Ostatnio aktywny 2 days ago

recursive-partial.ts Surowy
1/**
2 * ... then taken from
3 * https://github.com/Noah2610/sync-tracker/blob/develop/lib/util/recursive-partial.ts
4 */
5
6/**
7 * Taken from Tone.js, which itself was taken from here:
8 * https://stackoverflow.com/a/51365037
9 */
10type RecursivePartial<T> = {
11 [P in keyof T]?: T[P] extends Array<infer U>
12 ? Array<RecursivePartial<U>>
13 : T[P] extends object
14 ? RecursivePartial<T[P]>
15 : T[P];
16};
17
18export default RecursivePartial;
recursivePartial.ts Surowy
1/**
2 * https://github.com/Noah2610/i3-color-theme-editor/blob/master/src/util/recursivePartial.ts
3 */
4
5export type RecursivePartial<T> = {
6 [P in keyof T]?: T[P] extends (infer U)[]
7 ? RecursivePartial<U>[]
8 : T[P] extends object
9 ? RecursivePartial<T[P]>
10 : T[P];
11};