npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

object-entries-map

0.1.0

@mmalecki

npmHomeRepoSnykSocket
Downloads:0
$ npm install object-entries-map
DailyWeeklyMonthlyYearly

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' }