Skip to main content
Module

x/fun/record.ts>deleteAt

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function deleteAt
import { deleteAt } from "https://deno.land/x/fun@v2.0.0/record.ts";

Remove the value and key at key from a ReadonlyRecord. If the record does not hold the key then no change is made and the original record is returned.

Examples

Example 1

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

const result1 = pipe(
  { one: 1, two: 2 },
  R.deleteAt('one'),
); // { two: 2 }
const result2 = pipe(
  { two: 2 },
  R.deleteAt('one'),
); // No Change { two: 2 }

Parameters

key: string