mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 10:19:24 +02:00
Moving to node_modules folder to make easier to upgrade
trying to move from Bootstrap 3 to Bootstrap 5
This commit is contained in:
parent
047e363a16
commit
d4d042e041
8460 changed files with 1355889 additions and 547977 deletions
10
node_modules/@hapi/boom/LICENSE.md
generated
vendored
Normal file
10
node_modules/@hapi/boom/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
Copyright (c) 2012-2020, Sideway Inc, and project contributors
|
||||
Copyright (c) 2012-2014, Walmart.
|
||||
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.
|
17
node_modules/@hapi/boom/README.md
generated
vendored
Normal file
17
node_modules/@hapi/boom/README.md
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
<a href="https://hapi.dev"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a>
|
||||
|
||||
# @hapi/boom
|
||||
|
||||
#### HTTP-friendly error objects.
|
||||
|
||||
**boom** is part of the **hapi** ecosystem and was designed to work seamlessly with the [hapi web framework](https://hapi.dev) and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out [hapi](https://hapi.dev) – they work even better together.
|
||||
|
||||
### Visit the [hapi.dev](https://hapi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://hapi.dev/family/boom/)
|
||||
- [Version status](https://hapi.dev/resources/status/#boom) (builds, dependencies, node versions, licenses, eol)
|
||||
- [Changelog](https://hapi.dev/family/boom/changelog/)
|
||||
- [Project policies](https://hapi.dev/policies/)
|
||||
- [Free and commercial support options](https://hapi.dev/support/)
|
549
node_modules/@hapi/boom/lib/index.d.ts
generated
vendored
Normal file
549
node_modules/@hapi/boom/lib/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,549 @@
|
|||
/**
|
||||
* An Error object used to return an HTTP response error (4xx, 5xx)
|
||||
*/
|
||||
export class Boom<Data = any> extends Error {
|
||||
|
||||
/**
|
||||
* Creates a new Boom object using the provided message
|
||||
*/
|
||||
constructor(message?: string | Error, options?: Options<Data>);
|
||||
|
||||
/**
|
||||
* Custom error data with additional information specific to the error type
|
||||
*/
|
||||
data?: Data;
|
||||
|
||||
/**
|
||||
* isBoom - if true, indicates this is a Boom object instance.
|
||||
*/
|
||||
isBoom: boolean;
|
||||
|
||||
/**
|
||||
* Convenience boolean indicating status code >= 500
|
||||
*/
|
||||
isServer: boolean;
|
||||
|
||||
/**
|
||||
* The error message
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The formatted response
|
||||
*/
|
||||
output: Output;
|
||||
|
||||
/**
|
||||
* The constructor used to create the error
|
||||
*/
|
||||
typeof: Function;
|
||||
|
||||
/**
|
||||
* Specifies if an error object is a valid boom object
|
||||
*
|
||||
* @param debug - A boolean that, when true, does not hide the original 500 error message. Defaults to false.
|
||||
*/
|
||||
reformat(debug?: boolean): string;
|
||||
}
|
||||
|
||||
|
||||
export interface Options<Data> {
|
||||
/**
|
||||
* The HTTP status code
|
||||
*
|
||||
* @default 500
|
||||
*/
|
||||
statusCode?: number;
|
||||
|
||||
/**
|
||||
* Additional error information
|
||||
*/
|
||||
data?: Data;
|
||||
|
||||
/**
|
||||
* Constructor reference used to crop the exception call stack output
|
||||
*/
|
||||
ctor?: Function;
|
||||
|
||||
/**
|
||||
* Error message string
|
||||
*
|
||||
* @default none
|
||||
*/
|
||||
message?: string;
|
||||
|
||||
/**
|
||||
* If false, the err provided is a Boom object, and a statusCode or message are provided, the values are ignored
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
override?: boolean;
|
||||
}
|
||||
|
||||
|
||||
export interface Decorate<Decoration> {
|
||||
|
||||
/**
|
||||
* An option with extra properties to set on the error object
|
||||
*/
|
||||
decorate?: Decoration;
|
||||
}
|
||||
|
||||
|
||||
export interface Payload {
|
||||
/**
|
||||
* The HTTP status code derived from error.output.statusCode
|
||||
*/
|
||||
statusCode: number;
|
||||
|
||||
/**
|
||||
* The HTTP status message derived from statusCode
|
||||
*/
|
||||
error: string;
|
||||
|
||||
/**
|
||||
* The error message derived from error.message
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* Custom properties
|
||||
*/
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
|
||||
export interface Output {
|
||||
/**
|
||||
* The HTTP status code
|
||||
*/
|
||||
statusCode: number;
|
||||
|
||||
/**
|
||||
* An object containing any HTTP headers where each key is a header name and value is the header content
|
||||
*/
|
||||
headers: { [header: string]: string | string[] | number | undefined };
|
||||
|
||||
/**
|
||||
* The formatted object used as the response payload (stringified)
|
||||
*/
|
||||
payload: Payload;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specifies if an object is a valid boom object
|
||||
*
|
||||
* @param obj - The object to assess
|
||||
* @param statusCode - Optional status code
|
||||
*
|
||||
* @returns Returns a boolean stating if the error object is a valid boom object and it has the provided statusCode (if present)
|
||||
*/
|
||||
export function isBoom(obj: unknown, statusCode?: number): obj is Boom;
|
||||
|
||||
|
||||
/**
|
||||
* Specifies if an error object is a valid boom object
|
||||
*
|
||||
* @param err - The error object to decorate
|
||||
* @param options - Options object
|
||||
*
|
||||
* @returns A decorated boom object
|
||||
*/
|
||||
export function boomify<Data, Decoration>(err: Error, options?: Options<Data> & Decorate<Decoration>): Boom<Data> & Decoration;
|
||||
|
||||
|
||||
// 4xx Errors
|
||||
|
||||
/**
|
||||
* Returns a 400 Bad Request error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 400 bad request error
|
||||
*/
|
||||
export function badRequest<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 401 Unauthorized error
|
||||
*
|
||||
* @param message - Optional message
|
||||
*
|
||||
* @returns A 401 Unauthorized error
|
||||
*/
|
||||
export function unauthorized<Data>(message?: string | null): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 401 Unauthorized error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param scheme - the authentication scheme name
|
||||
* @param attributes - an object of values used to construct the 'WWW-Authenticate' header
|
||||
*
|
||||
* @returns A 401 Unauthorized error
|
||||
*/
|
||||
export function unauthorized<Data>(message: '' | null, scheme: string, attributes?: string | unauthorized.Attributes): Boom<Data> & unauthorized.MissingAuth;
|
||||
export function unauthorized<Data>(message: string | null, scheme: string, attributes?: string | unauthorized.Attributes): Boom<Data>;
|
||||
|
||||
|
||||
export namespace unauthorized {
|
||||
|
||||
interface Attributes {
|
||||
[index: string]: number | string | null | undefined;
|
||||
}
|
||||
|
||||
interface MissingAuth {
|
||||
|
||||
/**
|
||||
* Indicate whether the 401 unauthorized error is due to missing credentials (vs. invalid)
|
||||
*/
|
||||
isMissing: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 401 Unauthorized error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param wwwAuthenticate - array of string values used to construct the wwwAuthenticate header
|
||||
*
|
||||
* @returns A 401 Unauthorized error
|
||||
*/
|
||||
export function unauthorized<Data>(message: string | null, wwwAuthenticate: string[]): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 402 Payment Required error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 402 Payment Required error
|
||||
*/
|
||||
export function paymentRequired<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 403 Forbidden error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 403 Forbidden error
|
||||
*/
|
||||
export function forbidden<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 404 Not Found error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 404 Not Found error
|
||||
*/
|
||||
export function notFound<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 405 Method Not Allowed error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
* @param allow - Optional string or array of strings which is used to set the 'Allow' header
|
||||
*
|
||||
* @returns A 405 Method Not Allowed error
|
||||
*/
|
||||
export function methodNotAllowed<Data>(message?: string, data?: Data, allow?: string | string[]): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 406 Not Acceptable error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 406 Not Acceptable error
|
||||
*/
|
||||
export function notAcceptable<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 407 Proxy Authentication error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 407 Proxy Authentication error
|
||||
*/
|
||||
export function proxyAuthRequired<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 408 Request Time-out error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 408 Request Time-out error
|
||||
*/
|
||||
export function clientTimeout<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 409 Conflict error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 409 Conflict error
|
||||
*/
|
||||
export function conflict<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 410 Gone error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 410 gone error
|
||||
*/
|
||||
export function resourceGone<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 411 Length Required error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 411 Length Required error
|
||||
*/
|
||||
export function lengthRequired<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 412 Precondition Failed error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 412 Precondition Failed error
|
||||
*/
|
||||
export function preconditionFailed<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 413 Request Entity Too Large error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 413 Request Entity Too Large error
|
||||
*/
|
||||
export function entityTooLarge<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 414 Request-URI Too Large error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 414 Request-URI Too Large error
|
||||
*/
|
||||
export function uriTooLong<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 415 Unsupported Media Type error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 415 Unsupported Media Type error
|
||||
*/
|
||||
export function unsupportedMediaType<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 416 Request Range Not Satisfiable error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 416 Request Range Not Satisfiable error
|
||||
*/
|
||||
export function rangeNotSatisfiable<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 417 Expectation Failed error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 417 Expectation Failed error
|
||||
*/
|
||||
export function expectationFailed<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 418 I'm a Teapot error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 418 I'm a Teapot error
|
||||
*/
|
||||
export function teapot<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 422 Unprocessable Entity error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 422 Unprocessable Entity error
|
||||
*/
|
||||
export function badData<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 423 Locked error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 423 Locked error
|
||||
*/
|
||||
export function locked<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 424 Failed Dependency error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 424 Failed Dependency error
|
||||
*/
|
||||
export function failedDependency<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
/**
|
||||
* Returns a 425 Too Early error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 425 Too Early error
|
||||
*/
|
||||
export function tooEarly<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 428 Precondition Required error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 428 Precondition Required error
|
||||
*/
|
||||
export function preconditionRequired<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 429 Too Many Requests error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 429 Too Many Requests error
|
||||
*/
|
||||
export function tooManyRequests<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 451 Unavailable For Legal Reasons error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 451 Unavailable for Legal Reasons error
|
||||
*/
|
||||
export function illegal<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
// 5xx Errors
|
||||
|
||||
/**
|
||||
* Returns a internal error (defaults to 500)
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
* @param statusCode - Optional status code override. Defaults to 500.
|
||||
*
|
||||
* @returns A 500 Internal Server error
|
||||
*/
|
||||
export function internal<Data>(message?: string, data?: Data, statusCode?: number): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 500 Internal Server Error error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 500 Internal Server error
|
||||
*/
|
||||
export function badImplementation<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 501 Not Implemented error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 501 Not Implemented error
|
||||
*/
|
||||
export function notImplemented<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 502 Bad Gateway error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 502 Bad Gateway error
|
||||
*/
|
||||
export function badGateway<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 503 Service Unavailable error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 503 Service Unavailable error
|
||||
*/
|
||||
export function serverUnavailable<Data>(message?: string, data?: Data): Boom<Data>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a 504 Gateway Time-out error
|
||||
*
|
||||
* @param message - Optional message
|
||||
* @param data - Optional additional error data
|
||||
*
|
||||
* @returns A 504 Gateway Time-out error
|
||||
*/
|
||||
export function gatewayTimeout<Data>(message?: string, data?: Data): Boom<Data>;
|
469
node_modules/@hapi/boom/lib/index.js
generated
vendored
Normal file
469
node_modules/@hapi/boom/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,469 @@
|
|||
'use strict';
|
||||
|
||||
const Hoek = require('@hapi/hoek');
|
||||
|
||||
|
||||
const internals = {
|
||||
codes: new Map([
|
||||
[100, 'Continue'],
|
||||
[101, 'Switching Protocols'],
|
||||
[102, 'Processing'],
|
||||
[200, 'OK'],
|
||||
[201, 'Created'],
|
||||
[202, 'Accepted'],
|
||||
[203, 'Non-Authoritative Information'],
|
||||
[204, 'No Content'],
|
||||
[205, 'Reset Content'],
|
||||
[206, 'Partial Content'],
|
||||
[207, 'Multi-Status'],
|
||||
[300, 'Multiple Choices'],
|
||||
[301, 'Moved Permanently'],
|
||||
[302, 'Moved Temporarily'],
|
||||
[303, 'See Other'],
|
||||
[304, 'Not Modified'],
|
||||
[305, 'Use Proxy'],
|
||||
[307, 'Temporary Redirect'],
|
||||
[400, 'Bad Request'],
|
||||
[401, 'Unauthorized'],
|
||||
[402, 'Payment Required'],
|
||||
[403, 'Forbidden'],
|
||||
[404, 'Not Found'],
|
||||
[405, 'Method Not Allowed'],
|
||||
[406, 'Not Acceptable'],
|
||||
[407, 'Proxy Authentication Required'],
|
||||
[408, 'Request Time-out'],
|
||||
[409, 'Conflict'],
|
||||
[410, 'Gone'],
|
||||
[411, 'Length Required'],
|
||||
[412, 'Precondition Failed'],
|
||||
[413, 'Request Entity Too Large'],
|
||||
[414, 'Request-URI Too Large'],
|
||||
[415, 'Unsupported Media Type'],
|
||||
[416, 'Requested Range Not Satisfiable'],
|
||||
[417, 'Expectation Failed'],
|
||||
[418, 'I\'m a teapot'],
|
||||
[422, 'Unprocessable Entity'],
|
||||
[423, 'Locked'],
|
||||
[424, 'Failed Dependency'],
|
||||
[425, 'Too Early'],
|
||||
[426, 'Upgrade Required'],
|
||||
[428, 'Precondition Required'],
|
||||
[429, 'Too Many Requests'],
|
||||
[431, 'Request Header Fields Too Large'],
|
||||
[451, 'Unavailable For Legal Reasons'],
|
||||
[500, 'Internal Server Error'],
|
||||
[501, 'Not Implemented'],
|
||||
[502, 'Bad Gateway'],
|
||||
[503, 'Service Unavailable'],
|
||||
[504, 'Gateway Time-out'],
|
||||
[505, 'HTTP Version Not Supported'],
|
||||
[506, 'Variant Also Negotiates'],
|
||||
[507, 'Insufficient Storage'],
|
||||
[509, 'Bandwidth Limit Exceeded'],
|
||||
[510, 'Not Extended'],
|
||||
[511, 'Network Authentication Required']
|
||||
])
|
||||
};
|
||||
|
||||
|
||||
exports.Boom = class extends Error {
|
||||
|
||||
constructor(message, options = {}) {
|
||||
|
||||
if (message instanceof Error) {
|
||||
return exports.boomify(Hoek.clone(message), options);
|
||||
}
|
||||
|
||||
const { statusCode = 500, data = null, ctor = exports.Boom } = options;
|
||||
const error = new Error(message ? message : undefined); // Avoids settings null message
|
||||
Error.captureStackTrace(error, ctor); // Filter the stack to our external API
|
||||
error.data = data;
|
||||
const boom = internals.initialize(error, statusCode);
|
||||
|
||||
Object.defineProperty(boom, 'typeof', { value: ctor });
|
||||
|
||||
if (options.decorate) {
|
||||
Object.assign(boom, options.decorate);
|
||||
}
|
||||
|
||||
return boom;
|
||||
}
|
||||
|
||||
static [Symbol.hasInstance](instance) {
|
||||
|
||||
if (this === exports.Boom) {
|
||||
return exports.isBoom(instance);
|
||||
}
|
||||
|
||||
// Cannot use 'instanceof' as it creates infinite recursion
|
||||
|
||||
return this.prototype.isPrototypeOf(instance);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
exports.isBoom = function (err, statusCode) {
|
||||
|
||||
return err instanceof Error && !!err.isBoom && (!statusCode || err.output.statusCode === statusCode);
|
||||
};
|
||||
|
||||
|
||||
exports.boomify = function (err, options) {
|
||||
|
||||
Hoek.assert(err instanceof Error, 'Cannot wrap non-Error object');
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (options.data !== undefined) {
|
||||
err.data = options.data;
|
||||
}
|
||||
|
||||
if (options.decorate) {
|
||||
Object.assign(err, options.decorate);
|
||||
}
|
||||
|
||||
if (!err.isBoom) {
|
||||
return internals.initialize(err, options.statusCode || 500, options.message);
|
||||
}
|
||||
|
||||
if (options.override === false || // Defaults to true
|
||||
!options.statusCode && !options.message) {
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
return internals.initialize(err, options.statusCode || err.output.statusCode, options.message);
|
||||
};
|
||||
|
||||
|
||||
// 4xx Client Errors
|
||||
|
||||
exports.badRequest = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 400, data, ctor: exports.badRequest });
|
||||
};
|
||||
|
||||
|
||||
exports.unauthorized = function (message, scheme, attributes) { // Or (message, wwwAuthenticate[])
|
||||
|
||||
const err = new exports.Boom(message, { statusCode: 401, ctor: exports.unauthorized });
|
||||
|
||||
// function (message)
|
||||
|
||||
if (!scheme) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// function (message, wwwAuthenticate[])
|
||||
|
||||
if (typeof scheme !== 'string') {
|
||||
err.output.headers['WWW-Authenticate'] = scheme.join(', ');
|
||||
return err;
|
||||
}
|
||||
|
||||
// function (message, scheme, attributes)
|
||||
|
||||
let wwwAuthenticate = `${scheme}`;
|
||||
|
||||
if (attributes ||
|
||||
message) {
|
||||
|
||||
err.output.payload.attributes = {};
|
||||
}
|
||||
|
||||
if (attributes) {
|
||||
if (typeof attributes === 'string') {
|
||||
wwwAuthenticate += ' ' + Hoek.escapeHeaderAttribute(attributes);
|
||||
err.output.payload.attributes = attributes;
|
||||
}
|
||||
else {
|
||||
wwwAuthenticate += ' ' + Object.keys(attributes).map((name) => {
|
||||
|
||||
let value = attributes[name];
|
||||
if (value === null ||
|
||||
value === undefined) {
|
||||
|
||||
value = '';
|
||||
}
|
||||
|
||||
err.output.payload.attributes[name] = value;
|
||||
return `${name}="${Hoek.escapeHeaderAttribute(value.toString())}"`;
|
||||
})
|
||||
.join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
if (message) {
|
||||
if (attributes) {
|
||||
wwwAuthenticate += ',';
|
||||
}
|
||||
|
||||
wwwAuthenticate += ` error="${Hoek.escapeHeaderAttribute(message)}"`;
|
||||
err.output.payload.attributes.error = message;
|
||||
}
|
||||
else {
|
||||
err.isMissing = true;
|
||||
}
|
||||
|
||||
err.output.headers['WWW-Authenticate'] = wwwAuthenticate;
|
||||
return err;
|
||||
};
|
||||
|
||||
|
||||
exports.paymentRequired = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 402, data, ctor: exports.paymentRequired });
|
||||
};
|
||||
|
||||
|
||||
exports.forbidden = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 403, data, ctor: exports.forbidden });
|
||||
};
|
||||
|
||||
|
||||
exports.notFound = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 404, data, ctor: exports.notFound });
|
||||
};
|
||||
|
||||
|
||||
exports.methodNotAllowed = function (message, data, allow) {
|
||||
|
||||
const err = new exports.Boom(message, { statusCode: 405, data, ctor: exports.methodNotAllowed });
|
||||
|
||||
if (typeof allow === 'string') {
|
||||
allow = [allow];
|
||||
}
|
||||
|
||||
if (Array.isArray(allow)) {
|
||||
err.output.headers.Allow = allow.join(', ');
|
||||
}
|
||||
|
||||
return err;
|
||||
};
|
||||
|
||||
|
||||
exports.notAcceptable = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 406, data, ctor: exports.notAcceptable });
|
||||
};
|
||||
|
||||
|
||||
exports.proxyAuthRequired = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 407, data, ctor: exports.proxyAuthRequired });
|
||||
};
|
||||
|
||||
|
||||
exports.clientTimeout = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 408, data, ctor: exports.clientTimeout });
|
||||
};
|
||||
|
||||
|
||||
exports.conflict = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 409, data, ctor: exports.conflict });
|
||||
};
|
||||
|
||||
|
||||
exports.resourceGone = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 410, data, ctor: exports.resourceGone });
|
||||
};
|
||||
|
||||
|
||||
exports.lengthRequired = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 411, data, ctor: exports.lengthRequired });
|
||||
};
|
||||
|
||||
|
||||
exports.preconditionFailed = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 412, data, ctor: exports.preconditionFailed });
|
||||
};
|
||||
|
||||
|
||||
exports.entityTooLarge = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 413, data, ctor: exports.entityTooLarge });
|
||||
};
|
||||
|
||||
|
||||
exports.uriTooLong = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 414, data, ctor: exports.uriTooLong });
|
||||
};
|
||||
|
||||
|
||||
exports.unsupportedMediaType = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 415, data, ctor: exports.unsupportedMediaType });
|
||||
};
|
||||
|
||||
|
||||
exports.rangeNotSatisfiable = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 416, data, ctor: exports.rangeNotSatisfiable });
|
||||
};
|
||||
|
||||
|
||||
exports.expectationFailed = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 417, data, ctor: exports.expectationFailed });
|
||||
};
|
||||
|
||||
|
||||
exports.teapot = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 418, data, ctor: exports.teapot });
|
||||
};
|
||||
|
||||
|
||||
exports.badData = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 422, data, ctor: exports.badData });
|
||||
};
|
||||
|
||||
|
||||
exports.locked = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 423, data, ctor: exports.locked });
|
||||
};
|
||||
|
||||
|
||||
exports.failedDependency = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 424, data, ctor: exports.failedDependency });
|
||||
};
|
||||
|
||||
exports.tooEarly = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 425, data, ctor: exports.tooEarly });
|
||||
};
|
||||
|
||||
|
||||
exports.preconditionRequired = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 428, data, ctor: exports.preconditionRequired });
|
||||
};
|
||||
|
||||
|
||||
exports.tooManyRequests = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 429, data, ctor: exports.tooManyRequests });
|
||||
};
|
||||
|
||||
|
||||
exports.illegal = function (message, data) {
|
||||
|
||||
return new exports.Boom(message, { statusCode: 451, data, ctor: exports.illegal });
|
||||
};
|
||||
|
||||
|
||||
// 5xx Server Errors
|
||||
|
||||
exports.internal = function (message, data, statusCode = 500) {
|
||||
|
||||
return internals.serverError(message, data, statusCode, exports.internal);
|
||||
};
|
||||
|
||||
|
||||
exports.notImplemented = function (message, data) {
|
||||
|
||||
return internals.serverError(message, data, 501, exports.notImplemented);
|
||||
};
|
||||
|
||||
|
||||
exports.badGateway = function (message, data) {
|
||||
|
||||
return internals.serverError(message, data, 502, exports.badGateway);
|
||||
};
|
||||
|
||||
|
||||
exports.serverUnavailable = function (message, data) {
|
||||
|
||||
return internals.serverError(message, data, 503, exports.serverUnavailable);
|
||||
};
|
||||
|
||||
|
||||
exports.gatewayTimeout = function (message, data) {
|
||||
|
||||
return internals.serverError(message, data, 504, exports.gatewayTimeout);
|
||||
};
|
||||
|
||||
|
||||
exports.badImplementation = function (message, data) {
|
||||
|
||||
const err = internals.serverError(message, data, 500, exports.badImplementation);
|
||||
err.isDeveloperError = true;
|
||||
return err;
|
||||
};
|
||||
|
||||
|
||||
internals.initialize = function (err, statusCode, message) {
|
||||
|
||||
const numberCode = parseInt(statusCode, 10);
|
||||
Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
|
||||
|
||||
err.isBoom = true;
|
||||
err.isServer = numberCode >= 500;
|
||||
|
||||
if (!err.hasOwnProperty('data')) {
|
||||
err.data = null;
|
||||
}
|
||||
|
||||
err.output = {
|
||||
statusCode: numberCode,
|
||||
payload: {},
|
||||
headers: {}
|
||||
};
|
||||
|
||||
Object.defineProperty(err, 'reformat', { value: internals.reformat, configurable: true });
|
||||
|
||||
if (!message &&
|
||||
!err.message) {
|
||||
|
||||
err.reformat();
|
||||
message = err.output.payload.error;
|
||||
}
|
||||
|
||||
if (message) {
|
||||
const props = Object.getOwnPropertyDescriptor(err, 'message') || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(err), 'message');
|
||||
Hoek.assert(!props || props.configurable && !props.get, 'The error is not compatible with boom');
|
||||
|
||||
err.message = message + (err.message ? ': ' + err.message : '');
|
||||
err.output.payload.message = err.message;
|
||||
}
|
||||
|
||||
err.reformat();
|
||||
return err;
|
||||
};
|
||||
|
||||
|
||||
internals.reformat = function (debug = false) {
|
||||
|
||||
this.output.payload.statusCode = this.output.statusCode;
|
||||
this.output.payload.error = internals.codes.get(this.output.statusCode) || 'Unknown';
|
||||
|
||||
if (this.output.statusCode === 500 && debug !== true) {
|
||||
this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user
|
||||
}
|
||||
else if (this.message) {
|
||||
this.output.payload.message = this.message;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.serverError = function (message, data, statusCode, ctor) {
|
||||
|
||||
if (data instanceof Error &&
|
||||
!data.isBoom) {
|
||||
|
||||
return exports.boomify(data, { statusCode, message });
|
||||
}
|
||||
|
||||
return new exports.Boom(message, { statusCode, data, ctor });
|
||||
};
|
61
node_modules/@hapi/boom/package.json
generated
vendored
Normal file
61
node_modules/@hapi/boom/package.json
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"_from": "@hapi/boom@9.x.x",
|
||||
"_id": "@hapi/boom@9.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Ls1oH8jaN1vNsqcaHVYJrKmgMcKsC1wcp8bujvXrHaAqD2iDYq3HoOwsxwo09Cuda5R5nC0o0IxlrlTuvPuzSw==",
|
||||
"_location": "/@hapi/boom",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@hapi/boom@9.x.x",
|
||||
"name": "@hapi/boom",
|
||||
"escapedName": "@hapi%2fboom",
|
||||
"scope": "@hapi",
|
||||
"rawSpec": "9.x.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "9.x.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@hapi/cryptiles"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-9.1.4.tgz",
|
||||
"_shasum": "1f9dad367c6a7da9f8def24b4a986fc5a7bd9db6",
|
||||
"_spec": "@hapi/boom@9.x.x",
|
||||
"_where": "G:\\GDrive\\htdocs\\YouPHPTube\\node_modules\\@hapi\\cryptiles",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hapijs/boom/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@hapi/hoek": "9.x.x"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "HTTP-friendly error objects",
|
||||
"devDependencies": {
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/lab": "24.x.x",
|
||||
"typescript": "~4.0.2"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/hapijs/boom#readme",
|
||||
"keywords": [
|
||||
"error",
|
||||
"http"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "lib/index.js",
|
||||
"name": "@hapi/boom",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hapijs/boom.git"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"version": "9.1.4"
|
||||
}
|
9
node_modules/@hapi/cryptiles/LICENSE.md
generated
vendored
Normal file
9
node_modules/@hapi/cryptiles/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
Copyright (c) 2014-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.
|
17
node_modules/@hapi/cryptiles/README.md
generated
vendored
Normal file
17
node_modules/@hapi/cryptiles/README.md
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
<a href="https://hapi.dev"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a>
|
||||
|
||||
# @hapi/cryptiles
|
||||
|
||||
#### General purpose crypto utilities.
|
||||
|
||||
**cryptiles** is part of the **hapi** ecosystem and was designed to work seamlessly with the [hapi web framework](https://hapi.dev) and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out [hapi](https://hapi.dev) – they work even better together.
|
||||
|
||||
### Visit the [hapi.dev](https://hapi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://hapi.dev/family/cryptiles/)
|
||||
- [Versions status](https://hapi.dev/resources/status/#cryptiles) (builds, dependencies, node versions, licenses, eol)
|
||||
- [Changelog](https://hapi.dev/family/cryptiles/changelog/)
|
||||
- [Project policies](https://hapi.dev/policies/)
|
||||
- [Free and commercial support options](https://hapi.dev/support/)
|
54
node_modules/@hapi/cryptiles/lib/index.d.ts
generated
vendored
Normal file
54
node_modules/@hapi/cryptiles/lib/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
Generate a cryptographically strong pseudo-random data
|
||||
|
||||
@param size - Size of the string
|
||||
|
||||
@returns A cryptographically strong pseudo-random data
|
||||
*/
|
||||
|
||||
export function randomString(size: number): string;
|
||||
|
||||
|
||||
/**
|
||||
Generate a cryptographically strong pseudo-random alphanumeric data
|
||||
|
||||
@param size - Size of the string
|
||||
|
||||
@returns A cryptographically strong pseudo-random alphanumeric data
|
||||
*/
|
||||
|
||||
export function randomAlphanumString(size: number): string;
|
||||
|
||||
|
||||
/**
|
||||
Return a random string of digits
|
||||
|
||||
@param size - Size of the digits
|
||||
|
||||
@returns A random string of digits
|
||||
*/
|
||||
|
||||
export function randomDigits(size: number): string;
|
||||
|
||||
|
||||
/**
|
||||
Generate a buffer of random bits
|
||||
|
||||
@param bits - Number of bits
|
||||
|
||||
@returns A buffer of random bits
|
||||
*/
|
||||
|
||||
export function randomBits(bits: number): Buffer;
|
||||
|
||||
|
||||
/**
|
||||
Generate a buffer of random bits
|
||||
|
||||
@param a - Data to compare
|
||||
@param b - Data to compare
|
||||
|
||||
@returns A boolean comparing a and b
|
||||
*/
|
||||
|
||||
export function fixedTimeComparison(a: string | Array<any>, b: string | Array<any>): boolean;
|
96
node_modules/@hapi/cryptiles/lib/index.js
generated
vendored
Normal file
96
node_modules/@hapi/cryptiles/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
'use strict';
|
||||
|
||||
const Crypto = require('crypto');
|
||||
|
||||
const Boom = require('@hapi/boom');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
// Generate a cryptographically strong pseudo-random data
|
||||
|
||||
exports.randomString = function (size) {
|
||||
|
||||
const buffer = exports.randomBits((size + 1) * 6);
|
||||
const string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
|
||||
return string.slice(0, size);
|
||||
};
|
||||
|
||||
|
||||
// Generate a cryptographically strong pseudo-random alphanum data
|
||||
|
||||
exports.randomAlphanumString = function (size) {
|
||||
|
||||
let result = '';
|
||||
|
||||
while (result.length < size) {
|
||||
const buffer = exports.randomBits((size + 1) * 6);
|
||||
result += buffer.toString('base64').replace(/[^a-zA-Z0-9]/g, '');
|
||||
}
|
||||
|
||||
return result.slice(0, size);
|
||||
};
|
||||
|
||||
|
||||
// Return a random string of digits
|
||||
|
||||
exports.randomDigits = function (size) {
|
||||
|
||||
const digits = [];
|
||||
|
||||
let buffer = internals.random(size * 2); // Provision twice the amount of bytes needed to increase chance of single pass
|
||||
let pos = 0;
|
||||
|
||||
while (digits.length < size) {
|
||||
if (pos >= buffer.length) {
|
||||
buffer = internals.random(size * 2);
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
if (buffer[pos] < 250) {
|
||||
digits.push(buffer[pos] % 10);
|
||||
}
|
||||
|
||||
++pos;
|
||||
}
|
||||
|
||||
return digits.join('');
|
||||
};
|
||||
|
||||
|
||||
// Generate a buffer of random bits
|
||||
|
||||
exports.randomBits = function (bits) {
|
||||
|
||||
if (!bits ||
|
||||
bits < 0) {
|
||||
|
||||
throw Boom.internal('Invalid random bits count');
|
||||
}
|
||||
|
||||
const bytes = Math.ceil(bits / 8);
|
||||
return internals.random(bytes);
|
||||
};
|
||||
|
||||
|
||||
exports.fixedTimeComparison = function (a, b) {
|
||||
|
||||
try {
|
||||
return Crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b));
|
||||
}
|
||||
catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.random = function (bytes) {
|
||||
|
||||
try {
|
||||
return Crypto.randomBytes(bytes);
|
||||
}
|
||||
catch (err) {
|
||||
throw Boom.internal('Failed generating random bits: ' + err.message);
|
||||
}
|
||||
};
|
64
node_modules/@hapi/cryptiles/package.json
generated
vendored
Normal file
64
node_modules/@hapi/cryptiles/package.json
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"_from": "@hapi/cryptiles@^5.1.0",
|
||||
"_id": "@hapi/cryptiles@5.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-fo9+d1Ba5/FIoMySfMqPBR/7Pa29J2RsiPrl7bkwo5W5o+AN1dAYQRi4SPrPwwVxVGKjgLOEWrsvt1BonJSfLA==",
|
||||
"_location": "/@hapi/cryptiles",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@hapi/cryptiles@^5.1.0",
|
||||
"name": "@hapi/cryptiles",
|
||||
"escapedName": "@hapi%2fcryptiles",
|
||||
"scope": "@hapi",
|
||||
"rawSpec": "^5.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/videojs-ima"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@hapi/cryptiles/-/cryptiles-5.1.0.tgz",
|
||||
"_shasum": "655de4cbbc052c947f696148c83b187fc2be8f43",
|
||||
"_spec": "@hapi/cryptiles@^5.1.0",
|
||||
"_where": "G:\\GDrive\\htdocs\\YouPHPTube\\node_modules\\videojs-ima",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hapijs/cryptiles/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@hapi/boom": "9.x.x"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "General purpose crypto utilities",
|
||||
"devDependencies": {
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/lab": "22.x.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/hapijs/cryptiles#readme",
|
||||
"keywords": [
|
||||
"cryptography",
|
||||
"security",
|
||||
"utilites"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "lib/index.js",
|
||||
"name": "@hapi/cryptiles",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hapijs/cryptiles.git"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"version": "5.1.0"
|
||||
}
|
12
node_modules/@hapi/hoek/LICENSE.md
generated
vendored
Normal file
12
node_modules/@hapi/hoek/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
Copyright (c) 2011-2020, Sideway Inc, and project contributors
|
||||
Copyright (c) 2011-2014, Walmart
|
||||
Copyright (c) 2011, Yahoo Inc.
|
||||
|
||||
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.
|
19
node_modules/@hapi/hoek/README.md
generated
vendored
Normal file
19
node_modules/@hapi/hoek/README.md
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<a href="https://hapi.dev"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a>
|
||||
|
||||
# @hapi/hoek
|
||||
|
||||
#### Utility methods for the hapi ecosystem.
|
||||
|
||||
**hoek** is part of the **hapi** ecosystem and was designed to work seamlessly with the [hapi web framework](https://hapi.dev) and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out [hapi](https://hapi.dev) – they work even better together.
|
||||
|
||||
This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash).
|
||||
|
||||
### Visit the [hapi.dev](https://hapi.dev) Developer Portal for tutorials, documentation, and support
|
||||
|
||||
## Useful resources
|
||||
|
||||
- [Documentation and API](https://hapi.dev/family/hoek/)
|
||||
- [Version status](https://hapi.dev/resources/status/#hoek) (builds, dependencies, node versions, licenses, eol)
|
||||
- [Changelog](https://hapi.dev/family/hoek/changelog/)
|
||||
- [Project policies](https://hapi.dev/policies/)
|
||||
- [Free and commercial support options](https://hapi.dev/support/)
|
102
node_modules/@hapi/hoek/lib/applyToDefaults.js
generated
vendored
Normal file
102
node_modules/@hapi/hoek/lib/applyToDefaults.js
generated
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
'use strict';
|
||||
|
||||
const Assert = require('./assert');
|
||||
const Clone = require('./clone');
|
||||
const Merge = require('./merge');
|
||||
const Reach = require('./reach');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (defaults, source, options = {}) {
|
||||
|
||||
Assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
|
||||
Assert(!source || source === true || typeof source === 'object', 'Invalid source value: must be true, falsy or an object');
|
||||
Assert(typeof options === 'object', 'Invalid options: must be an object');
|
||||
|
||||
if (!source) { // If no source, return null
|
||||
return null;
|
||||
}
|
||||
|
||||
if (options.shallow) {
|
||||
return internals.applyToDefaultsWithShallow(defaults, source, options);
|
||||
}
|
||||
|
||||
const copy = Clone(defaults);
|
||||
|
||||
if (source === true) { // If source is set to true, use defaults
|
||||
return copy;
|
||||
}
|
||||
|
||||
const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false;
|
||||
return Merge(copy, source, { nullOverride, mergeArrays: false });
|
||||
};
|
||||
|
||||
|
||||
internals.applyToDefaultsWithShallow = function (defaults, source, options) {
|
||||
|
||||
const keys = options.shallow;
|
||||
Assert(Array.isArray(keys), 'Invalid keys');
|
||||
|
||||
const seen = new Map();
|
||||
const merge = source === true ? null : new Set();
|
||||
|
||||
for (let key of keys) {
|
||||
key = Array.isArray(key) ? key : key.split('.'); // Pre-split optimization
|
||||
|
||||
const ref = Reach(defaults, key);
|
||||
if (ref &&
|
||||
typeof ref === 'object') {
|
||||
|
||||
seen.set(ref, merge && Reach(source, key) || ref);
|
||||
}
|
||||
else if (merge) {
|
||||
merge.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
const copy = Clone(defaults, {}, seen);
|
||||
|
||||
if (!merge) {
|
||||
return copy;
|
||||
}
|
||||
|
||||
for (const key of merge) {
|
||||
internals.reachCopy(copy, source, key);
|
||||
}
|
||||
|
||||
const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false;
|
||||
return Merge(copy, source, { nullOverride, mergeArrays: false });
|
||||
};
|
||||
|
||||
|
||||
internals.reachCopy = function (dst, src, path) {
|
||||
|
||||
for (const segment of path) {
|
||||
if (!(segment in src)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const val = src[segment];
|
||||
|
||||
if (typeof val !== 'object' || val === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
src = val;
|
||||
}
|
||||
|
||||
const value = src;
|
||||
let ref = dst;
|
||||
for (let i = 0; i < path.length - 1; ++i) {
|
||||
const segment = path[i];
|
||||
if (typeof ref[segment] !== 'object') {
|
||||
ref[segment] = {};
|
||||
}
|
||||
|
||||
ref = ref[segment];
|
||||
}
|
||||
|
||||
ref[path[path.length - 1]] = value;
|
||||
};
|
21
node_modules/@hapi/hoek/lib/assert.js
generated
vendored
Normal file
21
node_modules/@hapi/hoek/lib/assert.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
'use strict';
|
||||
|
||||
const AssertError = require('./error');
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (condition, ...args) {
|
||||
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length === 1 &&
|
||||
args[0] instanceof Error) {
|
||||
|
||||
throw args[0];
|
||||
}
|
||||
|
||||
throw new AssertError(args);
|
||||
};
|
29
node_modules/@hapi/hoek/lib/bench.js
generated
vendored
Normal file
29
node_modules/@hapi/hoek/lib/bench.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = internals.Bench = class {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.ts = 0;
|
||||
this.reset();
|
||||
}
|
||||
|
||||
reset() {
|
||||
|
||||
this.ts = internals.Bench.now();
|
||||
}
|
||||
|
||||
elapsed() {
|
||||
|
||||
return internals.Bench.now() - this.ts;
|
||||
}
|
||||
|
||||
static now() {
|
||||
|
||||
const ts = process.hrtime();
|
||||
return (ts[0] * 1e3) + (ts[1] / 1e6);
|
||||
}
|
||||
};
|
12
node_modules/@hapi/hoek/lib/block.js
generated
vendored
Normal file
12
node_modules/@hapi/hoek/lib/block.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
const Ignore = require('./ignore');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function () {
|
||||
|
||||
return new Promise(Ignore);
|
||||
};
|
176
node_modules/@hapi/hoek/lib/clone.js
generated
vendored
Normal file
176
node_modules/@hapi/hoek/lib/clone.js
generated
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
'use strict';
|
||||
|
||||
const Reach = require('./reach');
|
||||
const Types = require('./types');
|
||||
const Utils = require('./utils');
|
||||
|
||||
|
||||
const internals = {
|
||||
needsProtoHack: new Set([Types.set, Types.map, Types.weakSet, Types.weakMap])
|
||||
};
|
||||
|
||||
|
||||
module.exports = internals.clone = function (obj, options = {}, _seen = null) {
|
||||
|
||||
if (typeof obj !== 'object' ||
|
||||
obj === null) {
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
let clone = internals.clone;
|
||||
let seen = _seen;
|
||||
|
||||
if (options.shallow) {
|
||||
if (options.shallow !== true) {
|
||||
return internals.cloneWithShallow(obj, options);
|
||||
}
|
||||
|
||||
clone = (value) => value;
|
||||
}
|
||||
else if (seen) {
|
||||
const lookup = seen.get(obj);
|
||||
if (lookup) {
|
||||
return lookup;
|
||||
}
|
||||
}
|
||||
else {
|
||||
seen = new Map();
|
||||
}
|
||||
|
||||
// Built-in object types
|
||||
|
||||
const baseProto = Types.getInternalProto(obj);
|
||||
if (baseProto === Types.buffer) {
|
||||
return Buffer && Buffer.from(obj); // $lab:coverage:ignore$
|
||||
}
|
||||
|
||||
if (baseProto === Types.date) {
|
||||
return new Date(obj.getTime());
|
||||
}
|
||||
|
||||
if (baseProto === Types.regex) {
|
||||
return new RegExp(obj);
|
||||
}
|
||||
|
||||
// Generic objects
|
||||
|
||||
const newObj = internals.base(obj, baseProto, options);
|
||||
if (newObj === obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (seen) {
|
||||
seen.set(obj, newObj); // Set seen, since obj could recurse
|
||||
}
|
||||
|
||||
if (baseProto === Types.set) {
|
||||
for (const value of obj) {
|
||||
newObj.add(clone(value, options, seen));
|
||||
}
|
||||
}
|
||||
else if (baseProto === Types.map) {
|
||||
for (const [key, value] of obj) {
|
||||
newObj.set(key, clone(value, options, seen));
|
||||
}
|
||||
}
|
||||
|
||||
const keys = Utils.keys(obj, options);
|
||||
for (const key of keys) {
|
||||
if (key === '__proto__') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (baseProto === Types.array &&
|
||||
key === 'length') {
|
||||
|
||||
newObj.length = obj.length;
|
||||
continue;
|
||||
}
|
||||
|
||||
const descriptor = Object.getOwnPropertyDescriptor(obj, key);
|
||||
if (descriptor) {
|
||||
if (descriptor.get ||
|
||||
descriptor.set) {
|
||||
|
||||
Object.defineProperty(newObj, key, descriptor);
|
||||
}
|
||||
else if (descriptor.enumerable) {
|
||||
newObj[key] = clone(obj[key], options, seen);
|
||||
}
|
||||
else {
|
||||
Object.defineProperty(newObj, key, { enumerable: false, writable: true, configurable: true, value: clone(obj[key], options, seen) });
|
||||
}
|
||||
}
|
||||
else {
|
||||
Object.defineProperty(newObj, key, {
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
value: clone(obj[key], options, seen)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return newObj;
|
||||
};
|
||||
|
||||
|
||||
internals.cloneWithShallow = function (source, options) {
|
||||
|
||||
const keys = options.shallow;
|
||||
options = Object.assign({}, options);
|
||||
options.shallow = false;
|
||||
|
||||
const seen = new Map();
|
||||
|
||||
for (const key of keys) {
|
||||
const ref = Reach(source, key);
|
||||
if (typeof ref === 'object' ||
|
||||
typeof ref === 'function') {
|
||||
|
||||
seen.set(ref, ref);
|
||||
}
|
||||
}
|
||||
|
||||
return internals.clone(source, options, seen);
|
||||
};
|
||||
|
||||
|
||||
internals.base = function (obj, baseProto, options) {
|
||||
|
||||
if (options.prototype === false) { // Defaults to true
|
||||
if (internals.needsProtoHack.has(baseProto)) {
|
||||
return new baseProto.constructor();
|
||||
}
|
||||
|
||||
return baseProto === Types.array ? [] : {};
|
||||
}
|
||||
|
||||
const proto = Object.getPrototypeOf(obj);
|
||||
if (proto &&
|
||||
proto.isImmutable) {
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (baseProto === Types.array) {
|
||||
const newObj = [];
|
||||
if (proto !== baseProto) {
|
||||
Object.setPrototypeOf(newObj, proto);
|
||||
}
|
||||
|
||||
return newObj;
|
||||
}
|
||||
|
||||
if (internals.needsProtoHack.has(baseProto)) {
|
||||
const newObj = new proto.constructor();
|
||||
if (proto !== baseProto) {
|
||||
Object.setPrototypeOf(newObj, proto);
|
||||
}
|
||||
|
||||
return newObj;
|
||||
}
|
||||
|
||||
return Object.create(proto);
|
||||
};
|
307
node_modules/@hapi/hoek/lib/contain.js
generated
vendored
Normal file
307
node_modules/@hapi/hoek/lib/contain.js
generated
vendored
Normal file
|
@ -0,0 +1,307 @@
|
|||
'use strict';
|
||||
|
||||
const Assert = require('./assert');
|
||||
const DeepEqual = require('./deepEqual');
|
||||
const EscapeRegex = require('./escapeRegex');
|
||||
const Utils = require('./utils');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (ref, values, options = {}) { // options: { deep, once, only, part, symbols }
|
||||
|
||||
/*
|
||||
string -> string(s)
|
||||
array -> item(s)
|
||||
object -> key(s)
|
||||
object -> object (key:value)
|
||||
*/
|
||||
|
||||
if (typeof values !== 'object') {
|
||||
values = [values];
|
||||
}
|
||||
|
||||
Assert(!Array.isArray(values) || values.length, 'Values array cannot be empty');
|
||||
|
||||
// String
|
||||
|
||||
if (typeof ref === 'string') {
|
||||
return internals.string(ref, values, options);
|
||||
}
|
||||
|
||||
// Array
|
||||
|
||||
if (Array.isArray(ref)) {
|
||||
return internals.array(ref, values, options);
|
||||
}
|
||||
|
||||
// Object
|
||||
|
||||
Assert(typeof ref === 'object', 'Reference must be string or an object');
|
||||
return internals.object(ref, values, options);
|
||||
};
|
||||
|
||||
|
||||
internals.array = function (ref, values, options) {
|
||||
|
||||
if (!Array.isArray(values)) {
|
||||
values = [values];
|
||||
}
|
||||
|
||||
if (!ref.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.only &&
|
||||
options.once &&
|
||||
ref.length !== values.length) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let compare;
|
||||
|
||||
// Map values
|
||||
|
||||
const map = new Map();
|
||||
for (const value of values) {
|
||||
if (!options.deep ||
|
||||
!value ||
|
||||
typeof value !== 'object') {
|
||||
|
||||
const existing = map.get(value);
|
||||
if (existing) {
|
||||
++existing.allowed;
|
||||
}
|
||||
else {
|
||||
map.set(value, { allowed: 1, hits: 0 });
|
||||
}
|
||||
}
|
||||
else {
|
||||
compare = compare || internals.compare(options);
|
||||
|
||||
let found = false;
|
||||
for (const [key, existing] of map.entries()) {
|
||||
if (compare(key, value)) {
|
||||
++existing.allowed;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
map.set(value, { allowed: 1, hits: 0 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Lookup values
|
||||
|
||||
let hits = 0;
|
||||
for (const item of ref) {
|
||||
let match;
|
||||
if (!options.deep ||
|
||||
!item ||
|
||||
typeof item !== 'object') {
|
||||
|
||||
match = map.get(item);
|
||||
}
|
||||
else {
|
||||
compare = compare || internals.compare(options);
|
||||
|
||||
for (const [key, existing] of map.entries()) {
|
||||
if (compare(key, item)) {
|
||||
match = existing;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
++match.hits;
|
||||
++hits;
|
||||
|
||||
if (options.once &&
|
||||
match.hits > match.allowed) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validate results
|
||||
|
||||
if (options.only &&
|
||||
hits !== ref.length) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const match of map.values()) {
|
||||
if (match.hits === match.allowed) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (match.hits < match.allowed &&
|
||||
!options.part) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !!hits;
|
||||
};
|
||||
|
||||
|
||||
internals.object = function (ref, values, options) {
|
||||
|
||||
Assert(options.once === undefined, 'Cannot use option once with object');
|
||||
|
||||
const keys = Utils.keys(ref, options);
|
||||
if (!keys.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Keys list
|
||||
|
||||
if (Array.isArray(values)) {
|
||||
return internals.array(keys, values, options);
|
||||
}
|
||||
|
||||
// Key value pairs
|
||||
|
||||
const symbols = Object.getOwnPropertySymbols(values).filter((sym) => values.propertyIsEnumerable(sym));
|
||||
const targets = [...Object.keys(values), ...symbols];
|
||||
|
||||
const compare = internals.compare(options);
|
||||
const set = new Set(targets);
|
||||
|
||||
for (const key of keys) {
|
||||
if (!set.has(key)) {
|
||||
if (options.only) {
|
||||
return false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!compare(values[key], ref[key])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
set.delete(key);
|
||||
}
|
||||
|
||||
if (set.size) {
|
||||
return options.part ? set.size < targets.length : false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
internals.string = function (ref, values, options) {
|
||||
|
||||
// Empty string
|
||||
|
||||
if (ref === '') {
|
||||
return values.length === 1 && values[0] === '' || // '' contains ''
|
||||
!options.once && !values.some((v) => v !== ''); // '' contains multiple '' if !once
|
||||
}
|
||||
|
||||
// Map values
|
||||
|
||||
const map = new Map();
|
||||
const patterns = [];
|
||||
|
||||
for (const value of values) {
|
||||
Assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
|
||||
|
||||
if (value) {
|
||||
const existing = map.get(value);
|
||||
if (existing) {
|
||||
++existing.allowed;
|
||||
}
|
||||
else {
|
||||
map.set(value, { allowed: 1, hits: 0 });
|
||||
patterns.push(EscapeRegex(value));
|
||||
}
|
||||
}
|
||||
else if (options.once ||
|
||||
options.only) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!patterns.length) { // Non-empty string contains unlimited empty string
|
||||
return true;
|
||||
}
|
||||
|
||||
// Match patterns
|
||||
|
||||
const regex = new RegExp(`(${patterns.join('|')})`, 'g');
|
||||
const leftovers = ref.replace(regex, ($0, $1) => {
|
||||
|
||||
++map.get($1).hits;
|
||||
return ''; // Remove from string
|
||||
});
|
||||
|
||||
// Validate results
|
||||
|
||||
if (options.only &&
|
||||
leftovers) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let any = false;
|
||||
for (const match of map.values()) {
|
||||
if (match.hits) {
|
||||
any = true;
|
||||
}
|
||||
|
||||
if (match.hits === match.allowed) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (match.hits < match.allowed &&
|
||||
!options.part) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// match.hits > match.allowed
|
||||
|
||||
if (options.once) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !!any;
|
||||
};
|
||||
|
||||
|
||||
internals.compare = function (options) {
|
||||
|
||||
if (!options.deep) {
|
||||
return internals.shallow;
|
||||
}
|
||||
|
||||
const hasOnly = options.only !== undefined;
|
||||
const hasPart = options.part !== undefined;
|
||||
|
||||
const flags = {
|
||||
prototype: hasOnly ? options.only : hasPart ? !options.part : false,
|
||||
part: hasOnly ? !options.only : hasPart ? options.part : false
|
||||
};
|
||||
|
||||
return (a, b) => DeepEqual(a, b, flags);
|
||||
};
|
||||
|
||||
|
||||
internals.shallow = function (a, b) {
|
||||
|
||||
return a === b;
|
||||
};
|
317
node_modules/@hapi/hoek/lib/deepEqual.js
generated
vendored
Normal file
317
node_modules/@hapi/hoek/lib/deepEqual.js
generated
vendored
Normal file
|
@ -0,0 +1,317 @@
|
|||
'use strict';
|
||||
|
||||
const Types = require('./types');
|
||||
|
||||
|
||||
const internals = {
|
||||
mismatched: null
|
||||
};
|
||||
|
||||
|
||||
module.exports = function (obj, ref, options) {
|
||||
|
||||
options = Object.assign({ prototype: true }, options);
|
||||
|
||||
return !!internals.isDeepEqual(obj, ref, options, []);
|
||||
};
|
||||
|
||||
|
||||
internals.isDeepEqual = function (obj, ref, options, seen) {
|
||||
|
||||
if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
|
||||
return obj !== 0 || 1 / obj === 1 / ref;
|
||||
}
|
||||
|
||||
const type = typeof obj;
|
||||
|
||||
if (type !== typeof ref) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj === null ||
|
||||
ref === null) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'function') {
|
||||
if (!options.deepFunction ||
|
||||
obj.toString() !== ref.toString()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Continue as object
|
||||
}
|
||||
else if (type !== 'object') {
|
||||
return obj !== obj && ref !== ref; // NaN
|
||||
}
|
||||
|
||||
const instanceType = internals.getSharedType(obj, ref, !!options.prototype);
|
||||
switch (instanceType) {
|
||||
case Types.buffer:
|
||||
return Buffer && Buffer.prototype.equals.call(obj, ref); // $lab:coverage:ignore$
|
||||
case Types.promise:
|
||||
return obj === ref;
|
||||
case Types.regex:
|
||||
return obj.toString() === ref.toString();
|
||||
case internals.mismatched:
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = seen.length - 1; i >= 0; --i) {
|
||||
if (seen[i].isSame(obj, ref)) {
|
||||
return true; // If previous comparison failed, it would have stopped execution
|
||||
}
|
||||
}
|
||||
|
||||
seen.push(new internals.SeenEntry(obj, ref));
|
||||
|
||||
try {
|
||||
return !!internals.isDeepEqualObj(instanceType, obj, ref, options, seen);
|
||||
}
|
||||
finally {
|
||||
seen.pop();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.getSharedType = function (obj, ref, checkPrototype) {
|
||||
|
||||
if (checkPrototype) {
|
||||
if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
|
||||
return internals.mismatched;
|
||||
}
|
||||
|
||||
return Types.getInternalProto(obj);
|
||||
}
|
||||
|
||||
const type = Types.getInternalProto(obj);
|
||||
if (type !== Types.getInternalProto(ref)) {
|
||||
return internals.mismatched;
|
||||
}
|
||||
|
||||
return type;
|
||||
};
|
||||
|
||||
|
||||
internals.valueOf = function (obj) {
|
||||
|
||||
const objValueOf = obj.valueOf;
|
||||
if (objValueOf === undefined) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
try {
|
||||
return objValueOf.call(obj);
|
||||
}
|
||||
catch (err) {
|
||||
return err;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
internals.hasOwnEnumerableProperty = function (obj, key) {
|
||||
|
||||
return Object.prototype.propertyIsEnumerable.call(obj, key);
|
||||
};
|
||||
|
||||
|
||||
internals.isSetSimpleEqual = function (obj, ref) {
|
||||
|
||||
for (const entry of Set.prototype.values.call(obj)) {
|
||||
if (!Set.prototype.has.call(ref, entry)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
internals.isDeepEqualObj = function (instanceType, obj, ref, options, seen) {
|
||||
|
||||
const { isDeepEqual, valueOf, hasOwnEnumerableProperty } = internals;
|
||||
const { keys, getOwnPropertySymbols } = Object;
|
||||
|
||||
if (instanceType === Types.array) {
|
||||
if (options.part) {
|
||||
|
||||
// Check if any index match any other index
|
||||
|
||||
for (const objValue of obj) {
|
||||
for (const refValue of ref) {
|
||||
if (isDeepEqual(objValue, refValue, options, seen)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (obj.length !== ref.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < obj.length; ++i) {
|
||||
if (!isDeepEqual(obj[i], ref[i], options, seen)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (instanceType === Types.set) {
|
||||
if (obj.size !== ref.size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!internals.isSetSimpleEqual(obj, ref)) {
|
||||
|
||||
// Check for deep equality
|
||||
|
||||
const ref2 = new Set(Set.prototype.values.call(ref));
|
||||
for (const objEntry of Set.prototype.values.call(obj)) {
|
||||
if (ref2.delete(objEntry)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let found = false;
|
||||
for (const refEntry of ref2) {
|
||||
if (isDeepEqual(objEntry, refEntry, options, seen)) {
|
||||
ref2.delete(refEntry);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (instanceType === Types.map) {
|
||||
if (obj.size !== ref.size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const [key, value] of Map.prototype.entries.call(obj)) {
|
||||
if (value === undefined && !Map.prototype.has.call(ref, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isDeepEqual(value, Map.prototype.get.call(ref, key), options, seen)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (instanceType === Types.error) {
|
||||
|
||||
// Always check name and message
|
||||
|
||||
if (obj.name !== ref.name ||
|
||||
obj.message !== ref.message) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check .valueOf()
|
||||
|
||||
const valueOfObj = valueOf(obj);
|
||||
const valueOfRef = valueOf(ref);
|
||||
if ((obj !== valueOfObj || ref !== valueOfRef) &&
|
||||
!isDeepEqual(valueOfObj, valueOfRef, options, seen)) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check properties
|
||||
|
||||
const objKeys = keys(obj);
|
||||
if (!options.part &&
|
||||
objKeys.length !== keys(ref).length &&
|
||||
!options.skip) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let skipped = 0;
|
||||
for (const key of objKeys) {
|
||||
if (options.skip &&
|
||||
options.skip.includes(key)) {
|
||||
|
||||
if (ref[key] === undefined) {
|
||||
++skipped;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hasOwnEnumerableProperty(ref, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isDeepEqual(obj[key], ref[key], options, seen)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!options.part &&
|
||||
objKeys.length - skipped !== keys(ref).length) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check symbols
|
||||
|
||||
if (options.symbols !== false) { // Defaults to true
|
||||
const objSymbols = getOwnPropertySymbols(obj);
|
||||
const refSymbols = new Set(getOwnPropertySymbols(ref));
|
||||
|
||||
for (const key of objSymbols) {
|
||||
if (!options.skip ||
|
||||
!options.skip.includes(key)) {
|
||||
|
||||
if (hasOwnEnumerableProperty(obj, key)) {
|
||||
if (!hasOwnEnumerableProperty(ref, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isDeepEqual(obj[key], ref[key], options, seen)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (hasOwnEnumerableProperty(ref, key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
refSymbols.delete(key);
|
||||
}
|
||||
|
||||
for (const key of refSymbols) {
|
||||
if (hasOwnEnumerableProperty(ref, key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
internals.SeenEntry = class {
|
||||
|
||||
constructor(obj, ref) {
|
||||
|
||||
this.obj = obj;
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
isSame(obj, ref) {
|
||||
|
||||
return this.obj === obj && this.ref === ref;
|
||||
}
|
||||
};
|
26
node_modules/@hapi/hoek/lib/error.js
generated
vendored
Normal file
26
node_modules/@hapi/hoek/lib/error.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
const Stringify = require('./stringify');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = class extends Error {
|
||||
|
||||
constructor(args) {
|
||||
|
||||
const msgs = args
|
||||
.filter((arg) => arg !== '')
|
||||
.map((arg) => {
|
||||
|
||||
return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : Stringify(arg);
|
||||
});
|
||||
|
||||
super(msgs.join(' ') || 'Unknown error');
|
||||
|
||||
if (typeof Error.captureStackTrace === 'function') { // $lab:coverage:ignore$
|
||||
Error.captureStackTrace(this, exports.assert);
|
||||
}
|
||||
}
|
||||
};
|
16
node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js
generated
vendored
Normal file
16
node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const Assert = require('./assert');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (attribute) {
|
||||
|
||||
// Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
|
||||
|
||||
Assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
|
||||
|
||||
return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
|
||||
};
|
87
node_modules/@hapi/hoek/lib/escapeHtml.js
generated
vendored
Normal file
87
node_modules/@hapi/hoek/lib/escapeHtml.js
generated
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (input) {
|
||||
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let escaped = '';
|
||||
|
||||
for (let i = 0; i < input.length; ++i) {
|
||||
|
||||
const charCode = input.charCodeAt(i);
|
||||
|
||||
if (internals.isSafe(charCode)) {
|
||||
escaped += input[i];
|
||||
}
|
||||
else {
|
||||
escaped += internals.escapeHtmlChar(charCode);
|
||||
}
|
||||
}
|
||||
|
||||
return escaped;
|
||||
};
|
||||
|
||||
|
||||
internals.escapeHtmlChar = function (charCode) {
|
||||
|
||||
const namedEscape = internals.namedHtml[charCode];
|
||||
if (typeof namedEscape !== 'undefined') {
|
||||
return namedEscape;
|
||||
}
|
||||
|
||||
if (charCode >= 256) {
|
||||
return '&#' + charCode + ';';
|
||||
}
|
||||
|
||||
const hexValue = charCode.toString(16).padStart(2, '0');
|
||||
return `&#x${hexValue};`;
|
||||
};
|
||||
|
||||
|
||||
internals.isSafe = function (charCode) {
|
||||
|
||||
return (typeof internals.safeCharCodes[charCode] !== 'undefined');
|
||||
};
|
||||
|
||||
|
||||
internals.namedHtml = {
|
||||
'38': '&',
|
||||
'60': '<',
|
||||
'62': '>',
|
||||
'34': '"',
|
||||
'160': ' ',
|
||||
'162': '¢',
|
||||
'163': '£',
|
||||
'164': '¤',
|
||||
'169': '©',
|
||||
'174': '®'
|
||||
};
|
||||
|
||||
|
||||
internals.safeCharCodes = (function () {
|
||||
|
||||
const safe = {};
|
||||
|
||||
for (let i = 32; i < 123; ++i) {
|
||||
|
||||
if ((i >= 97) || // a-z
|
||||
(i >= 65 && i <= 90) || // A-Z
|
||||
(i >= 48 && i <= 57) || // 0-9
|
||||
i === 32 || // space
|
||||
i === 46 || // .
|
||||
i === 44 || // ,
|
||||
i === 45 || // -
|
||||
i === 58 || // :
|
||||
i === 95) { // _
|
||||
|
||||
safe[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return safe;
|
||||
}());
|
41
node_modules/@hapi/hoek/lib/escapeJson.js
generated
vendored
Normal file
41
node_modules/@hapi/hoek/lib/escapeJson.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (input) {
|
||||
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const lessThan = 0x3C;
|
||||
const greaterThan = 0x3E;
|
||||
const andSymbol = 0x26;
|
||||
const lineSeperator = 0x2028;
|
||||
|
||||
// replace method
|
||||
let charCode;
|
||||
return input.replace(/[<>&\u2028\u2029]/g, (match) => {
|
||||
|
||||
charCode = match.charCodeAt(0);
|
||||
|
||||
if (charCode === lessThan) {
|
||||
return '\\u003c';
|
||||
}
|
||||
|
||||
if (charCode === greaterThan) {
|
||||
return '\\u003e';
|
||||
}
|
||||
|
||||
if (charCode === andSymbol) {
|
||||
return '\\u0026';
|
||||
}
|
||||
|
||||
if (charCode === lineSeperator) {
|
||||
return '\\u2028';
|
||||
}
|
||||
|
||||
return '\\u2029';
|
||||
});
|
||||
};
|
11
node_modules/@hapi/hoek/lib/escapeRegex.js
generated
vendored
Normal file
11
node_modules/@hapi/hoek/lib/escapeRegex.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (string) {
|
||||
|
||||
// Escape ^$.*+-?=!:|\/()[]{},
|
||||
|
||||
return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
|
||||
};
|
20
node_modules/@hapi/hoek/lib/flatten.js
generated
vendored
Normal file
20
node_modules/@hapi/hoek/lib/flatten.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = internals.flatten = function (array, target) {
|
||||
|
||||
const result = target || [];
|
||||
|
||||
for (let i = 0; i < array.length; ++i) {
|
||||
if (Array.isArray(array[i])) {
|
||||
internals.flatten(array[i], result);
|
||||
}
|
||||
else {
|
||||
result.push(array[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
6
node_modules/@hapi/hoek/lib/ignore.js
generated
vendored
Normal file
6
node_modules/@hapi/hoek/lib/ignore.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function () { };
|
471
node_modules/@hapi/hoek/lib/index.d.ts
generated
vendored
Normal file
471
node_modules/@hapi/hoek/lib/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,471 @@
|
|||
/// <reference types="node" />
|
||||
|
||||
|
||||
/**
|
||||
* Performs a deep comparison of the two values including support for circular dependencies, prototype, and enumerable properties.
|
||||
*
|
||||
* @param obj - The value being compared.
|
||||
* @param ref - The reference value used for comparison.
|
||||
*
|
||||
* @return true when the two values are equal, otherwise false.
|
||||
*/
|
||||
export function deepEqual(obj: any, ref: any, options?: deepEqual.Options): boolean;
|
||||
|
||||
export namespace deepEqual {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* Compare functions with difference references by comparing their internal code and properties.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly deepFunction?: boolean;
|
||||
|
||||
/**
|
||||
* Allow partial match.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly part?: boolean;
|
||||
|
||||
/**
|
||||
* Compare the objects' prototypes.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly prototype?: boolean;
|
||||
|
||||
/**
|
||||
* List of object keys to ignore different values of.
|
||||
*
|
||||
* @default null
|
||||
*/
|
||||
readonly skip?: (string | symbol)[];
|
||||
|
||||
/**
|
||||
* Compare symbol properties.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly symbols?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clone any value, object, or array.
|
||||
*
|
||||
* @param obj - The value being cloned.
|
||||
* @param options - Optional settings.
|
||||
*
|
||||
* @returns A deep clone of `obj`.
|
||||
*/
|
||||
export function clone<T>(obj: T, options?: clone.Options): T;
|
||||
|
||||
export namespace clone {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* Clone the object's prototype.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly prototype?: boolean;
|
||||
|
||||
/**
|
||||
* Include symbol properties.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly symbols?: boolean;
|
||||
|
||||
/**
|
||||
* Shallow clone the specified keys.
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
readonly shallow?: string[] | string[][] | boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Merge all the properties of source into target.
|
||||
*
|
||||
* @param target - The object being modified.
|
||||
* @param source - The object used to copy properties from.
|
||||
* @param options - Optional settings.
|
||||
*
|
||||
* @returns The `target` object.
|
||||
*/
|
||||
export function merge<T1 extends object, T2 extends object>(target: T1, source: T2, options?: merge.Options): T1 & T2;
|
||||
|
||||
export namespace merge {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* When true, null value from `source` overrides existing value in `target`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly nullOverride?: boolean;
|
||||
|
||||
/**
|
||||
* When true, array value from `source` is merged with the existing value in `target`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly mergeArrays?: boolean;
|
||||
|
||||
/**
|
||||
* Compare symbol properties.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly symbols?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Apply source to a copy of the defaults.
|
||||
*
|
||||
* @param defaults - An object with the default values to use of `options` does not contain the same keys.
|
||||
* @param source - The source used to override the `defaults`.
|
||||
* @param options - Optional settings.
|
||||
*
|
||||
* @returns A copy of `defaults` with `source` keys overriding any conflicts.
|
||||
*/
|
||||
export function applyToDefaults<T extends object>(defaults: Partial<T>, source: Partial<T> | boolean | null, options?: applyToDefaults.Options): Partial<T>;
|
||||
|
||||
export namespace applyToDefaults {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* When true, null value from `source` overrides existing value in `target`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly nullOverride?: boolean;
|
||||
|
||||
/**
|
||||
* Shallow clone the specified keys.
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
readonly shallow?: string[] | string[][];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find the common unique items in two arrays.
|
||||
*
|
||||
* @param array1 - The first array to compare.
|
||||
* @param array2 - The second array to compare.
|
||||
* @param options - Optional settings.
|
||||
*
|
||||
* @return - An array of the common items. If `justFirst` is true, returns the first common item.
|
||||
*/
|
||||
export function intersect<T1, T2>(array1: intersect.Array<T1>, array2: intersect.Array<T2>, options?: intersect.Options): Array<T1 | T2>;
|
||||
export function intersect<T1, T2>(array1: intersect.Array<T1>, array2: intersect.Array<T2>, options?: intersect.Options): T1 | T2;
|
||||
|
||||
export namespace intersect {
|
||||
|
||||
type Array<T> = ArrayLike<T> | Set<T> | null;
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* When true, return the first overlapping value.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly first?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the reference value contains the provided values.
|
||||
*
|
||||
* @param ref - The reference string, array, or object.
|
||||
* @param values - A single or array of values to find within `ref`. If `ref` is an object, `values` can be a key name, an array of key names, or an object with key-value pairs to compare.
|
||||
*
|
||||
* @return true if the value contains the provided values, otherwise false.
|
||||
*/
|
||||
export function contain(ref: string, values: string | string[], options?: contain.Options): boolean;
|
||||
export function contain(ref: any[], values: any, options?: contain.Options): boolean;
|
||||
export function contain(ref: object, values: string | string[] | object, options?: Omit<contain.Options, 'once'>): boolean;
|
||||
|
||||
export namespace contain {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* Perform a deep comparison.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly deep?: boolean;
|
||||
|
||||
/**
|
||||
* Allow only one occurrence of each value.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly once?: boolean;
|
||||
|
||||
/**
|
||||
* Allow only values explicitly listed.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly only?: boolean;
|
||||
|
||||
/**
|
||||
* Allow partial match.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly part?: boolean;
|
||||
|
||||
/**
|
||||
* Include symbol properties.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly symbols?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flatten an array with sub arrays
|
||||
*
|
||||
* @param array - an array of items or other arrays to flatten.
|
||||
* @param target - if provided, an array to shallow copy the flattened `array` items to
|
||||
*
|
||||
* @return a flat array of the provided values (appended to `target` is provided).
|
||||
*/
|
||||
export function flatten<T>(array: ArrayLike<T | ReadonlyArray<T>>, target?: ArrayLike<T | ReadonlyArray<T>>): T[];
|
||||
|
||||
|
||||
/**
|
||||
* Convert an object key chain string to reference.
|
||||
*
|
||||
* @param obj - the object from which to look up the value.
|
||||
* @param chain - the string path of the requested value. The chain string is split into key names using `options.separator`, or an array containing each individual key name. A chain including negative numbers will work like a negative index on an array.
|
||||
*
|
||||
* @return The value referenced by the chain if found, otherwise undefined. If chain is null, undefined, or false, the object itself will be returned.
|
||||
*/
|
||||
export function reach(obj: object | null, chain: string | (string | number)[] | false | null | undefined, options?: reach.Options): any;
|
||||
|
||||
export namespace reach {
|
||||
|
||||
interface Options {
|
||||
|
||||
/**
|
||||
* String to split chain path on. Defaults to '.'.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly separator?: string;
|
||||
|
||||
/**
|
||||
* Value to return if the path or value is not present. No default value.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly default?: any;
|
||||
|
||||
/**
|
||||
* If true, will throw an error on missing member in the chain. Default to false.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly strict?: boolean;
|
||||
|
||||
/**
|
||||
* If true, allows traversing functions for properties. false will throw an error if a function is part of the chain.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly functions?: boolean;
|
||||
|
||||
/**
|
||||
* If true, allows traversing Set and Map objects for properties. false will return undefined regardless of the Set or Map passed.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly iterables?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace string parameters (using format "{path.to.key}") with their corresponding object key values using `Hoek.reach()`.
|
||||
*
|
||||
* @param obj - the object from which to look up the value.
|
||||
* @param template - the string containing {} enclosed key paths to be replaced.
|
||||
*
|
||||
* @return The template string with the {} enclosed keys replaced with looked-up values.
|
||||
*/
|
||||
export function reachTemplate(obj: object | null, template: string, options?: reach.Options): string;
|
||||
|
||||
|
||||
/**
|
||||
* Throw an error if condition is falsy.
|
||||
*
|
||||
* @param condition - If `condition` is not truthy, an exception is thrown.
|
||||
* @param error - The error thrown if the condition fails.
|
||||
*
|
||||
* @return Does not return a value but throws if the `condition` is falsy.
|
||||
*/
|
||||
export function assert(condition: any, error: Error): void;
|
||||
|
||||
|
||||
/**
|
||||
* Throw an error if condition is falsy.
|
||||
*
|
||||
* @param condition - If `condition` is not truthy, an exception is thrown.
|
||||
* @param args - Any number of values, concatenated together (space separated) to create the error message.
|
||||
*
|
||||
* @return Does not return a value but throws if the `condition` is falsy.
|
||||
*/
|
||||
export function assert(condition: any, ...args: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* A benchmarking timer, using the internal node clock for maximum accuracy.
|
||||
*/
|
||||
export class Bench {
|
||||
|
||||
constructor();
|
||||
|
||||
/** The starting timestamp expressed in the number of milliseconds since the epoch. */
|
||||
ts: number;
|
||||
|
||||
/** The time in milliseconds since the object was created. */
|
||||
elapsed(): number;
|
||||
|
||||
/** Reset the `ts` value to now. */
|
||||
reset(): void;
|
||||
|
||||
/** The current time in milliseconds since the epoch. */
|
||||
static now(): number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Escape string for Regex construction by prefixing all reserved characters with a backslash.
|
||||
*
|
||||
* @param string - The string to be escaped.
|
||||
*
|
||||
* @return The escaped string.
|
||||
*/
|
||||
export function escapeRegex(string: string): string;
|
||||
|
||||
|
||||
/**
|
||||
* Escape string for usage as an attribute value in HTTP headers.
|
||||
*
|
||||
* @param attribute - The string to be escaped.
|
||||
*
|
||||
* @return The escaped string. Will throw on invalid characters that are not supported to be escaped.
|
||||
*/
|
||||
export function escapeHeaderAttribute(attribute: string): string;
|
||||
|
||||
|
||||
/**
|
||||
* Escape string for usage in HTML.
|
||||
*
|
||||
* @param string - The string to be escaped.
|
||||
*
|
||||
* @return The escaped string.
|
||||
*/
|
||||
export function escapeHtml(string: string): string;
|
||||
|
||||
|
||||
/**
|
||||
* Escape string for usage in JSON.
|
||||
*
|
||||
* @param string - The string to be escaped.
|
||||
*
|
||||
* @return The escaped string.
|
||||
*/
|
||||
export function escapeJson(string: string): string;
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a function to ensure it can only execute once.
|
||||
*
|
||||
* @param method - The function to be wrapped.
|
||||
*
|
||||
* @return The wrapped function.
|
||||
*/
|
||||
export function once<T extends Function>(method: T): T;
|
||||
|
||||
|
||||
/**
|
||||
* A reusable no-op function.
|
||||
*/
|
||||
export function ignore(...ignore: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string with protection against thrown errors.
|
||||
*
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer The JSON.stringify() `replacer` argument.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*
|
||||
* @return The JSON string. If the operation fails, an error string value is returned (no exception thrown).
|
||||
*/
|
||||
export function stringify(value: any, replacer?: any, space?: string | number): string;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a Promise that resolves after the requested timeout.
|
||||
*
|
||||
* @param timeout - The number of milliseconds to wait before resolving the Promise.
|
||||
* @param returnValue - The value that the Promise will resolve to.
|
||||
*
|
||||
* @return A Promise that resolves with `returnValue`.
|
||||
*/
|
||||
export function wait<T>(timeout?: number, returnValue?: T): Promise<T>;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a Promise that never resolves.
|
||||
*/
|
||||
export function block(): Promise<void>;
|
||||
|
||||
|
||||
/**
|
||||
* Determines if an object is a promise.
|
||||
*
|
||||
* @param promise - the object tested.
|
||||
*
|
||||
* @returns true if the object is a promise, otherwise false.
|
||||
*/
|
||||
export function isPromise(promise: any): boolean;
|
||||
|
||||
|
||||
export namespace ts {
|
||||
|
||||
/**
|
||||
* Defines a type that can must be one of T or U but not both.
|
||||
*/
|
||||
type XOR<T, U> = (T | U) extends object ? (internals.Without<T, U> & U) | (internals.Without<U, T> & T) : T | U;
|
||||
}
|
||||
|
||||
|
||||
declare namespace internals {
|
||||
|
||||
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
||||
}
|
45
node_modules/@hapi/hoek/lib/index.js
generated
vendored
Normal file
45
node_modules/@hapi/hoek/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
'use strict';
|
||||
|
||||
exports.applyToDefaults = require('./applyToDefaults');
|
||||
|
||||
exports.assert = require('./assert');
|
||||
|
||||
exports.Bench = require('./bench');
|
||||
|
||||
exports.block = require('./block');
|
||||
|
||||
exports.clone = require('./clone');
|
||||
|
||||
exports.contain = require('./contain');
|
||||
|
||||
exports.deepEqual = require('./deepEqual');
|
||||
|
||||
exports.Error = require('./error');
|
||||
|
||||
exports.escapeHeaderAttribute = require('./escapeHeaderAttribute');
|
||||
|
||||
exports.escapeHtml = require('./escapeHtml');
|
||||
|
||||
exports.escapeJson = require('./escapeJson');
|
||||
|
||||
exports.escapeRegex = require('./escapeRegex');
|
||||
|
||||
exports.flatten = require('./flatten');
|
||||
|
||||
exports.ignore = require('./ignore');
|
||||
|
||||
exports.intersect = require('./intersect');
|
||||
|
||||
exports.isPromise = require('./isPromise');
|
||||
|
||||
exports.merge = require('./merge');
|
||||
|
||||
exports.once = require('./once');
|
||||
|
||||
exports.reach = require('./reach');
|
||||
|
||||
exports.reachTemplate = require('./reachTemplate');
|
||||
|
||||
exports.stringify = require('./stringify');
|
||||
|
||||
exports.wait = require('./wait');
|
41
node_modules/@hapi/hoek/lib/intersect.js
generated
vendored
Normal file
41
node_modules/@hapi/hoek/lib/intersect.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (array1, array2, options = {}) {
|
||||
|
||||
if (!array1 ||
|
||||
!array2) {
|
||||
|
||||
return (options.first ? null : []);
|
||||
}
|
||||
|
||||
const common = [];
|
||||
const hash = (Array.isArray(array1) ? new Set(array1) : array1);
|
||||
const found = new Set();
|
||||
for (const value of array2) {
|
||||
if (internals.has(hash, value) &&
|
||||
!found.has(value)) {
|
||||
|
||||
if (options.first) {
|
||||
return value;
|
||||
}
|
||||
|
||||
common.push(value);
|
||||
found.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
return (options.first ? null : common);
|
||||
};
|
||||
|
||||
|
||||
internals.has = function (ref, key) {
|
||||
|
||||
if (typeof ref.has === 'function') {
|
||||
return ref.has(key);
|
||||
}
|
||||
|
||||
return ref[key] !== undefined;
|
||||
};
|
9
node_modules/@hapi/hoek/lib/isPromise.js
generated
vendored
Normal file
9
node_modules/@hapi/hoek/lib/isPromise.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (promise) {
|
||||
|
||||
return !!promise && typeof promise.then === 'function';
|
||||
};
|
78
node_modules/@hapi/hoek/lib/merge.js
generated
vendored
Normal file
78
node_modules/@hapi/hoek/lib/merge.js
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
'use strict';
|
||||
|
||||
const Assert = require('./assert');
|
||||
const Clone = require('./clone');
|
||||
const Utils = require('./utils');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = internals.merge = function (target, source, options) {
|
||||
|
||||
Assert(target && typeof target === 'object', 'Invalid target value: must be an object');
|
||||
Assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
|
||||
|
||||
if (!source) {
|
||||
return target;
|
||||
}
|
||||
|
||||
options = Object.assign({ nullOverride: true, mergeArrays: true }, options);
|
||||
|
||||
if (Array.isArray(source)) {
|
||||
Assert(Array.isArray(target), 'Cannot merge array onto an object');
|
||||
if (!options.mergeArrays) {
|
||||
target.length = 0; // Must not change target assignment
|
||||
}
|
||||
|
||||
for (let i = 0; i < source.length; ++i) {
|
||||
target.push(Clone(source[i], { symbols: options.symbols }));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
const keys = Utils.keys(source, options);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
const key = keys[i];
|
||||
if (key === '__proto__' ||
|
||||
!Object.prototype.propertyIsEnumerable.call(source, key)) {
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
const value = source[key];
|
||||
if (value &&
|
||||
typeof value === 'object') {
|
||||
|
||||
if (target[key] === value) {
|
||||
continue; // Can occur for shallow merges
|
||||
}
|
||||
|
||||
if (!target[key] ||
|
||||
typeof target[key] !== 'object' ||
|
||||
(Array.isArray(target[key]) !== Array.isArray(value)) ||
|
||||
value instanceof Date ||
|
||||
(Buffer && Buffer.isBuffer(value)) || // $lab:coverage:ignore$
|
||||
value instanceof RegExp) {
|
||||
|
||||
target[key] = Clone(value, { symbols: options.symbols });
|
||||
}
|
||||
else {
|
||||
internals.merge(target[key], value, options);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (value !== null &&
|
||||
value !== undefined) { // Explicit to preserve empty strings
|
||||
|
||||
target[key] = value;
|
||||
}
|
||||
else if (options.nullOverride) {
|
||||
target[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
23
node_modules/@hapi/hoek/lib/once.js
generated
vendored
Normal file
23
node_modules/@hapi/hoek/lib/once.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (method) {
|
||||
|
||||
if (method._hoekOnce) {
|
||||
return method;
|
||||
}
|
||||
|
||||
let once = false;
|
||||
const wrapped = function (...args) {
|
||||
|
||||
if (!once) {
|
||||
once = true;
|
||||
method(...args);
|
||||
}
|
||||
};
|
||||
|
||||
wrapped._hoekOnce = true;
|
||||
return wrapped;
|
||||
};
|
76
node_modules/@hapi/hoek/lib/reach.js
generated
vendored
Normal file
76
node_modules/@hapi/hoek/lib/reach.js
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
'use strict';
|
||||
|
||||
const Assert = require('./assert');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (obj, chain, options) {
|
||||
|
||||
if (chain === false ||
|
||||
chain === null ||
|
||||
chain === undefined) {
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
if (typeof options === 'string') {
|
||||
options = { separator: options };
|
||||
}
|
||||
|
||||
const isChainArray = Array.isArray(chain);
|
||||
|
||||
Assert(!isChainArray || !options.separator, 'Separator option no valid for array-based chain');
|
||||
|
||||
const path = isChainArray ? chain : chain.split(options.separator || '.');
|
||||
let ref = obj;
|
||||
for (let i = 0; i < path.length; ++i) {
|
||||
let key = path[i];
|
||||
const type = options.iterables && internals.iterables(ref);
|
||||
|
||||
if (Array.isArray(ref) ||
|
||||
type === 'set') {
|
||||
|
||||
const number = Number(key);
|
||||
if (Number.isInteger(number)) {
|
||||
key = number < 0 ? ref.length + number : number;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ref ||
|
||||
typeof ref === 'function' && options.functions === false || // Defaults to true
|
||||
!type && ref[key] === undefined) {
|
||||
|
||||
Assert(!options.strict || i + 1 === path.length, 'Missing segment', key, 'in reach path ', chain);
|
||||
Assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
|
||||
ref = options.default;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!type) {
|
||||
ref = ref[key];
|
||||
}
|
||||
else if (type === 'set') {
|
||||
ref = [...ref][key];
|
||||
}
|
||||
else { // type === 'map'
|
||||
ref = ref.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
return ref;
|
||||
};
|
||||
|
||||
|
||||
internals.iterables = function (ref) {
|
||||
|
||||
if (ref instanceof Set) {
|
||||
return 'set';
|
||||
}
|
||||
|
||||
if (ref instanceof Map) {
|
||||
return 'map';
|
||||
}
|
||||
};
|
16
node_modules/@hapi/hoek/lib/reachTemplate.js
generated
vendored
Normal file
16
node_modules/@hapi/hoek/lib/reachTemplate.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const Reach = require('./reach');
|
||||
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (obj, template, options) {
|
||||
|
||||
return template.replace(/{([^{}]+)}/g, ($0, chain) => {
|
||||
|
||||
const value = Reach(obj, chain, options);
|
||||
return (value === undefined || value === null ? '' : value);
|
||||
});
|
||||
};
|
14
node_modules/@hapi/hoek/lib/stringify.js
generated
vendored
Normal file
14
node_modules/@hapi/hoek/lib/stringify.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (...args) {
|
||||
|
||||
try {
|
||||
return JSON.stringify.apply(null, args);
|
||||
}
|
||||
catch (err) {
|
||||
return '[Cannot display object: ' + err.message + ']';
|
||||
}
|
||||
};
|
55
node_modules/@hapi/hoek/lib/types.js
generated
vendored
Normal file
55
node_modules/@hapi/hoek/lib/types.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
exports = module.exports = {
|
||||
array: Array.prototype,
|
||||
buffer: Buffer && Buffer.prototype, // $lab:coverage:ignore$
|
||||
date: Date.prototype,
|
||||
error: Error.prototype,
|
||||
generic: Object.prototype,
|
||||
map: Map.prototype,
|
||||
promise: Promise.prototype,
|
||||
regex: RegExp.prototype,
|
||||
set: Set.prototype,
|
||||
weakMap: WeakMap.prototype,
|
||||
weakSet: WeakSet.prototype
|
||||
};
|
||||
|
||||
|
||||
internals.typeMap = new Map([
|
||||
['[object Error]', exports.error],
|
||||
['[object Map]', exports.map],
|
||||
['[object Promise]', exports.promise],
|
||||
['[object Set]', exports.set],
|
||||
['[object WeakMap]', exports.weakMap],
|
||||
['[object WeakSet]', exports.weakSet]
|
||||
]);
|
||||
|
||||
|
||||
exports.getInternalProto = function (obj) {
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
return exports.array;
|
||||
}
|
||||
|
||||
if (Buffer && obj instanceof Buffer) { // $lab:coverage:ignore$
|
||||
return exports.buffer;
|
||||
}
|
||||
|
||||
if (obj instanceof Date) {
|
||||
return exports.date;
|
||||
}
|
||||
|
||||
if (obj instanceof RegExp) {
|
||||
return exports.regex;
|
||||
}
|
||||
|
||||
if (obj instanceof Error) {
|
||||
return exports.error;
|
||||
}
|
||||
|
||||
const objName = Object.prototype.toString.call(obj);
|
||||
return internals.typeMap.get(objName) || exports.generic;
|
||||
};
|
9
node_modules/@hapi/hoek/lib/utils.js
generated
vendored
Normal file
9
node_modules/@hapi/hoek/lib/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
exports.keys = function (obj, options = {}) {
|
||||
|
||||
return options.symbols !== false ? Reflect.ownKeys(obj) : Object.getOwnPropertyNames(obj); // Defaults to true
|
||||
};
|
13
node_modules/@hapi/hoek/lib/wait.js
generated
vendored
Normal file
13
node_modules/@hapi/hoek/lib/wait.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
const internals = {};
|
||||
|
||||
|
||||
module.exports = function (timeout, returnValue) {
|
||||
|
||||
if (typeof timeout !== 'number' && timeout !== undefined) {
|
||||
throw new TypeError('Timeout must be a number');
|
||||
}
|
||||
|
||||
return new Promise((resolve) => setTimeout(resolve, timeout, returnValue));
|
||||
};
|
64
node_modules/@hapi/hoek/package.json
generated
vendored
Normal file
64
node_modules/@hapi/hoek/package.json
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"_from": "@hapi/hoek@9.x.x",
|
||||
"_id": "@hapi/hoek@9.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==",
|
||||
"_location": "/@hapi/hoek",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@hapi/hoek@9.x.x",
|
||||
"name": "@hapi/hoek",
|
||||
"escapedName": "@hapi%2fhoek",
|
||||
"scope": "@hapi",
|
||||
"rawSpec": "9.x.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "9.x.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@hapi/boom"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
|
||||
"_shasum": "9551142a1980503752536b5050fd99f4a7f13b17",
|
||||
"_spec": "@hapi/hoek@9.x.x",
|
||||
"_where": "G:\\GDrive\\htdocs\\YouPHPTube\\node_modules\\@hapi\\boom",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hapijs/hoek/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "General purpose node utilities",
|
||||
"devDependencies": {
|
||||
"@hapi/code": "8.x.x",
|
||||
"@hapi/eslint-plugin": "*",
|
||||
"@hapi/lab": "^24.0.0",
|
||||
"typescript": "~4.0.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"plugin:@hapi/module"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/hapijs/hoek#readme",
|
||||
"keywords": [
|
||||
"utilities"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "lib/index.js",
|
||||
"name": "@hapi/hoek",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hapijs/hoek.git"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"version": "9.2.1"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue