zod 4.0.0-beta.20250410T194338 → 4.0.0-beta.20250410T221232
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/dist/commonjs/schemas.d.ts +13 -6
- package/dist/commonjs/schemas.js +12 -2
- package/dist/esm/schemas.d.ts +13 -6
- package/dist/esm/schemas.js +9 -0
- package/package.json +2 -2
- package/src/schemas.ts +25 -7
|
@@ -83,6 +83,8 @@ export interface _ZodString<Input = unknown> extends ZodType {
|
|
|
83
83
|
ulid(params?: string | core.$ZodCheckULIDParams): this;
|
|
84
84
|
/** @deprecated Use `z.base64()` instead. */
|
|
85
85
|
base64(params?: string | core.$ZodCheckBase64Params): this;
|
|
86
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
87
|
+
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
|
|
86
88
|
/** @deprecated Use `z.xid()` instead. */
|
|
87
89
|
xid(params?: string | core.$ZodCheckXIDParams): this;
|
|
88
90
|
/** @deprecated Use `z.ksuid()` instead. */
|
|
@@ -214,6 +216,11 @@ export interface ZodBase64 extends ZodStringFormat<"base64"> {
|
|
|
214
216
|
}
|
|
215
217
|
export declare const ZodBase64: core.$constructor<ZodBase64>;
|
|
216
218
|
export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
|
|
219
|
+
export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
|
|
220
|
+
_zod: core.$ZodBase64URLInternals;
|
|
221
|
+
}
|
|
222
|
+
export declare const ZodBase64URL: core.$constructor<ZodBase64URL>;
|
|
223
|
+
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL;
|
|
217
224
|
export interface ZodE164 extends ZodStringFormat<"e164"> {
|
|
218
225
|
_zod: core.$ZodE164Internals;
|
|
219
226
|
}
|
|
@@ -263,19 +270,19 @@ export interface ZodNumberFormat extends ZodNumber {
|
|
|
263
270
|
_zod: core.$ZodNumberFormatInternals;
|
|
264
271
|
}
|
|
265
272
|
export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
|
|
266
|
-
interface ZodInt extends ZodNumberFormat {
|
|
273
|
+
export interface ZodInt extends ZodNumberFormat {
|
|
267
274
|
}
|
|
268
275
|
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
|
|
269
|
-
interface ZodFloat32 extends ZodNumberFormat {
|
|
276
|
+
export interface ZodFloat32 extends ZodNumberFormat {
|
|
270
277
|
}
|
|
271
278
|
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
|
|
272
|
-
interface ZodFloat64 extends ZodNumberFormat {
|
|
279
|
+
export interface ZodFloat64 extends ZodNumberFormat {
|
|
273
280
|
}
|
|
274
281
|
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
|
|
275
|
-
interface ZodInt32 extends ZodNumberFormat {
|
|
282
|
+
export interface ZodInt32 extends ZodNumberFormat {
|
|
276
283
|
}
|
|
277
284
|
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
|
|
278
|
-
interface ZodUInt32 extends ZodNumberFormat {
|
|
285
|
+
export interface ZodUInt32 extends ZodNumberFormat {
|
|
279
286
|
}
|
|
280
287
|
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
|
|
281
288
|
export interface _ZodBoolean<T = unknown> extends ZodType {
|
|
@@ -744,6 +751,6 @@ export type ZodJSONSchema = ZodUnion<[
|
|
|
744
751
|
};
|
|
745
752
|
};
|
|
746
753
|
export declare function json(params?: core.$ZodCustomParams): ZodJSONSchema;
|
|
747
|
-
interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {
|
|
754
|
+
export interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {
|
|
748
755
|
}
|
|
749
756
|
export declare function preprocess<A, U extends core.$ZodType>(fn: (arg: unknown, ctx: RefinementCtx) => A, schema: U, params?: ZodPreprocessParams): ZodPipe<ZodTransform<A, unknown>, U>;
|
package/dist/commonjs/schemas.js
CHANGED
|
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransform = void 0;
|
|
36
|
+
exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodInterface = exports.ZodObjectLike = exports.ZodArray = exports.ZodDate = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodBigIntFormat = exports.ZodBigInt = exports.ZodBoolean = exports.ZodNumberFormat = exports.ZodNumber = exports.ZodJWT = exports.ZodE164 = exports.ZodBase64URL = exports.ZodBase64 = exports.ZodCIDRv6 = exports.ZodCIDRv4 = exports.ZodIPv6 = exports.ZodIPv4 = exports.ZodKSUID = exports.ZodXID = exports.ZodULID = exports.ZodCUID2 = exports.ZodCUID = exports.ZodNanoID = exports.ZodEmoji = exports.ZodURL = exports.ZodUUID = exports.ZodGUID = exports.ZodEmail = exports.ZodStringFormat = exports.ZodString = exports.ZodType = exports.coerce = exports.iso = void 0;
|
|
37
|
+
exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransform = exports.ZodFile = void 0;
|
|
38
38
|
exports.string = string;
|
|
39
39
|
exports.email = email;
|
|
40
40
|
exports.guid = guid;
|
|
@@ -55,6 +55,7 @@ exports.ipv6 = ipv6;
|
|
|
55
55
|
exports.cidrv4 = cidrv4;
|
|
56
56
|
exports.cidrv6 = cidrv6;
|
|
57
57
|
exports.base64 = base64;
|
|
58
|
+
exports.base64url = base64url;
|
|
58
59
|
exports.e164 = e164;
|
|
59
60
|
exports.jwt = jwt;
|
|
60
61
|
exports.number = number;
|
|
@@ -219,6 +220,7 @@ exports.ZodString = core.$constructor("ZodString", (inst, def) => {
|
|
|
219
220
|
inst.cuid2 = (params) => inst.check(core._cuid2(exports.ZodCUID2, params));
|
|
220
221
|
inst.ulid = (params) => inst.check(core._ulid(exports.ZodULID, params));
|
|
221
222
|
inst.base64 = (params) => inst.check(core._base64(exports.ZodBase64, params));
|
|
223
|
+
inst.base64url = (params) => inst.check(core._base64url(exports.ZodBase64URL, params));
|
|
222
224
|
// inst.jsonString = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
223
225
|
// inst.json = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
224
226
|
inst.xid = (params) => inst.check(core._xid(exports.ZodXID, params));
|
|
@@ -400,6 +402,14 @@ exports.ZodBase64 = core.$constructor("ZodBase64", (inst, def) => {
|
|
|
400
402
|
function base64(params) {
|
|
401
403
|
return core._base64(exports.ZodBase64, params);
|
|
402
404
|
}
|
|
405
|
+
exports.ZodBase64URL = core.$constructor("ZodBase64URL", (inst, def) => {
|
|
406
|
+
// ZodStringFormat.init(inst, def);
|
|
407
|
+
core.$ZodBase64URL.init(inst, def);
|
|
408
|
+
exports.ZodType.init(inst, def);
|
|
409
|
+
});
|
|
410
|
+
function base64url(params) {
|
|
411
|
+
return core._base64url(exports.ZodBase64URL, params);
|
|
412
|
+
}
|
|
403
413
|
exports.ZodE164 = core.$constructor("ZodE164", (inst, def) => {
|
|
404
414
|
// ZodStringFormat.init(inst, def);
|
|
405
415
|
core.$ZodE164.init(inst, def);
|
package/dist/esm/schemas.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export interface _ZodString<Input = unknown> extends ZodType {
|
|
|
83
83
|
ulid(params?: string | core.$ZodCheckULIDParams): this;
|
|
84
84
|
/** @deprecated Use `z.base64()` instead. */
|
|
85
85
|
base64(params?: string | core.$ZodCheckBase64Params): this;
|
|
86
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
87
|
+
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
|
|
86
88
|
/** @deprecated Use `z.xid()` instead. */
|
|
87
89
|
xid(params?: string | core.$ZodCheckXIDParams): this;
|
|
88
90
|
/** @deprecated Use `z.ksuid()` instead. */
|
|
@@ -214,6 +216,11 @@ export interface ZodBase64 extends ZodStringFormat<"base64"> {
|
|
|
214
216
|
}
|
|
215
217
|
export declare const ZodBase64: core.$constructor<ZodBase64>;
|
|
216
218
|
export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
|
|
219
|
+
export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
|
|
220
|
+
_zod: core.$ZodBase64URLInternals;
|
|
221
|
+
}
|
|
222
|
+
export declare const ZodBase64URL: core.$constructor<ZodBase64URL>;
|
|
223
|
+
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL;
|
|
217
224
|
export interface ZodE164 extends ZodStringFormat<"e164"> {
|
|
218
225
|
_zod: core.$ZodE164Internals;
|
|
219
226
|
}
|
|
@@ -263,19 +270,19 @@ export interface ZodNumberFormat extends ZodNumber {
|
|
|
263
270
|
_zod: core.$ZodNumberFormatInternals;
|
|
264
271
|
}
|
|
265
272
|
export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
|
|
266
|
-
interface ZodInt extends ZodNumberFormat {
|
|
273
|
+
export interface ZodInt extends ZodNumberFormat {
|
|
267
274
|
}
|
|
268
275
|
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
|
|
269
|
-
interface ZodFloat32 extends ZodNumberFormat {
|
|
276
|
+
export interface ZodFloat32 extends ZodNumberFormat {
|
|
270
277
|
}
|
|
271
278
|
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
|
|
272
|
-
interface ZodFloat64 extends ZodNumberFormat {
|
|
279
|
+
export interface ZodFloat64 extends ZodNumberFormat {
|
|
273
280
|
}
|
|
274
281
|
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
|
|
275
|
-
interface ZodInt32 extends ZodNumberFormat {
|
|
282
|
+
export interface ZodInt32 extends ZodNumberFormat {
|
|
276
283
|
}
|
|
277
284
|
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
|
|
278
|
-
interface ZodUInt32 extends ZodNumberFormat {
|
|
285
|
+
export interface ZodUInt32 extends ZodNumberFormat {
|
|
279
286
|
}
|
|
280
287
|
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
|
|
281
288
|
export interface _ZodBoolean<T = unknown> extends ZodType {
|
|
@@ -744,6 +751,6 @@ export type ZodJSONSchema = ZodUnion<[
|
|
|
744
751
|
};
|
|
745
752
|
};
|
|
746
753
|
export declare function json(params?: core.$ZodCustomParams): ZodJSONSchema;
|
|
747
|
-
interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {
|
|
754
|
+
export interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {
|
|
748
755
|
}
|
|
749
756
|
export declare function preprocess<A, U extends core.$ZodType>(fn: (arg: unknown, ctx: RefinementCtx) => A, schema: U, params?: ZodPreprocessParams): ZodPipe<ZodTransform<A, unknown>, U>;
|
package/dist/esm/schemas.js
CHANGED
|
@@ -96,6 +96,7 @@ export const ZodString = /*@__PURE__*/ core.$constructor("ZodString", (inst, def
|
|
|
96
96
|
inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
|
|
97
97
|
inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
|
|
98
98
|
inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
|
|
99
|
+
inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
|
|
99
100
|
// inst.jsonString = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
100
101
|
// inst.json = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
101
102
|
inst.xid = (params) => inst.check(core._xid(ZodXID, params));
|
|
@@ -277,6 +278,14 @@ export const ZodBase64 = /*@__PURE__*/ core.$constructor("ZodBase64", (inst, def
|
|
|
277
278
|
export function base64(params) {
|
|
278
279
|
return core._base64(ZodBase64, params);
|
|
279
280
|
}
|
|
281
|
+
export const ZodBase64URL = /*@__PURE__*/ core.$constructor("ZodBase64URL", (inst, def) => {
|
|
282
|
+
// ZodStringFormat.init(inst, def);
|
|
283
|
+
core.$ZodBase64URL.init(inst, def);
|
|
284
|
+
ZodType.init(inst, def);
|
|
285
|
+
});
|
|
286
|
+
export function base64url(params) {
|
|
287
|
+
return core._base64url(ZodBase64URL, params);
|
|
288
|
+
}
|
|
280
289
|
export const ZodE164 = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) => {
|
|
281
290
|
// ZodStringFormat.init(inst, def);
|
|
282
291
|
core.$ZodE164.init(inst, def);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.20250410T221232",
|
|
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",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@zod/core": "0.
|
|
73
|
+
"@zod/core": "0.3.1"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"clean": "rm -rf dist",
|
package/src/schemas.ts
CHANGED
|
@@ -212,6 +212,8 @@ export interface _ZodString<Input = unknown> extends ZodType {
|
|
|
212
212
|
ulid(params?: string | core.$ZodCheckULIDParams): this;
|
|
213
213
|
/** @deprecated Use `z.base64()` instead. */
|
|
214
214
|
base64(params?: string | core.$ZodCheckBase64Params): this;
|
|
215
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
216
|
+
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
|
|
215
217
|
// /** @deprecated Use `z.jsonString()` instead. */
|
|
216
218
|
// jsonString(params?: string | core.$ZodCheckJSONStringParams): this;
|
|
217
219
|
/** @deprecated Use `z.xid()` instead. */
|
|
@@ -295,6 +297,7 @@ export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$const
|
|
|
295
297
|
inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
|
|
296
298
|
inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
|
|
297
299
|
inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
|
|
300
|
+
inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
|
|
298
301
|
// inst.jsonString = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
299
302
|
// inst.json = (params) => inst.check(core._jsonString(Zodinst,params));
|
|
300
303
|
inst.xid = (params) => inst.check(core._xid(ZodXID, params));
|
|
@@ -598,11 +601,26 @@ export const ZodBase64: core.$constructor<ZodBase64> = /*@__PURE__*/ core.$const
|
|
|
598
601
|
core.$ZodBase64.init(inst, def);
|
|
599
602
|
ZodType.init(inst, def);
|
|
600
603
|
});
|
|
601
|
-
|
|
602
604
|
export function base64(params?: string | core.$ZodBase64Params): ZodBase64 {
|
|
603
605
|
return core._base64(ZodBase64, params);
|
|
604
606
|
}
|
|
605
607
|
|
|
608
|
+
// ZodBase64URL
|
|
609
|
+
export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
|
|
610
|
+
_zod: core.$ZodBase64URLInternals;
|
|
611
|
+
}
|
|
612
|
+
export const ZodBase64URL: core.$constructor<ZodBase64URL> = /*@__PURE__*/ core.$constructor(
|
|
613
|
+
"ZodBase64URL",
|
|
614
|
+
(inst, def) => {
|
|
615
|
+
// ZodStringFormat.init(inst, def);
|
|
616
|
+
core.$ZodBase64URL.init(inst, def);
|
|
617
|
+
ZodType.init(inst, def);
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
export function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL {
|
|
621
|
+
return core._base64url(ZodBase64URL, params);
|
|
622
|
+
}
|
|
623
|
+
|
|
606
624
|
// ZodE164
|
|
607
625
|
export interface ZodE164 extends ZodStringFormat<"e164"> {
|
|
608
626
|
_zod: core.$ZodE164Internals;
|
|
@@ -716,31 +734,31 @@ export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/
|
|
|
716
734
|
);
|
|
717
735
|
|
|
718
736
|
// int
|
|
719
|
-
interface ZodInt extends ZodNumberFormat {}
|
|
737
|
+
export interface ZodInt extends ZodNumberFormat {}
|
|
720
738
|
export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
|
|
721
739
|
return core._int(ZodNumberFormat, params);
|
|
722
740
|
}
|
|
723
741
|
|
|
724
742
|
// float32
|
|
725
|
-
interface ZodFloat32 extends ZodNumberFormat {}
|
|
743
|
+
export interface ZodFloat32 extends ZodNumberFormat {}
|
|
726
744
|
export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
|
|
727
745
|
return core._float32(ZodNumberFormat, params);
|
|
728
746
|
}
|
|
729
747
|
|
|
730
748
|
// float64
|
|
731
|
-
interface ZodFloat64 extends ZodNumberFormat {}
|
|
749
|
+
export interface ZodFloat64 extends ZodNumberFormat {}
|
|
732
750
|
export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
|
|
733
751
|
return core._float64(ZodNumberFormat, params);
|
|
734
752
|
}
|
|
735
753
|
|
|
736
754
|
// int32
|
|
737
|
-
interface ZodInt32 extends ZodNumberFormat {}
|
|
755
|
+
export interface ZodInt32 extends ZodNumberFormat {}
|
|
738
756
|
export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
|
|
739
757
|
return core._int32(ZodNumberFormat, params);
|
|
740
758
|
}
|
|
741
759
|
|
|
742
760
|
// uint32
|
|
743
|
-
interface ZodUInt32 extends ZodNumberFormat {}
|
|
761
|
+
export interface ZodUInt32 extends ZodNumberFormat {}
|
|
744
762
|
export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
|
|
745
763
|
return core._uint32(ZodNumberFormat, params);
|
|
746
764
|
}
|
|
@@ -2347,7 +2365,7 @@ export function json(params?: core.$ZodCustomParams): ZodJSONSchema {
|
|
|
2347
2365
|
}
|
|
2348
2366
|
|
|
2349
2367
|
// preprocess
|
|
2350
|
-
interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {}
|
|
2368
|
+
export interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {}
|
|
2351
2369
|
|
|
2352
2370
|
// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
|
|
2353
2371
|
export function preprocess<A, U extends core.$ZodType>(
|