zod-compiler 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -588
- package/dist/cli/commands/generate.d.ts +0 -2
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +0 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/watch.d.ts +0 -1
- package/dist/cli/commands/watch.d.ts.map +1 -1
- package/dist/cli/commands/watch.js +0 -2
- package/dist/cli/commands/watch.js.map +1 -1
- package/dist/cli/index.js +0 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/core/codegen/build-path.d.ts +40 -0
- package/dist/core/codegen/build-path.d.ts.map +1 -0
- package/dist/core/codegen/build-path.js +473 -0
- package/dist/core/codegen/build-path.js.map +1 -0
- package/dist/core/codegen/context.d.ts +77 -3
- package/dist/core/codegen/context.d.ts.map +1 -1
- package/dist/core/codegen/context.js +68 -33
- package/dist/core/codegen/context.js.map +1 -1
- package/dist/core/codegen/dedupe.d.ts +7 -0
- package/dist/core/codegen/dedupe.d.ts.map +1 -1
- package/dist/core/codegen/dedupe.js +7 -0
- package/dist/core/codegen/dedupe.js.map +1 -1
- package/dist/core/codegen/fast-path.d.ts.map +1 -1
- package/dist/core/codegen/fast-path.js +11 -5
- package/dist/core/codegen/fast-path.js.map +1 -1
- package/dist/core/codegen/index.d.ts.map +1 -1
- package/dist/core/codegen/index.js +89 -5
- package/dist/core/codegen/index.js.map +1 -1
- package/dist/core/codegen/regex-unroll.d.ts +36 -0
- package/dist/core/codegen/regex-unroll.d.ts.map +1 -0
- package/dist/core/codegen/regex-unroll.js +231 -0
- package/dist/core/codegen/regex-unroll.js.map +1 -0
- package/dist/core/codegen/schemas/array.d.ts.map +1 -1
- package/dist/core/codegen/schemas/array.js +4 -3
- package/dist/core/codegen/schemas/array.js.map +1 -1
- package/dist/core/codegen/schemas/default.d.ts.map +1 -1
- package/dist/core/codegen/schemas/default.js +2 -4
- package/dist/core/codegen/schemas/default.js.map +1 -1
- package/dist/core/codegen/schemas/discriminated-union.d.ts.map +1 -1
- package/dist/core/codegen/schemas/discriminated-union.js +3 -3
- package/dist/core/codegen/schemas/discriminated-union.js.map +1 -1
- package/dist/core/codegen/schemas/map.js +2 -2
- package/dist/core/codegen/schemas/map.js.map +1 -1
- package/dist/core/codegen/schemas/nullable.d.ts.map +1 -1
- package/dist/core/codegen/schemas/nullable.js +2 -4
- package/dist/core/codegen/schemas/nullable.js.map +1 -1
- package/dist/core/codegen/schemas/object.d.ts.map +1 -1
- package/dist/core/codegen/schemas/object.js +10 -9
- package/dist/core/codegen/schemas/object.js.map +1 -1
- package/dist/core/codegen/schemas/optional.d.ts.map +1 -1
- package/dist/core/codegen/schemas/optional.js +3 -5
- package/dist/core/codegen/schemas/optional.js.map +1 -1
- package/dist/core/codegen/schemas/record.js +2 -2
- package/dist/core/codegen/schemas/record.js.map +1 -1
- package/dist/core/codegen/schemas/set.d.ts.map +1 -1
- package/dist/core/codegen/schemas/set.js +4 -3
- package/dist/core/codegen/schemas/set.js.map +1 -1
- package/dist/core/codegen/schemas/string.d.ts.map +1 -1
- package/dist/core/codegen/schemas/string.js +2 -2
- package/dist/core/codegen/schemas/string.js.map +1 -1
- package/dist/core/codegen/schemas/template-literal.d.ts.map +1 -1
- package/dist/core/codegen/schemas/template-literal.js +9 -1
- package/dist/core/codegen/schemas/template-literal.js.map +1 -1
- package/dist/core/codegen/schemas/tuple.d.ts.map +1 -1
- package/dist/core/codegen/schemas/tuple.js +4 -3
- package/dist/core/codegen/schemas/tuple.js.map +1 -1
- package/dist/core/codegen/well-known-regex.d.ts +22 -4
- package/dist/core/codegen/well-known-regex.d.ts.map +1 -1
- package/dist/core/codegen/well-known-regex.js +27 -5
- package/dist/core/codegen/well-known-regex.js.map +1 -1
- package/dist/core/extract/extractors/object.d.ts.map +1 -1
- package/dist/core/extract/extractors/object.js +11 -5
- package/dist/core/extract/extractors/object.js.map +1 -1
- package/dist/core/extract/index.d.ts +3 -3
- package/dist/core/extract/index.d.ts.map +1 -1
- package/dist/core/extract/index.js +2 -2
- package/dist/core/extract/index.js.map +1 -1
- package/dist/core/extract/registry.d.ts +2 -2
- package/dist/core/extract/registry.d.ts.map +1 -1
- package/dist/core/extract/registry.js +4 -5
- package/dist/core/extract/registry.js.map +1 -1
- package/dist/core/extract/types.d.ts +0 -11
- package/dist/core/extract/types.d.ts.map +1 -1
- package/dist/core/iife.d.ts.map +1 -1
- package/dist/core/iife.js +3 -2
- package/dist/core/iife.js.map +1 -1
- package/dist/core/pipeline.d.ts +0 -2
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +1 -3
- package/dist/core/pipeline.js.map +1 -1
- package/dist/swc.d.ts.map +1 -1
- package/dist/swc.js +0 -1
- package/dist/swc.js.map +1 -1
- package/dist/unplugin/hoist-compile.d.ts +1 -1
- package/dist/unplugin/hoist-compile.d.ts.map +1 -1
- package/dist/unplugin/hoist-compile.js +4 -4
- package/dist/unplugin/hoist-compile.js.map +1 -1
- package/dist/unplugin/index.d.ts.map +1 -1
- package/dist/unplugin/index.js +0 -3
- package/dist/unplugin/index.js.map +1 -1
- package/dist/unplugin/transform.d.ts.map +1 -1
- package/dist/unplugin/transform.js +1 -2
- package/dist/unplugin/transform.js.map +1 -1
- package/dist/unplugin/types.d.ts +0 -23
- package/dist/unplugin/types.d.ts.map +1 -1
- package/dist/unplugin/types.js.map +1 -1
- package/dist/unplugin/virtual.d.ts.map +1 -1
- package/dist/unplugin/virtual.js +11 -7
- package/dist/unplugin/virtual.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Path: one uninstrumented pass that VALIDATES and BUILDS the stripped
|
|
3
|
+
* output together, abandoning the whole parse at the first failing check.
|
|
4
|
+
*
|
|
5
|
+
* `z.object()` strips unknown keys, so a successful parse cannot return the
|
|
6
|
+
* input by reference — it must produce a fresh object. That rules out the Fast
|
|
7
|
+
* Path (whose contract is `data === input`), and before this the only remaining
|
|
8
|
+
* option was the eager slow walk: a fully instrumented traversal that collects
|
|
9
|
+
* issues on every parse, valid or not.
|
|
10
|
+
*
|
|
11
|
+
* Two passes are wasteful in either direction. Validating first and building
|
|
12
|
+
* afterwards reads every property twice (measured 29.7 ns vs 21.6 for the slow
|
|
13
|
+
* walk on a 6-field object). Building with issue collection pays the
|
|
14
|
+
* instrumentation even when nothing fails. Doing both in ONE pass, with a
|
|
15
|
+
* sentinel instead of an issues array, beats both — and a failure costs only
|
|
16
|
+
* the checks up to the first bad one, because the issue-producing walk is
|
|
17
|
+
* deferred into `.error` exactly as `__zcFinD` does for mutation-free schemas:
|
|
18
|
+
*
|
|
19
|
+
* object clean object invalid array(8) invalid
|
|
20
|
+
* slow walk 21.6 ns 30.4 ns 197.5 ns
|
|
21
|
+
* build path 18.1 ns 7.7 ns 9.8 ns
|
|
22
|
+
*
|
|
23
|
+
* The generator is deliberately partial. A subtree that rebuilds nothing is
|
|
24
|
+
* validated with its existing Fast Path expression and passed through by
|
|
25
|
+
* reference, so only genuinely rebuilding containers need code here; anything
|
|
26
|
+
* else returns null and keeps the eager walk. Callers must also confirm
|
|
27
|
+
* {@link mutatesBeyondStrip} is false — coerce/default/transform/superRefine
|
|
28
|
+
* rewrite values, which this pass does not model.
|
|
29
|
+
*/
|
|
30
|
+
import { declareFastTemps, emitRuntimeHelper, emitTemp, escapeString, keyMembershipTest, rejectsUndefined, } from "./context.js";
|
|
31
|
+
import { createFastGen, generateFast } from "./fast-path.js";
|
|
32
|
+
import { EXTRACT_CAP, estimateFastCost, MIN_EXTRACT, predictedInlineSize } from "./fast-size.js";
|
|
33
|
+
import { ZC_HOP_DECL } from "./issue-decls.js";
|
|
34
|
+
/**
|
|
35
|
+
* Which nodes of `root` produce a value that is not their input — i.e. are, or
|
|
36
|
+
* contain, a stripping object. Everything else can be validated in place and
|
|
37
|
+
* passed through, which is what keeps this generator small.
|
|
38
|
+
*
|
|
39
|
+
* Computed as a fixpoint rather than a plain walk because of recursion: a
|
|
40
|
+
* `recursiveRef` is a back-edge with no children, so a local walk reads false
|
|
41
|
+
* for it and would pass the whole recursive subtree through by reference —
|
|
42
|
+
* leaving every nested value unstripped while the outermost one was rebuilt.
|
|
43
|
+
* Resolving the ref against its target closes the cycle, and iterating to a
|
|
44
|
+
* fixpoint settles the mutual dependency between the two.
|
|
45
|
+
*/
|
|
46
|
+
function rebuildSet(root) {
|
|
47
|
+
const targets = new Map([[0, root]]);
|
|
48
|
+
const nodes = [];
|
|
49
|
+
const seen = new Set();
|
|
50
|
+
const collect = (node) => {
|
|
51
|
+
if (seen.has(node))
|
|
52
|
+
return;
|
|
53
|
+
seen.add(node);
|
|
54
|
+
nodes.push(node);
|
|
55
|
+
if (node.type === "recursionTarget")
|
|
56
|
+
targets.set(node.refId, node.inner);
|
|
57
|
+
for (const child of children(node))
|
|
58
|
+
collect(child);
|
|
59
|
+
};
|
|
60
|
+
collect(root);
|
|
61
|
+
const rebuilds = new Set();
|
|
62
|
+
for (let changed = true; changed;) {
|
|
63
|
+
changed = false;
|
|
64
|
+
for (const node of nodes) {
|
|
65
|
+
if (rebuilds.has(node))
|
|
66
|
+
continue;
|
|
67
|
+
const target = node.type === "recursiveRef" ? targets.get(node.refId ?? 0) : undefined;
|
|
68
|
+
const rebuild = (node.type === "object" && node.stripUnknownKeys === true) ||
|
|
69
|
+
(target !== undefined && rebuilds.has(target)) ||
|
|
70
|
+
children(node).some((child) => rebuilds.has(child));
|
|
71
|
+
if (rebuild) {
|
|
72
|
+
rebuilds.add(node);
|
|
73
|
+
changed = true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return rebuilds;
|
|
78
|
+
}
|
|
79
|
+
/** Does `ir`, taken as a whole schema, produce a value that is not its input? */
|
|
80
|
+
export function rebuildsOutput(ir) {
|
|
81
|
+
return rebuildSet(ir).has(ir);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* True when the subtree mutates for any reason OTHER than stripping — coerce,
|
|
85
|
+
* `.default()`, `.catch()`, `.transform()`, `.trim()`, `superRefine`. Those
|
|
86
|
+
* rewrite values rather than merely reshaping objects, so the build pass (which
|
|
87
|
+
* only ever copies validated values) cannot reproduce them and the schema keeps
|
|
88
|
+
* the eager walk.
|
|
89
|
+
*/
|
|
90
|
+
function mutatesBeyondStrip(ir) {
|
|
91
|
+
return mutatesHere(ir) || children(ir).some(mutatesBeyondStrip);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Does this node rewrite values on its own account (ignoring its children, and
|
|
95
|
+
* ignoring the reshaping a strip object does)? Mirrors the node-local half of
|
|
96
|
+
* `hasMutation`; the recursion above supplies the other half.
|
|
97
|
+
*/
|
|
98
|
+
function mutatesHere(ir) {
|
|
99
|
+
switch (ir.type) {
|
|
100
|
+
case "string":
|
|
101
|
+
return (ir.coerce === true ||
|
|
102
|
+
superRefines(ir.checks) ||
|
|
103
|
+
ir.checks.some((c) => c.kind === "overwrite_effect" || (c.kind === "string_format" && c.format === "url")));
|
|
104
|
+
case "number":
|
|
105
|
+
return ir.coerce === true || superRefines(ir.checks);
|
|
106
|
+
case "boolean":
|
|
107
|
+
case "bigint":
|
|
108
|
+
case "date":
|
|
109
|
+
return ir.coerce === true;
|
|
110
|
+
case "default":
|
|
111
|
+
case "catch":
|
|
112
|
+
case "effect":
|
|
113
|
+
case "fallback":
|
|
114
|
+
case "stringBool":
|
|
115
|
+
return true;
|
|
116
|
+
case "object":
|
|
117
|
+
case "array":
|
|
118
|
+
return superRefines(ir.checks);
|
|
119
|
+
default:
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function superRefines(checks) {
|
|
124
|
+
return checks !== undefined && checks.some((c) => c.kind === "super_refine_effect");
|
|
125
|
+
}
|
|
126
|
+
function children(ir) {
|
|
127
|
+
switch (ir.type) {
|
|
128
|
+
case "object":
|
|
129
|
+
return ir.catchall
|
|
130
|
+
? [...Object.values(ir.properties), ir.catchall]
|
|
131
|
+
: Object.values(ir.properties);
|
|
132
|
+
case "array":
|
|
133
|
+
return [ir.element];
|
|
134
|
+
case "tuple":
|
|
135
|
+
return ir.rest === null ? ir.items : [...ir.items, ir.rest];
|
|
136
|
+
case "record":
|
|
137
|
+
case "map":
|
|
138
|
+
return [ir.keyType, ir.valueType];
|
|
139
|
+
case "set":
|
|
140
|
+
return [ir.valueType];
|
|
141
|
+
case "union":
|
|
142
|
+
case "discriminatedUnion":
|
|
143
|
+
return ir.options;
|
|
144
|
+
case "intersection":
|
|
145
|
+
return [ir.left, ir.right];
|
|
146
|
+
case "optional":
|
|
147
|
+
case "nullable":
|
|
148
|
+
case "readonly":
|
|
149
|
+
case "default":
|
|
150
|
+
case "catch":
|
|
151
|
+
case "effect":
|
|
152
|
+
case "recursionTarget":
|
|
153
|
+
return [ir.inner];
|
|
154
|
+
case "pipe":
|
|
155
|
+
return [ir.in, ir.out];
|
|
156
|
+
default:
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Host the whole schema as `function NAME(input){…}` returning the built value
|
|
162
|
+
* or the FAIL sentinel. Returns the function name, or null when the schema is
|
|
163
|
+
* not expressible as a single build pass.
|
|
164
|
+
*/
|
|
165
|
+
export function generateBuild(ir, ctx) {
|
|
166
|
+
const rebuilds = rebuildSet(ir);
|
|
167
|
+
if (!rebuilds.has(ir) || mutatesBeyondStrip(ir))
|
|
168
|
+
return null;
|
|
169
|
+
const fail = emitFailSentinel(ctx);
|
|
170
|
+
const scope = { temps: [], used: 0 };
|
|
171
|
+
const built = build(ir, "input", { ctx, extractable: false, fail, rebuilds, scope });
|
|
172
|
+
if (built === null)
|
|
173
|
+
return null;
|
|
174
|
+
const name = emitTemp(ctx, "vb");
|
|
175
|
+
ctx.preamble.push(`function ${name}(input){${declareFastTemps(scope)}${built.code}return ${built.value};}`);
|
|
176
|
+
return name;
|
|
177
|
+
}
|
|
178
|
+
/** One `{}` per validator, compared by identity — no parse output can equal it. */
|
|
179
|
+
function emitFailSentinel(ctx) {
|
|
180
|
+
if (ctx.buildFailName === undefined) {
|
|
181
|
+
ctx.buildFailName = `__bf_${ctx.counter++}`;
|
|
182
|
+
ctx.preamble.push(`var ${ctx.buildFailName}={};`);
|
|
183
|
+
}
|
|
184
|
+
return ctx.buildFailName;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Statements producing the built value of `ir` read from `input`, or null.
|
|
188
|
+
*
|
|
189
|
+
* Size-gated exactly like the fast path: once inlining `ir` would push the
|
|
190
|
+
* function being assembled past EXTRACT_CAP, the sub-build is hosted as its own
|
|
191
|
+
* `__vb_N(p)` returning value-or-FAIL and replaced by a call. Without this a
|
|
192
|
+
* deeply nested schema emits one enormous build function — measured at 113 KB
|
|
193
|
+
* and 354 KB on the deep fixtures — far past the bytecode size where V8 stops
|
|
194
|
+
* running TurboFan on it, which would forfeit the speed this path exists for.
|
|
195
|
+
*/
|
|
196
|
+
function build(ir, input, g) {
|
|
197
|
+
// Resolved before the passthrough shortcut below. A back-edge carries no
|
|
198
|
+
// children, so `rebuildsOutput` reads false for it — and passing it through by
|
|
199
|
+
// reference would leave every nested recursive value unstripped while the
|
|
200
|
+
// outermost one was rebuilt.
|
|
201
|
+
if (ir.type === "recursiveRef")
|
|
202
|
+
return buildRecursiveCall(ir.refId ?? 0, input, g);
|
|
203
|
+
if (ir.type === "recursionTarget")
|
|
204
|
+
return buildRecursionTarget(ir, input, g);
|
|
205
|
+
if (!g.rebuilds.has(ir))
|
|
206
|
+
return passthrough(ir, input, g);
|
|
207
|
+
const cache = (g.ctx.fastSizeCache ??= new WeakMap());
|
|
208
|
+
if (g.extractable &&
|
|
209
|
+
g.scope.used + predictedInlineSize(ir, input.length, cache) > EXTRACT_CAP &&
|
|
210
|
+
(g.scope.used > EXTRACT_CAP || estimateFastCost(ir, cache) >= MIN_EXTRACT)) {
|
|
211
|
+
const hosted = hostBuild(ir, g);
|
|
212
|
+
if (hosted !== null) {
|
|
213
|
+
const slot = local(g, "bh");
|
|
214
|
+
const code = `${slot}=${hosted}(${input});if(${slot}===${g.fail})return ${g.fail};`;
|
|
215
|
+
g.scope.used += code.length;
|
|
216
|
+
return { code, value: slot };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// This node's extraction decision is made; its descendants get to make their
|
|
220
|
+
// own, so an oversized hosted helper keeps splitting.
|
|
221
|
+
const before = g.scope.used;
|
|
222
|
+
const out = buildInline(ir, input, { ...g, extractable: true });
|
|
223
|
+
if (out !== null)
|
|
224
|
+
g.scope.used = before + out.code.length;
|
|
225
|
+
return out;
|
|
226
|
+
}
|
|
227
|
+
/** Host `ir`'s build in its own function over a fresh parameter; returns its name. */
|
|
228
|
+
function hostBuild(ir, g) {
|
|
229
|
+
const param = emitTemp(g.ctx, "bp");
|
|
230
|
+
const scope = { temps: [], used: 0 };
|
|
231
|
+
const inner = build(ir, param, { ...g, extractable: false, scope });
|
|
232
|
+
if (inner === null)
|
|
233
|
+
return null;
|
|
234
|
+
const name = emitTemp(g.ctx, "vb");
|
|
235
|
+
g.ctx.preamble.push(`function ${name}(${param}){${declareFastTemps(scope)}${inner.code}return ${inner.value};}`);
|
|
236
|
+
return name;
|
|
237
|
+
}
|
|
238
|
+
function buildInline(ir, input, g) {
|
|
239
|
+
switch (ir.type) {
|
|
240
|
+
case "object":
|
|
241
|
+
return buildObject(ir, input, g);
|
|
242
|
+
case "array":
|
|
243
|
+
return buildArray(ir, input, g);
|
|
244
|
+
case "tuple":
|
|
245
|
+
return buildTuple(ir, input, g);
|
|
246
|
+
case "record":
|
|
247
|
+
return buildRecord(ir, input, g);
|
|
248
|
+
case "optional":
|
|
249
|
+
return buildSentinel(ir.inner, input, g, "===undefined", "undefined");
|
|
250
|
+
case "nullable":
|
|
251
|
+
return buildSentinel(ir.inner, input, g, "===null", "null");
|
|
252
|
+
case "readonly":
|
|
253
|
+
return build(ir.inner, input, g);
|
|
254
|
+
case "union":
|
|
255
|
+
case "discriminatedUnion":
|
|
256
|
+
return buildUnion(ir, input, g);
|
|
257
|
+
default:
|
|
258
|
+
// A rebuilding intersection, map or set: expressible in principle, but
|
|
259
|
+
// each needs its own output-shaping rules, so they keep the eager walk
|
|
260
|
+
// until there is a measured reason to add them.
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Host the target's build once under a name registered BEFORE its body is
|
|
266
|
+
* generated, so the back-edges inside that body resolve to it.
|
|
267
|
+
*/
|
|
268
|
+
function buildRecursionTarget(ir, input, g) {
|
|
269
|
+
const table = (g.ctx.buildRecNames ??= new Map());
|
|
270
|
+
if (!table.has(ir.refId)) {
|
|
271
|
+
const name = emitTemp(g.ctx, "vbr");
|
|
272
|
+
table.set(ir.refId, name);
|
|
273
|
+
const param = emitTemp(g.ctx, "bp");
|
|
274
|
+
const scope = { temps: [], used: 0 };
|
|
275
|
+
const inner = build(ir.inner, param, { ...g, extractable: false, scope });
|
|
276
|
+
if (inner === null) {
|
|
277
|
+
table.delete(ir.refId);
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
g.ctx.preamble.push(`function ${name}(${param}){${declareFastTemps(scope)}${inner.code}return ${inner.value};}`);
|
|
281
|
+
}
|
|
282
|
+
return buildRecursiveCall(ir.refId, input, g);
|
|
283
|
+
}
|
|
284
|
+
/** Call the hosted build for a recursion target, propagating its FAIL. */
|
|
285
|
+
function buildRecursiveCall(refId, input, g) {
|
|
286
|
+
const name = g.ctx.buildRecNames?.get(refId);
|
|
287
|
+
if (name === undefined)
|
|
288
|
+
return null;
|
|
289
|
+
const slot = local(g, "bh");
|
|
290
|
+
return {
|
|
291
|
+
code: `${slot}=${name}(${input});if(${slot}===${g.fail})return ${g.fail};`,
|
|
292
|
+
value: slot,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Try each option in declaration order and take the first that builds — which
|
|
297
|
+
* is what zod's union does with the first option that parses.
|
|
298
|
+
*
|
|
299
|
+
* Every option is HOSTED rather than inlined, and that is load-bearing: a
|
|
300
|
+
* failing build signals with `return FAIL`, which inside the enclosing function
|
|
301
|
+
* would abandon the whole parse instead of moving on to the next option. Behind
|
|
302
|
+
* a call, the same signal is just a value to test.
|
|
303
|
+
*
|
|
304
|
+
* A discriminated union gets the same treatment rather than a switch: the
|
|
305
|
+
* options still have to be probed by call, and its dispatch advantage is
|
|
306
|
+
* already spent by the enclosing container's own work.
|
|
307
|
+
*/
|
|
308
|
+
function buildUnion(ir, input, g) {
|
|
309
|
+
const hosted = [];
|
|
310
|
+
for (const option of ir.options) {
|
|
311
|
+
const fn = g.rebuilds.has(option) ? hostBuild(option, g) : hostPassthrough(option, g);
|
|
312
|
+
if (fn === null)
|
|
313
|
+
return null;
|
|
314
|
+
hosted.push(fn);
|
|
315
|
+
}
|
|
316
|
+
if (hosted.length === 0)
|
|
317
|
+
return null;
|
|
318
|
+
const out = local(g, "bu");
|
|
319
|
+
let code = `${out}=${hosted[0]}(${input});`;
|
|
320
|
+
for (const fn of hosted.slice(1)) {
|
|
321
|
+
code += `if(${out}===${g.fail}){${out}=${fn}(${input});}`;
|
|
322
|
+
}
|
|
323
|
+
code += `if(${out}===${g.fail})return ${g.fail};`;
|
|
324
|
+
return { code, value: out };
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Host a non-rebuilding option as `value-or-FAIL`, so a union can probe it with
|
|
328
|
+
* the same protocol as a rebuilding one.
|
|
329
|
+
*/
|
|
330
|
+
function hostPassthrough(ir, g) {
|
|
331
|
+
const param = emitTemp(g.ctx, "bp");
|
|
332
|
+
const scope = { temps: [], used: 0 };
|
|
333
|
+
const expr = generateFast(ir, createFastGen(param, g.ctx, true, scope));
|
|
334
|
+
if (expr === null)
|
|
335
|
+
return null;
|
|
336
|
+
const name = emitTemp(g.ctx, "vp");
|
|
337
|
+
g.ctx.preamble.push(`function ${name}(${param}){${declareFastTemps(scope)}return ${expr === "true" ? param : `(${expr})?${param}:${g.fail}`};}`);
|
|
338
|
+
return name;
|
|
339
|
+
}
|
|
340
|
+
/** Validate in place with the Fast Path and hand the input straight back. */
|
|
341
|
+
function passthrough(ir, input, g) {
|
|
342
|
+
const scoped = createFastGen(input, g.ctx, true, g.scope);
|
|
343
|
+
const expr = generateFast(ir, scoped);
|
|
344
|
+
if (expr === null)
|
|
345
|
+
return null;
|
|
346
|
+
return { code: expr === "true" ? "" : `if(!(${expr}))return ${g.fail};`, value: input };
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Rebuild from the declared keys. Sound for a stripping object (that IS the
|
|
350
|
+
* output) and for a strict one (unknown keys are rejected, so the declared keys
|
|
351
|
+
* are the whole key set). A loose object or one with a `.catchall()` keeps keys
|
|
352
|
+
* this pass does not enumerate, so those bail.
|
|
353
|
+
*/
|
|
354
|
+
function buildObject(ir, input, g) {
|
|
355
|
+
if (ir.catchall !== undefined)
|
|
356
|
+
return null;
|
|
357
|
+
if (ir.stripUnknownKeys !== true && ir.strict !== true)
|
|
358
|
+
return null;
|
|
359
|
+
if (ir.checks !== undefined && ir.checks.length > 0)
|
|
360
|
+
return null;
|
|
361
|
+
if (ir.suppressAbsentKeys !== undefined && ir.suppressAbsentKeys.length > 0)
|
|
362
|
+
return null;
|
|
363
|
+
let code = `if(typeof ${input}!=="object"||${input}===null||Array.isArray(${input}))return ${g.fail};`;
|
|
364
|
+
if (ir.strict === true) {
|
|
365
|
+
const keyVar = local(g, "bk");
|
|
366
|
+
code += `for(${keyVar} in ${input}){if(!(${keyMembershipTest(g.ctx, Object.keys(ir.properties), keyVar)}))return ${g.fail};}`;
|
|
367
|
+
}
|
|
368
|
+
const slots = [];
|
|
369
|
+
for (const [key, propIR] of Object.entries(ir.properties)) {
|
|
370
|
+
const keyStr = escapeString(key);
|
|
371
|
+
const slot = local(g, "bv");
|
|
372
|
+
code += `${slot}=${input}[${keyStr}];`;
|
|
373
|
+
const propBuilt = build(propIR, slot, g);
|
|
374
|
+
if (propBuilt === null)
|
|
375
|
+
return null;
|
|
376
|
+
code += propBuilt.code;
|
|
377
|
+
slots.push({ always: rejectsUndefined(propIR), keyStr, value: propBuilt.value });
|
|
378
|
+
}
|
|
379
|
+
// Same assembly the eager strip walk uses: the longest LEADING run of
|
|
380
|
+
// always-present keys goes into one object literal (V8 stamps it from a
|
|
381
|
+
// cached boilerplate map in a single allocation), and everything after the
|
|
382
|
+
// first conditional key is appended so insertion order still matches zod.
|
|
383
|
+
// The per-key test is zod's own — keep the key when the parsed value is
|
|
384
|
+
// defined, or when it was present on the input at all.
|
|
385
|
+
const out = local(g, "bo");
|
|
386
|
+
const literal = [];
|
|
387
|
+
let appends = "";
|
|
388
|
+
let leading = true;
|
|
389
|
+
for (const slot of slots) {
|
|
390
|
+
if (leading && slot.always) {
|
|
391
|
+
literal.push(`${slot.keyStr}:${slot.value}`);
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
leading = false;
|
|
395
|
+
appends += slot.always
|
|
396
|
+
? `${out}[${slot.keyStr}]=${slot.value};`
|
|
397
|
+
: `if(${slot.value}!==undefined||(${slot.keyStr} in ${input})){${out}[${slot.keyStr}]=${slot.value};}`;
|
|
398
|
+
}
|
|
399
|
+
code += `${out}={${literal.join(",")}};${appends}`;
|
|
400
|
+
return { code, value: out };
|
|
401
|
+
}
|
|
402
|
+
function buildArray(ir, input, g) {
|
|
403
|
+
if (ir.checks.length > 0)
|
|
404
|
+
return null;
|
|
405
|
+
const out = local(g, "ba");
|
|
406
|
+
const index = local(g, "bi");
|
|
407
|
+
const elem = local(g, "be");
|
|
408
|
+
const inner = build(ir.element, elem, g);
|
|
409
|
+
if (inner === null)
|
|
410
|
+
return null;
|
|
411
|
+
const code = `if(!Array.isArray(${input}))return ${g.fail};` +
|
|
412
|
+
`${out}=new Array(${input}.length);` +
|
|
413
|
+
`for(${index}=0;${index}<${input}.length;${index}++){` +
|
|
414
|
+
`${elem}=${input}[${index}];${inner.code}${out}[${index}]=${inner.value};}`;
|
|
415
|
+
return { code, value: out };
|
|
416
|
+
}
|
|
417
|
+
function buildTuple(ir, input, g) {
|
|
418
|
+
// Trailing-optional and rest handling shape the output length; keep those on
|
|
419
|
+
// the eager walk rather than restating the rules here.
|
|
420
|
+
if (ir.rest !== null)
|
|
421
|
+
return null;
|
|
422
|
+
if (ir.items.some((item) => !rejectsUndefined(item)))
|
|
423
|
+
return null;
|
|
424
|
+
let code = `if(!Array.isArray(${input})||${input}.length!==${ir.items.length})return ${g.fail};`;
|
|
425
|
+
const values = [];
|
|
426
|
+
for (const [index, itemIR] of ir.items.entries()) {
|
|
427
|
+
const slot = local(g, "bt");
|
|
428
|
+
code += `${slot}=${input}[${index}];`;
|
|
429
|
+
const inner = build(itemIR, slot, g);
|
|
430
|
+
if (inner === null)
|
|
431
|
+
return null;
|
|
432
|
+
code += inner.code;
|
|
433
|
+
values.push(inner.value);
|
|
434
|
+
}
|
|
435
|
+
const out = local(g, "bl");
|
|
436
|
+
code += `${out}=[${values.join(",")}];`;
|
|
437
|
+
return { code, value: out };
|
|
438
|
+
}
|
|
439
|
+
function buildRecord(ir, input, g) {
|
|
440
|
+
const plainStringKey = ir.keyType.type === "string" && ir.keyType.checks.length === 0 && ir.keyType.coerce !== true;
|
|
441
|
+
if (!plainStringKey)
|
|
442
|
+
return null;
|
|
443
|
+
const out = local(g, "br");
|
|
444
|
+
const keyVar = local(g, "brk");
|
|
445
|
+
const valVar = local(g, "brv");
|
|
446
|
+
const inner = build(ir.valueType, valVar, g);
|
|
447
|
+
if (inner === null)
|
|
448
|
+
return null;
|
|
449
|
+
const hop = emitRuntimeHelper(g.ctx, "__zcHop", ZC_HOP_DECL);
|
|
450
|
+
const code = `if(typeof ${input}!=="object"||${input}===null||Array.isArray(${input}))return ${g.fail};` +
|
|
451
|
+
`${out}={};` +
|
|
452
|
+
`for(${keyVar} in ${input}){if(${hop}.call(${input},${keyVar})){` +
|
|
453
|
+
`${valVar}=${input}[${keyVar}];${inner.code}${out}[${keyVar}]=${inner.value};}}`;
|
|
454
|
+
return { code, value: out };
|
|
455
|
+
}
|
|
456
|
+
/** `optional` / `nullable` around a rebuilding inner: pass the sentinel through. */
|
|
457
|
+
function buildSentinel(innerIR, input, g, test, sentinel) {
|
|
458
|
+
const inner = build(innerIR, input, g);
|
|
459
|
+
if (inner === null)
|
|
460
|
+
return null;
|
|
461
|
+
const out = local(g, "bw");
|
|
462
|
+
return {
|
|
463
|
+
code: `if(${input}${test}){${out}=${sentinel};}else{${inner.code}${out}=${inner.value};}`,
|
|
464
|
+
value: out,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
/** Allocate a `var` the hosted build function declares. */
|
|
468
|
+
function local(g, prefix) {
|
|
469
|
+
const name = emitTemp(g.ctx, prefix);
|
|
470
|
+
g.scope.temps.push(name);
|
|
471
|
+
return name;
|
|
472
|
+
}
|
|
473
|
+
//# sourceMappingURL=build-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-path.js","sourceRoot":"","sources":["../../../src/core/codegen/build-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAyB/C;;;;;;;;;;;GAWG;AACH,SAAS,UAAU,CAAC,IAAc;IAChC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAmB,CAAC,CAAC,CAAC,E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,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3B,OAAO;QACL,IAAI,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,GAAG,IAAI,QAAQ,UAAU,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,KAAK,IAAI;QACzF,KAAK,EAAE,GAAG;KACX,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,KAAK,CAAC,CAAW,EAAE,MAAc;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -30,6 +30,13 @@ export interface CodeGenResult {
|
|
|
30
30
|
* `.is()` then derives from `safeParse(input).success`.
|
|
31
31
|
*/
|
|
32
32
|
fastTotal: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Hosted predicate installed as `.is()`, when it differs from `fastFnName`.
|
|
35
|
+
* A schema that rebuilds its output has no by-reference shortcut (so
|
|
36
|
+
* `fastFnName` is null) yet still has an exact acceptance predicate, because
|
|
37
|
+
* stripping reshapes the payload and never the verdict.
|
|
38
|
+
*/
|
|
39
|
+
isFnName?: string | null;
|
|
33
40
|
/**
|
|
34
41
|
* Compact mode only: the `__rf[N]` index this validator delegates its cold
|
|
35
42
|
* error path to (the schema itself, captured as a fresh root RefEntry). When
|
|
@@ -89,6 +96,10 @@ export interface CodeGenContext {
|
|
|
89
96
|
effectFnCache?: Map<string, string>;
|
|
90
97
|
/** Dedup cache for constant preamble declarations: initializer text → preamble var. */
|
|
91
98
|
valueCache?: Map<string, string>;
|
|
99
|
+
/** Name of the build path's FAIL sentinel, declared once per validator. */
|
|
100
|
+
buildFailName?: string;
|
|
101
|
+
/** Hosted build-function name per recursion target refId, so back-edges resolve. */
|
|
102
|
+
buildRecNames?: Map<number, string>;
|
|
92
103
|
/** Memo for estimateFastCost (size-gated fast-check extraction). Lazily created. */
|
|
93
104
|
fastSizeCache?: WeakMap<SchemaIR, number>;
|
|
94
105
|
/** Memo for estimateRuntimeCost (cheapest-first check ordering). Lazily created. */
|
|
@@ -161,7 +172,40 @@ export type SlowGenerator<T extends SchemaIR = SchemaIR> = (ir: T, g: SlowGen) =
|
|
|
161
172
|
*/
|
|
162
173
|
export interface FastScope {
|
|
163
174
|
used: number;
|
|
175
|
+
/**
|
|
176
|
+
* `var` temps that the function this scope is assembling must declare, in
|
|
177
|
+
* allocation order. Populated by {@link FastGen.local}; every site that
|
|
178
|
+
* materializes a function body from a fresh scope emits
|
|
179
|
+
* {@link declareFastTemps} at the top of that body.
|
|
180
|
+
*
|
|
181
|
+
* Function-scoped (never module-scoped) is load-bearing: a recursive
|
|
182
|
+
* validator re-enters itself while an outer frame still holds a live temp,
|
|
183
|
+
* and each invocation needs its own binding.
|
|
184
|
+
*/
|
|
185
|
+
temps: string[];
|
|
164
186
|
}
|
|
187
|
+
/** `var a,b;` declaration for a scope's temps, or "" when it allocated none. */
|
|
188
|
+
export declare function declareFastTemps(scope: FastScope): string;
|
|
189
|
+
/**
|
|
190
|
+
* Fast check for a wrapper that compares its input against a sentinel and
|
|
191
|
+
* otherwise delegates to an inner schema — `optional` (`===undefined`),
|
|
192
|
+
* `nullable` (`===null`) and `default` (`!==undefined`).
|
|
193
|
+
*
|
|
194
|
+
* Written naively these read the input TWICE: once for the sentinel test and
|
|
195
|
+
* again inside the inner check (which may itself read it several more times —
|
|
196
|
+
* `typeof x==="string"&&x.length>=3&&x.length<=20`). V8's load elimination
|
|
197
|
+
* removes the repeats only while the access is monomorphic; on the polymorphic
|
|
198
|
+
* and megamorphic call sites real payloads produce (an array of objects with
|
|
199
|
+
* differing key order, anything out of `JSON.parse`) every repeat is a fresh
|
|
200
|
+
* megamorphic lookup. Binding the value to a local once is worth 1.1-1.7x on
|
|
201
|
+
* the whole object check when the optional key is present, and is neutral when
|
|
202
|
+
* it is absent.
|
|
203
|
+
*
|
|
204
|
+
* Only hoisted when the input is a property access; a bare local (an array
|
|
205
|
+
* element variable, a record value) is already a single load, so it keeps the
|
|
206
|
+
* shorter form and byte-identical output.
|
|
207
|
+
*/
|
|
208
|
+
export declare function fastSentinelWrapper(g: FastGen, innerIR: SchemaIR, sentinel: string, joiner: "&&" | "||"): string | null;
|
|
165
209
|
/** Context object for fast-path (boolean expression) generator functions. */
|
|
166
210
|
export interface FastGen {
|
|
167
211
|
readonly input: string;
|
|
@@ -200,6 +244,13 @@ export interface FastGen {
|
|
|
200
244
|
scoped(input: string): FastGen;
|
|
201
245
|
/** Generate a unique temp variable name. */
|
|
202
246
|
temp(prefix: string): string;
|
|
247
|
+
/**
|
|
248
|
+
* Allocate a unique name AND record it on this scope so the enclosing
|
|
249
|
+
* emitted function declares it as a `var` (see {@link FastScope.temps}).
|
|
250
|
+
* Use for a value bound inside an expression — `(t=x["k"])===undefined` —
|
|
251
|
+
* where `temp()` alone would leave the name undeclared.
|
|
252
|
+
*/
|
|
253
|
+
local(prefix: string): string;
|
|
203
254
|
/** Add a regex to preamble and return the variable name. */
|
|
204
255
|
regex(prefix: string, pattern: string, flags?: string): string;
|
|
205
256
|
}
|
|
@@ -281,11 +332,34 @@ export declare function emitRegexSourceString(ctx: CodeGenContext, pattern: stri
|
|
|
281
332
|
export declare function emitConstant(ctx: CodeGenContext, prefix: string, initializer: string): string;
|
|
282
333
|
/** Declare a `new Set([...])` in the preamble and return its variable name. */
|
|
283
334
|
export declare function emitSet(ctx: CodeGenContext, prefix: string, values: readonly unknown[]): string;
|
|
335
|
+
/**
|
|
336
|
+
* Shape-key count at or below which the unknown-key pass compares with an
|
|
337
|
+
* inline `===` chain rather than a hashed lookup.
|
|
338
|
+
*
|
|
339
|
+
* This is deliberately NOT {@link ENUM_INLINE_THRESHOLD}: the two look alike but
|
|
340
|
+
* are different workloads. An enum compares schema literals against arbitrary
|
|
341
|
+
* INPUT strings, which may be long, share prefixes, and are not necessarily
|
|
342
|
+
* internalized — so a hashed set earns its keep quickly. A shape-key test
|
|
343
|
+
* compares them against keys arriving from `for-in`, i.e. the object's own
|
|
344
|
+
* internalized key strings, so every arm of the chain is a pointer compare that
|
|
345
|
+
* V8 predicts perfectly, while `table[k]` / `set.has(k)` pays a string hash and
|
|
346
|
+
* probe per key.
|
|
347
|
+
*
|
|
348
|
+
* Measured over a strict object's for-in pass (JSON-parsed input, 8 rotated
|
|
349
|
+
* shapes), `===` chain vs the previous `{k:1}` table: 3.7x at 6 keys, 3.8x at
|
|
350
|
+
* 10, 3.1x at 20, 3.1x at 48 — the chain still leads at 64 (283 ns vs 690) and
|
|
351
|
+
* only loses past ~96, where `Set.has` (not the table, which never wins at any
|
|
352
|
+
* size) takes over. 64 sits below that crossover and above any realistic shape.
|
|
353
|
+
*/
|
|
354
|
+
export declare const KEY_MEMBERSHIP_INLINE_THRESHOLD = 64;
|
|
284
355
|
/**
|
|
285
356
|
* Boolean membership test for one key variable against a fixed key list.
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
357
|
+
* Empty list recognizes nothing.
|
|
358
|
+
*
|
|
359
|
+
* `Set.has` is the large-shape fallback rather than a `{key:1}` object table:
|
|
360
|
+
* the table is also `__proto__`-hostile (an own `__proto__` key cannot be set
|
|
361
|
+
* by an object literal, so that key would silently read as unknown), which the
|
|
362
|
+
* Set has no trouble with.
|
|
289
363
|
*/
|
|
290
364
|
export declare function keyMembershipTest(ctx: CodeGenContext, keys: readonly string[], keyVar: string): string;
|
|
291
365
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/core/codegen/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO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