UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

10 lines (8 loc) 286 B
import { match } from "../main.ts"; describe("match()", () => { it("delivers matches", () => { expect(match(/foo/)("I am foofoo")).toEqual(["foo"]); expect(match(/foo/g)("I am foofoo")).toEqual(["foo", "foo"]); expect(match("foo")("foo bar")).toEqual(["foo"]); }); });