Type Challenges Judge

OmitByType

提出詳細

type OmitByType<T, U> = { [K in keyof T as T[K] extends U ? never : K]: T[K] }
提出日時2023-09-15 13:46:24
問題OmitByType
ユーザーsankantsu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' interface Model { name: string count: number isReadonly: boolean isEnable: boolean } type cases = [ Expect<Equal<OmitByType<Model, boolean>, { name: string; count: number }>>, Expect<Equal<OmitByType<Model, string>, { count: number; isReadonly: boolean; isEnable: boolean }>>, Expect<Equal<OmitByType<Model, number>, { name: string; isReadonly: boolean; isEnable: boolean }>>, ]