Skip to content

Commit 4d0d889

Browse files
committed
upgrade sort-array
1 parent d156304 commit 4d0d889

5 files changed

Lines changed: 61 additions & 64 deletions

File tree

LICENSE.md

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) 2014-19 Lloyd Brookes <75pound@gmail.com>
3+
Copyright (c) 2014-20 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.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ $ jsdoc2md --json <files>
2424

2525
* * *
2626

27-
&copy; 2014-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
27+
&copy; 2014-20 Lloyd Brookes \<75pound@gmail.com\>.
28+
29+
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ function jsdocParse (jsdocData) {
1616
return sort(data)
1717
}
1818

19-
function sort (array, properties) {
19+
function sort (array) {
2020
const sortBy = require('sort-array')
21-
const customOrder = {
22-
kind: ['class', 'constructor', 'mixin', 'member', 'namespace', 'enum', 'constant', 'function', 'event', 'typedef', 'external'],
23-
scope: ['global', 'instance', 'static', 'inner']
24-
}
25-
properties = properties || ['scope', 'category', 'kind', 'order']
26-
return sortBy(array, properties, customOrder)
21+
return sortBy(array, {
22+
by: ['scope', 'category', 'kind', 'order'],
23+
order: ['scope', 'asc', 'kind', 'asc'],
24+
customOrders: {
25+
kind: ['class', 'constructor', 'mixin', 'member', 'namespace', 'enum', 'constant', 'function', 'event', 'typedef', 'external'],
26+
scope: ['global', 'instance', 'static', 'inner']
27+
},
28+
nullRank: -1,
29+
undefinedRank: -1
30+
})
2731
}
2832

2933
module.exports = jsdocParse

package-lock.json

Lines changed: 44 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"lodash.omit": "^4.5.0",
2424
"lodash.pick": "^4.4.0",
2525
"reduce-extract": "^1.0.0",
26-
"sort-array": "^2.0.0",
26+
"sort-array": "^4.1.0-0",
2727
"test-value": "^3.0.0"
2828
},
2929
"devDependencies": {
30-
"test-runner": "^0.8.3"
30+
"test-runner": "^0.8.10"
3131
},
3232
"standard": {
3333
"ignore": [

0 commit comments

Comments
 (0)