1.0.3 • Published 5 years ago

lodash-sorted-pairs v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

lodash-sorted-pairs

Get sorted pairs (key, value) from an object using lodash.

import sortedPairs from 'lodash-sorted-pairs'

const object = { b: 1, a: 2 }

// Sort by key:
sortedPairs(object)
// -> [ ['a', 2], ['b', 1] ]

// Or pass a sorted on pairs from `_.toPairs`:
sortedPairs(object, _.property('1'))
// -> [ ['b', 1], ['a', 2] ]