npm.io
1.1.3 • Published 5 years ago

matchlib

Licence
ISC
Version
1.1.3
Deps
0
Size
1 kB
Vulns
0
Weekly
0
Stars
2

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);