oops

Commons
stable

Unconditionally throws an Error. Typed as returning `never`, making it usable as an exhaustiveness guard in switch/if chains where TypeScript must know all branches throw.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Return value

The value returned by this util.

Does not return — always throws an Error. The `never` return type lets TypeScript narrow exhaustively after the call site.

Usage

Examples

Ready-to-paste usage snippets.

Exhaustiveness guard in a switch

typescript