GitHub license CI Codecov DeepScan grade Discord Gitmoji

match

A simple pattern matching library for people who love currying!

Getting started

match is super easy to use:

import { isSome, match } from "https://deno.land/x/match/mod.ts";

const value = "Deno";

const option = match<string, string>(value)(
  [(v) => v === "Deno", () => `Deno found!`],
  [(v) => v === "Node", () => `We are not looking for you Node, sorry!`],
)();

const result = isSome(option) ? option.value : "Not found";

console.log(result);

You can found more information in the documentation!

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant.

Contributing

Before you contribute, please take a few minutes to read the contribution guidelines.

Contributors


Sylvain PONTOREAU

📖 💻

Licence

MIT