Wondering what’s next for npm?Check out our public roadmap! »

is-sorted

1.0.5 • Public • Published

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

Install

npm i is-sorted

DownloadsWeekly Downloads

1,627

Version

1.0.5

License

MIT

Unpacked Size

4.36 kB

Total Files

7

Last publish

Collaborators

  • avatar