Skip to content

Commit 17a652a

Browse files
committed
Drop Node.js 10 support to enable native array sorting
Closes #50
1 parent 4e21583 commit 17a652a

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22

33
node_js:
4+
- 14
45
- 12
5-
- 10
66

77
script:
88
- npm run test:ci

package-lock.json

Lines changed: 0 additions & 5 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"preversion": "npm test",
1717
"scrape": "node src/property-scraper"
1818
},
19-
"dependencies": {
20-
"timsort": "^0.3.0"
21-
},
19+
"dependencies": {},
2220
"devDependencies": {
2321
"@mdn/browser-compat-data": "^2.0.3",
2422
"benchmark": "^2.1.4",
@@ -30,7 +28,7 @@
3028
"postcss": "^8.0.9"
3129
},
3230
"engines": {
33-
"node": ">= 10"
31+
"node": ">= 12"
3432
},
3533
"repository": {
3634
"type": "git",

src/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
const { readFile } = require('fs').promises;
44
const path = require('path');
55

6-
const timsort = require('timsort').sort;
7-
86
const builtInOrders = [
97
'alphabetical',
108
'concentric-css',
@@ -107,7 +105,7 @@ function processCss ({ css, comparator }) {
107105
}
108106

109107
function sortCssDeclarations ({ nodes, comparator }) {
110-
timsort(nodes, (a, b) => {
108+
nodes.sort((a, b) => {
111109
if (a.type === 'decl' && b.type === 'decl') {
112110
return comparator(a.prop, b.prop);
113111
} else {

0 commit comments

Comments
 (0)