31 lines
572 B
Markdown
31 lines
572 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 | <code>Optional<T></code> | |
|
|
|
|
<b>Returns:</b>
|
|
|
|
`T`
|
|
|
|
val
|
|
|
|
## Exceptions
|
|
|
|
NotFoundError
|
|
|