Skip to content

Commit 969d174

Browse files
committed
fix: variable undefined check
1 parent 8cebc40 commit 969d174

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

api/src/bundler/plugins/remark-undeclared-variables.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ export default function remarkUndeclaredVariables(): (ast: Node) => void {
3636
}
3737
}
3838

39-
const undeclared: string[] = [];
40-
4139
function visitorForUndeclared(node: UnDeclaredNode) {
42-
if (!declared.includes(node.value)) {
43-
undeclared.push(node.value);
40+
if (node.value && !declared.includes(node.value)) {
4441
node.type = 'text';
4542
node.data = undefined;
4643
node.value = `\{${node.value}\}`;

0 commit comments

Comments
 (0)