https://github.com/vitorluizc/reconstruct
:construction_worker: Iterate over properties and merge them into a new object.
https://github.com/vitorluizc/reconstruct
javascript object reconstruction typescript
Last synced: about 1 month ago
JSON representation
:construction_worker: Iterate over properties and merge them into a new object.
- Host: GitHub
- URL: https://github.com/vitorluizc/reconstruct
- Owner: VitorLuizC
- License: mit
- Created: 2018-02-28T12:50:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-04T05:39:15.000Z (almost 7 years ago)
- Last Synced: 2025-08-30T05:57:01.151Z (about 1 month ago)
- Topics: javascript, object, reconstruction, typescript
- Language: TypeScript
- Homepage:
- Size: 132 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reconstruct
[](https://travis-ci.org/VitorLuizC/reconstruct)
Maps object into a new one using an anonymous function.
## Installation
Install it using Yarn or NPM.
```sh
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.
```js
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](./LICENSE).