1
0
Fork 0
js-utils/docs/api/js-utils.mustexist.md

32 lines
652 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [@apextoaster/js-utils](./js-utils.md) &gt; [mustExist](./js-utils.mustexist.md)
## mustExist() function
Assert that a variable is not `None` and return the value. Throw if it is `None`<!-- -->.
<b>Signature:</b>
```typescript
export declare function mustExist<T>(val: Maybe<T>, err?: string): T;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| val | [Maybe](./js-utils.maybe.md)<!-- -->&lt;T&gt; | |
| err | string | |
<b>Returns:</b>
T
val
## Exceptions
NotFoundError