KeyOf
Same as keyof
, but works with unions.
import { KeyOf } from 'crustack/types'
type MyObject = | { a: number b: string } | { b: string c?: boolean }
type T = KeyOf<MyObject>// 'a' | 'b' | 'c'
type U = keyof MyObject// 'b'