function either<A, B>(validatorA, validatorB): (x) => x is A | B
Create a validator that merges two validators.
This is useful for validating properties that have 2 disjoint sets of possible values.
e.g. {someObject: string}|false
Type parameters
Type parameter |
---|
A |
B |
Parameters
Returns
Function
Parameters
Parameter | Type |
---|---|
x | unknown |
Returns
x is A | B