check key words
This commit is contained in:
1 parent
6575515305
commit
8bee70fc9a
4 files changed
+8
-5
No files matched your search
+2
-1
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user