From 44e17504c4b19e4588a9d596f80d73f5b92d21f5 Mon Sep 17 00:00:00 2001 From: erweixin <2991552132@qq.com> Date: Fri, 10 Jan 2025 12:34:47 +0800 Subject: [PATCH] fix: extend the judgment logic of isBooleanStringLiteral --- packages/shared/src/is.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shared/src/is.ts b/packages/shared/src/is.ts index 347da6e1af32..a3d9f26454df 100644 --- a/packages/shared/src/is.ts +++ b/packages/shared/src/is.ts @@ -27,8 +27,8 @@ export function isNumber (o: unknown): o is number { return typeof o === 'number' } -export function isBooleanStringLiteral (o: unknown): o is string { - return o === 'true' || o === 'false' +export function isBooleanStringLiteral (o: unknown): o is boolean { + return o === 'true' || o === 'false' || o === '!0' || o === '!1' } export function isObjectStringLiteral (o: unknown): o is string {