Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

object-pairs

eush77605.9kMIT0.1.0

Object -> [[key0, value0], [key1, value1]...]

object, pairs, array, keys, values, zip, unzip

readme

object-pairs Build Status Dependency Status

npm

Turn an object into list of [key, value] pairs for mapping, iterating or other purposes.

Example

> pairs = require('object-pairs')
[Function]
> pairs({ foo: 2, bar: 4 })
[ [ 'foo', 2 ],
  [ 'bar', 4 ] ]

API

pairs(obj)

Return list of key-value pairs.

Install

npm install object-pairs

License

MIT