Throws if the given value is undefined, otherwise returns it.
The generic type of the value being tested.
The value which could possibly be undefined.
The (optional) name of the value, to include in the thrown error message.
The value, once it has been confirmed it is not undefined.
Throws if the given value is undefined, otherwise returns it.