Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
parent
a10d84bc2e
commit
7ad2aa66bb
7655 changed files with 1763577 additions and 14 deletions
24
node_modules/ip-regex/index.js
generated
vendored
Normal file
24
node_modules/ip-regex/index.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
const 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}';
|
||||
|
||||
const v6seg = '[0-9a-fA-F]{1,4}';
|
||||
const v6 = `
|
||||
(
|
||||
(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
||||
(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
||||
(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
||||
(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
||||
(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
||||
(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
||||
(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
||||
(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
||||
)(%[0-9a-zA-Z]{1,})? // %eth0 %1
|
||||
`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
|
||||
|
||||
const ip = module.exports = opts => opts && opts.exact ?
|
||||
new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) :
|
||||
new RegExp(`(?:${v4})|(?:${v6})`, 'g');
|
||||
|
||||
ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g');
|
||||
ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g');
|
21
node_modules/ip-regex/license
generated
vendored
Normal file
21
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.
|
45
node_modules/ip-regex/package.json
generated
vendored
Normal file
45
node_modules/ip-regex/package.json
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "ip-regex",
|
||||
"version": "2.1.0",
|
||||
"description": "Regular expression for matching IP addresses (IPv4 & IPv6)",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/ip-regex",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"ip",
|
||||
"ipv6",
|
||||
"ipv4",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"text",
|
||||
"pattern",
|
||||
"internet",
|
||||
"protocol",
|
||||
"address",
|
||||
"validate"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
63
node_modules/ip-regex/readme.md
generated
vendored
Normal file
63
node_modules/ip-regex/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
# ip-regex [](https://travis-ci.org/sindresorhus/ip-regex)
|
||||
|
||||
> Regular expression for matching IP addresses
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save ip-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const 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`<br>
|
||||
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.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Loading…
Add table
Add a link
Reference in a new issue