Skip to content

Commit 655c785

Browse files
committed
add support for nanRank. Fixes #15
1 parent 06eb159 commit 655c785

File tree

9 files changed

+83
-382
lines changed

9 files changed

+83
-382
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest, windows-latest]
19-
node-version: [12, 14, 16, 18, 20, 22]
19+
node-version: [12, 14, 16, 18, 20, 22, 24]
2020

2121
steps:
2222
- uses: actions/checkout@v4

LICENSE renamed to LICENCE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
The MIT Licence (MIT)
22

3-
Copyright (c) 2015-24 Lloyd Brookes <75pound@gmail.com>
3+
Copyright (c) 2015-25 Lloyd Brookes <75pound@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.hbs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ Please visit [the sort-array wiki](https://github.com/75lb/sort-array/wiki) for
174174

175175
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
176176

177-
Node.js:
177+
Node.js CommonJS:
178178

179179
```js
180180
const sortArray = require('sort-array')
181181
```
182182

183-
Within Node.js with ECMAScript Module support enabled:
183+
Node.js ECMAScript:
184184

185185
```js
186186
import sortArray from 'sort-array'
@@ -192,14 +192,8 @@ Within an modern browser ECMAScript Module:
192192
import sortArray from './node_modules/sort-array/dist/index.mjs'
193193
```
194194

195-
Old browser (adds `window.sortArray`):
196-
197-
```html
198-
<script nomodule src="./node_modules/sort-array/dist/index.js"></script>
199-
```
200-
201195
* * *
202196

203-
&copy; 2015-24 Lloyd Brookes \<75pound@gmail.com\>.
197+
&copy; 2015-25 Lloyd Brookes \<75pound@gmail.com\>.
204198

205199
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,20 @@ const sortArray = require('sort-array')
193193
| [options.computed] | <code>object</code> | A dictionary object containing one or more computed field functions. The function will be invoked once per item in the array. Each invocation will receive the array item as input and must return a primitive value by which the array can be sorted. |
194194
| [options.nullRank] | <code>number</code> | Configures whether `null` values will be sorted before or after defined values. Set to `-1` for before, `1` for after. Defaults to `1`. |
195195
| [options.undefinedRank] | <code>number</code> | Configures whether `undefined` values will be sorted before or after defined values. Set to `-1` for before, `1` for after. Defaults to `1`. |
196+
| [options.nanRank] | <code>number</code> | Configures whether `NaN` values will be sorted before or after defined values. Set to `-1` for before, `1` for after. Defaults to `1`. |
196197

197198

198199
## Load anywhere
199200

200201
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
201202

202-
Node.js:
203+
Node.js CommonJS:
203204

204205
```js
205206
const sortArray = require('sort-array')
206207
```
207208

208-
Within Node.js with ECMAScript Module support enabled:
209+
Node.js ECMAScript:
209210

210211
```js
211212
import sortArray from 'sort-array'
@@ -217,14 +218,8 @@ Within an modern browser ECMAScript Module:
217218
import sortArray from './node_modules/sort-array/dist/index.mjs'
218219
```
219220

220-
Old browser (adds `window.sortArray`):
221-
222-
```html
223-
<script nomodule src="./node_modules/sort-array/dist/index.js"></script>
224-
```
225-
226221
* * *
227222

228-
&copy; 2015-24 Lloyd Brookes \<75pound@gmail.com\>.
223+
&copy; 2015-25 Lloyd Brookes \<75pound@gmail.com\>.
229224

230225
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

0 commit comments

Comments
 (0)