assertNullish()function

assertNullish(value: Nullish<T>, caller: AnyCaller = assertNullish): asserts value is T
ParamType
valueNullish<T>
The value to assert. required
callerAnyCaller
Function used to attribute a thrown error to the calling site. Defaults to assertNullish
Return
asserts value is T
Nothing; narrows value to T.
Throws
unknown
RequiredError if value is not null or undefined.

Assert that a value is nullish (null or undefined).