0.1.2 #3
@@ -0,0 +1 @@
|
|||||||
|
export { ExtendableZodSchemaObject } from "./traits/ExtendableZodSchemaObject"
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
export type CommonKeys<A, B> = Extract<keyof A, keyof B>
|
export type CommonKeys<A, B> = Extract<keyof A, keyof B>
|
||||||
|
|
||||||
/**
|
export type Extend<T extends readonly object[]> = (
|
||||||
* Merges an inheritance tree defined by an array of types, considering overrides.
|
T extends [
|
||||||
* @template T - An array of types representing the inheritance tree.
|
infer Super,
|
||||||
*/
|
infer Self,
|
||||||
export type Extend<T extends readonly any[]> = (
|
...infer Rest extends object[],
|
||||||
T extends [infer Super, infer Self, ...infer Rest]
|
]
|
||||||
? Pick<Self, CommonKeys<Self, Super>> extends Pick<Super, CommonKeys<Self, Super>>
|
? Pick<Self, CommonKeys<Self, Super>> extends Pick<Super, CommonKeys<Self, Super>>
|
||||||
? Extend<[
|
? Extend<[
|
||||||
Omit<Super, CommonKeys<Self, Super>> & Self,
|
Omit<Super, CommonKeys<Self, Super>> & Self,
|
||||||
@@ -19,7 +19,7 @@ export type Extend<T extends readonly any[]> = (
|
|||||||
: never
|
: never
|
||||||
: T extends [infer Self]
|
: T extends [infer Self]
|
||||||
? Self
|
? Self
|
||||||
: void
|
: {}
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user