first commit
This commit is contained in:
20
build/node_modules/ip-regex/index.js
generated
vendored
Normal file
20
build/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');
|
||||
};
|
||||
21
build/node_modules/ip-regex/license
generated
vendored
Normal file
21
build/node_modules/ip-regex/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
74
build/node_modules/ip-regex/package.json
generated
vendored
Normal file
74
build/node_modules/ip-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ip-regex@1.0.3",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "ip-regex@1.0.3",
|
||||
"_id": "ip-regex@1.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-3FiQdvZZ9BnCIgOaMzFvHHOH7/0=",
|
||||
"_location": "/ip-regex",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "ip-regex@1.0.3",
|
||||
"name": "ip-regex",
|
||||
"escapedName": "ip-regex",
|
||||
"rawSpec": "1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/url-regex"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz",
|
||||
"_spec": "1.0.3",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/ip-regex/issues"
|
||||
},
|
||||
"description": "Regular expression for matching IP addresses",
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/ip-regex#readme",
|
||||
"keywords": [
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern",
|
||||
"ip",
|
||||
"internet",
|
||||
"protocol",
|
||||
"address",
|
||||
"validate"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "ip-regex",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/ip-regex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.3"
|
||||
}
|
||||
59
build/node_modules/ip-regex/readme.md
generated
vendored
Normal file
59
build/node_modules/ip-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# ip-regex [](https://travis-ci.org/sindresorhus/ip-regex)
|
||||
|
||||
> Regular expression for matching IP addresses
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save ip-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var ipRegex = require('ip-regex');
|
||||
|
||||
// contains an IP address
|
||||
ipRegex().test('unicorn 192.168.0.1');
|
||||
//=> true
|
||||
|
||||
// is an IP address
|
||||
ipRegex({exact: true}).test('unicorn 192.168.0.1');
|
||||
//=> false
|
||||
|
||||
ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8');
|
||||
//=> true
|
||||
|
||||
'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex());
|
||||
//=> ['192.168.0.1', '1:2:3:4:5:6:7:8']
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### ipRegex(options)
|
||||
|
||||
Returns a regex for matching both IPv4 and IPv6.
|
||||
|
||||
### ipRegex.v4(options)
|
||||
|
||||
Returns a regex for matching IPv4.
|
||||
|
||||
### ipRegex.v6(options)
|
||||
|
||||
Returns a regex for matching IPv6.
|
||||
|
||||
#### options.exact
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false` *(Matches any IP address in a string)*
|
||||
|
||||
Only match an exact string.
|
||||
Useful with `RegExp#test` to check if a string is an IP address.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user