exclude

function exclude<T, U>(validator, excludeValidator): (x) => x is Exclude<U, T>

Create a validator that allows types excluding those that satisfy an excludeValidator.

Type parameters

Type parameter
T
U

Parameters

ParameterType
validator(x) => x is U
excludeValidator(x) => x is T

Returns

Function

Parameters

ParameterType
xunknown

Returns

x is Exclude<U, T>