import { Deep } from "https://deno.land/x/rimbu@1.2.0/deep/internal.ts";
const { withType } = Deep;
Returns a curried API with a known target type. This can be useful for using the methods in contexts where the target type can be inferred from the usage.
Examples
Example 1
Example 1
const s = { a: 1, b: { c: 'a', d: true }}
const upd = Deep.withType<typeof s>().patchWith([{ d: (v) => !v }])
upd(s)
// => { a: 1, b: { c: 'a', d: false }}