function nullable<T>(subValidator): (x) => x is null | T
Create a validator which allows the target to be either null or satisfy the
sub-validator.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
subValidator | (p1 ) => p1 is T |
Returns
Function
A validator for the array type
Parameters
Parameter | Type |
---|---|
x | unknown |
Returns
x is null | T