Skip to content

Commit 622806f

Browse files
LeoYuaneternalsky
authored andcommitted
fix(code-gen): fix types error
1 parent 03495ba commit 622806f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/code-generator/src/utils/expressionParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function parseExpressionGetKeywords(expr: string | null | undefined): str
167167
],
168168
});
169169

170-
const addIdentifierIfNeeded = (x: Record<string, unknown> | number | null | undefined) => {
170+
const addIdentifierIfNeeded = (x: Node | null | undefined) => {
171171
if (typeof x === 'object' && isIdentifier(x) && JS_KEYWORDS.includes(x.name)) {
172172
keywordVars.add(x.name);
173173
}
@@ -189,7 +189,7 @@ export function parseExpressionGetKeywords(expr: string | null | undefined): str
189189
addIdentifierIfNeeded(item);
190190
});
191191
} else {
192-
addIdentifierIfNeeded(fieldValue as Record<string, unknown> | null);
192+
addIdentifierIfNeeded(fieldValue as any);
193193
}
194194
}
195195
});
@@ -217,7 +217,7 @@ export function parseExpressionGetGlobalVariables(
217217
const ast = parser.parse(`!(${expr});`);
218218

219219
const addUndeclaredIdentifierIfNeeded = (
220-
x: Record<string, unknown> | number | null | undefined,
220+
x: Node | null | undefined,
221221
path: NodePath<Node>,
222222
) => {
223223
if (typeof x === 'object' && isIdentifier(x) && !path.scope.hasBinding(x.name)) {
@@ -241,7 +241,7 @@ export function parseExpressionGetGlobalVariables(
241241
addUndeclaredIdentifierIfNeeded(item, path);
242242
});
243243
} else {
244-
addUndeclaredIdentifierIfNeeded(fieldValue as Record<string, unknown> | null, path);
244+
addUndeclaredIdentifierIfNeeded(fieldValue as any, path);
245245
}
246246
}
247247
});

0 commit comments

Comments
 (0)