CódigoNão tentada
Desafio de tipos: MyOmit
Dificuldade: média
Implemente MyOmit<T, K> sem Omit, Pick ou Exclude. Dica: key remapping em um mapped type (as), onde mapear uma chave para never a descarta.
Ver solução de referência
// 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] };
Ctrl Enter