@jamesernator/match

Pattern matching

Stats

StarsIssuesVersionUpdatedCreatedSize
@jamesernator/match
0.2.13 years ago5 years agoMinified + gzip package size for @jamesernator/match in KB

Readme

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.