Threads AI

assertNever / assert_never

Ends a switch over a union, so a variant nobody handles is a type error.

Python uses typing.assert_never, which threads does not re-export.

Import from @threads/core (TypeScript) or threads (Python).

function assertNever(value: never): never

Parameters

valueneverrequired

The value no case matched; the type checker proves none can.

Returns

never

Edit on GitHub

On this page