@jamesernator/match

0.2.1 • Public • Published

Match

Experiemental package designed for

trying out semantics of the pattern matching proposal

Test a value matches a pattern

import match, { string, number } from "@jamesernator/match"

match([string, string, number], ['cats', 'hats', 2]) // true

match.on('fizz')
    .if(string, val => console.log("Got a string!")
    .else(_ => { throw new Error("Not a string") })

Methods docs coming soon

Readme

Keywords

none

Package Sidebar

Install

npm i @jamesernator/match

Weekly Downloads

5

Version

0.2.1

License

MIT

Unpacked Size

44.8 kB

Total Files

39

Last publish

Collaborators

  • jamesernator