Assertion function to assert that a value is set. Any value that is not null or undefined is considered set including falsy values such as 0 or "".
Throws MissingValueError if value is not set.
the value asserted to be set.
an optional exception message to use if the check fails.
const value = getValue();// ^? string | nullassertSet(value);// value is now guaranteed to be non-null Copy
const value = getValue();// ^? string | nullassertSet(value);// value is now guaranteed to be non-null
v6.15.0
MissingValueError if value is not set.
Assertion function to assert that a value is set. Any value that is not null or undefined is considered set including falsy values such as 0 or "".
Throws MissingValueError if value is not set.