From cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 27 Mar 2019 21:01:33 +0100 Subject: remove node_modules --- node_modules/is-url/index.js | 47 -------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 node_modules/is-url/index.js (limited to 'node_modules/is-url/index.js') diff --git a/node_modules/is-url/index.js b/node_modules/is-url/index.js deleted file mode 100644 index 3ea3d20db..000000000 --- a/node_modules/is-url/index.js +++ /dev/null @@ -1,47 +0,0 @@ - -/** - * Expose `isUrl`. - */ - -module.exports = isUrl; - -/** - * RegExps. - * A URL must match #1 and then at least one of #2/#3. - * Use two levels of REs to avoid REDOS. - */ - -var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/; - -var localhostDomainRE = /^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/ -var nonLocalhostDomainRE = /^[^\s\.]+\.\S{2,}$/; - -/** - * Loosely validate a URL `string`. - * - * @param {String} string - * @return {Boolean} - */ - -function isUrl(string){ - if (typeof string !== 'string') { - return false; - } - - var match = string.match(protocolAndDomainRE); - if (!match) { - return false; - } - - var everythingAfterProtocol = match[1]; - if (!everythingAfterProtocol) { - return false; - } - - if (localhostDomainRE.test(everythingAfterProtocol) || - nonLocalhostDomainRE.test(everythingAfterProtocol)) { - return true; - } - - return false; -} -- cgit v1.2.3