@duncan/exhaustive@0.8.2
latest
frou/exhaustive-helperMake tolerable a poor man's version of exhaustive pattern-matching, in TypeScript
This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun




JSR Score
100%
Published
a year ago (0.8.2)
exhaustive
is a function to help statically check that you explicitly handle all possible values.
See its documentation for a longer explanation. TypeScript's never
type is the novel thing that makes it work.
We could copy & paste the function definition into a "utils" file in each project, but why not define it centrally and reuse it? That's why it's been put on this module registry:
import exhaustive from "jsr:@duncan/exhaustive"
Add Package
deno add jsr:@duncan/exhaustive
Import symbol
import * as exhaustive from "@duncan/exhaustive";
Import directly with a jsr specifier
import * as exhaustive from "jsr:@duncan/exhaustive";
Add Package
pnpm i jsr:@duncan/exhaustive
pnpm dlx jsr add @duncan/exhaustive
Import symbol
import * as exhaustive from "@duncan/exhaustive";
Add Package
yarn add jsr:@duncan/exhaustive
yarn dlx jsr add @duncan/exhaustive
Import symbol
import * as exhaustive from "@duncan/exhaustive";
Add Package
npx jsr add @duncan/exhaustive
Import symbol
import * as exhaustive from "@duncan/exhaustive";
Add Package
bunx jsr add @duncan/exhaustive
Import symbol
import * as exhaustive from "@duncan/exhaustive";