zod 3.25.49 → 3.25.50
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/cjs/v4/classic/schemas.js +23 -22
- package/dist/cjs/v4/core/checks.js +2 -0
- package/dist/cjs/v4/core/core.js +2 -1
- package/dist/cjs/v4/core/schemas.js +1 -0
- package/dist/cjs/v4/mini/schemas.js +21 -27
- package/dist/esm/v4/classic/schemas.js +23 -22
- package/dist/esm/v4/core/checks.js +2 -0
- package/dist/esm/v4/core/core.js +2 -1
- package/dist/esm/v4/core/schemas.js +1 -0
- package/dist/esm/v4/mini/schemas.js +21 -27
- package/dist/types/v4/classic/coerce.d.ts +5 -5
- package/dist/types/v4/classic/schemas.d.ts +84 -118
- package/dist/types/v4/core/core.d.ts +3 -11
- package/dist/types/v4/core/schemas.d.ts +121 -108
- package/dist/types/v4/core/util.d.ts +2 -3
- package/dist/types/v4/mini/schemas.d.ts +31 -32
- package/package.json +1 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as core from "zod/v4/core";
|
|
2
2
|
import { util } from "zod/v4/core";
|
|
3
|
-
type SomeType = core
|
|
4
|
-
export interface ZodMiniType<out Output = unknown, out Input = unknown> extends core.$ZodType<Output, Input> {
|
|
3
|
+
type SomeType = core.SomeType;
|
|
4
|
+
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
|
5
5
|
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
|
6
|
-
clone(def?:
|
|
6
|
+
clone(def?: Internals["def"], params?: {
|
|
7
7
|
parent: boolean;
|
|
8
8
|
}): this;
|
|
9
9
|
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
|
10
|
-
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : this & Record<"_zod", Record<"
|
|
11
|
-
def:
|
|
10
|
+
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : this & Record<"_zod", Record<"output", core.output<this> & core.$brand<T>>>;
|
|
11
|
+
def: Internals["def"];
|
|
12
12
|
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
|
13
13
|
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
|
|
14
14
|
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
|
15
15
|
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
|
|
16
16
|
}
|
|
17
|
+
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<Internals["output"], Internals["input"], Internals> {
|
|
18
|
+
}
|
|
17
19
|
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
|
|
18
|
-
export interface ZodMiniString<Input = unknown> extends
|
|
19
|
-
_zod: core.$ZodStringInternals<Input>;
|
|
20
|
+
export interface ZodMiniString<Input = unknown> extends _ZodMiniType<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
|
|
20
21
|
}
|
|
21
22
|
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
|
|
22
23
|
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
|
|
@@ -195,16 +196,14 @@ export interface ZodMiniDate<T = unknown> extends ZodMiniType {
|
|
|
195
196
|
}
|
|
196
197
|
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
|
|
197
198
|
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
|
|
198
|
-
export interface ZodMiniArray<T extends SomeType =
|
|
199
|
-
_zod: core.$ZodArrayInternals<T>;
|
|
199
|
+
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
|
|
200
200
|
}
|
|
201
201
|
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
|
|
202
202
|
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
|
|
203
203
|
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniLiteral<keyof T["shape"]>;
|
|
204
204
|
export interface ZodMiniObject<
|
|
205
205
|
/** @ts-ignore Cast variance */
|
|
206
|
-
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$ZodObjectConfig> extends ZodMiniType {
|
|
207
|
-
_zod: core.$ZodObjectInternals<Shape, Config>;
|
|
206
|
+
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$ZodObjectConfig> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
|
|
208
207
|
shape: Shape;
|
|
209
208
|
}
|
|
210
209
|
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
|
|
@@ -233,40 +232,40 @@ export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObj
|
|
|
233
232
|
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M): ZodMiniObject<util.Extend<T["shape"], {
|
|
234
233
|
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
235
234
|
}>, T["_zod"]["config"]>;
|
|
236
|
-
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly
|
|
235
|
+
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends ZodMiniType {
|
|
237
236
|
_zod: core.$ZodUnionInternals<T>;
|
|
238
237
|
}
|
|
239
238
|
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
|
|
240
239
|
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
|
|
241
|
-
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly
|
|
240
|
+
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[]> extends ZodMiniUnion<Options> {
|
|
242
241
|
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
|
243
242
|
}
|
|
244
243
|
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
|
|
245
244
|
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types>;
|
|
246
|
-
export interface ZodMiniIntersection<A extends SomeType =
|
|
245
|
+
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
247
246
|
_zod: core.$ZodIntersectionInternals<A, B>;
|
|
248
247
|
}
|
|
249
248
|
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
|
|
250
249
|
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
|
|
251
|
-
export interface ZodMiniTuple<T extends util.TupleItems =
|
|
250
|
+
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends ZodMiniType {
|
|
252
251
|
_zod: core.$ZodTupleInternals<T, Rest>;
|
|
253
252
|
}
|
|
254
253
|
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
|
|
255
|
-
export declare function tuple<T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
|
|
256
|
-
export declare function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
|
|
254
|
+
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
|
|
255
|
+
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
|
|
257
256
|
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
|
|
258
|
-
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType =
|
|
257
|
+
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
259
258
|
_zod: core.$ZodRecordInternals<Key, Value>;
|
|
260
259
|
}
|
|
261
260
|
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
|
|
262
261
|
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
|
|
263
262
|
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<ZodMiniUnion<[Key, ZodMiniNever]>, Value>;
|
|
264
|
-
export interface ZodMiniMap<Key extends SomeType =
|
|
263
|
+
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
265
264
|
_zod: core.$ZodMapInternals<Key, Value>;
|
|
266
265
|
}
|
|
267
266
|
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
|
|
268
267
|
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
|
|
269
|
-
export interface ZodMiniSet<T extends SomeType =
|
|
268
|
+
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
270
269
|
_zod: core.$ZodSetInternals<T>;
|
|
271
270
|
}
|
|
272
271
|
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
|
|
@@ -302,38 +301,38 @@ export interface ZodMiniTransform<O = unknown, I = unknown> extends ZodMiniType
|
|
|
302
301
|
}
|
|
303
302
|
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
|
|
304
303
|
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
|
|
305
|
-
export interface ZodMiniOptional<T extends SomeType =
|
|
304
|
+
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
306
305
|
_zod: core.$ZodOptionalInternals<T>;
|
|
307
306
|
}
|
|
308
307
|
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
|
|
309
308
|
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
|
|
310
|
-
export interface ZodMiniNullable<T extends SomeType =
|
|
309
|
+
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
311
310
|
_zod: core.$ZodNullableInternals<T>;
|
|
312
311
|
}
|
|
313
312
|
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
|
|
314
313
|
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
|
|
315
314
|
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
|
|
316
|
-
export interface ZodMiniDefault<T extends SomeType =
|
|
315
|
+
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
317
316
|
_zod: core.$ZodDefaultInternals<T>;
|
|
318
317
|
}
|
|
319
318
|
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
|
|
320
319
|
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
|
|
321
|
-
export interface ZodMiniPrefault<T extends SomeType =
|
|
320
|
+
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
322
321
|
_zod: core.$ZodPrefaultInternals<T>;
|
|
323
322
|
}
|
|
324
323
|
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
|
|
325
324
|
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.input<T>> | (() => util.NoUndefined<core.input<T>>)): ZodMiniPrefault<T>;
|
|
326
|
-
export interface ZodMiniNonOptional<T extends SomeType =
|
|
325
|
+
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
327
326
|
_zod: core.$ZodNonOptionalInternals<T>;
|
|
328
327
|
}
|
|
329
328
|
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
|
|
330
329
|
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
|
|
331
|
-
export interface ZodMiniSuccess<T extends SomeType =
|
|
330
|
+
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
332
331
|
_zod: core.$ZodSuccessInternals<T>;
|
|
333
332
|
}
|
|
334
333
|
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
|
|
335
334
|
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
|
|
336
|
-
export interface ZodMiniCatch<T extends SomeType =
|
|
335
|
+
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
337
336
|
_zod: core.$ZodCatchInternals<T>;
|
|
338
337
|
}
|
|
339
338
|
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
|
|
@@ -344,12 +343,12 @@ export interface ZodMiniNaN extends ZodMiniType {
|
|
|
344
343
|
}
|
|
345
344
|
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
|
|
346
345
|
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
|
|
347
|
-
export interface ZodMiniPipe<A extends SomeType =
|
|
346
|
+
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
348
347
|
_zod: core.$ZodPipeInternals<A, B>;
|
|
349
348
|
}
|
|
350
349
|
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
|
|
351
|
-
export declare function pipe<const A extends
|
|
352
|
-
export interface ZodMiniReadonly<T extends SomeType =
|
|
350
|
+
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
|
|
351
|
+
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
353
352
|
_zod: core.$ZodReadonlyInternals<T>;
|
|
354
353
|
}
|
|
355
354
|
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
|
@@ -359,13 +358,13 @@ export interface ZodMiniTemplateLiteral<Template extends string = string> extend
|
|
|
359
358
|
}
|
|
360
359
|
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
|
|
361
360
|
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
|
362
|
-
export interface ZodMiniLazy<T extends SomeType =
|
|
361
|
+
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
363
362
|
_zod: core.$ZodLazyInternals<T>;
|
|
364
363
|
}
|
|
365
364
|
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
|
|
366
365
|
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
|
|
367
366
|
export { _lazy as lazy };
|
|
368
|
-
export interface ZodMiniPromise<T extends SomeType =
|
|
367
|
+
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends ZodMiniType {
|
|
369
368
|
_zod: core.$ZodPromiseInternals<T>;
|
|
370
369
|
}
|
|
371
370
|
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
|
package/package.json
CHANGED