npm.io
1.0.5 • Published 8 years ago

is-sorted

Licence
MIT
Version
1.0.5
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
25

is-sorted

TRAVIS NPM js-standard-style

A small module to check if an Array is sorted.

Example

var sorted = require('is-sorted')

console.log(sorted([1, 2, 3]))
// => true

console.log(sorted([3, 1, 2]))
// => false

// supports custom comparators
console.log(sorted([3, 2, 1], function (a, b) { return b - a })
// => true

LICENSE MIT

Keywords