Skip to content

Commit f9a84d1

Browse files
erweixintutuxxx
andauthored
fix(template): 修复属性默认值为true时无法改为false问题 (#17152,#16903)
* fix: extend the judgment logic of isBooleanStringLiteral * fix(template): updateSnapshot --------- Co-authored-by: Shijie Yu <[email protected]>
1 parent f180604 commit f9a84d1

15 files changed

+2117
-2117
lines changed

packages/shared/src/is.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function isNumber (o: unknown): o is number {
2828
}
2929

3030
export function isBooleanStringLiteral (o: unknown): o is string {
31-
return o === 'true' || o === 'false'
31+
return o === 'true' || o === 'false' || o === '!0' || o === '!1'
3232
}
3333

3434
export function isObjectStringLiteral (o: unknown): o is string {

tests/__tests__/__snapshots__/babel.spec.ts.snap

+72-72
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/compiler-macros.spec.ts.snap

+72-72
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/config.spec.ts.snap

+376-376
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/css-modules.spec.ts.snap

+144-144
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/framework.spec.ts.snap

+194-194
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/mini-platform.spec.ts.snap

+129-129
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/parse-html.spec.ts.snap

+72-72
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/prerender.spec.ts.snap

+216-216
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/sass.spec.ts.snap

+360-360
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/skyline.spec.ts.snap

+97-97
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/subpackages.spec.ts.snap

+72-72
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/tabbar.spec.ts.snap

+167-167
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/ts.spec.ts.snap

+72-72
Large diffs are not rendered by default.

tests/__tests__/__snapshots__/wx-hybrid.spec.ts.snap

+73-73
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)