object-entries-map
v0.1.0
Published
Deconstruct an object into entries (using `Object.entries`), run a user-supplied map function, and reconstruct the object (using `Object.fromEntries`)
Readme
object-entries-map
Deconstructs an object into entries (using Object.entries), runs a user-supplied
map function over it, and reconstructs the object (using Object.fromEntries).
Installation
npm i object-entries-mapUsage
const objectEntriesMap = require('object-entries-map')
const obj = { foo: 'bar' }
objectEntriesMap(obj, ([key, value]) => [value, key]) // => { bar: 'foo' }