Asserts that a value is truthy, throwing an error if it is not.
The value to check.
Optional
Optional error message to throw if the assertion fails.
Error if the value is falsy.
assert(user !== null, 'User must be defined') Copy
assert(user !== null, 'User must be defined')
Asserts that a value is truthy, throwing an error if it is not.