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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Valeur de retour

La valeur retournée par cet util.

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

Usage

Exemples

Extraits de code prêts à coller.

Exhaustiveness guard in a switch

typescript