Comparing version 2.1.1 to 2.1.2
14
index.js
'use strict'; | ||
var ip = require('ip-regex').v4().source; | ||
var tlds = require('./tlds.json').join('|'); | ||
@@ -8,2 +9,3 @@ | ||
* | ||
* @param {Object} opts | ||
* @api public | ||
@@ -22,15 +24,5 @@ */ | ||
var tld = '(?:\\.(?:xn--[a-z0-9\\-]{1,59}|' + tlds + '+))'; | ||
var ips = [ | ||
'(?!10(?:\\.\\d{1,3}){3})', | ||
'(?!127(?:\\.\\d{1,3}){3})', | ||
'(?!169\\.254(?:\\.\\d{1,3}){2})', | ||
'(?!192\\.168(?:\\.\\d{1,3}){2})', | ||
'(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})', | ||
'(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])', | ||
'(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}', | ||
'(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' | ||
].join(''); | ||
var regex = [ | ||
protocol + auth + '(?:' + ips + '|', | ||
protocol + auth + '(?:' + ip + '|', | ||
'(?:localhost)|' + host + domain + tld + ')' + port + path | ||
@@ -37,0 +29,0 @@ ].join(''); |
{ | ||
"name": "url-regex", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Regular expression for matching URLs", | ||
@@ -32,3 +32,6 @@ "license": "MIT", | ||
"tlds": "^1.14.0" | ||
}, | ||
"dependencies": { | ||
"ip-regex": "^1.0.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9173
1
25
+ Addedip-regex@^1.0.1
+ Addedip-regex@1.0.3(transitive)