Skip to content

Commit

Permalink
Use finite list of scalar types instead
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaKhD committed Sep 29, 2022
1 parent 41e24e7 commit ca64582
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export type Xor<T1, T2 = never, T3 = never, T4 = never, T5 = never, T6 = never,
| Seal<T8, KeysOf<T1, T2, T3, T4, T5, T6, T7, T9>>
| Seal<T9, KeysOf<T1, T2, T3, T4, T5, T6, T7, T8>>;

export type DeepPartial<T> = T extends Record<string, unknown> ? {
type Scalar = string | number | Function | Date | Boolean | Array<unknown>;
export type DeepPartial<T> = T extends Scalar ? T : {
[P in keyof T]?: DeepPartial<T[P]>;
} : T;
};

type ItemType<T> = T extends (infer TItem)[] ? TItem : T;
type Property<T, TPropName extends string> = T extends Partial<Record<TPropName, infer TValue>> ? TValue : never;
Expand Down

0 comments on commit ca64582

Please sign in to comment.