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

+3 -2
View File
@@ -252,8 +252,9 @@ export const checkNodeArgValue = (
hasError = true;
}
} else if (isBoolType(type)) {
const isBool = typeof value === "boolean" || value === undefined;
if (!isBool) {
const isBool = typeof value === "boolean";
const isOptional = value === undefined && isNodeArgOptional(arg);
if (!(isBool || isOptional)) {
error(`'${arg.name}=${JSON.stringify(value)}' is not a boolean`);
hasError = true;
}