orderby-time
v0.1.0
Published
Curried function returning a new array sorted by time without mutating the original array.
Downloads
3
Maintainers
Readme
orderby-time
Curried function returning a new array sorted by time without mutating the original array.
npm install orderby-time --save
You can also use Duo, Bower or download the files manually.
npm stats
API Example
var order = require('orderby-time')
var todos = [
{ name: 'Do something 03', date: '2015-10-21T06:01:47.427Z' },
{ name: 'Do something 01', date: '2015-08-05T01:00:00.007Z' },
{ name: 'Do something 02', date: '2015-10-20T06:01:47.427Z' }
]
order('date', todos)
//=> [ { name: 'Do something 01', date: '2015-08-05T01:00:00.007Z' }, { name: 'Do something 02', date: '2015-10-20T06:01:47.427Z' }, { name: 'Do something 03', date: '2015-10-21T06:01:47.427Z' } ]
API
order(path, list)
arguments
path (String)
Dot or bracket-notation object path string.list (array)
Array to sort.
returns
(array)
Array sorted by time.
Contributing
SEE: contributing.md