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

insert

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

Insert a value A into a ReadonlyRecord at the key location. If the value inserted has object equality with the current value in the record then no change is made and the original record is returned.

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

const insert = R.insert(1);

const result1 = pipe(
  { one: 1, two: 2 },
  insert('one'),
); // No Mutation, returns original object
const result2 = pipe(
  { two: 2 },
  insert('one'),
); // { one: 1, two: 2 }
function insert<A>(value: A): (key: string) => (ua: ReadonlyRecord<A>) => ReadonlyRecord<A>;
§
insert<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]