Skip to content

Commit

Permalink
fix(template): 修复属性默认值为true时无法改为false问题 (NervJS#17152,NervJS#16903)
Browse files Browse the repository at this point in the history
* fix: extend the judgment logic of isBooleanStringLiteral

* fix(template): updateSnapshot

---------

Co-authored-by: Shijie Yu <[email protected]>
  • Loading branch information
2 people authored and ianzone committed Feb 28, 2025
1 parent 796731f commit c080be4
Show file tree
Hide file tree
Showing 15 changed files with 2,117 additions and 2,117 deletions.
2 changes: 1 addition & 1 deletion packages/shared/src/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function isNumber (o: unknown): o is number {
}

export function isBooleanStringLiteral (o: unknown): o is string {
return o === 'true' || o === 'false'
return o === 'true' || o === 'false' || o === '!0' || o === '!1'
}

export function isObjectStringLiteral (o: unknown): o is string {
Expand Down
144 changes: 72 additions & 72 deletions tests/__tests__/__snapshots__/babel.spec.ts.snap

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions tests/__tests__/__snapshots__/compiler-macros.spec.ts.snap

Large diffs are not rendered by default.

752 changes: 376 additions & 376 deletions tests/__tests__/__snapshots__/config.spec.ts.snap

Large diffs are not rendered by default.

288 changes: 144 additions & 144 deletions tests/__tests__/__snapshots__/css-modules.spec.ts.snap

Large diffs are not rendered by default.

388 changes: 194 additions & 194 deletions tests/__tests__/__snapshots__/framework.spec.ts.snap

Large diffs are not rendered by default.

258 changes: 129 additions & 129 deletions tests/__tests__/__snapshots__/mini-platform.spec.ts.snap

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions tests/__tests__/__snapshots__/parse-html.spec.ts.snap

Large diffs are not rendered by default.

432 changes: 216 additions & 216 deletions tests/__tests__/__snapshots__/prerender.spec.ts.snap

Large diffs are not rendered by default.

720 changes: 360 additions & 360 deletions tests/__tests__/__snapshots__/sass.spec.ts.snap

Large diffs are not rendered by default.

194 changes: 97 additions & 97 deletions tests/__tests__/__snapshots__/skyline.spec.ts.snap

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions tests/__tests__/__snapshots__/subpackages.spec.ts.snap

Large diffs are not rendered by default.

334 changes: 167 additions & 167 deletions tests/__tests__/__snapshots__/tabbar.spec.ts.snap

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions tests/__tests__/__snapshots__/ts.spec.ts.snap

Large diffs are not rendered by default.

146 changes: 73 additions & 73 deletions tests/__tests__/__snapshots__/wx-hybrid.spec.ts.snap

Large diffs are not rendered by default.

0 comments on commit c080be4

Please sign in to comment.