@ossedb/patmat - v1.0.0
    Preparing search index...

      @ossedb/patmat - v1.0.0

      Typed pattern matching and algebraic data types for JavaScript and TypeScript, in Node and the browser.

      import { match, P, adt } from '@ossedb/patmat';

      const fact = (n: number): number =>
      match(n)
      .with(0, () => 1)
      .with(P.bind('n', P.number), ({ n }) => n * fact(n - 1))
      .exhaustive();
      NonExhaustiveError
      Matcher
      Pat
      RestPattern
      Adt
      Captures
      CapturesOf
      CaseSpec
      MatchedOf
      Pattern
      Primitive
      Variant
      VariantOf
      P
      adt
      isMatch
      match