Skip to content

Commit

Permalink
fix: extend the judgment logic of isBooleanStringLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
erweixin committed Jan 10, 2025
1 parent 6964768 commit 44e1750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared/src/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44e1750

Please sign in to comment.