From 8ac307f96a5ceb08c395b3bb9f7dbfb997c38cbb Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Tue, 28 Jun 2016 13:03:29 -0700 Subject: [PATCH] fix(getComponentDocInfo): use crossplatform path check --- docs/app/utils/getComponentDocInfo.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/app/utils/getComponentDocInfo.js b/docs/app/utils/getComponentDocInfo.js index 0e689ac972..54bd381be1 100644 --- a/docs/app/utils/getComponentDocInfo.js +++ b/docs/app/utils/getComponentDocInfo.js @@ -2,13 +2,15 @@ import _ from 'lodash' import docgenInfo from '../docgenInfo.json' /** - * This util extracts and formats a doc object from docgenInfo.json for a single `component` and merges it with - * the component's meta information. + * This util extracts and formats a doc object from docgenInfo.json for a single `component`. * @param {string} _meta Stardust component _meta object. * @returns {{}} Documentation object. */ export default (_meta) => { - const docPath = _.find(_.keys(docgenInfo), path => path.includes(`/${_meta.name}.js`)) + const docPath = _.find(_.keys(docgenInfo), path => { + const re = new RegExp(`${_meta.name}.js$`) + return re.test(path) + }) const docgen = docgenInfo[docPath] return { docPath, docgen }