Skip to content

Commit

Permalink
chore!: upgrade is-url-superb to ^4.0.0 (#125)
Browse files Browse the repository at this point in the history
* chore!: upgrade is-url-superb to ^4.0.0

*Breaking*: Require Node.js 10
- remove url-regex dependency

* chore: remove self-dep from perf test and update deps for audit

Co-authored-by: shellscape <andrew@shellscape.org>
  • Loading branch information
AndersCan and shellscape committed Sep 16, 2020
1 parent 38fafe9 commit d719ce1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 100 deletions.
2 changes: 1 addition & 1 deletion lib/nodes/Word.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Word extends Node {
const { value } = lastNode;
lastNode.isColor = colorRegex.test(value) || colorNames.includes(value.toLowerCase());
lastNode.isHex = hexRegex.test(value);
lastNode.isUrl = isUrl(value);
lastNode.isUrl = value.startsWith('//') ? isUrl(`http:${value}`) : isUrl(value);
lastNode.isVariable = Word.testVariable(tokens[0], parser);
}

Expand Down
97 changes: 12 additions & 85 deletions package-lock.json

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

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"engines": {
"node": ">=6.14.4"
"node": ">=10"
},
"scripts": {
"ci:coverage": "nyc npm run test && nyc report --reporter=text-lcov > coverage.lcov",
Expand All @@ -31,9 +31,8 @@
],
"dependencies": {
"color-name": "^1.1.4",
"is-url-superb": "^3.0.0",
"postcss": "^7.0.5",
"url-regex": "^5.0.0"
"is-url-superb": "^4.0.0",
"postcss": "^7.0.5"
},
"devDependencies": {
"ava": "^3.5.1",
Expand All @@ -44,7 +43,6 @@
"nyc": "^15.0.0",
"perfy": "^1.1.5",
"postcss-value-parser": "^4.0.0",
"postcss-values-parser": "^3.0.3",
"pre-commit": "^1.2.2",
"prettier": "^2.0.1",
"strip-ansi": "^6.0.0",
Expand Down
10 changes: 1 addition & 9 deletions perf/perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const chalk = require('chalk');
const globby = require('globby');
const perfy = require('perfy');
const valueParser = require('postcss-value-parser');
const v2Parser = require('postcss-values-parser');

const strip = require('strip-ansi');
const table = require('text-table');

Expand Down Expand Up @@ -39,14 +39,6 @@ const { parse } = require('../');
theirs = { milliseconds: NaN };
}

perfy.start('v2');
try {
v2Parser(test).parse();
v2 = perfy.end('v2');
} catch (e) {
v2 = { milliseconds: NaN };
}

results.push({
test,
ours: ours.milliseconds,
Expand Down

0 comments on commit d719ce1

Please sign in to comment.