assertNotNullish()function

assertNotNullish(value: Nullish<T>, caller: AnyCaller = assertNotNullish): 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 assertNotNullish
Return
asserts value is T
Nothing; narrows value to T.
Throws
unknown
RequiredError if value is null or undefined.

Assert that a value is not nullish (not null and not undefined).