Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

reconstruct

VitorLuizC250MIT1.0.0TypeScript support: included

Maps object into a new one using an anonymous function.

reconstruct, object-map, functional-programming

readme

Reconstruct

Build Status

Maps object into a new one using an anonymous function.

Installation

Install it using Yarn or NPM.

yarn add reconstruct

# With NPM
npm i reconstruct

Usage

Reconstruct provides a function to map an iterate over object value & properties returning new one to compose result.

import reconstruct from 'reconstruct'

const invert = (value, property) => ({ [value]: property })

reconstruct({ A: 1, B: 2 }, invert) == { '1': 'A', '2': 'B' }

License

Released under MIT license. You can see it here.