This commit is contained in:
@@ -15,17 +15,21 @@ export type ExtendFn = Tuples.Reduce<ExtendReducerFn, {}>
|
||||
export type Extend<T extends readonly object[]> = Call<ExtendFn, T>
|
||||
|
||||
|
||||
export type ExtendPlain<T extends readonly any[]> = (
|
||||
export type ExtendPlain<T extends readonly object[]> = (
|
||||
T extends [infer Super, infer Self, ...infer Rest]
|
||||
? Pick<Self, CommonKeys<Self, Super>> extends Pick<Super, CommonKeys<Self, Super>>
|
||||
? ExtendPlain<[
|
||||
Omit<Super, CommonKeys<Self, Super>> & Self,
|
||||
...Rest,
|
||||
]>
|
||||
? Rest extends object[]
|
||||
? Pick<Self, CommonKeys<Self, Super>> extends Pick<Super, CommonKeys<Self, Super>>
|
||||
? ExtendPlain<[
|
||||
Omit<Super, CommonKeys<Self, Super>> & Self,
|
||||
...Rest,
|
||||
]>
|
||||
: never
|
||||
: never
|
||||
: T extends [infer Self]
|
||||
? Self
|
||||
: void
|
||||
? Self extends object
|
||||
? Self
|
||||
: never
|
||||
: {}
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user