mirror of
https://github.com/taixingyiji/openit.git
synced 2025-11-02 13:52:23 +00:00
Hello World
This commit is contained in:
1
utils/rm/node_modules/ip-address/.eslintignore
generated
vendored
Normal file
1
utils/rm/node_modules/ip-address/.eslintignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
46
utils/rm/node_modules/ip-address/.eslintrc
generated
vendored
Normal file
46
utils/rm/node_modules/ip-address/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"array-bracket-spacing": [2, "never"],
|
||||
"brace-style": [2, "1tbs"],
|
||||
"camelcase": 2,
|
||||
"computed-property-spacing": [2, "never"],
|
||||
"consistent-this": [1, "self"],
|
||||
"default-case": 2,
|
||||
"func-style": [2, "declaration"],
|
||||
"guard-for-in": 2,
|
||||
"indent": [2, 2],
|
||||
"linebreak-style": [2, "unix"],
|
||||
"max-nested-callbacks": 0,
|
||||
"no-console": 0,
|
||||
"no-else-return": 1,
|
||||
"no-eq-null": 2,
|
||||
"no-floating-decimal": 2,
|
||||
"no-irregular-whitespace": 2,
|
||||
"no-lonely-if": 2,
|
||||
"no-multi-spaces": 1,
|
||||
"no-nested-ternary": 2,
|
||||
"no-process-exit": 0,
|
||||
"no-self-compare": 2,
|
||||
"no-shadow": 1,
|
||||
"no-spaced-func": 2,
|
||||
"no-undef": 2,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
|
||||
"object-curly-spacing": [2, "never"],
|
||||
"quotes": [1, "single", "avoid-escape"],
|
||||
"radix": 2,
|
||||
"require-jsdoc": 2,
|
||||
"semi": [2, "always"],
|
||||
"semi-spacing": [2, {"before": false, "after": true}],
|
||||
"space-after-keywords": [2, "always"],
|
||||
"space-infix-ops": 2,
|
||||
"space-return-throw-case": 2,
|
||||
"valid-jsdoc": 2,
|
||||
"wrap-iife": [2, "inside"]
|
||||
}
|
||||
}
|
||||
68
utils/rm/node_modules/ip-address/.jscsrc
generated
vendored
Normal file
68
utils/rm/node_modules/ip-address/.jscsrc
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"excludeFiles": [
|
||||
"**/node_modules/**",
|
||||
"lib/**"
|
||||
],
|
||||
"requireSpacesInConditionalExpression": {
|
||||
"afterTest": true,
|
||||
"beforeConsequent": true,
|
||||
"afterConsequent": true,
|
||||
"beforeAlternate": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true,
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"requireSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"requireSpacesInFunction": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInCallExpression": true,
|
||||
"requireBlocksOnNewline": true,
|
||||
"requirePaddingNewlinesBeforeKeywords": [
|
||||
"do",
|
||||
"for",
|
||||
"if",
|
||||
"switch",
|
||||
"case",
|
||||
"try",
|
||||
"catch",
|
||||
"while",
|
||||
"with",
|
||||
"return"
|
||||
],
|
||||
"disallowQuotedKeysInObjects": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"?",
|
||||
"=",
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!==",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<="
|
||||
],
|
||||
"disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"],
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"validateParameterSeparator": ", "
|
||||
}
|
||||
22
utils/rm/node_modules/ip-address/.travis.yml
generated
vendored
Normal file
22
utils/rm/node_modules/ip-address/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.npm
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
language: node_js
|
||||
node_js:
|
||||
- 12
|
||||
- 11
|
||||
- 10
|
||||
- 9
|
||||
- 8
|
||||
- 7
|
||||
- 6
|
||||
script: "./coverage.sh"
|
||||
sudo: false
|
||||
46
utils/rm/node_modules/ip-address/CODE_OF_CONDUCT.md
generated
vendored
Normal file
46
utils/rm/node_modules/ip-address/CODE_OF_CONDUCT.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at beau@beaugunderson.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
19
utils/rm/node_modules/ip-address/LICENSE
generated
vendored
Normal file
19
utils/rm/node_modules/ip-address/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2011 by Beau Gunderson
|
||||
|
||||
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.
|
||||
96
utils/rm/node_modules/ip-address/README.md
generated
vendored
Normal file
96
utils/rm/node_modules/ip-address/README.md
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
[![travis]](http://travis-ci.org/beaugunderson/ip-address)
|
||||
[![codecov]](https://codecov.io/github/beaugunderson/ip-address?branch=master)
|
||||
[![downloads]](https://www.npmjs.com/package/ip-address)
|
||||
[![npm]](https://www.npmjs.com/package/ip-address)
|
||||
[![greenkeeper]](https://greenkeeper.io/)
|
||||
|
||||
[codecov]: https://codecov.io/github/beaugunderson/ip-address/coverage.svg?branch=master
|
||||
[downloads]: https://img.shields.io/npm/dm/ip-address.svg
|
||||
[greenkeeper]: https://badges.greenkeeper.io/beaugunderson/ip-address.svg
|
||||
[npm]: https://img.shields.io/npm/v/ip-address.svg
|
||||
[travis]: https://img.shields.io/travis/beaugunderson/ip-address.svg
|
||||
|
||||
## ip-address
|
||||
|
||||
`ip-address` is a library for validating and manipulating IPv4 and IPv6
|
||||
addresses in JavaScript.
|
||||
|
||||
### Documentation
|
||||
|
||||
Documentation is available at [ip-address.js.org](http://ip-address.js.org/).
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
var Address6 = require('ip-address').Address6;
|
||||
|
||||
var address = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');
|
||||
|
||||
address.isValid(); // true
|
||||
|
||||
var teredo = address.inspectTeredo();
|
||||
|
||||
teredo.client4; // '157.60.0.1'
|
||||
```
|
||||
|
||||
### Features
|
||||
|
||||
- Parsing of all IPv6 notations
|
||||
- Parsing of IPv6 addresses and ports from URLs with `Address6.fromURL(url)`
|
||||
- Validity checking
|
||||
- Decoding of the [Teredo
|
||||
information](http://en.wikipedia.org/wiki/Teredo_tunneling#IPv6_addressing)
|
||||
in an address
|
||||
- Whether one address is a valid subnet of another
|
||||
- What special properties a given address has (multicast prefix, unique
|
||||
local address prefix, etc.)
|
||||
- Number of subnets of a certain size in a given address
|
||||
- Display methods
|
||||
- Hex, binary, and decimal
|
||||
- Canonical form
|
||||
- Correct form
|
||||
- IPv4-compatible (i.e. `::ffff:192.168.0.1`)
|
||||
- Works in [node](http://nodejs.org/) and the browser (with browserify)
|
||||
- ~1,600 test cases
|
||||
|
||||
### Used by
|
||||
|
||||
- [anon](https://github.com/edsu/anon) which powers
|
||||
[@congressedits](https://twitter.com/congressedits), among
|
||||
[many others](https://github.com/edsu/anon#community)
|
||||
- [base85](https://github.com/noseglid/base85): base85 encoding/decoding
|
||||
- [contrail-web-core](https://github.com/Juniper/contrail-web-core): part of
|
||||
Contrail, a network virtualization solution made by Juniper Networks
|
||||
- [dhcpjs](https://github.com/apaprocki/node-dhcpjs): a DHCP client and server
|
||||
- [epochtalk](https://github.com/epochtalk/epochtalk): next generation forum
|
||||
software
|
||||
- [geoip-web](https://github.com/tfrce/node-geoip-web): a server for
|
||||
quickly geolocating IP addresses
|
||||
- [hexabus](https://github.com/mysmartgrid/hexabus): an IPv6-based home
|
||||
automation bus
|
||||
- [hubot-deploy](https://github.com/atmos/hubot-deploy): GitHub Flow via hubot
|
||||
- [heroku-portscanner](https://github.com/robison/heroku-portscanner): nmap
|
||||
hosted on Heroku
|
||||
- [ipfs-swarm](https://github.com/diasdavid/node-ipfs-swarm): a swarm
|
||||
implementation based on IPFS
|
||||
- [javascript-x-server](https://github.com/GothAck/javascript-x-server): an X
|
||||
server written in JavaScript
|
||||
- [libnmap](https://github.com/jas-/node-libnmap): a node API for nmap
|
||||
- [mail-io](https://github.com/mofux/mail-io): a lightweight SMTP server
|
||||
- [maxmind-db-reader](https://github.com/PaddeK/node-maxmind-db): a library for
|
||||
reading MaxMind database files
|
||||
- [proxy-protocol-v2](https://github.com/ably/proxy-protocol-v2): a proxy
|
||||
protocol encoder/decoder built by [Ably](https://www.ably.io/)
|
||||
- [Samsara](https://github.com/mariusGundersen/Samsara): a Docker web interface
|
||||
- [sis-api](https://github.com/sis-cmdb/sis-api): a configuration management
|
||||
database API
|
||||
- [socks5-client](https://github.com/mattcg/socks5-client): a SOCKS v5 client
|
||||
- [socksified](https://github.com/vially/node-socksified): a SOCKS v5 client
|
||||
- [socksv5](https://github.com/mscdex/socksv5): a SOCKS v5 server/client
|
||||
- [ssdapi](https://github.com/rsolomou/ssdapi): an API created by the
|
||||
University of Portsmouth
|
||||
- [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega): a [Chrome
|
||||
extension](https://chrome.google.com/webstore/detail/padekgcemlokbadohgkifijomclgjgif)
|
||||
for switching between multiple proxies with ~311k users!
|
||||
- [swiz](https://github.com/racker/node-swiz): a serialization framework built
|
||||
and used by [Rackspace](http://www.rackspace.com/)
|
||||
26
utils/rm/node_modules/ip-address/bower.json
generated
vendored
Normal file
26
utils/rm/node_modules/ip-address/bower.json
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "ip-address",
|
||||
"description": "A library for parsing IPv6 and IPv4 IP addresses in node and the browser.",
|
||||
"main": "dist/ip-address-globals.js",
|
||||
"authors": [
|
||||
"Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ipv6",
|
||||
"ipv4",
|
||||
"browser",
|
||||
"validation"
|
||||
],
|
||||
"homepage": "https://github.com/beaugunderson/ip-address",
|
||||
"moduleType": [
|
||||
"globals"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
20579
utils/rm/node_modules/ip-address/dist/ip-address-globals.js
generated
vendored
Normal file
20579
utils/rm/node_modules/ip-address/dist/ip-address-globals.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
350
utils/rm/node_modules/ip-address/docs/assets/anchor.js
generated
vendored
Normal file
350
utils/rm/node_modules/ip-address/docs/assets/anchor.js
generated
vendored
Normal file
@@ -0,0 +1,350 @@
|
||||
/*!
|
||||
* AnchorJS - v4.0.0 - 2017-06-02
|
||||
* https://github.com/bryanbraun/anchorjs
|
||||
* Copyright (c) 2017 Bryan Braun; Licensed MIT
|
||||
*/
|
||||
/* eslint-env amd, node */
|
||||
|
||||
// https://github.com/umdjs/umd/blob/master/templates/returnExports.js
|
||||
(function(root, factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.AnchorJS = factory();
|
||||
root.anchors = new root.AnchorJS();
|
||||
}
|
||||
})(this, function() {
|
||||
'use strict';
|
||||
function AnchorJS(options) {
|
||||
this.options = options || {};
|
||||
this.elements = [];
|
||||
|
||||
/**
|
||||
* Assigns options to the internal options object, and provides defaults.
|
||||
* @param {Object} opts - Options object
|
||||
*/
|
||||
function _applyRemainingDefaultOptions(opts) {
|
||||
opts.icon = opts.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'.
|
||||
opts.visible = opts.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' & 'touch'
|
||||
opts.placement = opts.hasOwnProperty('placement')
|
||||
? opts.placement
|
||||
: 'right'; // Also accepts 'left'
|
||||
opts.class = opts.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name.
|
||||
// Using Math.floor here will ensure the value is Number-cast and an integer.
|
||||
opts.truncate = opts.hasOwnProperty('truncate')
|
||||
? Math.floor(opts.truncate)
|
||||
: 64; // Accepts any value that can be typecast to a number.
|
||||
}
|
||||
|
||||
_applyRemainingDefaultOptions(this.options);
|
||||
|
||||
/**
|
||||
* Checks to see if this device supports touch. Uses criteria pulled from Modernizr:
|
||||
* https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40
|
||||
* @returns {Boolean} - true if the current device supports touch.
|
||||
*/
|
||||
this.isTouchDevice = function() {
|
||||
return !!(
|
||||
'ontouchstart' in window ||
|
||||
(window.DocumentTouch && document instanceof DocumentTouch)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add anchor links to page elements.
|
||||
* @param {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links
|
||||
* to. Also accepts an array or nodeList containing the relavant elements.
|
||||
* @returns {this} - The AnchorJS object
|
||||
*/
|
||||
this.add = function(selector) {
|
||||
var elements,
|
||||
elsWithIds,
|
||||
idList,
|
||||
elementID,
|
||||
i,
|
||||
index,
|
||||
count,
|
||||
tidyText,
|
||||
newTidyText,
|
||||
readableID,
|
||||
anchor,
|
||||
visibleOptionToUse,
|
||||
indexesToDrop = [];
|
||||
|
||||
// We reapply options here because somebody may have overwritten the default options object when setting options.
|
||||
// For example, this overwrites all options but visible:
|
||||
//
|
||||
// anchors.options = { visible: 'always'; }
|
||||
_applyRemainingDefaultOptions(this.options);
|
||||
|
||||
visibleOptionToUse = this.options.visible;
|
||||
if (visibleOptionToUse === 'touch') {
|
||||
visibleOptionToUse = this.isTouchDevice() ? 'always' : 'hover';
|
||||
}
|
||||
|
||||
// Provide a sensible default selector, if none is given.
|
||||
if (!selector) {
|
||||
selector = 'h2, h3, h4, h5, h6';
|
||||
}
|
||||
|
||||
elements = _getElements(selector);
|
||||
|
||||
if (elements.length === 0) {
|
||||
return this;
|
||||
}
|
||||
|
||||
_addBaselineStyles();
|
||||
|
||||
// We produce a list of existing IDs so we don't generate a duplicate.
|
||||
elsWithIds = document.querySelectorAll('[id]');
|
||||
idList = [].map.call(elsWithIds, function assign(el) {
|
||||
return el.id;
|
||||
});
|
||||
|
||||
for (i = 0; i < elements.length; i++) {
|
||||
if (this.hasAnchorJSLink(elements[i])) {
|
||||
indexesToDrop.push(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (elements[i].hasAttribute('id')) {
|
||||
elementID = elements[i].getAttribute('id');
|
||||
} else if (elements[i].hasAttribute('data-anchor-id')) {
|
||||
elementID = elements[i].getAttribute('data-anchor-id');
|
||||
} else {
|
||||
tidyText = this.urlify(elements[i].textContent);
|
||||
|
||||
// Compare our generated ID to existing IDs (and increment it if needed)
|
||||
// before we add it to the page.
|
||||
newTidyText = tidyText;
|
||||
count = 0;
|
||||
do {
|
||||
if (index !== undefined) {
|
||||
newTidyText = tidyText + '-' + count;
|
||||
}
|
||||
|
||||
index = idList.indexOf(newTidyText);
|
||||
count += 1;
|
||||
} while (index !== -1);
|
||||
index = undefined;
|
||||
idList.push(newTidyText);
|
||||
|
||||
elements[i].setAttribute('id', newTidyText);
|
||||
elementID = newTidyText;
|
||||
}
|
||||
|
||||
readableID = elementID.replace(/-/g, ' ');
|
||||
|
||||
// The following code builds the following DOM structure in a more effiecient (albeit opaque) way.
|
||||
// '<a class="anchorjs-link ' + this.options.class + '" href="#' + elementID + '" aria-label="Anchor link for: ' + readableID + '" data-anchorjs-icon="' + this.options.icon + '"></a>';
|
||||
anchor = document.createElement('a');
|
||||
anchor.className = 'anchorjs-link ' + this.options.class;
|
||||
anchor.href = '#' + elementID;
|
||||
anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID);
|
||||
anchor.setAttribute('data-anchorjs-icon', this.options.icon);
|
||||
|
||||
if (visibleOptionToUse === 'always') {
|
||||
anchor.style.opacity = '1';
|
||||
}
|
||||
|
||||
if (this.options.icon === '\ue9cb') {
|
||||
anchor.style.font = '1em/1 anchorjs-icons';
|
||||
|
||||
// We set lineHeight = 1 here because the `anchorjs-icons` font family could otherwise affect the
|
||||
// height of the heading. This isn't the case for icons with `placement: left`, so we restore
|
||||
// line-height: inherit in that case, ensuring they remain positioned correctly. For more info,
|
||||
// see https://github.com/bryanbraun/anchorjs/issues/39.
|
||||
if (this.options.placement === 'left') {
|
||||
anchor.style.lineHeight = 'inherit';
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.placement === 'left') {
|
||||
anchor.style.position = 'absolute';
|
||||
anchor.style.marginLeft = '-1em';
|
||||
anchor.style.paddingRight = '0.5em';
|
||||
elements[i].insertBefore(anchor, elements[i].firstChild);
|
||||
} else {
|
||||
// if the option provided is `right` (or anything else).
|
||||
anchor.style.paddingLeft = '0.375em';
|
||||
elements[i].appendChild(anchor);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < indexesToDrop.length; i++) {
|
||||
elements.splice(indexesToDrop[i] - i, 1);
|
||||
}
|
||||
this.elements = this.elements.concat(elements);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes all anchorjs-links from elements targed by the selector.
|
||||
* @param {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links,
|
||||
* OR a nodeList / array containing the DOM elements.
|
||||
* @returns {this} - The AnchorJS object
|
||||
*/
|
||||
this.remove = function(selector) {
|
||||
var index,
|
||||
domAnchor,
|
||||
elements = _getElements(selector);
|
||||
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
domAnchor = elements[i].querySelector('.anchorjs-link');
|
||||
if (domAnchor) {
|
||||
// Drop the element from our main list, if it's in there.
|
||||
index = this.elements.indexOf(elements[i]);
|
||||
if (index !== -1) {
|
||||
this.elements.splice(index, 1);
|
||||
}
|
||||
// Remove the anchor from the DOM.
|
||||
elements[i].removeChild(domAnchor);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes all anchorjs links. Mostly used for tests.
|
||||
*/
|
||||
this.removeAll = function() {
|
||||
this.remove(this.elements);
|
||||
};
|
||||
|
||||
/**
|
||||
* Urlify - Refine text so it makes a good ID.
|
||||
*
|
||||
* To do this, we remove apostrophes, replace nonsafe characters with hyphens,
|
||||
* remove extra hyphens, truncate, trim hyphens, and make lowercase.
|
||||
*
|
||||
* @param {String} text - Any text. Usually pulled from the webpage element we are linking to.
|
||||
* @returns {String} - hyphen-delimited text for use in IDs and URLs.
|
||||
*/
|
||||
this.urlify = function(text) {
|
||||
// Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\
|
||||
var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g,
|
||||
urlText;
|
||||
|
||||
// The reason we include this _applyRemainingDefaultOptions is so urlify can be called independently,
|
||||
// even after setting options. This can be useful for tests or other applications.
|
||||
if (!this.options.truncate) {
|
||||
_applyRemainingDefaultOptions(this.options);
|
||||
}
|
||||
|
||||
// Note: we trim hyphens after truncating because truncating can cause dangling hyphens.
|
||||
// Example string: // " ⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
|
||||
urlText = text
|
||||
.trim() // "⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
|
||||
.replace(/\'/gi, '') // "⚡⚡ Dont forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
|
||||
.replace(nonsafeChars, '-') // "⚡⚡-Dont-forget--URL-fragments-should-be-i18n-friendly--hyphenated--short--and-clean-"
|
||||
.replace(/-{2,}/g, '-') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-short-and-clean-"
|
||||
.substring(0, this.options.truncate) // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-"
|
||||
.replace(/^-+|-+$/gm, '') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated"
|
||||
.toLowerCase(); // "⚡⚡-dont-forget-url-fragments-should-be-i18n-friendly-hyphenated"
|
||||
|
||||
return urlText;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines if this element already has an AnchorJS link on it.
|
||||
* Uses this technique: http://stackoverflow.com/a/5898748/1154642
|
||||
* @param {HTMLElemnt} el - a DOM node
|
||||
* @returns {Boolean} true/false
|
||||
*/
|
||||
this.hasAnchorJSLink = function(el) {
|
||||
var hasLeftAnchor =
|
||||
el.firstChild &&
|
||||
(' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1,
|
||||
hasRightAnchor =
|
||||
el.lastChild &&
|
||||
(' ' + el.lastChild.className + ' ').indexOf(' anchorjs-link ') > -1;
|
||||
|
||||
return hasLeftAnchor || hasRightAnchor || false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Turns a selector, nodeList, or array of elements into an array of elements (so we can use array methods).
|
||||
* It also throws errors on any other inputs. Used to handle inputs to .add and .remove.
|
||||
* @param {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links,
|
||||
* OR a nodeList / array containing the DOM elements.
|
||||
* @returns {Array} - An array containing the elements we want.
|
||||
*/
|
||||
function _getElements(input) {
|
||||
var elements;
|
||||
if (typeof input === 'string' || input instanceof String) {
|
||||
// See https://davidwalsh.name/nodelist-array for the technique transforming nodeList -> Array.
|
||||
elements = [].slice.call(document.querySelectorAll(input));
|
||||
// I checked the 'input instanceof NodeList' test in IE9 and modern browsers and it worked for me.
|
||||
} else if (Array.isArray(input) || input instanceof NodeList) {
|
||||
elements = [].slice.call(input);
|
||||
} else {
|
||||
throw new Error('The selector provided to AnchorJS was invalid.');
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* _addBaselineStyles
|
||||
* Adds baseline styles to the page, used by all AnchorJS links irregardless of configuration.
|
||||
*/
|
||||
function _addBaselineStyles() {
|
||||
// We don't want to add global baseline styles if they've been added before.
|
||||
if (document.head.querySelector('style.anchorjs') !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var style = document.createElement('style'),
|
||||
linkRule =
|
||||
' .anchorjs-link {' +
|
||||
' opacity: 0;' +
|
||||
' text-decoration: none;' +
|
||||
' -webkit-font-smoothing: antialiased;' +
|
||||
' -moz-osx-font-smoothing: grayscale;' +
|
||||
' }',
|
||||
hoverRule =
|
||||
' *:hover > .anchorjs-link,' +
|
||||
' .anchorjs-link:focus {' +
|
||||
' opacity: 1;' +
|
||||
' }',
|
||||
anchorjsLinkFontFace =
|
||||
' @font-face {' +
|
||||
' font-family: "anchorjs-icons";' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
|
||||
' src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype");' +
|
||||
' }',
|
||||
pseudoElContent =
|
||||
' [data-anchorjs-icon]::after {' +
|
||||
' content: attr(data-anchorjs-icon);' +
|
||||
' }',
|
||||
firstStyleEl;
|
||||
|
||||
style.className = 'anchorjs';
|
||||
style.appendChild(document.createTextNode('')); // Necessary for Webkit.
|
||||
|
||||
// We place it in the head with the other style tags, if possible, so as to
|
||||
// not look out of place. We insert before the others so these styles can be
|
||||
// overridden if necessary.
|
||||
firstStyleEl = document.head.querySelector('[rel="stylesheet"], style');
|
||||
if (firstStyleEl === undefined) {
|
||||
document.head.appendChild(style);
|
||||
} else {
|
||||
document.head.insertBefore(style, firstStyleEl);
|
||||
}
|
||||
|
||||
style.sheet.insertRule(linkRule, style.sheet.cssRules.length);
|
||||
style.sheet.insertRule(hoverRule, style.sheet.cssRules.length);
|
||||
style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length);
|
||||
style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length);
|
||||
}
|
||||
}
|
||||
|
||||
return AnchorJS;
|
||||
});
|
||||
12
utils/rm/node_modules/ip-address/docs/assets/bass-addons.css
generated
vendored
Normal file
12
utils/rm/node_modules/ip-address/docs/assets/bass-addons.css
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
.input {
|
||||
font-family: inherit;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 2rem;
|
||||
padding: .5rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #ccc;
|
||||
font-size: .875rem;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
544
utils/rm/node_modules/ip-address/docs/assets/bass.css
generated
vendored
Normal file
544
utils/rm/node_modules/ip-address/docs/assets/bass.css
generated
vendored
Normal file
@@ -0,0 +1,544 @@
|
||||
/*! Basscss | http://basscss.com | MIT License */
|
||||
|
||||
.h1{ font-size: 2rem }
|
||||
.h2{ font-size: 1.5rem }
|
||||
.h3{ font-size: 1.25rem }
|
||||
.h4{ font-size: 1rem }
|
||||
.h5{ font-size: .875rem }
|
||||
.h6{ font-size: .75rem }
|
||||
|
||||
.font-family-inherit{ font-family:inherit }
|
||||
.font-size-inherit{ font-size:inherit }
|
||||
.text-decoration-none{ text-decoration:none }
|
||||
|
||||
.bold{ font-weight: bold; font-weight: bold }
|
||||
.regular{ font-weight:normal }
|
||||
.italic{ font-style:italic }
|
||||
.caps{ text-transform:uppercase; letter-spacing: .2em; }
|
||||
|
||||
.left-align{ text-align:left }
|
||||
.center{ text-align:center }
|
||||
.right-align{ text-align:right }
|
||||
.justify{ text-align:justify }
|
||||
|
||||
.nowrap{ white-space:nowrap }
|
||||
.break-word{ word-wrap:break-word }
|
||||
|
||||
.line-height-1{ line-height: 1 }
|
||||
.line-height-2{ line-height: 1.125 }
|
||||
.line-height-3{ line-height: 1.25 }
|
||||
.line-height-4{ line-height: 1.5 }
|
||||
|
||||
.list-style-none{ list-style:none }
|
||||
.underline{ text-decoration:underline }
|
||||
|
||||
.truncate{
|
||||
max-width:100%;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.list-reset{
|
||||
list-style:none;
|
||||
padding-left:0;
|
||||
}
|
||||
|
||||
.inline{ display:inline }
|
||||
.block{ display:block }
|
||||
.inline-block{ display:inline-block }
|
||||
.table{ display:table }
|
||||
.table-cell{ display:table-cell }
|
||||
|
||||
.overflow-hidden{ overflow:hidden }
|
||||
.overflow-scroll{ overflow:scroll }
|
||||
.overflow-auto{ overflow:auto }
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after{
|
||||
content:" ";
|
||||
display:table
|
||||
}
|
||||
.clearfix:after{ clear:both }
|
||||
|
||||
.left{ float:left }
|
||||
.right{ float:right }
|
||||
|
||||
.fit{ max-width:100% }
|
||||
|
||||
.max-width-1{ max-width: 24rem }
|
||||
.max-width-2{ max-width: 32rem }
|
||||
.max-width-3{ max-width: 48rem }
|
||||
.max-width-4{ max-width: 64rem }
|
||||
|
||||
.border-box{ box-sizing:border-box }
|
||||
|
||||
.align-baseline{ vertical-align:baseline }
|
||||
.align-top{ vertical-align:top }
|
||||
.align-middle{ vertical-align:middle }
|
||||
.align-bottom{ vertical-align:bottom }
|
||||
|
||||
.m0{ margin:0 }
|
||||
.mt0{ margin-top:0 }
|
||||
.mr0{ margin-right:0 }
|
||||
.mb0{ margin-bottom:0 }
|
||||
.ml0{ margin-left:0 }
|
||||
.mx0{ margin-left:0; margin-right:0 }
|
||||
.my0{ margin-top:0; margin-bottom:0 }
|
||||
|
||||
.m1{ margin: .5rem }
|
||||
.mt1{ margin-top: .5rem }
|
||||
.mr1{ margin-right: .5rem }
|
||||
.mb1{ margin-bottom: .5rem }
|
||||
.ml1{ margin-left: .5rem }
|
||||
.mx1{ margin-left: .5rem; margin-right: .5rem }
|
||||
.my1{ margin-top: .5rem; margin-bottom: .5rem }
|
||||
|
||||
.m2{ margin: 1rem }
|
||||
.mt2{ margin-top: 1rem }
|
||||
.mr2{ margin-right: 1rem }
|
||||
.mb2{ margin-bottom: 1rem }
|
||||
.ml2{ margin-left: 1rem }
|
||||
.mx2{ margin-left: 1rem; margin-right: 1rem }
|
||||
.my2{ margin-top: 1rem; margin-bottom: 1rem }
|
||||
|
||||
.m3{ margin: 2rem }
|
||||
.mt3{ margin-top: 2rem }
|
||||
.mr3{ margin-right: 2rem }
|
||||
.mb3{ margin-bottom: 2rem }
|
||||
.ml3{ margin-left: 2rem }
|
||||
.mx3{ margin-left: 2rem; margin-right: 2rem }
|
||||
.my3{ margin-top: 2rem; margin-bottom: 2rem }
|
||||
|
||||
.m4{ margin: 4rem }
|
||||
.mt4{ margin-top: 4rem }
|
||||
.mr4{ margin-right: 4rem }
|
||||
.mb4{ margin-bottom: 4rem }
|
||||
.ml4{ margin-left: 4rem }
|
||||
.mx4{ margin-left: 4rem; margin-right: 4rem }
|
||||
.my4{ margin-top: 4rem; margin-bottom: 4rem }
|
||||
|
||||
.mxn1{ margin-left: -.5rem; margin-right: -.5rem; }
|
||||
.mxn2{ margin-left: -1rem; margin-right: -1rem; }
|
||||
.mxn3{ margin-left: -2rem; margin-right: -2rem; }
|
||||
.mxn4{ margin-left: -4rem; margin-right: -4rem; }
|
||||
|
||||
.ml-auto{ margin-left:auto }
|
||||
.mr-auto{ margin-right:auto }
|
||||
.mx-auto{ margin-left:auto; margin-right:auto; }
|
||||
|
||||
.p0{ padding:0 }
|
||||
.pt0{ padding-top:0 }
|
||||
.pr0{ padding-right:0 }
|
||||
.pb0{ padding-bottom:0 }
|
||||
.pl0{ padding-left:0 }
|
||||
.px0{ padding-left:0; padding-right:0 }
|
||||
.py0{ padding-top:0; padding-bottom:0 }
|
||||
|
||||
.p1{ padding: .5rem }
|
||||
.pt1{ padding-top: .5rem }
|
||||
.pr1{ padding-right: .5rem }
|
||||
.pb1{ padding-bottom: .5rem }
|
||||
.pl1{ padding-left: .5rem }
|
||||
.py1{ padding-top: .5rem; padding-bottom: .5rem }
|
||||
.px1{ padding-left: .5rem; padding-right: .5rem }
|
||||
|
||||
.p2{ padding: 1rem }
|
||||
.pt2{ padding-top: 1rem }
|
||||
.pr2{ padding-right: 1rem }
|
||||
.pb2{ padding-bottom: 1rem }
|
||||
.pl2{ padding-left: 1rem }
|
||||
.py2{ padding-top: 1rem; padding-bottom: 1rem }
|
||||
.px2{ padding-left: 1rem; padding-right: 1rem }
|
||||
|
||||
.p3{ padding: 2rem }
|
||||
.pt3{ padding-top: 2rem }
|
||||
.pr3{ padding-right: 2rem }
|
||||
.pb3{ padding-bottom: 2rem }
|
||||
.pl3{ padding-left: 2rem }
|
||||
.py3{ padding-top: 2rem; padding-bottom: 2rem }
|
||||
.px3{ padding-left: 2rem; padding-right: 2rem }
|
||||
|
||||
.p4{ padding: 4rem }
|
||||
.pt4{ padding-top: 4rem }
|
||||
.pr4{ padding-right: 4rem }
|
||||
.pb4{ padding-bottom: 4rem }
|
||||
.pl4{ padding-left: 4rem }
|
||||
.py4{ padding-top: 4rem; padding-bottom: 4rem }
|
||||
.px4{ padding-left: 4rem; padding-right: 4rem }
|
||||
|
||||
.col{
|
||||
float:left;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.col-right{
|
||||
float:right;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.col-1{
|
||||
width:8.33333%;
|
||||
}
|
||||
|
||||
.col-2{
|
||||
width:16.66667%;
|
||||
}
|
||||
|
||||
.col-3{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.col-4{
|
||||
width:33.33333%;
|
||||
}
|
||||
|
||||
.col-5{
|
||||
width:41.66667%;
|
||||
}
|
||||
|
||||
.col-6{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.col-7{
|
||||
width:58.33333%;
|
||||
}
|
||||
|
||||
.col-8{
|
||||
width:66.66667%;
|
||||
}
|
||||
|
||||
.col-9{
|
||||
width:75%;
|
||||
}
|
||||
|
||||
.col-10{
|
||||
width:83.33333%;
|
||||
}
|
||||
|
||||
.col-11{
|
||||
width:91.66667%;
|
||||
}
|
||||
|
||||
.col-12{
|
||||
width:100%;
|
||||
}
|
||||
@media (min-width: 40em){
|
||||
|
||||
.sm-col{
|
||||
float:left;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.sm-col-right{
|
||||
float:right;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.sm-col-1{
|
||||
width:8.33333%;
|
||||
}
|
||||
|
||||
.sm-col-2{
|
||||
width:16.66667%;
|
||||
}
|
||||
|
||||
.sm-col-3{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.sm-col-4{
|
||||
width:33.33333%;
|
||||
}
|
||||
|
||||
.sm-col-5{
|
||||
width:41.66667%;
|
||||
}
|
||||
|
||||
.sm-col-6{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.sm-col-7{
|
||||
width:58.33333%;
|
||||
}
|
||||
|
||||
.sm-col-8{
|
||||
width:66.66667%;
|
||||
}
|
||||
|
||||
.sm-col-9{
|
||||
width:75%;
|
||||
}
|
||||
|
||||
.sm-col-10{
|
||||
width:83.33333%;
|
||||
}
|
||||
|
||||
.sm-col-11{
|
||||
width:91.66667%;
|
||||
}
|
||||
|
||||
.sm-col-12{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
}
|
||||
@media (min-width: 52em){
|
||||
|
||||
.md-col{
|
||||
float:left;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.md-col-right{
|
||||
float:right;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.md-col-1{
|
||||
width:8.33333%;
|
||||
}
|
||||
|
||||
.md-col-2{
|
||||
width:16.66667%;
|
||||
}
|
||||
|
||||
.md-col-3{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.md-col-4{
|
||||
width:33.33333%;
|
||||
}
|
||||
|
||||
.md-col-5{
|
||||
width:41.66667%;
|
||||
}
|
||||
|
||||
.md-col-6{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.md-col-7{
|
||||
width:58.33333%;
|
||||
}
|
||||
|
||||
.md-col-8{
|
||||
width:66.66667%;
|
||||
}
|
||||
|
||||
.md-col-9{
|
||||
width:75%;
|
||||
}
|
||||
|
||||
.md-col-10{
|
||||
width:83.33333%;
|
||||
}
|
||||
|
||||
.md-col-11{
|
||||
width:91.66667%;
|
||||
}
|
||||
|
||||
.md-col-12{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
}
|
||||
@media (min-width: 64em){
|
||||
|
||||
.lg-col{
|
||||
float:left;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.lg-col-right{
|
||||
float:right;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.lg-col-1{
|
||||
width:8.33333%;
|
||||
}
|
||||
|
||||
.lg-col-2{
|
||||
width:16.66667%;
|
||||
}
|
||||
|
||||
.lg-col-3{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.lg-col-4{
|
||||
width:33.33333%;
|
||||
}
|
||||
|
||||
.lg-col-5{
|
||||
width:41.66667%;
|
||||
}
|
||||
|
||||
.lg-col-6{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.lg-col-7{
|
||||
width:58.33333%;
|
||||
}
|
||||
|
||||
.lg-col-8{
|
||||
width:66.66667%;
|
||||
}
|
||||
|
||||
.lg-col-9{
|
||||
width:75%;
|
||||
}
|
||||
|
||||
.lg-col-10{
|
||||
width:83.33333%;
|
||||
}
|
||||
|
||||
.lg-col-11{
|
||||
width:91.66667%;
|
||||
}
|
||||
|
||||
.lg-col-12{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
}
|
||||
.flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex }
|
||||
|
||||
@media (min-width: 40em){
|
||||
.sm-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex }
|
||||
}
|
||||
|
||||
@media (min-width: 52em){
|
||||
.md-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex }
|
||||
}
|
||||
|
||||
@media (min-width: 64em){
|
||||
.lg-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex }
|
||||
}
|
||||
|
||||
.flex-column{ -webkit-box-orient:vertical; -webkit-box-direction:normal; -webkit-flex-direction:column; -ms-flex-direction:column; flex-direction:column }
|
||||
.flex-wrap{ -webkit-flex-wrap:wrap; -ms-flex-wrap:wrap; flex-wrap:wrap }
|
||||
|
||||
.items-start{ -webkit-box-align:start; -webkit-align-items:flex-start; -ms-flex-align:start; -ms-grid-row-align:flex-start; align-items:flex-start }
|
||||
.items-end{ -webkit-box-align:end; -webkit-align-items:flex-end; -ms-flex-align:end; -ms-grid-row-align:flex-end; align-items:flex-end }
|
||||
.items-center{ -webkit-box-align:center; -webkit-align-items:center; -ms-flex-align:center; -ms-grid-row-align:center; align-items:center }
|
||||
.items-baseline{ -webkit-box-align:baseline; -webkit-align-items:baseline; -ms-flex-align:baseline; -ms-grid-row-align:baseline; align-items:baseline }
|
||||
.items-stretch{ -webkit-box-align:stretch; -webkit-align-items:stretch; -ms-flex-align:stretch; -ms-grid-row-align:stretch; align-items:stretch }
|
||||
|
||||
.self-start{ -webkit-align-self:flex-start; -ms-flex-item-align:start; align-self:flex-start }
|
||||
.self-end{ -webkit-align-self:flex-end; -ms-flex-item-align:end; align-self:flex-end }
|
||||
.self-center{ -webkit-align-self:center; -ms-flex-item-align:center; align-self:center }
|
||||
.self-baseline{ -webkit-align-self:baseline; -ms-flex-item-align:baseline; align-self:baseline }
|
||||
.self-stretch{ -webkit-align-self:stretch; -ms-flex-item-align:stretch; align-self:stretch }
|
||||
|
||||
.justify-start{ -webkit-box-pack:start; -webkit-justify-content:flex-start; -ms-flex-pack:start; justify-content:flex-start }
|
||||
.justify-end{ -webkit-box-pack:end; -webkit-justify-content:flex-end; -ms-flex-pack:end; justify-content:flex-end }
|
||||
.justify-center{ -webkit-box-pack:center; -webkit-justify-content:center; -ms-flex-pack:center; justify-content:center }
|
||||
.justify-between{ -webkit-box-pack:justify; -webkit-justify-content:space-between; -ms-flex-pack:justify; justify-content:space-between }
|
||||
.justify-around{ -webkit-justify-content:space-around; -ms-flex-pack:distribute; justify-content:space-around }
|
||||
|
||||
.content-start{ -webkit-align-content:flex-start; -ms-flex-line-pack:start; align-content:flex-start }
|
||||
.content-end{ -webkit-align-content:flex-end; -ms-flex-line-pack:end; align-content:flex-end }
|
||||
.content-center{ -webkit-align-content:center; -ms-flex-line-pack:center; align-content:center }
|
||||
.content-between{ -webkit-align-content:space-between; -ms-flex-line-pack:justify; align-content:space-between }
|
||||
.content-around{ -webkit-align-content:space-around; -ms-flex-line-pack:distribute; align-content:space-around }
|
||||
.content-stretch{ -webkit-align-content:stretch; -ms-flex-line-pack:stretch; align-content:stretch }
|
||||
.flex-auto{
|
||||
-webkit-box-flex:1;
|
||||
-webkit-flex:1 1 auto;
|
||||
-ms-flex:1 1 auto;
|
||||
flex:1 1 auto;
|
||||
min-width:0;
|
||||
min-height:0;
|
||||
}
|
||||
.flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none }
|
||||
.fs0{ flex-shrink: 0 }
|
||||
|
||||
.order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 }
|
||||
.order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 }
|
||||
.order-2{ -webkit-box-ordinal-group:3; -webkit-order:2; -ms-flex-order:2; order:2 }
|
||||
.order-3{ -webkit-box-ordinal-group:4; -webkit-order:3; -ms-flex-order:3; order:3 }
|
||||
.order-last{ -webkit-box-ordinal-group:100000; -webkit-order:99999; -ms-flex-order:99999; order:99999 }
|
||||
|
||||
.relative{ position:relative }
|
||||
.absolute{ position:absolute }
|
||||
.fixed{ position:fixed }
|
||||
|
||||
.top-0{ top:0 }
|
||||
.right-0{ right:0 }
|
||||
.bottom-0{ bottom:0 }
|
||||
.left-0{ left:0 }
|
||||
|
||||
.z1{ z-index: 1 }
|
||||
.z2{ z-index: 2 }
|
||||
.z3{ z-index: 3 }
|
||||
.z4{ z-index: 4 }
|
||||
|
||||
.border{
|
||||
border-style:solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.border-top{
|
||||
border-top-style:solid;
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
.border-right{
|
||||
border-right-style:solid;
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.border-bottom{
|
||||
border-bottom-style:solid;
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.border-left{
|
||||
border-left-style:solid;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.border-none{ border:0 }
|
||||
|
||||
.rounded{ border-radius: 3px }
|
||||
.circle{ border-radius:50% }
|
||||
|
||||
.rounded-top{ border-radius: 3px 3px 0 0 }
|
||||
.rounded-right{ border-radius: 0 3px 3px 0 }
|
||||
.rounded-bottom{ border-radius: 0 0 3px 3px }
|
||||
.rounded-left{ border-radius: 3px 0 0 3px }
|
||||
|
||||
.not-rounded{ border-radius:0 }
|
||||
|
||||
.hide{
|
||||
position:absolute !important;
|
||||
height:1px;
|
||||
width:1px;
|
||||
overflow:hidden;
|
||||
clip:rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
|
||||
@media (max-width: 40em){
|
||||
.xs-hide{ display:none !important }
|
||||
}
|
||||
|
||||
@media (min-width: 40em) and (max-width: 52em){
|
||||
.sm-hide{ display:none !important }
|
||||
}
|
||||
|
||||
@media (min-width: 52em) and (max-width: 64em){
|
||||
.md-hide{ display:none !important }
|
||||
}
|
||||
|
||||
@media (min-width: 64em){
|
||||
.lg-hide{ display:none !important }
|
||||
}
|
||||
|
||||
.display-none{ display:none !important }
|
||||
|
||||
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/EOT/SourceCodePro-Bold.eot
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/EOT/SourceCodePro-Bold.eot
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/EOT/SourceCodePro-Regular.eot
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/EOT/SourceCodePro-Regular.eot
generated
vendored
Executable file
Binary file not shown.
93
utils/rm/node_modules/ip-address/docs/assets/fonts/LICENSE.txt
generated
vendored
Executable file
93
utils/rm/node_modules/ip-address/docs/assets/fonts/LICENSE.txt
generated
vendored
Executable file
@@ -0,0 +1,93 @@
|
||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/OTF/SourceCodePro-Bold.otf
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/OTF/SourceCodePro-Bold.otf
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/OTF/SourceCodePro-Regular.otf
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/OTF/SourceCodePro-Regular.otf
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2
generated
vendored
Executable file
Binary file not shown.
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2
generated
vendored
Executable file
BIN
utils/rm/node_modules/ip-address/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2
generated
vendored
Executable file
Binary file not shown.
23
utils/rm/node_modules/ip-address/docs/assets/fonts/source-code-pro.css
generated
vendored
Executable file
23
utils/rm/node_modules/ip-address/docs/assets/fonts/source-code-pro.css
generated
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
@font-face{
|
||||
font-family: 'Source Code Pro';
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-stretch: normal;
|
||||
src: url('EOT/SourceCodePro-Regular.eot') format('embedded-opentype'),
|
||||
url('WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'),
|
||||
url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'),
|
||||
url('OTF/SourceCodePro-Regular.otf') format('opentype'),
|
||||
url('TTF/SourceCodePro-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
@font-face{
|
||||
font-family: 'Source Code Pro';
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-stretch: normal;
|
||||
src: url('EOT/SourceCodePro-Bold.eot') format('embedded-opentype'),
|
||||
url('WOFF2/TTF/SourceCodePro-Bold.ttf.woff2') format('woff2'),
|
||||
url('WOFF/OTF/SourceCodePro-Bold.otf.woff') format('woff'),
|
||||
url('OTF/SourceCodePro-Bold.otf') format('opentype'),
|
||||
url('TTF/SourceCodePro-Bold.ttf') format('truetype');
|
||||
}
|
||||
123
utils/rm/node_modules/ip-address/docs/assets/github.css
generated
vendored
Normal file
123
utils/rm/node_modules/ip-address/docs/assets/github.css
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
-webkit-text-size-adjust: none;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.diff .hljs-header,
|
||||
.hljs-javadoc {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.css .rule .hljs-keyword,
|
||||
.hljs-winutils,
|
||||
.nginx .hljs-title,
|
||||
.hljs-subst,
|
||||
.hljs-request,
|
||||
.hljs-status {
|
||||
color: #1184CE;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-hexcolor,
|
||||
.ruby .hljs-constant {
|
||||
color: #ed225d;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-tag .hljs-value,
|
||||
.hljs-phpdoc,
|
||||
.hljs-dartdoc,
|
||||
.tex .hljs-formula {
|
||||
color: #ed225d;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-id,
|
||||
.scss .hljs-preprocessor {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-list .hljs-keyword,
|
||||
.hljs-subst {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-class .hljs-title,
|
||||
.hljs-type,
|
||||
.vhdl .hljs-literal,
|
||||
.tex .hljs-command {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-tag,
|
||||
.hljs-tag .hljs-title,
|
||||
.hljs-rules .hljs-property,
|
||||
.django .hljs-tag .hljs-keyword {
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-attribute,
|
||||
.hljs-variable,
|
||||
.lisp .hljs-body {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.hljs-regexp {
|
||||
color: #009926;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.ruby .hljs-symbol .hljs-string,
|
||||
.lisp .hljs-keyword,
|
||||
.clojure .hljs-keyword,
|
||||
.scheme .hljs-keyword,
|
||||
.tex .hljs-special,
|
||||
.hljs-prompt {
|
||||
color: #990073;
|
||||
}
|
||||
|
||||
.hljs-built_in {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-preprocessor,
|
||||
.hljs-pragma,
|
||||
.hljs-pi,
|
||||
.hljs-doctype,
|
||||
.hljs-shebang,
|
||||
.hljs-cdata {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: #fdd;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.diff .hljs-change {
|
||||
background: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-chunk {
|
||||
color: #aaa;
|
||||
}
|
||||
168
utils/rm/node_modules/ip-address/docs/assets/site.js
generated
vendored
Normal file
168
utils/rm/node_modules/ip-address/docs/assets/site.js
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
/* global anchors */
|
||||
|
||||
// add anchor links to headers
|
||||
anchors.options.placement = 'left';
|
||||
anchors.add('h3');
|
||||
|
||||
// Filter UI
|
||||
var tocElements = document.getElementById('toc').getElementsByTagName('li');
|
||||
|
||||
document.getElementById('filter-input').addEventListener('keyup', function(e) {
|
||||
var i, element, children;
|
||||
|
||||
// enter key
|
||||
if (e.keyCode === 13) {
|
||||
// go to the first displayed item in the toc
|
||||
for (i = 0; i < tocElements.length; i++) {
|
||||
element = tocElements[i];
|
||||
if (!element.classList.contains('display-none')) {
|
||||
location.replace(element.firstChild.href);
|
||||
return e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var match = function() {
|
||||
return true;
|
||||
};
|
||||
|
||||
var value = this.value.toLowerCase();
|
||||
|
||||
if (!value.match(/^\s*$/)) {
|
||||
match = function(element) {
|
||||
var html = element.firstChild.innerHTML;
|
||||
return html && html.toLowerCase().indexOf(value) !== -1;
|
||||
};
|
||||
}
|
||||
|
||||
for (i = 0; i < tocElements.length; i++) {
|
||||
element = tocElements[i];
|
||||
children = Array.from(element.getElementsByTagName('li'));
|
||||
if (match(element) || children.some(match)) {
|
||||
element.classList.remove('display-none');
|
||||
} else {
|
||||
element.classList.add('display-none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var items = document.getElementsByClassName('toggle-sibling');
|
||||
for (var j = 0; j < items.length; j++) {
|
||||
items[j].addEventListener('click', toggleSibling);
|
||||
}
|
||||
|
||||
function toggleSibling() {
|
||||
var stepSibling = this.parentNode.getElementsByClassName('toggle-target')[0];
|
||||
var icon = this.getElementsByClassName('icon')[0];
|
||||
var klass = 'display-none';
|
||||
if (stepSibling.classList.contains(klass)) {
|
||||
stepSibling.classList.remove(klass);
|
||||
icon.innerHTML = '▾';
|
||||
} else {
|
||||
stepSibling.classList.add(klass);
|
||||
icon.innerHTML = '▸';
|
||||
}
|
||||
}
|
||||
|
||||
function showHashTarget(targetId) {
|
||||
if (targetId) {
|
||||
var hashTarget = document.getElementById(targetId);
|
||||
// new target is hidden
|
||||
if (
|
||||
hashTarget &&
|
||||
hashTarget.offsetHeight === 0 &&
|
||||
hashTarget.parentNode.parentNode.classList.contains('display-none')
|
||||
) {
|
||||
hashTarget.parentNode.parentNode.classList.remove('display-none');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function scrollIntoView(targetId) {
|
||||
// Only scroll to element if we don't have a stored scroll position.
|
||||
if (targetId && !history.state) {
|
||||
var hashTarget = document.getElementById(targetId);
|
||||
if (hashTarget) {
|
||||
hashTarget.scrollIntoView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function gotoCurrentTarget() {
|
||||
showHashTarget(location.hash.substring(1));
|
||||
scrollIntoView(location.hash.substring(1));
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', gotoCurrentTarget);
|
||||
gotoCurrentTarget();
|
||||
|
||||
var toclinks = document.getElementsByClassName('pre-open');
|
||||
for (var k = 0; k < toclinks.length; k++) {
|
||||
toclinks[k].addEventListener('mousedown', preOpen, false);
|
||||
}
|
||||
|
||||
function preOpen() {
|
||||
showHashTarget(this.hash.substring(1));
|
||||
}
|
||||
|
||||
var split_left = document.querySelector('#split-left');
|
||||
var split_right = document.querySelector('#split-right');
|
||||
var split_parent = split_left.parentNode;
|
||||
var cw_with_sb = split_left.clientWidth;
|
||||
split_left.style.overflow = 'hidden';
|
||||
var cw_without_sb = split_left.clientWidth;
|
||||
split_left.style.overflow = '';
|
||||
|
||||
Split(['#split-left', '#split-right'], {
|
||||
elementStyle: function(dimension, size, gutterSize) {
|
||||
return {
|
||||
'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'
|
||||
};
|
||||
},
|
||||
gutterStyle: function(dimension, gutterSize) {
|
||||
return {
|
||||
'flex-basis': gutterSize + 'px'
|
||||
};
|
||||
},
|
||||
gutterSize: 20,
|
||||
sizes: [33, 67]
|
||||
});
|
||||
|
||||
// Chrome doesn't remember scroll position properly so do it ourselves.
|
||||
// Also works on Firefox and Edge.
|
||||
|
||||
function updateState() {
|
||||
history.replaceState(
|
||||
{
|
||||
left_top: split_left.scrollTop,
|
||||
right_top: split_right.scrollTop
|
||||
},
|
||||
document.title
|
||||
);
|
||||
}
|
||||
|
||||
function loadState(ev) {
|
||||
if (ev) {
|
||||
// Edge doesn't replace change history.state on popstate.
|
||||
history.replaceState(ev.state, document.title);
|
||||
}
|
||||
if (history.state) {
|
||||
split_left.scrollTop = history.state.left_top;
|
||||
split_right.scrollTop = history.state.right_top;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
// Restore after Firefox scrolls to hash.
|
||||
setTimeout(function() {
|
||||
loadState();
|
||||
// Update with initial scroll position.
|
||||
updateState();
|
||||
// Update scroll positions only after we've loaded because Firefox
|
||||
// emits an initial scroll event with 0.
|
||||
split_left.addEventListener('scroll', updateState);
|
||||
split_right.addEventListener('scroll', updateState);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
window.addEventListener('popstate', loadState);
|
||||
15
utils/rm/node_modules/ip-address/docs/assets/split.css
generated
vendored
Normal file
15
utils/rm/node_modules/ip-address/docs/assets/split.css
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
.gutter {
|
||||
background-color: #f5f5f5;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
}
|
||||
|
||||
.gutter.gutter-vertical {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.gutter.gutter-horizontal {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
||||
cursor: ew-resize;
|
||||
}
|
||||
586
utils/rm/node_modules/ip-address/docs/assets/split.js
generated
vendored
Normal file
586
utils/rm/node_modules/ip-address/docs/assets/split.js
generated
vendored
Normal file
@@ -0,0 +1,586 @@
|
||||
/*! Split.js - v1.3.5 */
|
||||
// https://github.com/nathancahill/Split.js
|
||||
// Copyright (c) 2017 Nathan Cahill; Licensed MIT
|
||||
|
||||
(function(global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
? (module.exports = factory())
|
||||
: typeof define === 'function' && define.amd
|
||||
? define(factory)
|
||||
: (global.Split = factory());
|
||||
})(this, function() {
|
||||
'use strict';
|
||||
// The programming goals of Split.js are to deliver readable, understandable and
|
||||
// maintainable code, while at the same time manually optimizing for tiny minified file size,
|
||||
// browser compatibility without additional requirements, graceful fallback (IE8 is supported)
|
||||
// and very few assumptions about the user's page layout.
|
||||
var global = window;
|
||||
var document = global.document;
|
||||
|
||||
// Save a couple long function names that are used frequently.
|
||||
// This optimization saves around 400 bytes.
|
||||
var addEventListener = 'addEventListener';
|
||||
var removeEventListener = 'removeEventListener';
|
||||
var getBoundingClientRect = 'getBoundingClientRect';
|
||||
var NOOP = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
// Figure out if we're in IE8 or not. IE8 will still render correctly,
|
||||
// but will be static instead of draggable.
|
||||
var isIE8 = global.attachEvent && !global[addEventListener];
|
||||
|
||||
// This library only needs two helper functions:
|
||||
//
|
||||
// The first determines which prefixes of CSS calc we need.
|
||||
// We only need to do this once on startup, when this anonymous function is called.
|
||||
//
|
||||
// Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
|
||||
// http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
|
||||
var calc =
|
||||
['', '-webkit-', '-moz-', '-o-']
|
||||
.filter(function(prefix) {
|
||||
var el = document.createElement('div');
|
||||
el.style.cssText = 'width:' + prefix + 'calc(9px)';
|
||||
|
||||
return !!el.style.length;
|
||||
})
|
||||
.shift() + 'calc';
|
||||
|
||||
// The second helper function allows elements and string selectors to be used
|
||||
// interchangeably. In either case an element is returned. This allows us to
|
||||
// do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`.
|
||||
var elementOrSelector = function(el) {
|
||||
if (typeof el === 'string' || el instanceof String) {
|
||||
return document.querySelector(el);
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
// The main function to initialize a split. Split.js thinks about each pair
|
||||
// of elements as an independant pair. Dragging the gutter between two elements
|
||||
// only changes the dimensions of elements in that pair. This is key to understanding
|
||||
// how the following functions operate, since each function is bound to a pair.
|
||||
//
|
||||
// A pair object is shaped like this:
|
||||
//
|
||||
// {
|
||||
// a: DOM element,
|
||||
// b: DOM element,
|
||||
// aMin: Number,
|
||||
// bMin: Number,
|
||||
// dragging: Boolean,
|
||||
// parent: DOM element,
|
||||
// isFirst: Boolean,
|
||||
// isLast: Boolean,
|
||||
// direction: 'horizontal' | 'vertical'
|
||||
// }
|
||||
//
|
||||
// The basic sequence:
|
||||
//
|
||||
// 1. Set defaults to something sane. `options` doesn't have to be passed at all.
|
||||
// 2. Initialize a bunch of strings based on the direction we're splitting.
|
||||
// A lot of the behavior in the rest of the library is paramatized down to
|
||||
// rely on CSS strings and classes.
|
||||
// 3. Define the dragging helper functions, and a few helpers to go with them.
|
||||
// 4. Loop through the elements while pairing them off. Every pair gets an
|
||||
// `pair` object, a gutter, and special isFirst/isLast properties.
|
||||
// 5. Actually size the pair elements, insert gutters and attach event listeners.
|
||||
var Split = function(ids, options) {
|
||||
if (options === void 0) options = {};
|
||||
|
||||
var dimension;
|
||||
var clientDimension;
|
||||
var clientAxis;
|
||||
var position;
|
||||
var paddingA;
|
||||
var paddingB;
|
||||
var elements;
|
||||
|
||||
// All DOM elements in the split should have a common parent. We can grab
|
||||
// the first elements parent and hope users read the docs because the
|
||||
// behavior will be whacky otherwise.
|
||||
var parent = elementOrSelector(ids[0]).parentNode;
|
||||
var parentFlexDirection = global.getComputedStyle(parent).flexDirection;
|
||||
|
||||
// Set default options.sizes to equal percentages of the parent element.
|
||||
var sizes =
|
||||
options.sizes ||
|
||||
ids.map(function() {
|
||||
return 100 / ids.length;
|
||||
});
|
||||
|
||||
// Standardize minSize to an array if it isn't already. This allows minSize
|
||||
// to be passed as a number.
|
||||
var minSize = options.minSize !== undefined ? options.minSize : 100;
|
||||
var minSizes = Array.isArray(minSize)
|
||||
? minSize
|
||||
: ids.map(function() {
|
||||
return minSize;
|
||||
});
|
||||
var gutterSize = options.gutterSize !== undefined ? options.gutterSize : 10;
|
||||
var snapOffset = options.snapOffset !== undefined ? options.snapOffset : 30;
|
||||
var direction = options.direction || 'horizontal';
|
||||
var cursor =
|
||||
options.cursor ||
|
||||
(direction === 'horizontal' ? 'ew-resize' : 'ns-resize');
|
||||
var gutter =
|
||||
options.gutter ||
|
||||
function(i, gutterDirection) {
|
||||
var gut = document.createElement('div');
|
||||
gut.className = 'gutter gutter-' + gutterDirection;
|
||||
return gut;
|
||||
};
|
||||
var elementStyle =
|
||||
options.elementStyle ||
|
||||
function(dim, size, gutSize) {
|
||||
var style = {};
|
||||
|
||||
if (typeof size !== 'string' && !(size instanceof String)) {
|
||||
if (!isIE8) {
|
||||
style[dim] = calc + '(' + size + '% - ' + gutSize + 'px)';
|
||||
} else {
|
||||
style[dim] = size + '%';
|
||||
}
|
||||
} else {
|
||||
style[dim] = size;
|
||||
}
|
||||
|
||||
return style;
|
||||
};
|
||||
var gutterStyle =
|
||||
options.gutterStyle ||
|
||||
function(dim, gutSize) {
|
||||
return (obj = {}), (obj[dim] = gutSize + 'px'), obj;
|
||||
var obj;
|
||||
};
|
||||
|
||||
// 2. Initialize a bunch of strings based on the direction we're splitting.
|
||||
// A lot of the behavior in the rest of the library is paramatized down to
|
||||
// rely on CSS strings and classes.
|
||||
if (direction === 'horizontal') {
|
||||
dimension = 'width';
|
||||
clientDimension = 'clientWidth';
|
||||
clientAxis = 'clientX';
|
||||
position = 'left';
|
||||
paddingA = 'paddingLeft';
|
||||
paddingB = 'paddingRight';
|
||||
} else if (direction === 'vertical') {
|
||||
dimension = 'height';
|
||||
clientDimension = 'clientHeight';
|
||||
clientAxis = 'clientY';
|
||||
position = 'top';
|
||||
paddingA = 'paddingTop';
|
||||
paddingB = 'paddingBottom';
|
||||
}
|
||||
|
||||
// 3. Define the dragging helper functions, and a few helpers to go with them.
|
||||
// Each helper is bound to a pair object that contains it's metadata. This
|
||||
// also makes it easy to store references to listeners that that will be
|
||||
// added and removed.
|
||||
//
|
||||
// Even though there are no other functions contained in them, aliasing
|
||||
// this to self saves 50 bytes or so since it's used so frequently.
|
||||
//
|
||||
// The pair object saves metadata like dragging state, position and
|
||||
// event listener references.
|
||||
|
||||
function setElementSize(el, size, gutSize) {
|
||||
// Split.js allows setting sizes via numbers (ideally), or if you must,
|
||||
// by string, like '300px'. This is less than ideal, because it breaks
|
||||
// the fluid layout that `calc(% - px)` provides. You're on your own if you do that,
|
||||
// make sure you calculate the gutter size by hand.
|
||||
var style = elementStyle(dimension, size, gutSize);
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
Object.keys(style).forEach(function(prop) {
|
||||
return (el.style[prop] = style[prop]);
|
||||
});
|
||||
}
|
||||
|
||||
function setGutterSize(gutterElement, gutSize) {
|
||||
var style = gutterStyle(dimension, gutSize);
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
Object.keys(style).forEach(function(prop) {
|
||||
return (gutterElement.style[prop] = style[prop]);
|
||||
});
|
||||
}
|
||||
|
||||
// Actually adjust the size of elements `a` and `b` to `offset` while dragging.
|
||||
// calc is used to allow calc(percentage + gutterpx) on the whole split instance,
|
||||
// which allows the viewport to be resized without additional logic.
|
||||
// Element a's size is the same as offset. b's size is total size - a size.
|
||||
// Both sizes are calculated from the initial parent percentage,
|
||||
// then the gutter size is subtracted.
|
||||
function adjust(offset) {
|
||||
var a = elements[this.a];
|
||||
var b = elements[this.b];
|
||||
var percentage = a.size + b.size;
|
||||
|
||||
a.size = (offset / this.size) * percentage;
|
||||
b.size = percentage - (offset / this.size) * percentage;
|
||||
|
||||
setElementSize(a.element, a.size, this.aGutterSize);
|
||||
setElementSize(b.element, b.size, this.bGutterSize);
|
||||
}
|
||||
|
||||
// drag, where all the magic happens. The logic is really quite simple:
|
||||
//
|
||||
// 1. Ignore if the pair is not dragging.
|
||||
// 2. Get the offset of the event.
|
||||
// 3. Snap offset to min if within snappable range (within min + snapOffset).
|
||||
// 4. Actually adjust each element in the pair to offset.
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
// | | <- a.minSize || b.minSize -> | |
|
||||
// | | | <- this.snapOffset || this.snapOffset -> | | |
|
||||
// | | | || | | |
|
||||
// | | | || | | |
|
||||
// ---------------------------------------------------------------------
|
||||
// | <- this.start this.size -> |
|
||||
function drag(e) {
|
||||
var offset;
|
||||
|
||||
if (!this.dragging) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the offset of the event from the first side of the
|
||||
// pair `this.start`. Supports touch events, but not multitouch, so only the first
|
||||
// finger `touches[0]` is counted.
|
||||
if ('touches' in e) {
|
||||
offset = e.touches[0][clientAxis] - this.start;
|
||||
} else {
|
||||
offset = e[clientAxis] - this.start;
|
||||
}
|
||||
|
||||
// If within snapOffset of min or max, set offset to min or max.
|
||||
// snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
|
||||
// Include the appropriate gutter sizes to prevent overflows.
|
||||
if (offset <= elements[this.a].minSize + snapOffset + this.aGutterSize) {
|
||||
offset = elements[this.a].minSize + this.aGutterSize;
|
||||
} else if (
|
||||
offset >=
|
||||
this.size - (elements[this.b].minSize + snapOffset + this.bGutterSize)
|
||||
) {
|
||||
offset = this.size - (elements[this.b].minSize + this.bGutterSize);
|
||||
}
|
||||
|
||||
// Actually adjust the size.
|
||||
adjust.call(this, offset);
|
||||
|
||||
// Call the drag callback continously. Don't do anything too intensive
|
||||
// in this callback.
|
||||
if (options.onDrag) {
|
||||
options.onDrag();
|
||||
}
|
||||
}
|
||||
|
||||
// Cache some important sizes when drag starts, so we don't have to do that
|
||||
// continously:
|
||||
//
|
||||
// `size`: The total size of the pair. First + second + first gutter + second gutter.
|
||||
// `start`: The leading side of the first element.
|
||||
//
|
||||
// ------------------------------------------------
|
||||
// | aGutterSize -> ||| |
|
||||
// | ||| |
|
||||
// | ||| |
|
||||
// | ||| <- bGutterSize |
|
||||
// ------------------------------------------------
|
||||
// | <- start size -> |
|
||||
function calculateSizes() {
|
||||
// Figure out the parent size minus padding.
|
||||
var a = elements[this.a].element;
|
||||
var b = elements[this.b].element;
|
||||
|
||||
this.size =
|
||||
a[getBoundingClientRect]()[dimension] +
|
||||
b[getBoundingClientRect]()[dimension] +
|
||||
this.aGutterSize +
|
||||
this.bGutterSize;
|
||||
this.start = a[getBoundingClientRect]()[position];
|
||||
}
|
||||
|
||||
// stopDragging is very similar to startDragging in reverse.
|
||||
function stopDragging() {
|
||||
var self = this;
|
||||
var a = elements[self.a].element;
|
||||
var b = elements[self.b].element;
|
||||
|
||||
if (self.dragging && options.onDragEnd) {
|
||||
options.onDragEnd();
|
||||
}
|
||||
|
||||
self.dragging = false;
|
||||
|
||||
// Remove the stored event listeners. This is why we store them.
|
||||
global[removeEventListener]('mouseup', self.stop);
|
||||
global[removeEventListener]('touchend', self.stop);
|
||||
global[removeEventListener]('touchcancel', self.stop);
|
||||
|
||||
self.parent[removeEventListener]('mousemove', self.move);
|
||||
self.parent[removeEventListener]('touchmove', self.move);
|
||||
|
||||
// Delete them once they are removed. I think this makes a difference
|
||||
// in memory usage with a lot of splits on one page. But I don't know for sure.
|
||||
delete self.stop;
|
||||
delete self.move;
|
||||
|
||||
a[removeEventListener]('selectstart', NOOP);
|
||||
a[removeEventListener]('dragstart', NOOP);
|
||||
b[removeEventListener]('selectstart', NOOP);
|
||||
b[removeEventListener]('dragstart', NOOP);
|
||||
|
||||
a.style.userSelect = '';
|
||||
a.style.webkitUserSelect = '';
|
||||
a.style.MozUserSelect = '';
|
||||
a.style.pointerEvents = '';
|
||||
|
||||
b.style.userSelect = '';
|
||||
b.style.webkitUserSelect = '';
|
||||
b.style.MozUserSelect = '';
|
||||
b.style.pointerEvents = '';
|
||||
|
||||
self.gutter.style.cursor = '';
|
||||
self.parent.style.cursor = '';
|
||||
}
|
||||
|
||||
// startDragging calls `calculateSizes` to store the inital size in the pair object.
|
||||
// It also adds event listeners for mouse/touch events,
|
||||
// and prevents selection while dragging so avoid the selecting text.
|
||||
function startDragging(e) {
|
||||
// Alias frequently used variables to save space. 200 bytes.
|
||||
var self = this;
|
||||
var a = elements[self.a].element;
|
||||
var b = elements[self.b].element;
|
||||
|
||||
// Call the onDragStart callback.
|
||||
if (!self.dragging && options.onDragStart) {
|
||||
options.onDragStart();
|
||||
}
|
||||
|
||||
// Don't actually drag the element. We emulate that in the drag function.
|
||||
e.preventDefault();
|
||||
|
||||
// Set the dragging property of the pair object.
|
||||
self.dragging = true;
|
||||
|
||||
// Create two event listeners bound to the same pair object and store
|
||||
// them in the pair object.
|
||||
self.move = drag.bind(self);
|
||||
self.stop = stopDragging.bind(self);
|
||||
|
||||
// All the binding. `window` gets the stop events in case we drag out of the elements.
|
||||
global[addEventListener]('mouseup', self.stop);
|
||||
global[addEventListener]('touchend', self.stop);
|
||||
global[addEventListener]('touchcancel', self.stop);
|
||||
|
||||
self.parent[addEventListener]('mousemove', self.move);
|
||||
self.parent[addEventListener]('touchmove', self.move);
|
||||
|
||||
// Disable selection. Disable!
|
||||
a[addEventListener]('selectstart', NOOP);
|
||||
a[addEventListener]('dragstart', NOOP);
|
||||
b[addEventListener]('selectstart', NOOP);
|
||||
b[addEventListener]('dragstart', NOOP);
|
||||
|
||||
a.style.userSelect = 'none';
|
||||
a.style.webkitUserSelect = 'none';
|
||||
a.style.MozUserSelect = 'none';
|
||||
a.style.pointerEvents = 'none';
|
||||
|
||||
b.style.userSelect = 'none';
|
||||
b.style.webkitUserSelect = 'none';
|
||||
b.style.MozUserSelect = 'none';
|
||||
b.style.pointerEvents = 'none';
|
||||
|
||||
// Set the cursor, both on the gutter and the parent element.
|
||||
// Doing only a, b and gutter causes flickering.
|
||||
self.gutter.style.cursor = cursor;
|
||||
self.parent.style.cursor = cursor;
|
||||
|
||||
// Cache the initial sizes of the pair.
|
||||
calculateSizes.call(self);
|
||||
}
|
||||
|
||||
// 5. Create pair and element objects. Each pair has an index reference to
|
||||
// elements `a` and `b` of the pair (first and second elements).
|
||||
// Loop through the elements while pairing them off. Every pair gets a
|
||||
// `pair` object, a gutter, and isFirst/isLast properties.
|
||||
//
|
||||
// Basic logic:
|
||||
//
|
||||
// - Starting with the second element `i > 0`, create `pair` objects with
|
||||
// `a = i - 1` and `b = i`
|
||||
// - Set gutter sizes based on the _pair_ being first/last. The first and last
|
||||
// pair have gutterSize / 2, since they only have one half gutter, and not two.
|
||||
// - Create gutter elements and add event listeners.
|
||||
// - Set the size of the elements, minus the gutter sizes.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// | i=0 | i=1 | i=2 | i=3 |
|
||||
// | | isFirst | | isLast |
|
||||
// | pair 0 pair 1 pair 2 |
|
||||
// | | | | |
|
||||
// -----------------------------------------------------------------------
|
||||
var pairs = [];
|
||||
elements = ids.map(function(id, i) {
|
||||
// Create the element object.
|
||||
var element = {
|
||||
element: elementOrSelector(id),
|
||||
size: sizes[i],
|
||||
minSize: minSizes[i]
|
||||
};
|
||||
|
||||
var pair;
|
||||
|
||||
if (i > 0) {
|
||||
// Create the pair object with it's metadata.
|
||||
pair = {
|
||||
a: i - 1,
|
||||
b: i,
|
||||
dragging: false,
|
||||
isFirst: i === 1,
|
||||
isLast: i === ids.length - 1,
|
||||
direction: direction,
|
||||
parent: parent
|
||||
};
|
||||
|
||||
// For first and last pairs, first and last gutter width is half.
|
||||
pair.aGutterSize = gutterSize;
|
||||
pair.bGutterSize = gutterSize;
|
||||
|
||||
if (pair.isFirst) {
|
||||
pair.aGutterSize = gutterSize / 2;
|
||||
}
|
||||
|
||||
if (pair.isLast) {
|
||||
pair.bGutterSize = gutterSize / 2;
|
||||
}
|
||||
|
||||
// if the parent has a reverse flex-direction, switch the pair elements.
|
||||
if (
|
||||
parentFlexDirection === 'row-reverse' ||
|
||||
parentFlexDirection === 'column-reverse'
|
||||
) {
|
||||
var temp = pair.a;
|
||||
pair.a = pair.b;
|
||||
pair.b = temp;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine the size of the current element. IE8 is supported by
|
||||
// staticly assigning sizes without draggable gutters. Assigns a string
|
||||
// to `size`.
|
||||
//
|
||||
// IE9 and above
|
||||
if (!isIE8) {
|
||||
// Create gutter elements for each pair.
|
||||
if (i > 0) {
|
||||
var gutterElement = gutter(i, direction);
|
||||
setGutterSize(gutterElement, gutterSize);
|
||||
|
||||
gutterElement[addEventListener](
|
||||
'mousedown',
|
||||
startDragging.bind(pair)
|
||||
);
|
||||
gutterElement[addEventListener](
|
||||
'touchstart',
|
||||
startDragging.bind(pair)
|
||||
);
|
||||
|
||||
parent.insertBefore(gutterElement, element.element);
|
||||
|
||||
pair.gutter = gutterElement;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the element size to our determined size.
|
||||
// Half-size gutters for first and last elements.
|
||||
if (i === 0 || i === ids.length - 1) {
|
||||
setElementSize(element.element, element.size, gutterSize / 2);
|
||||
} else {
|
||||
setElementSize(element.element, element.size, gutterSize);
|
||||
}
|
||||
|
||||
var computedSize = element.element[getBoundingClientRect]()[dimension];
|
||||
|
||||
if (computedSize < element.minSize) {
|
||||
element.minSize = computedSize;
|
||||
}
|
||||
|
||||
// After the first iteration, and we have a pair object, append it to the
|
||||
// list of pairs.
|
||||
if (i > 0) {
|
||||
pairs.push(pair);
|
||||
}
|
||||
|
||||
return element;
|
||||
});
|
||||
|
||||
function setSizes(newSizes) {
|
||||
newSizes.forEach(function(newSize, i) {
|
||||
if (i > 0) {
|
||||
var pair = pairs[i - 1];
|
||||
var a = elements[pair.a];
|
||||
var b = elements[pair.b];
|
||||
|
||||
a.size = newSizes[i - 1];
|
||||
b.size = newSize;
|
||||
|
||||
setElementSize(a.element, a.size, pair.aGutterSize);
|
||||
setElementSize(b.element, b.size, pair.bGutterSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
pairs.forEach(function(pair) {
|
||||
pair.parent.removeChild(pair.gutter);
|
||||
elements[pair.a].element.style[dimension] = '';
|
||||
elements[pair.b].element.style[dimension] = '';
|
||||
});
|
||||
}
|
||||
|
||||
if (isIE8) {
|
||||
return {
|
||||
setSizes: setSizes,
|
||||
destroy: destroy
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
setSizes: setSizes,
|
||||
getSizes: function getSizes() {
|
||||
return elements.map(function(element) {
|
||||
return element.size;
|
||||
});
|
||||
},
|
||||
collapse: function collapse(i) {
|
||||
if (i === pairs.length) {
|
||||
var pair = pairs[i - 1];
|
||||
|
||||
calculateSizes.call(pair);
|
||||
|
||||
if (!isIE8) {
|
||||
adjust.call(pair, pair.size - pair.bGutterSize);
|
||||
}
|
||||
} else {
|
||||
var pair$1 = pairs[i];
|
||||
|
||||
calculateSizes.call(pair$1);
|
||||
|
||||
if (!isIE8) {
|
||||
adjust.call(pair$1, pair$1.aGutterSize);
|
||||
}
|
||||
}
|
||||
},
|
||||
destroy: destroy
|
||||
};
|
||||
};
|
||||
|
||||
return Split;
|
||||
});
|
||||
140
utils/rm/node_modules/ip-address/docs/assets/style.css
generated
vendored
Normal file
140
utils/rm/node_modules/ip-address/docs/assets/style.css
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
.documentation {
|
||||
font-family: Helvetica, sans-serif;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.black {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin: 20px 0 10px 0;
|
||||
}
|
||||
|
||||
.documentation h3 {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.border-bottom {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #1184CE;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.documentation a[href]:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.py1-ul li {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.max-height-100 {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.height-viewport-100 {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
section:target h3 {
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.documentation td,
|
||||
.documentation th {
|
||||
padding: .25rem .25rem;
|
||||
}
|
||||
|
||||
h1:hover .anchorjs-link,
|
||||
h2:hover .anchorjs-link,
|
||||
h3:hover .anchorjs-link,
|
||||
h4:hover .anchorjs-link {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.fix-3 {
|
||||
width: 25%;
|
||||
max-width: 244px;
|
||||
}
|
||||
|
||||
.fix-3 {
|
||||
width: 25%;
|
||||
max-width: 244px;
|
||||
}
|
||||
|
||||
@media (min-width: 52em) {
|
||||
.fix-margin-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
}
|
||||
|
||||
.pre, pre, code, .code {
|
||||
font-family: Source Code Pro,Menlo,Consolas,Liberation Mono,monospace;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.fill-light {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.width2 {
|
||||
width: 1rem;
|
||||
}
|
||||
|
||||
.input {
|
||||
font-family: inherit;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 2rem;
|
||||
padding: .5rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #ccc;
|
||||
font-size: .875rem;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.prose table th,
|
||||
.prose table td {
|
||||
text-align: left;
|
||||
padding:8px;
|
||||
border:1px solid #ddd;
|
||||
}
|
||||
|
||||
.prose table th:nth-child(1) { border-right: none; }
|
||||
.prose table th:nth-child(2) { border-left: none; }
|
||||
|
||||
.prose table {
|
||||
border:1px solid #ddd;
|
||||
}
|
||||
|
||||
.prose-big {
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.quiet {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.minishadow {
|
||||
box-shadow: 2px 2px 10px #f3f3f3;
|
||||
}
|
||||
6234
utils/rm/node_modules/ip-address/docs/index.html
generated
vendored
Normal file
6234
utils/rm/node_modules/ip-address/docs/index.html
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
utils/rm/node_modules/ip-address/ip-address-globals.js
generated
vendored
Normal file
8
utils/rm/node_modules/ip-address/ip-address-globals.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var ip = require('./ip-address.js');
|
||||
|
||||
window.Address4 = ip.Address4;
|
||||
window.Address6 = ip.Address6;
|
||||
|
||||
window.v6 = ip.v6;
|
||||
8
utils/rm/node_modules/ip-address/ip-address.js
generated
vendored
Normal file
8
utils/rm/node_modules/ip-address/ip-address.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
exports.Address4 = require('./lib/ipv4.js');
|
||||
exports.Address6 = require('./lib/ipv6.js');
|
||||
|
||||
exports.v6 = {
|
||||
helpers: require('./lib/v6/helpers.js')
|
||||
};
|
||||
39
utils/rm/node_modules/ip-address/lib/common.js
generated
vendored
Normal file
39
utils/rm/node_modules/ip-address/lib/common.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
// A wrapper function that returns false if the address is not valid; used to
|
||||
// avoid boilerplate checks for `if (!this.valid) { return false; }`
|
||||
var falseIfInvalid = exports.falseIfInvalid = function (fn) {
|
||||
return function () {
|
||||
if (!this.valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
exports.isInSubnet = falseIfInvalid(function (address) {
|
||||
if (this.subnetMask < address.subnetMask) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mask(address.subnetMask) === address.mask()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
exports.isCorrect = function (defaultBits) {
|
||||
return falseIfInvalid(function () {
|
||||
if (this.addressMinusSuffix !== this.correctForm()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.subnetMask === defaultBits && !this.parsedSubnet) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.parsedSubnet === String(this.subnetMask);
|
||||
});
|
||||
};
|
||||
309
utils/rm/node_modules/ip-address/lib/ipv4.js
generated
vendored
Normal file
309
utils/rm/node_modules/ip-address/lib/ipv4.js
generated
vendored
Normal file
@@ -0,0 +1,309 @@
|
||||
'use strict';
|
||||
|
||||
var BigInteger = require('jsbn').BigInteger;
|
||||
var common = require('./common.js');
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
var _ = require('lodash');
|
||||
|
||||
var constants = require('./v4/constants.js');
|
||||
|
||||
/**
|
||||
* Represents an IPv4 address
|
||||
* @class Address4
|
||||
* @param {string} address - An IPv4 address string
|
||||
*/
|
||||
function Address4(address) {
|
||||
this.valid = false;
|
||||
this.address = address;
|
||||
this.groups = constants.GROUPS;
|
||||
|
||||
this.v4 = true;
|
||||
|
||||
this.subnet = '/32';
|
||||
this.subnetMask = 32;
|
||||
|
||||
var subnet = constants.RE_SUBNET_STRING.exec(address);
|
||||
|
||||
if (subnet) {
|
||||
this.parsedSubnet = subnet[0].replace('/', '');
|
||||
this.subnetMask = parseInt(this.parsedSubnet, 10);
|
||||
this.subnet = '/' + this.subnetMask;
|
||||
|
||||
if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {
|
||||
this.valid = false;
|
||||
this.error = 'Invalid subnet mask.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
address = address.replace(constants.RE_SUBNET_STRING, '');
|
||||
}
|
||||
|
||||
this.addressMinusSuffix = address;
|
||||
|
||||
this.parsedAddress = this.parse(address);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses a v4 address
|
||||
*/
|
||||
Address4.prototype.parse = function (address) {
|
||||
var groups = address.split('.');
|
||||
|
||||
if (address.match(constants.RE_ADDRESS)) {
|
||||
this.valid = true;
|
||||
} else {
|
||||
this.error = 'Invalid IPv4 address.';
|
||||
}
|
||||
|
||||
return groups;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return true if the address is valid
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
Address4.prototype.isValid = function () {
|
||||
return this.valid;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the correct form of an address
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address4.prototype.correctForm = function () {
|
||||
return this.parsedAddress.map(function (part) {
|
||||
return parseInt(part, 10);
|
||||
}).join('.');
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the address is correct, false otherwise
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
Address4.prototype.isCorrect = common.isCorrect(constants.BITS);
|
||||
|
||||
/**
|
||||
* Converts a hex string to an IPv4 address object
|
||||
* @memberof Address4
|
||||
* @static
|
||||
* @param {string} hex - a hex string to convert
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.fromHex = function (hex) {
|
||||
var padded = _.padStart(hex.replace(/:/g, ''), 8, '0');
|
||||
var groups = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < 8; i += 2) {
|
||||
var h = padded.slice(i, i + 2);
|
||||
|
||||
groups.push(parseInt(h, 16));
|
||||
}
|
||||
|
||||
return new Address4(groups.join('.'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an integer into a IPv4 address object
|
||||
* @memberof Address4
|
||||
* @static
|
||||
* @param {integer} integer - a number to convert
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.fromInteger = function (integer) {
|
||||
return Address4.fromHex(integer.toString(16));
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an IPv4 address object to a hex string
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address4.prototype.toHex = function () {
|
||||
return this.parsedAddress.map(function (part) {
|
||||
return sprintf('%02x', parseInt(part, 10));
|
||||
}).join(':');
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an IPv4 address object to an array of bytes
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Array}
|
||||
*/
|
||||
Address4.prototype.toArray = function () {
|
||||
return this.parsedAddress.map(function (part) {
|
||||
return parseInt(part, 10);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an IPv4 address object to an IPv6 address group
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address4.prototype.toGroup6 = function () {
|
||||
var output = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < constants.GROUPS; i += 2) {
|
||||
var hex = sprintf('%02x%02x',
|
||||
parseInt(this.parsedAddress[i], 10),
|
||||
parseInt(this.parsedAddress[i + 1], 10));
|
||||
|
||||
output.push(sprintf('%x', parseInt(hex, 16)));
|
||||
}
|
||||
|
||||
return output.join(':');
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the address as a BigInteger
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address4.prototype.bigInteger = function () {
|
||||
if (!this.valid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new BigInteger(this.parsedAddress.map(function (n) {
|
||||
return sprintf('%02x', parseInt(n, 10));
|
||||
}).join(''), 16);
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function getting start address.
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address4.prototype._startAddress = function () {
|
||||
return new BigInteger(
|
||||
this.mask() + _.repeat('0', constants.BITS - this.subnetMask), 2
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* The first address in the range given by this address' subnet.
|
||||
* Often referred to as the Network Address.
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.prototype.startAddress = function () {
|
||||
return Address4.fromBigInteger(this._startAddress());
|
||||
};
|
||||
|
||||
/**
|
||||
* The first host address in the range given by this address's subnet ie
|
||||
* the first address after the Network Address
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.prototype.startAddressExclusive = function () {
|
||||
var adjust = new BigInteger('1');
|
||||
return Address4.fromBigInteger(this._startAddress().add(adjust));
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function getting end address.
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address4.prototype._endAddress = function () {
|
||||
return new BigInteger(
|
||||
this.mask() + _.repeat('1', constants.BITS - this.subnetMask), 2
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* The last address in the range given by this address' subnet
|
||||
* Often referred to as the Broadcast
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.prototype.endAddress = function () {
|
||||
return Address4.fromBigInteger(this._endAddress());
|
||||
};
|
||||
|
||||
/**
|
||||
* The last host address in the range given by this address's subnet ie
|
||||
* the last address prior to the Broadcast Address
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.prototype.endAddressExclusive = function () {
|
||||
var adjust = new BigInteger('1');
|
||||
return Address4.fromBigInteger(this._endAddress().subtract(adjust));
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts a BigInteger to a v4 address object
|
||||
* @memberof Address4
|
||||
* @static
|
||||
* @param {BigInteger} bigInteger - a BigInteger to convert
|
||||
* @returns {Address4}
|
||||
*/
|
||||
Address4.fromBigInteger = function (bigInteger) {
|
||||
return Address4.fromInteger(parseInt(bigInteger.toString(), 10));
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the first n bits of the address, defaulting to the
|
||||
* subnet mask
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address4.prototype.mask = function (optionalMask) {
|
||||
if (optionalMask === undefined) {
|
||||
optionalMask = this.subnetMask;
|
||||
}
|
||||
|
||||
return this.getBitsBase2(0, optionalMask);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the bits in the given range as a base-2 string
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {string}
|
||||
*/
|
||||
Address4.prototype.getBitsBase2 = function (start, end) {
|
||||
return this.binaryZeroPad().slice(start, end);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given address is in the subnet of the current address
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Address4.prototype.isInSubnet = common.isInSubnet;
|
||||
|
||||
/**
|
||||
* Returns a zero-padded base-2 string representation of the address
|
||||
* @memberof Address4
|
||||
* @instance
|
||||
* @returns {string}
|
||||
*/
|
||||
Address4.prototype.binaryZeroPad = function () {
|
||||
return _.padStart(this.bigInteger().toString(2), constants.BITS, '0');
|
||||
};
|
||||
|
||||
module.exports = Address4;
|
||||
966
utils/rm/node_modules/ip-address/lib/ipv6.js
generated
vendored
Normal file
966
utils/rm/node_modules/ip-address/lib/ipv6.js
generated
vendored
Normal file
@@ -0,0 +1,966 @@
|
||||
'use strict';
|
||||
|
||||
var BigInteger = require('jsbn').BigInteger;
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
var _ = require('lodash');
|
||||
|
||||
var constants4 = require('./v4/constants.js');
|
||||
var constants6 = require('./v6/constants.js');
|
||||
|
||||
var Address4 = require('./ipv4.js');
|
||||
|
||||
function addCommas(number) {
|
||||
var r = /(\d+)(\d{3})/;
|
||||
|
||||
while (r.test(number)) {
|
||||
number = number.replace(r, '$1,$2');
|
||||
}
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
function spanLeadingZeroes4(n) {
|
||||
n = n.replace(/^(0{1,})([1-9]+)$/, '<span class="parse-error">$1</span>$2');
|
||||
n = n.replace(/^(0{1,})(0)$/, '<span class="parse-error">$1</span>$2');
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an IPv6 address
|
||||
* @class Address6
|
||||
* @param {string} address - An IPv6 address string
|
||||
* @param {number} [groups=8] - How many octets to parse
|
||||
* @example
|
||||
* var address = new Address6('2001::/32');
|
||||
*/
|
||||
function Address6(address, optionalGroups) {
|
||||
if (optionalGroups === undefined) {
|
||||
this.groups = constants6.GROUPS;
|
||||
} else {
|
||||
this.groups = optionalGroups;
|
||||
}
|
||||
|
||||
this.v4 = false;
|
||||
|
||||
this.subnet = '/128';
|
||||
this.subnetMask = 128;
|
||||
|
||||
this.zone = '';
|
||||
|
||||
this.address = address;
|
||||
|
||||
var subnet = constants6.RE_SUBNET_STRING.exec(address);
|
||||
|
||||
if (subnet) {
|
||||
this.parsedSubnet = subnet[0].replace('/', '');
|
||||
this.subnetMask = parseInt(this.parsedSubnet, 10);
|
||||
this.subnet = '/' + this.subnetMask;
|
||||
|
||||
if (isNaN(this.subnetMask) ||
|
||||
this.subnetMask < 0 ||
|
||||
this.subnetMask > constants6.BITS) {
|
||||
this.valid = false;
|
||||
this.error = 'Invalid subnet mask.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
address = address.replace(constants6.RE_SUBNET_STRING, '');
|
||||
} else if (/\//.test(address)) {
|
||||
this.valid = false;
|
||||
this.error = 'Invalid subnet mask.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var zone = constants6.RE_ZONE_STRING.exec(address);
|
||||
|
||||
if (zone) {
|
||||
this.zone = zone[0];
|
||||
|
||||
address = address.replace(constants6.RE_ZONE_STRING, '');
|
||||
}
|
||||
|
||||
this.addressMinusSuffix = address;
|
||||
|
||||
this.parsedAddress = this.parse(this.addressMinusSuffix);
|
||||
}
|
||||
|
||||
_.merge(Address6.prototype, require('./v6/attributes.js'));
|
||||
_.merge(Address6.prototype, require('./v6/html.js'));
|
||||
_.merge(Address6.prototype, require('./v6/regular-expressions.js'));
|
||||
|
||||
/**
|
||||
* Convert a BigInteger to a v6 address object
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @param {BigInteger} bigInteger - a BigInteger to convert
|
||||
* @returns {Address6}
|
||||
* @example
|
||||
* var bigInteger = new BigInteger('1000000000000');
|
||||
* var address = Address6.fromBigInteger(bigInteger);
|
||||
* address.correctForm(); // '::e8:d4a5:1000'
|
||||
*/
|
||||
Address6.fromBigInteger = function (bigInteger) {
|
||||
var hex = _.padStart(bigInteger.toString(16), 32, '0');
|
||||
var groups = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < constants6.GROUPS; i++) {
|
||||
groups.push(hex.slice(i * 4, (i + 1) * 4));
|
||||
}
|
||||
|
||||
return new Address6(groups.join(':'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert a URL (with optional port number) to an address object
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @param {string} url - a URL with optional port number
|
||||
* @returns {Address6}
|
||||
* @example
|
||||
* var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/');
|
||||
* addressAndPort.address.correctForm(); // 'ffff::'
|
||||
* addressAndPort.port; // 8080
|
||||
*/
|
||||
Address6.fromURL = function (url) {
|
||||
var host;
|
||||
var port;
|
||||
var result;
|
||||
|
||||
// If we have brackets parse them and find a port
|
||||
if (url.indexOf('[') !== -1 && url.indexOf(']:') !== -1) {
|
||||
result = constants6.RE_URL_WITH_PORT.exec(url);
|
||||
|
||||
if (result === null) {
|
||||
return {
|
||||
error: 'failed to parse address with port',
|
||||
address: null,
|
||||
port: null
|
||||
};
|
||||
}
|
||||
|
||||
host = result[1];
|
||||
port = result[2];
|
||||
// If there's a URL extract the address
|
||||
} else if (url.indexOf('/') !== -1) {
|
||||
// Remove the protocol prefix
|
||||
url = url.replace(/^[a-z0-9]+:\/\//, '');
|
||||
|
||||
// Parse the address
|
||||
result = constants6.RE_URL.exec(url);
|
||||
|
||||
if (result === null) {
|
||||
return {
|
||||
error: 'failed to parse address from URL',
|
||||
address: null,
|
||||
port: null
|
||||
};
|
||||
}
|
||||
|
||||
host = result[1];
|
||||
// Otherwise just assign the URL to the host and let the library parse it
|
||||
} else {
|
||||
host = url;
|
||||
}
|
||||
|
||||
// If there's a port convert it to an integer
|
||||
if (port) {
|
||||
port = parseInt(port, 10);
|
||||
|
||||
//squelch out of range ports
|
||||
if (port < 0 || port > 65536) {
|
||||
port = null;
|
||||
}
|
||||
} else {
|
||||
// Standardize `undefined` to `null`
|
||||
port = null;
|
||||
}
|
||||
|
||||
return {
|
||||
address: new Address6(host),
|
||||
port: port
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an IPv6-mapped address given an IPv4 address
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @param {string} address - An IPv4 address string
|
||||
* @returns {Address6}
|
||||
* @example
|
||||
* var address = Address6.fromAddress4('192.168.0.1');
|
||||
* address.correctForm(); // '::ffff:c0a8:1'
|
||||
* address.to4in6(); // '::ffff:192.168.0.1'
|
||||
*/
|
||||
Address6.fromAddress4 = function (address4) {
|
||||
var address4 = new Address4(address4);
|
||||
|
||||
var mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask);
|
||||
|
||||
return new Address6('::ffff:' + address4.correctForm() + '/' + mask6);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return an address from ip6.arpa form
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @param {string} arpaFormAddress - an 'ip6.arpa' form address
|
||||
* @returns {Adress6}
|
||||
* @example
|
||||
* var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.)
|
||||
* address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe'
|
||||
*/
|
||||
Address6.fromArpa = function (arpaFormAddress) {
|
||||
//remove ending ".ip6.arpa." or just "."
|
||||
var address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, '');
|
||||
var semicolonAmount = 7;
|
||||
|
||||
//correct ip6.arpa form with ending removed will be 63 characters
|
||||
if (address.length !== 63) {
|
||||
address = {
|
||||
error: "Not Valid 'ip6.arpa' form",
|
||||
address: null
|
||||
};
|
||||
return address;
|
||||
}
|
||||
|
||||
address = address.split('.').reverse();
|
||||
|
||||
for (var i = semicolonAmount; i > 0; i--) {
|
||||
var insertIndex = i * 4;
|
||||
address.splice(insertIndex, 0, ':');
|
||||
}
|
||||
|
||||
address = address.join('');
|
||||
return new Address6(address);
|
||||
};
|
||||
|
||||
/*
|
||||
* A helper function to compact an array
|
||||
*/
|
||||
function compact (address, slice) {
|
||||
var s1 = [];
|
||||
var s2 = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < address.length; i++) {
|
||||
if (i < slice[0]) {
|
||||
s1.push(address[i]);
|
||||
} else if (i > slice[1]) {
|
||||
s2.push(address[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return s1.concat(['compact']).concat(s2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Microsoft UNC transcription of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String} the Microsoft UNC transcription of the address
|
||||
*/
|
||||
Address6.prototype.microsoftTranscription = function () {
|
||||
return sprintf('%s.ipv6-literal.net',
|
||||
this.correctForm().replace(/:/g, '-'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the first n bits of the address, defaulting to the subnet mask
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @param {number} [mask=subnet] - the number of bits to mask
|
||||
* @returns {String} the first n bits of the address as a string
|
||||
*/
|
||||
Address6.prototype.mask = function (optionalMask) {
|
||||
if (optionalMask === undefined) {
|
||||
optionalMask = this.subnetMask;
|
||||
}
|
||||
|
||||
return this.getBitsBase2(0, optionalMask);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the number of possible subnets of a given size in the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @param {number} [size=128] - the subnet size
|
||||
* @returns {String}
|
||||
*/
|
||||
// TODO: probably useful to have a numeric version of this too
|
||||
Address6.prototype.possibleSubnets = function (optionalSubnetSize) {
|
||||
if (optionalSubnetSize === undefined) {
|
||||
optionalSubnetSize = 128;
|
||||
}
|
||||
|
||||
var availableBits = constants6.BITS - this.subnetMask;
|
||||
var subnetBits = Math.abs(optionalSubnetSize - constants6.BITS);
|
||||
var subnetPowers = availableBits - subnetBits;
|
||||
|
||||
if (subnetPowers < 0) {
|
||||
return '0';
|
||||
}
|
||||
|
||||
return addCommas(new BigInteger('2', 10).pow(subnetPowers).toString(10));
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function getting start address.
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address6.prototype._startAddress = function () {
|
||||
return new BigInteger(
|
||||
this.mask() + _.repeat('0', constants6.BITS - this.subnetMask), 2
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* The first address in the range given by this address' subnet
|
||||
* Often referred to as the Network Address.
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.prototype.startAddress = function () {
|
||||
return Address6.fromBigInteger(this._startAddress());
|
||||
};
|
||||
|
||||
/**
|
||||
* The first host address in the range given by this address's subnet ie
|
||||
* the first address after the Network Address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.prototype.startAddressExclusive = function () {
|
||||
var adjust = new BigInteger('1');
|
||||
return Address6.fromBigInteger(this._startAddress().add(adjust));
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function getting end address.
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address6.prototype._endAddress = function () {
|
||||
return new BigInteger(
|
||||
this.mask() + _.repeat('1', constants6.BITS - this.subnetMask), 2
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* The last address in the range given by this address' subnet
|
||||
* Often referred to as the Broadcast
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.prototype.endAddress = function () {
|
||||
return Address6.fromBigInteger(this._endAddress());
|
||||
};
|
||||
|
||||
/**
|
||||
* The last host address in the range given by this address's subnet ie
|
||||
* the last address prior to the Broadcast Address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.prototype.endAddressExclusive = function () {
|
||||
var adjust = new BigInteger('1');
|
||||
return Address6.fromBigInteger(this._endAddress().subtract(adjust));
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the scope of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.getScope = function () {
|
||||
var scope = constants6.SCOPES[this.getBits(12, 16)];
|
||||
|
||||
if (this.getType() === 'Global unicast' &&
|
||||
scope !== 'Link local') {
|
||||
scope = 'Global';
|
||||
}
|
||||
|
||||
return scope;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the type of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.getType = function () {
|
||||
var self = this;
|
||||
|
||||
function isType(name, type) {
|
||||
return self.isInSubnet(new Address6(type));
|
||||
}
|
||||
|
||||
return _.find(constants6.TYPES, isType) || 'Global unicast';
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the bits in the given range as a BigInteger
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address6.prototype.getBits = function (start, end) {
|
||||
return new BigInteger(this.getBitsBase2(start, end), 2);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the bits in the given range as a base-2 string
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.getBitsBase2 = function (start, end) {
|
||||
return this.binaryZeroPad().slice(start, end);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the bits in the given range as a base-16 string
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.getBitsBase16 = function (start, end) {
|
||||
var length = end - start;
|
||||
|
||||
if (length % 4 !== 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _.padStart(this.getBits(start, end).toString(16), length / 4, '0');
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the bits that are set past the subnet mask length
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.getBitsPastSubnet = function () {
|
||||
return this.getBitsBase2(this.subnetMask, constants6.BITS);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the reversed ip6.arpa form of the address
|
||||
* @memberof Address6
|
||||
* @param {Object} options
|
||||
* @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.reverseForm = function (options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
var characters = Math.floor(this.subnetMask / 4);
|
||||
|
||||
var reversed = this.canonicalForm()
|
||||
.replace(/:/g, '')
|
||||
.split('')
|
||||
.slice(0, characters)
|
||||
.reverse()
|
||||
.join('.');
|
||||
|
||||
if (characters > 0) {
|
||||
if (options.omitSuffix) {
|
||||
return reversed;
|
||||
}
|
||||
|
||||
return sprintf('%s.ip6.arpa.', reversed);
|
||||
}
|
||||
|
||||
if (options.omitSuffix) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return 'ip6.arpa.';
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the correct form of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.correctForm = function () {
|
||||
if (!this.parsedAddress) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var i;
|
||||
var groups = [];
|
||||
|
||||
var zeroCounter = 0;
|
||||
var zeroes = [];
|
||||
|
||||
for (i = 0; i < this.parsedAddress.length; i++) {
|
||||
var value = parseInt(this.parsedAddress[i], 16);
|
||||
|
||||
if (value === 0) {
|
||||
zeroCounter++;
|
||||
}
|
||||
|
||||
if (value !== 0 && zeroCounter > 0) {
|
||||
if (zeroCounter > 1) {
|
||||
zeroes.push([i - zeroCounter, i - 1]);
|
||||
}
|
||||
|
||||
zeroCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Do we end with a string of zeroes?
|
||||
if (zeroCounter > 1) {
|
||||
zeroes.push([this.parsedAddress.length - zeroCounter,
|
||||
this.parsedAddress.length - 1]);
|
||||
}
|
||||
|
||||
var zeroLengths = zeroes.map(function (n) {
|
||||
return (n[1] - n[0]) + 1;
|
||||
});
|
||||
|
||||
if (zeroes.length > 0) {
|
||||
var index = zeroLengths.indexOf(_.max(zeroLengths));
|
||||
|
||||
groups = compact(this.parsedAddress, zeroes[index]);
|
||||
} else {
|
||||
groups = this.parsedAddress;
|
||||
}
|
||||
|
||||
for (i = 0; i < groups.length; i++) {
|
||||
if (groups[i] !== 'compact') {
|
||||
groups[i] = parseInt(groups[i], 16).toString(16);
|
||||
}
|
||||
}
|
||||
|
||||
var correct = groups.join(':');
|
||||
|
||||
correct = correct.replace(/^compact$/, '::');
|
||||
correct = correct.replace(/^compact|compact$/, ':');
|
||||
correct = correct.replace(/compact/, '');
|
||||
|
||||
return correct;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a zero-padded base-2 string representation of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
* @example
|
||||
* var address = new Address6('2001:4860:4001:803::1011');
|
||||
* address.binaryZeroPad();
|
||||
* // '0010000000000001010010000110000001000000000000010000100000000011
|
||||
* // 0000000000000000000000000000000000000000000000000001000000010001'
|
||||
*/
|
||||
Address6.prototype.binaryZeroPad = function () {
|
||||
return _.padStart(this.bigInteger().toString(2), constants6.BITS, '0');
|
||||
};
|
||||
|
||||
// TODO: Improve the semantics of this helper function
|
||||
Address6.prototype.parse4in6 = function (address) {
|
||||
var groups = address.split(':');
|
||||
var lastGroup = groups.slice(-1)[0];
|
||||
|
||||
var address4 = lastGroup.match(constants4.RE_ADDRESS);
|
||||
|
||||
if (address4) {
|
||||
var temp4 = new Address4(address4[0]);
|
||||
|
||||
for (var i = 0; i < temp4.groups; i++) {
|
||||
if (/^0[0-9]+/.test(temp4.parsedAddress[i])) {
|
||||
this.valid = false;
|
||||
this.error = 'IPv4 addresses can not have leading zeroes.';
|
||||
|
||||
this.parseError = address.replace(constants4.RE_ADDRESS,
|
||||
temp4.parsedAddress.map(spanLeadingZeroes4).join('.'));
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
this.v4 = true;
|
||||
|
||||
groups[groups.length - 1] = temp4.toGroup6();
|
||||
|
||||
address = groups.join(':');
|
||||
}
|
||||
|
||||
return address;
|
||||
};
|
||||
|
||||
// TODO: Make private?
|
||||
Address6.prototype.parse = function (address) {
|
||||
address = this.parse4in6(address);
|
||||
|
||||
if (this.error) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var badCharacters = address.match(constants6.RE_BAD_CHARACTERS);
|
||||
|
||||
if (badCharacters) {
|
||||
this.valid = false;
|
||||
this.error = sprintf('Bad character%s detected in address: %s',
|
||||
badCharacters.length > 1 ? 's' : '', badCharacters.join(''));
|
||||
|
||||
this.parseError = address.replace(constants6.RE_BAD_CHARACTERS,
|
||||
'<span class="parse-error">$1</span>');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var badAddress = address.match(constants6.RE_BAD_ADDRESS);
|
||||
|
||||
if (badAddress) {
|
||||
this.valid = false;
|
||||
this.error = sprintf('Address failed regex: %s', badAddress.join(''));
|
||||
|
||||
this.parseError = address.replace(constants6.RE_BAD_ADDRESS,
|
||||
'<span class="parse-error">$1</span>');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var groups = [];
|
||||
|
||||
var halves = address.split('::');
|
||||
|
||||
if (halves.length === 2) {
|
||||
var first = halves[0].split(':');
|
||||
var last = halves[1].split(':');
|
||||
|
||||
if (first.length === 1 &&
|
||||
first[0] === '') {
|
||||
first = [];
|
||||
}
|
||||
|
||||
if (last.length === 1 &&
|
||||
last[0] === '') {
|
||||
last = [];
|
||||
}
|
||||
|
||||
var remaining = this.groups - (first.length + last.length);
|
||||
|
||||
if (!remaining) {
|
||||
this.valid = false;
|
||||
this.error = 'Error parsing groups';
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
this.elidedGroups = remaining;
|
||||
|
||||
this.elisionBegin = first.length;
|
||||
this.elisionEnd = first.length + this.elidedGroups;
|
||||
|
||||
first.forEach(function (group) {
|
||||
groups.push(group);
|
||||
});
|
||||
|
||||
for (var i = 0; i < remaining; i++) {
|
||||
groups.push(0);
|
||||
}
|
||||
|
||||
last.forEach(function (group) {
|
||||
groups.push(group);
|
||||
});
|
||||
} else if (halves.length === 1) {
|
||||
groups = address.split(':');
|
||||
|
||||
this.elidedGroups = 0;
|
||||
} else {
|
||||
this.valid = false;
|
||||
this.error = 'Too many :: groups found';
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
groups = groups.map(function (g) {
|
||||
return sprintf('%x', parseInt(g, 16));
|
||||
});
|
||||
|
||||
if (groups.length !== this.groups) {
|
||||
this.valid = false;
|
||||
this.error = 'Incorrect number of groups found';
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
this.valid = true;
|
||||
|
||||
return groups;
|
||||
};
|
||||
|
||||
function paddedHex(octet) {
|
||||
return sprintf('%04x', parseInt(octet, 16));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the canonical form of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.canonicalForm = function () {
|
||||
if (!this.valid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.parsedAddress.map(paddedHex).join(':');
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the decimal form of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.decimal = function () {
|
||||
if (!this.valid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.parsedAddress.map(function (n) {
|
||||
return sprintf('%05d', parseInt(n, 16));
|
||||
}).join(':');
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the address as a BigInteger
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {BigInteger}
|
||||
*/
|
||||
Address6.prototype.bigInteger = function () {
|
||||
if (!this.valid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new BigInteger(this.parsedAddress.map(paddedHex).join(''), 16);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the last two groups of this address as an IPv4 address string
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
* @example
|
||||
* var address = new Address6('2001:4860:4001::1825:bf11');
|
||||
* address.to4(); // '24.37.191.17'
|
||||
*/
|
||||
Address6.prototype.to4 = function () {
|
||||
var binary = this.binaryZeroPad().split('');
|
||||
|
||||
return Address4.fromHex(new BigInteger(binary.slice(96, 128)
|
||||
.join(''), 2).toString(16));
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the v4-in-v6 form of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {String}
|
||||
*/
|
||||
Address6.prototype.to4in6 = function () {
|
||||
var address4 = this.to4();
|
||||
var address6 = new Address6(this.parsedAddress.slice(0, 6).join(':'), 6);
|
||||
|
||||
var correct = address6.correctForm();
|
||||
|
||||
var infix = '';
|
||||
|
||||
if (!/:$/.test(correct)) {
|
||||
infix = ':';
|
||||
}
|
||||
|
||||
return address6.correctForm() + infix + address4.address;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return an object containing the Teredo properties of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Object}
|
||||
*/
|
||||
Address6.prototype.inspectTeredo = function () {
|
||||
/*
|
||||
- Bits 0 to 31 are set to the Teredo prefix (normally 2001:0000::/32).
|
||||
- Bits 32 to 63 embed the primary IPv4 address of the Teredo server that
|
||||
is used.
|
||||
- Bits 64 to 79 can be used to define some flags. Currently only the
|
||||
higher order bit is used; it is set to 1 if the Teredo client is
|
||||
located behind a cone NAT, 0 otherwise. For Microsoft's Windows Vista
|
||||
and Windows Server 2008 implementations, more bits are used. In those
|
||||
implementations, the format for these 16 bits is "CRAAAAUG AAAAAAAA",
|
||||
where "C" remains the "Cone" flag. The "R" bit is reserved for future
|
||||
use. The "U" bit is for the Universal/Local flag (set to 0). The "G" bit
|
||||
is Individual/Group flag (set to 0). The A bits are set to a 12-bit
|
||||
randomly generated number chosen by the Teredo client to introduce
|
||||
additional protection for the Teredo node against IPv6-based scanning
|
||||
attacks.
|
||||
- Bits 80 to 95 contains the obfuscated UDP port number. This is the
|
||||
port number that is mapped by the NAT to the Teredo client with all
|
||||
bits inverted.
|
||||
- Bits 96 to 127 contains the obfuscated IPv4 address. This is the
|
||||
public IPv4 address of the NAT with all bits inverted.
|
||||
*/
|
||||
var prefix = this.getBitsBase16(0, 32);
|
||||
|
||||
var udpPort = this.getBits(80, 96).xor(new BigInteger('ffff', 16)).toString();
|
||||
|
||||
var server4 = Address4.fromHex(this.getBitsBase16(32, 64));
|
||||
var client4 = Address4.fromHex(this.getBits(96, 128)
|
||||
.xor(new BigInteger('ffffffff', 16)).toString(16));
|
||||
|
||||
var flags = this.getBits(64, 80);
|
||||
var flagsBase2 = this.getBitsBase2(64, 80);
|
||||
|
||||
var coneNat = flags.testBit(15);
|
||||
var reserved = flags.testBit(14);
|
||||
var groupIndividual = flags.testBit(8);
|
||||
var universalLocal = flags.testBit(9);
|
||||
var nonce = new BigInteger(flagsBase2.slice(2, 6) +
|
||||
flagsBase2.slice(8, 16), 2).toString(10);
|
||||
|
||||
return {
|
||||
prefix: sprintf('%s:%s', prefix.slice(0, 4), prefix.slice(4, 8)),
|
||||
server4: server4.address,
|
||||
client4: client4.address,
|
||||
flags: flagsBase2,
|
||||
coneNat: coneNat,
|
||||
microsoft: {
|
||||
reserved: reserved,
|
||||
universalLocal: universalLocal,
|
||||
groupIndividual: groupIndividual,
|
||||
nonce: nonce
|
||||
},
|
||||
udpPort: udpPort
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Return an object containing the 6to4 properties of the address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Object}
|
||||
*/
|
||||
Address6.prototype.inspect6to4 = function () {
|
||||
/*
|
||||
- Bits 0 to 15 are set to the 6to4 prefix (2002::/16).
|
||||
- Bits 16 to 48 embed the IPv4 address of the 6to4 gateway that is used.
|
||||
*/
|
||||
|
||||
var prefix = this.getBitsBase16(0, 16);
|
||||
|
||||
var gateway = Address4.fromHex(this.getBitsBase16(16, 48));
|
||||
|
||||
return {
|
||||
prefix: sprintf('%s', prefix.slice(0, 4)),
|
||||
gateway: gateway.address
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a v6 6to4 address from a v6 v4inv6 address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.prototype.to6to4 = function () {
|
||||
if (!this.is4()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var addr6to4 = [
|
||||
'2002',
|
||||
this.getBitsBase16(96, 112),
|
||||
this.getBitsBase16(112, 128),
|
||||
'',
|
||||
'/16'
|
||||
].join(':');
|
||||
|
||||
return new Address6(addr6to4);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a byte array
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Array}
|
||||
*/
|
||||
Address6.prototype.toByteArray = function () {
|
||||
var byteArray = this.bigInteger().toByteArray();
|
||||
|
||||
// work around issue where `toByteArray` returns a leading 0 element
|
||||
if (byteArray.length === 17 && byteArray[0] === 0) {
|
||||
return byteArray.slice(1);
|
||||
}
|
||||
|
||||
return byteArray;
|
||||
};
|
||||
|
||||
function unsignByte(b) {
|
||||
return b & 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an unsigned byte array
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {Array}
|
||||
*/
|
||||
Address6.prototype.toUnsignedByteArray = function () {
|
||||
return this.toByteArray().map(unsignByte);
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert a byte array to an Address6 object
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.fromByteArray = function (bytes) {
|
||||
return this.fromUnsignedByteArray(bytes.map(unsignByte));
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert an unsigned byte array to an Address6 object
|
||||
* @memberof Address6
|
||||
* @static
|
||||
* @returns {Address6}
|
||||
*/
|
||||
Address6.fromUnsignedByteArray = function (bytes) {
|
||||
var BYTE_MAX = new BigInteger('256', 10);
|
||||
var result = new BigInteger('0', 10);
|
||||
var multiplier = new BigInteger('1', 10);
|
||||
|
||||
for (var i = bytes.length - 1; i >= 0; i--) {
|
||||
result = result.add(
|
||||
multiplier.multiply(new BigInteger(bytes[i].toString(10), 10)));
|
||||
|
||||
multiplier = multiplier.multiply(BYTE_MAX);
|
||||
}
|
||||
|
||||
return Address6.fromBigInteger(result);
|
||||
};
|
||||
|
||||
module.exports = Address6;
|
||||
6
utils/rm/node_modules/ip-address/lib/v4/constants.js
generated
vendored
Normal file
6
utils/rm/node_modules/ip-address/lib/v4/constants.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
exports.BITS = 32;
|
||||
exports.GROUPS = 4;
|
||||
|
||||
exports.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;
|
||||
|
||||
exports.RE_SUBNET_STRING = /\/\d{1,2}$/;
|
||||
106
utils/rm/node_modules/ip-address/lib/v6/attributes.js
generated
vendored
Normal file
106
utils/rm/node_modules/ip-address/lib/v6/attributes.js
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
'use strict';
|
||||
|
||||
var common = require('../common.js');
|
||||
var v6 = require('./constants.js');
|
||||
|
||||
/**
|
||||
* Returns true if the address is valid, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isValid = function () {
|
||||
return this.valid;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given address is in the subnet of the current address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isInSubnet = common.isInSubnet;
|
||||
|
||||
/**
|
||||
* Returns true if the address is correct, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isCorrect = common.isCorrect(v6.BITS);
|
||||
|
||||
/**
|
||||
* Returns true if the address is in the canonical form, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isCanonical = common.falseIfInvalid(function () {
|
||||
return this.addressMinusSuffix === this.canonicalForm();
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a link local address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isLinkLocal = common.falseIfInvalid(function () {
|
||||
// Zeroes are required, i.e. we can't check isInSubnet with 'fe80::/10'
|
||||
if (this.getBitsBase2(0, 64) ===
|
||||
'1111111010000000000000000000000000000000000000000000000000000000') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a multicast address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isMulticast = common.falseIfInvalid(function () {
|
||||
return this.getType() === 'Multicast';
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a v4-in-v6 address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.is4 = common.falseIfInvalid(function () {
|
||||
return this.v4;
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a Teredo address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isTeredo = common.falseIfInvalid(function () {
|
||||
return this.isInSubnet(new this.constructor('2001::/32'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a 6to4 address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.is6to4 = common.falseIfInvalid(function () {
|
||||
return this.isInSubnet(new this.constructor('2002::/16'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns true if the address is a loopback address, false otherwise
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.isLoopback = common.falseIfInvalid(function () {
|
||||
return this.getType() === 'Loopback';
|
||||
});
|
||||
79
utils/rm/node_modules/ip-address/lib/v6/constants.js
generated
vendored
Normal file
79
utils/rm/node_modules/ip-address/lib/v6/constants.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
exports.BITS = 128;
|
||||
exports.GROUPS = 8;
|
||||
|
||||
/**
|
||||
* Represents IPv6 address scopes
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.SCOPES = {
|
||||
0: 'Reserved',
|
||||
1: 'Interface local',
|
||||
2: 'Link local',
|
||||
4: 'Admin local',
|
||||
5: 'Site local',
|
||||
8: 'Organization local',
|
||||
14: 'Global',
|
||||
15: 'Reserved'
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents IPv6 address types
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.TYPES = {
|
||||
'ff01::1/128': 'Multicast (All nodes on this interface)',
|
||||
'ff01::2/128': 'Multicast (All routers on this interface)',
|
||||
'ff02::1/128': 'Multicast (All nodes on this link)',
|
||||
'ff02::2/128': 'Multicast (All routers on this link)',
|
||||
'ff05::2/128': 'Multicast (All routers in this site)',
|
||||
'ff02::5/128': 'Multicast (OSPFv3 AllSPF routers)',
|
||||
'ff02::6/128': 'Multicast (OSPFv3 AllDR routers)',
|
||||
'ff02::9/128': 'Multicast (RIP routers)',
|
||||
'ff02::a/128': 'Multicast (EIGRP routers)',
|
||||
'ff02::d/128': 'Multicast (PIM routers)',
|
||||
'ff02::16/128': 'Multicast (MLDv2 reports)',
|
||||
'ff01::fb/128': 'Multicast (mDNSv6)',
|
||||
'ff02::fb/128': 'Multicast (mDNSv6)',
|
||||
'ff05::fb/128': 'Multicast (mDNSv6)',
|
||||
'ff02::1:2/128': 'Multicast (All DHCP servers and relay agents on this link)',
|
||||
'ff05::1:2/128': 'Multicast (All DHCP servers and relay agents in this site)',
|
||||
'ff02::1:3/128': 'Multicast (All DHCP servers on this link)',
|
||||
'ff05::1:3/128': 'Multicast (All DHCP servers in this site)',
|
||||
'::/128': 'Unspecified',
|
||||
'::1/128': 'Loopback',
|
||||
'ff00::/8': 'Multicast',
|
||||
'fe80::/10': 'Link-local unicast'
|
||||
};
|
||||
|
||||
/**
|
||||
* A regular expression that matches bad characters in an IPv6 address
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.RE_BAD_CHARACTERS = /([^0-9a-f:\/%])/ig;
|
||||
|
||||
/**
|
||||
* A regular expression that matches an incorrect IPv6 address
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/ig;
|
||||
|
||||
/**
|
||||
* A regular expression that matches an IPv6 subnet
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
|
||||
|
||||
/**
|
||||
* A regular expression that matches an IPv6 zone
|
||||
* @memberof Address6
|
||||
* @static
|
||||
*/
|
||||
exports.RE_ZONE_STRING = /%.*$/;
|
||||
|
||||
exports.RE_URL = new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);
|
||||
exports.RE_URL_WITH_PORT = new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);
|
||||
64
utils/rm/node_modules/ip-address/lib/v6/helpers.js
generated
vendored
Normal file
64
utils/rm/node_modules/ip-address/lib/v6/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
/**
|
||||
* @returns {String} the string with all zeroes contained in a <span>
|
||||
*/
|
||||
var spanAllZeroes = exports.spanAllZeroes = function (s) {
|
||||
return s.replace(/(0+)/g, '<span class="zero">$1</span>');
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {String} the string with each character contained in a <span>
|
||||
*/
|
||||
exports.spanAll = function (s, optionalOffset) {
|
||||
if (optionalOffset === undefined) {
|
||||
optionalOffset = 0;
|
||||
}
|
||||
|
||||
var letters = s.split('');
|
||||
|
||||
return letters.map(function (n, i) {
|
||||
return sprintf('<span class="digit value-%s position-%d">%s</span>', n,
|
||||
i + optionalOffset,
|
||||
spanAllZeroes(n)); // XXX Use #base-2 .value-0 instead?
|
||||
}).join('');
|
||||
};
|
||||
|
||||
function spanLeadingZeroesSimple(group) {
|
||||
return group.replace(/^(0+)/, '<span class="zero">$1</span>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {String} the string with leading zeroes contained in a <span>
|
||||
*/
|
||||
exports.spanLeadingZeroes = function (address) {
|
||||
var groups = address.split(':');
|
||||
|
||||
return groups.map(function (g) {
|
||||
return spanLeadingZeroesSimple(g);
|
||||
}).join(':');
|
||||
};
|
||||
|
||||
/**
|
||||
* Groups an address
|
||||
* @returns {String} a grouped address
|
||||
*/
|
||||
exports.simpleGroup = function (addressString, offset) {
|
||||
var groups = addressString.split(':');
|
||||
|
||||
if (!offset) {
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
return groups.map(function (g, i) {
|
||||
if (/group-v4/.test(g)) {
|
||||
return g;
|
||||
}
|
||||
|
||||
return sprintf('<span class="hover-group group-%d">%s</span>',
|
||||
i + offset,
|
||||
spanLeadingZeroesSimple(g));
|
||||
}).join(':');
|
||||
};
|
||||
107
utils/rm/node_modules/ip-address/lib/v6/html.js
generated
vendored
Normal file
107
utils/rm/node_modules/ip-address/lib/v6/html.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
'use strict';
|
||||
|
||||
var constants4 = require('../v4/constants.js');
|
||||
var helpers = require('./helpers.js');
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
/**
|
||||
* @returns {String} the address in link form with a default port of 80
|
||||
*/
|
||||
exports.href = function (optionalPort) {
|
||||
if (optionalPort === undefined) {
|
||||
optionalPort = '';
|
||||
} else {
|
||||
optionalPort = sprintf(':%s', optionalPort);
|
||||
}
|
||||
|
||||
return sprintf('http://[%s]%s/', this.correctForm(), optionalPort);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {String} a link suitable for conveying the address via a URL hash
|
||||
*/
|
||||
exports.link = function (options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (options.className === undefined) {
|
||||
options.className = '';
|
||||
}
|
||||
|
||||
if (options.prefix === undefined) {
|
||||
options.prefix = '/#address=';
|
||||
}
|
||||
|
||||
if (options.v4 === undefined) {
|
||||
options.v4 = false;
|
||||
}
|
||||
|
||||
var formFunction = this.correctForm;
|
||||
|
||||
if (options.v4) {
|
||||
formFunction = this.to4in6;
|
||||
}
|
||||
|
||||
if (options.className) {
|
||||
return sprintf('<a href="%1$s%2$s" class="%3$s">%2$s</a>',
|
||||
options.prefix, formFunction.call(this), options.className);
|
||||
}
|
||||
|
||||
return sprintf('<a href="%1$s%2$s">%2$s</a>', options.prefix,
|
||||
formFunction.call(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Groups an address
|
||||
* @returns {String}
|
||||
*/
|
||||
exports.group = function () {
|
||||
var address4 = this.address.match(constants4.RE_ADDRESS);
|
||||
var i;
|
||||
|
||||
if (address4) {
|
||||
// The IPv4 case
|
||||
var segments = address4[0].split('.');
|
||||
|
||||
this.address = this.address.replace(constants4.RE_ADDRESS,
|
||||
sprintf('<span class="hover-group group-v4 group-6">%s</span>' +
|
||||
'.' +
|
||||
'<span class="hover-group group-v4 group-7">%s</span>',
|
||||
segments.slice(0, 2).join('.'),
|
||||
segments.slice(2, 4).join('.')));
|
||||
}
|
||||
|
||||
if (this.elidedGroups === 0) {
|
||||
// The simple case
|
||||
return helpers.simpleGroup(this.address);
|
||||
}
|
||||
|
||||
// The elided case
|
||||
var output = [];
|
||||
|
||||
var halves = this.address.split('::');
|
||||
|
||||
if (halves[0].length) {
|
||||
output.push(helpers.simpleGroup(halves[0]));
|
||||
} else {
|
||||
output.push('');
|
||||
}
|
||||
|
||||
var classes = ['hover-group'];
|
||||
|
||||
for (i = this.elisionBegin;
|
||||
i < this.elisionBegin + this.elidedGroups; i++) {
|
||||
classes.push(sprintf('group-%d', i));
|
||||
}
|
||||
|
||||
output.push(sprintf('<span class="%s"></span>', classes.join(' ')));
|
||||
|
||||
if (halves[1].length) {
|
||||
output.push(helpers.simpleGroup(halves[1], this.elisionEnd));
|
||||
} else {
|
||||
output.push('');
|
||||
}
|
||||
|
||||
return output.join(':');
|
||||
};
|
||||
152
utils/rm/node_modules/ip-address/lib/v6/regular-expressions.js
generated
vendored
Normal file
152
utils/rm/node_modules/ip-address/lib/v6/regular-expressions.js
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
'use strict';
|
||||
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
var v6 = require('./constants.js');
|
||||
|
||||
function groupPossibilities(possibilities) {
|
||||
return sprintf('(%s)', possibilities.join('|'));
|
||||
}
|
||||
|
||||
function padGroup(group) {
|
||||
if (group.length < 4) {
|
||||
return sprintf('0{0,%d}%s', 4 - group.length, group);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
function simpleRegularExpression(groups) {
|
||||
var zeroIndexes = [];
|
||||
|
||||
groups.forEach(function (group, i) {
|
||||
var groupInteger = parseInt(group, 16);
|
||||
|
||||
if (groupInteger === 0) {
|
||||
zeroIndexes.push(i);
|
||||
}
|
||||
});
|
||||
|
||||
// You can technically elide a single 0, this creates the regular expressions
|
||||
// to match that eventuality
|
||||
var possibilities = zeroIndexes.map(function (zeroIndex) {
|
||||
return groups.map(function (group, i) {
|
||||
if (i === zeroIndex) {
|
||||
var elision = (i === 0 || i === v6.GROUPS - 1) ? ':' : '';
|
||||
|
||||
return groupPossibilities([padGroup(group), elision]);
|
||||
}
|
||||
|
||||
return padGroup(group);
|
||||
}).join(':');
|
||||
});
|
||||
|
||||
// The simplest case
|
||||
possibilities.push(groups.map(padGroup).join(':'));
|
||||
|
||||
return groupPossibilities(possibilities);
|
||||
}
|
||||
|
||||
function possibleElisions(elidedGroups, moreLeft, moreRight) {
|
||||
var left = moreLeft ? '' : ':';
|
||||
var right = moreRight ? '' : ':';
|
||||
|
||||
var possibilities = [];
|
||||
|
||||
// 1. elision of everything (::)
|
||||
if (!moreLeft && !moreRight) {
|
||||
possibilities.push('::');
|
||||
}
|
||||
|
||||
// 2. complete elision of the middle
|
||||
if (moreLeft && moreRight) {
|
||||
possibilities.push('');
|
||||
}
|
||||
|
||||
if ((moreRight && !moreLeft) || (!moreRight && moreLeft)) {
|
||||
// 3. complete elision of one side
|
||||
possibilities.push(':');
|
||||
}
|
||||
|
||||
// 4. elision from the left side
|
||||
possibilities.push(sprintf('%s(:0{1,4}){1,%d}', left, elidedGroups - 1));
|
||||
|
||||
// 5. elision from the right side
|
||||
possibilities.push(sprintf('(0{1,4}:){1,%d}%s', elidedGroups - 1, right));
|
||||
|
||||
// 6. no elision
|
||||
possibilities.push(sprintf('(0{1,4}:){%d}0{1,4}', elidedGroups - 1));
|
||||
|
||||
// 7. elision (including sloppy elision) from the middle
|
||||
for (var groups = 1; groups < elidedGroups - 1; groups++) {
|
||||
for (var position = 1; position < elidedGroups - groups; position++) {
|
||||
possibilities.push(sprintf('(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}',
|
||||
position,
|
||||
elidedGroups - position - groups - 1));
|
||||
}
|
||||
}
|
||||
|
||||
return groupPossibilities(possibilities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a regular expression string that can be used to find or validate
|
||||
* all variations of this address
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @param {string} optionalSubString
|
||||
* @returns {string}
|
||||
*/
|
||||
exports.regularExpressionString = function (optionalSubString) {
|
||||
if (optionalSubString === undefined) {
|
||||
optionalSubString = false;
|
||||
}
|
||||
|
||||
var output = [];
|
||||
|
||||
// TODO: revisit why this is necessary
|
||||
var address6 = new this.constructor(this.correctForm());
|
||||
|
||||
if (address6.elidedGroups === 0) {
|
||||
// The simple case
|
||||
output.push(simpleRegularExpression(address6.parsedAddress));
|
||||
} else if (address6.elidedGroups === v6.GROUPS) {
|
||||
// A completely elided address
|
||||
output.push(possibleElisions(v6.GROUPS));
|
||||
} else {
|
||||
// A partially elided address
|
||||
var halves = address6.address.split('::');
|
||||
|
||||
if (halves[0].length) {
|
||||
output.push(simpleRegularExpression(halves[0].split(':')));
|
||||
}
|
||||
|
||||
output.push(possibleElisions(address6.elidedGroups,
|
||||
halves[0].length !== 0,
|
||||
halves[1].length !== 0));
|
||||
|
||||
if (halves[1].length) {
|
||||
output.push(simpleRegularExpression(halves[1].split(':')));
|
||||
}
|
||||
|
||||
output = [output.join(':')];
|
||||
}
|
||||
|
||||
if (!optionalSubString) {
|
||||
output = [].concat('(?=^|\\b|[^\\w\\:])(', output, ')(?=[^\\w\\:]|\\b|$)');
|
||||
}
|
||||
|
||||
return output.join('');
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate a regular expression that can be used to find or validate all
|
||||
* variations of this address.
|
||||
* @memberof Address6
|
||||
* @instance
|
||||
* @param {string} optionalSubString
|
||||
* @returns {RegExp}
|
||||
*/
|
||||
exports.regularExpression = function (optionalSubstring) {
|
||||
return new RegExp(this.regularExpressionString(optionalSubstring), 'i');
|
||||
};
|
||||
40
utils/rm/node_modules/ip-address/package.json
generated
vendored
Normal file
40
utils/rm/node_modules/ip-address/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "ip-address",
|
||||
"description": "A library for parsing IPv4 and IPv6 IP addresses in node and the browser.",
|
||||
"keywords": [
|
||||
"ipv6",
|
||||
"ipv4",
|
||||
"browser",
|
||||
"validation"
|
||||
],
|
||||
"version": "5.9.4",
|
||||
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",
|
||||
"license": "MIT",
|
||||
"main": "ip-address.js",
|
||||
"scripts": {
|
||||
"test": "mocha -R spec",
|
||||
"docs": "documentation build --github --output docs --format html ./ip-address.js",
|
||||
"prepublishOnly": "browserify ./ip-address-globals.js > ./dist/ip-address-globals.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/beaugunderson/ip-address.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"jsbn": "1.1.0",
|
||||
"lodash": "^4.17.15",
|
||||
"sprintf-js": "1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.3.0",
|
||||
"chai": "^4.2.0",
|
||||
"codecov.io": "^0.1.6",
|
||||
"documentation": "^12.0.3",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^6.2.0",
|
||||
"mochify": "^6.3.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user