deno.land / x / rambda@v9.1.1 / source / updateObject.js

updateObject.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { assocPath } from './assocPath.js'
export function updateObject(rules, obj){ if (arguments.length === 1) return _obj => updateObject(rules, _obj)
let clone = { ...obj } /*?.*/
rules.forEach(([ objectPath, newValue ]) => { clone = assocPath( objectPath, newValue, clone ) })
return clone}
rambda

Version Info

Tagged at
7 months ago