Skip to main content
Module

x/rimbu/mod.ts>Match.every

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Match.every
import { Match } from "https://deno.land/x/rimbu@0.11.6/mod.ts";
const { every } = Match;

Returns a matcher that returns true if every given matchItem matches the given value.

Examples

Example 1

const input = { a: 1, b: { c: true, d: 'a' } }
match(input, Match.every({ a: 1, { c: true } } )) // => true
match(input, Match.every({ a: 1, { c: false } } )) // => false

Type Parameters

T
R
optional
Q extends T = T

Parameters

...matchItems: Match.Options<Q, R>[]
  • the match specifications to test

Returns

Every<T, R, Q>