@benny-otieno/array-to-object

1.0.3 • Public • Published

SIMPLE ARRAY TO OBJECT MAPPER

Installation

  • Using npm: npm i @benny-otieno/array-to-object
  • Using Yarn: yarn add @benny-otieno/array-to-object

Example

The first argument is the key array and the second argument is the values

const arrayToObject = require("array-to-object");


arrayToObject(["name", "height"], ["Benny", "1.7m"])

result // { name: 'Benny', height: '1.7m' }



arrayToObject(["fruits", "expenses"], [["apples","bananas"], ["rent","transport"]])

result // { fruits: [ 'apples', 'bananas' ], expenses: [ 'rent', 'transport' ] }

License

Author

Feel free to ask me questions on Twitter @CodeManyatta!

Contributors

Feel free to add more features or raise PR's for improvemts. I welcome collaborations.

Readme

Keywords

Package Sidebar

Install

npm i @benny-otieno/array-to-object

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

3.18 kB

Total Files

4

Last publish

Collaborators

  • benny-otieno