diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-11-17 23:25:29 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-11-17 23:25:29 +0100 |
commit | 953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch) | |
tree | 8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/addressbook/node_modules/http2-wrapper/source/utils | |
parent | 62a9199846b0c07c03218703b33e8385764f42d9 (diff) | |
download | pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2 pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip |
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/addressbook/node_modules/http2-wrapper/source/utils')
10 files changed, 0 insertions, 291 deletions
diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/calculate-server-name.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/calculate-server-name.js deleted file mode 100644 index a8ba061..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/calculate-server-name.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const {isIP} = require('net'); -const assert = require('assert'); - -const getHost = host => { - if (host[0] === '[') { - const idx = host.indexOf(']'); - - assert(idx !== -1); - return host.slice(1, idx); - } - - const idx = host.indexOf(':'); - if (idx === -1) { - return host; - } - - return host.slice(0, idx); -}; - -module.exports = host => { - const servername = getHost(host); - - if (isIP(servername)) { - return ''; - } - - return servername; -}; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/check-type.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/check-type.js deleted file mode 100644 index ddfefdc..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/check-type.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const checkType = (name, value, types) => { - const valid = types.some(type => { - const typeofType = typeof type; - if (typeofType === 'string') { - return typeof value === type; - } - - return value instanceof type; - }); - - if (!valid) { - const names = types.map(type => typeof type === 'string' ? type : type.name); - - throw new TypeError(`Expected '${name}' to be a type of ${names.join(' or ')}, got ${typeof value}`); - } -}; - -module.exports = checkType; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js deleted file mode 100644 index 53d81cf..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -module.exports = stream => { - if (stream.listenerCount('error') !== 0) { - return stream; - } - - stream.__destroy = stream._destroy; - stream._destroy = (...args) => { - const callback = args.pop(); - - stream.__destroy(...args, async error => { - await Promise.resolve(); - callback(error); - }); - }; - - const onError = error => { - // eslint-disable-next-line promise/prefer-await-to-then - Promise.resolve().then(() => { - stream.emit('error', error); - }); - }; - - stream.once('error', onError); - - // eslint-disable-next-line promise/prefer-await-to-then - Promise.resolve().then(() => { - stream.off('error', onError); - }); - - return stream; -}; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/errors.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/errors.js deleted file mode 100644 index 7be9e6b..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/errors.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -/* istanbul ignore file: https://github.com/nodejs/node/blob/master/lib/internal/errors.js */ - -const makeError = (Base, key, getMessage) => { - module.exports[key] = class NodeError extends Base { - constructor(...args) { - super(typeof getMessage === 'string' ? getMessage : getMessage(args)); - this.name = `${super.name} [${key}]`; - this.code = key; - } - }; -}; - -makeError(TypeError, 'ERR_INVALID_ARG_TYPE', args => { - const type = args[0].includes('.') ? 'property' : 'argument'; - - let valid = args[1]; - const isManyTypes = Array.isArray(valid); - - if (isManyTypes) { - valid = `${valid.slice(0, -1).join(', ')} or ${valid.slice(-1)}`; - } - - return `The "${args[0]}" ${type} must be ${isManyTypes ? 'one of' : 'of'} type ${valid}. Received ${typeof args[2]}`; -}); - -makeError(TypeError, 'ERR_INVALID_PROTOCOL', args => - `Protocol "${args[0]}" not supported. Expected "${args[1]}"` -); - -makeError(Error, 'ERR_HTTP_HEADERS_SENT', args => - `Cannot ${args[0]} headers after they are sent to the client` -); - -makeError(TypeError, 'ERR_INVALID_HTTP_TOKEN', args => - `${args[0]} must be a valid HTTP token [${args[1]}]` -); - -makeError(TypeError, 'ERR_HTTP_INVALID_HEADER_VALUE', args => - `Invalid value "${args[0]} for header "${args[1]}"` -); - -makeError(TypeError, 'ERR_INVALID_CHAR', args => - `Invalid character in ${args[0]} [${args[1]}]` -); - -makeError( - Error, - 'ERR_HTTP2_NO_SOCKET_MANIPULATION', - 'HTTP/2 sockets should not be directly manipulated (e.g. read and written)' -); diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js deleted file mode 100644 index bed31cd..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = header => { - switch (header) { - case ':method': - case ':scheme': - case ':authority': - case ':path': - return true; - default: - return false; - } -}; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/js-stream-socket.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/js-stream-socket.js deleted file mode 100644 index ac22280..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/js-stream-socket.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -const stream = require('stream'); -const tls = require('tls'); - -// Really awesome hack. -const JSStreamSocket = (new tls.TLSSocket(new stream.PassThrough()))._handle._parentWrap.constructor; - -module.exports = JSStreamSocket; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-events.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-events.js deleted file mode 100644 index 35e2ae0..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-events.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = (from, to, events) => { - for (const event of events) { - from.on(event, (...args) => to.emit(event, ...args)); - } -}; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js deleted file mode 100644 index 89a0ac4..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; -const {ERR_HTTP2_NO_SOCKET_MANIPULATION} = require('./errors.js'); - -/* istanbul ignore file */ -/* https://github.com/nodejs/node/blob/6eec858f34a40ffa489c1ec54bb24da72a28c781/lib/internal/http2/compat.js#L195-L272 */ - -const proxySocketHandler = { - has(stream, property) { - // Replaced [kSocket] with .socket - const reference = stream.session === undefined ? stream : stream.session.socket; - return (property in stream) || (property in reference); - }, - - get(stream, property) { - switch (property) { - case 'on': - case 'once': - case 'end': - case 'emit': - case 'destroy': - return stream[property].bind(stream); - case 'writable': - case 'destroyed': - return stream[property]; - case 'readable': - if (stream.destroyed) { - return false; - } - - return stream.readable; - case 'setTimeout': { - const {session} = stream; - if (session !== undefined) { - return session.setTimeout.bind(session); - } - - return stream.setTimeout.bind(stream); - } - - case 'write': - case 'read': - case 'pause': - case 'resume': - throw new ERR_HTTP2_NO_SOCKET_MANIPULATION(); - default: { - // Replaced [kSocket] with .socket - const reference = stream.session === undefined ? stream : stream.session.socket; - const value = reference[property]; - - return typeof value === 'function' ? value.bind(reference) : value; - } - } - }, - - getPrototypeOf(stream) { - if (stream.session !== undefined) { - // Replaced [kSocket] with .socket - return Reflect.getPrototypeOf(stream.session.socket); - } - - return Reflect.getPrototypeOf(stream); - }, - - set(stream, property, value) { - switch (property) { - case 'writable': - case 'readable': - case 'destroyed': - case 'on': - case 'once': - case 'end': - case 'emit': - case 'destroy': - stream[property] = value; - return true; - case 'setTimeout': { - const {session} = stream; - if (session === undefined) { - stream.setTimeout = value; - } else { - session.setTimeout = value; - } - - return true; - } - - case 'write': - case 'read': - case 'pause': - case 'resume': - throw new ERR_HTTP2_NO_SOCKET_MANIPULATION(); - default: { - // Replaced [kSocket] with .socket - const reference = stream.session === undefined ? stream : stream.session.socket; - reference[property] = value; - return true; - } - } - } -}; - -module.exports = proxySocketHandler; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-name.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-name.js deleted file mode 100644 index 82cbc34..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-name.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -const {ERR_INVALID_HTTP_TOKEN} = require('./errors.js'); -const isRequestPseudoHeader = require('./is-request-pseudo-header.js'); - -const isValidHttpToken = /^[\^`\-\w!#$%&*+.|~]+$/; - -module.exports = name => { - if (typeof name !== 'string' || (!isValidHttpToken.test(name) && !isRequestPseudoHeader(name))) { - throw new ERR_INVALID_HTTP_TOKEN('Header name', name); - } -}; diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-value.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-value.js deleted file mode 100644 index 749c985..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/validate-header-value.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -const { - ERR_HTTP_INVALID_HEADER_VALUE, - ERR_INVALID_CHAR -} = require('./errors.js'); - -const isInvalidHeaderValue = /[^\t\u0020-\u007E\u0080-\u00FF]/; - -module.exports = (name, value) => { - if (typeof value === 'undefined') { - throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name); - } - - if (isInvalidHeaderValue.test(value)) { - throw new ERR_INVALID_CHAR('header content', name); - } -}; |