Comparing version 3.23.0-canary.20240418T224529 to 3.23.0-canary.20240420T221414
@@ -34,9 +34,7 @@ export declare namespace util { | ||
}[keyof T]; | ||
type pickRequired<T extends object, R extends keyof T = requiredKeys<T>> = { | ||
[k in R]: T[k]; | ||
}; | ||
type pickOptional<T extends object, O extends keyof T = optionalKeys<T>> = { | ||
[k in O]?: T[k]; | ||
}; | ||
export type addQuestionMarks<T extends object> = pickRequired<T> & pickOptional<T> & { | ||
export type addQuestionMarks<T extends object> = { | ||
[K in requiredKeys<T>]: T[K]; | ||
} & { | ||
[K in optionalKeys<T>]?: T[K]; | ||
} & { | ||
[k in keyof T]?: unknown; | ||
@@ -55,3 +53,5 @@ }; | ||
export const mergeShapes: <U, T>(first: U, second: T) => T & U; | ||
export type extendShape<A, B> = flatten<Omit<A, keyof B> & B>; | ||
export type extendShape<A extends object, B extends object> = { | ||
[K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A ? A[K] : never; | ||
}; | ||
export {}; | ||
@@ -58,0 +58,0 @@ } |
@@ -554,3 +554,3 @@ import { enumUtil } from "./helpers/enumUtil"; | ||
* */ | ||
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>>; | ||
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<objectUtil.extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<objectUtil.extendShape<T, Augmentation>, Catchall, UnknownKeys>>; | ||
/** | ||
@@ -557,0 +557,0 @@ * Prior to zod@1.0.12 there was a bug in the |
{ | ||
"name": "zod", | ||
"version": "3.23.0-canary.20240418T224529", | ||
"version": "3.23.0-canary.20240420T221414", | ||
"author": "Colin McDonnell <colin@colinhacks.com>", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
3088
673598