Answer the question
In order to leave comments, you need to log in
Is there a way to skip certain types?
I have a type
type Person = { id: string; name: boolean; su:number }
type Sedra = Omit<Person, "su"|"id">;
// {name: boolean;}
type Sedra = OmitType<Person, boolean|number >;
// {id: string;}
Answer the question
In order to leave comments, you need to log in
can be crafted from mapped type, indexed type, conditional type, and Pick library type
type OmitType<T, O> = Pick<T, {[P in keyof T]: T[P] extends O ? never : P}[keyof T]>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question