import { type Deep } from "https://deno.land/x/rimbu@0.14.0/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.
Methods
getAtWith<P extends Path.Get<T>>(path: P): (source: T) => Path.Result<T, P>
Returns a function that given an object returns the value at the given path
.
patchAtWith<P extends Path.Set<T>, TT = T>(path: P, patchItem: Patch<Path.Result<T, P>, Path.Result<TT, P>>): (source: T) => T
Returns a function that patches a given value
with the given patchItems
at the given path
.
matchAtWith<P extends Path.Get<T>>(path: P, matcher: Match<Path.Result<T, P>>): (source: T) => boolean
Returns a function that matches a given value
with the given matcher
at the given string path
.
selectWith<SL extends Selector<T>>(selector: Selector.Shape<SL>): (source: T) => Selector.Result<T, SL>
Returns a function that selects a certain shape from a given value
with the given selector
.
selectAtWith<P extends Path.Get<T>, SL extends Selector<Path.Result<T, P>>>(path: P, selector: Selector.Shape<SL>): (source: T) => Selector.Result<Path.Result<T, P>, SL>
Returns a function that selects a certain shape from a given value
with the given selector
at the given string path
.