zod 3.23.0 → 3.23.2
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/lib/helpers/util.d.ts +1 -1
- package/lib/types.d.ts +7 -7
- package/package.json +2 -2
package/lib/helpers/util.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare namespace objectUtil {
|
|
|
31
31
|
type requiredKeys<T extends object> = {
|
|
32
32
|
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
33
33
|
}[keyof T];
|
|
34
|
-
export type addQuestionMarks<T extends object> = {
|
|
34
|
+
export type addQuestionMarks<T extends object, _O = any> = {
|
|
35
35
|
[K in requiredKeys<T>]: T[K];
|
|
36
36
|
} & {
|
|
37
37
|
[K in optionalKeys<T>]?: T[K];
|
package/lib/types.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare type SafeParseError<Input> = {
|
|
|
44
44
|
data?: never;
|
|
45
45
|
};
|
|
46
46
|
export declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
47
|
-
export declare abstract class ZodType<Output =
|
|
47
|
+
export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = any> {
|
|
48
48
|
readonly _type: Output;
|
|
49
49
|
readonly _output: Output;
|
|
50
50
|
readonly _input: Input;
|
|
@@ -589,9 +589,9 @@ export declare class ZodObject<T extends ZodRawShape, UnknownKeys extends Unknow
|
|
|
589
589
|
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
590
590
|
}>, UnknownKeys, Catchall>;
|
|
591
591
|
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
592
|
-
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1
|
|
593
|
-
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1
|
|
594
|
-
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1
|
|
592
|
+
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
593
|
+
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
594
|
+
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
595
595
|
}
|
|
596
596
|
export declare type AnyZodObject = ZodObject<any, any, any>;
|
|
597
597
|
export declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
@@ -954,7 +954,7 @@ export declare function custom<T>(check?: (data: any) => any, params?: string |
|
|
|
954
954
|
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
|
955
955
|
export { ZodType as Schema, ZodType as ZodSchema };
|
|
956
956
|
export declare const late: {
|
|
957
|
-
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T
|
|
957
|
+
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_1]; }>;
|
|
958
958
|
};
|
|
959
959
|
export declare enum ZodFirstPartyTypeKind {
|
|
960
960
|
ZodString = "ZodString",
|
|
@@ -1053,8 +1053,8 @@ declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
|
|
1053
1053
|
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
|
1054
1054
|
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
|
1055
1055
|
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T, "many">;
|
|
1056
|
-
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T
|
|
1057
|
-
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T
|
|
1056
|
+
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_1]; }>;
|
|
1057
|
+
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_1]; }>;
|
|
1058
1058
|
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>;
|
|
1059
1059
|
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
|
1060
1060
|
declare const intersectionType: <T extends ZodTypeAny, U extends ZodTypeAny>(left: T, right: U, params?: RawCreateParams) => ZodIntersection<T, U>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.2",
|
|
4
4
|
"author": "Colin McDonnell <colin@colinhacks.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/colinhacks/zod"
|
|
7
|
+
"url": "git+https://github.com/colinhacks/zod.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "./lib/index.js",
|
|
10
10
|
"module": "./lib/index.mjs",
|