fix check boolean

This commit is contained in:
codetypes committed 2025-11-11 10:40:29 +08:00
1 parent e4cfab885a
commit 6ae27c50a0
3 files changed
+117 -242

No files matched your search

+113 -239
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "behavior3editor", "name": "behavior3editor",
"version": "1.8.8", "version": "1.8.9",
"main": "dist-electron/main/index.js", "main": "dist-electron/main/index.js",
"description": "行为树编辑器", "description": "行为树编辑器",
"author": "zhandouxiaojiji & codetypes", "author": "zhandouxiaojiji & codetypes",
+3 -2
View File
@@ -252,8 +252,9 @@ export const checkNodeArgValue = (
hasError = true; hasError = true;
} }
} else if (isBoolType(type)) { } else if (isBoolType(type)) {
const isBool = typeof value === "boolean" || value === undefined; const isBool = typeof value === "boolean";
if (!isBool) { const isOptional = value === undefined && isNodeArgOptional(arg);
if (!(isBool || isOptional)) {
error(`'${arg.name}=${JSON.stringify(value)}' is not a boolean`); error(`'${arg.name}=${JSON.stringify(value)}' is not a boolean`);
hasError = true; hasError = true;
} }