import { type Deep } from "https://deno.land/x/rimbu@0.13.5/deep/mod.ts";
const { WithType } = Deep;
Typed and curried Deep API, used in situations where the target type is known but the value will be applied later.
Examples
Example 1
Example 1
const s = { a: 1, b: { c: 'a', d: true }};
const upd = Deep.withType<typeof s>().patchWith([{ a: (v) => v + 1 }]);
upd(s);
// => { a: 2, b: { c: 'a', d: true }}
Methods
Returns a function that given an object returns the value at the given path
.
Returns a function that patches a given value
with the given patchItems
.
Returns a function that patches a given value
with the given patchItems
at the given path
.
Returns a function that matches a given value
with the given matcher
.
Returns a function that matches a given value
with the given matcher
at the given string path
.
Returns a function that selects a certain shape from a given value
with the given selector
.
Returns a function that selects a certain shape from a given value
with the given selector
at the given string path
.