import { Match } from "https://deno.land/x/rimbu@0.10.0/mod.ts";
const { createAny } = Match;
Returns a function that takes a value of type T, and returns true if the value matches any of the
given matches
array of Match instances.
Examples
Example 1
Example 1
type Person = { name: string, age: number }
const m = Match.createAny<Person>({ age: v => v > 20 }, { name: v => v.length > 2 })
console.log(m({ name: 'abc', age: 10 }))
// => true
console.log(m({ name: 'abc', age: 20 }))
// => true
console.log(m({ name: 'a', age: 20 }))
// => true
console.log(m({ name: 'a', age: 10 }))
// => false