# assertNever

`function` in `utils` · v0.5.0

<https://docs.seedcord.org/packages/utils/0.5.0/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`.
