assert
Verifies if the supplied value is defined. If not, an error is thrown.
Signature
assert<T>(input: T | undefined, error?: string): T
Parameters
| Name | Type | Optional | Description | 
|---|---|---|---|
| input | T | No | Specifies the value to assert. | 
| error | string | Yes | Specifies the optional error message that is thrown. | 
Return value
Returns the value.