Skip to content

Commit c59fa5b

Browse files
jlengstorfChristopherBiscardi
authored andcommitted
fix: add null check for codeScopeAbsPaths (#219)
1 parent 4bafcba commit c59fa5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/gatsby-plugin-mdx/component-with-mdx-scope.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = function componentWithMDXScope(
1515
codeScopeAbsPaths = [],
1616
projectRoot = process.cwd()
1717
) {
18-
if (typeof codeScopeAbsPaths === "string") {
19-
codeScopeAbsPaths = [codeScopeAbsPaths];
18+
if (!(codeScopeAbsPaths instanceof Array)) {
19+
codeScopeAbsPaths = [codeScopeAbsPaths].filter(Boolean);
2020
}
2121
const isTS = absWrapperPath.endsWith(".ts");
2222
const isTSX = absWrapperPath.endsWith(".tsx");

0 commit comments

Comments
 (0)