array-is-sorted-1

1.0.0 • Public • Published

is-sorted

A small module to check if an Array is sorted.

workflow codecov

![License]https://img.shields.io/apm/l/array-is-sorted-1

Example

let 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

Package Sidebar

Install

npm i array-is-sorted-1

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.49 kB

Total Files

6

Last publish

Collaborators

  • luobinf