import { Deep } from "https://deno.land/x/rimbu@1.0.2/deep/internal.ts";
const { selectAt } = Deep;
Returns the result of applying the given selector
shape to the given source
value.
Examples
Example 1
Example 1
const item = { a: { b: 1, c: 'a' } };
Deep.selectAt(item, 'a', { q: 'c', z: ['b', v => v.b + 1] as const });
// => { q: 'a', z: [1, 2] }
Parameters
source: T
- the source value to select from
path: P
- the string path in the object
selector: Selector.Shape<SL>
- a shape indicating the selection from the source value at the given path