2.0.2 • Published 6 years ago

clay-list-sorter v2.0.2

Weekly downloads
214
License
Apache-2.0
Repository
github
Last release
6 years ago

clay-list-sorter

Build Status npm Version JS Standard

Sorter functions for ClayDB list

Installation

$ npm install clay-list-sorter --save

Usage

'use strict'

const { sortArray } = require('clay-list-sorter')

{
  let source = [ { name: 'foo', index: 2 }, { name: 'bar', index: 1 } ]
  let sort = 'index'

  let sorted = sortArray(source, sort)
  console.log(sorted) // -> [ { name: 'bar', index: 1 }, { name: 'foo', index: 2 } ]
}

Functions

Available functions

SignatureDescription
sortArray(array, conditions) -> Object[]Sort array with condition

License

This software is released under the Apache-2.0 License.

Links