this utility type optionalizes all property keys that are of the never type.
never
type MyType = { a: number, b: never, c: never, d: { e: never, f: string } }type MyType_OptionallyCleansed = RemoveNeverKeys<MyType>// type MyType_OptionallyCleansed === { a: number, b?: never, c?: never, d: { e: never, f: string } } Copy
type MyType = { a: number, b: never, c: never, d: { e: never, f: string } }type MyType_OptionallyCleansed = RemoveNeverKeys<MyType>// type MyType_OptionallyCleansed === { a: number, b?: never, c?: never, d: { e: never, f: string } }
Generated using TypeDoc
this utility type optionalizes all property keys that are of the
never
type.