Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/deep/internal.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@1.1.0/deep/internal.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