refactor: move type utils to shared

This commit is contained in:
Evan You
2022-01-16 15:43:19 +08:00
parent 2e3e183b4f
commit 6cfd72e760
6 changed files with 10 additions and 8 deletions

View File

@@ -1,10 +0,0 @@
export type UnionToIntersection<U> = (
U extends any ? (k: U) => void : never
) extends (k: infer I) => void
? I
: never
// make keys required but keep undefined values
export type LooseRequired<T> = { [P in string & keyof T]: T[P] }
export type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N