|
|
@@ -1,7 +1,16 @@
|
|
|
+// tslint:disable:no-shadowed-variable
|
|
|
/**
|
|
|
* A recursive implementation of the Partial<T> type.
|
|
|
+ * Source: https://stackoverflow.com/a/49936686/772859
|
|
|
*/
|
|
|
-export type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
|
|
|
+export type DeepPartial<T> = {
|
|
|
+ [P in keyof T]?: T[P] extends Array<infer U>
|
|
|
+ ? Array<DeepPartial<U>>
|
|
|
+ : T[P] extends ReadonlyArray<infer U>
|
|
|
+ ? ReadonlyArray<DeepPartial<U>>
|
|
|
+ : DeepPartial<T[P]>
|
|
|
+};
|
|
|
+// tslint:enable:no-shadowed-variable
|
|
|
|
|
|
// tslint:disable:ban-types
|
|
|
/**
|