zod 4.1.0-canary.20250710T002006 → 4.1.0-canary.20250710T200141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/v4/classic/compat.ts +1 -0
- package/src/v4/classic/schemas.ts +3 -12
- package/src/v4/core/schemas.ts +4 -3
- package/src/v4/core/versions.ts +1 -1
- package/v4/classic/compat.d.cts +1 -0
- package/v4/classic/compat.d.ts +1 -0
- package/v4/classic/schemas.d.cts +3 -12
- package/v4/classic/schemas.d.ts +3 -12
- package/v4/core/schemas.d.cts +4 -3
- package/v4/core/schemas.d.ts +4 -3
- package/v4/core/versions.cjs +1 -1
- package/v4/core/versions.js +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<br/>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
-
<a href="https://github.com/colinhacks/zod/actions?query=branch%
|
|
13
|
+
<a href="https://github.com/colinhacks/zod/actions?query=branch%3Amain"><img src="https://github.com/colinhacks/zod/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Zod CI status" /></a>
|
|
14
14
|
<a href="https://opensource.org/licenses/MIT" rel="nofollow"><img src="https://img.shields.io/github/license/colinhacks/zod" alt="License"></a>
|
|
15
15
|
<a href="https://www.npmjs.com/package/zod" rel="nofollow"><img src="https://img.shields.io/npm/dw/zod.svg" alt="npm"></a>
|
|
16
16
|
<a href="https://discord.gg/KaSRdyX2vc" rel="nofollow"><img src="https://img.shields.io/discord/893487829802418277?label=Discord&logo=discord&logoColor=white" alt="discord server"></a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod",
|
|
3
|
-
"version": "4.1.0-canary.
|
|
3
|
+
"version": "4.1.0-canary.20250710T200141",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Colin McDonnell <zod@colinhacks.com>",
|
|
6
6
|
"description": "TypeScript-first schema declaration and validation library with static type inference",
|
package/src/v4/classic/compat.ts
CHANGED
|
@@ -61,7 +61,8 @@ export interface ZodType<
|
|
|
61
61
|
|
|
62
62
|
// refinements
|
|
63
63
|
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
|
64
|
-
/** @deprecated Use `.check()` instead.
|
|
64
|
+
/** @deprecated Use [`.check()`](https://zod.dev/api?id=check) instead.
|
|
65
|
+
*/
|
|
65
66
|
superRefine(
|
|
66
67
|
refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>
|
|
67
68
|
): this;
|
|
@@ -1074,17 +1075,7 @@ export interface ZodObject<
|
|
|
1074
1075
|
): ZodObject<util.Extend<Shape, U>, Config>;
|
|
1075
1076
|
|
|
1076
1077
|
/**
|
|
1077
|
-
* @deprecated Use
|
|
1078
|
-
*
|
|
1079
|
-
* ```ts
|
|
1080
|
-
* const A = z.object({ a: z.string() });
|
|
1081
|
-
* const B = z.object({ b: z.number() });
|
|
1082
|
-
*
|
|
1083
|
-
* const C = z.object({
|
|
1084
|
-
* ...A.shape,
|
|
1085
|
-
* ...B.shape
|
|
1086
|
-
* });
|
|
1087
|
-
* ```
|
|
1078
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
1088
1079
|
*/
|
|
1089
1080
|
merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
1090
1081
|
|
package/src/v4/core/schemas.ts
CHANGED
|
@@ -2865,9 +2865,10 @@ export const $ZodLiteral: core.$constructor<$ZodLiteral> = /*@__PURE__*/ core.$c
|
|
|
2865
2865
|
//////////////////////////////////////////
|
|
2866
2866
|
|
|
2867
2867
|
// provide a fallback in case the File interface isn't provided in the environment
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
}
|
|
2868
|
+
type _File = typeof globalThis extends { File: new (...args: any[]) => any }
|
|
2869
|
+
? InstanceType<typeof globalThis.File>
|
|
2870
|
+
: {};
|
|
2871
|
+
interface File extends _File {}
|
|
2871
2872
|
|
|
2872
2873
|
export interface $ZodFileDef extends $ZodTypeDef {
|
|
2873
2874
|
type: "file";
|
package/src/v4/core/versions.ts
CHANGED
package/v4/classic/compat.d.cts
CHANGED
package/v4/classic/compat.d.ts
CHANGED
package/v4/classic/schemas.d.cts
CHANGED
|
@@ -25,7 +25,8 @@ export interface ZodType<out Output = unknown, out Input = unknown, out Internal
|
|
|
25
25
|
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
26
26
|
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
27
27
|
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
|
28
|
-
/** @deprecated Use `.check()` instead.
|
|
28
|
+
/** @deprecated Use [`.check()`](https://zod.dev/api?id=check) instead.
|
|
29
|
+
*/
|
|
29
30
|
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
|
30
31
|
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
|
31
32
|
optional(): ZodOptional<this>;
|
|
@@ -416,17 +417,7 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
|
|
416
417
|
strip(): ZodObject<Shape, core.$strip>;
|
|
417
418
|
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
|
|
418
419
|
/**
|
|
419
|
-
* @deprecated Use
|
|
420
|
-
*
|
|
421
|
-
* ```ts
|
|
422
|
-
* const A = z.object({ a: z.string() });
|
|
423
|
-
* const B = z.object({ b: z.number() });
|
|
424
|
-
*
|
|
425
|
-
* const C = z.object({
|
|
426
|
-
* ...A.shape,
|
|
427
|
-
* ...B.shape
|
|
428
|
-
* });
|
|
429
|
-
* ```
|
|
420
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
430
421
|
*/
|
|
431
422
|
merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
432
423
|
pick<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
package/v4/classic/schemas.d.ts
CHANGED
|
@@ -25,7 +25,8 @@ export interface ZodType<out Output = unknown, out Input = unknown, out Internal
|
|
|
25
25
|
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
26
26
|
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
27
27
|
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
|
28
|
-
/** @deprecated Use `.check()` instead.
|
|
28
|
+
/** @deprecated Use [`.check()`](https://zod.dev/api?id=check) instead.
|
|
29
|
+
*/
|
|
29
30
|
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
|
30
31
|
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
|
31
32
|
optional(): ZodOptional<this>;
|
|
@@ -416,17 +417,7 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
|
|
416
417
|
strip(): ZodObject<Shape, core.$strip>;
|
|
417
418
|
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
|
|
418
419
|
/**
|
|
419
|
-
* @deprecated Use
|
|
420
|
-
*
|
|
421
|
-
* ```ts
|
|
422
|
-
* const A = z.object({ a: z.string() });
|
|
423
|
-
* const B = z.object({ b: z.number() });
|
|
424
|
-
*
|
|
425
|
-
* const C = z.object({
|
|
426
|
-
* ...A.shape,
|
|
427
|
-
* ...B.shape
|
|
428
|
-
* });
|
|
429
|
-
* ```
|
|
420
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
430
421
|
*/
|
|
431
422
|
merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
432
423
|
pick<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
package/v4/core/schemas.d.cts
CHANGED
|
@@ -761,9 +761,10 @@ export interface $ZodLiteral<T extends util.Literal = util.Literal> extends $Zod
|
|
|
761
761
|
_zod: $ZodLiteralInternals<T>;
|
|
762
762
|
}
|
|
763
763
|
export declare const $ZodLiteral: core.$constructor<$ZodLiteral>;
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
764
|
+
type _File = typeof globalThis extends {
|
|
765
|
+
File: new (...args: any[]) => any;
|
|
766
|
+
} ? InstanceType<typeof globalThis.File> : {};
|
|
767
|
+
interface File extends _File {
|
|
767
768
|
}
|
|
768
769
|
export interface $ZodFileDef extends $ZodTypeDef {
|
|
769
770
|
type: "file";
|
package/v4/core/schemas.d.ts
CHANGED
|
@@ -761,9 +761,10 @@ export interface $ZodLiteral<T extends util.Literal = util.Literal> extends $Zod
|
|
|
761
761
|
_zod: $ZodLiteralInternals<T>;
|
|
762
762
|
}
|
|
763
763
|
export declare const $ZodLiteral: core.$constructor<$ZodLiteral>;
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
764
|
+
type _File = typeof globalThis extends {
|
|
765
|
+
File: new (...args: any[]) => any;
|
|
766
|
+
} ? InstanceType<typeof globalThis.File> : {};
|
|
767
|
+
interface File extends _File {
|
|
767
768
|
}
|
|
768
769
|
export interface $ZodFileDef extends $ZodTypeDef {
|
|
769
770
|
type: "file";
|
package/v4/core/versions.cjs
CHANGED
package/v4/core/versions.js
CHANGED