Skip to content

Commit

Permalink
Drop Node.js 10 support to enable native array sorting
Browse files Browse the repository at this point in the history
Closes #50
  • Loading branch information
Siilwyn committed Oct 17, 2020
1 parent 4e21583 commit 17a652a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js

node_js:
- 14
- 12
- 10

script:
- npm run test:ci
Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"preversion": "npm test",
"scrape": "node src/property-scraper"
},
"dependencies": {
"timsort": "^0.3.0"
},
"dependencies": {},
"devDependencies": {
"@mdn/browser-compat-data": "^2.0.3",
"benchmark": "^2.1.4",
Expand All @@ -30,7 +28,7 @@
"postcss": "^8.0.9"
},
"engines": {
"node": ">= 10"
"node": ">= 12"
},
"repository": {
"type": "git",
Expand Down
4 changes: 1 addition & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
const { readFile } = require('fs').promises;
const path = require('path');

const timsort = require('timsort').sort;

const builtInOrders = [
'alphabetical',
'concentric-css',
Expand Down Expand Up @@ -107,7 +105,7 @@ function processCss ({ css, comparator }) {
}

function sortCssDeclarations ({ nodes, comparator }) {
timsort(nodes, (a, b) => {
nodes.sort((a, b) => {
if (a.type === 'decl' && b.type === 'decl') {
return comparator(a.prop, b.prop);
} else {
Expand Down

0 comments on commit 17a652a

Please sign in to comment.