non-null
TypeScript helper. Assert if a value is neither null nor undefined.
Declaration
Usage
nonNull1 // = 1nonNullnull // throws an errornonNullundefined // throws an error
Assert if a value is neither null nor undefined using the assert
module. Returns the value.
Note that the type return value is coerced to be non-null.
Tip
To remove assert
calls, use a tool such as unassert.