Skip to main content
Module

x/rambda/assoc-spec.ts

Faster and smaller alternative to Ramda
Go to Latest
File
import {assoc} from 'rambda'
const obj = {a: 1}const newValue = 2const newProp = 'b'
describe('R.assoc', () => { it('happy', () => { const result = assoc(newProp, newValue, obj)
result.a // $ExpectType number result.b // $ExpectType number }) it('curried 1', () => { const result = assoc(newProp, newValue)(obj)
result.a // $ExpectType number result.b // $ExpectType number }) it('curried 2', () => { const result = assoc(newProp)(newValue)(obj)
result.a // $ExpectType number result.b // $ExpectType number })})