A simple pattern matching library for people who love currying!
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!
This project has adopted the code of conduct defined by the Contributor Covenant.
Before you contribute, please take a few minutes to read the contribution guidelines.
Sylvain PONTOREAU 📖 💻 |