Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rambda/mod.ts>assoc

Faster and smaller alternative to Ramda
Go to Latest
function assoc
import { assoc } from "https://deno.land/x/rambda@9.2.1/mod.ts";

It makes a shallow clone of obj with setting or overriding the property prop with newValue.

Type Parameters

T
U
K extends string

Parameters

prop: K
val: T
obj: U

Returns

Record<K, T> & Omit<U, K>

Type Parameters

T
K extends string

Parameters

prop: K
val: T

Returns

<U>(obj: U) => Record<K, T> & Omit<U, K>

Type Parameters

K extends string

Returns

AssocPartialOne<K>