# Function assertNever

- assertNever(value, error?): undefined

- Intended to be used as the default case of a switch statement that covers all values of a string union. This will yield a typing error if the string union gets updated and all cases are not covered. This function simply throws the error, if one is passed in as an argument; otherwise it returns undefined.

  #### Parameters

  - value: never

    The value being checked against the values of a string union.

  - `Optional` error: Error

    The optional error to throw.

  #### Returns undefined