0.1.0 • Published 4 years ago

object-entries-map v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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-map

Usage

const objectEntriesMap = require('object-entries-map')
const obj = { foo: 'bar' }
objectEntriesMap(obj, ([key, value]) => [value, key]) // => { bar: 'foo' }