https://github.com/dcousens/is-sorted
A small module to check if an Array is sorted
https://github.com/dcousens/is-sorted
array array-like javascript sort sorting
Last synced: 7 months ago
JSON representation
A small module to check if an Array is sorted
- Host: GitHub
- URL: https://github.com/dcousens/is-sorted
- Owner: dcousens
- License: mit
- Created: 2015-05-18T03:43:07.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T04:07:03.000Z (about 2 years ago)
- Last Synced: 2025-08-29T20:30:11.407Z (7 months ago)
- Topics: array, array-like, javascript, sort, sorting
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 22
- Watchers: 2
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micro-npm-packages - is-sorted - A small module to check if an Array is sorted. (Modules / Array)
- fucking-awesome-micro-npm-packages - is-sorted - A small module to check if an Array is sorted. (Modules / Array)
- awesome-micro-npm-packages - is-sorted - A small module to check if an Array is sorted. (Modules / Array)
- awesome-micro-npm-packages-zh - is-sorted - 检查数组是否被排序. (模块 / 数组)
README
# is-sorted
[](https://www.npmjs.org/package/is-sorted)
[](https://github.com/feross/standard)
A small module to check if an Array is sorted.
## Example
``` javascript
const 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](LICENSE)