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

x/rambda/files/index.d.ts>assoc

Faster and smaller alternative to Ramda
Latest
function assoc
import { assoc } from "https://deno.land/x/rambda@9.4.1/files/index.d.ts";

Type Parameters

K extends PropertyKey

Returns

{ <T>(val: T): <U extends Record<K, T>>(obj: U) => U; <U extends Record<K, T>, T>(val: T, obj: U): U; }

Type Parameters

T
K extends PropertyKey

Parameters

prop: K
val: T

Returns

{ <U>(obj: U): U extends Record<K, any> ? U[K] extends T ? U : Record<K, T> & Omit<U, K> : U & Record<K, T>; }

Type Parameters

U
K extends keyof U
T extends U[K]

Parameters

prop: K
val: T
obj: U