Omit
提出詳細
type MyReadonly2<T, K extends keyof T> = { readonly [P in K]: T[P]; } & Omit<T, K>
| 提出日時 | 2025-09-14 15:12:11 | 
|---|---|
| 問題 | Omit | 
| ユーザー | balckowl | 
| ステータス | Wrong Answer | 
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Expected1, MyOmit<Todo, 'description'>>>, Expect<Equal<Expected2, MyOmit<Todo, 'description' | 'completed'>>>, ] // @ts-expect-error type error = MyOmit<Todo, 'description' | 'invalid'> interface Todo { title: string description: string completed: boolean } interface Expected1 { title: string completed: boolean } interface Expected2 { title: string }