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

x/rimbu/deep/index.ts>Deep.matchAt

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

Returns true if the given value object matches the given matcher at the given path, false otherwise.

Examples

Example 1

const input = { a: 1, b: { c: true, d: 'a' } }
Deep.matchAt(input, 'b', { c: true })
// => true

Parameters

source: T
  • the input value
path: P
  • the string path in the object
matcher: Match<Path.Result<T, P>>
  • a matcher object or a function taking the matcher API and returning a match object

Returns

boolean