object-from-pairs

0.0.2 • Public • Published

object from pairs

Create an object from an array of pairs

Can be used as a partial ponyfill or prollyfil for tc39 / proposal-object-from-entries

Author: @brodybits (Christopher J. Brody)

License: CC0 OR UNLICENSE OR ISC OR Apache-2.0 OR CC-BY-SA-3.0 OR CC-BY-SA-4.0

Sample

const objectFromPairs = require('object-from-pairs')
 
console.log(objectFromPairs([
  [ 'first' + 'Key',        'first value' ],
  [ 'second' + '-' + 'key', 'second value' ],
]))

outputs the following:

{ firstKey: 'first value', 'second-key': 'second value' }

(see quick-demo.js)

TODO

  • deeper testing
  • proper API documentation
  • use eslint-config-standard@12 when available (https://github.com/standard/eslint-config-standard/issues/123)
  • follow standard more closely in quick-demo.js and sample
  • pre-es6 support
  • test on browser
  • test on AppVeyor & Travis CI
  • SauceLabs?
  • commit package-lock.json (??)

FUTURE TBD

See also

Package Sidebar

Install

npm i object-from-pairs

Weekly Downloads

3

Version

0.0.2

License

CC0 OR UNLICENSE OR ISC OR Apache-2.0 OR CC-BY-SA-3.0 OR CC-BY-SA-4.0

Unpacked Size

4.1 kB

Total Files

5

Last publish

Collaborators

  • brodybits