Home > tab-info > assertExists
assertExists() function
Assert whether a value is neither null
nor undefined
Signature:
export declare function assertExists<T>(val: T | undefined | null, valDescription: string): asserts val is T;
Parameters
Parameter | Type | Description |
---|---|---|
val | T | undefined | null | value to test |
valDescription | string | a description of the meaning of this value (for a user-friendly assertion error) |
Returns:
asserts val is T