matchlib
v1.1.3
Published
A simple pattern matching library
Downloads
4
Readme
MatchLib
A simple pattern matching library
Getting started
very simple to use:
npm install matchlib
after package installation
import matchlib from 'matchlib';
const option = matchlib(50)(
[(key) => key === 18, () => `You are young`],
[(key) => key === 50, () => `You are old`],
[(key) => key === 6, () => `You are a child`]
)(() => `Not found!`);
console.log(option);