From e9f842546184c202f511a99991a1d87345457d66 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sat, 20 Apr 2024 22:53:24 +0200 Subject: [PATCH 1/9] Using 3.23.0-beta2. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7549931c3..11fe52910 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "tsx": "^4.6.2", "typescript": "^5.2.2", "vitest": "^1.5.0", - "zod": "^3.22.3" + "zod": "beta" }, "keywords": [ "nodejs", diff --git a/yarn.lock b/yarn.lock index 736f15183..df112b7d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4739,7 +4739,7 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -zod@^3.22.3: - version "3.22.5" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.5.tgz#b9b09db03f6700b0d0b75bf0dbf0c5fc46155220" - integrity sha512-HqnGsCdVZ2xc0qWPLdO25WnseXThh0kEYKIdV5F/hTHO75hNZFp8thxSeHhiPrHZKrFTo1SOgkAj9po5bexZlw== +zod@beta: + version "3.23.0-beta.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.0-beta.2.tgz#4ac8ec78c8985b619eac1fa8359105c6bce083e0" + integrity sha512-u5wv4OKNPwybJMpVsBZc2LZq5DEk+64xloBnD/QwvfdLimLE0+3cqxMbOZzHwe44vseinF3DoHz7KCWV1MLfAg== From 9a38a606b6f9f34de295f9397f77d8910887f251 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sat, 20 Apr 2024 23:02:49 +0200 Subject: [PATCH 2/9] FIX: deduplicating dependencies in CJS, ESM, 952 and compatibility tests. --- tests/cjs/package.json | 6 +----- tests/compat/package.json | 6 +----- tests/esm/package.json | 6 +----- tests/issue952/package.json | 9 +-------- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/tests/cjs/package.json b/tests/cjs/package.json index ceaa66274..3f0544baa 100644 --- a/tests/cjs/package.json +++ b/tests/cjs/package.json @@ -3,10 +3,6 @@ "private": true, "version": "0.0.0", "dependencies": { - "express-zod-api": "link:../..", - "express": "^4", - "http-errors": "^2", - "typescript": "^5", - "zod": "^3" + "express-zod-api": "link:../.." } } diff --git a/tests/compat/package.json b/tests/compat/package.json index ed84159f9..7dc327ae3 100644 --- a/tests/compat/package.json +++ b/tests/compat/package.json @@ -6,11 +6,7 @@ "test": "jest" }, "dependencies": { - "express-zod-api": "link:../..", - "express": "^4", - "http-errors": "^2", - "typescript": "^5", - "zod": "^3" + "express-zod-api": "link:../.." }, "devDependencies": { "jest": "^30.0.0-alpha.3", diff --git a/tests/esm/package.json b/tests/esm/package.json index db3f2e277..5e339bf46 100644 --- a/tests/esm/package.json +++ b/tests/esm/package.json @@ -4,10 +4,6 @@ "version": "0.0.0", "type": "module", "dependencies": { - "express-zod-api": "link:../..", - "express": "^4", - "http-errors": "^2", - "typescript": "^5", - "zod": "^3" + "express-zod-api": "link:../.." } } diff --git a/tests/issue952/package.json b/tests/issue952/package.json index 6a1172784..844b77619 100644 --- a/tests/issue952/package.json +++ b/tests/issue952/package.json @@ -7,13 +7,6 @@ "posttest": "rm quick-start.d.ts" }, "dependencies": { - "express-zod-api": "link:../..", - "express": "^4", - "http-errors": "^2", - "typescript": "^5", - "zod": "^3" - }, - "devDependencies": { - "@types/express": "^4" + "express-zod-api": "link:../.." } } From a305e4fcf695e887206bce788b5266769f34f923 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sat, 20 Apr 2024 23:27:05 +0200 Subject: [PATCH 3/9] Better implementation for ez.dateIn(). --- src/date-in-schema.ts | 20 ++++--- src/schema-helpers.ts | 1 + .../__snapshots__/date-in-schema.spec.ts.snap | 55 +++++++++++++++++++ tests/unit/date-in-schema.spec.ts | 17 ++---- 4 files changed, 74 insertions(+), 19 deletions(-) create mode 100644 tests/unit/__snapshots__/date-in-schema.spec.ts.snap diff --git a/src/date-in-schema.ts b/src/date-in-schema.ts index 8a2385a17..6d0770fd6 100644 --- a/src/date-in-schema.ts +++ b/src/date-in-schema.ts @@ -4,12 +4,18 @@ import { isValidDate, isoDateRegex } from "./schema-helpers"; export const ezDateInKind = "DateIn"; -export const dateIn = () => - proprietary( +export const dateIn = () => { + const base = z.string(); + const hasDateMethod = typeof base.date === "function"; + const schema = hasDateMethod + ? base + .date() + .or(base.datetime()) + .or(base.datetime({ local: true })) + : base.regex(isoDateRegex); // @todo remove after min zod v3.23 (v19) + + return proprietary( ezDateInKind, - z - .string() - .regex(isoDateRegex) - .transform((str) => new Date(str)) - .pipe(z.date().refine(isValidDate)), + schema.transform((str) => new Date(str)).pipe(z.date().refine(isValidDate)), ); +}; diff --git a/src/schema-helpers.ts b/src/schema-helpers.ts index beb77c4cd..9a7aaf7b8 100644 --- a/src/schema-helpers.ts +++ b/src/schema-helpers.ts @@ -6,6 +6,7 @@ export const isValidDate = (date: Date): boolean => !isNaN(date.getTime()); * @example 2021-01-01T00:00:00Z * @example 2021-01-01T00:00:00 * @example 2021-01-01 + * @todo remove after min zod v3.23 (v19) */ export const isoDateRegex = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?)?Z?$/; diff --git a/tests/unit/__snapshots__/date-in-schema.spec.ts.snap b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap new file mode 100644 index 000000000..8fd8aec7b --- /dev/null +++ b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap @@ -0,0 +1,55 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ez.dateIn() > parsing > should handle wrong parsed type 1`] = ` +[ + { + "code": "invalid_union", + "message": "Invalid input", + "path": [], + "unionErrors": [ + [ZodError: [ + { + "code": "invalid_union", + "unionErrors": [ + { + "issues": [ + { + "code": "invalid_type", + "expected": "string", + "received": "number", + "path": [], + "message": "Expected string, received number" + } + ], + "name": "ZodError" + }, + { + "issues": [ + { + "code": "invalid_type", + "expected": "string", + "received": "number", + "path": [], + "message": "Expected string, received number" + } + ], + "name": "ZodError" + } + ], + "path": [], + "message": "Invalid input" + } +]], + [ZodError: [ + { + "code": "invalid_type", + "expected": "string", + "received": "number", + "path": [], + "message": "Expected string, received number" + } +]], + ], + }, +] +`; diff --git a/tests/unit/date-in-schema.spec.ts b/tests/unit/date-in-schema.spec.ts index 46e375898..6784555ee 100644 --- a/tests/unit/date-in-schema.spec.ts +++ b/tests/unit/date-in-schema.spec.ts @@ -18,15 +18,7 @@ describe("ez.dateIn()", () => { const result = schema.safeParse(123); expect(result.success).toBeFalsy(); if (!result.success) { - expect(result.error.issues).toEqual([ - { - code: "invalid_type", - expected: "string", - message: "Expected string, received number", - path: [], - received: "number", - }, - ]); + expect(result.error.issues).toMatchSnapshot(); } }); @@ -52,9 +44,10 @@ describe("ez.dateIn()", () => { if (!result.success) { expect(result.error.issues).toEqual([ { - code: "invalid_date", + code: "invalid_string", message: "Invalid date", path: [], + validation: "date", }, ]); } @@ -68,8 +61,8 @@ describe("ez.dateIn()", () => { expect(result.error.issues).toEqual([ { code: "invalid_string", - message: "Invalid", - validation: "regex", + message: "Invalid date", + validation: "date", path: [], }, ]); From 195333dd3f8a18251dfbc4d1bc7c7362b88257fa Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sat, 20 Apr 2024 23:33:23 +0200 Subject: [PATCH 4/9] Better implementation for ez.file(base64). --- src/documentation-helpers.ts | 5 ++++- src/file-schema.ts | 14 ++++++++++---- tests/unit/file-schema.spec.ts | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/documentation-helpers.ts b/src/documentation-helpers.ts index 5b82c10b1..0acf86858 100644 --- a/src/documentation-helpers.ts +++ b/src/documentation-helpers.ts @@ -163,7 +163,10 @@ export const depictFile: Depicter = ({ schema }) => ({ type: "string", format: schema instanceof z.ZodString - ? schema._def.checks.find((check) => check.kind === "regex") + ? schema._def.checks.find( + /** @todo remove regex check when min zod v3.23 (v19) */ + (check) => check.kind === "regex" || check.kind === "base64", + ) ? "byte" : "file" : "binary", diff --git a/src/file-schema.ts b/src/file-schema.ts index e43419582..be1af280c 100644 --- a/src/file-schema.ts +++ b/src/file-schema.ts @@ -7,6 +7,7 @@ const bufferSchema = z.custom((subject) => Buffer.isBuffer(subject), { message: "Expected Buffer", }); +/** @todo remove after min zod v3.23 (v19) */ const base64Regex = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; @@ -14,11 +15,16 @@ const variants = { buffer: () => proprietary(ezFileKind, bufferSchema), string: () => proprietary(ezFileKind, z.string()), binary: () => proprietary(ezFileKind, bufferSchema.or(z.string())), - base64: () => - proprietary( + base64: () => { + const base = z.string(); + const hasBase64Method = typeof base.base64 === "function"; + return proprietary( ezFileKind, - z.string().regex(base64Regex, "Does not match base64 encoding"), - ), + hasBase64Method + ? base.base64() + : base.regex(base64Regex, "Does not match base64 encoding"), // @todo remove after min zod v3.23 (v19) + ); + }, }; type Variants = typeof variants; diff --git a/tests/unit/file-schema.spec.ts b/tests/unit/file-schema.spec.ts index 6478c9688..f20223875 100644 --- a/tests/unit/file-schema.spec.ts +++ b/tests/unit/file-schema.spec.ts @@ -79,9 +79,9 @@ describe("ez.file()", () => { expect(result.error.issues).toEqual([ { code: "invalid_string", - message: "Does not match base64 encoding", - validation: "regex", + message: "Invalid base64", path: [], + validation: "base64", }, ]); } From a07fa790ed6a2ca2b5de3212bdaf482604267651 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sun, 21 Apr 2024 09:19:16 +0200 Subject: [PATCH 5/9] Ref: flattening union for ez.dateIn(). --- src/date-in-schema.ts | 5 +-- .../__snapshots__/date-in-schema.spec.ts.snap | 41 ++++++------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/date-in-schema.ts b/src/date-in-schema.ts index 6d0770fd6..0dae8b051 100644 --- a/src/date-in-schema.ts +++ b/src/date-in-schema.ts @@ -8,10 +8,7 @@ export const dateIn = () => { const base = z.string(); const hasDateMethod = typeof base.date === "function"; const schema = hasDateMethod - ? base - .date() - .or(base.datetime()) - .or(base.datetime({ local: true })) + ? z.union([base.date(), base.datetime(), base.datetime({ local: true })]) : base.regex(isoDateRegex); // @todo remove after min zod v3.23 (v19) return proprietary( diff --git a/tests/unit/__snapshots__/date-in-schema.spec.ts.snap b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap index 8fd8aec7b..7e487ceea 100644 --- a/tests/unit/__snapshots__/date-in-schema.spec.ts.snap +++ b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap @@ -9,35 +9,20 @@ exports[`ez.dateIn() > parsing > should handle wrong parsed type 1`] = ` "unionErrors": [ [ZodError: [ { - "code": "invalid_union", - "unionErrors": [ - { - "issues": [ - { - "code": "invalid_type", - "expected": "string", - "received": "number", - "path": [], - "message": "Expected string, received number" - } - ], - "name": "ZodError" - }, - { - "issues": [ - { - "code": "invalid_type", - "expected": "string", - "received": "number", - "path": [], - "message": "Expected string, received number" - } - ], - "name": "ZodError" - } - ], + "code": "invalid_type", + "expected": "string", + "received": "number", + "path": [], + "message": "Expected string, received number" + } +]], + [ZodError: [ + { + "code": "invalid_type", + "expected": "string", + "received": "number", "path": [], - "message": "Invalid input" + "message": "Expected string, received number" } ]], [ZodError: [ From 99eda2a1d4106f7e1938209ebbb68197a6e1b4a1 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sun, 21 Apr 2024 13:02:13 +0200 Subject: [PATCH 6/9] Ref, Cov: Testing legacy mode for ez.dateIn(). --- src/date-in-schema.ts | 2 +- .../__snapshots__/date-in-schema.spec.ts.snap | 57 ++++++++++++++++++- tests/unit/date-in-schema.spec.ts | 31 +++++----- 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/src/date-in-schema.ts b/src/date-in-schema.ts index 0dae8b051..116758652 100644 --- a/src/date-in-schema.ts +++ b/src/date-in-schema.ts @@ -6,7 +6,7 @@ export const ezDateInKind = "DateIn"; export const dateIn = () => { const base = z.string(); - const hasDateMethod = typeof base.date === "function"; + const hasDateMethod = base.date?.() instanceof z.ZodString; const schema = hasDateMethod ? z.union([base.date(), base.datetime(), base.datetime({ local: true })]) : base.regex(isoDateRegex); // @todo remove after min zod v3.23 (v19) diff --git a/tests/unit/__snapshots__/date-in-schema.spec.ts.snap b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap index 7e487ceea..a81fbe0c3 100644 --- a/tests/unit/__snapshots__/date-in-schema.spec.ts.snap +++ b/tests/unit/__snapshots__/date-in-schema.spec.ts.snap @@ -1,6 +1,28 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`ez.dateIn() > parsing > should handle wrong parsed type 1`] = ` +exports[`ez.dateIn() current mode > parsing > should handle invalid date 1`] = ` +[ + { + "code": "invalid_string", + "message": "Invalid date", + "path": [], + "validation": "date", + }, +] +`; + +exports[`ez.dateIn() current mode > parsing > should handle invalid format 1`] = ` +[ + { + "code": "invalid_string", + "message": "Invalid date", + "path": [], + "validation": "date", + }, +] +`; + +exports[`ez.dateIn() current mode > parsing > should handle wrong parsed type 1`] = ` [ { "code": "invalid_union", @@ -38,3 +60,36 @@ exports[`ez.dateIn() > parsing > should handle wrong parsed type 1`] = ` }, ] `; + +exports[`ez.dateIn() legacy mode > parsing > should handle invalid date 1`] = ` +[ + { + "code": "invalid_date", + "message": "Invalid date", + "path": [], + }, +] +`; + +exports[`ez.dateIn() legacy mode > parsing > should handle invalid format 1`] = ` +[ + { + "code": "invalid_string", + "message": "Invalid", + "path": [], + "validation": "regex", + }, +] +`; + +exports[`ez.dateIn() legacy mode > parsing > should handle wrong parsed type 1`] = ` +[ + { + "code": "invalid_type", + "expected": "string", + "message": "Expected string, received number", + "path": [], + "received": "number", + }, +] +`; diff --git a/tests/unit/date-in-schema.spec.ts b/tests/unit/date-in-schema.spec.ts index 6784555ee..6da35f11e 100644 --- a/tests/unit/date-in-schema.spec.ts +++ b/tests/unit/date-in-schema.spec.ts @@ -1,9 +1,18 @@ import { z } from "zod"; import { getMeta } from "../../src/metadata"; import { ez } from "../../src"; -import { describe, expect, test } from "vitest"; +import { beforeAll, describe, expect, test, vi } from "vitest"; + +describe.each(["current", "legacy"])("ez.dateIn() %s mode", (mode) => { + // @todo remove after min zod v3.23 (v19) + beforeAll(() => { + if (mode === "legacy") { + vi.spyOn(z.ZodString.prototype, "date").mockImplementation( + () => null as unknown as z.ZodString, + ); + } + }); -describe("ez.dateIn()", () => { describe("creation", () => { test("should create an instance", () => { const schema = ez.dateIn(); @@ -42,14 +51,7 @@ describe("ez.dateIn()", () => { const result = schema.safeParse("2022-01-32"); expect(result.success).toBeFalsy(); if (!result.success) { - expect(result.error.issues).toEqual([ - { - code: "invalid_string", - message: "Invalid date", - path: [], - validation: "date", - }, - ]); + expect(result.error.issues).toMatchSnapshot(); } }); @@ -58,14 +60,7 @@ describe("ez.dateIn()", () => { const result = schema.safeParse("12.01.2021"); expect(result.success).toBeFalsy(); if (!result.success) { - expect(result.error.issues).toEqual([ - { - code: "invalid_string", - message: "Invalid date", - validation: "date", - path: [], - }, - ]); + expect(result.error.issues).toMatchSnapshot(); } }); }); From 69d59efaffc6563b2e306e2448c56a473a648885 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sun, 21 Apr 2024 13:07:20 +0200 Subject: [PATCH 7/9] Same for ez.file(base64). --- src/file-schema.ts | 2 +- .../__snapshots__/file-schema.spec.ts.snap | 23 +++++++++++++++++++ tests/unit/file-schema.spec.ts | 22 ++++++++++-------- 3 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 tests/unit/__snapshots__/file-schema.spec.ts.snap diff --git a/src/file-schema.ts b/src/file-schema.ts index be1af280c..e02500d8c 100644 --- a/src/file-schema.ts +++ b/src/file-schema.ts @@ -17,7 +17,7 @@ const variants = { binary: () => proprietary(ezFileKind, bufferSchema.or(z.string())), base64: () => { const base = z.string(); - const hasBase64Method = typeof base.base64 === "function"; + const hasBase64Method = base.base64?.() instanceof z.ZodString; return proprietary( ezFileKind, hasBase64Method diff --git a/tests/unit/__snapshots__/file-schema.spec.ts.snap b/tests/unit/__snapshots__/file-schema.spec.ts.snap new file mode 100644 index 000000000..86fd2fccb --- /dev/null +++ b/tests/unit/__snapshots__/file-schema.spec.ts.snap @@ -0,0 +1,23 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ez.file() current mode > parsing > should perform additional check for base64 file 1`] = ` +[ + { + "code": "invalid_string", + "message": "Invalid base64", + "path": [], + "validation": "base64", + }, +] +`; + +exports[`ez.file() legacy mode > parsing > should perform additional check for base64 file 1`] = ` +[ + { + "code": "invalid_string", + "message": "Does not match base64 encoding", + "path": [], + "validation": "regex", + }, +] +`; diff --git a/tests/unit/file-schema.spec.ts b/tests/unit/file-schema.spec.ts index f20223875..990a903e1 100644 --- a/tests/unit/file-schema.spec.ts +++ b/tests/unit/file-schema.spec.ts @@ -3,9 +3,18 @@ import { z } from "zod"; import { getMeta } from "../../src/metadata"; import { ez } from "../../src"; import { readFile } from "node:fs/promises"; -import { describe, expect, test } from "vitest"; +import { beforeAll, describe, expect, test, vi } from "vitest"; + +describe.each(["current", "legacy"])("ez.file() %s mode", (mode) => { + // @todo remove after min zod v3.23 (v19) + beforeAll(() => { + if (mode === "legacy") { + vi.spyOn(z.ZodString.prototype, "base64").mockImplementation( + () => null as unknown as z.ZodString, + ); + } + }); -describe("ez.file()", () => { describe("creation", () => { test("should create an instance being string by default", () => { const schema = ez.file(); @@ -76,14 +85,7 @@ describe("ez.file()", () => { const result = schema.safeParse("~~~~"); expect(result.success).toBeFalsy(); if (!result.success) { - expect(result.error.issues).toEqual([ - { - code: "invalid_string", - message: "Invalid base64", - path: [], - validation: "base64", - }, - ]); + expect(result.error.issues).toMatchSnapshot(); } }); From b8fb619bd1556b939c05b84d19ad42b288f01059 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Mon, 22 Apr 2024 07:09:29 +0200 Subject: [PATCH 8/9] Using 3.23.0. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 11fe52910..004f05bac 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "tsx": "^4.6.2", "typescript": "^5.2.2", "vitest": "^1.5.0", - "zod": "beta" + "zod": "^3.23.0" }, "keywords": [ "nodejs", diff --git a/yarn.lock b/yarn.lock index df112b7d7..c69e56d7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4739,7 +4739,7 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -zod@beta: - version "3.23.0-beta.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.0-beta.2.tgz#4ac8ec78c8985b619eac1fa8359105c6bce083e0" - integrity sha512-u5wv4OKNPwybJMpVsBZc2LZq5DEk+64xloBnD/QwvfdLimLE0+3cqxMbOZzHwe44vseinF3DoHz7KCWV1MLfAg== +zod@^3.23.0: + version "3.23.0" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.0.tgz#a25dab5052702834233e0041e9dd8b6a8480e744" + integrity sha512-OFLT+LTocvabn6q76BTwVB0hExEBS0IduTr3cqZyMqEDbOnYmcU+y0tUAYbND4uwclpBGi4I4UUBGzylWpjLGA== From 46c921f9897e93f6c3b6334eb2da83a81bc3925a Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Mon, 22 Apr 2024 07:51:18 +0200 Subject: [PATCH 9/9] Changelog: 18.1.0. --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17a67feb8..d128b5a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Version 18 +### v18.1.0 + +- Optimization for `zod` 3.23: + - `zod` 3.23 offers + [several features on handling strings](https://github.com/colinhacks/zod/releases/tag/v3.23.0); + - It's also claimed to be "the final 3.x release before Zod 4.0".; + - Using the featured `zod` refinements in the following proprietary schemas: `ez.dateIn()` and `ez.file("base64")`; + - The changes are non-breaking and the compatibility to `zod` 3.22 remains; + - Validation error messages will depend on actual `zod` version installed. + ### v18.0.0 - **Breaking changes**: