Never Patronize Mothers

    orderby-time

    0.1.0 • Public • Published

    orderby-time

    Curried function returning a new array sorted by time without mutating the original array.

    Build Status Code Climate js-standard-style

    npm install orderby-time --save

    You can also use Duo, Bower or download the files manually.

    npm stats

    npm NPM downloads David

    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

    Licenses

    GitHub license

    Install

    npm i orderby-time

    DownloadsWeekly Downloads

    3

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • wilmoore