zod-compiler 1.24.1 → 1.25.0
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 +1 -0
- package/dist/core/diagnostic.d.ts.map +1 -1
- package/dist/core/diagnostic.js +1 -0
- package/dist/core/diagnostic.js.map +1 -1
- package/dist/core/extract/extractors/readonly.d.ts +11 -4
- package/dist/core/extract/extractors/readonly.d.ts.map +1 -1
- package/dist/core/extract/extractors/readonly.js +61 -5
- package/dist/core/extract/extractors/readonly.js.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -430,6 +430,7 @@ A schema delegates to Zod when it reaches JavaScript the generated code cannot r
|
|
|
430
430
|
| `ctx`-taking or `async` callbacks | Needs Zod's parse context / the async pipeline |
|
|
431
431
|
| `z.url()`, `z.jwt()` | Algorithmic formats (`new URL()`, signature parsing) |
|
|
432
432
|
| Overlapping or policy-sensitive object intersections | Zod's independent parse-and-merge semantics cannot be safely collapsed |
|
|
433
|
+
| `.readonly()` over a container | Zod freezes its rebuilt output; compiled containers are the caller's input |
|
|
433
434
|
| Dynamic error maps, unresolvable `z.lazy()` | Not knowable at build time |
|
|
434
435
|
|
|
435
436
|
Everything else compiles, including context-free `preprocess` callbacks and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic.d.ts","names":[],"sources":["../../src/core/diagnostic.ts"],"mappings":";;KASY;UAEK;;EAEf;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA,UAAU;;UAGK;;EAEf,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAa;IAAgB;IAAc;;;;;;;
|
|
1
|
+
{"version":3,"file":"diagnostic.d.ts","names":[],"sources":["../../src/core/diagnostic.ts"],"mappings":";;KASY;UAEK;;EAEf;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA,UAAU;;UAGK;;EAEf,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAa;IAAgB;IAAc;;;;;;;iBA+L7B,eAAe,IAAI,WAAW"}
|
package/dist/core/diagnostic.js
CHANGED
|
@@ -21,6 +21,7 @@ const FALLBACK_HINTS = {
|
|
|
21
21
|
superRefine: "Replace .superRefine() with built-in checks if possible",
|
|
22
22
|
custom: "Replace z.custom() with a supported schema type",
|
|
23
23
|
lazy: "Ensure the lazy getter resolves to a static schema (recursion compiles automatically)",
|
|
24
|
+
readonly: "Zod freezes the container it rebuilt; compiled containers are the caller's own input, so this delegates rather than freeze it. .readonly() over a primitive compiles",
|
|
24
25
|
unsupported: "This schema type is not yet supported by zod-compiler",
|
|
25
26
|
coalesced: "Every property falls back to Zod, so the whole object is delegated once (faster than per-field delegation)"
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic.js","names":[],"sources":["../../src/core/diagnostic.ts"],"sourcesContent":["/**\n * Schema diagnostic utilities for the `check` command.\n * Walks SchemaIR in a single pass and collects per-node diagnostic info.\n */\n\nimport type { SchemaIR } from \"./types.js\";\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\nexport type NodeStatus = \"compiled\" | \"fallback\";\n\nexport interface DiagnosticNode {\n /** SchemaIR type (e.g. \"string\", \"object\", \"fallback\") */\n type: string;\n /** Dot-separated path from root (e.g. \".name\", \".addresses[]\") */\n path: string;\n /** Whether this node is compiled or falls back to Zod */\n status: NodeStatus;\n /** Fallback reason when status is \"fallback\" */\n reason?: string;\n /** Actionable hint for fixing the fallback */\n hint?: string;\n /** Child diagnostic nodes */\n children: DiagnosticNode[];\n}\n\nexport interface DiagnosticResult {\n /** Root diagnostic tree */\n root: DiagnosticNode;\n /** Total leaf node count */\n total: number;\n /** Number of compiled leaf nodes */\n compilable: number;\n /** Coverage percentage (0-100) */\n coveragePct: number;\n /** Whether the schema is eligible for Fast Path */\n fastPathEligible: boolean;\n /** Reason Fast Path is ineligible (when fastPathEligible is false) */\n fastPathBlocker?: string;\n /** Flat list of fallback entries for summary display */\n fallbacks: { reason: string; path: string; hint: string }[];\n}\n\n// ─── Fast Path Eligibility ──────────────────────────────────────────────────\n\n/** Schema types that block Fast Path eligibility. */\nconst FAST_PATH_BLOCKERS = new Set<string>([\"fallback\", \"effect\", \"stringBool\"]);\n\n/** Check if a single node blocks Fast Path (without recursing). */\nfunction detectFastPathBlocker(ir: SchemaIR): string | null {\n if (FAST_PATH_BLOCKERS.has(ir.type)) {\n return ir.type === \"fallback\" ? `fallback (${(ir as { reason: string }).reason})` : ir.type;\n }\n if (\"coerce\" in ir && ir.coerce) {\n return `coerce (${ir.type})`;\n }\n // Value-mutating string checks make the schema slow-path only: overwrite\n // effects (.trim()/.toLowerCase()) rewrite the value and url checks trim it,\n // while the fast path returns input unchanged.\n if (ir.type === \"string\") {\n for (const check of ir.checks) {\n if (check.kind === \"overwrite_effect\") return \"overwrite (.trim()/.toLowerCase())\";\n if (check.kind === \"string_format\" && check.format === \"url\") return \"url (trims value)\";\n }\n }\n return null;\n}\n\n// ─── Hint Generation ────────────────────────────────────────────────────────\n\nconst FALLBACK_HINTS: Record<string, string> = {\n transform: \"Extract transform into a separate post-processing step\",\n refine: \"Replace .refine() with built-in checks (e.g. .min(), .max(), .regex())\",\n superRefine: \"Replace .superRefine() with built-in checks if possible\",\n custom: \"Replace z.custom() with a supported schema type\",\n lazy: \"Ensure the lazy getter resolves to a static schema (recursion compiles automatically)\",\n unsupported: \"This schema type is not yet supported by zod-compiler\",\n coalesced:\n \"Every property falls back to Zod, so the whole object is delegated once (faster than per-field delegation)\",\n};\n\nfunction getHint(reason: string): string {\n return FALLBACK_HINTS[reason] ?? \"Check zod-compiler documentation for supported schemas\";\n}\n\n// ─── Child Iteration (with path computation) ───────────────────────────────\n\n/** Yields [childPath, childIR] pairs for a given SchemaIR node. */\nfunction* iterChildren(ir: SchemaIR, parentPath: string): Generator<[string, SchemaIR]> {\n switch (ir.type) {\n case \"object\":\n for (const [key, child] of Object.entries(ir.properties)) {\n yield [`${parentPath}.${key}`, child];\n }\n break;\n case \"array\":\n yield [`${parentPath}[]`, ir.element];\n break;\n case \"tuple\":\n for (const [i, item] of ir.items.entries()) {\n yield [`${parentPath}[${i}]`, item];\n }\n if (ir.rest) yield [`${parentPath}[...rest]`, ir.rest];\n break;\n case \"record\":\n yield [`${parentPath}[key]`, ir.keyType];\n yield [`${parentPath}[value]`, ir.valueType];\n break;\n case \"set\":\n yield [`${parentPath}[element]`, ir.valueType];\n break;\n case \"map\":\n yield [`${parentPath}[key]`, ir.keyType];\n yield [`${parentPath}[value]`, ir.valueType];\n break;\n case \"union\":\n case \"discriminatedUnion\":\n for (const [i, opt] of ir.options.entries()) {\n yield [`${parentPath}[${i}]`, opt];\n }\n break;\n case \"intersection\":\n yield [`${parentPath}[left]`, ir.left];\n yield [`${parentPath}[right]`, ir.right];\n break;\n case \"optional\":\n case \"nullable\":\n case \"readonly\":\n yield [parentPath, ir.inner];\n break;\n case \"default\":\n case \"catch\":\n yield [parentPath, ir.inner];\n break;\n case \"pipe\":\n yield [`${parentPath}[in]`, ir.in];\n yield [`${parentPath}[out]`, ir.out];\n break;\n case \"effect\":\n yield [`${parentPath}[inner]`, ir.inner];\n break;\n case \"recursionTarget\":\n // Transparent wrapper around a non-root recursive sub-schema: descend so\n // coverage and any inner fallbacks are reported at the same path.\n yield [parentPath, ir.inner];\n break;\n case \"zodDelegate\":\n // The success path is compiled; only issue materialization delegates.\n yield [parentPath, ir.inner];\n break;\n }\n}\n\n// ─── Single-Pass Diagnostic Walker ──────────────────────────────────────────\n\ninterface WalkResult {\n node: DiagnosticNode;\n total: number;\n compilable: number;\n fallbacks: { reason: string; path: string; hint: string }[];\n /** First Fast Path blocker found in this subtree, or null if eligible. */\n fastPathBlocker: string | null;\n}\n\nfunction walkIR(ir: SchemaIR, currentPath: string): WalkResult {\n // Fallback leaf\n if (ir.type === \"fallback\") {\n const hint = getHint(ir.reason);\n const nodePath = currentPath || \"(root)\";\n return {\n node: {\n type: ir.type,\n path: nodePath,\n status: \"fallback\",\n reason: ir.reason,\n hint,\n children: [],\n },\n total: 1,\n compilable: 0,\n fallbacks: [{ reason: ir.reason, path: nodePath, hint }],\n fastPathBlocker: `fallback (${ir.reason})`,\n };\n }\n\n // Check if this node itself blocks Fast Path\n let fastPathBlocker = detectFastPathBlocker(ir);\n\n // Recurse into children\n const children: DiagnosticNode[] = [];\n let total = 0;\n let compilable = 0;\n const fallbacks: { reason: string; path: string; hint: string }[] = [];\n\n for (const [childPath, child] of iterChildren(ir, currentPath)) {\n const r = walkIR(child, childPath);\n children.push(r.node);\n total += r.total;\n compilable += r.compilable;\n fallbacks.push(...r.fallbacks);\n if (fastPathBlocker === null && r.fastPathBlocker !== null) {\n fastPathBlocker = r.fastPathBlocker;\n }\n }\n\n // Leaf node (no children produced by iterChildren)\n if (children.length === 0) {\n total = 1;\n compilable = 1;\n }\n\n return {\n node: {\n type: ir.type,\n path: currentPath || \"(root)\",\n status: \"compiled\",\n children,\n },\n total,\n compilable,\n fallbacks,\n fastPathBlocker,\n };\n}\n\n/**\n * Diagnose a SchemaIR in a single pass.\n * Returns a diagnostic tree with coverage stats, Fast Path eligibility, and actionable hints.\n */\nexport function diagnoseSchema(ir: SchemaIR): DiagnosticResult {\n const { node: root, total, compilable, fallbacks, fastPathBlocker } = walkIR(ir, \"\");\n const coveragePct = total > 0 ? Math.round((compilable / total) * 100) : 100;\n\n const result: DiagnosticResult = {\n root,\n total,\n compilable,\n coveragePct,\n fastPathEligible: fastPathBlocker === null,\n fallbacks,\n };\n if (fastPathBlocker !== null) {\n result.fastPathBlocker = fastPathBlocker;\n }\n return result;\n}\n"],"mappings":";;AA8CA,MAAM,qCAAqB,IAAI,IAAY;CAAC;CAAY;CAAU;AAAY,CAAC;;AAG/E,SAAS,sBAAsB,IAA6B;CAC1D,IAAI,mBAAmB,IAAI,GAAG,IAAI,GAChC,OAAO,GAAG,S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SAAS,KAAK,EAAE,IAAI;EACpB,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,UAAU,KAAK,GAAG,EAAE,SAAS;EAC7B,IAAI,oBAAoB,QAAQ,EAAE,oBAAoB,MACpD,kBAAkB,EAAE;CAExB;CAGA,IAAI,SAAS,WAAW,GAAG;EACzB,QAAQ;EACR,aAAa;CACf;CAEA,OAAO;EACL,MAAM;GACJ,MAAM,GAAG;GACT,MAAM,eAAe;GACrB,QAAQ;GACR;EACF;EACA;EACA;EACA;EACA;CACF;AACF;;;;;AAMA,SAAgB,eAAe,IAAgC;CAC7D,MAAM,EAAE,MAAM,MAAM,OAAO,YAAY,WAAW,oBAAoB,OAAO,IAAI,EAAE;CAGnF,MAAM,SAA2B;EAC/B;EACA;EACA;EACA,aANkB,QAAQ,IAAI,KAAK,MAAO,aAAa,QAAS,GAAG,IAAI;EAOvE,kBAAkB,oBAAoB;EACtC;CACF;CACA,IAAI,oBAAoB,MACtB,OAAO,kBAAkB;CAE3B,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"diagnostic.js","names":[],"sources":["../../src/core/diagnostic.ts"],"sourcesContent":["/**\n * Schema diagnostic utilities for the `check` command.\n * Walks SchemaIR in a single pass and collects per-node diagnostic info.\n */\n\nimport type { SchemaIR } from \"./types.js\";\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\nexport type NodeStatus = \"compiled\" | \"fallback\";\n\nexport interface DiagnosticNode {\n /** SchemaIR type (e.g. \"string\", \"object\", \"fallback\") */\n type: string;\n /** Dot-separated path from root (e.g. \".name\", \".addresses[]\") */\n path: string;\n /** Whether this node is compiled or falls back to Zod */\n status: NodeStatus;\n /** Fallback reason when status is \"fallback\" */\n reason?: string;\n /** Actionable hint for fixing the fallback */\n hint?: string;\n /** Child diagnostic nodes */\n children: DiagnosticNode[];\n}\n\nexport interface DiagnosticResult {\n /** Root diagnostic tree */\n root: DiagnosticNode;\n /** Total leaf node count */\n total: number;\n /** Number of compiled leaf nodes */\n compilable: number;\n /** Coverage percentage (0-100) */\n coveragePct: number;\n /** Whether the schema is eligible for Fast Path */\n fastPathEligible: boolean;\n /** Reason Fast Path is ineligible (when fastPathEligible is false) */\n fastPathBlocker?: string;\n /** Flat list of fallback entries for summary display */\n fallbacks: { reason: string; path: string; hint: string }[];\n}\n\n// ─── Fast Path Eligibility ──────────────────────────────────────────────────\n\n/** Schema types that block Fast Path eligibility. */\nconst FAST_PATH_BLOCKERS = new Set<string>([\"fallback\", \"effect\", \"stringBool\"]);\n\n/** Check if a single node blocks Fast Path (without recursing). */\nfunction detectFastPathBlocker(ir: SchemaIR): string | null {\n if (FAST_PATH_BLOCKERS.has(ir.type)) {\n return ir.type === \"fallback\" ? `fallback (${(ir as { reason: string }).reason})` : ir.type;\n }\n if (\"coerce\" in ir && ir.coerce) {\n return `coerce (${ir.type})`;\n }\n // Value-mutating string checks make the schema slow-path only: overwrite\n // effects (.trim()/.toLowerCase()) rewrite the value and url checks trim it,\n // while the fast path returns input unchanged.\n if (ir.type === \"string\") {\n for (const check of ir.checks) {\n if (check.kind === \"overwrite_effect\") return \"overwrite (.trim()/.toLowerCase())\";\n if (check.kind === \"string_format\" && check.format === \"url\") return \"url (trims value)\";\n }\n }\n return null;\n}\n\n// ─── Hint Generation ────────────────────────────────────────────────────────\n\nconst FALLBACK_HINTS: Record<string, string> = {\n transform: \"Extract transform into a separate post-processing step\",\n refine: \"Replace .refine() with built-in checks (e.g. .min(), .max(), .regex())\",\n superRefine: \"Replace .superRefine() with built-in checks if possible\",\n custom: \"Replace z.custom() with a supported schema type\",\n lazy: \"Ensure the lazy getter resolves to a static schema (recursion compiles automatically)\",\n readonly:\n \"Zod freezes the container it rebuilt; compiled containers are the caller's own input, so this delegates rather than freeze it. .readonly() over a primitive compiles\",\n unsupported: \"This schema type is not yet supported by zod-compiler\",\n coalesced:\n \"Every property falls back to Zod, so the whole object is delegated once (faster than per-field delegation)\",\n};\n\nfunction getHint(reason: string): string {\n return FALLBACK_HINTS[reason] ?? \"Check zod-compiler documentation for supported schemas\";\n}\n\n// ─── Child Iteration (with path computation) ───────────────────────────────\n\n/** Yields [childPath, childIR] pairs for a given SchemaIR node. */\nfunction* iterChildren(ir: SchemaIR, parentPath: string): Generator<[string, SchemaIR]> {\n switch (ir.type) {\n case \"object\":\n for (const [key, child] of Object.entries(ir.properties)) {\n yield [`${parentPath}.${key}`, child];\n }\n break;\n case \"array\":\n yield [`${parentPath}[]`, ir.element];\n break;\n case \"tuple\":\n for (const [i, item] of ir.items.entries()) {\n yield [`${parentPath}[${i}]`, item];\n }\n if (ir.rest) yield [`${parentPath}[...rest]`, ir.rest];\n break;\n case \"record\":\n yield [`${parentPath}[key]`, ir.keyType];\n yield [`${parentPath}[value]`, ir.valueType];\n break;\n case \"set\":\n yield [`${parentPath}[element]`, ir.valueType];\n break;\n case \"map\":\n yield [`${parentPath}[key]`, ir.keyType];\n yield [`${parentPath}[value]`, ir.valueType];\n break;\n case \"union\":\n case \"discriminatedUnion\":\n for (const [i, opt] of ir.options.entries()) {\n yield [`${parentPath}[${i}]`, opt];\n }\n break;\n case \"intersection\":\n yield [`${parentPath}[left]`, ir.left];\n yield [`${parentPath}[right]`, ir.right];\n break;\n case \"optional\":\n case \"nullable\":\n case \"readonly\":\n yield [parentPath, ir.inner];\n break;\n case \"default\":\n case \"catch\":\n yield [parentPath, ir.inner];\n break;\n case \"pipe\":\n yield [`${parentPath}[in]`, ir.in];\n yield [`${parentPath}[out]`, ir.out];\n break;\n case \"effect\":\n yield [`${parentPath}[inner]`, ir.inner];\n break;\n case \"recursionTarget\":\n // Transparent wrapper around a non-root recursive sub-schema: descend so\n // coverage and any inner fallbacks are reported at the same path.\n yield [parentPath, ir.inner];\n break;\n case \"zodDelegate\":\n // The success path is compiled; only issue materialization delegates.\n yield [parentPath, ir.inner];\n break;\n }\n}\n\n// ─── Single-Pass Diagnostic Walker ──────────────────────────────────────────\n\ninterface WalkResult {\n node: DiagnosticNode;\n total: number;\n compilable: number;\n fallbacks: { reason: string; path: string; hint: string }[];\n /** First Fast Path blocker found in this subtree, or null if eligible. */\n fastPathBlocker: string | null;\n}\n\nfunction walkIR(ir: SchemaIR, currentPath: string): WalkResult {\n // Fallback leaf\n if (ir.type === \"fallback\") {\n const hint = getHint(ir.reason);\n const nodePath = currentPath || \"(root)\";\n return {\n node: {\n type: ir.type,\n path: nodePath,\n status: \"fallback\",\n reason: ir.reason,\n hint,\n children: [],\n },\n total: 1,\n compilable: 0,\n fallbacks: [{ reason: ir.reason, path: nodePath, hint }],\n fastPathBlocker: `fallback (${ir.reason})`,\n };\n }\n\n // Check if this node itself blocks Fast Path\n let fastPathBlocker = detectFastPathBlocker(ir);\n\n // Recurse into children\n const children: DiagnosticNode[] = [];\n let total = 0;\n let compilable = 0;\n const fallbacks: { reason: string; path: string; hint: string }[] = [];\n\n for (const [childPath, child] of iterChildren(ir, currentPath)) {\n const r = walkIR(child, childPath);\n children.push(r.node);\n total += r.total;\n compilable += r.compilable;\n fallbacks.push(...r.fallbacks);\n if (fastPathBlocker === null && r.fastPathBlocker !== null) {\n fastPathBlocker = r.fastPathBlocker;\n }\n }\n\n // Leaf node (no children produced by iterChildren)\n if (children.length === 0) {\n total = 1;\n compilable = 1;\n }\n\n return {\n node: {\n type: ir.type,\n path: currentPath || \"(root)\",\n status: \"compiled\",\n children,\n },\n total,\n compilable,\n fallbacks,\n fastPathBlocker,\n };\n}\n\n/**\n * Diagnose a SchemaIR in a single pass.\n * Returns a diagnostic tree with coverage stats, Fast Path eligibility, and actionable hints.\n */\nexport function diagnoseSchema(ir: SchemaIR): DiagnosticResult {\n const { node: root, total, compilable, fallbacks, fastPathBlocker } = walkIR(ir, \"\");\n const coveragePct = total > 0 ? Math.round((compilable / total) * 100) : 100;\n\n const result: DiagnosticResult = {\n root,\n total,\n compilable,\n coveragePct,\n fastPathEligible: fastPathBlocker === null,\n fallbacks,\n };\n if (fastPathBlocker !== null) {\n result.fastPathBlocker = fastPathBlocker;\n }\n return result;\n}\n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,CAAC;CACpC,IAAI,QAAQ;CACZ,IAAI,aAAa;CACjB,MAAM,YAA8D,CAAC;CAErE,KAAK,MAAM,CAAC,WAAW,UAAU,aAAa,IAAI,WAAW,GAAG;EAC9D,MAAM,IAAI,OAAO,OAAO,SAAS;EACjC,SAAS,KAAK,EAAE,IAAI;EACpB,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,UAAU,KAAK,GAAG,EAAE,SAAS;EAC7B,IAAI,oBAAoB,QAAQ,EAAE,oBAAoB,MACpD,kBAAkB,EAAE;CAExB;CAGA,IAAI,SAAS,WAAW,GAAG;EACzB,QAAQ;EACR,aAAa;CACf;CAEA,OAAO;EACL,MAAM;GACJ,MAAM,GAAG;GACT,MAAM,eAAe;GACrB,QAAQ;GACR;EACF;EACA;EACA;EACA;EACA;CACF;AACF;;;;;AAMA,SAAgB,eAAe,IAAgC;CAC7D,MAAM,EAAE,MAAM,MAAM,OAAO,YAAY,WAAW,oBAAoB,OAAO,IAAI,EAAE;CAGnF,MAAM,SAA2B;EAC/B;EACA;EACA;EACA,aANkB,QAAQ,IAAI,KAAK,MAAO,aAAa,QAAS,GAAG,IAAI;EAOvE,kBAAkB,oBAAoB;EACtC;CACF;CACA,IAAI,oBAAoB,MACtB,OAAO,kBAAkB;CAE3B,OAAO;AACT"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Extractor } from "../types.js";
|
|
2
2
|
//#region src/core/extract/extractors/readonly.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* z.readonly() freezes the parse OUTPUT in Zod.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* z.readonly() freezes the parse OUTPUT in Zod.
|
|
5
|
+
*
|
|
6
|
+
* Over a primitive that freeze is unobservable, so the wrapper compiles away
|
|
7
|
+
* entirely and a single readonly field stops forcing its whole enclosing object
|
|
8
|
+
* onto the eager walk.
|
|
9
|
+
*
|
|
10
|
+
* Over a container it is very much observable, and compiled validators return
|
|
11
|
+
* the caller's input as-is for every container except a stripping object — so
|
|
12
|
+
* emitting Object.freeze would freeze the caller's own data, a side effect Zod
|
|
13
|
+
* avoids by freezing the object it rebuilt. Those keep delegating to Zod, which
|
|
14
|
+
* rebuilds and freezes its own output.
|
|
8
15
|
*/
|
|
9
16
|
declare const extractReadonly: Extractor;
|
|
10
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readonly.d.ts","names":[],"sources":["../../../../src/core/extract/extractors/readonly.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"readonly.d.ts","names":[],"sources":["../../../../src/core/extract/extractors/readonly.ts"],"mappings":";;;;;;;;;;;;;;;cA0Ea,iBAAiB"}
|
|
@@ -1,11 +1,67 @@
|
|
|
1
1
|
//#region src/core/extract/extractors/readonly.ts
|
|
2
|
+
/** Does this node carry a check that replaces its value with an arbitrary one? */
|
|
3
|
+
function rewritesValue(ir) {
|
|
4
|
+
return ir.checks?.some((check) => check.kind === "overwrite_effect") === true;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* Does freezing this node's output provably do nothing?
|
|
8
|
+
*
|
|
9
|
+
* `Object.freeze` is a no-op on a primitive — `Object.isFrozen("a")` is already
|
|
10
|
+
* `true` — so a `.readonly()` whose inner always yields one is a pure
|
|
11
|
+
* type-level wrapper that can compile to its inner schema unchanged.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately conservative. `any`/`unknown`/`custom`/`effect`/`pipe` can each
|
|
14
|
+
* yield an object at runtime, `default`/`catch` can substitute one, and `date`/
|
|
15
|
+
* `file` ARE objects, so none of them qualify — they keep the delegation below.
|
|
7
16
|
*/
|
|
8
|
-
|
|
17
|
+
function freezeIsNoop(ir) {
|
|
18
|
+
if (rewritesValue(ir)) return false;
|
|
19
|
+
switch (ir.type) {
|
|
20
|
+
case "string":
|
|
21
|
+
case "number":
|
|
22
|
+
case "boolean":
|
|
23
|
+
case "bigint":
|
|
24
|
+
case "symbol":
|
|
25
|
+
case "null":
|
|
26
|
+
case "undefined":
|
|
27
|
+
case "void":
|
|
28
|
+
case "nan":
|
|
29
|
+
case "never":
|
|
30
|
+
case "enum":
|
|
31
|
+
case "templateLiteral":
|
|
32
|
+
case "stringBool": return true;
|
|
33
|
+
case "literal": return ir.values.every((value) => value === null || typeof value !== "object" && typeof value !== "function");
|
|
34
|
+
case "optional":
|
|
35
|
+
case "nullable":
|
|
36
|
+
case "readonly": return freezeIsNoop(ir.inner);
|
|
37
|
+
case "union":
|
|
38
|
+
case "discriminatedUnion": return ir.options.every(freezeIsNoop);
|
|
39
|
+
default: return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* z.readonly() freezes the parse OUTPUT in Zod.
|
|
44
|
+
*
|
|
45
|
+
* Over a primitive that freeze is unobservable, so the wrapper compiles away
|
|
46
|
+
* entirely and a single readonly field stops forcing its whole enclosing object
|
|
47
|
+
* onto the eager walk.
|
|
48
|
+
*
|
|
49
|
+
* Over a container it is very much observable, and compiled validators return
|
|
50
|
+
* the caller's input as-is for every container except a stripping object — so
|
|
51
|
+
* emitting Object.freeze would freeze the caller's own data, a side effect Zod
|
|
52
|
+
* avoids by freezing the object it rebuilt. Those keep delegating to Zod, which
|
|
53
|
+
* rebuilds and freezes its own output.
|
|
54
|
+
*/
|
|
55
|
+
const extractReadonly = (def, ctx) => {
|
|
56
|
+
const refMark = ctx.refs?.length ?? 0;
|
|
57
|
+
const inner = ctx.visit(def.innerType, "._zod.def.innerType");
|
|
58
|
+
if (freezeIsNoop(inner)) return {
|
|
59
|
+
type: "readonly",
|
|
60
|
+
inner
|
|
61
|
+
};
|
|
62
|
+
if (ctx.refs) ctx.refs.length = refMark;
|
|
63
|
+
return ctx.fallback("readonly");
|
|
64
|
+
};
|
|
9
65
|
//#endregion
|
|
10
66
|
export { extractReadonly };
|
|
11
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readonly.js","names":[],"sources":["../../../../src/core/extract/extractors/readonly.ts"],"sourcesContent":["import type { Extractor } from \"../types.js\";\n\n/**\n * z.readonly() freezes the parse OUTPUT in Zod
|
|
1
|
+
{"version":3,"file":"readonly.js","names":[],"sources":["../../../../src/core/extract/extractors/readonly.ts"],"sourcesContent":["import type { SchemaIR } from \"../../types.js\";\nimport type { Extractor } from \"../types.js\";\n\n/** Does this node carry a check that replaces its value with an arbitrary one? */\nfunction rewritesValue(ir: SchemaIR): boolean {\n const checks = (ir as { checks?: readonly { kind: string }[] }).checks;\n return checks?.some((check) => check.kind === \"overwrite_effect\") === true;\n}\n\n/**\n * Does freezing this node's output provably do nothing?\n *\n * `Object.freeze` is a no-op on a primitive — `Object.isFrozen(\"a\")` is already\n * `true` — so a `.readonly()` whose inner always yields one is a pure\n * type-level wrapper that can compile to its inner schema unchanged.\n *\n * Deliberately conservative. `any`/`unknown`/`custom`/`effect`/`pipe` can each\n * yield an object at runtime, `default`/`catch` can substitute one, and `date`/\n * `file` ARE objects, so none of them qualify — they keep the delegation below.\n */\nfunction freezeIsNoop(ir: SchemaIR): boolean {\n // `.overwrite(fn)` — and the built-ins that compile to it, `.trim()` /\n // `.toLowerCase()` — substitutes whatever its callback returns, so the IR tag\n // stops predicting the output type: `z.string().overwrite(v => ({ v }))` is a\n // `string` node that yields an object, which Zod's readonly then freezes.\n // Checked ahead of the switch so no allowlisted type can smuggle one in.\n if (rewritesValue(ir)) return false;\n switch (ir.type) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"null\":\n case \"undefined\":\n case \"void\":\n case \"nan\":\n // Yields no value at all, so there is nothing for a freeze to act on.\n case \"never\":\n case \"enum\":\n case \"templateLiteral\":\n case \"stringBool\":\n return true;\n // z.literal() compares by identity and accepts reference values, so a\n // literal qualifies only when every one of its values is a primitive.\n case \"literal\":\n return ir.values.every(\n (value) => value === null || (typeof value !== \"object\" && typeof value !== \"function\"),\n );\n case \"optional\":\n case \"nullable\":\n case \"readonly\":\n return freezeIsNoop(ir.inner);\n case \"union\":\n case \"discriminatedUnion\":\n return ir.options.every(freezeIsNoop);\n default:\n return false;\n }\n}\n\n/**\n * z.readonly() freezes the parse OUTPUT in Zod.\n *\n * Over a primitive that freeze is unobservable, so the wrapper compiles away\n * entirely and a single readonly field stops forcing its whole enclosing object\n * onto the eager walk.\n *\n * Over a container it is very much observable, and compiled validators return\n * the caller's input as-is for every container except a stripping object — so\n * emitting Object.freeze would freeze the caller's own data, a side effect Zod\n * avoids by freezing the object it rebuilt. Those keep delegating to Zod, which\n * rebuilds and freezes its own output.\n */\nexport const extractReadonly: Extractor = (def, ctx) => {\n const refMark = ctx.refs?.length ?? 0;\n const inner = ctx.visit(def.innerType, \"._zod.def.innerType\");\n if (freezeIsNoop(inner)) return { type: \"readonly\", inner };\n // The whole subtree is being discarded, so roll back any ref-table entries\n // its fallbacks registered — otherwise __rf[] retains schemas the emitted\n // code never reads (same rollback extractObject does when it coalesces).\n if (ctx.refs) ctx.refs.length = refMark;\n return ctx.fallback(\"readonly\");\n};\n"],"mappings":";;AAIA,SAAS,cAAc,IAAuB;CAE5C,OADgB,GAAgD,QACjD,MAAM,UAAU,MAAM,SAAS,kBAAkB,MAAM;AACxE;;;;;;;;;;;;AAaA,SAAS,aAAa,IAAuB;CAM3C,IAAI,cAAc,EAAE,GAAG,OAAO;CAC9B,QAAQ,GAAG,MAAX;EACE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EAEL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,cACH,OAAO;EAGT,KAAK,WACH,OAAO,GAAG,OAAO,OACd,UAAU,UAAU,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU,UAC9E;EACF,KAAK;EACL,KAAK;EACL,KAAK,YACH,OAAO,aAAa,GAAG,KAAK;EAC9B,KAAK;EACL,KAAK,sBACH,OAAO,GAAG,QAAQ,MAAM,YAAY;EACtC,SACE,OAAO;CACX;AACF;;;;;;;;;;;;;;AAeA,MAAa,mBAA8B,KAAK,QAAQ;CACtD,MAAM,UAAU,IAAI,MAAM,UAAU;CACpC,MAAM,QAAQ,IAAI,MAAM,IAAI,WAAW,qBAAqB;CAC5D,IAAI,aAAa,KAAK,GAAG,OAAO;EAAE,MAAM;EAAY;CAAM;CAI1D,IAAI,IAAI,MAAM,IAAI,KAAK,SAAS;CAChC,OAAO,IAAI,SAAS,UAAU;AAChC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -484,7 +484,7 @@ interface ZodDelegateIR {
|
|
|
484
484
|
}
|
|
485
485
|
interface FallbackIR {
|
|
486
486
|
type: "fallback";
|
|
487
|
-
reason: "transform" | "refine" | "superRefine" | "custom" | "lazy" | "unsupported" | "coalesced";
|
|
487
|
+
reason: "transform" | "refine" | "superRefine" | "custom" | "lazy" | "readonly" | "unsupported" | "coalesced";
|
|
488
488
|
/** Index into the __rf[] fallback schemas array. Present when partial fallback is used. */
|
|
489
489
|
refIndex?: number;
|
|
490
490
|
}
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/core/types.ts"],"mappings":";;;;;;UAQiB;;EAEf;;UAGe,uBAAuB;EACtC;EACA;;UAGe,uBAAuB;EACtC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;EACA;;EAEA;;;;;;;;;;;;;;;;;;EAkBA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,sBAAsB;EACrC;EACA;;KA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;EACT,WAAW;;UAGI;EACf;EACA,SAAS;;UAKM;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA,SAAS;;;;;;EAMT;IAAS;IAA8D;;;UAGxD;EACf;EACA,MAAM;EACN,OAAO;;UAKQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;;UAGQ;EACf;EACA,OAAO;EACP;;;;;;;;;;;EAWA;;UAGe;EACf;EACA,IAAI;EACJ,KAAK;;UAKU;EACf;EACA;;;;;EAKA;;;;;;;EAOA;;EAEA,OAAO;;UAGQ;EACf;EACA;;EAEA;;EAEA;;EAEA,OAAO;;;;;;UASQ;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;UAQe;EACf;EACA,OAAO;;EAEP;;UAGe;EACf;EACA;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/core/types.ts"],"mappings":";;;;;;UAQiB;;EAEf;;UAGe,uBAAuB;EACtC;EACA;;UAGe,uBAAuB;EACtC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,0BAA0B;EACzC;EACA;;UAGe,0BAA0B;EACzC;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;EACA;;EAEA;;;;;;;;;;;;;;;;;;EAkBA;;UAGe,sBAAsB;EACrC;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;;UAGe,sBAAsB;EACrC;EACA;;KAGU,UACR,iBACA,iBACA,oBACA,mBACA,gBACA,kBACA,oBACA,oBACA,gBACA,kBACA;UAMa;EACf;;;;;;EAMA;;;;;;;;;EASA;;EAEA;;;;;;EAMA;;;;;;;;;EASA;;;;;;;;;;;;;UAce;EACf;;EAEA;;;;;;UAOe;EACf;;EAEA;;;KAIU,kBACR,UACA,sBACA,2BACA;UAIa,6BAA6B;EAC5C;EACA;EACA;EACA;;U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