Comparing version 3.23.0-canary.20240321T233535 to 3.23.0-canary.20240322T225818
@@ -27,6 +27,11 @@ export declare namespace util { | ||
} & V; | ||
type optionalKeys<T extends object> = { | ||
[k in keyof T]: undefined extends T[k] ? k : never; | ||
}[keyof T]; | ||
type requiredKeys<T extends object> = { | ||
[k in keyof T]: undefined extends T[k] ? never : k; | ||
}[keyof T]; | ||
export type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>> = Pick<Required<T>, R> & Partial<T>; | ||
export type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>, O extends keyof T = optionalKeys<T>> = Pick<T, R> & Partial<Pick<T, O>> & { | ||
[k in keyof T]?: unknown; | ||
}; | ||
export type identity<T> = T; | ||
@@ -33,0 +38,0 @@ export type flatten<T> = identity<{ |
@@ -550,5 +550,5 @@ import { enumUtil } from "./helpers/enumUtil"; | ||
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>; | ||
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>; | ||
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>; | ||
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>; | ||
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_3]; }>; | ||
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_3]; }>; | ||
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1], { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? k_1 : never; }[keyof T_1]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_3]; }>; | ||
} | ||
@@ -901,3 +901,3 @@ export declare type AnyZodObject = ZodObject<any, any, any>; | ||
export declare const late: { | ||
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>; | ||
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_3]; }>; | ||
}; | ||
@@ -996,4 +996,4 @@ export declare enum ZodFirstPartyTypeKind { | ||
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T, "many">; | ||
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>; | ||
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>; | ||
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_3]; }>; | ||
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k_2 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T], { [k_1 in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k_1] ? k_1 : never; }[keyof T]>[k_2]; }, { [k_3 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_3]; }>; | ||
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>; | ||
@@ -1000,0 +1000,0 @@ declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create; |
{ | ||
"name": "zod", | ||
"version": "3.23.0-canary.20240321T233535", | ||
"version": "3.23.0-canary.20240322T225818", | ||
"author": "Colin McDonnell <colin@colinhacks.com>", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
641009
14441