zod-compiler 1.22.0 → 1.22.2

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.
Files changed (132) hide show
  1. package/README.md +154 -588
  2. package/dist/cli/commands/generate.d.ts +0 -2
  3. package/dist/cli/commands/generate.d.ts.map +1 -1
  4. package/dist/cli/commands/generate.js +0 -2
  5. package/dist/cli/commands/generate.js.map +1 -1
  6. package/dist/cli/commands/watch.d.ts +0 -1
  7. package/dist/cli/commands/watch.d.ts.map +1 -1
  8. package/dist/cli/commands/watch.js +0 -2
  9. package/dist/cli/commands/watch.js.map +1 -1
  10. package/dist/cli/index.js +0 -7
  11. package/dist/cli/index.js.map +1 -1
  12. package/dist/core/codegen/build-path.d.ts +48 -0
  13. package/dist/core/codegen/build-path.d.ts.map +1 -0
  14. package/dist/core/codegen/build-path.js +642 -0
  15. package/dist/core/codegen/build-path.js.map +1 -0
  16. package/dist/core/codegen/context.d.ts +106 -9
  17. package/dist/core/codegen/context.d.ts.map +1 -1
  18. package/dist/core/codegen/context.js +89 -39
  19. package/dist/core/codegen/context.js.map +1 -1
  20. package/dist/core/codegen/dedupe.d.ts +7 -0
  21. package/dist/core/codegen/dedupe.d.ts.map +1 -1
  22. package/dist/core/codegen/dedupe.js +7 -0
  23. package/dist/core/codegen/dedupe.js.map +1 -1
  24. package/dist/core/codegen/fast-path.d.ts.map +1 -1
  25. package/dist/core/codegen/fast-path.js +11 -5
  26. package/dist/core/codegen/fast-path.js.map +1 -1
  27. package/dist/core/codegen/index.d.ts.map +1 -1
  28. package/dist/core/codegen/index.js +95 -5
  29. package/dist/core/codegen/index.js.map +1 -1
  30. package/dist/core/codegen/issue-decls.d.ts +40 -0
  31. package/dist/core/codegen/issue-decls.d.ts.map +1 -1
  32. package/dist/core/codegen/issue-decls.js +70 -0
  33. package/dist/core/codegen/issue-decls.js.map +1 -1
  34. package/dist/core/codegen/regex-unroll.d.ts +36 -0
  35. package/dist/core/codegen/regex-unroll.d.ts.map +1 -0
  36. package/dist/core/codegen/regex-unroll.js +231 -0
  37. package/dist/core/codegen/regex-unroll.js.map +1 -0
  38. package/dist/core/codegen/schemas/array.d.ts.map +1 -1
  39. package/dist/core/codegen/schemas/array.js +22 -5
  40. package/dist/core/codegen/schemas/array.js.map +1 -1
  41. package/dist/core/codegen/schemas/default.d.ts +15 -0
  42. package/dist/core/codegen/schemas/default.d.ts.map +1 -1
  43. package/dist/core/codegen/schemas/default.js +26 -5
  44. package/dist/core/codegen/schemas/default.js.map +1 -1
  45. package/dist/core/codegen/schemas/discriminated-union.d.ts.map +1 -1
  46. package/dist/core/codegen/schemas/discriminated-union.js +3 -3
  47. package/dist/core/codegen/schemas/discriminated-union.js.map +1 -1
  48. package/dist/core/codegen/schemas/map.d.ts +17 -0
  49. package/dist/core/codegen/schemas/map.d.ts.map +1 -1
  50. package/dist/core/codegen/schemas/map.js +62 -7
  51. package/dist/core/codegen/schemas/map.js.map +1 -1
  52. package/dist/core/codegen/schemas/nullable.d.ts.map +1 -1
  53. package/dist/core/codegen/schemas/nullable.js +2 -4
  54. package/dist/core/codegen/schemas/nullable.js.map +1 -1
  55. package/dist/core/codegen/schemas/number.d.ts.map +1 -1
  56. package/dist/core/codegen/schemas/number.js +25 -0
  57. package/dist/core/codegen/schemas/number.js.map +1 -1
  58. package/dist/core/codegen/schemas/object.d.ts.map +1 -1
  59. package/dist/core/codegen/schemas/object.js +27 -18
  60. package/dist/core/codegen/schemas/object.js.map +1 -1
  61. package/dist/core/codegen/schemas/optional.d.ts +10 -0
  62. package/dist/core/codegen/schemas/optional.d.ts.map +1 -1
  63. package/dist/core/codegen/schemas/optional.js +4 -6
  64. package/dist/core/codegen/schemas/optional.js.map +1 -1
  65. package/dist/core/codegen/schemas/record.d.ts.map +1 -1
  66. package/dist/core/codegen/schemas/record.js +11 -5
  67. package/dist/core/codegen/schemas/record.js.map +1 -1
  68. package/dist/core/codegen/schemas/set.d.ts.map +1 -1
  69. package/dist/core/codegen/schemas/set.js +11 -7
  70. package/dist/core/codegen/schemas/set.js.map +1 -1
  71. package/dist/core/codegen/schemas/string.d.ts +13 -2
  72. package/dist/core/codegen/schemas/string.d.ts.map +1 -1
  73. package/dist/core/codegen/schemas/string.js +68 -56
  74. package/dist/core/codegen/schemas/string.js.map +1 -1
  75. package/dist/core/codegen/schemas/template-literal.d.ts.map +1 -1
  76. package/dist/core/codegen/schemas/template-literal.js +9 -1
  77. package/dist/core/codegen/schemas/template-literal.js.map +1 -1
  78. package/dist/core/codegen/schemas/tuple.d.ts.map +1 -1
  79. package/dist/core/codegen/schemas/tuple.js +4 -3
  80. package/dist/core/codegen/schemas/tuple.js.map +1 -1
  81. package/dist/core/codegen/schemas/union.d.ts.map +1 -1
  82. package/dist/core/codegen/schemas/union.js +2 -1
  83. package/dist/core/codegen/schemas/union.js.map +1 -1
  84. package/dist/core/codegen/well-known-regex.d.ts +22 -4
  85. package/dist/core/codegen/well-known-regex.d.ts.map +1 -1
  86. package/dist/core/codegen/well-known-regex.js +27 -5
  87. package/dist/core/codegen/well-known-regex.js.map +1 -1
  88. package/dist/core/extract/extractors/default.d.ts.map +1 -1
  89. package/dist/core/extract/extractors/default.js +6 -1
  90. package/dist/core/extract/extractors/default.js.map +1 -1
  91. package/dist/core/extract/extractors/object.d.ts.map +1 -1
  92. package/dist/core/extract/extractors/object.js +11 -5
  93. package/dist/core/extract/extractors/object.js.map +1 -1
  94. package/dist/core/extract/index.d.ts +3 -3
  95. package/dist/core/extract/index.d.ts.map +1 -1
  96. package/dist/core/extract/index.js +2 -2
  97. package/dist/core/extract/index.js.map +1 -1
  98. package/dist/core/extract/registry.d.ts +2 -2
  99. package/dist/core/extract/registry.d.ts.map +1 -1
  100. package/dist/core/extract/registry.js +4 -5
  101. package/dist/core/extract/registry.js.map +1 -1
  102. package/dist/core/extract/types.d.ts +0 -11
  103. package/dist/core/extract/types.d.ts.map +1 -1
  104. package/dist/core/iife.d.ts.map +1 -1
  105. package/dist/core/iife.js +3 -2
  106. package/dist/core/iife.js.map +1 -1
  107. package/dist/core/pipeline.d.ts +0 -2
  108. package/dist/core/pipeline.d.ts.map +1 -1
  109. package/dist/core/pipeline.js +1 -3
  110. package/dist/core/pipeline.js.map +1 -1
  111. package/dist/core/types.d.ts +11 -0
  112. package/dist/core/types.d.ts.map +1 -1
  113. package/dist/swc.d.ts.map +1 -1
  114. package/dist/swc.js +0 -1
  115. package/dist/swc.js.map +1 -1
  116. package/dist/unplugin/hoist-compile.d.ts +1 -1
  117. package/dist/unplugin/hoist-compile.d.ts.map +1 -1
  118. package/dist/unplugin/hoist-compile.js +4 -4
  119. package/dist/unplugin/hoist-compile.js.map +1 -1
  120. package/dist/unplugin/index.d.ts.map +1 -1
  121. package/dist/unplugin/index.js +0 -3
  122. package/dist/unplugin/index.js.map +1 -1
  123. package/dist/unplugin/transform.d.ts.map +1 -1
  124. package/dist/unplugin/transform.js +1 -2
  125. package/dist/unplugin/transform.js.map +1 -1
  126. package/dist/unplugin/types.d.ts +0 -23
  127. package/dist/unplugin/types.d.ts.map +1 -1
  128. package/dist/unplugin/types.js.map +1 -1
  129. package/dist/unplugin/virtual.d.ts.map +1 -1
  130. package/dist/unplugin/virtual.js +11 -7
  131. package/dist/unplugin/virtual.js.map +1 -1
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAkB,aAAa,EAAE,WAAW,EAAgB,MAAM,cAAc,CAAC;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC7C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAgSf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAkB,aAAa,EAAE,WAAW,EAAgB,MAAM,cAAc,CAAC;AAG7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC7C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAoYf"}
@@ -1,4 +1,5 @@
1
- import { emitRfDelegate, hasMutation } from "./context.js";
1
+ import { generateBuild, rebuildsOutput } from "./build-path.js";
2
+ import { declareFastTemps, emitRfDelegate, hasMutation } from "./context.js";
2
3
  import { createFastGen, generateFast } from "./fast-path.js";
3
4
  import { createSlowGen, generateSlow } from "./slow-path.js";
4
5
  /**
@@ -89,12 +90,13 @@ export function generateValidator(ir, name, options) {
89
90
  for (const t of ctx.recTargets.values()) {
90
91
  if (t.isRoot)
91
92
  continue;
92
- const body = generateFast(t.inner, createFastGen("input", ctx, false));
93
+ const targetGen = createFastGen("input", ctx, false);
94
+ const body = generateFast(t.inner, targetGen);
93
95
  if (body === null) {
94
96
  fastExpr = null;
95
97
  break;
96
98
  }
97
- ctx.preamble.push(`function ${t.fastName}(input){return ${body};}`);
99
+ ctx.preamble.push(`function ${t.fastName}(input){${declareFastTemps(targetGen.scope)}return ${body};}`);
98
100
  }
99
101
  }
100
102
  if (fastExpr === null) {
@@ -124,9 +126,20 @@ export function generateValidator(ir, name, options) {
124
126
  let fastFnName = null;
125
127
  if (fastExpr !== null && fastExpr !== "true") {
126
128
  fastFnName = ctx.recFastName ?? `__fc_${ctx.counter++}`;
127
- ctx.preamble.push(`function ${fastFnName}(input){return ${fastExpr};}`);
129
+ ctx.preamble.push(`function ${fastFnName}(input){${declareFastTemps(fg.scope)}return ${fastExpr};}`);
128
130
  fastExpr = `${fastFnName}(input)`;
129
131
  }
132
+ // Build Path: one pass that validates and assembles the stripped output,
133
+ // bailing on the first failure (see build-path). Null unless the schema
134
+ // rebuilds AND its only mutation is stripping AND the shape is modelled — so
135
+ // this emits nothing for the mutation-free schemas the compact branch takes.
136
+ const buildFnName = generateBuild(ir, ctx);
137
+ // `.is()` for a build-path schema is the fast expression — stripping reshapes
138
+ // the payload, never the verdict. A substituted `.default()` breaks that: the
139
+ // fast check demands a present value where the schema accepts its absence, so
140
+ // the predicate is partial and `.is()` falls back to safeParse().success
141
+ // (which runs the build pass, so it is no slower than the eager walk was).
142
+ const buildIsFnName = ctx.buildSubstitutesValue === true ? null : fastFnName;
130
143
  const baseRefCount = options?.refCount ?? 0;
131
144
  // Compact mode: a mutation-free schema with a TOTAL fast path needs no
132
145
  // compiled slow walk — its only purpose is reproducing zod's issues on
@@ -162,6 +175,34 @@ export function generateValidator(ir, name, options) {
162
175
  rootDelegateRefIndex: baseRefCount,
163
176
  };
164
177
  }
178
+ // Compact + Build Path: same bargain for a stripping schema. The build pass
179
+ // still has to run (it produces the payload, which zod's schema would only
180
+ // reproduce by parsing again), but the compiled issue walk is what compact
181
+ // drops, and delegating that to the retained zod schema costs a few bytes.
182
+ if (options?.compact === true &&
183
+ buildFnName !== null &&
184
+ ctx.buildFailName !== undefined &&
185
+ !hasNonRootTargets) {
186
+ const delegate = emitRfDelegate(ctx, baseRefCount);
187
+ ctx.usedHelpers.add("__zcFinZ");
188
+ const built = `__bd_${ctx.counter++}`;
189
+ return {
190
+ code: ["/* zod-compiler */", ...ctx.preamble].join("\n"),
191
+ functionDef: [
192
+ `function ${fnName}(input){`,
193
+ `var ${built}=${buildFnName}(input);`,
194
+ `if(${built}!==${ctx.buildFailName}){return{success:true,data:${built}};}`,
195
+ `return __zcFinZ(${delegate},input);`,
196
+ `}`,
197
+ ].join("\n"),
198
+ refCount: baseRefCount + 1,
199
+ usedHelpers: ctx.usedHelpers,
200
+ fastFnName: null,
201
+ fastTotal: false,
202
+ isFnName: buildIsFnName,
203
+ rootDelegateRefIndex: baseRefCount,
204
+ };
205
+ }
165
206
  // Host each non-root recursion target as a safeParse-shaped slow validator,
166
207
  // mirroring the root's eager body: collect issues, return success+data or a
167
208
  // deferred-error result. Always emitted (the slow path always exists); the
@@ -186,6 +227,50 @@ export function generateValidator(ir, name, options) {
186
227
  const slowCode = rootRef !== undefined ? `${rootRef.name}(_d,[],_e);` : generateSlow(ir, sg);
187
228
  const buildCode = () => ["/* zod-compiler */", ...ctx.preamble].join("\n");
188
229
  const functionDefParts = [`function ${fnName}(input){`];
230
+ // Build Path: the schema's only mutation is stripping, so one pass can
231
+ // validate and assemble the output together and bail on the first failure,
232
+ // leaving the issue-producing walk deferred behind `.error` (see build-path).
233
+ // The fast check stays out of `safeParse` entirely — running it first would
234
+ // read every property twice — but it is still an EXACT acceptance predicate
235
+ // (stripping reshapes the output, never the verdict), so `.is()` installs it.
236
+ if (buildFnName !== null && ctx.buildFailName !== undefined) {
237
+ ctx.usedHelpers.add("__zcFinD");
238
+ const built = `__bd_${ctx.counter++}`;
239
+ // A self-recursive walk calls this validator BY NAME (slowRecursiveRef),
240
+ // and that binding exists only inside the named function expression — so
241
+ // there the walk stays a per-call closure. Everything else hosts it in the
242
+ // preamble, keeping safeParse to three statements. Mirrors the same split
243
+ // in the mutation-free branch below.
244
+ const recursive = slowCode.includes(fnName);
245
+ let deferred;
246
+ if (recursive) {
247
+ deferred = `__zcFinD(function(input){var _e=[];\nvar _d=input;\n${slowCode}\nreturn _e;},input)`;
248
+ }
249
+ else {
250
+ const walkName = `__sw_${ctx.counter++}`;
251
+ ctx.preamble.push(`function ${walkName}(input){var _e=[];\nvar _d=input;\n${slowCode}\nreturn _e;}`);
252
+ deferred = `__zcFinD(${walkName},input)`;
253
+ }
254
+ return {
255
+ code: buildCode(),
256
+ functionDef: [
257
+ `function ${fnName}(input){`,
258
+ `var ${built}=${buildFnName}(input);`,
259
+ `if(${built}!==${ctx.buildFailName}){return{success:true,data:${built}};}`,
260
+ `return ${deferred};`,
261
+ `}`,
262
+ ].join("\n"),
263
+ refCount: options?.refCount ?? 0,
264
+ usedHelpers: ctx.usedHelpers,
265
+ // No by-reference shortcut: `data` is the freshly built object, so
266
+ // parse() must go through safeParse rather than returning its input.
267
+ fastFnName: null,
268
+ // `fastTotal` qualifies `fastFnName`, which is null here; the predicate
269
+ // travels in `isFnName` instead.
270
+ fastTotal: false,
271
+ isFnName: buildIsFnName,
272
+ };
273
+ }
189
274
  if (fastExpr === "true") {
190
275
  // Schema always succeeds (any/unknown) — skip slow path entirely
191
276
  functionDefParts.push(`return{success:true,data:input};`);
@@ -243,9 +328,14 @@ export function generateValidator(ir, name, options) {
243
328
  fastTotal: true,
244
329
  };
245
330
  }
246
- if (fastExpr !== null) {
331
+ if (fastExpr !== null && !rebuildsOutput(ir)) {
247
332
  // Partial fast path (default/catch/... present-value shortcut): the slow
248
333
  // path must run eagerly — it can succeed where the fast check failed.
334
+ //
335
+ // Withheld when the schema rebuilds its output: there the fast check is a
336
+ // sound VERDICT but says nothing about the payload, and `data:input` would
337
+ // hand back the unstripped input. Such schemas reach here only when the
338
+ // build path declined them, so the eager walk produces the output instead.
249
339
  functionDefParts.push(`if(${fastExpr}){return{success:true,data:input};}`);
250
340
  }
251
341
  // Success branch inlined at the call site instead of inside __zcFin: the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/codegen/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwB7D;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,EAAY,EACZ,IAAY,EACZ,OAAkC;IAElC,MAAM,MAAM,GAAG,aAAa,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,GAAgB,OAAO,EAAE,IAAI,IAAI,QAAQ,CAAC;IACpD,MAAM,GAAG,GAAmB;QAC1B,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,CAAC;QACV,MAAM;QACN,UAAU,EAAE,IAAI,GAAG,EAAE;QACrB,IAAI;QACJ,WAAW,EAAE,IAAI,GAAG,EAAE;KACvB,CAAC;IAEF,yEAAyE;IACzE,4EAA4E;IAC5E,6EAA6E;IAC7E,IAAI,OAAO,EAAE,aAAa,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC5C,CAAC;IAED,uEAAuE;IACvE,wEAAwE;IACxE,uEAAuE;IACvE,0EAA0E;IAC1E,wEAAwE;IACxE,wDAAwD;IACxD,IAAI,EAAE,CAAC,IAAI,KAAK,UAAU,IAAI,EAAE,CAA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,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAC9D,KAAK,QAAQ,CAAC;QACd,KAAK,KAAK;YACR,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;QACpC,KAAK,KAAK;YACR,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACxB,KAAK,OAAO,CAAC;QACb,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC,OAAO,CAAC;QACpB,KAAK,cAAc;YACjB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAC7B,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,iBAAiB;YACpB,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;QACzB;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -34,6 +34,46 @@ export declare const ZC_FSR_DECL = "function __zcFsr(v,s){var vd=((\"\"+v).split
34
34
  * per call would not.
35
35
  */
36
36
  export declare const ZC_HOP_DECL = "const __zcHop=Object.prototype.hasOwnProperty;";
37
+ /** `c==="invalid_type"||c==="invalid_value"||…` over the code held in `codeExpr`. */
38
+ export declare function abortingCodeTest(codeExpr: string): string;
39
+ /**
40
+ * Port of zod's `util.aborted(payload, startIndex)`: has anything since
41
+ * `startIndex` produced a NON-continuable issue?
42
+ *
43
+ * zod gates a schema's check chain on this (`runChecks`: `else if (isAborted)
44
+ * continue`), which is what makes a container's `.refine()` still run after a
45
+ * property or element failed its own `min`/`max`/format check, and stop running
46
+ * once one failed to parse at all. The `startIndex` is the issue count when the
47
+ * node was entered, mirroring the fresh payload zod hands each sub-schema.
48
+ *
49
+ * Size/length checks are exempt in zod — they declare a `when` predicate, which
50
+ * bypasses the abort gate — so generated code leaves those ungated and only
51
+ * wraps the refine/superRefine effects.
52
+ */
53
+ export declare const ZC_AB_DECL: string;
54
+ /**
55
+ * Port of zod's `util.finalizeIssue` for issues NESTED inside an
56
+ * `invalid_key` / `invalid_element` wrapper. Those never reach the top-level
57
+ * finalization loop (which walks only the outer array), so zod finalizes them
58
+ * where it builds the wrapper: locale message applied when none was baked in,
59
+ * `input` cleared. Their `path` stays RELATIVE to the key or value schema — zod
60
+ * ran it on a fresh payload — so nothing rewrites it.
61
+ *
62
+ * `input` is cleared by assignment rather than `delete`, matching the top-level
63
+ * finalizer and the union's per-option loop.
64
+ */
65
+ export declare const ZC_FZ_DECL: string;
66
+ /**
67
+ * Port of zod's `util.prefixIssues(key, issues)` for a map entry whose key is a
68
+ * property-key type: each issue's RELATIVE path is spliced onto the map's own
69
+ * path plus the key, and the issue moves into the parent's array.
70
+ *
71
+ * `b.concat(k,x.path)` flattens `x.path` one level, giving exactly
72
+ * `[...base, key, ...relative]`.
73
+ */
74
+ export declare const ZC_PFX_DECL = "function __zcPfx(d,s,b,k){for(var i=0;i<s.length;i++){var x=s[i];x.path=b.concat(k,x.path);d.push(x);}}";
75
+ /** Does `keyExpr` hold one of zod's `util.propertyKeyTypes` (string|number|symbol)? */
76
+ export declare function propertyKeyTest(keyExpr: string): string;
37
77
  /**
38
78
  * superRefine fast-check: run the payload callback on a throwaway payload and
39
79
  * report whether it both added nothing AND left the value alone. zod's own
@@ -1 +1 @@
1
- {"version":3,"file":"issue-decls.d.ts","sourceRoot":"","sources":["../../../src/core/codegen/issue-decls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA0BH,6DAA6D;AAC7D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxD,CAAC;AAEF;;;;GAIG;AACH,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O,MAAM,UAAU,QAKkD,CAAC;AAE1E,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQjE,CAAC"}
@@ -51,6 +51,73 @@ export const ZC_FSR_DECL = 'function __zcFsr(v,s){var vd=((""+v).split(".")[1]||
51
51
  * per call would not.
52
52
  */
53
53
  export const ZC_HOP_DECL = "const __zcHop=Object.prototype.hasOwnProperty;";
54
+ /**
55
+ * Issue codes zod raises from a schema's `_zod.parse` rather than from a check,
56
+ * and which therefore carry `continue !== true` — what `util.aborted` looks for.
57
+ *
58
+ * Everything a CHECK produces (`too_small`, `too_big`, `invalid_format`,
59
+ * `not_multiple_of`, a refine's `custom`) is continuable, because `$ZodCheck`
60
+ * sets `continue: !def.abort` and an `abort: true` check costs the schema its
61
+ * compiled path anyway — so classifying by code alone is exact for generated
62
+ * issues.
63
+ *
64
+ * Read by {@link ZC_AB_DECL} and by the union's option-pruning loop, which
65
+ * applies the same rule inline over a per-option issue array.
66
+ */
67
+ const ABORTING_ISSUE_CODES = [
68
+ "invalid_type",
69
+ "invalid_value",
70
+ "invalid_union",
71
+ "unrecognized_keys",
72
+ "invalid_key",
73
+ "invalid_element",
74
+ ];
75
+ /** `c==="invalid_type"||c==="invalid_value"||…` over the code held in `codeExpr`. */
76
+ export function abortingCodeTest(codeExpr) {
77
+ return ABORTING_ISSUE_CODES.map((code) => `${codeExpr}===${JSON.stringify(code)}`).join("||");
78
+ }
79
+ /**
80
+ * Port of zod's `util.aborted(payload, startIndex)`: has anything since
81
+ * `startIndex` produced a NON-continuable issue?
82
+ *
83
+ * zod gates a schema's check chain on this (`runChecks`: `else if (isAborted)
84
+ * continue`), which is what makes a container's `.refine()` still run after a
85
+ * property or element failed its own `min`/`max`/format check, and stop running
86
+ * once one failed to parse at all. The `startIndex` is the issue count when the
87
+ * node was entered, mirroring the fresh payload zod hands each sub-schema.
88
+ *
89
+ * Size/length checks are exempt in zod — they declare a `when` predicate, which
90
+ * bypasses the abort gate — so generated code leaves those ungated and only
91
+ * wraps the refine/superRefine effects.
92
+ */
93
+ export const ZC_AB_DECL = `function __zcAb(e,i){for(;i<e.length;i++){var c=e[i].code;if(${abortingCodeTest("c")})return true;}return false;}`;
94
+ /**
95
+ * Port of zod's `util.finalizeIssue` for issues NESTED inside an
96
+ * `invalid_key` / `invalid_element` wrapper. Those never reach the top-level
97
+ * finalization loop (which walks only the outer array), so zod finalizes them
98
+ * where it builds the wrapper: locale message applied when none was baked in,
99
+ * `input` cleared. Their `path` stays RELATIVE to the key or value schema — zod
100
+ * ran it on a fresh payload — so nothing rewrites it.
101
+ *
102
+ * `input` is cleared by assignment rather than `delete`, matching the top-level
103
+ * finalizer and the union's per-option loop.
104
+ */
105
+ export const ZC_FZ_DECL = "function __zcFz(e){for(var i=0;i<e.length;i++){var s=e[i];" +
106
+ 'if(s.message===undefined&&typeof __zcMsg==="function")s.message=__zcMsg(s);' +
107
+ "s.input=undefined;}return e;}";
108
+ /**
109
+ * Port of zod's `util.prefixIssues(key, issues)` for a map entry whose key is a
110
+ * property-key type: each issue's RELATIVE path is spliced onto the map's own
111
+ * path plus the key, and the issue moves into the parent's array.
112
+ *
113
+ * `b.concat(k,x.path)` flattens `x.path` one level, giving exactly
114
+ * `[...base, key, ...relative]`.
115
+ */
116
+ export const ZC_PFX_DECL = "function __zcPfx(d,s,b,k){for(var i=0;i<s.length;i++){var x=s[i];x.path=b.concat(k,x.path);d.push(x);}}";
117
+ /** Does `keyExpr` hold one of zod's `util.propertyKeyTypes` (string|number|symbol)? */
118
+ export function propertyKeyTest(keyExpr) {
119
+ return `typeof ${keyExpr}==="string"||typeof ${keyExpr}==="number"||typeof ${keyExpr}==="symbol"`;
120
+ }
54
121
  /**
55
122
  * superRefine fast-check: run the payload callback on a throwaway payload and
56
123
  * report whether it both added nothing AND left the value alone. zod's own
@@ -104,8 +171,11 @@ export const ZC_SR_DECL = "function __zcSr(f,v,p,e){var q={value:v,issues:[]};__
104
171
  "t.path=s.path&&s.path.length?p.concat(s.path):p;e.push(t);}return q;}";
105
172
  /** Non-issue runtime helper declarations hosted in the virtual module. */
106
173
  export const RUNTIME_HELPER_DECLS = {
174
+ __zcAb: ZC_AB_DECL,
107
175
  __zcFsr: ZC_FSR_DECL,
176
+ __zcFz: ZC_FZ_DECL,
108
177
  __zcHop: ZC_HOP_DECL,
178
+ __zcPfx: ZC_PFX_DECL,
109
179
  __zcSr: ZC_SR_DECL,
110
180
  __zcSrOk: ZC_SR_OK_DECL,
111
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"issue-decls.js","sourceRoot":"","sources":["../../../src/core/codegen/issue-decls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,UAAU,GACd,uJAAuJ,CAAC;AAE1J,MAAM,gBAAgB,GACpB,oKAAoK,CAAC;AAEvK,MAAM,UAAU,GACd,qJAAqJ,CAAC;AAExJ,MAAM,gBAAgB,GACpB,kKAAkK,CAAC;AAErK,MAAM,UAAU,GACd,kIAAkI,CAAC;AAErI,MAAM,UAAU,GACd,wKAAwK,CAAC;AAE3K,MAAM,UAAU,GACd,2IAA2I,CAAC;AAE9I,MAAM,UAAU,GACd,mIAAmI,CAAC;AAEtI,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC3D,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB,yWAAyW,CAAC;AAE5W;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gDAAgD,CAAC;AAE5E;;;;;;;;;;;;;;GAcG;AACH,MAAM,C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IAClB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,aAAa;CACxB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Bounded-repeat unrolling for `.test()` regexes.
3
+ *
4
+ * V8's irregexp compiles a counted quantifier (`[0-9a-fA-F]{12}`) into a
5
+ * backtrack-capable loop carrying a counter register, but compiles the same
6
+ * atom written out (`[0-9a-fA-F][0-9a-fA-F]…`) into straight-line matching
7
+ * code. Rewriting one into the other is purely structural — the language the
8
+ * pattern accepts is unchanged — and is worth a lot on exactly the string
9
+ * formats everyday schemas lean on:
10
+ *
11
+ * z.uuid() 3.1x z.guid() 3.4x z.ksuid() 2.7x
12
+ * z.xid() 2.2x z.ulid() 2.1x z.base64() 2.1x
13
+ * z.nanoid() 1.9x z.e164() 1.5x z.iso.date() 1.3x
14
+ *
15
+ * Measured on V8 13.x (node 24). The win starts at `{4}` (1.28x) and grows
16
+ * with the count (2.7x at `{64}`); `{2}`/`{3}` are a wash, which is what
17
+ * {@link MIN_REPEAT} encodes.
18
+ *
19
+ * The rewrite applies only to quantifiers whose atom is a SINGLE CHARACTER
20
+ * matcher — a character class, an escape, or a literal character. A group's
21
+ * repeat is left alone: unrolling it would duplicate capture groups and
22
+ * renumber every backreference after it. Anything the scanner cannot account
23
+ * for exactly makes the whole transform bail (`null`), leaving the original
24
+ * pattern in place.
25
+ *
26
+ * Callers must keep reporting the ORIGINAL source in issues — the rewritten
27
+ * regex's `toString()` would otherwise leak into `pattern:` and diverge from
28
+ * zod. See `emitRegexSourceString`.
29
+ */
30
+ /**
31
+ * Rewrite bounded repeats of single-character atoms into explicit repetition.
32
+ * Returns `null` when nothing changed or the pattern could not be scanned
33
+ * exactly (in which case the caller keeps the original source).
34
+ */
35
+ export declare function unrollRepeats(source: string): string | null;
36
+ //# sourceMappingURL=regex-unroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-unroll.d.ts","sourceRoot":"","sources":["../../../src/core/codegen/regex-unroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA4BH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA4D3D"}
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Bounded-repeat unrolling for `.test()` regexes.
3
+ *
4
+ * V8's irregexp compiles a counted quantifier (`[0-9a-fA-F]{12}`) into a
5
+ * backtrack-capable loop carrying a counter register, but compiles the same
6
+ * atom written out (`[0-9a-fA-F][0-9a-fA-F]…`) into straight-line matching
7
+ * code. Rewriting one into the other is purely structural — the language the
8
+ * pattern accepts is unchanged — and is worth a lot on exactly the string
9
+ * formats everyday schemas lean on:
10
+ *
11
+ * z.uuid() 3.1x z.guid() 3.4x z.ksuid() 2.7x
12
+ * z.xid() 2.2x z.ulid() 2.1x z.base64() 2.1x
13
+ * z.nanoid() 1.9x z.e164() 1.5x z.iso.date() 1.3x
14
+ *
15
+ * Measured on V8 13.x (node 24). The win starts at `{4}` (1.28x) and grows
16
+ * with the count (2.7x at `{64}`); `{2}`/`{3}` are a wash, which is what
17
+ * {@link MIN_REPEAT} encodes.
18
+ *
19
+ * The rewrite applies only to quantifiers whose atom is a SINGLE CHARACTER
20
+ * matcher — a character class, an escape, or a literal character. A group's
21
+ * repeat is left alone: unrolling it would duplicate capture groups and
22
+ * renumber every backreference after it. Anything the scanner cannot account
23
+ * for exactly makes the whole transform bail (`null`), leaving the original
24
+ * pattern in place.
25
+ *
26
+ * Callers must keep reporting the ORIGINAL source in issues — the rewritten
27
+ * regex's `toString()` would otherwise leak into `pattern:` and diverge from
28
+ * zod. See `emitRegexSourceString`.
29
+ */
30
+ /**
31
+ * Smallest mandatory repeat count worth unrolling. Below this the counter loop
32
+ * and the straight-line form measure the same (0.97-1.00x), so leaving the
33
+ * pattern untouched keeps generated output smaller for no speed cost.
34
+ */
35
+ const MIN_REPEAT = 4;
36
+ /**
37
+ * Largest repeat count unrolled. A `{500}` would expand to a pattern longer
38
+ * than anything it could save, so it keeps the counter loop.
39
+ */
40
+ const MAX_REPEAT = 64;
41
+ /** Largest `max - min` optional tail expanded (`{6,14}` → 6 copies + 8 `?` copies). */
42
+ const MAX_OPTIONAL = 32;
43
+ /**
44
+ * Total characters the rewrite may add across a whole pattern. Once spent,
45
+ * later quantifiers are copied verbatim — the rewrite degrades gradually
46
+ * instead of failing, and emitted size stays bounded for hand-written patterns.
47
+ */
48
+ const GROWTH_BUDGET = 2_048;
49
+ /** Characters that begin something other than a literal single-character atom. */
50
+ const NON_ATOM = new Set(["^", "$", "|", "(", ")", "*", "+", "?"]);
51
+ /**
52
+ * Rewrite bounded repeats of single-character atoms into explicit repetition.
53
+ * Returns `null` when nothing changed or the pattern could not be scanned
54
+ * exactly (in which case the caller keeps the original source).
55
+ */
56
+ export function unrollRepeats(source) {
57
+ let out = "";
58
+ let index = 0;
59
+ /** Offset in `out` where the most recent atom starts, or -1 when the preceding construct is not a single-character atom. */
60
+ let atomOffset = -1;
61
+ let budget = GROWTH_BUDGET;
62
+ let changed = false;
63
+ while (index < source.length) {
64
+ const char = source[index];
65
+ if (char === "\\") {
66
+ const end = readEscape(source, index);
67
+ if (end === null)
68
+ return null;
69
+ atomOffset = out.length;
70
+ out += source.slice(index, end);
71
+ index = end;
72
+ continue;
73
+ }
74
+ if (char === "[") {
75
+ const end = readClass(source, index);
76
+ if (end === null)
77
+ return null;
78
+ atomOffset = out.length;
79
+ out += source.slice(index, end);
80
+ index = end;
81
+ continue;
82
+ }
83
+ if (char === "{") {
84
+ const quantifier = readQuantifier(source, index);
85
+ if (quantifier !== null) {
86
+ const expansion =
87
+ // A lazy quantifier (`{n,m}?`) prefers the shortest match; the
88
+ // unrolled form's `?` copies are greedy, so it is left alone.
89
+ source[quantifier.end] === "?" || atomOffset < 0
90
+ ? null
91
+ : expand(out.slice(atomOffset), quantifier, budget);
92
+ if (expansion === null) {
93
+ out += source.slice(index, quantifier.end);
94
+ }
95
+ else {
96
+ budget -= expansion.length - (out.length - atomOffset);
97
+ out = out.slice(0, atomOffset) + expansion;
98
+ changed = true;
99
+ }
100
+ // A quantifier cannot itself be quantified, so whatever follows starts
101
+ // a fresh atom.
102
+ atomOffset = -1;
103
+ index = quantifier.end;
104
+ continue;
105
+ }
106
+ // Not a valid quantifier — an unescaped `{` is a literal in Annex B.
107
+ }
108
+ atomOffset = NON_ATOM.has(char) || isSurrogate(char) ? -1 : out.length;
109
+ out += char;
110
+ index += 1;
111
+ }
112
+ return changed ? out : null;
113
+ }
114
+ /** Repeated-atom form of `atom{min,max}`, or null when it is not worth (or safe to) expand. */
115
+ function expand(atom, { min, max }, budget) {
116
+ if (min < MIN_REPEAT || min > MAX_REPEAT)
117
+ return null;
118
+ const optional = max === Infinity ? 0 : max - min;
119
+ if (optional > MAX_OPTIONAL)
120
+ return null;
121
+ const mandatory = atom.repeat(min);
122
+ const tail = max === Infinity ? `${atom}*` : `${atom}?`.repeat(optional);
123
+ const expansion = mandatory + tail;
124
+ // `atom{min,max}` is being replaced by `expansion`; charge the difference.
125
+ if (expansion.length - atom.length > budget)
126
+ return null;
127
+ return expansion;
128
+ }
129
+ /** True for a lone UTF-16 surrogate code unit, which is never treated as its own atom. */
130
+ function isSurrogate(char) {
131
+ const code = char.charCodeAt(0);
132
+ return code >= 0xd8_00 && code <= 0xdf_ff;
133
+ }
134
+ /**
135
+ * End offset (exclusive) of the escape sequence starting at `start`, or null
136
+ * when the sequence is not one whose extent is unambiguous.
137
+ *
138
+ * Everything here hinges on the caller only passing FLAG-LESS patterns, where
139
+ * Annex B's "identity escape" fallback makes several sequences mean something
140
+ * other than they would under `u`: `\p{L}` is the letter `p` followed by three
141
+ * literal characters, not a property escape, and `\uZZZZ` is `u` followed by
142
+ * four literal `Z`s. Consuming those as one atom would attach a following
143
+ * quantifier to the wrong character, so the well-formed fixed-width escapes
144
+ * are recognised exactly and every ambiguous form bails.
145
+ */
146
+ function readEscape(source, start) {
147
+ const next = source[start + 1];
148
+ if (next === undefined)
149
+ return null;
150
+ // Property escapes and named backreferences read differently with and
151
+ // without the `u` flag — never worth resolving for the sake of a rewrite.
152
+ if (next === "p" || next === "P" || next === "k")
153
+ return null;
154
+ // `\12` may be backreference 12 or backreference 1 followed by a literal 2,
155
+ // depending on how many groups the pattern has.
156
+ if (next >= "0" && next <= "9") {
157
+ const after = source[start + 2];
158
+ return after !== undefined && after >= "0" && after <= "9" ? null : start + 2;
159
+ }
160
+ if (next === "u")
161
+ return fixedWidth(source, start, 4, isHexDigit);
162
+ if (next === "x")
163
+ return fixedWidth(source, start, 2, isHexDigit);
164
+ if (next === "c")
165
+ return fixedWidth(source, start, 1, isAsciiLetter);
166
+ // Character-class escapes (`\d`, `\w`, `\s`), control escapes (`\n`, `\t`)
167
+ // and identity escapes (`\.`, `\\`, `\{`) are all one character wide.
168
+ return start + 2;
169
+ }
170
+ /** End offset of `\<kind>` plus exactly `width` chars satisfying `valid`, or null. */
171
+ function fixedWidth(source, start, width, valid) {
172
+ const end = start + 2 + width;
173
+ if (end > source.length)
174
+ return null;
175
+ for (let index = start + 2; index < end; index++) {
176
+ if (!valid(source[index]))
177
+ return null;
178
+ }
179
+ return end;
180
+ }
181
+ function isHexDigit(char) {
182
+ return /[0-9a-fA-F]/.test(char);
183
+ }
184
+ function isAsciiLetter(char) {
185
+ return /[a-zA-Z]/.test(char);
186
+ }
187
+ /**
188
+ * End offset (exclusive) of the character class starting at `start`, or null
189
+ * when unterminated. The first unescaped `]` closes the class — `[]]` is an
190
+ * empty class followed by a literal `]`, not a class containing `]`.
191
+ */
192
+ function readClass(source, start) {
193
+ let index = start + 1;
194
+ if (source[index] === "^")
195
+ index += 1;
196
+ while (index < source.length) {
197
+ const char = source[index];
198
+ if (char === "\\") {
199
+ const end = readEscape(source, index);
200
+ if (end === null)
201
+ return null;
202
+ index = end;
203
+ continue;
204
+ }
205
+ // A `v`-mode nested class would need its own nesting rules; callers only
206
+ // pass flag-less patterns, where `[` inside a class is a literal.
207
+ if (char === "]")
208
+ return index + 1;
209
+ index += 1;
210
+ }
211
+ return null;
212
+ }
213
+ /**
214
+ * Parse `{n}`, `{n,}` or `{n,m}` at `start`. Returns null when the braces do
215
+ * not form a quantifier, which Annex B treats as literal `{` characters.
216
+ */
217
+ function readQuantifier(source, start) {
218
+ const close = source.indexOf("}", start);
219
+ if (close === -1)
220
+ return null;
221
+ const body = source.slice(start + 1, close);
222
+ const match = /^(\d+)(?:,(\d*))?$/.exec(body);
223
+ if (!match)
224
+ return null;
225
+ const min = Number(match[1]);
226
+ const max = match[2] === undefined ? min : match[2] === "" ? Infinity : Number(match[2]);
227
+ if (max < min)
228
+ return null;
229
+ return { end: close + 1, max, min };
230
+ }
231
+ //# sourceMappingURL=regex-unroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-unroll.js","sourceRoot":"","sources":["../../../src/core/codegen/regex-unroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,uFAAuF;AACvF,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;;;GAIG;AACH,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B,kFAAkF;AAClF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEnE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,4HAA4H;IAC5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AG;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/schemas/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAW,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAMtD,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAyD9E;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA2ChE"}
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/schemas/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAW,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AActD,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CA4E9E;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA4ChE"}