Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/deep/deep.ts>matchWith

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

Returns a function that matches a given value with the given matcher.

Examples

Example 1

const items = [{ a: 1, b: 'a' }, { a: 2, b: 'b' }];
items.filter(Deep.matchWith({ a: 2 }));
// => [{ a: 2, b: 'b' }]

Parameters

matcher: Match<T>
  • a matcher object that matches input values.

Returns

(source: T) => boolean