Skip to content

Commit

Permalink
fix(babelParse.ts): in mergedParserOptions, return empty array as Sym…
Browse files Browse the repository at this point in the history
…bol.iterator() value if parserOptions.plugins is undefined
  • Loading branch information
usrrname committed Apr 28, 2023
1 parent af26a45 commit 640c4a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/lib/csf-tools/src/babelParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function parseWithFlowOrTypescript(source: string, parserOptions: babelParser.Pa
// Merge the provided parserOptions with the custom parser plugins
const mergedParserOptions = {
...parserOptions,
plugins: [...parserOptions.plugins, ...parserPlugins],
plugins: [...(parserOptions.plugins ?? []), ...parserPlugins],
};

return babelParser.parse(source, mergedParserOptions);
Expand Down

0 comments on commit 640c4a3

Please sign in to comment.