Skip to content

@mega-yfue/eufy-sdk / assertNever

Function: assertNever()

ts
function assertNever(value): never;

Exhaustiveness guard for discriminated unions. Placed in a switch default (or the else of an if-chain) over every variant: if a new variant is added and left unhandled, the call fails to typecheck (its type is no longer never), and at runtime it throws instead of silently falling through.

Parameters

value

never

Returns

never

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.