Skip to content

Commit f69a507

Browse files
committed
Fix type in readme. Add node 15 to travis
1 parent 191f1b4 commit f69a507

8 files changed

Lines changed: 2806 additions & 44 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_js:
33
- 10
44
- 12
55
- 14
6+
- 15

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-20 Lloyd Brookes <75pound@gmail.com>
3+
Copyright (c) 2015-21 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@ This library is compatible with Node.js, the Web and any style of module loader.
177177
Node.js:
178178

179179
```js
180-
const arrayify = require('sort-array')
180+
const sortArray = require('sort-array')
181181
```
182182

183183
Within Node.js with ECMAScript Module support enabled:
184184

185185
```js
186-
import arrayify from 'sort-array'
186+
import sortArray from 'sort-array'
187187
```
188188

189189
Within an modern browser ECMAScript Module:
190190

191191
```js
192-
import arrayify from './node_modules/sort-array/dist/index.mjs'
192+
import sortArray from './node_modules/sort-array/dist/index.mjs'
193193
```
194194

195195
Old browser (adds `window.sortArray`):
@@ -200,6 +200,6 @@ Old browser (adds `window.sortArray`):
200200

201201
* * *
202202

203-
&copy; 2015-20 Lloyd Brookes \<75pound@gmail.com\>.
203+
&copy; 2015-21 Lloyd Brookes \<75pound@gmail.com\>.
204204

205205
Isomorphic test suite by [test-runner](https://github.com/test-runner-js/test-runner) and [web-runner](https://github.com/test-runner-js/web-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,19 @@ This library is compatible with Node.js, the Web and any style of module loader.
202202
Node.js:
203203

204204
```js
205-
const arrayify = require('sort-array')
205+
const sortArray = require('sort-array')
206206
```
207207

208208
Within Node.js with ECMAScript Module support enabled:
209209

210210
```js
211-
import arrayify from 'sort-array'
211+
import sortArray from 'sort-array'
212212
```
213213

214214
Within an modern browser ECMAScript Module:
215215

216216
```js
217-
import arrayify from './node_modules/sort-array/dist/index.mjs'
217+
import sortArray from './node_modules/sort-array/dist/index.mjs'
218218
```
219219

220220
Old browser (adds `window.sortArray`):
@@ -225,6 +225,6 @@ Old browser (adds `window.sortArray`):
225225

226226
* * *
227227

228-
&copy; 2015-20 Lloyd Brookes \<75pound@gmail.com\>.
228+
&copy; 2015-21 Lloyd Brookes \<75pound@gmail.com\>.
229229

230230
Isomorphic test suite by [test-runner](https://github.com/test-runner-js/test-runner) and [web-runner](https://github.com/test-runner-js/web-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

dist/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,13 @@
5252
function arrayify (input) {
5353
if (Array.isArray(input)) {
5454
return input
55-
}
56-
57-
if (input === undefined) {
55+
} else if (input === undefined) {
5856
return []
59-
}
60-
61-
if (isArrayLike(input) || input instanceof Set) {
57+
} else if (isArrayLike(input) || input instanceof Set) {
6258
return Array.from(input)
59+
} else {
60+
return [input]
6361
}
64-
65-
return [input]
6662
}
6763

6864
/**

dist/index.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,13 @@ function isArrayLike (input) {
4646
function arrayify (input) {
4747
if (Array.isArray(input)) {
4848
return input
49-
}
50-
51-
if (input === undefined) {
49+
} else if (input === undefined) {
5250
return []
53-
}
54-
55-
if (isArrayLike(input) || input instanceof Set) {
51+
} else if (isArrayLike(input) || input instanceof Set) {
5652
return Array.from(input)
53+
} else {
54+
return [input]
5755
}
58-
59-
return [input]
6056
}
6157

6258
/**

0 commit comments

Comments
 (0)