v0.2.0
Make tolerable a poor man's version of exhaustive pattern-matching, in TypeScript
Repository
Current version released
2 years ago
exhaustive is a function to help statically check that you explicitly handle all possible values.
See its doc comment for a longer explanation. TypeScript’s never type is the novel thing that makes this work.
We could copy+paste this function into a “utils” junk-drawer in each project, but why not define it centrally and reuse it?
As such, it is available from the Deno third-party module registry:
import exhaustive from "https://deno.land/x/exhaustive/mod.ts"