Skip to content

Function: neverGuard() ​

ts
function neverGuard(x: never, msg: string): Error;

Create an Error for an unexpected value. The never parameter helps TypeScript check exhaustive branches. This function returns the Error; it does not throw it.

Parameters ​

ParameterType
xnever
msgstring

Returns ​

Error

Built by Siebly. Open source SDKs for exchange APIs.