Saltar al contenido

CódigoSin intentar

Reto de tipos: MyOmit

Dificultad: media

Implementa MyOmit<T, K> sin Omit, Pick ni Exclude. Pista: reasignación de claves en un mapped type (as), donde mapear una clave a never la elimina.

Ver solución de referencia
// Key remapping with `as`: mapping a key to `never` drops it.
export type MyOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
Cargando editor…