Change8

v4.1.13

📦 zodView on GitHub →
6 features🐛 8 fixes🔧 8 symbols

Summary

Zod v4.1.13 introduces MAC address validation, z.meta/z.describe, and significant performance optimizations for initialization. It also addresses several edge-case bugs in records, tuples, and localization.

Migration Steps

  1. Update Node.js environment to use LTS (Node 24 is now used in CI/Lockfile)
  2. If using Vitest, ensure compatibility with v4 as the project has upgraded

✨ New Features

  • Added MAC address validation (v4 and mini)
  • Added z.meta() and z.describe() for schema metadata
  • Added support for number literals and TypeScript enum keys in z.record
  • Implemented slugify functionality
  • Improved Dutch (nl) and Hebrew (he) localizations
  • Faster initialization and optimized performance for large schemas

🐛 Bug Fixes

  • Fixed dual package hazard for globalRegistry
  • Prevented infinite recursion for recursive tuples
  • Fixed inferred z.promise() type accuracy
  • Corrected regex reflection in error messages
  • Fixed handling of non-function constructor fields in isPlainObject for records
  • Fixed JSON Schema generation to use oneOf for discriminated unions
  • Fixed iteration over keys in catchall objects using the 'in' operator
  • Fixed optional tuple and partial record edge cases

🔧 Affected Symbols

z.promisez.recordz.tuplez.metaz.describeglobalRegistryisPlainObjectisTransforming