Skip to main content
Module

x/rimbu/mod.ts>Deep.matchAtWith

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

Returns a function that matches a given value with the given matcher at the given string path.

Examples

Example 1

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

Type Parameters

T
P extends Path.Get<T>
optional
TE extends T = T

Parameters

path: P
  • the string path in the object
matcher: Match<Path.Result<T & TE, P>>
  • a matcher object that matches input values.

Returns

(source: T) => boolean