Skip to content

Commit

Permalink
fix(docz-core): props state parser
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Feb 22, 2019
1 parent 6e5a158 commit 87767e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/docz-core/src/states/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ const getPattern = (ts: boolean) => {
return [ts ? tsPattern : jsPattern, '!**/node_modules']
}

export const mapToArray = (map: any) =>
Object.entries(map).map(([key, value]) => ({ key, value }))
export const mapToArray = (map: any = []) =>
Object.entries(map)
.map(entry => entry && { key: entry[0], value: entry[1] })
.filter(Boolean)

const initial = (config: Config) => async (p: Params) => {
const pattern = getPattern(config.typescript)
Expand Down

0 comments on commit 87767e8

Please sign in to comment.