import { Deep } from "https://deno.land/x/rimbu@1.2.0/deep/internal.ts";
const { select } = 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.select(item, { q: 'a.c', y: ['a.b', 'a.c'], z: (v) => v.a.b + 1 });
// => { q: 'a', y: [1, 'a'], z: 2 }
Parameters
source: T
- the source value to select from
selector: Selector.Shape<SL>
- a shape indicating the selection from the source values