Checks if the assertion passes or if the value is null or undefined.
const maybeString = nullish(string);maybeString(1); // Error: typemaybeString("hello"); // passesmaybeString(null); // passesmaybeString(undefined); // passes Copy
const maybeString = nullish(string);maybeString(1); // Error: typemaybeString("hello"); // passesmaybeString(null); // passesmaybeString(undefined); // passes
Assertion to be checked.
Checks if the assertion passes or if the value is null or undefined.
Example