# assertNever

`function` in `utils` · v0.8.17

<https://seedcord.org/docs/packages/utils/0.8.17/functions/assert-never>

Exhaustiveness guard for discriminated unions. Place in the `default` branch of a `switch` over a
union's discriminant: if a new variant is added without a matching case, the call fails to compile.
Throws at runtime if reached with a value the types said was impossible.

```ts
assertNever(value: never): never
```

Exhaustiveness guard for discriminated unions. Place in the `default` branch of a `switch` over a
union's discriminant: if a new variant is added without a matching case, the call fails to compile.
Throws at runtime if reached with a value the types said was impossible.

Parameters.

- `value` `never`

Returns `never`.
