Add production dependencies
This commit is contained in:
parent
5a0114f3e2
commit
579ccdc29f
12113 changed files with 978046 additions and 3 deletions
20
node_modules/ip-regex/index.js
generated
vendored
Normal file
20
node_modules/ip-regex/index.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
var v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}';
|
||||
var v6 = '(?:(?:[0-9a-fA-F:]){1,4}(?:(?::(?:[0-9a-fA-F]){1,4}|:)){2,7})+';
|
||||
|
||||
var ip = module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
return opts.exact ? new RegExp('(?:^' + v4 + '$)|(?:^' + v6 + '$)') :
|
||||
new RegExp('(?:' + v4 + ')|(?:' + v6 + ')', 'g');
|
||||
};
|
||||
|
||||
ip.v4 = function (opts) {
|
||||
opts = opts || {};
|
||||
return opts.exact ? new RegExp('^' + v4 + '$') : new RegExp(v4, 'g');
|
||||
};
|
||||
|
||||
ip.v6 = function (opts) {
|
||||
opts = opts || {};
|
||||
return opts.exact ? new RegExp('^' + v6 + '$') : new RegExp(v6, 'g');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue