@cryptosheet/sort-by-property

sort an array by multiple properties

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@cryptosheet/sort-by-property
2.0.04 years ago4 years agoMinified + gzip package size for @cryptosheet/sort-by-property in KB

Readme

@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'))