Skip to content

Commit 937f73c

Browse files
committed
Fix tsconfig issue in bench
1 parent 76452d4 commit 937f73c

File tree

7 files changed

+14
-28
lines changed

7 files changed

+14
-28
lines changed

packages/bench/object-moltar.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ console.log(z3Schema.parse(DATA[0]));
9494
console.log(z4Schema.parse(DATA[0]));
9595
console.log(z4LibSchema.parse(DATA[0]));
9696

97+
const inPlace = { inPlace: true }
9798

9899
const bench = metabench("z.object() safeParse", {
99100
zod3() {
@@ -104,7 +105,8 @@ const bench = metabench("z.object() safeParse", {
104105
},
105106
zod4(){
106107
for (const _ of DATA) z4Schema.parse(_);
107-
}
108+
},
109+
108110
// zod4strict() {
109111
// for (const _ of DATA) z4SchemaStrict.parse(_);
110112
// },

packages/bench/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"valibot": "^1.0.0",
88
"zod": "workspace:*",
99
"zod3": "npm:zod@~3.24.0",
10-
"zod4": "npm:zod@4.0.8"
10+
"zod4": "npm:zod@4.0.8",
11+
"@types/node": "^22.10.5"
1112
},
1213
"scripts": {
1314
"bench": "tsx --conditions @zod/source index.ts"

packages/bench/tsconfig.bench.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../.configs/tsconfig.base.json",
2+
"extends": "../../.configs/tsconfig.base.json",
33
"compilerOptions": {
44
"noEmit": true,
55
"extendedDiagnostics": true,

packages/bench/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../.configs/tsconfig.base.json",
2+
"extends": "../../.configs/tsconfig.base.json",
33
"compilerOptions": {
44
"noEmit": true,
55
"extendedDiagnostics": true,

packages/zod/src/v4/core/schemas.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
18621862

18631863
const proms: Promise<any>[] = [];
18641864
const shape = value.shape;
1865+
18651866
for (const key of value.keys) {
18661867
const el = shape[key]!;
18671868
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
@@ -1907,7 +1908,7 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
19071908
}
19081909

19091910
// A: preserve key order {
1910-
doc.write(`const newResult = {}`);
1911+
doc.write(`const newResult = {};`);
19111912
for (const key of normalized.keys) {
19121913
const id = ids[key];
19131914
const k = util.esc(key);
@@ -1920,13 +1921,15 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
19201921
})));
19211922
}
19221923
1924+
19231925
if (${id}.value === undefined) {
19241926
if (${k} in input) {
19251927
newResult[${k}] = undefined;
19261928
}
19271929
} else {
19281930
newResult[${k}] = ${id}.value;
19291931
}
1932+
19301933
`);
19311934
}
19321935

play.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)