1
0
Fork 0
js-utils/docs/api/js-utils.mustexist.md

669 B

Home > @apextoaster/js-utils > mustExist

mustExist() function

Assert that a variable is not None and return the value. Throw if it is None.

Signature:

export declare function mustExist<T>(val: Maybe<T>, err?: string): T;

Parameters

Parameter Type Description
val Maybe<T>
err string (Optional)

Returns:

T

val

Exceptions

NotFoundError