reconstruct
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

/reconstruct/

    Package Sidebar

    Install

    npm i reconstruct

    Weekly Downloads

    65

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    12.3 kB

    Total Files

    9

    Last publish

    Collaborators

    • vitorluizc