5 lines
No EOL
270 B
TypeScript
5 lines
No EOL
270 B
TypeScript
// I don’t understand why, but Omit (built-in) breaks discriminated unions. This type does not.
|
||
// See https://github.com/microsoft/TypeScript/issues/31501#issuecomment-1079728677
|
||
export type RemoveKey<T, K extends string> = {
|
||
[P in keyof T as Exclude<P, K>]: T[P];
|
||
} |