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

x/rimbu/deep/internal.ts>Deep.getAtWith

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

Returns a function that gets the value at the given string path inside an object.

Examples

Example 1

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

Parameters

path: P
  • the string path in the object

Returns

(source: T) => Path.Result<T, P>