SubtraitAbstract
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-02-17 17:12:46 +01:00
parent 2fa71aaf37
commit 04146f6c69
2 changed files with 38 additions and 11 deletions

View File

@@ -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
: {}
)