# @suninfo/array-is-sorted

> 检测数组是否排序的模块

Latest version **0.1.0** (published 2018-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @suninfo/array-is-sorted
pnpm add @suninfo/array-is-sorted
yarn add @suninfo/array-is-sorted
bun add @suninfo/array-is-sorted
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-04-08 |
| First published | 2018-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | XinHuaLuFang |
| Maintainers | xhlf |
| Keywords | array, is-sorted, sort, sorted |

## Links

- npm: https://www.npmjs.com/package/@suninfo/array-is-sorted
- Repository: https://github.com/SunInfoFE/array-is-sorted
- Issues: https://github.com/SunInfoFE/array-is-sorted/issues
- npm.io page: https://npm.io/package/@suninfo/array-is-sorted

## Recent versions

- 0.1.0 (latest) — 2018-04-08

## README

# array-is-sorted

检测数组是否排序的模块


# Installation

```bash
$ npm install @sunflower/array-is-sorted
```

# Usage

默认的排序规则为由小到大。
```js
const checksorted = require('@sunflower/array-is-sorted');

checksorted([1, 3, 5]); // => true
checksorted([3, 1, 5]); // => false
```

自定义排序规则
```js
const checksorted = require('@sunflower/array-is-sorted');

let myfun = function(prev, next) {
  return next.charCodeAt() - prev.charCodeAt()
};

checksorted(['a', 'b', 'f'], myfun); // => true
checksorted(['c', 'z', 'm'], myfun); // => false
```

# Tests

安装`mocha`测试框架，然后执行测试命令：
```bash
$ yarn
$ npm test
```

# License
The [MIT](LICENSE) License

---
_Source: https://npm.io/package/@suninfo/array-is-sorted · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
