31 lines
591 B
Markdown
31 lines
591 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustExist](./js-utils.mustexist.md)
|
|
|
|
## mustExist() function
|
|
|
|
Assert that a variable is not nil and return the value.
|
|
|
|
<b>Signature:</b>
|
|
|
|
```typescript
|
|
export declare function mustExist<T>(val: Optional<T>): T;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Type | Description |
|
|
| --- | --- | --- |
|
|
| val | [Optional](./js-utils.optional.md)<!-- --><T> | |
|
|
|
|
<b>Returns:</b>
|
|
|
|
T
|
|
|
|
val
|
|
|
|
## Exceptions
|
|
|
|
NotFoundError
|
|
|