check key words

This commit is contained in:
codetypes committed 2025-07-31 16:19:53 +08:00
1 parent 6575515305
commit 8bee70fc9a
4 files changed
+8 -5

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ import {
isIntType,
isJsonType,
isStringType,
keyWords,
NodeArg,
NodeData,
TreeData,
@@ -141,7 +142,7 @@ export const isNewVersion = (version: string) => {
};
export const isValidVariableName = (name: string) => {
return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name);
return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name) && !keyWords.includes(name);
};
export const isSubtreeRoot = (data: NodeData) => {