diff --git a/core/docz-core/src/states/props.ts b/core/docz-core/src/states/props.ts index 1286f36cd..d77b16330 100644 --- a/core/docz-core/src/states/props.ts +++ b/core/docz-core/src/states/props.ts @@ -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)