The type of the value
The type of the error (defaults to Error)
The value to check for null/undefined
Custom error message
Whether to throw the error instead of returning a Result (defaults to true)
A Result containing the value if not null/undefined, or an error if it is
Asserts that a value is not null or undefined, returning the value if valid.