array-2-object
Returns an object from a given array
Table of Contents
Install
Using npm
npm install --save array-2-object
Usage
Signature
: Object
Default options
base: {} value: null
const array2object =
Examples given the following array
const array = 'V' 'version' 'n' 'name'
const object = /* object * { * "version": null, * "name": null, * "V": null, * "n": null * } */
With a different initial value
const options = value: "foo"const object = /* object * { * "version": "foo", * "name": "foo", * "V": "foo", * "n": "foo" * } */
With a different initial value and a base object
const base = "dependencies": "bar" "S": "bar" const options = value: "foo" base: base const object = /* object * { * "dependencies": "bar", * "version": "foo", * "name": "foo", * "S": "bar", * "V": "foo", * "n": "foo" * } */
Contribute
PRs accepted & greatly appreciated.
Tests
npm installnpm test
Dependencies
None
Dev Dependencies
- codecov: Uploading report to Codecov: https://codecov.io
- nyc: the Istanbul command line interface
- rimraf: A deep deletion module for node (like
rm -rf
) - tape: tap-producing test harness for node and browsers
License
MIT