assertNot()function

assertNot(left: T | N, right: N, caller: AnyCaller = assertNot): asserts left is T
ParamType
leftT
N
The value to check and narrow. required
rightN
The value left must not equal. required
callerAnyCaller
Function to attribute a thrown error to (defaults to assertNot). Defaults to assertNot
Return
asserts left is T
Throws
RequiredError
If the values are equal.

Assert that two values are not equal, narrowing left to exclude the type of right.

Examples

assertNot(1, 2); // passes