RenaiApp/types/deep-partial.d.ts

8 lines
205 B
TypeScript
Raw Normal View History

type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U>
? Array<DeepPartial<U>>
2019-11-18 23:00:11 +01:00
: T[P] extends ReadonlyArray<infer V>
? ReadonlyArray<DeepPartial<V>>
: DeepPartial<T[P]>;
};