From 54e15e5d834d10c1193e5d7a88421dad2d7b0bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Zorro?= Date: Fri, 15 Nov 2019 08:32:57 -0500 Subject: [PATCH] Removing unrelated file changes --- index.js | 4 +--- lib/isIP.js | 53 +------------------------------------------- lib/isMobilePhone.js | 1 - 3 files changed, 2 insertions(+), 56 deletions(-) diff --git a/index.js b/index.js index da024fb49..a51d0031b 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,5 @@ "use strict"; -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - Object.defineProperty(exports, "__esModule", { value: true }); @@ -161,7 +159,7 @@ var _isSlug = _interopRequireDefault(require("./lib/isSlug")); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } diff --git a/lib/isIP.js b/lib/isIP.js index 13f7ebc3f..dc7f95447 100644 --- a/lib/isIP.js +++ b/lib/isIP.js @@ -9,35 +9,6 @@ var _assertString = _interopRequireDefault(require("./util/assertString")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** -11.3. Examples - - The following addresses - - fe80::1234 (on the 1st link of the node) - ff02::5678 (on the 5th link of the node) - ff08::9abc (on the 10th organization of the node) - - would be represented as follows: - - fe80::1234%1 - ff02::5678%5 - ff08::9abc%10 - - (Here we assume a natural translation from a zone index to the - part, where the Nth zone of any scope is translated into - "N".) - - If we use interface names as , those addresses could also be - represented as follows: - - fe80::1234%ne0 - ff02::5678%pvc1.3 - ff08::9abc%interface10 - - where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs - to the 5th link, and "interface10" belongs to the 10th organization. - * * */ var ipv4Maybe = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; var ipv6Block = /^[0-9A-F]{1,4}$/i; @@ -58,29 +29,7 @@ function isIP(str) { }); return parts[3] <= 255; } else if (version === '6') { - var addressAndZone = [str]; // ipv6 addresses could have scoped architecture - // according to https://tools.ietf.org/html/rfc4007#section-11 - - if (str.includes('%')) { - addressAndZone = str.split('%'); - - if (addressAndZone.length !== 2) { - // it must be just two parts - return false; - } - - if (!addressAndZone[0].includes(':')) { - // the first part must be the address - return false; - } - - if (addressAndZone[1] === '') { - // the second part must not be empty - return false; - } - } - - var blocks = addressAndZone[0].split(':'); + var blocks = str.split(':'); var foundOmissionBlock = false; // marker to indicate :: // At least some OS accept the last 32 bits of an IPv6 address // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says diff --git a/lib/isMobilePhone.js b/lib/isMobilePhone.js index 9e699d126..99e48f660 100644 --- a/lib/isMobilePhone.js +++ b/lib/isMobilePhone.js @@ -52,7 +52,6 @@ var phones = { 'en-ZM': /^(\+?26)?09[567]\d{7}$/, 'es-CO': /^(\+?57)?([1-8]{1}|3[0-9]{2})?[2-9]{1}\d{6}$/, 'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/, - 'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/, 'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/, 'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/, 'es-PA': /^(\+?507)\d{7,8}$/,