SIMPLE ARRAY TO OBJECT MAPPER
Installation
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.