diff --git a/index.js b/index.js index 2eb99844a..b2af5bb07 100644 --- a/index.js +++ b/index.js @@ -181,7 +181,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 _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; } diff --git a/lib/isIP.js b/lib/isIP.js index b5a924cfd..83dfda2a3 100644 --- a/lib/isIP.js +++ b/lib/isIP.js @@ -58,29 +58,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 ede3f6637..cbb133256 100644 --- a/lib/isMobilePhone.js +++ b/lib/isMobilePhone.js @@ -55,7 +55,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}$/,