Releases: colinhacks/zod
Releases · colinhacks/zod
v4.2.1
v4.2.0
Features
Implement Standard JSON Schema
standard-schema/standard-schema#134
Implement z.fromJSONSchema()
const jsonSchema = {
type: "object",
properties: {
name: { type: "string" },
age: { type: "number" }
},
required: ["name"]
};
const schema = z.fromJSONSchema(jsonSchema);Implement z.xor()
const schema = z.xor(
z.object({ type: "user", name: z.string() }),
z.object({ type: "admin", role: z.string() })
);
// Exactly one of the schemas must matchImplement z.looseRecord()
const schema = z.looseRecord(z.string(), z.number());
// Allows additional properties beyond those definedCommits:
v4.1.13
Commits:
- 5c2602c Update AI widget (#5318)
- d3da530 reflect the specified regex correctly in error (#5338)
- 39f8c45 faster initialization (#5352)
- e9e2790 Clean up comment
- 8e4739f Update inferred z.promise() type
- 2849df8 fix(locales): improve Dutch (nl) localization (#5367)
- b0d3c9f Run tests on windows
- 6fd61b7 feat unitest (#5358)
- a4e4bc8 Lock to node 24
- 8de8bad Fix windows build
- b2c186b Use Node LTS
- b73b1f6 Consolidate isTransforming logic
- d85f3ea Fix #5353
- 1bac0f3 Fix test.yml
- 86d4dad Fix partial record
- 5e6c0fd Fix attw on windows
- 27fc616 Extend test timeout
- 8d336c4 Remove windows runner
- 5be72e0 chore(doc): update metadata.tsx (#5331)
- cb0272a docs: add 'cd zod' step to development setup instructions (#5394)
- 24e3325 docs: replace 'Refinement' with 'Transform' in transforms section (#5397)
- 644a082 chore: add resource for validating environment variables with Zod (#5403)
- 5e1cfcf Change doc for email validation method in Zod schema (#5392)
- 88cf944 Fix: Iterate over keys in catchall object using "in" operator. (#5376)
- aa43732 Emphasise that
enumvalidates against values, for object literal &enums (#5386) - 3a4bd00 Improve Hebrew localization for Zod error messages (#5409)
- c10f9d1 Fix typos (#5420)
- 86f0ef9 Documentation Improvements (#5417)
- e120a48 Fix opt tuple
- f9bbb50 Improve tuple
- 0ba0f34 Optimize docs caching/ISR (#5433)
- c3ec66c Improve docs caching
- c8cce4b docs: fix typos and links (#5428)
- 84ec047 docs(ecosystem): Add react-f3 (#5429)
- 3396515 Docs: Fix typo in safeExtend description (#5445)
- 3d93a7d feat: MAC address validation in v4 and mini (#5440)
- f2f0d17 Fix dual package hazard for
globalRegistry(#5452) - 9fc493f fix: use oneOf for discriminated unions in JSON Schema (#5453)
- 603dbe8 Clean up regex, drop backreferences
- ab69b9e Update mac addr tests
- f791052 chore: upgrade vitest to v4 (#5028)
- f97e80d fix(core): prevent infinite recursion for recursive tuples (#5089) (#5094)
- 002e01a fix(record): handle non-function constructor field in isPlainObject (#5098)
- 6716517 docs(contributing): add instructions on building @zod/docs (#5114)
- 8b0603d Fix typo in ISO time documentation (#5277)
- be85ecc docs(codecs): correct
stringToDatesafeDecode methods (#5302) - 50bba54 Add zodgres to ecosystem documentation (#5308)
- 377f5d1 Add
zod-to-mongo-schemato ecosystem documentation (#5457) - dea32d5 docs(ecosystem): add fn sphere and zod-compare (#5326)
- 02ea4c8 Add Claude Code GitHub Workflow (#5460)
- d44253d Add support for number literal and TypeScript's enum keys in
z.record(#5334) - f52344e Fix vitest 4
- 0f4ce73 Do not allow unsound pick/omit
- 162fe29 Add z.meta and z.describe
- 3de39ee Implement slugify
- 5bfc8f2 Fix docs
- 0e803a2 Revert "Do not allow unsound pick/omit"
- a774750 v4.1.13
- 2cdd82b 4.1.13
- 4063e80 Update check-semver script
v4.1.12
Commits:
- 0b109c3 docs(ecosystem): add bupkis to the ecosystem section (#5237)
- d22ec0d docs(ecosystem): add upfetch (#5238)
- c56a4f6 docs(ecosystem): add
eslint-plugin-zod-x(#5261) - a0abcc0 docs(metadata.mdx): fix a mistake in an example output (#5248)
- 62bf4e4 fix(ZodError): prevent flatten() from crashing on 'toString' key (#5266)
- 02a5840 refac(errors): Unify code structure and improve types (#5278)
- 4b1922a docs(content/v4/index): fix zod version (#5289)
- 3fcb20f Add frrm to ecosystem (#5292)
- fda4c7c Make docs work without token
- af44738 Fix lint
- 77c3c9f Export bg.ts
- 3b94610 v4.1.12
v4.1.11
v4.1.10
v4.1.9
v4.1.8
v4.1.7
Commits:
- 0cca351 Fix variable name inconsistency in coercion documentation (#5188)
- aa78c27 Add copy/edit buttons
- 76452d4 Update button txt
- 937f73c Fix tsconfig issue in bench
- 976b436 v4.1.6 (#5222)
- 4309c61 Fix cidrv6 validation - cidrv6 should reject invalid strings with multiple slashes (#5196)
- ef95a73 feat(locales): Add Lithuanian (lt) locale (#5210)
- 3803f3f docs: update wrong contents in codeblocks in
api.mdx(#5209) - 8a47d5c docs: update coerce example in
api.mdx(#5207) - e87db13 feat(locales): Add Georgian (ka) locale (#5203)
- c54b123 docs: adds
@traversable/zodand@traversable/zod-testto v4 ecosystem (#5194) - c27a294 Fix two tiny grammatical errors in the docs. (#5193)
- 23a2d66 docs: fix broken links in async refinements and transforms references (#5190)
- 845a230 fix(locales): Add type name translations to Spanish locale (#5187)
- 27f13d6 Improve regex precision and eliminate duplicates in regexes.ts (#5181)
- a8a52b3 fix(v4): fix Khmer and Ukrainian locales (#5177)
- 887e37c Update slugs
- e1f1948 fix(v4): ensure array defaults are shallow-cloned (#5173)
- 9f65038 docs(ecosystem): add DRZL; fix Prisma Zod Generator placement (#5215)
- aa6f0f0 More fixes (#5223)
- aab3356 4.1.7
v4.1.5
Previous Next