Create a type predicate function that passes if input is null or passes the given predicate.
input
null
predicate
const isNullableString = nullable(isString);isNullableString('hello'); // trueisNullableString(null); // trueisNullableString(undefined); // false Copy
const isNullableString = nullable(isString);isNullableString('hello'); // trueisNullableString(null); // trueisNullableString(undefined); // false
Create a type predicate function that passes if
inputisnullor passes the givenpredicate.