1.0.0 • Published 2 years ago

array-is-sorted-1 v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

is-sorted

A small module to check if an Array is sorted.

workflow codecov

Licensehttps://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