@cryptosheet/sort-by-property
v2.0.0
Published
sort an array by multiple properties
Downloads
19
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'))