import { updateAt } from "https://deno.land/x/fun@v2.0.0-alpha.6/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. This function does the same as update but has the parameters switched in order
Examples
Example 1
Example 1
import * as R from "./record.ts";
import { pipe } from "./fn.ts";
const atOne = R.updateAt('one');
const result1 = pipe(
{ one: 1, two: 2 },
atOne(2),
); // { one: 2, two: 2 }
const result2 = pipe(
{ two: 2 },
atOne(2),
); // No change { two: 2 }