| Index: lib/url.js |
| diff --git a/lib/url.js b/lib/url.js |
| index 4ea741dbbfee3134f421426713b877edf6f39364..7614799423094d75f900f13e7f0cd35919c8b950 100644 |
| --- a/lib/url.js |
| +++ b/lib/url.js |
| @@ -17,8 +17,10 @@ |
| /** @module url */ |
| -let getDomain = require("tldjs").getDomain; |
| -let punycode = require("punycode"); |
| +"use strict"; |
| + |
| +const {getDomain} = require("tldjs"); |
| +const punycode = require("punycode"); |
| let getDecodedHostname = |
| /** |
| @@ -28,7 +30,7 @@ let getDecodedHostname = |
| * @return {string} |
| * @static |
| */ |
| -exports.getDecodedHostname = function(url) |
| +exports.getDecodedHostname = url => |
| { |
| let hostname = url.hostname; |
| @@ -46,7 +48,7 @@ exports.getDecodedHostname = function(url) |
| * @param {Frame} frame |
| * @return {string} |
| */ |
| -exports.extractHostFromFrame = function(frame) |
| +exports.extractHostFromFrame = frame => |
| { |
| for (; frame; frame = frame.parent) |
| { |
| @@ -65,7 +67,7 @@ exports.extractHostFromFrame = function(frame) |
| * @param {URL} url |
| * @return {string} |
| */ |
| -exports.stringifyURL = function(url) |
| +exports.stringifyURL = url => |
| { |
| let protocol = url.protocol; |
| let href = url.href; |
| @@ -102,7 +104,7 @@ function isDomain(hostname) |
| * @param {string} documentHost The IDN-decoded hostname of the document |
| * @return {Boolean} |
| */ |
| -exports.isThirdParty = function(url, documentHost) |
| +exports.isThirdParty = (url, documentHost) => |
| { |
| let requestHost = getDecodedHostname(url).replace(/\.+$/, ""); |
| documentHost = documentHost.replace(/\.+$/, ""); |