first commit
This commit is contained in:
9
app_vue/node_modules/@sideway/address/LICENSE.md
generated
vendored
Normal file
9
app_vue/node_modules/@sideway/address/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
Copyright (c) 2019-2020, Sideway, Inc. and Project contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
app_vue/node_modules/@sideway/address/README.md
generated
vendored
Normal file
14
app_vue/node_modules/@sideway/address/README.md
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
# @sideway/address
|
||||
|
||||
#### Validate email address and domain.
|
||||
|
||||
**address** is part of the **joi** ecosystem.
|
||||
|
||||
### Visit the [joi.dev](https://joi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://joi.dev/module/address/)
|
||||
- [Versions status](https://joi.dev/resources/status/#address)
|
||||
- [Changelog](https://joi.dev/module/address/changelog/)
|
||||
- [Project policies](https://joi.dev/policies/)
|
120
app_vue/node_modules/@sideway/address/lib/decode.js
generated
vendored
Normal file
120
app_vue/node_modules/@sideway/address/lib/decode.js
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
'use strict';
|
||||
|
||||
// Adapted from:
|
||||
// Copyright (c) 2017-2019 Justin Ridgewell, MIT Licensed, https://github.com/jridgewell/safe-decode-string-component
|
||||
// Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>, MIT Licensed, http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
exports.decode = function (string) {
|
||||
|
||||
let percentPos = string.indexOf('%');
|
||||
if (percentPos === -1) {
|
||||
return string;
|
||||
}
|
||||
|
||||
let decoded = '';
|
||||
let last = 0;
|
||||
let codepoint = 0;
|
||||
let startOfOctets = percentPos;
|
||||
let state = internals.utf8.accept;
|
||||
|
||||
while (percentPos > -1 &&
|
||||
percentPos < string.length) {
|
||||
|
||||
const high = internals.resolveHex(string[percentPos + 1], 4);
|
||||
const low = internals.resolveHex(string[percentPos + 2], 0);
|
||||
const byte = high | low;
|
||||
const type = internals.utf8.data[byte];
|
||||
state = internals.utf8.data[256 + state + type];
|
||||
codepoint = (codepoint << 6) | (byte & internals.utf8.data[364 + type]);
|
||||
|
||||
if (state === internals.utf8.accept) {
|
||||
decoded += string.slice(last, startOfOctets);
|
||||
decoded += codepoint <= 0xFFFF
|
||||
? String.fromCharCode(codepoint)
|
||||
: String.fromCharCode(0xD7C0 + (codepoint >> 10), 0xDC00 + (codepoint & 0x3FF));
|
||||
|
||||
codepoint = 0;
|
||||
last = percentPos + 3;
|
||||
percentPos = string.indexOf('%', last);
|
||||
startOfOctets = percentPos;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === internals.utf8.reject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
percentPos += 3;
|
||||
|
||||
if (percentPos >= string.length ||
|
||||
string[percentPos] !== '%') {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return decoded + string.slice(last);
|
||||
};
|
||||
|
||||
|
||||
internals.resolveHex = function (char, shift) {
|
||||
|
||||
const i = internals.hex[char];
|
||||
return i === undefined ? 255 : i << shift;
|
||||
};
|
||||
|
||||
|
||||
internals.hex = {
|
||||
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4,
|
||||
'5': 5, '6': 6, '7': 7, '8': 8, '9': 9,
|
||||
'a': 10, 'A': 10, 'b': 11, 'B': 11, 'c': 12,
|
||||
'C': 12, 'd': 13, 'D': 13, 'e': 14, 'E': 14,
|
||||
'f': 15, 'F': 15
|
||||
};
|
||||
|
||||
|
||||
internals.utf8 = {
|
||||
accept: 12,
|
||||
reject: 0,
|
||||
data: [
|
||||
|
||||
// Maps bytes to character to a transition
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 7,
|
||||
10, 9, 9, 9, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
|
||||
// Maps a state to a new state when adding a transition
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 24, 36, 48, 60, 72, 84, 96,
|
||||
0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
// Maps the current transition to a mask that needs to apply to the byte
|
||||
|
||||
0x7F, 0x3F, 0x3F, 0x3F, 0x00, 0x1F, 0x0F, 0x0F, 0x0F, 0x07, 0x07, 0x07
|
||||
]
|
||||
};
|
123
app_vue/node_modules/@sideway/address/lib/domain.js
generated
vendored
Normal file
123
app_vue/node_modules/@sideway/address/lib/domain.js
generated
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
'use strict';
|
||||
|
||||
const Url = require('url');
|
||||
|
||||
const Errors = require('./errors');
|
||||
|
||||
|
||||
const internals = {
|
||||
minDomainSegments: 2,
|
||||
nonAsciiRx: /[^\x00-\x7f]/,
|
||||
domainControlRx: /[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/, // Control + space + separators
|
||||
tldSegmentRx: /^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,
|
||||
domainSegmentRx: /^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,
|
||||
URL: Url.URL || URL // $lab:coverage:ignore$
|
||||
};
|
||||
|
||||
|
||||
exports.analyze = function (domain, options = {}) {
|
||||
|
||||
if (!domain) { // Catch null / undefined
|
||||
return Errors.code('DOMAIN_NON_EMPTY_STRING');
|
||||
}
|
||||
|
||||
if (typeof domain !== 'string') {
|
||||
throw new Error('Invalid input: domain must be a string');
|
||||
}
|
||||
|
||||
if (domain.length > 256) {
|
||||
return Errors.code('DOMAIN_TOO_LONG');
|
||||
}
|
||||
|
||||
const ascii = !internals.nonAsciiRx.test(domain);
|
||||
if (!ascii) {
|
||||
if (options.allowUnicode === false) { // Defaults to true
|
||||
return Errors.code('DOMAIN_INVALID_UNICODE_CHARS');
|
||||
}
|
||||
|
||||
domain = domain.normalize('NFC');
|
||||
}
|
||||
|
||||
if (internals.domainControlRx.test(domain)) {
|
||||
return Errors.code('DOMAIN_INVALID_CHARS');
|
||||
}
|
||||
|
||||
domain = internals.punycode(domain);
|
||||
|
||||
// https://tools.ietf.org/html/rfc1035 section 2.3.1
|
||||
|
||||
if (options.allowFullyQualified &&
|
||||
domain[domain.length - 1] === '.') {
|
||||
|
||||
domain = domain.slice(0, -1);
|
||||
}
|
||||
|
||||
const minDomainSegments = options.minDomainSegments || internals.minDomainSegments;
|
||||
|
||||
const segments = domain.split('.');
|
||||
if (segments.length < minDomainSegments) {
|
||||
return Errors.code('DOMAIN_SEGMENTS_COUNT');
|
||||
}
|
||||
|
||||
if (options.maxDomainSegments) {
|
||||
if (segments.length > options.maxDomainSegments) {
|
||||
return Errors.code('DOMAIN_SEGMENTS_COUNT_MAX');
|
||||
}
|
||||
}
|
||||
|
||||
const tlds = options.tlds;
|
||||
if (tlds) {
|
||||
const tld = segments[segments.length - 1].toLowerCase();
|
||||
if (tlds.deny && tlds.deny.has(tld) ||
|
||||
tlds.allow && !tlds.allow.has(tld)) {
|
||||
|
||||
return Errors.code('DOMAIN_FORBIDDEN_TLDS');
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < segments.length; ++i) {
|
||||
const segment = segments[i];
|
||||
|
||||
if (!segment.length) {
|
||||
return Errors.code('DOMAIN_EMPTY_SEGMENT');
|
||||
}
|
||||
|
||||
if (segment.length > 63) {
|
||||
return Errors.code('DOMAIN_LONG_SEGMENT');
|
||||
}
|
||||
|
||||
if (i < segments.length - 1) {
|
||||
if (!internals.domainSegmentRx.test(segment)) {
|
||||
return Errors.code('DOMAIN_INVALID_CHARS');
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!internals.tldSegmentRx.test(segment)) {
|
||||
return Errors.code('DOMAIN_INVALID_TLDS_CHARS');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
exports.isValid = function (domain, options) {
|
||||
|
||||
return !exports.analyze(domain, options);
|
||||
};
|
||||
|
||||
|
||||
internals.punycode = function (domain) {
|
||||
|
||||
if (domain.includes('%')) {
|
||||
domain = domain.replace(/%/g, '%25');
|
||||
}
|
||||
|
||||
try {
|
||||
return new internals.URL(`http://${domain}`).host;
|
||||
}
|
||||
catch (err) {
|
||||
return domain;
|
||||
}
|
||||
};
|
170
app_vue/node_modules/@sideway/address/lib/email.js
generated
vendored
Normal file
170
app_vue/node_modules/@sideway/address/lib/email.js
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
'use strict';
|
||||
|
||||
const Util = require('util');
|
||||
|
||||
const Domain = require('./domain');
|
||||
const Errors = require('./errors');
|
||||
|
||||
|
||||
const internals = {
|
||||
nonAsciiRx: /[^\x00-\x7f]/,
|
||||
encoder: new (Util.TextEncoder || TextEncoder)() // $lab:coverage:ignore$
|
||||
};
|
||||
|
||||
|
||||
exports.analyze = function (email, options) {
|
||||
|
||||
return internals.email(email, options);
|
||||
};
|
||||
|
||||
|
||||
exports.isValid = function (email, options) {
|
||||
|
||||
return !internals.email(email, options);
|
||||
};
|
||||
|
||||
|
||||
internals.email = function (email, options = {}) {
|
||||
|
||||
if (typeof email !== 'string') {
|
||||
throw new Error('Invalid input: email must be a string');
|
||||
}
|
||||
|
||||
if (!email) {
|
||||
return Errors.code('EMPTY_STRING');
|
||||
}
|
||||
|
||||
// Unicode
|
||||
|
||||
const ascii = !internals.nonAsciiRx.test(email);
|
||||
if (!ascii) {
|
||||
if (options.allowUnicode === false) { // Defaults to true
|
||||
return Errors.code('FORBIDDEN_UNICODE');
|
||||
}
|
||||
|
||||
email = email.normalize('NFC');
|
||||
}
|
||||
|
||||
// Basic structure
|
||||
|
||||
const parts = email.split('@');
|
||||
if (parts.length !== 2) {
|
||||
return parts.length > 2 ? Errors.code('MULTIPLE_AT_CHAR') : Errors.code('MISSING_AT_CHAR');
|
||||
}
|
||||
|
||||
const [local, domain] = parts;
|
||||
|
||||
if (!local) {
|
||||
return Errors.code('EMPTY_LOCAL');
|
||||
}
|
||||
|
||||
if (!options.ignoreLength) {
|
||||
if (email.length > 254) { // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3
|
||||
return Errors.code('ADDRESS_TOO_LONG');
|
||||
}
|
||||
|
||||
if (internals.encoder.encode(local).length > 64) { // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.1
|
||||
return Errors.code('LOCAL_TOO_LONG');
|
||||
}
|
||||
}
|
||||
|
||||
// Validate parts
|
||||
|
||||
return internals.local(local, ascii) || Domain.analyze(domain, options);
|
||||
};
|
||||
|
||||
|
||||
internals.local = function (local, ascii) {
|
||||
|
||||
const segments = local.split('.');
|
||||
for (const segment of segments) {
|
||||
if (!segment.length) {
|
||||
return Errors.code('EMPTY_LOCAL_SEGMENT');
|
||||
}
|
||||
|
||||
if (ascii) {
|
||||
if (!internals.atextRx.test(segment)) {
|
||||
return Errors.code('INVALID_LOCAL_CHARS');
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const char of segment) {
|
||||
if (internals.atextRx.test(char)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const binary = internals.binary(char);
|
||||
if (!internals.atomRx.test(binary)) {
|
||||
return Errors.code('INVALID_LOCAL_CHARS');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.binary = function (char) {
|
||||
|
||||
return Array.from(internals.encoder.encode(char)).map((v) => String.fromCharCode(v)).join('');
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
From RFC 5321:
|
||||
|
||||
Mailbox = Local-part "@" ( Domain / address-literal )
|
||||
|
||||
Local-part = Dot-string / Quoted-string
|
||||
Dot-string = Atom *("." Atom)
|
||||
Atom = 1*atext
|
||||
atext = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"
|
||||
|
||||
Domain = sub-domain *("." sub-domain)
|
||||
sub-domain = Let-dig [Ldh-str]
|
||||
Let-dig = ALPHA / DIGIT
|
||||
Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
|
||||
|
||||
ALPHA = %x41-5A / %x61-7A ; a-z, A-Z
|
||||
DIGIT = %x30-39 ; 0-9
|
||||
|
||||
From RFC 6531:
|
||||
|
||||
sub-domain =/ U-label
|
||||
atext =/ UTF8-non-ascii
|
||||
|
||||
UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
|
||||
|
||||
UTF8-2 = %xC2-DF UTF8-tail
|
||||
UTF8-3 = %xE0 %xA0-BF UTF8-tail /
|
||||
%xE1-EC 2( UTF8-tail ) /
|
||||
%xED %x80-9F UTF8-tail /
|
||||
%xEE-EF 2( UTF8-tail )
|
||||
UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) /
|
||||
%xF1-F3 3( UTF8-tail ) /
|
||||
%xF4 %x80-8F 2( UTF8-tail )
|
||||
|
||||
UTF8-tail = %x80-BF
|
||||
|
||||
Note: The following are not supported:
|
||||
|
||||
RFC 5321: address-literal, Quoted-string
|
||||
RFC 5322: obs-*, CFWS
|
||||
*/
|
||||
|
||||
|
||||
internals.atextRx = /^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/; // _ included in \w
|
||||
|
||||
|
||||
internals.atomRx = new RegExp([
|
||||
|
||||
// %xC2-DF UTF8-tail
|
||||
'(?:[\\xc2-\\xdf][\\x80-\\xbf])',
|
||||
|
||||
// %xE0 %xA0-BF UTF8-tail %xE1-EC 2( UTF8-tail ) %xED %x80-9F UTF8-tail %xEE-EF 2( UTF8-tail )
|
||||
'(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})',
|
||||
|
||||
// %xF0 %x90-BF 2( UTF8-tail ) %xF1-F3 3( UTF8-tail ) %xF4 %x80-8F 2( UTF8-tail )
|
||||
'(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})'
|
||||
|
||||
].join('|'));
|
29
app_vue/node_modules/@sideway/address/lib/errors.js
generated
vendored
Normal file
29
app_vue/node_modules/@sideway/address/lib/errors.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
exports.codes = {
|
||||
EMPTY_STRING: 'Address must be a non-empty string',
|
||||
FORBIDDEN_UNICODE: 'Address contains forbidden Unicode characters',
|
||||
MULTIPLE_AT_CHAR: 'Address cannot contain more than one @ character',
|
||||
MISSING_AT_CHAR: 'Address must contain one @ character',
|
||||
EMPTY_LOCAL: 'Address local part cannot be empty',
|
||||
ADDRESS_TOO_LONG: 'Address too long',
|
||||
LOCAL_TOO_LONG: 'Address local part too long',
|
||||
EMPTY_LOCAL_SEGMENT: 'Address local part contains empty dot-separated segment',
|
||||
INVALID_LOCAL_CHARS: 'Address local part contains invalid character',
|
||||
DOMAIN_NON_EMPTY_STRING: 'Domain must be a non-empty string',
|
||||
DOMAIN_TOO_LONG: 'Domain too long',
|
||||
DOMAIN_INVALID_UNICODE_CHARS: 'Domain contains forbidden Unicode characters',
|
||||
DOMAIN_INVALID_CHARS: 'Domain contains invalid character',
|
||||
DOMAIN_INVALID_TLDS_CHARS: 'Domain contains invalid tld character',
|
||||
DOMAIN_SEGMENTS_COUNT: 'Domain lacks the minimum required number of segments',
|
||||
DOMAIN_SEGMENTS_COUNT_MAX: 'Domain contains too many segments',
|
||||
DOMAIN_FORBIDDEN_TLDS: 'Domain uses forbidden TLD',
|
||||
DOMAIN_EMPTY_SEGMENT: 'Domain contains empty dot-separated segment',
|
||||
DOMAIN_LONG_SEGMENT: 'Domain contains dot-separated segment that is too long'
|
||||
};
|
||||
|
||||
|
||||
exports.code = function (code) {
|
||||
|
||||
return { code, error: exports.codes[code] };
|
||||
};
|
255
app_vue/node_modules/@sideway/address/lib/index.d.ts
generated
vendored
Normal file
255
app_vue/node_modules/@sideway/address/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,255 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as Hoek from '@hapi/hoek';
|
||||
|
||||
|
||||
export namespace domain {
|
||||
|
||||
/**
|
||||
* Analyzes a string to verify it is a valid domain name.
|
||||
*
|
||||
* @param domain - the domain name to validate.
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @return - undefined when valid, otherwise an object with single error key with a string message value.
|
||||
*/
|
||||
function analyze(domain: string, options?: Options): Analysis | null;
|
||||
|
||||
/**
|
||||
* Analyzes a string to verify it is a valid domain name.
|
||||
*
|
||||
* @param domain - the domain name to validate.
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @return - true when valid, otherwise false.
|
||||
*/
|
||||
function isValid(domain: string, options?: Options): boolean;
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* Determines whether Unicode characters are allowed.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly allowUnicode?: boolean;
|
||||
|
||||
/**
|
||||
* The minimum number of domain segments (e.g. `x.y.z` has 3 segments) required.
|
||||
*
|
||||
* @default 2
|
||||
*/
|
||||
readonly minDomainSegments?: number;
|
||||
|
||||
/**
|
||||
* Top-level-domain options
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly tlds?: Tlds.Allow | Tlds.Deny | boolean;
|
||||
}
|
||||
|
||||
namespace Tlds {
|
||||
|
||||
interface Allow {
|
||||
|
||||
readonly allow: Set<string> | true;
|
||||
}
|
||||
|
||||
interface Deny {
|
||||
|
||||
readonly deny: Set<string>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export namespace email {
|
||||
|
||||
/**
|
||||
* Analyzes a string to verify it is a valid email address.
|
||||
*
|
||||
* @param email - the email address to validate.
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @return - undefined when valid, otherwise an object with single error key with a string message value.
|
||||
*/
|
||||
function analyze(email: string, options?: Options): Analysis | null;
|
||||
|
||||
/**
|
||||
* Analyzes a string to verify it is a valid email address.
|
||||
*
|
||||
* @param email - the email address to validate.
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @return - true when valid, otherwise false.
|
||||
*/
|
||||
function isValid(email: string, options?: Options): boolean;
|
||||
|
||||
interface Options extends domain.Options {
|
||||
|
||||
/**
|
||||
* Determines whether to ignore the standards maximum email length limit.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly ignoreLength?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export interface Analysis {
|
||||
|
||||
/**
|
||||
* The reason validation failed.
|
||||
*/
|
||||
error: string;
|
||||
|
||||
/**
|
||||
* The error code.
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
|
||||
|
||||
export const errors: Record<string, string>;
|
||||
|
||||
|
||||
export namespace ip {
|
||||
|
||||
/**
|
||||
* Generates a regular expression used to validate IP addresses.
|
||||
*
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @returns an object with the regular expression and meta data.
|
||||
*/
|
||||
function regex(options?: Options): Expression;
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* The required CIDR mode.
|
||||
*
|
||||
* @default 'optional'
|
||||
*/
|
||||
readonly cidr?: Cidr;
|
||||
|
||||
/**
|
||||
* The allowed versions.
|
||||
*
|
||||
* @default ['ipv4', 'ipv6', 'ipvfuture']
|
||||
*/
|
||||
readonly version?: Version | Version[];
|
||||
}
|
||||
|
||||
type Cidr = 'optional' | 'required' | 'forbidden';
|
||||
type Version = 'ipv4' | 'ipv6' | 'ipvfuture';
|
||||
|
||||
interface Expression {
|
||||
|
||||
/**
|
||||
* The CIDR mode.
|
||||
*/
|
||||
cidr: Cidr;
|
||||
|
||||
/**
|
||||
* The raw regular expression string.
|
||||
*/
|
||||
raw: string;
|
||||
|
||||
/**
|
||||
* The regular expression.
|
||||
*/
|
||||
regex: RegExp;
|
||||
|
||||
/**
|
||||
* The array of versions allowed.
|
||||
*/
|
||||
versions: Version[];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export namespace uri {
|
||||
|
||||
/**
|
||||
* Faster version of decodeURIComponent() that does not throw.
|
||||
*
|
||||
* @param string - the URL string to decode.
|
||||
*
|
||||
* @returns the decoded string or null if invalid.
|
||||
*/
|
||||
function decode(string: string): string | null;
|
||||
|
||||
/**
|
||||
* Generates a regular expression used to validate URI addresses.
|
||||
*
|
||||
* @param options - optional settings.
|
||||
*
|
||||
* @returns an object with the regular expression and meta data.
|
||||
*/
|
||||
function regex(options?: Options): Expression;
|
||||
|
||||
type Options = Hoek.ts.XOR<Options.Options, Options.Relative>;
|
||||
|
||||
namespace Options {
|
||||
|
||||
interface Query {
|
||||
|
||||
/**
|
||||
* Allow the use of [] in query parameters.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly allowQuerySquareBrackets?: boolean;
|
||||
}
|
||||
|
||||
interface Relative extends Query {
|
||||
|
||||
/**
|
||||
* Requires the URI to be relative.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly relativeOnly?: boolean;
|
||||
}
|
||||
|
||||
interface Options extends Query {
|
||||
|
||||
/**
|
||||
* Allow relative URIs.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly allowRelative?: boolean;
|
||||
|
||||
/**
|
||||
* Capture domain segment ($1).
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly domain?: boolean;
|
||||
|
||||
/**
|
||||
* The allowed URI schemes.
|
||||
*/
|
||||
readonly scheme?: Scheme | Scheme[];
|
||||
}
|
||||
|
||||
type Scheme = string | RegExp;
|
||||
}
|
||||
|
||||
interface Expression {
|
||||
|
||||
/**
|
||||
* The raw regular expression string.
|
||||
*/
|
||||
raw: string;
|
||||
|
||||
/**
|
||||
* The regular expression.
|
||||
*/
|
||||
regex: RegExp;
|
||||
}
|
||||
}
|
97
app_vue/node_modules/@sideway/address/lib/index.js
generated
vendored
Normal file
97
app_vue/node_modules/@sideway/address/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
'use strict';
|
||||
|
||||
const Decode = require('./decode');
|
||||
const Domain = require('./domain');
|
||||
const Email = require('./email');
|
||||
const Errors = require('./errors');
|
||||
const Ip = require('./ip');
|
||||
const Tlds = require('./tlds');
|
||||
const Uri = require('./uri');
|
||||
|
||||
|
||||
const internals = {
|
||||
defaultTlds: { allow: Tlds, deny: null }
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
errors: Errors.codes,
|
||||
|
||||
domain: {
|
||||
analyze(domain, options) {
|
||||
|
||||
options = internals.options(options);
|
||||
return Domain.analyze(domain, options);
|
||||
},
|
||||
|
||||
isValid(domain, options) {
|
||||
|
||||
options = internals.options(options);
|
||||
return Domain.isValid(domain, options);
|
||||
}
|
||||
},
|
||||
email: {
|
||||
analyze(email, options) {
|
||||
|
||||
options = internals.options(options);
|
||||
return Email.analyze(email, options);
|
||||
},
|
||||
|
||||
isValid(email, options) {
|
||||
|
||||
options = internals.options(options);
|
||||
return Email.isValid(email, options);
|
||||
}
|
||||
},
|
||||
ip: {
|
||||
regex: Ip.regex
|
||||
},
|
||||
uri: {
|
||||
decode: Decode.decode,
|
||||
regex: Uri.regex
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.options = function (options) {
|
||||
|
||||
if (!options) {
|
||||
return { tlds: internals.defaultTlds };
|
||||
}
|
||||
|
||||
if (options.tlds === false) { // Defaults to true
|
||||
return options;
|
||||
}
|
||||
|
||||
if (!options.tlds ||
|
||||
options.tlds === true) {
|
||||
|
||||
return Object.assign({}, options, { tlds: internals.defaultTlds });
|
||||
}
|
||||
|
||||
if (typeof options.tlds !== 'object') {
|
||||
throw new Error('Invalid options: tlds must be a boolean or an object');
|
||||
}
|
||||
|
||||
if (options.tlds.deny) {
|
||||
if (options.tlds.deny instanceof Set === false) {
|
||||
throw new Error('Invalid options: tlds.deny must be a Set object');
|
||||
}
|
||||
|
||||
if (options.tlds.allow) {
|
||||
throw new Error('Invalid options: cannot specify both tlds.allow and tlds.deny lists');
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
if (options.tlds.allow === true) {
|
||||
return Object.assign({}, options, { tlds: internals.defaultTlds });
|
||||
}
|
||||
|
||||
if (options.tlds.allow instanceof Set === false) {
|
||||
throw new Error('Invalid options: tlds.allow must be a Set object or true');
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
63
app_vue/node_modules/@sideway/address/lib/ip.js
generated
vendored
Normal file
63
app_vue/node_modules/@sideway/address/lib/ip.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
'use strict';
|
||||
|
||||
const Assert = require('@hapi/hoek/lib/assert');
|
||||
|
||||
const Uri = require('./uri');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
exports.regex = function (options = {}) {
|
||||
|
||||
// CIDR
|
||||
|
||||
Assert(options.cidr === undefined || typeof options.cidr === 'string', 'options.cidr must be a string');
|
||||
const cidr = options.cidr ? options.cidr.toLowerCase() : 'optional';
|
||||
Assert(['required', 'optional', 'forbidden'].includes(cidr), 'options.cidr must be one of required, optional, forbidden');
|
||||
|
||||
// Versions
|
||||
|
||||
Assert(options.version === undefined || typeof options.version === 'string' || Array.isArray(options.version), 'options.version must be a string or an array of string');
|
||||
let versions = options.version || ['ipv4', 'ipv6', 'ipvfuture'];
|
||||
if (!Array.isArray(versions)) {
|
||||
versions = [versions];
|
||||
}
|
||||
|
||||
Assert(versions.length >= 1, 'options.version must have at least 1 version specified');
|
||||
|
||||
for (let i = 0; i < versions.length; ++i) {
|
||||
Assert(typeof versions[i] === 'string', 'options.version must only contain strings');
|
||||
versions[i] = versions[i].toLowerCase();
|
||||
Assert(['ipv4', 'ipv6', 'ipvfuture'].includes(versions[i]), 'options.version contains unknown version ' + versions[i] + ' - must be one of ipv4, ipv6, ipvfuture');
|
||||
}
|
||||
|
||||
versions = Array.from(new Set(versions));
|
||||
|
||||
// Regex
|
||||
|
||||
const parts = versions.map((version) => {
|
||||
|
||||
// Forbidden
|
||||
|
||||
if (cidr === 'forbidden') {
|
||||
return Uri.ip[version];
|
||||
}
|
||||
|
||||
// Required
|
||||
|
||||
const cidrpart = `\\/${version === 'ipv4' ? Uri.ip.v4Cidr : Uri.ip.v6Cidr}`;
|
||||
|
||||
if (cidr === 'required') {
|
||||
return `${Uri.ip[version]}${cidrpart}`;
|
||||
}
|
||||
|
||||
// Optional
|
||||
|
||||
return `${Uri.ip[version]}(?:${cidrpart})?`;
|
||||
});
|
||||
|
||||
const raw = `(?:${parts.join('|')})`;
|
||||
const regex = new RegExp(`^${raw}$`);
|
||||
return { cidr, versions, regex, raw };
|
||||
};
|
1468
app_vue/node_modules/@sideway/address/lib/tlds.js
generated
vendored
Normal file
1468
app_vue/node_modules/@sideway/address/lib/tlds.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
207
app_vue/node_modules/@sideway/address/lib/uri.js
generated
vendored
Normal file
207
app_vue/node_modules/@sideway/address/lib/uri.js
generated
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
'use strict';
|
||||
|
||||
const Assert = require('@hapi/hoek/lib/assert');
|
||||
const EscapeRegex = require('@hapi/hoek/lib/escapeRegex');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
internals.generate = function () {
|
||||
|
||||
const rfc3986 = {};
|
||||
|
||||
const hexDigit = '\\dA-Fa-f'; // HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
||||
const hexDigitOnly = '[' + hexDigit + ']';
|
||||
|
||||
const unreserved = '\\w-\\.~'; // unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
||||
const subDelims = '!\\$&\'\\(\\)\\*\\+,;='; // sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
||||
const pctEncoded = '%' + hexDigit; // pct-encoded = "%" HEXDIG HEXDIG
|
||||
const pchar = unreserved + pctEncoded + subDelims + ':@'; // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
||||
const pcharOnly = '[' + pchar + ']';
|
||||
const decOctect = '(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])'; // dec-octet = DIGIT / %x31-39 DIGIT / "1" 2DIGIT / "2" %x30-34 DIGIT / "25" %x30-35 ; 0-9 / 10-99 / 100-199 / 200-249 / 250-255
|
||||
|
||||
rfc3986.ipv4address = '(?:' + decOctect + '\\.){3}' + decOctect; // IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
||||
|
||||
/*
|
||||
h16 = 1*4HEXDIG ; 16 bits of address represented in hexadecimal
|
||||
ls32 = ( h16 ":" h16 ) / IPv4address ; least-significant 32 bits of address
|
||||
IPv6address = 6( h16 ":" ) ls32
|
||||
/ "::" 5( h16 ":" ) ls32
|
||||
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
||||
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
||||
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
||||
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
||||
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
||||
/ [ *5( h16 ":" ) h16 ] "::" h16
|
||||
/ [ *6( h16 ":" ) h16 ] "::"
|
||||
*/
|
||||
|
||||
const h16 = hexDigitOnly + '{1,4}';
|
||||
const ls32 = '(?:' + h16 + ':' + h16 + '|' + rfc3986.ipv4address + ')';
|
||||
const IPv6SixHex = '(?:' + h16 + ':){6}' + ls32;
|
||||
const IPv6FiveHex = '::(?:' + h16 + ':){5}' + ls32;
|
||||
const IPv6FourHex = '(?:' + h16 + ')?::(?:' + h16 + ':){4}' + ls32;
|
||||
const IPv6ThreeHex = '(?:(?:' + h16 + ':){0,1}' + h16 + ')?::(?:' + h16 + ':){3}' + ls32;
|
||||
const IPv6TwoHex = '(?:(?:' + h16 + ':){0,2}' + h16 + ')?::(?:' + h16 + ':){2}' + ls32;
|
||||
const IPv6OneHex = '(?:(?:' + h16 + ':){0,3}' + h16 + ')?::' + h16 + ':' + ls32;
|
||||
const IPv6NoneHex = '(?:(?:' + h16 + ':){0,4}' + h16 + ')?::' + ls32;
|
||||
const IPv6NoneHex2 = '(?:(?:' + h16 + ':){0,5}' + h16 + ')?::' + h16;
|
||||
const IPv6NoneHex3 = '(?:(?:' + h16 + ':){0,6}' + h16 + ')?::';
|
||||
|
||||
rfc3986.ipv4Cidr = '(?:\\d|[1-2]\\d|3[0-2])'; // IPv4 cidr = DIGIT / %x31-32 DIGIT / "3" %x30-32 ; 0-9 / 10-29 / 30-32
|
||||
rfc3986.ipv6Cidr = '(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])'; // IPv6 cidr = DIGIT / %x31-39 DIGIT / "1" %x0-1 DIGIT / "12" %x0-8; 0-9 / 10-99 / 100-119 / 120-128
|
||||
rfc3986.ipv6address = '(?:' + IPv6SixHex + '|' + IPv6FiveHex + '|' + IPv6FourHex + '|' + IPv6ThreeHex + '|' + IPv6TwoHex + '|' + IPv6OneHex + '|' + IPv6NoneHex + '|' + IPv6NoneHex2 + '|' + IPv6NoneHex3 + ')';
|
||||
rfc3986.ipvFuture = 'v' + hexDigitOnly + '+\\.[' + unreserved + subDelims + ':]+'; // IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
||||
|
||||
rfc3986.scheme = '[a-zA-Z][a-zA-Z\\d+-\\.]*'; // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
||||
rfc3986.schemeRegex = new RegExp(rfc3986.scheme);
|
||||
|
||||
const userinfo = '[' + unreserved + pctEncoded + subDelims + ':]*'; // userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
||||
const IPLiteral = '\\[(?:' + rfc3986.ipv6address + '|' + rfc3986.ipvFuture + ')\\]'; // IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
||||
const regName = '[' + unreserved + pctEncoded + subDelims + ']{1,255}'; // reg-name = *( unreserved / pct-encoded / sub-delims )
|
||||
const host = '(?:' + IPLiteral + '|' + rfc3986.ipv4address + '|' + regName + ')'; // host = IP-literal / IPv4address / reg-name
|
||||
const port = '\\d*'; // port = *DIGIT
|
||||
const authority = '(?:' + userinfo + '@)?' + host + '(?::' + port + ')?'; // authority = [ userinfo "@" ] host [ ":" port ]
|
||||
const authorityCapture = '(?:' + userinfo + '@)?(' + host + ')(?::' + port + ')?';
|
||||
|
||||
/*
|
||||
segment = *pchar
|
||||
segment-nz = 1*pchar
|
||||
path = path-abempty ; begins with "/" '|' is empty
|
||||
/ path-absolute ; begins with "/" but not "//"
|
||||
/ path-noscheme ; begins with a non-colon segment
|
||||
/ path-rootless ; begins with a segment
|
||||
/ path-empty ; zero characters
|
||||
path-abempty = *( "/" segment )
|
||||
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
||||
path-rootless = segment-nz *( "/" segment )
|
||||
*/
|
||||
|
||||
const segment = pcharOnly + '*';
|
||||
const segmentNz = pcharOnly + '+';
|
||||
const segmentNzNc = '[' + unreserved + pctEncoded + subDelims + '@' + ']+';
|
||||
const pathEmpty = '';
|
||||
const pathAbEmpty = '(?:\\/' + segment + ')*';
|
||||
const pathAbsolute = '\\/(?:' + segmentNz + pathAbEmpty + ')?';
|
||||
const pathRootless = segmentNz + pathAbEmpty;
|
||||
const pathNoScheme = segmentNzNc + pathAbEmpty;
|
||||
const pathAbNoAuthority = '(?:\\/\\/\\/' + segment + pathAbEmpty + ')'; // Used by file:///
|
||||
|
||||
// hier-part = "//" authority path
|
||||
|
||||
rfc3986.hierPart = '(?:' + '(?:\\/\\/' + authority + pathAbEmpty + ')' + '|' + pathAbsolute + '|' + pathRootless + '|' + pathAbNoAuthority + ')';
|
||||
rfc3986.hierPartCapture = '(?:' + '(?:\\/\\/' + authorityCapture + pathAbEmpty + ')' + '|' + pathAbsolute + '|' + pathRootless + ')';
|
||||
|
||||
// relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty
|
||||
|
||||
rfc3986.relativeRef = '(?:' + '(?:\\/\\/' + authority + pathAbEmpty + ')' + '|' + pathAbsolute + '|' + pathNoScheme + '|' + pathEmpty + ')';
|
||||
rfc3986.relativeRefCapture = '(?:' + '(?:\\/\\/' + authorityCapture + pathAbEmpty + ')' + '|' + pathAbsolute + '|' + pathNoScheme + '|' + pathEmpty + ')';
|
||||
|
||||
// query = *( pchar / "/" / "?" )
|
||||
// query = *( pchar / "[" / "]" / "/" / "?" )
|
||||
|
||||
rfc3986.query = '[' + pchar + '\\/\\?]*(?=#|$)'; //Finish matching either at the fragment part '|' end of the line.
|
||||
rfc3986.queryWithSquareBrackets = '[' + pchar + '\\[\\]\\/\\?]*(?=#|$)';
|
||||
|
||||
// fragment = *( pchar / "/" / "?" )
|
||||
|
||||
rfc3986.fragment = '[' + pchar + '\\/\\?]*';
|
||||
|
||||
return rfc3986;
|
||||
};
|
||||
|
||||
internals.rfc3986 = internals.generate();
|
||||
|
||||
|
||||
exports.ip = {
|
||||
v4Cidr: internals.rfc3986.ipv4Cidr,
|
||||
v6Cidr: internals.rfc3986.ipv6Cidr,
|
||||
ipv4: internals.rfc3986.ipv4address,
|
||||
ipv6: internals.rfc3986.ipv6address,
|
||||
ipvfuture: internals.rfc3986.ipvFuture
|
||||
};
|
||||
|
||||
|
||||
internals.createRegex = function (options) {
|
||||
|
||||
const rfc = internals.rfc3986;
|
||||
|
||||
// Construct expression
|
||||
|
||||
const query = options.allowQuerySquareBrackets ? rfc.queryWithSquareBrackets : rfc.query;
|
||||
const suffix = '(?:\\?' + query + ')?' + '(?:#' + rfc.fragment + ')?';
|
||||
|
||||
// relative-ref = relative-part [ "?" query ] [ "#" fragment ]
|
||||
|
||||
const relative = options.domain ? rfc.relativeRefCapture : rfc.relativeRef;
|
||||
|
||||
if (options.relativeOnly) {
|
||||
return internals.wrap(relative + suffix);
|
||||
}
|
||||
|
||||
// Custom schemes
|
||||
|
||||
let customScheme = '';
|
||||
if (options.scheme) {
|
||||
Assert(options.scheme instanceof RegExp || typeof options.scheme === 'string' || Array.isArray(options.scheme), 'scheme must be a RegExp, String, or Array');
|
||||
|
||||
const schemes = [].concat(options.scheme);
|
||||
Assert(schemes.length >= 1, 'scheme must have at least 1 scheme specified');
|
||||
|
||||
// Flatten the array into a string to be used to match the schemes
|
||||
|
||||
const selections = [];
|
||||
for (let i = 0; i < schemes.length; ++i) {
|
||||
const scheme = schemes[i];
|
||||
Assert(scheme instanceof RegExp || typeof scheme === 'string', 'scheme at position ' + i + ' must be a RegExp or String');
|
||||
|
||||
if (scheme instanceof RegExp) {
|
||||
selections.push(scheme.source.toString());
|
||||
}
|
||||
else {
|
||||
Assert(rfc.schemeRegex.test(scheme), 'scheme at position ' + i + ' must be a valid scheme');
|
||||
selections.push(EscapeRegex(scheme));
|
||||
}
|
||||
}
|
||||
|
||||
customScheme = selections.join('|');
|
||||
}
|
||||
|
||||
// URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
||||
|
||||
const scheme = customScheme ? '(?:' + customScheme + ')' : rfc.scheme;
|
||||
const absolute = '(?:' + scheme + ':' + (options.domain ? rfc.hierPartCapture : rfc.hierPart) + ')';
|
||||
const prefix = options.allowRelative ? '(?:' + absolute + '|' + relative + ')' : absolute;
|
||||
return internals.wrap(prefix + suffix, customScheme);
|
||||
};
|
||||
|
||||
|
||||
internals.wrap = function (raw, scheme) {
|
||||
|
||||
raw = `(?=.)(?!https?\:/(?:$|[^/]))(?!https?\:///)(?!https?\:[^/])${raw}`; // Require at least one character and explicitly forbid 'http:/' or HTTP with empty domain
|
||||
|
||||
return {
|
||||
raw,
|
||||
regex: new RegExp(`^${raw}$`),
|
||||
scheme
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
internals.uriRegex = internals.createRegex({});
|
||||
|
||||
|
||||
exports.regex = function (options = {}) {
|
||||
|
||||
if (options.scheme ||
|
||||
options.allowRelative ||
|
||||
options.relativeOnly ||
|
||||
options.allowQuerySquareBrackets ||
|
||||
options.domain) {
|
||||
|
||||
return internals.createRegex(options);
|
||||
}
|
||||
|
||||
return internals.uriRegex;
|
||||
};
|
30
app_vue/node_modules/@sideway/address/package.json
generated
vendored
Normal file
30
app_vue/node_modules/@sideway/address/package.json
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@sideway/address",
|
||||
"description": "Email address and domain validation",
|
||||
"version": "4.1.5",
|
||||
"repository": "git://github.com/sideway/address",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"keywords": [
|
||||
"email",
|
||||
"domain",
|
||||
"address",
|
||||
"validation"
|
||||
],
|
||||
"dependencies": {
|
||||
"@hapi/hoek": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "4.0.x",
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/lab": "24.x.x"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "lab -a @hapi/code -t 100 -L -Y",
|
||||
"test-cov-html": "lab -a @hapi/code -t 100 -L -r html -o coverage.html"
|
||||
},
|
||||
"license": "BSD-3-Clause"
|
||||
}
|
9
app_vue/node_modules/@sideway/formula/LICENSE.md
generated
vendored
Normal file
9
app_vue/node_modules/@sideway/formula/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
Copyright (c) 2019-2020, Sideway. Inc, and project contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
18
app_vue/node_modules/@sideway/formula/README.md
generated
vendored
Normal file
18
app_vue/node_modules/@sideway/formula/README.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# @sideway/formula
|
||||
|
||||
#### Math and string formula parser.
|
||||
|
||||
**formula** is part of the **joi** ecosystem.
|
||||
|
||||
### Visit the [joi.dev](https://joi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://joi.dev/module/formula/)
|
||||
- [Version status](https://joi.dev/resources/status/#formula) (builds, dependencies, node versions, licenses, eol)
|
||||
- [Changelog](https://joi.dev/module/formula/changelog/)
|
||||
- [Project policies](https://joi.dev/policies/)
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Inspired by [**fparse**](https://github.com/bylexus/fparse), copyright 2012-2018 Alexander Schenkel <alex@alexi.ch>
|
52
app_vue/node_modules/@sideway/formula/lib/index.d.ts
generated
vendored
Normal file
52
app_vue/node_modules/@sideway/formula/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Formula parser
|
||||
*/
|
||||
export class Parser<T extends (string | number)> {
|
||||
|
||||
/**
|
||||
* Create a new formula parser.
|
||||
*
|
||||
* @param formula - the formula string to parse.
|
||||
* @param options - optional settings.
|
||||
*/
|
||||
constructor(formula: string, options?: Options);
|
||||
|
||||
/**
|
||||
* Evaluate the formula.
|
||||
*
|
||||
* @param context - optional object with runtime formula context used to resolve variables.
|
||||
*
|
||||
* @returns the string or number outcome of the resolved formula.
|
||||
*/
|
||||
evaluate(context?: any): T;
|
||||
}
|
||||
|
||||
|
||||
export interface Options {
|
||||
|
||||
/**
|
||||
* A hash of key - value pairs used to convert constants to values.
|
||||
*/
|
||||
readonly constants?: Record<string, any>;
|
||||
|
||||
/**
|
||||
* A regular expression used to validate token variables.
|
||||
*/
|
||||
readonly tokenRx?: RegExp;
|
||||
|
||||
/**
|
||||
* A variable resolver factory function.
|
||||
*/
|
||||
readonly reference?: Options.Reference;
|
||||
|
||||
/**
|
||||
* A hash of key-value pairs used to resolve formula functions.
|
||||
*/
|
||||
readonly functions?: Record<string, Function>;
|
||||
}
|
||||
|
||||
|
||||
export namespace Options {
|
||||
|
||||
type Reference = (name: string) => (context: any) => any;
|
||||
}
|
456
app_vue/node_modules/@sideway/formula/lib/index.js
generated
vendored
Normal file
456
app_vue/node_modules/@sideway/formula/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,456 @@
|
||||
'use strict';
|
||||
|
||||
const internals = {
|
||||
operators: ['!', '^', '*', '/', '%', '+', '-', '<', '<=', '>', '>=', '==', '!=', '&&', '||', '??'],
|
||||
operatorCharacters: ['!', '^', '*', '/', '%', '+', '-', '<', '=', '>', '&', '|', '?'],
|
||||
operatorsOrder: [['^'], ['*', '/', '%'], ['+', '-'], ['<', '<=', '>', '>='], ['==', '!='], ['&&'], ['||', '??']],
|
||||
operatorsPrefix: ['!', 'n'],
|
||||
|
||||
literals: {
|
||||
'"': '"',
|
||||
'`': '`',
|
||||
'\'': '\'',
|
||||
'[': ']'
|
||||
},
|
||||
|
||||
numberRx: /^(?:[0-9]*(\.[0-9]*)?){1}$/,
|
||||
tokenRx: /^[\w\$\#\.\@\:\{\}]+$/,
|
||||
|
||||
symbol: Symbol('formula'),
|
||||
settings: Symbol('settings')
|
||||
};
|
||||
|
||||
|
||||
exports.Parser = class {
|
||||
|
||||
constructor(string, options = {}) {
|
||||
|
||||
if (!options[internals.settings] &&
|
||||
options.constants) {
|
||||
|
||||
for (const constant in options.constants) {
|
||||
const value = options.constants[constant];
|
||||
if (value !== null &&
|
||||
!['boolean', 'number', 'string'].includes(typeof value)) {
|
||||
|
||||
throw new Error(`Formula constant ${constant} contains invalid ${typeof value} value type`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.settings = options[internals.settings] ? options : Object.assign({ [internals.settings]: true, constants: {}, functions: {} }, options);
|
||||
this.single = null;
|
||||
|
||||
this._parts = null;
|
||||
this._parse(string);
|
||||
}
|
||||
|
||||
_parse(string) {
|
||||
|
||||
let parts = [];
|
||||
let current = '';
|
||||
let parenthesis = 0;
|
||||
let literal = false;
|
||||
|
||||
const flush = (inner) => {
|
||||
|
||||
if (parenthesis) {
|
||||
throw new Error('Formula missing closing parenthesis');
|
||||
}
|
||||
|
||||
const last = parts.length ? parts[parts.length - 1] : null;
|
||||
|
||||
if (!literal &&
|
||||
!current &&
|
||||
!inner) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (last &&
|
||||
last.type === 'reference' &&
|
||||
inner === ')') { // Function
|
||||
|
||||
last.type = 'function';
|
||||
last.value = this._subFormula(current, last.value);
|
||||
current = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (inner === ')') { // Segment
|
||||
const sub = new exports.Parser(current, this.settings);
|
||||
parts.push({ type: 'segment', value: sub });
|
||||
}
|
||||
else if (literal) {
|
||||
if (literal === ']') { // Reference
|
||||
parts.push({ type: 'reference', value: current });
|
||||
current = '';
|
||||
return;
|
||||
}
|
||||
|
||||
parts.push({ type: 'literal', value: current }); // Literal
|
||||
}
|
||||
else if (internals.operatorCharacters.includes(current)) { // Operator
|
||||
if (last &&
|
||||
last.type === 'operator' &&
|
||||
internals.operators.includes(last.value + current)) { // 2 characters operator
|
||||
|
||||
last.value += current;
|
||||
}
|
||||
else {
|
||||
parts.push({ type: 'operator', value: current });
|
||||
}
|
||||
}
|
||||
else if (current.match(internals.numberRx)) { // Number
|
||||
parts.push({ type: 'constant', value: parseFloat(current) });
|
||||
}
|
||||
else if (this.settings.constants[current] !== undefined) { // Constant
|
||||
parts.push({ type: 'constant', value: this.settings.constants[current] });
|
||||
}
|
||||
else { // Reference
|
||||
if (!current.match(internals.tokenRx)) {
|
||||
throw new Error(`Formula contains invalid token: ${current}`);
|
||||
}
|
||||
|
||||
parts.push({ type: 'reference', value: current });
|
||||
}
|
||||
|
||||
current = '';
|
||||
};
|
||||
|
||||
for (const c of string) {
|
||||
if (literal) {
|
||||
if (c === literal) {
|
||||
flush();
|
||||
literal = false;
|
||||
}
|
||||
else {
|
||||
current += c;
|
||||
}
|
||||
}
|
||||
else if (parenthesis) {
|
||||
if (c === '(') {
|
||||
current += c;
|
||||
++parenthesis;
|
||||
}
|
||||
else if (c === ')') {
|
||||
--parenthesis;
|
||||
if (!parenthesis) {
|
||||
flush(c);
|
||||
}
|
||||
else {
|
||||
current += c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
current += c;
|
||||
}
|
||||
}
|
||||
else if (c in internals.literals) {
|
||||
literal = internals.literals[c];
|
||||
}
|
||||
else if (c === '(') {
|
||||
flush();
|
||||
++parenthesis;
|
||||
}
|
||||
else if (internals.operatorCharacters.includes(c)) {
|
||||
flush();
|
||||
current = c;
|
||||
flush();
|
||||
}
|
||||
else if (c !== ' ') {
|
||||
current += c;
|
||||
}
|
||||
else {
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
flush();
|
||||
|
||||
// Replace prefix - to internal negative operator
|
||||
|
||||
parts = parts.map((part, i) => {
|
||||
|
||||
if (part.type !== 'operator' ||
|
||||
part.value !== '-' ||
|
||||
i && parts[i - 1].type !== 'operator') {
|
||||
|
||||
return part;
|
||||
}
|
||||
|
||||
return { type: 'operator', value: 'n' };
|
||||
});
|
||||
|
||||
// Validate tokens order
|
||||
|
||||
let operator = false;
|
||||
for (const part of parts) {
|
||||
if (part.type === 'operator') {
|
||||
if (internals.operatorsPrefix.includes(part.value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!operator) {
|
||||
throw new Error('Formula contains an operator in invalid position');
|
||||
}
|
||||
|
||||
if (!internals.operators.includes(part.value)) {
|
||||
throw new Error(`Formula contains an unknown operator ${part.value}`);
|
||||
}
|
||||
}
|
||||
else if (operator) {
|
||||
throw new Error('Formula missing expected operator');
|
||||
}
|
||||
|
||||
operator = !operator;
|
||||
}
|
||||
|
||||
if (!operator) {
|
||||
throw new Error('Formula contains invalid trailing operator');
|
||||
}
|
||||
|
||||
// Identify single part
|
||||
|
||||
if (parts.length === 1 &&
|
||||
['reference', 'literal', 'constant'].includes(parts[0].type)) {
|
||||
|
||||
this.single = { type: parts[0].type === 'reference' ? 'reference' : 'value', value: parts[0].value };
|
||||
}
|
||||
|
||||
// Process parts
|
||||
|
||||
this._parts = parts.map((part) => {
|
||||
|
||||
// Operators
|
||||
|
||||
if (part.type === 'operator') {
|
||||
return internals.operatorsPrefix.includes(part.value) ? part : part.value;
|
||||
}
|
||||
|
||||
// Literals, constants, segments
|
||||
|
||||
if (part.type !== 'reference') {
|
||||
return part.value;
|
||||
}
|
||||
|
||||
// References
|
||||
|
||||
if (this.settings.tokenRx &&
|
||||
!this.settings.tokenRx.test(part.value)) {
|
||||
|
||||
throw new Error(`Formula contains invalid reference ${part.value}`);
|
||||
}
|
||||
|
||||
if (this.settings.reference) {
|
||||
return this.settings.reference(part.value);
|
||||
}
|
||||
|
||||
return internals.reference(part.value);
|
||||
});
|
||||
}
|
||||
|
||||
_subFormula(string, name) {
|
||||
|
||||
const method = this.settings.functions[name];
|
||||
if (typeof method !== 'function') {
|
||||
throw new Error(`Formula contains unknown function ${name}`);
|
||||
}
|
||||
|
||||
let args = [];
|
||||
if (string) {
|
||||
let current = '';
|
||||
let parenthesis = 0;
|
||||
let literal = false;
|
||||
|
||||
const flush = () => {
|
||||
|
||||
if (!current) {
|
||||
throw new Error(`Formula contains function ${name} with invalid arguments ${string}`);
|
||||
}
|
||||
|
||||
args.push(current);
|
||||
current = '';
|
||||
};
|
||||
|
||||
for (let i = 0; i < string.length; ++i) {
|
||||
const c = string[i];
|
||||
if (literal) {
|
||||
current += c;
|
||||
if (c === literal) {
|
||||
literal = false;
|
||||
}
|
||||
}
|
||||
else if (c in internals.literals &&
|
||||
!parenthesis) {
|
||||
|
||||
current += c;
|
||||
literal = internals.literals[c];
|
||||
}
|
||||
else if (c === ',' &&
|
||||
!parenthesis) {
|
||||
|
||||
flush();
|
||||
}
|
||||
else {
|
||||
current += c;
|
||||
if (c === '(') {
|
||||
++parenthesis;
|
||||
}
|
||||
else if (c === ')') {
|
||||
--parenthesis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
args = args.map((arg) => new exports.Parser(arg, this.settings));
|
||||
|
||||
return function (context) {
|
||||
|
||||
const innerValues = [];
|
||||
for (const arg of args) {
|
||||
innerValues.push(arg.evaluate(context));
|
||||
}
|
||||
|
||||
return method.call(context, ...innerValues);
|
||||
};
|
||||
}
|
||||
|
||||
evaluate(context) {
|
||||
|
||||
const parts = this._parts.slice();
|
||||
|
||||
// Prefix operators
|
||||
|
||||
for (let i = parts.length - 2; i >= 0; --i) {
|
||||
const part = parts[i];
|
||||
if (part &&
|
||||
part.type === 'operator') {
|
||||
|
||||
const current = parts[i + 1];
|
||||
parts.splice(i + 1, 1);
|
||||
const value = internals.evaluate(current, context);
|
||||
parts[i] = internals.single(part.value, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Left-right operators
|
||||
|
||||
internals.operatorsOrder.forEach((set) => {
|
||||
|
||||
for (let i = 1; i < parts.length - 1;) {
|
||||
if (set.includes(parts[i])) {
|
||||
const operator = parts[i];
|
||||
const left = internals.evaluate(parts[i - 1], context);
|
||||
const right = internals.evaluate(parts[i + 1], context);
|
||||
|
||||
parts.splice(i, 2);
|
||||
const result = internals.calculate(operator, left, right);
|
||||
parts[i - 1] = result === 0 ? 0 : result; // Convert -0
|
||||
}
|
||||
else {
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return internals.evaluate(parts[0], context);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
exports.Parser.prototype[internals.symbol] = true;
|
||||
|
||||
|
||||
internals.reference = function (name) {
|
||||
|
||||
return function (context) {
|
||||
|
||||
return context && context[name] !== undefined ? context[name] : null;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
internals.evaluate = function (part, context) {
|
||||
|
||||
if (part === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (typeof part === 'function') {
|
||||
return part(context);
|
||||
}
|
||||
|
||||
if (part[internals.symbol]) {
|
||||
return part.evaluate(context);
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
|
||||
|
||||
internals.single = function (operator, value) {
|
||||
|
||||
if (operator === '!') {
|
||||
return value ? false : true;
|
||||
}
|
||||
|
||||
// operator === 'n'
|
||||
|
||||
const negative = -value;
|
||||
if (negative === 0) { // Override -0
|
||||
return 0;
|
||||
}
|
||||
|
||||
return negative;
|
||||
};
|
||||
|
||||
|
||||
internals.calculate = function (operator, left, right) {
|
||||
|
||||
if (operator === '??') {
|
||||
return internals.exists(left) ? left : right;
|
||||
}
|
||||
|
||||
if (typeof left === 'string' ||
|
||||
typeof right === 'string') {
|
||||
|
||||
if (operator === '+') {
|
||||
left = internals.exists(left) ? left : '';
|
||||
right = internals.exists(right) ? right : '';
|
||||
return left + right;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (operator) {
|
||||
case '^': return Math.pow(left, right);
|
||||
case '*': return left * right;
|
||||
case '/': return left / right;
|
||||
case '%': return left % right;
|
||||
case '+': return left + right;
|
||||
case '-': return left - right;
|
||||
}
|
||||
}
|
||||
|
||||
switch (operator) {
|
||||
case '<': return left < right;
|
||||
case '<=': return left <= right;
|
||||
case '>': return left > right;
|
||||
case '>=': return left >= right;
|
||||
case '==': return left === right;
|
||||
case '!=': return left !== right;
|
||||
case '&&': return left && right;
|
||||
case '||': return left || right;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
internals.exists = function (value) {
|
||||
|
||||
return value !== null && value !== undefined;
|
||||
};
|
28
app_vue/node_modules/@sideway/formula/package.json
generated
vendored
Normal file
28
app_vue/node_modules/@sideway/formula/package.json
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@sideway/formula",
|
||||
"description": "Math and string formula parser.",
|
||||
"version": "3.0.1",
|
||||
"repository": "git://github.com/sideway/formula",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"keywords": [
|
||||
"formula",
|
||||
"parser",
|
||||
"math",
|
||||
"string"
|
||||
],
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"typescript": "4.0.x",
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/lab": "24.x.x"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "lab -a @hapi/code -t 100 -L -Y",
|
||||
"test-cov-html": "lab -a @hapi/code -t 100 -L -r html -o coverage.html"
|
||||
},
|
||||
"license": "BSD-3-Clause"
|
||||
}
|
10
app_vue/node_modules/@sideway/pinpoint/LICENSE.md
generated
vendored
Normal file
10
app_vue/node_modules/@sideway/pinpoint/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
Copyright (c) 2019-2020, Sideway. Inc, and project contributors
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
app_vue/node_modules/@sideway/pinpoint/README.md
generated
vendored
Normal file
14
app_vue/node_modules/@sideway/pinpoint/README.md
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
# @sideway/pinpoint
|
||||
|
||||
#### Return the filename and line number of the calling function.
|
||||
|
||||
**pinpoint** is part of the **joi** ecosystem.
|
||||
|
||||
### Visit the [joi.dev](https://joi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://joi.dev/module/pinpoint/)
|
||||
- [Version status](https://joi.dev/resources/status/#pinpoint) (builds, dependencies, node versions, licenses, eol)
|
||||
- [Changelog](https://joi.dev/module/pinpoint/changelog/)
|
||||
- [Project policies](https://joi.dev/policies/)
|
24
app_vue/node_modules/@sideway/pinpoint/lib/index.d.ts
generated
vendored
Normal file
24
app_vue/node_modules/@sideway/pinpoint/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
Returns the filename and line number of the caller in the call stack
|
||||
|
||||
@param depth - The distance from the location function in the call stack. Defaults to 1 (caller).
|
||||
|
||||
@return an object with the filename and line number.
|
||||
*/
|
||||
export function location(depth?: number): location.Location;
|
||||
|
||||
declare namespace location {
|
||||
|
||||
interface Location {
|
||||
|
||||
/**
|
||||
The fully qualified filename.
|
||||
*/
|
||||
readonly filename: string;
|
||||
|
||||
/**
|
||||
The file line number.
|
||||
*/
|
||||
readonly line: number;
|
||||
}
|
||||
}
|
21
app_vue/node_modules/@sideway/pinpoint/lib/index.js
generated
vendored
Normal file
21
app_vue/node_modules/@sideway/pinpoint/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
exports.location = function (depth = 0) {
|
||||
|
||||
const orig = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = (ignore, stack) => stack;
|
||||
|
||||
const capture = {};
|
||||
Error.captureStackTrace(capture, this);
|
||||
const line = capture.stack[depth + 1];
|
||||
|
||||
Error.prepareStackTrace = orig;
|
||||
|
||||
return {
|
||||
filename: line.getFileName(),
|
||||
line: line.getLineNumber()
|
||||
};
|
||||
};
|
25
app_vue/node_modules/@sideway/pinpoint/package.json
generated
vendored
Normal file
25
app_vue/node_modules/@sideway/pinpoint/package.json
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@sideway/pinpoint",
|
||||
"description": "Return the filename and line number of the calling function",
|
||||
"version": "2.0.0",
|
||||
"repository": "git://github.com/sideway/pinpoint",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"keywords": [
|
||||
"utilities"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"typescript": "4.0.x",
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/lab": "24.x.x"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "lab -a @hapi/code -t 100 -L -Y",
|
||||
"test-cov-html": "lab -a @hapi/code -t 100 -L -r html -o coverage.html"
|
||||
},
|
||||
"license": "BSD-3-Clause"
|
||||
}
|
Reference in New Issue
Block a user