Skip to content

Commit 4c0d8bd

Browse files
chore(deps): update dependency zod to v4.2.0 (#3132)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [zod](https://zod.dev) ([source](https://redirect.github.com/colinhacks/zod)) | [`4.1.13` -> `4.2.0`](https://renovatebot.com/diffs/npm/zod/4.1.13/4.2.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/zod/4.2.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/zod/4.1.13/4.2.0?slim=true) | --- ### Release Notes <details> <summary>colinhacks/zod (zod)</summary> ### [`v4.2.0`](https://redirect.github.com/colinhacks/zod/releases/tag/v4.2.0) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v4.1.13...v4.2.0) #### Features ##### Implement Standard JSON Schema [standard-schema/standard-schema#134](https://redirect.github.com/standard-schema/standard-schema/pull/134) ##### Implement `z.fromJSONSchema()` ```typescript const jsonSchema = { type: "object", properties: { name: { type: "string" }, age: { type: "number" } }, required: ["name"] }; const schema = z.fromJSONSchema(jsonSchema); ``` ##### Implement `z.xor()` ```typescript const schema = z.xor( z.object({ type: "user", name: z.string() }), z.object({ type: "admin", role: z.string() }) ); // Exactly one of the schemas must match ``` ##### Implement `z.looseRecord()` ```typescript const schema = z.looseRecord(z.string(), z.number()); // Allows additional properties beyond those defined ``` #### Commits: - [`af49c08`](https://redirect.github.com/colinhacks/zod/commit/af49c084f66339110d00e37ff71dc7b3b9f2b7ef) Update docs for JSON Schema conversion of `z.undefined()` ([#&#8203;5504](https://redirect.github.com/colinhacks/zod/issues/5504)) - [`767f320`](https://redirect.github.com/colinhacks/zod/commit/767f320318986e422f524b939f1a7174544fda2e) Add `.toJSONSchema()` method ([#&#8203;5477](https://redirect.github.com/colinhacks/zod/issues/5477)) - [`e17dcb6`](https://redirect.github.com/colinhacks/zod/commit/e17dcb63573397063e87d7c7fe10a5a78968181a) Add `z.fromJSONSchema()`, `z.looseRecord()`, `z.xor()` ([#&#8203;5534](https://redirect.github.com/colinhacks/zod/issues/5534)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/RobinTail/express-zod-api). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi40Mi4yIiwidXBkYXRlZEluVmVyIjoiNDIuNDIuMiIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Anna Bocharova <[email protected]>
1 parent 3b33394 commit 4c0d8bd

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

express-zod-api/src/diagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class Diagnostics {
2626
): void {
2727
if (ref.isSchemaChecked) return;
2828
for (const dir of ["input", "output"] as const) {
29-
const stack = [
29+
const stack: z.core.JSONSchema.BaseSchema[] = [
3030
z.toJSONSchema(endpoint[`${dir}Schema`], { unrepresentable: "any" }),
3131
];
3232
while (stack.length > 0) {

express-zod-api/tests/__snapshots__/env.spec.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodEmai
2323
],
2424
"parse": [Function],
2525
"pattern": /\\^\\(\\?!\\\\\\.\\)\\(\\?!\\.\\*\\\\\\.\\\\\\.\\)\\(\\[A-Za-z0-9_'\\+\\\\-\\\\\\.\\]\\*\\)\\[A-Za-z0-9_\\+-\\]@\\(\\[A-Za-z0-9\\]\\[A-Za-z0-9\\\\-\\]\\*\\\\\\.\\)\\+\\[A-Za-z\\]\\{2,\\}\\$/,
26+
"processJSONSchema": [Function],
2627
"run": [Function],
2728
"traits": Set {
2829
"ZodEmail",
@@ -62,6 +63,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
6263
"deferred": [],
6364
"parse": [Function],
6465
"pattern": /\\^-\\?\\\\d\\+\\$/,
66+
"processJSONSchema": [Function],
6567
"run": [Function],
6668
"traits": Set {
6769
"ZodNumber",
@@ -94,6 +96,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
9496
],
9597
"parse": [Function],
9698
"pattern": /\\^-\\?\\\\d\\+\\$/,
99+
"processJSONSchema": [Function],
97100
"run": [Function],
98101
"traits": Set {
99102
"ZodNumberFormat",
@@ -130,6 +133,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
130133
],
131134
"parse": [Function],
132135
"pattern": /\\^-\\?\\\\d\\+\\$/,
136+
"processJSONSchema": [Function],
133137
"run": [Function],
134138
"traits": Set {
135139
"ZodNumberFormat",
@@ -169,6 +173,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
169173
],
170174
"parse": [Function],
171175
"pattern": /\\^-\\?\\\\d\\+\\$/,
176+
"processJSONSchema": [Function],
172177
"run": [Function],
173178
"traits": Set {
174179
"ZodNumberFormat",
@@ -206,6 +211,7 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodStri
206211
"deferred": [],
207212
"parse": [Function],
208213
"pattern": /\\^\\(\\?!\\\\\\.\\)\\(\\?!\\.\\*\\\\\\.\\\\\\.\\)\\(\\[A-Za-z0-9_'\\+\\\\-\\\\\\.\\]\\*\\)\\[A-Za-z0-9_\\+-\\]@\\(\\[A-Za-z0-9\\]\\[A-Za-z0-9\\\\-\\]\\*\\\\\\.\\)\\+\\[A-Za-z\\]\\{2,\\}\\$/,
214+
"processJSONSchema": [Function],
209215
"run": [Function],
210216
"traits": Set {
211217
"ZodString",

pnpm-lock.yaml

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ catalogs:
6464
"http-errors": "^2.0.1"
6565
"typescript": "^5.9.2"
6666
"typescript-eslint": "^8.46.1"
67-
"zod": "^4.1.13"
67+
"zod": "^4.2.0"
6868
overrides:
6969
"@scarf/scarf": "npm:[email protected]"

0 commit comments

Comments
 (0)