Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

modifyAt

import { modifyAt } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/record.ts";

Modify a value A into a ReadonlyRecord at the key location. If the object does not hold the specified key then no change is made. This is the same function as modify with the order of parameters flipped.

@example
import * as R from "./record.ts";
import { pipe } from "./fn.ts";

const inc = (n: number) => n + 1;
const atOne = R.modifyAt('one');

const result1 = pipe(
  { one: 1, two: 2 },
  atOne(inc),
); // { one: 2, two: 2 }
const result2 = pipe(
  { two: 2 },
  atOne(inc),
); // { two: 2 }
function modifyAt(key: string): <A>(modifyFn: (a: A) => A) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>;
§
modifyAt(key: string): <A>(modifyFn: (a: A) => A) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>
[src]

§Parameters

§
key: string
[src]

§Return Type

§
<A>(modifyFn: (a: A) => A) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>
[src]