Skip to content

Commit

Permalink
fix(getComponentDocInfo): use crossplatform path check
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Jun 28, 2016
1 parent d873d2c commit 8ac307f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/app/utils/getComponentDocInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 8ac307f

Please sign in to comment.