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

update

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

Update a ReadonlyRecord at key with a value A. The record will only be updated if it already holds the specified key, otherwise no changes are made.

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

const to2 = R.update(2);

const result1 = pipe(
  { one: 1, two: 2 },
  to2('one'),
); // { one: 2, two: 2 }
const result2 = pipe(
  { two: 2 },
  to2('one'),
); // No change { two: 2 }
function update<A>(value: A): (key: string) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>;
§
update<A>(value: A): (key: string) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>
[src]

§Type Parameters

§Parameters

§
value: A
[src]

§Return Type

§
(key: string) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>
[src]