Type alias ExcludeType<Obj, Type>

ExcludeType<Obj, Type>: {
    [K in keyof Obj]: Exclude<Obj[K], Type>
}

Exclude type Type from the properties of Obj.

type Foo = { a: string | null; b: number };
type Bar = ExcludeType<Foo, null>;
// Bar = { a: string, b: number }

Type Parameters

  • Obj
  • Type