🌪️ filter
Exclude from T those types that are assignable to U, and replace them with R.
T
U
R
This can be used as a drop-in replacement of the build-in Exclude.
Exclude
type R = Exclude<undefined, undefined> // nevertype R = Exclude<undefined | 1, undefined> // 1type R = Exclude<undefined, undefined, 2> // 2type R = Exclude<undefined | 1, undefined, 2> // 1 | 2 Copy
type R = Exclude<undefined, undefined> // nevertype R = Exclude<undefined | 1, undefined> // 1type R = Exclude<undefined, undefined, 2> // 2type R = Exclude<undefined | 1, undefined, 2> // 1 | 2
🌪️ filter
Exclude from
T
those types that are assignable toU
, and replace them withR
.This can be used as a drop-in replacement of the build-in
Exclude
.