0.0.4 • Published 7 years ago

@jx/match v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Match

Experiemental package designed for

trying out semantics of the pattern matching proposal

Test a value matches a pattern

import match, { string, number } from "@jx/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