@cryptosheet/sort-by-property

2.0.0 • Public • Published

@cryptosheet/sort-by-property

sort an array by multiple properties. the order of the properties defines the precedence.

Usage

const sortByProperty = require('@cryptosheet/sort-by-property')
const transactions = [{
  created_at: '...',
  exchange: 'coinbase',
  currencyPair: 'ltc-eur'
}, {
  created_at: '...',
  exchange: 'coinbase',
  currencyPair: 'ltc-eur'
}]

transactions.sort(sortByProperty('created_at', 'exchange', 'currencyPair'))

Readme

Keywords

none

Package Sidebar

Install

npm i @cryptosheet/sort-by-property

Weekly Downloads

1

Version

2.0.0

License

ISC

Unpacked Size

2.76 kB

Total Files

4

Last publish

Collaborators

  • christian_fei