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