Zod v4.6.7
Version 4.6.7 von Zod enthält einen einzelnen Commit mit der Versionsbezeichnung 4.6.7.
Commits:
- b500a2ee95134f81d74da7911d7378dd2853d042 4.6.7
Folge Zod, um die Release Notes in deinen Feed zu holen.
Version 4.6.7 von Zod enthält einen einzelnen Commit mit der Versionsbezeichnung 4.6.7.
In Version 4.6.6 von Zod wurden bösartige Commits, die am 21. September über einen kompromittierten Git-Zugang auf den main-Zweig gelangten, am selben Tag zurückgesetzt und entfernt; sie wurden nie auf npm veröffentlicht.
Six malicious commits pushed to
mainon September 21 with a compromised git credential were reverted the same day in #6620 and have since been removed from the history ofmain. None were ever published to npm. The npm provenance for 4.6.6 names 284243fb, the pre-rewrite copy of 9c219833 with identical contents.
Zod 4.6.5 passt die Form von .properties() bei z.instanceof() an den Instanztyp an und ergänzt Dokumentation; z.currencyCode() wurde zwischenzeitlich zurückgenommen und wieder eingeführt.
Zod 4.6.4 führt z.currencyCode() auf Basis einer mitgelieferten ISO-4217-Liste ein und beschleunigt z.url() bei ungültigen URLs per URL.canParse() um etwa das 50-Fache.
A patch on top of 4.6.3.
d6bc1e30 feat: add z.currencyCode() over a vendored ISO 4217 list, refreshed weekly by CI (#6595)ad32d751 perf: z.url() rejects an invalid URL with URL.canParse() instead of a throwing constructor, about 50x faster; fewer allocations on the validation path (#6588)2bb08717 chore: re-pin the integration peers to the workspace zod after the 4.6.4 bumpf6e1701a chore(deps): bump next to 15.5.25 and vite to 7.3.6 (#6153)Zod 4.6.3 macht z.properties() wieder zu einem Check und entfernt das in 4.6.0 eingeführte eigenständige Schema, während z.instanceof().properties() und .check(...z.properties()) unverändert bleiben.
A patch on top of 4.6.2.
413cce9a fix(v4): make z.properties() a check again (#6594) — removes the standalone z.properties() schema from 4.6.0; z.instanceof().properties() and .check(...z.properties()) are unchanged75d63ee1 docs: show only the .properties() method form in the 4.6 post46da9572 docs: match the error-message examples to what the parsers emitZod 4.6.2 behebt, dass undefined-Ergebnisse von prefault und Objektschlüssel nicht erhalten blieben, und ergänzt den Ankündigungsbeitrag zu Zod 4.6.
Zod 4.6.1 behebt Probleme mit eindeutigen Tags bei Discriminators mit Default und mit der Index-Inferenz rekursiver Objekte und fügt das tadschikische Locale tg hinzu.
A patch on top of 4.6.0.
b12aa523 fix: preserve unique tags with defaulted discriminators (#6582) — closes #6577dd9c36fa fix(v4): defer recursive object index inference (#6580)3b154992 feat(lang): add Tajik (tg) locale (#6581) by @ismoil772efa8b80 ci: give the npm wait a real budget and drop the back-publish path (#6583)Zod 4.6.0 bringt .validate() für schnelle boolesche Prüfung, z.instanceof().properties(), z.iban(), z.withParser(), schnelleres CommonJS, eine Korrektur der Speicherbelegung bei rekursiven Schemas sowie @zod/mini als eigenständiges Paket.
Zod 4.6 is now available.
npm install zod@latest
At a glance:
.validate() — checks input validity without building a result (up to 35x faster than .safeParse().success on a compiled schema)z.instanceof().properties() — validates properties of an instancefromJSONSchema() — enforces six validation keywords it used to ignorez.iban() — electronic-format IBAN plus mod-97 checksumz.withParser() — installs a parser generated elsewhere, for environments without new Functionz.validate() under require)@zod/mini — Zod Mini as a standalone package, versioned in lockstep with zod since 4.5.validate()Standalone boolean validation, in Zod, Zod Mini, and Zod Core. It answers "is this input valid?" without constructing a ZodError, which makes rejection cheap. The return type is a guard on the schema's input type.
z.validate(z.string(), "hi"); // true
z.validate(z.string(), 42); // false
``` …
Zod 4.5.4 verhindert, dass die Zyklusprüfung eine Default-Factory auslöst.
Zod 4.5.3 gibt numerische Record-Schlüssel in toJSONSchema als Strings aus; übrige Änderungen betreffen Dokumentation und Benchmarks.
Zod 4.5.2 ermöglicht, dass ein Prototype-Method-Getter einen einfachen Aufruf beantwortet, sodass vi.spyOn funktioniert; sonst gibt es vor allem Docs-Korrekturen und CI-Änderungen.
Zod 4.5.1 koppelt das GitHub-Release und die JSR-Veröffentlichung daran, dass die Version auf npm verfügbar ist.
Zod 4.5.0 führt z.compile() für bis zu etwa 9-fach schnelleres Parsen, z.creditCard(), z.properties(), z.deepPartial(), .exactPartial() und z.validate() ein, reduziert den Speicherbedarf von Schemas und ergänzt acht neue Locales.
Zod 4.5 is now available.
npm install zod@latest
At a glance:
z.compile() — the flagship feature of Zod 4.5z.creditCard() — 12–19 digits plus Luhn checksumz.properties() — the multi-property counterpart to z.property()z.deepPartial()/.exactPartial()z.validate(): boolean — a fast-path to verify input validity without a full parse (up to 16x faster on invalid data)bn), Central Kurdish (ckb), Hindi (hi), Kannada (kn), Norwegian Nynorsk (nn), Brazilian Portuguese (pt-BR), Slovak (sk), Turkmen (tk)z.compile()You can now pre-compile any Zod schema using z.compile(schema). This dramatically speeds up parsing performance.
import * as z from "zod";
const Player = z.object({
username: z.string(),
bio: z.string(),
xp: z.number(),
// ...20 more properties...
});
const CompiledPlayer = z.compile(Player);
A compiled schema can be used exactly like an uncompiled one. There are no special rules around compiled schemas. They're just faster.
Player.parse({ ... });
CompiledPlayer.parse({ ... }); // ~9x faster
On objects, arrays, and unions, this speeds up parsing by a factor of ~3–9. More complex schemas stand to benefit more than simpler ones. …
Zod 4.4.3 stellt die Catch-Behandlung für fehlende Objekt-Schlüssel wieder her, verallgemeinert optin/fallback auf transform und stellt preprocess bei fehlenden Schlüsseln wieder her; außerdem gibt es Dokumentationsänderungen.
Zod 4.4.2 lässt z.preprocess die Optionalität dem inneren Schema überlassen, verschärft die Typisierung der Optionen von Discriminated Unions und enthält zahlreiche Dokumentationskorrekturen.
baseUrl from tsconfig …Zod 4.4.1 lehnt Tuple-Lücken vor erforderlichen Defaults ab, und das Veröffentlichen von Releases hängt nun vom vollständigen Test-Workflow ab.
Zod 4.4.0 bringt viele Korrektheitsfixes, die Zod teils strenger machen, darunter dass Defaults in Tuple-Positionen nun korrekt in der geparsten Ausgabe erscheinen.
This is a minor release with a wide set of correctness and soundness fixes. Some fixes intentionally make Zod stricter, so code that depended on previously accepted invalid or ambiguous inputs may need small updates.
Fixed in #5661. Tuple parsing now more accurately reflects defaults, optional tails, explicit undefined, and under-filled inputs. The headline behavior is that defaults in tuple positions now properly appear in parsed output.
const schema = z.tuple([
z.string(),
z.string().default("fallback"),
]);
schema.parse(["a"]);
// ["a", "fallback"]
Trailing optional elements that are absent still stay absent; they are not filled with undefined.
const schema = z.tuple([
z.string(),
z.string().optional(),
]);
schema.parse(["a"]);
// ["a"]
But explicit undefined values supplied by the caller are preserved.
schema.parse(["a", undefined]);
// ["a", undefined]
When optional elements appear before later defaults, the parsed tuple is now dense so array operations behave predictably.
const schema = z.tuple([
z.string(),
z.string().optional(),
z.string().default("fallback"),
]);
schema.parse(["a"]);
// ["a", undefined, "fallback"]
``` …
Zod 4.3.6 enthält kleinere Korrekturen, etwa eine robots.txt mit User-agent, vermiedene Star-Re-Exporte und eine verallgemeinerte Behandlung numerischer Schlüssel.
Zod 4.3.5 verbessert das Treeshaking von Zod Mini und aktualisiert die Migrationsdokumentation zur Veralterung von message.
Zod 4.3.4 unterstützt patternProperties für looseRecord, entfernt iso time in fromJSONSchema und entfernt .refine() aus ZodMiniType.