Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop Node.js 8 #191

Merged
merged 3 commits into from Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -5,10 +5,10 @@ init:
# Test against these versions of Node.js.
environment:
matrix:
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "12"
- nodejs_version: "13"
- nodejs_version: "14"

matrix:
fast_finish: true
Expand Down
6 changes: 2 additions & 4 deletions lib/decode_url.js
@@ -1,7 +1,6 @@
'use strict';

const { parse, URL } = require('url');
const { toUnicode } = require('punycode.js');
const { parse, format } = require('url');

const safeDecodeURI = str => {
try {
Expand All @@ -18,8 +17,7 @@ const decodeURL = str => {
// Exit if input is a data url
if (parsed.origin === 'null') return str;

// TODO: refactor to `url.format()` once Node 8 is dropped
const url = parsed.toString().replace(parsed.hostname, toUnicode(parsed.hostname));
const url = format(parsed, { unicode: true });
return safeDecodeURI(url);
}

Expand Down
6 changes: 2 additions & 4 deletions lib/encode_url.js
@@ -1,7 +1,6 @@
'use strict';

const { toUnicode } = require('punycode.js');
const { parse, URL } = require('url');
const { parse, format } = require('url');

const safeDecodeURI = str => {
try {
Expand All @@ -20,8 +19,7 @@ const encodeURL = str => {

parsed.search = encodeURI(safeDecodeURI(parsed.search));
// preserve IDN
// TODO: refactor to url.format() once Node 8 EOL
return parsed.toString().replace(parsed.hostname, toUnicode(parsed.hostname));
return format(parsed, { unicode: true });
}

return encodeURI(safeDecodeURI(str));
Expand Down
2 changes: 1 addition & 1 deletion lib/full_url_for.js
@@ -1,6 +1,6 @@
'use strict';

const { parse, URL } = require('url');
const { parse } = require('url');
const encodeURL = require('./encode_url');
const prettyUrls = require('./pretty_urls');

Expand Down
2 changes: 1 addition & 1 deletion lib/is_external_link.js
@@ -1,6 +1,6 @@
'use strict';

const { parse, URL } = require('url');
const { parse } = require('url');

const Cache = require('./cache');
const cache = new Cache();
Expand Down
2 changes: 1 addition & 1 deletion lib/url_for.js
@@ -1,6 +1,6 @@
'use strict';

const { parse, URL } = require('url');
const { parse } = require('url');
const encodeURL = require('./encode_url');
const relative_url = require('./relative_url');
const prettyUrls = require('./pretty_urls');
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -50,11 +50,10 @@
"highlight.js": "^9.13.1",
"htmlparser2": "^4.0.0",
"prismjs": "^1.17.1",
"punycode.js": "^2.1.0",
"strip-indent": "^3.0.0",
"striptags": "^3.1.1"
},
"engines": {
"node": ">=8.6.0"
"node": ">=10.13.0"
}
}