j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..c3972e39f2be5d735a25578c1f9adcc3b26e8068
--- /dev/null
+++ b/node_modules/base64-js/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "base64-js",
+ "description": "Base64 encoding/decoding in pure JS",
+ "version": "1.5.1",
+ "author": "T. Jameson Little ",
+ "typings": "index.d.ts",
+ "bugs": {
+ "url": "https://github.com/beatgammit/base64-js/issues"
+ },
+ "devDependencies": {
+ "babel-minify": "^0.5.1",
+ "benchmark": "^2.1.4",
+ "browserify": "^16.3.0",
+ "standard": "*",
+ "tape": "4.x"
+ },
+ "homepage": "https://github.com/beatgammit/base64-js",
+ "keywords": [
+ "base64"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/beatgammit/base64-js.git"
+ },
+ "scripts": {
+ "build": "browserify -s base64js -r ./ | minify > base64js.min.js",
+ "lint": "standard",
+ "test": "npm run lint && npm run unit",
+ "unit": "tape test/*.js"
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+}
diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..17dd110e87f4d0c20e04326ae3f19e651867a86d
--- /dev/null
+++ b/node_modules/body-parser/HISTORY.md
@@ -0,0 +1,731 @@
+2.2.0 / 2025-03-27
+=========================
+
+* refactor: normalize common options for all parsers
+* deps:
+ * iconv-lite@^0.6.3
+
+2.1.0 / 2025-02-10
+=========================
+
+* deps:
+ * type-is@^2.0.0
+ * debug@^4.4.0
+ * Removed destroy
+* refactor: prefix built-in node module imports
+* use the node require cache instead of custom caching
+
+2.0.2 / 2024-10-31
+=========================
+
+* remove `unpipe` package and use native `unpipe()` method
+
+2.0.1 / 2024-09-10
+=========================
+
+* Restore expected behavior `extended` to `false`
+
+2.0.0 / 2024-09-10
+=========================
+* Propagate changes from 1.20.3
+* add brotli support #406
+* Breaking Change: Node.js 18 is the minimum supported version
+
+2.0.0-beta.2 / 2023-02-23
+=========================
+
+This incorporates all changes after 1.19.1 up to 1.20.2.
+
+ * Remove deprecated `bodyParser()` combination middleware
+ * deps: debug@3.1.0
+ - Add `DEBUG_HIDE_DATE` environment variable
+ - Change timer to per-namespace instead of global
+ - Change non-TTY date format
+ - Remove `DEBUG_FD` environment variable support
+ - Support 256 namespace colors
+ * deps: iconv-lite@0.5.2
+ - Add encoding cp720
+ - Add encoding UTF-32
+ * deps: raw-body@3.0.0-beta.1
+
+2.0.0-beta.1 / 2021-12-17
+=========================
+
+ * Drop support for Node.js 0.8
+ * `req.body` is no longer always initialized to `{}`
+ - it is left `undefined` unless a body is parsed
+ * `urlencoded` parser now defaults `extended` to `false`
+ * Use `on-finished` to determine when body read
+
+1.20.3 / 2024-09-10
+===================
+
+ * deps: qs@6.13.0
+ * add `depth` option to customize the depth level in the parser
+ * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`)
+
+1.20.2 / 2023-02-21
+===================
+
+ * Fix strict json error message on Node.js 19+
+ * deps: content-type@~1.0.5
+ - perf: skip value escaping when unnecessary
+ * deps: raw-body@2.5.2
+
+1.20.1 / 2022-10-06
+===================
+
+ * deps: qs@6.11.0
+ * perf: remove unnecessary object clone
+
+1.20.0 / 2022-04-02
+===================
+
+ * Fix error message for json parse whitespace in `strict`
+ * Fix internal error when inflated body exceeds limit
+ * Prevent loss of async hooks context
+ * Prevent hanging when request already read
+ * deps: depd@2.0.0
+ - Replace internal `eval` usage with `Function` constructor
+ - Use instance methods on `process` to check for listeners
+ * deps: http-errors@2.0.0
+ - deps: depd@2.0.0
+ - deps: statuses@2.0.1
+ * deps: on-finished@2.4.1
+ * deps: qs@6.10.3
+ * deps: raw-body@2.5.1
+ - deps: http-errors@2.0.0
+
+1.19.2 / 2022-02-15
+===================
+
+ * deps: bytes@3.1.2
+ * deps: qs@6.9.7
+ * Fix handling of `__proto__` keys
+ * deps: raw-body@2.4.3
+ - deps: bytes@3.1.2
+
+1.19.1 / 2021-12-10
+===================
+
+ * deps: bytes@3.1.1
+ * deps: http-errors@1.8.1
+ - deps: inherits@2.0.4
+ - deps: toidentifier@1.0.1
+ - deps: setprototypeof@1.2.0
+ * deps: qs@6.9.6
+ * deps: raw-body@2.4.2
+ - deps: bytes@3.1.1
+ - deps: http-errors@1.8.1
+ * deps: safe-buffer@5.2.1
+ * deps: type-is@~1.6.18
+
+1.19.0 / 2019-04-25
+===================
+
+ * deps: bytes@3.1.0
+ - Add petabyte (`pb`) support
+ * deps: http-errors@1.7.2
+ - Set constructor name when possible
+ - deps: setprototypeof@1.1.1
+ - deps: statuses@'>= 1.5.0 < 2'
+ * deps: iconv-lite@0.4.24
+ - Added encoding MIK
+ * deps: qs@6.7.0
+ - Fix parsing array brackets after index
+ * deps: raw-body@2.4.0
+ - deps: bytes@3.1.0
+ - deps: http-errors@1.7.2
+ - deps: iconv-lite@0.4.24
+ * deps: type-is@~1.6.17
+ - deps: mime-types@~2.1.24
+ - perf: prevent internal `throw` on invalid type
+
+1.18.3 / 2018-05-14
+===================
+
+ * Fix stack trace for strict json parse error
+ * deps: depd@~1.1.2
+ - perf: remove argument reassignment
+ * deps: http-errors@~1.6.3
+ - deps: depd@~1.1.2
+ - deps: setprototypeof@1.1.0
+ - deps: statuses@'>= 1.3.1 < 2'
+ * deps: iconv-lite@0.4.23
+ - Fix loading encoding with year appended
+ - Fix deprecation warnings on Node.js 10+
+ * deps: qs@6.5.2
+ * deps: raw-body@2.3.3
+ - deps: http-errors@1.6.3
+ - deps: iconv-lite@0.4.23
+ * deps: type-is@~1.6.16
+ - deps: mime-types@~2.1.18
+
+1.18.2 / 2017-09-22
+===================
+
+ * deps: debug@2.6.9
+ * perf: remove argument reassignment
+
+1.18.1 / 2017-09-12
+===================
+
+ * deps: content-type@~1.0.4
+ - perf: remove argument reassignment
+ - perf: skip parameter parsing when no parameters
+ * deps: iconv-lite@0.4.19
+ - Fix ISO-8859-1 regression
+ - Update Windows-1255
+ * deps: qs@6.5.1
+ - Fix parsing & compacting very deep objects
+ * deps: raw-body@2.3.2
+ - deps: iconv-lite@0.4.19
+
+1.18.0 / 2017-09-08
+===================
+
+ * Fix JSON strict violation error to match native parse error
+ * Include the `body` property on verify errors
+ * Include the `type` property on all generated errors
+ * Use `http-errors` to set status code on errors
+ * deps: bytes@3.0.0
+ * deps: debug@2.6.8
+ * deps: depd@~1.1.1
+ - Remove unnecessary `Buffer` loading
+ * deps: http-errors@~1.6.2
+ - deps: depd@1.1.1
+ * deps: iconv-lite@0.4.18
+ - Add support for React Native
+ - Add a warning if not loaded as utf-8
+ - Fix CESU-8 decoding in Node.js 8
+ - Improve speed of ISO-8859-1 encoding
+ * deps: qs@6.5.0
+ * deps: raw-body@2.3.1
+ - Use `http-errors` for standard emitted errors
+ - deps: bytes@3.0.0
+ - deps: iconv-lite@0.4.18
+ - perf: skip buffer decoding on overage chunk
+ * perf: prevent internal `throw` when missing charset
+
+1.17.2 / 2017-05-17
+===================
+
+ * deps: debug@2.6.7
+ - Fix `DEBUG_MAX_ARRAY_LENGTH`
+ - deps: ms@2.0.0
+ * deps: type-is@~1.6.15
+ - deps: mime-types@~2.1.15
+
+1.17.1 / 2017-03-06
+===================
+
+ * deps: qs@6.4.0
+ - Fix regression parsing keys starting with `[`
+
+1.17.0 / 2017-03-01
+===================
+
+ * deps: http-errors@~1.6.1
+ - Make `message` property enumerable for `HttpError`s
+ - deps: setprototypeof@1.0.3
+ * deps: qs@6.3.1
+ - Fix compacting nested arrays
+
+1.16.1 / 2017-02-10
+===================
+
+ * deps: debug@2.6.1
+ - Fix deprecation messages in WebStorm and other editors
+ - Undeprecate `DEBUG_FD` set to `1` or `2`
+
+1.16.0 / 2017-01-17
+===================
+
+ * deps: debug@2.6.0
+ - Allow colors in workers
+ - Deprecated `DEBUG_FD` environment variable
+ - Fix error when running under React Native
+ - Use same color for same namespace
+ - deps: ms@0.7.2
+ * deps: http-errors@~1.5.1
+ - deps: inherits@2.0.3
+ - deps: setprototypeof@1.0.2
+ - deps: statuses@'>= 1.3.1 < 2'
+ * deps: iconv-lite@0.4.15
+ - Added encoding MS-31J
+ - Added encoding MS-932
+ - Added encoding MS-936
+ - Added encoding MS-949
+ - Added encoding MS-950
+ - Fix GBK/GB18030 handling of Euro character
+ * deps: qs@6.2.1
+ - Fix array parsing from skipping empty values
+ * deps: raw-body@~2.2.0
+ - deps: iconv-lite@0.4.15
+ * deps: type-is@~1.6.14
+ - deps: mime-types@~2.1.13
+
+1.15.2 / 2016-06-19
+===================
+
+ * deps: bytes@2.4.0
+ * deps: content-type@~1.0.2
+ - perf: enable strict mode
+ * deps: http-errors@~1.5.0
+ - Use `setprototypeof` module to replace `__proto__` setting
+ - deps: statuses@'>= 1.3.0 < 2'
+ - perf: enable strict mode
+ * deps: qs@6.2.0
+ * deps: raw-body@~2.1.7
+ - deps: bytes@2.4.0
+ - perf: remove double-cleanup on happy path
+ * deps: type-is@~1.6.13
+ - deps: mime-types@~2.1.11
+
+1.15.1 / 2016-05-05
+===================
+
+ * deps: bytes@2.3.0
+ - Drop partial bytes on all parsed units
+ - Fix parsing byte string that looks like hex
+ * deps: raw-body@~2.1.6
+ - deps: bytes@2.3.0
+ * deps: type-is@~1.6.12
+ - deps: mime-types@~2.1.10
+
+1.15.0 / 2016-02-10
+===================
+
+ * deps: http-errors@~1.4.0
+ - Add `HttpError` export, for `err instanceof createError.HttpError`
+ - deps: inherits@2.0.1
+ - deps: statuses@'>= 1.2.1 < 2'
+ * deps: qs@6.1.0
+ * deps: type-is@~1.6.11
+ - deps: mime-types@~2.1.9
+
+1.14.2 / 2015-12-16
+===================
+
+ * deps: bytes@2.2.0
+ * deps: iconv-lite@0.4.13
+ * deps: qs@5.2.0
+ * deps: raw-body@~2.1.5
+ - deps: bytes@2.2.0
+ - deps: iconv-lite@0.4.13
+ * deps: type-is@~1.6.10
+ - deps: mime-types@~2.1.8
+
+1.14.1 / 2015-09-27
+===================
+
+ * Fix issue where invalid charset results in 400 when `verify` used
+ * deps: iconv-lite@0.4.12
+ - Fix CESU-8 decoding in Node.js 4.x
+ * deps: raw-body@~2.1.4
+ - Fix masking critical errors from `iconv-lite`
+ - deps: iconv-lite@0.4.12
+ * deps: type-is@~1.6.9
+ - deps: mime-types@~2.1.7
+
+1.14.0 / 2015-09-16
+===================
+
+ * Fix JSON strict parse error to match syntax errors
+ * Provide static `require` analysis in `urlencoded` parser
+ * deps: depd@~1.1.0
+ - Support web browser loading
+ * deps: qs@5.1.0
+ * deps: raw-body@~2.1.3
+ - Fix sync callback when attaching data listener causes sync read
+ * deps: type-is@~1.6.8
+ - Fix type error when given invalid type to match against
+ - deps: mime-types@~2.1.6
+
+1.13.3 / 2015-07-31
+===================
+
+ * deps: type-is@~1.6.6
+ - deps: mime-types@~2.1.4
+
+1.13.2 / 2015-07-05
+===================
+
+ * deps: iconv-lite@0.4.11
+ * deps: qs@4.0.0
+ - Fix dropping parameters like `hasOwnProperty`
+ - Fix user-visible incompatibilities from 3.1.0
+ - Fix various parsing edge cases
+ * deps: raw-body@~2.1.2
+ - Fix error stack traces to skip `makeError`
+ - deps: iconv-lite@0.4.11
+ * deps: type-is@~1.6.4
+ - deps: mime-types@~2.1.2
+ - perf: enable strict mode
+ - perf: remove argument reassignment
+
+1.13.1 / 2015-06-16
+===================
+
+ * deps: qs@2.4.2
+ - Downgraded from 3.1.0 because of user-visible incompatibilities
+
+1.13.0 / 2015-06-14
+===================
+
+ * Add `statusCode` property on `Error`s, in addition to `status`
+ * Change `type` default to `application/json` for JSON parser
+ * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser
+ * Provide static `require` analysis
+ * Use the `http-errors` module to generate errors
+ * deps: bytes@2.1.0
+ - Slight optimizations
+ * deps: iconv-lite@0.4.10
+ - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails
+ - Leading BOM is now removed when decoding
+ * deps: on-finished@~2.3.0
+ - Add defined behavior for HTTP `CONNECT` requests
+ - Add defined behavior for HTTP `Upgrade` requests
+ - deps: ee-first@1.1.1
+ * deps: qs@3.1.0
+ - Fix dropping parameters like `hasOwnProperty`
+ - Fix various parsing edge cases
+ - Parsed object now has `null` prototype
+ * deps: raw-body@~2.1.1
+ - Use `unpipe` module for unpiping requests
+ - deps: iconv-lite@0.4.10
+ * deps: type-is@~1.6.3
+ - deps: mime-types@~2.1.1
+ - perf: reduce try block size
+ - perf: remove bitwise operations
+ * perf: enable strict mode
+ * perf: remove argument reassignment
+ * perf: remove delete call
+
+1.12.4 / 2015-05-10
+===================
+
+ * deps: debug@~2.2.0
+ * deps: qs@2.4.2
+ - Fix allowing parameters like `constructor`
+ * deps: on-finished@~2.2.1
+ * deps: raw-body@~2.0.1
+ - Fix a false-positive when unpiping in Node.js 0.8
+ - deps: bytes@2.0.1
+ * deps: type-is@~1.6.2
+ - deps: mime-types@~2.0.11
+
+1.12.3 / 2015-04-15
+===================
+
+ * Slight efficiency improvement when not debugging
+ * deps: depd@~1.0.1
+ * deps: iconv-lite@0.4.8
+ - Add encoding alias UNICODE-1-1-UTF-7
+ * deps: raw-body@1.3.4
+ - Fix hanging callback if request aborts during read
+ - deps: iconv-lite@0.4.8
+
+1.12.2 / 2015-03-16
+===================
+
+ * deps: qs@2.4.1
+ - Fix error when parameter `hasOwnProperty` is present
+
+1.12.1 / 2015-03-15
+===================
+
+ * deps: debug@~2.1.3
+ - Fix high intensity foreground color for bold
+ - deps: ms@0.7.0
+ * deps: type-is@~1.6.1
+ - deps: mime-types@~2.0.10
+
+1.12.0 / 2015-02-13
+===================
+
+ * add `debug` messages
+ * accept a function for the `type` option
+ * use `content-type` to parse `Content-Type` headers
+ * deps: iconv-lite@0.4.7
+ - Gracefully support enumerables on `Object.prototype`
+ * deps: raw-body@1.3.3
+ - deps: iconv-lite@0.4.7
+ * deps: type-is@~1.6.0
+ - fix argument reassignment
+ - fix false-positives in `hasBody` `Transfer-Encoding` check
+ - support wildcard for both type and subtype (`*/*`)
+ - deps: mime-types@~2.0.9
+
+1.11.0 / 2015-01-30
+===================
+
+ * make internal `extended: true` depth limit infinity
+ * deps: type-is@~1.5.6
+ - deps: mime-types@~2.0.8
+
+1.10.2 / 2015-01-20
+===================
+
+ * deps: iconv-lite@0.4.6
+ - Fix rare aliases of single-byte encodings
+ * deps: raw-body@1.3.2
+ - deps: iconv-lite@0.4.6
+
+1.10.1 / 2015-01-01
+===================
+
+ * deps: on-finished@~2.2.0
+ * deps: type-is@~1.5.5
+ - deps: mime-types@~2.0.7
+
+1.10.0 / 2014-12-02
+===================
+
+ * make internal `extended: true` array limit dynamic
+
+1.9.3 / 2014-11-21
+==================
+
+ * deps: iconv-lite@0.4.5
+ - Fix Windows-31J and X-SJIS encoding support
+ * deps: qs@2.3.3
+ - Fix `arrayLimit` behavior
+ * deps: raw-body@1.3.1
+ - deps: iconv-lite@0.4.5
+ * deps: type-is@~1.5.3
+ - deps: mime-types@~2.0.3
+
+1.9.2 / 2014-10-27
+==================
+
+ * deps: qs@2.3.2
+ - Fix parsing of mixed objects and values
+
+1.9.1 / 2014-10-22
+==================
+
+ * deps: on-finished@~2.1.1
+ - Fix handling of pipelined requests
+ * deps: qs@2.3.0
+ - Fix parsing of mixed implicit and explicit arrays
+ * deps: type-is@~1.5.2
+ - deps: mime-types@~2.0.2
+
+1.9.0 / 2014-09-24
+==================
+
+ * include the charset in "unsupported charset" error message
+ * include the encoding in "unsupported content encoding" error message
+ * deps: depd@~1.0.0
+
+1.8.4 / 2014-09-23
+==================
+
+ * fix content encoding to be case-insensitive
+
+1.8.3 / 2014-09-19
+==================
+
+ * deps: qs@2.2.4
+ - Fix issue with object keys starting with numbers truncated
+
+1.8.2 / 2014-09-15
+==================
+
+ * deps: depd@0.4.5
+
+1.8.1 / 2014-09-07
+==================
+
+ * deps: media-typer@0.3.0
+ * deps: type-is@~1.5.1
+
+1.8.0 / 2014-09-05
+==================
+
+ * make empty-body-handling consistent between chunked requests
+ - empty `json` produces `{}`
+ - empty `raw` produces `new Buffer(0)`
+ - empty `text` produces `''`
+ - empty `urlencoded` produces `{}`
+ * deps: qs@2.2.3
+ - Fix issue where first empty value in array is discarded
+ * deps: type-is@~1.5.0
+ - fix `hasbody` to be true for `content-length: 0`
+
+1.7.0 / 2014-09-01
+==================
+
+ * add `parameterLimit` option to `urlencoded` parser
+ * change `urlencoded` extended array limit to 100
+ * respond with 413 when over `parameterLimit` in `urlencoded`
+
+1.6.7 / 2014-08-29
+==================
+
+ * deps: qs@2.2.2
+ - Remove unnecessary cloning
+
+1.6.6 / 2014-08-27
+==================
+
+ * deps: qs@2.2.0
+ - Array parsing fix
+ - Performance improvements
+
+1.6.5 / 2014-08-16
+==================
+
+ * deps: on-finished@2.1.0
+
+1.6.4 / 2014-08-14
+==================
+
+ * deps: qs@1.2.2
+
+1.6.3 / 2014-08-10
+==================
+
+ * deps: qs@1.2.1
+
+1.6.2 / 2014-08-07
+==================
+
+ * deps: qs@1.2.0
+ - Fix parsing array of objects
+
+1.6.1 / 2014-08-06
+==================
+
+ * deps: qs@1.1.0
+ - Accept urlencoded square brackets
+ - Accept empty values in implicit array notation
+
+1.6.0 / 2014-08-05
+==================
+
+ * deps: qs@1.0.2
+ - Complete rewrite
+ - Limits array length to 20
+ - Limits object depth to 5
+ - Limits parameters to 1,000
+
+1.5.2 / 2014-07-27
+==================
+
+ * deps: depd@0.4.4
+ - Work-around v8 generating empty stack traces
+
+1.5.1 / 2014-07-26
+==================
+
+ * deps: depd@0.4.3
+ - Fix exception when global `Error.stackTraceLimit` is too low
+
+1.5.0 / 2014-07-20
+==================
+
+ * deps: depd@0.4.2
+ - Add `TRACE_DEPRECATION` environment variable
+ - Remove non-standard grey color from color output
+ - Support `--no-deprecation` argument
+ - Support `--trace-deprecation` argument
+ * deps: iconv-lite@0.4.4
+ - Added encoding UTF-7
+ * deps: raw-body@1.3.0
+ - deps: iconv-lite@0.4.4
+ - Added encoding UTF-7
+ - Fix `Cannot switch to old mode now` error on Node.js 0.10+
+ * deps: type-is@~1.3.2
+
+1.4.3 / 2014-06-19
+==================
+
+ * deps: type-is@1.3.1
+ - fix global variable leak
+
+1.4.2 / 2014-06-19
+==================
+
+ * deps: type-is@1.3.0
+ - improve type parsing
+
+1.4.1 / 2014-06-19
+==================
+
+ * fix urlencoded extended deprecation message
+
+1.4.0 / 2014-06-19
+==================
+
+ * add `text` parser
+ * add `raw` parser
+ * check accepted charset in content-type (accepts utf-8)
+ * check accepted encoding in content-encoding (accepts identity)
+ * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed
+ * deprecate `urlencoded()` without provided `extended` option
+ * lazy-load urlencoded parsers
+ * parsers split into files for reduced mem usage
+ * support gzip and deflate bodies
+ - set `inflate: false` to turn off
+ * deps: raw-body@1.2.2
+ - Support all encodings from `iconv-lite`
+
+1.3.1 / 2014-06-11
+==================
+
+ * deps: type-is@1.2.1
+ - Switch dependency from mime to mime-types@1.0.0
+
+1.3.0 / 2014-05-31
+==================
+
+ * add `extended` option to urlencoded parser
+
+1.2.2 / 2014-05-27
+==================
+
+ * deps: raw-body@1.1.6
+ - assert stream encoding on node.js 0.8
+ - assert stream encoding on node.js < 0.10.6
+ - deps: bytes@1
+
+1.2.1 / 2014-05-26
+==================
+
+ * invoke `next(err)` after request fully read
+ - prevents hung responses and socket hang ups
+
+1.2.0 / 2014-05-11
+==================
+
+ * add `verify` option
+ * deps: type-is@1.2.0
+ - support suffix matching
+
+1.1.2 / 2014-05-11
+==================
+
+ * improve json parser speed
+
+1.1.1 / 2014-05-11
+==================
+
+ * fix repeated limit parsing with every request
+
+1.1.0 / 2014-05-10
+==================
+
+ * add `type` option
+ * deps: pin for safety and consistency
+
+1.0.2 / 2014-04-14
+==================
+
+ * use `type-is` module
+
+1.0.1 / 2014-03-20
+==================
+
+ * lower default limits to 100kb
diff --git a/node_modules/body-parser/LICENSE b/node_modules/body-parser/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..386b7b6946e47bc46f8138791049b4e6a7cef889
--- /dev/null
+++ b/node_modules/body-parser/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2014-2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9fcd4c6f8eb550d7ddca624212b0533390c0fdb5
--- /dev/null
+++ b/node_modules/body-parser/README.md
@@ -0,0 +1,491 @@
+# body-parser
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Build Status][ci-image]][ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
+
+Node.js body parsing middleware.
+
+Parse incoming request bodies in a middleware before your handlers, available
+under the `req.body` property.
+
+**Note** As `req.body`'s shape is based on user-controlled input, all
+properties and values in this object are untrusted and should be validated
+before trusting. For example, `req.body.foo.toString()` may fail in multiple
+ways, for example the `foo` property may not be there or may not be a string,
+and `toString` may not be a function and instead a string or other user input.
+
+[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
+
+_This does not handle multipart bodies_, due to their complex and typically
+large nature. For multipart bodies, you may be interested in the following
+modules:
+
+ * [busboy](https://www.npmjs.org/package/busboy#readme) and
+ [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)
+ * [multiparty](https://www.npmjs.org/package/multiparty#readme) and
+ [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)
+ * [formidable](https://www.npmjs.org/package/formidable#readme)
+ * [multer](https://www.npmjs.org/package/multer#readme)
+
+This module provides the following parsers:
+
+ * [JSON body parser](#bodyparserjsonoptions)
+ * [Raw body parser](#bodyparserrawoptions)
+ * [Text body parser](#bodyparsertextoptions)
+ * [URL-encoded form body parser](#bodyparserurlencodedoptions)
+
+Other body parsers you might be interested in:
+
+- [body](https://www.npmjs.org/package/body#readme)
+- [co-body](https://www.npmjs.org/package/co-body#readme)
+
+## Installation
+
+```sh
+$ npm install body-parser
+```
+
+## API
+
+```js
+const bodyParser = require('body-parser')
+```
+
+The `bodyParser` object exposes various factories to create middlewares. All
+middlewares will populate the `req.body` property with the parsed body when
+the `Content-Type` request header matches the `type` option.
+
+The various errors returned by this module are described in the
+[errors section](#errors).
+
+### bodyParser.json([options])
+
+Returns middleware that only parses `json` and only looks at requests where
+the `Content-Type` header matches the `type` option. This parser accepts any
+Unicode encoding of the body and supports automatic inflation of `gzip`,
+`br` (brotli) and `deflate` encodings.
+
+A new `body` object containing the parsed data is populated on the `request`
+object after the middleware (i.e. `req.body`).
+
+#### Options
+
+The `json` function takes an optional `options` object that may contain any of
+the following keys:
+
+##### inflate
+
+When set to `true`, then deflated (compressed) bodies will be inflated; when
+`false`, deflated bodies are rejected. Defaults to `true`.
+
+##### limit
+
+Controls the maximum request body size. If this is a number, then the value
+specifies the number of bytes; if it is a string, the value is passed to the
+[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
+to `'100kb'`.
+
+##### reviver
+
+The `reviver` option is passed directly to `JSON.parse` as the second
+argument. You can find more information on this argument
+[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).
+
+##### strict
+
+When set to `true`, will only accept arrays and objects; when `false` will
+accept anything `JSON.parse` accepts. Defaults to `true`.
+
+##### type
+
+The `type` option is used to determine what media type the middleware will
+parse. This option can be a string, array of strings, or a function. If not a
+function, `type` option is passed directly to the
+[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
+be an extension name (like `json`), a mime type (like `application/json`), or
+a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
+option is called as `fn(req)` and the request is parsed if it returns a truthy
+value. Defaults to `application/json`.
+
+##### verify
+
+The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
+where `buf` is a `Buffer` of the raw request body and `encoding` is the
+encoding of the request. The parsing can be aborted by throwing an error.
+
+### bodyParser.raw([options])
+
+Returns middleware that parses all bodies as a `Buffer` and only looks at
+requests where the `Content-Type` header matches the `type` option. This
+parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
+encodings.
+
+A new `body` object containing the parsed data is populated on the `request`
+object after the middleware (i.e. `req.body`). This will be a `Buffer` object
+of the body.
+
+#### Options
+
+The `raw` function takes an optional `options` object that may contain any of
+the following keys:
+
+##### inflate
+
+When set to `true`, then deflated (compressed) bodies will be inflated; when
+`false`, deflated bodies are rejected. Defaults to `true`.
+
+##### limit
+
+Controls the maximum request body size. If this is a number, then the value
+specifies the number of bytes; if it is a string, the value is passed to the
+[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
+to `'100kb'`.
+
+##### type
+
+The `type` option is used to determine what media type the middleware will
+parse. This option can be a string, array of strings, or a function.
+If not a function, `type` option is passed directly to the
+[type-is](https://www.npmjs.org/package/type-is#readme) library and this
+can be an extension name (like `bin`), a mime type (like
+`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
+`application/*`). If a function, the `type` option is called as `fn(req)`
+and the request is parsed if it returns a truthy value. Defaults to
+`application/octet-stream`.
+
+##### verify
+
+The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
+where `buf` is a `Buffer` of the raw request body and `encoding` is the
+encoding of the request. The parsing can be aborted by throwing an error.
+
+### bodyParser.text([options])
+
+Returns middleware that parses all bodies as a string and only looks at
+requests where the `Content-Type` header matches the `type` option. This
+parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
+encodings.
+
+A new `body` string containing the parsed data is populated on the `request`
+object after the middleware (i.e. `req.body`). This will be a string of the
+body.
+
+#### Options
+
+The `text` function takes an optional `options` object that may contain any of
+the following keys:
+
+##### defaultCharset
+
+Specify the default character set for the text content if the charset is not
+specified in the `Content-Type` header of the request. Defaults to `utf-8`.
+
+##### inflate
+
+When set to `true`, then deflated (compressed) bodies will be inflated; when
+`false`, deflated bodies are rejected. Defaults to `true`.
+
+##### limit
+
+Controls the maximum request body size. If this is a number, then the value
+specifies the number of bytes; if it is a string, the value is passed to the
+[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
+to `'100kb'`.
+
+##### type
+
+The `type` option is used to determine what media type the middleware will
+parse. This option can be a string, array of strings, or a function. If not
+a function, `type` option is passed directly to the
+[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
+be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
+type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
+option is called as `fn(req)` and the request is parsed if it returns a
+truthy value. Defaults to `text/plain`.
+
+##### verify
+
+The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
+where `buf` is a `Buffer` of the raw request body and `encoding` is the
+encoding of the request. The parsing can be aborted by throwing an error.
+
+### bodyParser.urlencoded([options])
+
+Returns middleware that only parses `urlencoded` bodies and only looks at
+requests where the `Content-Type` header matches the `type` option. This
+parser accepts only UTF-8 encoding of the body and supports automatic
+inflation of `gzip`, `br` (brotli) and `deflate` encodings.
+
+A new `body` object containing the parsed data is populated on the `request`
+object after the middleware (i.e. `req.body`). This object will contain
+key-value pairs, where the value can be a string or array (when `extended` is
+`false`), or any type (when `extended` is `true`).
+
+#### Options
+
+The `urlencoded` function takes an optional `options` object that may contain
+any of the following keys:
+
+##### extended
+
+The "extended" syntax allows for rich objects and arrays to be encoded into the
+URL-encoded format, allowing for a JSON-like experience with URL-encoded. For
+more information, please [see the qs
+library](https://www.npmjs.org/package/qs#readme).
+
+Defaults to `false`.
+
+##### inflate
+
+When set to `true`, then deflated (compressed) bodies will be inflated; when
+`false`, deflated bodies are rejected. Defaults to `true`.
+
+##### limit
+
+Controls the maximum request body size. If this is a number, then the value
+specifies the number of bytes; if it is a string, the value is passed to the
+[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
+to `'100kb'`.
+
+##### parameterLimit
+
+The `parameterLimit` option controls the maximum number of parameters that
+are allowed in the URL-encoded data. If a request contains more parameters
+than this value, a 413 will be returned to the client. Defaults to `1000`.
+
+##### type
+
+The `type` option is used to determine what media type the middleware will
+parse. This option can be a string, array of strings, or a function. If not
+a function, `type` option is passed directly to the
+[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
+be an extension name (like `urlencoded`), a mime type (like
+`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
+`*/x-www-form-urlencoded`). If a function, the `type` option is called as
+`fn(req)` and the request is parsed if it returns a truthy value. Defaults
+to `application/x-www-form-urlencoded`.
+
+##### verify
+
+The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
+where `buf` is a `Buffer` of the raw request body and `encoding` is the
+encoding of the request. The parsing can be aborted by throwing an error.
+
+##### defaultCharset
+
+The default charset to parse as, if not specified in content-type. Must be
+either `utf-8` or `iso-8859-1`. Defaults to `utf-8`.
+
+##### charsetSentinel
+
+Whether to let the value of the `utf8` parameter take precedence as the charset
+selector. It requires the form to contain a parameter named `utf8` with a value
+of `✓`. Defaults to `false`.
+
+##### interpretNumericEntities
+
+Whether to decode numeric entities such as `☺` when parsing an iso-8859-1
+form. Defaults to `false`.
+
+
+#### depth
+
+The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
+
+## Errors
+
+The middlewares provided by this module create errors using the
+[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
+will typically have a `status`/`statusCode` property that contains the suggested
+HTTP response code, an `expose` property to determine if the `message` property
+should be displayed to the client, a `type` property to determine the type of
+error without matching against the `message`, and a `body` property containing
+the read body, if available.
+
+The following are the common errors created, though any error can come through
+for various reasons.
+
+### content encoding unsupported
+
+This error will occur when the request had a `Content-Encoding` header that
+contained an encoding but the "inflation" option was set to `false`. The
+`status` property is set to `415`, the `type` property is set to
+`'encoding.unsupported'`, and the `charset` property will be set to the
+encoding that is unsupported.
+
+### entity parse failed
+
+This error will occur when the request contained an entity that could not be
+parsed by the middleware. The `status` property is set to `400`, the `type`
+property is set to `'entity.parse.failed'`, and the `body` property is set to
+the entity value that failed parsing.
+
+### entity verify failed
+
+This error will occur when the request contained an entity that could not be
+failed verification by the defined `verify` option. The `status` property is
+set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
+`body` property is set to the entity value that failed verification.
+
+### request aborted
+
+This error will occur when the request is aborted by the client before reading
+the body has finished. The `received` property will be set to the number of
+bytes received before the request was aborted and the `expected` property is
+set to the number of expected bytes. The `status` property is set to `400`
+and `type` property is set to `'request.aborted'`.
+
+### request entity too large
+
+This error will occur when the request body's size is larger than the "limit"
+option. The `limit` property will be set to the byte limit and the `length`
+property will be set to the request body's length. The `status` property is
+set to `413` and the `type` property is set to `'entity.too.large'`.
+
+### request size did not match content length
+
+This error will occur when the request's length did not match the length from
+the `Content-Length` header. This typically occurs when the request is malformed,
+typically when the `Content-Length` header was calculated based on characters
+instead of bytes. The `status` property is set to `400` and the `type` property
+is set to `'request.size.invalid'`.
+
+### stream encoding should not be set
+
+This error will occur when something called the `req.setEncoding` method prior
+to this middleware. This module operates directly on bytes only and you cannot
+call `req.setEncoding` when using this module. The `status` property is set to
+`500` and the `type` property is set to `'stream.encoding.set'`.
+
+### stream is not readable
+
+This error will occur when the request is no longer readable when this middleware
+attempts to read it. This typically means something other than a middleware from
+this module read the request body already and the middleware was also configured to
+read the same request. The `status` property is set to `500` and the `type`
+property is set to `'stream.not.readable'`.
+
+### too many parameters
+
+This error will occur when the content of the request exceeds the configured
+`parameterLimit` for the `urlencoded` parser. The `status` property is set to
+`413` and the `type` property is set to `'parameters.too.many'`.
+
+### unsupported charset "BOGUS"
+
+This error will occur when the request had a charset parameter in the
+`Content-Type` header, but the `iconv-lite` module does not support it OR the
+parser does not support it. The charset is contained in the message as well
+as in the `charset` property. The `status` property is set to `415`, the
+`type` property is set to `'charset.unsupported'`, and the `charset` property
+is set to the charset that is unsupported.
+
+### unsupported content encoding "bogus"
+
+This error will occur when the request had a `Content-Encoding` header that
+contained an unsupported encoding. The encoding is contained in the message
+as well as in the `encoding` property. The `status` property is set to `415`,
+the `type` property is set to `'encoding.unsupported'`, and the `encoding`
+property is set to the encoding that is unsupported.
+
+### The input exceeded the depth
+
+This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
+
+## Examples
+
+### Express/Connect top-level generic
+
+This example demonstrates adding a generic JSON and URL-encoded parser as a
+top-level middleware, which will parse the bodies of all incoming requests.
+This is the simplest setup.
+
+```js
+const express = require('express')
+const bodyParser = require('body-parser')
+
+const app = express()
+
+// parse application/x-www-form-urlencoded
+app.use(bodyParser.urlencoded())
+
+// parse application/json
+app.use(bodyParser.json())
+
+app.use(function (req, res) {
+ res.setHeader('Content-Type', 'text/plain')
+ res.write('you posted:\n')
+ res.end(String(JSON.stringify(req.body, null, 2)))
+})
+```
+
+### Express route-specific
+
+This example demonstrates adding body parsers specifically to the routes that
+need them. In general, this is the most recommended way to use body-parser with
+Express.
+
+```js
+const express = require('express')
+const bodyParser = require('body-parser')
+
+const app = express()
+
+// create application/json parser
+const jsonParser = bodyParser.json()
+
+// create application/x-www-form-urlencoded parser
+const urlencodedParser = bodyParser.urlencoded()
+
+// POST /login gets urlencoded bodies
+app.post('/login', urlencodedParser, function (req, res) {
+ if (!req.body || !req.body.username) res.sendStatus(400)
+ res.send('welcome, ' + req.body.username)
+})
+
+// POST /api/users gets JSON bodies
+app.post('/api/users', jsonParser, function (req, res) {
+ if (!req.body) res.sendStatus(400)
+ // create user in req.body
+})
+```
+
+### Change accepted type for parsers
+
+All the parsers accept a `type` option which allows you to change the
+`Content-Type` that the middleware will parse.
+
+```js
+const express = require('express')
+const bodyParser = require('body-parser')
+
+const app = express()
+
+// parse various different custom JSON types as JSON
+app.use(bodyParser.json({ type: 'application/*+json' }))
+
+// parse some custom thing into a Buffer
+app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
+
+// parse an HTML body into a string
+app.use(bodyParser.text({ type: 'text/html' }))
+```
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci
+[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master
+[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
+[node-version-image]: https://badgen.net/npm/node/body-parser
+[node-version-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/body-parser
+[npm-url]: https://npmjs.org/package/body-parser
+[npm-version-image]: https://badgen.net/npm/v/body-parser
+[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
+[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
\ No newline at end of file
diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d722d0b23d7c6ad3d5277d2befa15eb0499afa18
--- /dev/null
+++ b/node_modules/body-parser/index.js
@@ -0,0 +1,80 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * @typedef Parsers
+ * @type {function}
+ * @property {function} json
+ * @property {function} raw
+ * @property {function} text
+ * @property {function} urlencoded
+ */
+
+/**
+ * Module exports.
+ * @type {Parsers}
+ */
+
+exports = module.exports = bodyParser
+
+/**
+ * JSON parser.
+ * @public
+ */
+
+Object.defineProperty(exports, 'json', {
+ configurable: true,
+ enumerable: true,
+ get: () => require('./lib/types/json')
+})
+
+/**
+ * Raw parser.
+ * @public
+ */
+
+Object.defineProperty(exports, 'raw', {
+ configurable: true,
+ enumerable: true,
+ get: () => require('./lib/types/raw')
+})
+
+/**
+ * Text parser.
+ * @public
+ */
+
+Object.defineProperty(exports, 'text', {
+ configurable: true,
+ enumerable: true,
+ get: () => require('./lib/types/text')
+})
+
+/**
+ * URL-encoded parser.
+ * @public
+ */
+
+Object.defineProperty(exports, 'urlencoded', {
+ configurable: true,
+ enumerable: true,
+ get: () => require('./lib/types/urlencoded')
+})
+
+/**
+ * Create a middleware to parse json and urlencoded bodies.
+ *
+ * @param {object} [options]
+ * @return {function}
+ * @deprecated
+ * @public
+ */
+
+function bodyParser () {
+ throw new Error('The bodyParser() generic has been split into individual middleware to use instead.')
+}
diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js
new file mode 100644
index 0000000000000000000000000000000000000000..eee8b111c24c6b67e2bc12085fd29179203cfb6a
--- /dev/null
+++ b/node_modules/body-parser/lib/read.js
@@ -0,0 +1,210 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var createError = require('http-errors')
+var getBody = require('raw-body')
+var iconv = require('iconv-lite')
+var onFinished = require('on-finished')
+var zlib = require('node:zlib')
+
+/**
+ * Module exports.
+ */
+
+module.exports = read
+
+/**
+ * Read a request into a buffer and parse.
+ *
+ * @param {object} req
+ * @param {object} res
+ * @param {function} next
+ * @param {function} parse
+ * @param {function} debug
+ * @param {object} options
+ * @private
+ */
+
+function read (req, res, next, parse, debug, options) {
+ var length
+ var opts = options
+ var stream
+
+ // read options
+ var encoding = opts.encoding !== null
+ ? opts.encoding
+ : null
+ var verify = opts.verify
+
+ try {
+ // get the content stream
+ stream = contentstream(req, debug, opts.inflate)
+ length = stream.length
+ stream.length = undefined
+ } catch (err) {
+ return next(err)
+ }
+
+ // set raw-body options
+ opts.length = length
+ opts.encoding = verify
+ ? null
+ : encoding
+
+ // assert charset is supported
+ if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
+ return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
+ charset: encoding.toLowerCase(),
+ type: 'charset.unsupported'
+ }))
+ }
+
+ // read body
+ debug('read body')
+ getBody(stream, opts, function (error, body) {
+ if (error) {
+ var _error
+
+ if (error.type === 'encoding.unsupported') {
+ // echo back charset
+ _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
+ charset: encoding.toLowerCase(),
+ type: 'charset.unsupported'
+ })
+ } else {
+ // set status code on error
+ _error = createError(400, error)
+ }
+
+ // unpipe from stream and destroy
+ if (stream !== req) {
+ req.unpipe()
+ stream.destroy()
+ }
+
+ // read off entire request
+ dump(req, function onfinished () {
+ next(createError(400, _error))
+ })
+ return
+ }
+
+ // verify
+ if (verify) {
+ try {
+ debug('verify body')
+ verify(req, res, body, encoding)
+ } catch (err) {
+ next(createError(403, err, {
+ body: body,
+ type: err.type || 'entity.verify.failed'
+ }))
+ return
+ }
+ }
+
+ // parse
+ var str = body
+ try {
+ debug('parse body')
+ str = typeof body !== 'string' && encoding !== null
+ ? iconv.decode(body, encoding)
+ : body
+ req.body = parse(str, encoding)
+ } catch (err) {
+ next(createError(400, err, {
+ body: str,
+ type: err.type || 'entity.parse.failed'
+ }))
+ return
+ }
+
+ next()
+ })
+}
+
+/**
+ * Get the content stream of the request.
+ *
+ * @param {object} req
+ * @param {function} debug
+ * @param {boolean} [inflate=true]
+ * @return {object}
+ * @api private
+ */
+
+function contentstream (req, debug, inflate) {
+ var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
+ var length = req.headers['content-length']
+
+ debug('content-encoding "%s"', encoding)
+
+ if (inflate === false && encoding !== 'identity') {
+ throw createError(415, 'content encoding unsupported', {
+ encoding: encoding,
+ type: 'encoding.unsupported'
+ })
+ }
+
+ if (encoding === 'identity') {
+ req.length = length
+ return req
+ }
+
+ var stream = createDecompressionStream(encoding, debug)
+ req.pipe(stream)
+ return stream
+}
+
+/**
+ * Create a decompression stream for the given encoding.
+ * @param {string} encoding
+ * @param {function} debug
+ * @return {object}
+ * @api private
+ */
+function createDecompressionStream (encoding, debug) {
+ switch (encoding) {
+ case 'deflate':
+ debug('inflate body')
+ return zlib.createInflate()
+ case 'gzip':
+ debug('gunzip body')
+ return zlib.createGunzip()
+ case 'br':
+ debug('brotli decompress body')
+ return zlib.createBrotliDecompress()
+ default:
+ throw createError(415, 'unsupported content encoding "' + encoding + '"', {
+ encoding: encoding,
+ type: 'encoding.unsupported'
+ })
+ }
+}
+
+/**
+ * Dump the contents of a request.
+ *
+ * @param {object} req
+ * @param {function} callback
+ * @api private
+ */
+
+function dump (req, callback) {
+ if (onFinished.isFinished(req)) {
+ callback(null)
+ } else {
+ onFinished(req, callback)
+ req.resume()
+ }
+}
diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js
new file mode 100644
index 0000000000000000000000000000000000000000..078ce7108ed8f971e6f644f84cdcf8d2bb87cd35
--- /dev/null
+++ b/node_modules/body-parser/lib/types/json.js
@@ -0,0 +1,206 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var createError = require('http-errors')
+var debug = require('debug')('body-parser:json')
+var isFinished = require('on-finished').isFinished
+var read = require('../read')
+var typeis = require('type-is')
+var { getCharset, normalizeOptions } = require('../utils')
+
+/**
+ * Module exports.
+ */
+
+module.exports = json
+
+/**
+ * RegExp to match the first non-space in a string.
+ *
+ * Allowed whitespace is defined in RFC 7159:
+ *
+ * ws = *(
+ * %x20 / ; Space
+ * %x09 / ; Horizontal tab
+ * %x0A / ; Line feed or New line
+ * %x0D ) ; Carriage return
+ */
+
+var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
+
+var JSON_SYNTAX_CHAR = '#'
+var JSON_SYNTAX_REGEXP = /#+/g
+
+/**
+ * Create a middleware to parse JSON bodies.
+ *
+ * @param {object} [options]
+ * @return {function}
+ * @public
+ */
+
+function json (options) {
+ var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/json')
+
+ var reviver = options?.reviver
+ var strict = options?.strict !== false
+
+ function parse (body) {
+ if (body.length === 0) {
+ // special-case empty json body, as it's a common client-side mistake
+ // TODO: maybe make this configurable or part of "strict" option
+ return {}
+ }
+
+ if (strict) {
+ var first = firstchar(body)
+
+ if (first !== '{' && first !== '[') {
+ debug('strict violation')
+ throw createStrictSyntaxError(body, first)
+ }
+ }
+
+ try {
+ debug('parse json')
+ return JSON.parse(body, reviver)
+ } catch (e) {
+ throw normalizeJsonSyntaxError(e, {
+ message: e.message,
+ stack: e.stack
+ })
+ }
+ }
+
+ return function jsonParser (req, res, next) {
+ if (isFinished(req)) {
+ debug('body already parsed')
+ next()
+ return
+ }
+
+ if (!('body' in req)) {
+ req.body = undefined
+ }
+
+ // skip requests without bodies
+ if (!typeis.hasBody(req)) {
+ debug('skip empty body')
+ next()
+ return
+ }
+
+ debug('content-type %j', req.headers['content-type'])
+
+ // determine if request should be parsed
+ if (!shouldParse(req)) {
+ debug('skip parsing')
+ next()
+ return
+ }
+
+ // assert charset per RFC 7159 sec 8.1
+ var charset = getCharset(req) || 'utf-8'
+ if (charset.slice(0, 4) !== 'utf-') {
+ debug('invalid charset')
+ next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
+ charset: charset,
+ type: 'charset.unsupported'
+ }))
+ return
+ }
+
+ // read
+ read(req, res, next, parse, debug, {
+ encoding: charset,
+ inflate,
+ limit,
+ verify
+ })
+ }
+}
+
+/**
+ * Create strict violation syntax error matching native error.
+ *
+ * @param {string} str
+ * @param {string} char
+ * @return {Error}
+ * @private
+ */
+
+function createStrictSyntaxError (str, char) {
+ var index = str.indexOf(char)
+ var partial = ''
+
+ if (index !== -1) {
+ partial = str.substring(0, index) + JSON_SYNTAX_CHAR
+
+ for (var i = index + 1; i < str.length; i++) {
+ partial += JSON_SYNTAX_CHAR
+ }
+ }
+
+ try {
+ JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
+ } catch (e) {
+ return normalizeJsonSyntaxError(e, {
+ message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) {
+ return str.substring(index, index + placeholder.length)
+ }),
+ stack: e.stack
+ })
+ }
+}
+
+/**
+ * Get the first non-whitespace character in a string.
+ *
+ * @param {string} str
+ * @return {function}
+ * @private
+ */
+
+function firstchar (str) {
+ var match = FIRST_CHAR_REGEXP.exec(str)
+
+ return match
+ ? match[1]
+ : undefined
+}
+
+/**
+ * Normalize a SyntaxError for JSON.parse.
+ *
+ * @param {SyntaxError} error
+ * @param {object} obj
+ * @return {SyntaxError}
+ */
+
+function normalizeJsonSyntaxError (error, obj) {
+ var keys = Object.getOwnPropertyNames(error)
+
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i]
+ if (key !== 'stack' && key !== 'message') {
+ delete error[key]
+ }
+ }
+
+ // replace stack before message for Node.js 0.10 and below
+ error.stack = obj.stack.replace(error.message, obj.message)
+ error.message = obj.message
+
+ return error
+}
diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js
new file mode 100644
index 0000000000000000000000000000000000000000..3788ff2791df88670a7aec2ecdd3a79bf4894640
--- /dev/null
+++ b/node_modules/body-parser/lib/types/raw.js
@@ -0,0 +1,75 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ */
+
+var debug = require('debug')('body-parser:raw')
+var isFinished = require('on-finished').isFinished
+var read = require('../read')
+var typeis = require('type-is')
+var { normalizeOptions } = require('../utils')
+
+/**
+ * Module exports.
+ */
+
+module.exports = raw
+
+/**
+ * Create a middleware to parse raw bodies.
+ *
+ * @param {object} [options]
+ * @return {function}
+ * @api public
+ */
+
+function raw (options) {
+ var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/octet-stream')
+
+ function parse (buf) {
+ return buf
+ }
+
+ return function rawParser (req, res, next) {
+ if (isFinished(req)) {
+ debug('body already parsed')
+ next()
+ return
+ }
+
+ if (!('body' in req)) {
+ req.body = undefined
+ }
+
+ // skip requests without bodies
+ if (!typeis.hasBody(req)) {
+ debug('skip empty body')
+ next()
+ return
+ }
+
+ debug('content-type %j', req.headers['content-type'])
+
+ // determine if request should be parsed
+ if (!shouldParse(req)) {
+ debug('skip parsing')
+ next()
+ return
+ }
+
+ // read
+ read(req, res, next, parse, debug, {
+ encoding: null,
+ inflate,
+ limit,
+ verify
+ })
+ }
+}
diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js
new file mode 100644
index 0000000000000000000000000000000000000000..3e0ab1bbd229f7acb829645f2727d267362a998c
--- /dev/null
+++ b/node_modules/body-parser/lib/types/text.js
@@ -0,0 +1,80 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ */
+
+var debug = require('debug')('body-parser:text')
+var isFinished = require('on-finished').isFinished
+var read = require('../read')
+var typeis = require('type-is')
+var { getCharset, normalizeOptions } = require('../utils')
+
+/**
+ * Module exports.
+ */
+
+module.exports = text
+
+/**
+ * Create a middleware to parse text bodies.
+ *
+ * @param {object} [options]
+ * @return {function}
+ * @api public
+ */
+
+function text (options) {
+ var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'text/plain')
+
+ var defaultCharset = options?.defaultCharset || 'utf-8'
+
+ function parse (buf) {
+ return buf
+ }
+
+ return function textParser (req, res, next) {
+ if (isFinished(req)) {
+ debug('body already parsed')
+ next()
+ return
+ }
+
+ if (!('body' in req)) {
+ req.body = undefined
+ }
+
+ // skip requests without bodies
+ if (!typeis.hasBody(req)) {
+ debug('skip empty body')
+ next()
+ return
+ }
+
+ debug('content-type %j', req.headers['content-type'])
+
+ // determine if request should be parsed
+ if (!shouldParse(req)) {
+ debug('skip parsing')
+ next()
+ return
+ }
+
+ // get charset
+ var charset = getCharset(req) || defaultCharset
+
+ // read
+ read(req, res, next, parse, debug, {
+ encoding: charset,
+ inflate,
+ limit,
+ verify
+ })
+ }
+}
diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js
new file mode 100644
index 0000000000000000000000000000000000000000..f993425efc8f64e5e05dc556b54a0be4e7df52d5
--- /dev/null
+++ b/node_modules/body-parser/lib/types/urlencoded.js
@@ -0,0 +1,177 @@
+/*!
+ * body-parser
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var createError = require('http-errors')
+var debug = require('debug')('body-parser:urlencoded')
+var isFinished = require('on-finished').isFinished
+var read = require('../read')
+var typeis = require('type-is')
+var qs = require('qs')
+var { getCharset, normalizeOptions } = require('../utils')
+
+/**
+ * Module exports.
+ */
+
+module.exports = urlencoded
+
+/**
+ * Create a middleware to parse urlencoded bodies.
+ *
+ * @param {object} [options]
+ * @return {function}
+ * @public
+ */
+
+function urlencoded (options) {
+ var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/x-www-form-urlencoded')
+
+ var defaultCharset = options?.defaultCharset || 'utf-8'
+ if (defaultCharset !== 'utf-8' && defaultCharset !== 'iso-8859-1') {
+ throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1')
+ }
+
+ // create the appropriate query parser
+ var queryparse = createQueryParser(options)
+
+ function parse (body, encoding) {
+ return body.length
+ ? queryparse(body, encoding)
+ : {}
+ }
+
+ return function urlencodedParser (req, res, next) {
+ if (isFinished(req)) {
+ debug('body already parsed')
+ next()
+ return
+ }
+
+ if (!('body' in req)) {
+ req.body = undefined
+ }
+
+ // skip requests without bodies
+ if (!typeis.hasBody(req)) {
+ debug('skip empty body')
+ next()
+ return
+ }
+
+ debug('content-type %j', req.headers['content-type'])
+
+ // determine if request should be parsed
+ if (!shouldParse(req)) {
+ debug('skip parsing')
+ next()
+ return
+ }
+
+ // assert charset
+ var charset = getCharset(req) || defaultCharset
+ if (charset !== 'utf-8' && charset !== 'iso-8859-1') {
+ debug('invalid charset')
+ next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
+ charset: charset,
+ type: 'charset.unsupported'
+ }))
+ return
+ }
+
+ // read
+ read(req, res, next, parse, debug, {
+ encoding: charset,
+ inflate,
+ limit,
+ verify
+ })
+ }
+}
+
+/**
+ * Get the extended query parser.
+ *
+ * @param {object} options
+ */
+
+function createQueryParser (options) {
+ var extended = Boolean(options?.extended)
+ var parameterLimit = options?.parameterLimit !== undefined
+ ? options?.parameterLimit
+ : 1000
+ var charsetSentinel = options?.charsetSentinel
+ var interpretNumericEntities = options?.interpretNumericEntities
+ var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0
+
+ if (isNaN(parameterLimit) || parameterLimit < 1) {
+ throw new TypeError('option parameterLimit must be a positive number')
+ }
+
+ if (isNaN(depth) || depth < 0) {
+ throw new TypeError('option depth must be a zero or a positive number')
+ }
+
+ if (isFinite(parameterLimit)) {
+ parameterLimit = parameterLimit | 0
+ }
+
+ return function queryparse (body, encoding) {
+ var paramCount = parameterCount(body, parameterLimit)
+
+ if (paramCount === undefined) {
+ debug('too many parameters')
+ throw createError(413, 'too many parameters', {
+ type: 'parameters.too.many'
+ })
+ }
+
+ var arrayLimit = extended ? Math.max(100, paramCount) : 0
+
+ debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding')
+ try {
+ return qs.parse(body, {
+ allowPrototypes: true,
+ arrayLimit: arrayLimit,
+ depth: depth,
+ charsetSentinel: charsetSentinel,
+ interpretNumericEntities: interpretNumericEntities,
+ charset: encoding,
+ parameterLimit: parameterLimit,
+ strictDepth: true
+ })
+ } catch (err) {
+ if (err instanceof RangeError) {
+ throw createError(400, 'The input exceeded the depth', {
+ type: 'querystring.parse.rangeError'
+ })
+ } else {
+ throw err
+ }
+ }
+ }
+}
+
+/**
+ * Count the number of parameters, stopping once limit reached
+ *
+ * @param {string} body
+ * @param {number} limit
+ * @api private
+ */
+
+function parameterCount (body, limit) {
+ var len = body.split('&').length
+
+ return len > limit ? undefined : len - 1
+}
diff --git a/node_modules/body-parser/lib/utils.js b/node_modules/body-parser/lib/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..eee5d952a1072c6bf5a1acd8b1506b4d213a6124
--- /dev/null
+++ b/node_modules/body-parser/lib/utils.js
@@ -0,0 +1,83 @@
+'use strict'
+
+/**
+ * Module dependencies.
+ */
+
+var bytes = require('bytes')
+var contentType = require('content-type')
+var typeis = require('type-is')
+
+/**
+ * Module exports.
+ */
+
+module.exports = {
+ getCharset,
+ normalizeOptions
+}
+
+/**
+ * Get the charset of a request.
+ *
+ * @param {object} req
+ * @api private
+ */
+
+function getCharset (req) {
+ try {
+ return (contentType.parse(req).parameters.charset || '').toLowerCase()
+ } catch {
+ return undefined
+ }
+}
+
+/**
+ * Get the simple type checker.
+ *
+ * @param {string | string[]} type
+ * @return {function}
+ */
+
+function typeChecker (type) {
+ return function checkType (req) {
+ return Boolean(typeis(req, type))
+ }
+}
+
+/**
+ * Normalizes the common options for all parsers.
+ *
+ * @param {object} options options to normalize
+ * @param {string | string[] | function} defaultType default content type(s) or a function to determine it
+ * @returns {object}
+ */
+function normalizeOptions (options, defaultType) {
+ if (!defaultType) {
+ // Parsers must define a default content type
+ throw new TypeError('defaultType must be provided')
+ }
+
+ var inflate = options?.inflate !== false
+ var limit = typeof options?.limit !== 'number'
+ ? bytes.parse(options?.limit || '100kb')
+ : options?.limit
+ var type = options?.type || defaultType
+ var verify = options?.verify || false
+
+ if (verify !== false && typeof verify !== 'function') {
+ throw new TypeError('option verify must be function')
+ }
+
+ // create the appropriate type checking function
+ var shouldParse = typeof type !== 'function'
+ ? typeChecker(type)
+ : type
+
+ return {
+ inflate,
+ limit,
+ verify,
+ shouldParse
+ }
+}
diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..e7f763b8e8ccd6db546518f7d9d0823c6a4f8599
--- /dev/null
+++ b/node_modules/body-parser/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "body-parser",
+ "description": "Node.js body parsing middleware",
+ "version": "2.2.0",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Jonathan Ong (http://jongleberry.com)"
+ ],
+ "license": "MIT",
+ "repository": "expressjs/body-parser",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^1.0.5",
+ "debug": "^4.4.0",
+ "http-errors": "^2.0.0",
+ "iconv-lite": "^0.6.3",
+ "on-finished": "^2.4.1",
+ "qs": "^6.14.0",
+ "raw-body": "^3.0.0",
+ "type-is": "^2.0.0"
+ },
+ "devDependencies": {
+ "eslint": "8.34.0",
+ "eslint-config-standard": "14.1.1",
+ "eslint-plugin-import": "2.27.5",
+ "eslint-plugin-markdown": "3.0.0",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "6.1.1",
+ "eslint-plugin-standard": "4.1.0",
+ "mocha": "^11.1.0",
+ "nyc": "^17.1.0",
+ "supertest": "^7.0.0"
+ },
+ "files": [
+ "lib/",
+ "LICENSE",
+ "HISTORY.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --reporter spec --check-leaks test/",
+ "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
+ }
+}
diff --git a/node_modules/brace-expansion/.github/FUNDING.yml b/node_modules/brace-expansion/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..79d1eafceccdfd94e9da95af5ccc8ccce24f198b
--- /dev/null
+++ b/node_modules/brace-expansion/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+tidelift: "npm/brace-expansion"
+patreon: juliangruber
diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..de3226673c3874b1c6506db022393c753495655c
--- /dev/null
+++ b/node_modules/brace-expansion/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013 Julian Gruber
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..e55c583dd095a596ed084669bce5860315ec7919
--- /dev/null
+++ b/node_modules/brace-expansion/README.md
@@ -0,0 +1,135 @@
+# brace-expansion
+
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
+as known from sh/bash, in JavaScript.
+
+[](http://travis-ci.org/juliangruber/brace-expansion)
+[](https://www.npmjs.org/package/brace-expansion)
+[](https://greenkeeper.io/)
+
+[](https://ci.testling.com/juliangruber/brace-expansion)
+
+## Example
+
+```js
+var expand = require('brace-expansion');
+
+expand('file-{a,b,c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('-v{,,}')
+// => ['-v', '-v', '-v']
+
+expand('file{0..2}.jpg')
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
+
+expand('file-{a..c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('file{2..0}.jpg')
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
+
+expand('file{0..4..2}.jpg')
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
+
+expand('file-{a..e..2}.jpg')
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
+
+expand('file{00..10..5}.jpg')
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
+
+expand('{{A..C},{a..c}}')
+// => ['A', 'B', 'C', 'a', 'b', 'c']
+
+expand('ppp{,config,oe{,conf}}')
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
+```
+
+## API
+
+```js
+var expand = require('brace-expansion');
+```
+
+### var expanded = expand(str)
+
+Return an array of all possible and valid expansions of `str`. If none are
+found, `[str]` is returned.
+
+Valid expansions are:
+
+```js
+/^(.*,)+(.+)?$/
+// {a,b,...}
+```
+
+A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+A numeric sequence from `x` to `y` inclusive, with optional increment.
+If `x` or `y` start with a leading `0`, all the numbers will be padded
+to have equal length. Negative numbers and backwards iteration work too.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
+`x` and `y` must be exactly one character, and if given, `incr` must be a
+number.
+
+For compatibility reasons, the string `${` is not eligible for brace expansion.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install brace-expansion
+```
+
+## Contributors
+
+- [Julian Gruber](https://github.com/juliangruber)
+- [Isaac Z. Schlueter](https://github.com/isaacs)
+
+## Sponsors
+
+This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
+
+Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
+
+## Security contact information
+
+To report a security vulnerability, please use the
+[Tidelift security contact](https://tidelift.com/security).
+Tidelift will coordinate the fix and disclosure.
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a27f81ce041e7cf9b7dd9d95533813527f918fb6
--- /dev/null
+++ b/node_modules/brace-expansion/index.js
@@ -0,0 +1,203 @@
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+ return parseInt(str, 10) == str
+ ? parseInt(str, 10)
+ : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+ return str.split('\\\\').join(escSlash)
+ .split('\\{').join(escOpen)
+ .split('\\}').join(escClose)
+ .split('\\,').join(escComma)
+ .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+ return str.split(escSlash).join('\\')
+ .split(escOpen).join('{')
+ .split(escClose).join('}')
+ .split(escComma).join(',')
+ .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+ if (!str)
+ return [''];
+
+ var parts = [];
+ var m = balanced('{', '}', str);
+
+ if (!m)
+ return str.split(',');
+
+ var pre = m.pre;
+ var body = m.body;
+ var post = m.post;
+ var p = pre.split(',');
+
+ p[p.length-1] += '{' + body + '}';
+ var postParts = parseCommaParts(post);
+ if (post.length) {
+ p[p.length-1] += postParts.shift();
+ p.push.apply(p, postParts);
+ }
+
+ parts.push.apply(parts, p);
+
+ return parts;
+}
+
+function expandTop(str) {
+ if (!str)
+ return [];
+
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
+ return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function embrace(str) {
+ return '{' + str + '}';
+}
+function isPadded(el) {
+ return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+ return i <= y;
+}
+function gte(i, y) {
+ return i >= y;
+}
+
+function expand(str, isTop) {
+ var expansions = [];
+
+ var m = balanced('{', '}', str);
+ if (!m) return [str];
+
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
+ var pre = m.pre;
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+
+ if (/\$$/.test(m.pre)) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre+ '{' + m.body + '}' + post[k];
+ expansions.push(expansion);
+ }
+ } else {
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+ var isSequence = isNumericSequence || isAlphaSequence;
+ var isOptions = m.body.indexOf(',') >= 0;
+ if (!isSequence && !isOptions) {
+ // {a},b}
+ if (m.post.match(/,(?!,).*\}/)) {
+ str = m.pre + '{' + m.body + escClose + m.post;
+ return expand(str);
+ }
+ return [str];
+ }
+
+ var n;
+ if (isSequence) {
+ n = m.body.split(/\.\./);
+ } else {
+ n = parseCommaParts(m.body);
+ if (n.length === 1) {
+ // x{{a,b}}y ==> x{a}y x{b}y
+ n = expand(n[0], false).map(embrace);
+ if (n.length === 1) {
+ return post.map(function(p) {
+ return m.pre + n[0] + p;
+ });
+ }
+ }
+ }
+
+ // at this point, n is the parts, and we know it's not a comma set
+ // with a single entry.
+ var N;
+
+ if (isSequence) {
+ var x = numeric(n[0]);
+ var y = numeric(n[1]);
+ var width = Math.max(n[0].length, n[1].length)
+ var incr = n.length == 3
+ ? Math.abs(numeric(n[2]))
+ : 1;
+ var test = lte;
+ var reverse = y < x;
+ if (reverse) {
+ incr *= -1;
+ test = gte;
+ }
+ var pad = n.some(isPadded);
+
+ N = [];
+
+ for (var i = x; test(i, y); i += incr) {
+ var c;
+ if (isAlphaSequence) {
+ c = String.fromCharCode(i);
+ if (c === '\\')
+ c = '';
+ } else {
+ c = String(i);
+ if (pad) {
+ var need = width - c.length;
+ if (need > 0) {
+ var z = new Array(need + 1).join('0');
+ if (i < 0)
+ c = '-' + z + c.slice(1);
+ else
+ c = z + c;
+ }
+ }
+ }
+ N.push(c);
+ }
+ } else {
+ N = [];
+
+ for (var j = 0; j < n.length; j++) {
+ N.push.apply(N, expand(n[j], false));
+ }
+ }
+
+ for (var j = 0; j < N.length; j++) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre + N[j] + post[k];
+ if (!isTop || isSequence || expansion)
+ expansions.push(expansion);
+ }
+ }
+ }
+
+ return expansions;
+}
+
diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..c7eee34511002aea1aab5be76c1bd79fe7ded291
--- /dev/null
+++ b/node_modules/brace-expansion/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "brace-expansion",
+ "description": "Brace expansion as known from sh/bash",
+ "version": "2.0.2",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/brace-expansion.git"
+ },
+ "homepage": "https://github.com/juliangruber/brace-expansion",
+ "main": "index.js",
+ "scripts": {
+ "test": "tape test/*.js",
+ "gentest": "bash test/generate.sh",
+ "bench": "matcha test/perf/bench.js"
+ },
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ },
+ "devDependencies": {
+ "@c4312/matcha": "^1.3.1",
+ "tape": "^4.6.0"
+ },
+ "keywords": [],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT",
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "publishConfig": {
+ "tag": "2.x"
+ }
+}
diff --git a/node_modules/buffer-crc32/LICENSE b/node_modules/buffer-crc32/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..9d2e5162a2d4bb1a26e51a07b14b9fd35f167c57
--- /dev/null
+++ b/node_modules/buffer-crc32/LICENSE
@@ -0,0 +1,19 @@
+The MIT License
+
+Copyright (c) 2013-2024 Brian J. Brennan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/buffer-crc32/README.md b/node_modules/buffer-crc32/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..8029761e644f3f7d15560d25f255f076b5cb4ebf
--- /dev/null
+++ b/node_modules/buffer-crc32/README.md
@@ -0,0 +1,55 @@
+# buffer-crc32
+
+[](https://npmjs.org/package/buffer-crc32)
+[](https://github.com/brianloveswords/buffer-crc32/actions/workflows/ci.yml)
+
+crc32 that works with binary data and fancy character sets, outputs
+buffer, signed or unsigned data and has tests.
+
+Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix
+
+This package requires Node 8+ to work.
+
+# install
+
+```
+npm install buffer-crc32
+```
+
+# example
+
+```js
+const crc32 = require('buffer-crc32');
+// works with buffers
+const buf = Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+crc32(buf); // ->
+
+// has convenience methods for getting signed or unsigned ints
+crc32.signed(buf); // -> -1805997238
+crc32.unsigned(buf); // -> 2488970058
+
+// will cast to buffer if given a string, so you can
+// directly use foreign characters safely
+crc32('自動販売機'); // ->
+
+// and works in append mode too
+const partialCrc = crc32('hey');
+const partialCrc = crc32(' ', partialCrc);
+const partialCrc = crc32('sup', partialCrc);
+const partialCrc = crc32(' ', partialCrc);
+const finalCrc = crc32('bros', partialCrc); // ->
+```
+
+# tests
+
+This was tested against the output of zlib's crc32 method. You can run
+the tests with`npm test` (requires tap)
+
+# see also
+
+https://github.com/alexgorbatchev/node-crc, `crc.buffer.crc32` also
+supports buffer inputs and return unsigned ints (thanks @tjholowaychuk).
+
+# license
+
+MIT/X11
diff --git a/node_modules/buffer-crc32/dist/index.cjs b/node_modules/buffer-crc32/dist/index.cjs
new file mode 100644
index 0000000000000000000000000000000000000000..db64a84b1fd7c745ad221cc5e314817c7c309da4
--- /dev/null
+++ b/node_modules/buffer-crc32/dist/index.cjs
@@ -0,0 +1,306 @@
+'use strict';
+
+function getDefaultExportFromCjs (x) {
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
+}
+
+const CRC_TABLE = new Int32Array([
+ 0,
+ 1996959894,
+ 3993919788,
+ 2567524794,
+ 124634137,
+ 1886057615,
+ 3915621685,
+ 2657392035,
+ 249268274,
+ 2044508324,
+ 3772115230,
+ 2547177864,
+ 162941995,
+ 2125561021,
+ 3887607047,
+ 2428444049,
+ 498536548,
+ 1789927666,
+ 4089016648,
+ 2227061214,
+ 450548861,
+ 1843258603,
+ 4107580753,
+ 2211677639,
+ 325883990,
+ 1684777152,
+ 4251122042,
+ 2321926636,
+ 335633487,
+ 1661365465,
+ 4195302755,
+ 2366115317,
+ 997073096,
+ 1281953886,
+ 3579855332,
+ 2724688242,
+ 1006888145,
+ 1258607687,
+ 3524101629,
+ 2768942443,
+ 901097722,
+ 1119000684,
+ 3686517206,
+ 2898065728,
+ 853044451,
+ 1172266101,
+ 3705015759,
+ 2882616665,
+ 651767980,
+ 1373503546,
+ 3369554304,
+ 3218104598,
+ 565507253,
+ 1454621731,
+ 3485111705,
+ 3099436303,
+ 671266974,
+ 1594198024,
+ 3322730930,
+ 2970347812,
+ 795835527,
+ 1483230225,
+ 3244367275,
+ 3060149565,
+ 1994146192,
+ 31158534,
+ 2563907772,
+ 4023717930,
+ 1907459465,
+ 112637215,
+ 2680153253,
+ 3904427059,
+ 2013776290,
+ 251722036,
+ 2517215374,
+ 3775830040,
+ 2137656763,
+ 141376813,
+ 2439277719,
+ 3865271297,
+ 1802195444,
+ 476864866,
+ 2238001368,
+ 4066508878,
+ 1812370925,
+ 453092731,
+ 2181625025,
+ 4111451223,
+ 1706088902,
+ 314042704,
+ 2344532202,
+ 4240017532,
+ 1658658271,
+ 366619977,
+ 2362670323,
+ 4224994405,
+ 1303535960,
+ 984961486,
+ 2747007092,
+ 3569037538,
+ 1256170817,
+ 1037604311,
+ 2765210733,
+ 3554079995,
+ 1131014506,
+ 879679996,
+ 2909243462,
+ 3663771856,
+ 1141124467,
+ 855842277,
+ 2852801631,
+ 3708648649,
+ 1342533948,
+ 654459306,
+ 3188396048,
+ 3373015174,
+ 1466479909,
+ 544179635,
+ 3110523913,
+ 3462522015,
+ 1591671054,
+ 702138776,
+ 2966460450,
+ 3352799412,
+ 1504918807,
+ 783551873,
+ 3082640443,
+ 3233442989,
+ 3988292384,
+ 2596254646,
+ 62317068,
+ 1957810842,
+ 3939845945,
+ 2647816111,
+ 81470997,
+ 1943803523,
+ 3814918930,
+ 2489596804,
+ 225274430,
+ 2053790376,
+ 3826175755,
+ 2466906013,
+ 167816743,
+ 2097651377,
+ 4027552580,
+ 2265490386,
+ 503444072,
+ 1762050814,
+ 4150417245,
+ 2154129355,
+ 426522225,
+ 1852507879,
+ 4275313526,
+ 2312317920,
+ 282753626,
+ 1742555852,
+ 4189708143,
+ 2394877945,
+ 397917763,
+ 1622183637,
+ 3604390888,
+ 2714866558,
+ 953729732,
+ 1340076626,
+ 3518719985,
+ 2797360999,
+ 1068828381,
+ 1219638859,
+ 3624741850,
+ 2936675148,
+ 906185462,
+ 1090812512,
+ 3747672003,
+ 2825379669,
+ 829329135,
+ 1181335161,
+ 3412177804,
+ 3160834842,
+ 628085408,
+ 1382605366,
+ 3423369109,
+ 3138078467,
+ 570562233,
+ 1426400815,
+ 3317316542,
+ 2998733608,
+ 733239954,
+ 1555261956,
+ 3268935591,
+ 3050360625,
+ 752459403,
+ 1541320221,
+ 2607071920,
+ 3965973030,
+ 1969922972,
+ 40735498,
+ 2617837225,
+ 3943577151,
+ 1913087877,
+ 83908371,
+ 2512341634,
+ 3803740692,
+ 2075208622,
+ 213261112,
+ 2463272603,
+ 3855990285,
+ 2094854071,
+ 198958881,
+ 2262029012,
+ 4057260610,
+ 1759359992,
+ 534414190,
+ 2176718541,
+ 4139329115,
+ 1873836001,
+ 414664567,
+ 2282248934,
+ 4279200368,
+ 1711684554,
+ 285281116,
+ 2405801727,
+ 4167216745,
+ 1634467795,
+ 376229701,
+ 2685067896,
+ 3608007406,
+ 1308918612,
+ 956543938,
+ 2808555105,
+ 3495958263,
+ 1231636301,
+ 1047427035,
+ 2932959818,
+ 3654703836,
+ 1088359270,
+ 936918e3,
+ 2847714899,
+ 3736837829,
+ 1202900863,
+ 817233897,
+ 3183342108,
+ 3401237130,
+ 1404277552,
+ 615818150,
+ 3134207493,
+ 3453421203,
+ 1423857449,
+ 601450431,
+ 3009837614,
+ 3294710456,
+ 1567103746,
+ 711928724,
+ 3020668471,
+ 3272380065,
+ 1510334235,
+ 755167117
+]);
+function ensureBuffer(input) {
+ if (Buffer.isBuffer(input)) {
+ return input;
+ }
+ if (typeof input === "number") {
+ return Buffer.alloc(input);
+ } else if (typeof input === "string") {
+ return Buffer.from(input);
+ } else {
+ throw new Error("input must be buffer, number, or string, received " + typeof input);
+ }
+}
+function bufferizeInt(num) {
+ const tmp = ensureBuffer(4);
+ tmp.writeInt32BE(num, 0);
+ return tmp;
+}
+function _crc32(buf, previous) {
+ buf = ensureBuffer(buf);
+ if (Buffer.isBuffer(previous)) {
+ previous = previous.readUInt32BE(0);
+ }
+ let crc = ~~previous ^ -1;
+ for (var n = 0; n < buf.length; n++) {
+ crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
+ }
+ return crc ^ -1;
+}
+function crc32() {
+ return bufferizeInt(_crc32.apply(null, arguments));
+}
+crc32.signed = function() {
+ return _crc32.apply(null, arguments);
+};
+crc32.unsigned = function() {
+ return _crc32.apply(null, arguments) >>> 0;
+};
+var bufferCrc32 = crc32;
+
+const index = /*@__PURE__*/getDefaultExportFromCjs(bufferCrc32);
+
+module.exports = index;
diff --git a/node_modules/buffer-crc32/dist/index.d.cts b/node_modules/buffer-crc32/dist/index.d.cts
new file mode 100644
index 0000000000000000000000000000000000000000..ac8fb580f7e9474f7a5e986eac3fd8a4900d3382
--- /dev/null
+++ b/node_modules/buffer-crc32/dist/index.d.cts
@@ -0,0 +1,35 @@
+///
+
+/**
+ * These definitions were written by BendingBender (https://github.com/BendingBender)
+ */
+
+export = crc32;
+
+declare function crc32(input: string | Buffer, partialCrc?: Buffer | number): Buffer;
+
+declare namespace crc32 {
+ /**
+ * Convenience method that returns a signed int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.signed(buf); // -> -1805997238
+ */
+ function signed(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+
+ /**
+ * Convenience method that returns an unsigned int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.unsigned(buf); // -> 2488970058
+ */
+ function unsigned(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+}
diff --git a/node_modules/buffer-crc32/dist/index.d.mts b/node_modules/buffer-crc32/dist/index.d.mts
new file mode 100644
index 0000000000000000000000000000000000000000..ac8fb580f7e9474f7a5e986eac3fd8a4900d3382
--- /dev/null
+++ b/node_modules/buffer-crc32/dist/index.d.mts
@@ -0,0 +1,35 @@
+///
+
+/**
+ * These definitions were written by BendingBender (https://github.com/BendingBender)
+ */
+
+export = crc32;
+
+declare function crc32(input: string | Buffer, partialCrc?: Buffer | number): Buffer;
+
+declare namespace crc32 {
+ /**
+ * Convenience method that returns a signed int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.signed(buf); // -> -1805997238
+ */
+ function signed(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+
+ /**
+ * Convenience method that returns an unsigned int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.unsigned(buf); // -> 2488970058
+ */
+ function unsigned(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+}
diff --git a/node_modules/buffer-crc32/dist/index.mjs b/node_modules/buffer-crc32/dist/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..9f80483ea355f8b5fea1bac23d8e1bfa54cd5752
--- /dev/null
+++ b/node_modules/buffer-crc32/dist/index.mjs
@@ -0,0 +1,304 @@
+function getDefaultExportFromCjs (x) {
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
+}
+
+const CRC_TABLE = new Int32Array([
+ 0,
+ 1996959894,
+ 3993919788,
+ 2567524794,
+ 124634137,
+ 1886057615,
+ 3915621685,
+ 2657392035,
+ 249268274,
+ 2044508324,
+ 3772115230,
+ 2547177864,
+ 162941995,
+ 2125561021,
+ 3887607047,
+ 2428444049,
+ 498536548,
+ 1789927666,
+ 4089016648,
+ 2227061214,
+ 450548861,
+ 1843258603,
+ 4107580753,
+ 2211677639,
+ 325883990,
+ 1684777152,
+ 4251122042,
+ 2321926636,
+ 335633487,
+ 1661365465,
+ 4195302755,
+ 2366115317,
+ 997073096,
+ 1281953886,
+ 3579855332,
+ 2724688242,
+ 1006888145,
+ 1258607687,
+ 3524101629,
+ 2768942443,
+ 901097722,
+ 1119000684,
+ 3686517206,
+ 2898065728,
+ 853044451,
+ 1172266101,
+ 3705015759,
+ 2882616665,
+ 651767980,
+ 1373503546,
+ 3369554304,
+ 3218104598,
+ 565507253,
+ 1454621731,
+ 3485111705,
+ 3099436303,
+ 671266974,
+ 1594198024,
+ 3322730930,
+ 2970347812,
+ 795835527,
+ 1483230225,
+ 3244367275,
+ 3060149565,
+ 1994146192,
+ 31158534,
+ 2563907772,
+ 4023717930,
+ 1907459465,
+ 112637215,
+ 2680153253,
+ 3904427059,
+ 2013776290,
+ 251722036,
+ 2517215374,
+ 3775830040,
+ 2137656763,
+ 141376813,
+ 2439277719,
+ 3865271297,
+ 1802195444,
+ 476864866,
+ 2238001368,
+ 4066508878,
+ 1812370925,
+ 453092731,
+ 2181625025,
+ 4111451223,
+ 1706088902,
+ 314042704,
+ 2344532202,
+ 4240017532,
+ 1658658271,
+ 366619977,
+ 2362670323,
+ 4224994405,
+ 1303535960,
+ 984961486,
+ 2747007092,
+ 3569037538,
+ 1256170817,
+ 1037604311,
+ 2765210733,
+ 3554079995,
+ 1131014506,
+ 879679996,
+ 2909243462,
+ 3663771856,
+ 1141124467,
+ 855842277,
+ 2852801631,
+ 3708648649,
+ 1342533948,
+ 654459306,
+ 3188396048,
+ 3373015174,
+ 1466479909,
+ 544179635,
+ 3110523913,
+ 3462522015,
+ 1591671054,
+ 702138776,
+ 2966460450,
+ 3352799412,
+ 1504918807,
+ 783551873,
+ 3082640443,
+ 3233442989,
+ 3988292384,
+ 2596254646,
+ 62317068,
+ 1957810842,
+ 3939845945,
+ 2647816111,
+ 81470997,
+ 1943803523,
+ 3814918930,
+ 2489596804,
+ 225274430,
+ 2053790376,
+ 3826175755,
+ 2466906013,
+ 167816743,
+ 2097651377,
+ 4027552580,
+ 2265490386,
+ 503444072,
+ 1762050814,
+ 4150417245,
+ 2154129355,
+ 426522225,
+ 1852507879,
+ 4275313526,
+ 2312317920,
+ 282753626,
+ 1742555852,
+ 4189708143,
+ 2394877945,
+ 397917763,
+ 1622183637,
+ 3604390888,
+ 2714866558,
+ 953729732,
+ 1340076626,
+ 3518719985,
+ 2797360999,
+ 1068828381,
+ 1219638859,
+ 3624741850,
+ 2936675148,
+ 906185462,
+ 1090812512,
+ 3747672003,
+ 2825379669,
+ 829329135,
+ 1181335161,
+ 3412177804,
+ 3160834842,
+ 628085408,
+ 1382605366,
+ 3423369109,
+ 3138078467,
+ 570562233,
+ 1426400815,
+ 3317316542,
+ 2998733608,
+ 733239954,
+ 1555261956,
+ 3268935591,
+ 3050360625,
+ 752459403,
+ 1541320221,
+ 2607071920,
+ 3965973030,
+ 1969922972,
+ 40735498,
+ 2617837225,
+ 3943577151,
+ 1913087877,
+ 83908371,
+ 2512341634,
+ 3803740692,
+ 2075208622,
+ 213261112,
+ 2463272603,
+ 3855990285,
+ 2094854071,
+ 198958881,
+ 2262029012,
+ 4057260610,
+ 1759359992,
+ 534414190,
+ 2176718541,
+ 4139329115,
+ 1873836001,
+ 414664567,
+ 2282248934,
+ 4279200368,
+ 1711684554,
+ 285281116,
+ 2405801727,
+ 4167216745,
+ 1634467795,
+ 376229701,
+ 2685067896,
+ 3608007406,
+ 1308918612,
+ 956543938,
+ 2808555105,
+ 3495958263,
+ 1231636301,
+ 1047427035,
+ 2932959818,
+ 3654703836,
+ 1088359270,
+ 936918e3,
+ 2847714899,
+ 3736837829,
+ 1202900863,
+ 817233897,
+ 3183342108,
+ 3401237130,
+ 1404277552,
+ 615818150,
+ 3134207493,
+ 3453421203,
+ 1423857449,
+ 601450431,
+ 3009837614,
+ 3294710456,
+ 1567103746,
+ 711928724,
+ 3020668471,
+ 3272380065,
+ 1510334235,
+ 755167117
+]);
+function ensureBuffer(input) {
+ if (Buffer.isBuffer(input)) {
+ return input;
+ }
+ if (typeof input === "number") {
+ return Buffer.alloc(input);
+ } else if (typeof input === "string") {
+ return Buffer.from(input);
+ } else {
+ throw new Error("input must be buffer, number, or string, received " + typeof input);
+ }
+}
+function bufferizeInt(num) {
+ const tmp = ensureBuffer(4);
+ tmp.writeInt32BE(num, 0);
+ return tmp;
+}
+function _crc32(buf, previous) {
+ buf = ensureBuffer(buf);
+ if (Buffer.isBuffer(previous)) {
+ previous = previous.readUInt32BE(0);
+ }
+ let crc = ~~previous ^ -1;
+ for (var n = 0; n < buf.length; n++) {
+ crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
+ }
+ return crc ^ -1;
+}
+function crc32() {
+ return bufferizeInt(_crc32.apply(null, arguments));
+}
+crc32.signed = function() {
+ return _crc32.apply(null, arguments);
+};
+crc32.unsigned = function() {
+ return _crc32.apply(null, arguments) >>> 0;
+};
+var bufferCrc32 = crc32;
+
+const index = /*@__PURE__*/getDefaultExportFromCjs(bufferCrc32);
+
+export { index as default };
diff --git a/node_modules/buffer-crc32/index.d.ts b/node_modules/buffer-crc32/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ac8fb580f7e9474f7a5e986eac3fd8a4900d3382
--- /dev/null
+++ b/node_modules/buffer-crc32/index.d.ts
@@ -0,0 +1,35 @@
+///
+
+/**
+ * These definitions were written by BendingBender (https://github.com/BendingBender)
+ */
+
+export = crc32;
+
+declare function crc32(input: string | Buffer, partialCrc?: Buffer | number): Buffer;
+
+declare namespace crc32 {
+ /**
+ * Convenience method that returns a signed int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.signed(buf); // -> -1805997238
+ */
+ function signed(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+
+ /**
+ * Convenience method that returns an unsigned int instead of a `Buffer`.
+ *
+ * @example
+ * import crc32 = require('buffer-crc32');
+ *
+ * // works with buffers
+ * const buf = Buffer.from([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]);
+ * crc32.unsigned(buf); // -> 2488970058
+ */
+ function unsigned(buffer: string | Buffer, partialCrc?: Buffer | number): number;
+}
diff --git a/node_modules/buffer-crc32/package.json b/node_modules/buffer-crc32/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..73cbe17e2a84e2f06a22a7a0a5402a2d2a79c7c7
--- /dev/null
+++ b/node_modules/buffer-crc32/package.json
@@ -0,0 +1,54 @@
+{
+ "author": "Brian J. Brennan ",
+ "name": "buffer-crc32",
+ "description": "A pure javascript CRC32 algorithm that plays nice with binary data",
+ "version": "1.0.0",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/brianloveswords/buffer-crc32/raw/master/LICENSE"
+ }
+ ],
+ "contributors": [
+ {
+ "name": "Vladimir Kuznetsov",
+ "github": "mistakster"
+ }
+ ],
+ "homepage": "https://github.com/brianloveswords/buffer-crc32",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/brianloveswords/buffer-crc32.git"
+ },
+ "scripts": {
+ "test": "tap tests/*.test.js --reporter classic",
+ "build": "npx unbuild@2.0.0 && npx cpy-cli index.d.ts dist --rename=index.d.cts && npx cpy-cli index.d.ts dist --rename=index.d.mts",
+ "prepublishOnly": "npm run build",
+ "format": "prettier --write --log-level warn \"**/*.{json,md,js}\""
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "prettier": "^3.2.4",
+ "tap": "~11.1.5"
+ },
+ "optionalDependencies": {},
+ "engines": {
+ "node": ">=8.0.0"
+ },
+ "license": "MIT",
+ "type": "commonjs",
+ "exports": {
+ ".": {
+ "import": "./dist/index.mjs",
+ "require": "./dist/index.cjs"
+ }
+ },
+ "main": "./dist/index.cjs",
+ "types": "./index.d.ts",
+ "files": [
+ "dist",
+ "index.d.ts",
+ "LICENSE",
+ "README.md"
+ ]
+}
diff --git a/node_modules/buffer-from/LICENSE b/node_modules/buffer-from/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..e4bf1d69b1bb0df5acf1278e583264acdc1eefc5
--- /dev/null
+++ b/node_modules/buffer-from/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016, 2018 Linus Unnebäck
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/buffer-from/index.js b/node_modules/buffer-from/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e1a58b5e8a06fd24ce5321aa6b08255dc9d0716d
--- /dev/null
+++ b/node_modules/buffer-from/index.js
@@ -0,0 +1,72 @@
+/* eslint-disable node/no-deprecated-api */
+
+var toString = Object.prototype.toString
+
+var isModern = (
+ typeof Buffer !== 'undefined' &&
+ typeof Buffer.alloc === 'function' &&
+ typeof Buffer.allocUnsafe === 'function' &&
+ typeof Buffer.from === 'function'
+)
+
+function isArrayBuffer (input) {
+ return toString.call(input).slice(8, -1) === 'ArrayBuffer'
+}
+
+function fromArrayBuffer (obj, byteOffset, length) {
+ byteOffset >>>= 0
+
+ var maxLength = obj.byteLength - byteOffset
+
+ if (maxLength < 0) {
+ throw new RangeError("'offset' is out of bounds")
+ }
+
+ if (length === undefined) {
+ length = maxLength
+ } else {
+ length >>>= 0
+
+ if (length > maxLength) {
+ throw new RangeError("'length' is out of bounds")
+ }
+ }
+
+ return isModern
+ ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
+ : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
+}
+
+function fromString (string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('"encoding" must be a valid string encoding')
+ }
+
+ return isModern
+ ? Buffer.from(string, encoding)
+ : new Buffer(string, encoding)
+}
+
+function bufferFrom (value, encodingOrOffset, length) {
+ if (typeof value === 'number') {
+ throw new TypeError('"value" argument must not be a number')
+ }
+
+ if (isArrayBuffer(value)) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'string') {
+ return fromString(value, encodingOrOffset)
+ }
+
+ return isModern
+ ? Buffer.from(value)
+ : new Buffer(value)
+}
+
+module.exports = bufferFrom
diff --git a/node_modules/buffer-from/package.json b/node_modules/buffer-from/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6ac5327bf8621ef03a3df8039518a98ba3d1648a
--- /dev/null
+++ b/node_modules/buffer-from/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "buffer-from",
+ "version": "1.1.2",
+ "license": "MIT",
+ "repository": "LinusU/buffer-from",
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "test": "standard && node test"
+ },
+ "devDependencies": {
+ "standard": "^12.0.1"
+ },
+ "keywords": [
+ "buffer",
+ "buffer from"
+ ]
+}
diff --git a/node_modules/buffer-from/readme.md b/node_modules/buffer-from/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..9880a558a7c91fefb0e6908318fbd991b6b93dcf
--- /dev/null
+++ b/node_modules/buffer-from/readme.md
@@ -0,0 +1,69 @@
+# Buffer From
+
+A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.
+
+## Installation
+
+```sh
+npm install --save buffer-from
+```
+
+## Usage
+
+```js
+const bufferFrom = require('buffer-from')
+
+console.log(bufferFrom([1, 2, 3, 4]))
+//=>
+
+const arr = new Uint8Array([1, 2, 3, 4])
+console.log(bufferFrom(arr.buffer, 1, 2))
+//=>
+
+console.log(bufferFrom('test', 'utf8'))
+//=>
+
+const buf = bufferFrom('test')
+console.log(bufferFrom(buf))
+//=>
+```
+
+## API
+
+### bufferFrom(array)
+
+- `array` <Array>
+
+Allocates a new `Buffer` using an `array` of octets.
+
+### bufferFrom(arrayBuffer[, byteOffset[, length]])
+
+- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer
+- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0`
+- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a TypedArray instance, the
+newly created `Buffer` will share the same allocated memory as the TypedArray.
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+### bufferFrom(buffer)
+
+- `buffer` <Buffer> An existing `Buffer` to copy data from
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+### bufferFrom(string[, encoding])
+
+- `string` <String> A string to encode.
+- `encoding` <String> The encoding of `string`. **Default:** `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `string`. If
+provided, the `encoding` parameter identifies the character encoding of
+`string`.
+
+## See also
+
+- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
+- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`
diff --git a/node_modules/buffer/AUTHORS.md b/node_modules/buffer/AUTHORS.md
new file mode 100644
index 0000000000000000000000000000000000000000..468aa1908c3796cdcad51bdeb239e5840c5d6151
--- /dev/null
+++ b/node_modules/buffer/AUTHORS.md
@@ -0,0 +1,73 @@
+# Authors
+
+#### Ordered by first contribution.
+
+- Romain Beauxis (toots@rastageeks.org)
+- Tobias Koppers (tobias.koppers@googlemail.com)
+- Janus (ysangkok@gmail.com)
+- Rainer Dreyer (rdrey1@gmail.com)
+- Tõnis Tiigi (tonistiigi@gmail.com)
+- James Halliday (mail@substack.net)
+- Michael Williamson (mike@zwobble.org)
+- elliottcable (github@elliottcable.name)
+- rafael (rvalle@livelens.net)
+- Andrew Kelley (superjoe30@gmail.com)
+- Andreas Madsen (amwebdk@gmail.com)
+- Mike Brevoort (mike.brevoort@pearson.com)
+- Brian White (mscdex@mscdex.net)
+- Feross Aboukhadijeh (feross@feross.org)
+- Ruben Verborgh (ruben@verborgh.org)
+- eliang (eliang.cs@gmail.com)
+- Jesse Tane (jesse.tane@gmail.com)
+- Alfonso Boza (alfonso@cloud.com)
+- Mathias Buus (mathiasbuus@gmail.com)
+- Devon Govett (devongovett@gmail.com)
+- Daniel Cousens (github@dcousens.com)
+- Joseph Dykstra (josephdykstra@gmail.com)
+- Parsha Pourkhomami (parshap+git@gmail.com)
+- Damjan Košir (damjan.kosir@gmail.com)
+- daverayment (dave.rayment@gmail.com)
+- kawanet (u-suke@kawa.net)
+- Linus Unnebäck (linus@folkdatorn.se)
+- Nolan Lawson (nolan.lawson@gmail.com)
+- Calvin Metcalf (calvin.metcalf@gmail.com)
+- Koki Takahashi (hakatasiloving@gmail.com)
+- Guy Bedford (guybedford@gmail.com)
+- Jan Schär (jscissr@gmail.com)
+- RaulTsc (tomescu.raul@gmail.com)
+- Matthieu Monsch (monsch@alum.mit.edu)
+- Dan Ehrenberg (littledan@chromium.org)
+- Kirill Fomichev (fanatid@ya.ru)
+- Yusuke Kawasaki (u-suke@kawa.net)
+- DC (dcposch@dcpos.ch)
+- John-David Dalton (john.david.dalton@gmail.com)
+- adventure-yunfei (adventure030@gmail.com)
+- Emil Bay (github@tixz.dk)
+- Sam Sudar (sudar.sam@gmail.com)
+- Volker Mische (volker.mische@gmail.com)
+- David Walton (support@geekstocks.com)
+- Сковорода Никита Андреевич (chalkerx@gmail.com)
+- greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com)
+- ukstv (sergey.ukustov@machinomy.com)
+- Renée Kooi (renee@kooi.me)
+- ranbochen (ranbochen@qq.com)
+- Vladimir Borovik (bobahbdb@gmail.com)
+- greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com)
+- kumavis (aaron@kumavis.me)
+- Sergey Ukustov (sergey.ukustov@machinomy.com)
+- Fei Liu (liu.feiwood@gmail.com)
+- Blaine Bublitz (blaine.bublitz@gmail.com)
+- clement (clement@seald.io)
+- Koushik Dutta (koushd@gmail.com)
+- Jordan Harband (ljharb@gmail.com)
+- Niklas Mischkulnig (mischnic@users.noreply.github.com)
+- Nikolai Vavilov (vvnicholas@gmail.com)
+- Fedor Nezhivoi (gyzerok@users.noreply.github.com)
+- shuse2 (shus.toda@gmail.com)
+- Peter Newman (peternewman@users.noreply.github.com)
+- mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com)
+- jkkang (jkkang@smartauth.kr)
+- Deklan Webster (deklanw@gmail.com)
+- Martin Heidegger (martin.heidegger@gmail.com)
+
+#### Generated by bin/update-authors.sh.
diff --git a/node_modules/buffer/LICENSE b/node_modules/buffer/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..d6bf75dcf1f6f701d4a8fc502f01f93e9d1284f2
--- /dev/null
+++ b/node_modules/buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh, and other contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/buffer/README.md b/node_modules/buffer/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..451e23576b320ad1c6348b75a958cf8a4b0c1c6b
--- /dev/null
+++ b/node_modules/buffer/README.md
@@ -0,0 +1,410 @@
+# buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/buffer
+[npm-image]: https://img.shields.io/npm/v/buffer.svg
+[npm-url]: https://npmjs.org/package/buffer
+[downloads-image]: https://img.shields.io/npm/dm/buffer.svg
+[downloads-url]: https://npmjs.org/package/buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### The buffer module from [node.js](https://nodejs.org/), for the browser.
+
+[![saucelabs][saucelabs-image]][saucelabs-url]
+
+[saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg
+[saucelabs-url]: https://saucelabs.com/u/buffer
+
+With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module.
+
+The goal is to provide an API that is 100% identical to
+[node's Buffer API](https://nodejs.org/api/buffer.html). Read the
+[official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
+instance methods, and class methods that are supported.
+
+## features
+
+- Manipulate binary data like a boss, in all browsers!
+- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`)
+- Extremely small bundle size (**6.75KB minified + gzipped**, 51.9KB with comments)
+- Excellent browser support (Chrome, Firefox, Edge, Safari 11+, iOS 11+, Android, etc.)
+- Preserves Node API exactly, with one minor difference (see below)
+- Square-bracket `buf[4]` notation works!
+- Does not modify any browser prototypes or put anything on `window`
+- Comprehensive test suite (including all buffer tests from node.js core)
+
+## install
+
+To use this module directly (without browserify), install it:
+
+```bash
+npm install buffer
+```
+
+This module was previously called **native-buffer-browserify**, but please use **buffer**
+from now on.
+
+If you do not use a bundler, you can use the [standalone script](https://bundle.run/buffer).
+
+## usage
+
+The module's API is identical to node's `Buffer` API. Read the
+[official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
+instance methods, and class methods that are supported.
+
+As mentioned above, `require('buffer')` or use the `Buffer` global with
+[browserify](http://browserify.org) and this module will automatically be included
+in your bundle. Almost any npm module will work in the browser, even if it assumes that
+the node `Buffer` API will be available.
+
+To depend on this module explicitly (without browserify), require it like this:
+
+```js
+var Buffer = require('buffer/').Buffer // note: the trailing slash is important!
+```
+
+To require this module explicitly, use `require('buffer/')` which tells the node.js module
+lookup algorithm (also used by browserify) to use the **npm module** named `buffer`
+instead of the **node.js core** module named `buffer`!
+
+
+## how does it work?
+
+The Buffer constructor returns instances of `Uint8Array` that have their prototype
+changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`,
+so the returned instances will have all the node `Buffer` methods and the
+`Uint8Array` methods. Square bracket notation works as expected -- it returns a
+single octet.
+
+The `Uint8Array` prototype remains unmodified.
+
+
+## tracking the latest node api
+
+This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer
+API is considered **stable** in the
+[node stability index](https://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index),
+so it is unlikely that there will ever be breaking changes.
+Nonetheless, when/if the Buffer API changes in node, this module's API will change
+accordingly.
+
+## related packages
+
+- [`buffer-reverse`](https://www.npmjs.com/package/buffer-reverse) - Reverse a buffer
+- [`buffer-xor`](https://www.npmjs.com/package/buffer-xor) - Bitwise xor a buffer
+- [`is-buffer`](https://www.npmjs.com/package/is-buffer) - Determine if an object is a Buffer without including the whole `Buffer` package
+
+## conversion packages
+
+### convert typed array to buffer
+
+Use [`typedarray-to-buffer`](https://www.npmjs.com/package/typedarray-to-buffer) to convert any kind of typed array to a `Buffer`. Does not perform a copy, so it's super fast.
+
+### convert buffer to typed array
+
+`Buffer` is a subclass of `Uint8Array` (which is a typed array). So there is no need to explicitly convert to typed array. Just use the buffer as a `Uint8Array`.
+
+### convert blob to buffer
+
+Use [`blob-to-buffer`](https://www.npmjs.com/package/blob-to-buffer) to convert a `Blob` to a `Buffer`.
+
+### convert buffer to blob
+
+To convert a `Buffer` to a `Blob`, use the `Blob` constructor:
+
+```js
+var blob = new Blob([ buffer ])
+```
+
+Optionally, specify a mimetype:
+
+```js
+var blob = new Blob([ buffer ], { type: 'text/html' })
+```
+
+### convert arraybuffer to buffer
+
+To convert an `ArrayBuffer` to a `Buffer`, use the `Buffer.from` function. Does not perform a copy, so it's super fast.
+
+```js
+var buffer = Buffer.from(arrayBuffer)
+```
+
+### convert buffer to arraybuffer
+
+To convert a `Buffer` to an `ArrayBuffer`, use the `.buffer` property (which is present on all `Uint8Array` objects):
+
+```js
+var arrayBuffer = buffer.buffer.slice(
+ buffer.byteOffset, buffer.byteOffset + buffer.byteLength
+)
+```
+
+Alternatively, use the [`to-arraybuffer`](https://www.npmjs.com/package/to-arraybuffer) module.
+
+## performance
+
+See perf tests in `/perf`.
+
+`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a
+sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will
+always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module,
+which is included to compare against.
+
+NOTE: Performance has improved since these benchmarks were taken. PR welcome to update the README.
+
+### Chrome 38
+
+| Method | Operations | Accuracy | Sampled | Fastest |
+|:-------|:-----------|:---------|:--------|:-------:|
+| BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ |
+| Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | |
+| | | | |
+| BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | |
+| Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | |
+| Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | |
+| Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | |
+| Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ |
+| | | | |
+| BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | |
+| Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ |
+| | | | |
+| BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ |
+| DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | |
+| | | | |
+| BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ |
+| DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | |
+| | | | |
+| BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ |
+| DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | |
+| | | | |
+| BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | |
+| Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ |
+| | | | |
+| BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | |
+| DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ |
+
+
+### Firefox 33
+
+| Method | Operations | Accuracy | Sampled | Fastest |
+|:-------|:-----------|:---------|:--------|:-------:|
+| BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | |
+| Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ |
+| | | | |
+| BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | |
+| Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | |
+| Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | |
+| Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | |
+| Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ |
+| | | | |
+| BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | |
+| Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | |
+| DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | |
+| DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ |
+| DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | |
+| | | | |
+| BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | |
+| Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ |
+| | | | |
+| BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | |
+| DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ |
+
+### Safari 8
+
+| Method | Operations | Accuracy | Sampled | Fastest |
+|:-------|:-----------|:---------|:--------|:-------:|
+| BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ |
+| Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | |
+| | | | |
+| BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | |
+| Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | |
+| Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | |
+| Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ |
+| | | | |
+| BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | |
+| Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ |
+| | | | |
+| BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | |
+| Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ |
+| | | | |
+| BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | |
+| DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ |
+| | | | |
+| BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | |
+| DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ |
+| | | | |
+| BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | |
+| DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ |
+| | | | |
+| BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | |
+| Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ |
+| | | | |
+| BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | |
+| DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ |
+
+
+### Node 0.11.14
+
+| Method | Operations | Accuracy | Sampled | Fastest |
+|:-------|:-----------|:---------|:--------|:-------:|
+| BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | |
+| Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ |
+| NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | |
+| | | | |
+| BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | |
+| Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ |
+| NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | |
+| | | | |
+| BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | |
+| Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ |
+| NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | |
+| | | | |
+| BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | |
+| Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ |
+| NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | |
+| | | | |
+| BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | |
+| Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | |
+| NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ |
+| | | | |
+| BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | |
+| Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ |
+| NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | |
+| | | | |
+| BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ |
+| DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | |
+| NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | |
+| | | | |
+| BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ |
+| DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | |
+| NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | |
+| | | | |
+| BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | |
+| DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | |
+| NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ |
+| | | | |
+| BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | |
+| Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ |
+| NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | |
+| | | | |
+| BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | |
+| DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ |
+| NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | |
+
+### iojs 1.8.1
+
+| Method | Operations | Accuracy | Sampled | Fastest |
+|:-------|:-----------|:---------|:--------|:-------:|
+| BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | |
+| Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | |
+| NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ |
+| | | | |
+| BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | |
+| Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | |
+| NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | |
+| Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | |
+| NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ |
+| | | | |
+| BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | |
+| Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ |
+| NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | |
+| | | | |
+| BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | |
+| Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | |
+| NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ |
+| | | | |
+| BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | |
+| Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ |
+| NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | |
+| | | | |
+| BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ |
+| DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | |
+| NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | |
+| | | | |
+| BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ |
+| DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | |
+| NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | |
+| | | | |
+| BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | |
+| DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | |
+| NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ |
+| | | | |
+| BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | |
+| Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | |
+| NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ |
+| | | | |
+| BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | |
+| DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ |
+| NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | |
+| | | | |
+
+## Testing the project
+
+First, install the project:
+
+ npm install
+
+Then, to run tests in Node.js, run:
+
+ npm run test-node
+
+To test locally in a browser, you can run:
+
+ npm run test-browser-es5-local # For ES5 browsers that don't support ES6
+ npm run test-browser-es6-local # For ES6 compliant browsers
+
+This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap).
+
+To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run:
+
+ npm test
+
+This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `bin/airtap-es5.yml` and `bin/airtap-es6.yml` files.
+
+## JavaScript Standard Style
+
+This module uses [JavaScript Standard Style](https://github.com/feross/standard).
+
+[](https://github.com/feross/standard)
+
+To test that the code conforms to the style, `npm install` and run:
+
+ ./node_modules/.bin/standard
+
+## credit
+
+This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify).
+
+## Security Policies and Procedures
+
+The `buffer` team and community take all security bugs in `buffer` seriously. Please see our [security policies and procedures](https://github.com/feross/security) document to learn how to report issues.
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis.
diff --git a/node_modules/buffer/index.d.ts b/node_modules/buffer/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07096a2f725aaccf84776b5e8158ac95038484cf
--- /dev/null
+++ b/node_modules/buffer/index.d.ts
@@ -0,0 +1,194 @@
+export class Buffer extends Uint8Array {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readBigUInt64LE(offset: number): BigInt;
+ readBigUInt64BE(offset: number): BigInt;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readBigInt64LE(offset: number): BigInt;
+ readBigInt64BE(offset: number): BigInt;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ reverse(): this;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeBigUInt64LE(value: number, offset: number): BigInt;
+ writeBigUInt64BE(value: number, offset: number): BigInt;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeBigInt64LE(value: number, offset: number): BigInt;
+ writeBigInt64BE(value: number, offset: number): BigInt;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer | Uint8Array): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Uint8Array[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Uint8Array, buf2: Uint8Array): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initializing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+}
diff --git a/node_modules/buffer/index.js b/node_modules/buffer/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..7a0e9c2a123bc9d26c20bb3de4a3c4e49b24ee40
--- /dev/null
+++ b/node_modules/buffer/index.js
@@ -0,0 +1,2106 @@
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */
+/* eslint-disable no-proto */
+
+'use strict'
+
+const base64 = require('base64-js')
+const ieee754 = require('ieee754')
+const customInspectSymbol =
+ (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
+ ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
+ : null
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+
+const K_MAX_LENGTH = 0x7fffffff
+exports.kMaxLength = K_MAX_LENGTH
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
+ * implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * We report that the browser does not support typed arrays if the are not subclassable
+ * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
+ * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
+ * for __proto__ and has a buggy typed array implementation.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
+
+if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
+ typeof console.error === 'function') {
+ console.error(
+ 'This browser lacks typed array (Uint8Array) support which is required by ' +
+ '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
+ )
+}
+
+function typedArraySupport () {
+ // Can typed array instances can be augmented?
+ try {
+ const arr = new Uint8Array(1)
+ const proto = { foo: function () { return 42 } }
+ Object.setPrototypeOf(proto, Uint8Array.prototype)
+ Object.setPrototypeOf(arr, proto)
+ return arr.foo() === 42
+ } catch (e) {
+ return false
+ }
+}
+
+Object.defineProperty(Buffer.prototype, 'parent', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.buffer
+ }
+})
+
+Object.defineProperty(Buffer.prototype, 'offset', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.byteOffset
+ }
+})
+
+function createBuffer (length) {
+ if (length > K_MAX_LENGTH) {
+ throw new RangeError('The value "' + length + '" is invalid for option "size"')
+ }
+ // Return an augmented `Uint8Array` instance
+ const buf = new Uint8Array(length)
+ Object.setPrototypeOf(buf, Buffer.prototype)
+ return buf
+}
+
+/**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+function Buffer (arg, encodingOrOffset, length) {
+ // Common case.
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new TypeError(
+ 'The "string" argument must be of type string. Received type number'
+ )
+ }
+ return allocUnsafe(arg)
+ }
+ return from(arg, encodingOrOffset, length)
+}
+
+Buffer.poolSize = 8192 // not used by this implementation
+
+function from (value, encodingOrOffset, length) {
+ if (typeof value === 'string') {
+ return fromString(value, encodingOrOffset)
+ }
+
+ if (ArrayBuffer.isView(value)) {
+ return fromArrayView(value)
+ }
+
+ if (value == null) {
+ throw new TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+ }
+
+ if (isInstance(value, ArrayBuffer) ||
+ (value && isInstance(value.buffer, ArrayBuffer))) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof SharedArrayBuffer !== 'undefined' &&
+ (isInstance(value, SharedArrayBuffer) ||
+ (value && isInstance(value.buffer, SharedArrayBuffer)))) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'number') {
+ throw new TypeError(
+ 'The "value" argument must not be of type number. Received type number'
+ )
+ }
+
+ const valueOf = value.valueOf && value.valueOf()
+ if (valueOf != null && valueOf !== value) {
+ return Buffer.from(valueOf, encodingOrOffset, length)
+ }
+
+ const b = fromObject(value)
+ if (b) return b
+
+ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
+ typeof value[Symbol.toPrimitive] === 'function') {
+ return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)
+ }
+
+ throw new TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+}
+
+/**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+Buffer.from = function (value, encodingOrOffset, length) {
+ return from(value, encodingOrOffset, length)
+}
+
+// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
+// https://github.com/feross/buffer/pull/148
+Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
+Object.setPrototypeOf(Buffer, Uint8Array)
+
+function assertSize (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be of type number')
+ } else if (size < 0) {
+ throw new RangeError('The value "' + size + '" is invalid for option "size"')
+ }
+}
+
+function alloc (size, fill, encoding) {
+ assertSize(size)
+ if (size <= 0) {
+ return createBuffer(size)
+ }
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpreted as a start offset.
+ return typeof encoding === 'string'
+ ? createBuffer(size).fill(fill, encoding)
+ : createBuffer(size).fill(fill)
+ }
+ return createBuffer(size)
+}
+
+/**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+Buffer.alloc = function (size, fill, encoding) {
+ return alloc(size, fill, encoding)
+}
+
+function allocUnsafe (size) {
+ assertSize(size)
+ return createBuffer(size < 0 ? 0 : checked(size) | 0)
+}
+
+/**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(size)
+}
+/**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(size)
+}
+
+function fromString (string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+
+ const length = byteLength(string, encoding) | 0
+ let buf = createBuffer(length)
+
+ const actual = buf.write(string, encoding)
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ buf = buf.slice(0, actual)
+ }
+
+ return buf
+}
+
+function fromArrayLike (array) {
+ const length = array.length < 0 ? 0 : checked(array.length) | 0
+ const buf = createBuffer(length)
+ for (let i = 0; i < length; i += 1) {
+ buf[i] = array[i] & 255
+ }
+ return buf
+}
+
+function fromArrayView (arrayView) {
+ if (isInstance(arrayView, Uint8Array)) {
+ const copy = new Uint8Array(arrayView)
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
+ }
+ return fromArrayLike(arrayView)
+}
+
+function fromArrayBuffer (array, byteOffset, length) {
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('"offset" is outside of buffer bounds')
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('"length" is outside of buffer bounds')
+ }
+
+ let buf
+ if (byteOffset === undefined && length === undefined) {
+ buf = new Uint8Array(array)
+ } else if (length === undefined) {
+ buf = new Uint8Array(array, byteOffset)
+ } else {
+ buf = new Uint8Array(array, byteOffset, length)
+ }
+
+ // Return an augmented `Uint8Array` instance
+ Object.setPrototypeOf(buf, Buffer.prototype)
+
+ return buf
+}
+
+function fromObject (obj) {
+ if (Buffer.isBuffer(obj)) {
+ const len = checked(obj.length) | 0
+ const buf = createBuffer(len)
+
+ if (buf.length === 0) {
+ return buf
+ }
+
+ obj.copy(buf, 0, 0, len)
+ return buf
+ }
+
+ if (obj.length !== undefined) {
+ if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
+ return createBuffer(0)
+ }
+ return fromArrayLike(obj)
+ }
+
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
+ return fromArrayLike(obj.data)
+ }
+}
+
+function checked (length) {
+ // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= K_MAX_LENGTH) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (length) {
+ if (+length != length) { // eslint-disable-line eqeqeq
+ length = 0
+ }
+ return Buffer.alloc(+length)
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return b != null && b._isBuffer === true &&
+ b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
+}
+
+Buffer.compare = function compare (a, b) {
+ if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
+ if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError(
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
+ )
+ }
+
+ if (a === b) return 0
+
+ let x = a.length
+ let y = b.length
+
+ for (let i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i]
+ y = b[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!Array.isArray(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0)
+ }
+
+ let i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length
+ }
+ }
+
+ const buffer = Buffer.allocUnsafe(length)
+ let pos = 0
+ for (i = 0; i < list.length; ++i) {
+ let buf = list[i]
+ if (isInstance(buf, Uint8Array)) {
+ if (pos + buf.length > buffer.length) {
+ if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
+ buf.copy(buffer, pos)
+ } else {
+ Uint8Array.prototype.set.call(
+ buffer,
+ buf,
+ pos
+ )
+ }
+ } else if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ } else {
+ buf.copy(buffer, pos)
+ }
+ pos += buf.length
+ }
+ return buffer
+}
+
+function byteLength (string, encoding) {
+ if (Buffer.isBuffer(string)) {
+ return string.length
+ }
+ if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
+ return string.byteLength
+ }
+ if (typeof string !== 'string') {
+ throw new TypeError(
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
+ 'Received type ' + typeof string
+ )
+ }
+
+ const len = string.length
+ const mustMatch = (arguments.length > 2 && arguments[2] === true)
+ if (!mustMatch && len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ let loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) {
+ return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
+ }
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+function slowToString (encoding, start, end) {
+ let loweredCase = false
+
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+ if (start === undefined || start < 0) {
+ start = 0
+ }
+ // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+ if (start > this.length) {
+ return ''
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length
+ }
+
+ if (end <= 0) {
+ return ''
+ }
+
+ // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
+ end >>>= 0
+ start >>>= 0
+
+ if (end <= start) {
+ return ''
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
+// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
+// reliably in a browserify context because there could be multiple different
+// copies of the 'buffer' package in use. This method works even for Buffer
+// instances that were created from another copy of the `buffer` package.
+// See: https://github.com/feross/buffer/issues/154
+Buffer.prototype._isBuffer = true
+
+function swap (b, n, m) {
+ const i = b[n]
+ b[n] = b[m]
+ b[m] = i
+}
+
+Buffer.prototype.swap16 = function swap16 () {
+ const len = this.length
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
+ }
+ for (let i = 0; i < len; i += 2) {
+ swap(this, i, i + 1)
+ }
+ return this
+}
+
+Buffer.prototype.swap32 = function swap32 () {
+ const len = this.length
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
+ }
+ for (let i = 0; i < len; i += 4) {
+ swap(this, i, i + 3)
+ swap(this, i + 1, i + 2)
+ }
+ return this
+}
+
+Buffer.prototype.swap64 = function swap64 () {
+ const len = this.length
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
+ }
+ for (let i = 0; i < len; i += 8) {
+ swap(this, i, i + 7)
+ swap(this, i + 1, i + 6)
+ swap(this, i + 2, i + 5)
+ swap(this, i + 3, i + 4)
+ }
+ return this
+}
+
+Buffer.prototype.toString = function toString () {
+ const length = this.length
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.toLocaleString = Buffer.prototype.toString
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ let str = ''
+ const max = exports.INSPECT_MAX_BYTES
+ str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
+ if (this.length > max) str += ' ... '
+ return ''
+}
+if (customInspectSymbol) {
+ Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
+}
+
+Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ if (isInstance(target, Uint8Array)) {
+ target = Buffer.from(target, target.offset, target.byteLength)
+ }
+ if (!Buffer.isBuffer(target)) {
+ throw new TypeError(
+ 'The "target" argument must be one of type Buffer or Uint8Array. ' +
+ 'Received type ' + (typeof target)
+ )
+ }
+
+ if (start === undefined) {
+ start = 0
+ }
+ if (end === undefined) {
+ end = target ? target.length : 0
+ }
+ if (thisStart === undefined) {
+ thisStart = 0
+ }
+ if (thisEnd === undefined) {
+ thisEnd = this.length
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index')
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0
+ }
+ if (thisStart >= thisEnd) {
+ return -1
+ }
+ if (start >= end) {
+ return 1
+ }
+
+ start >>>= 0
+ end >>>= 0
+ thisStart >>>= 0
+ thisEnd >>>= 0
+
+ if (this === target) return 0
+
+ let x = thisEnd - thisStart
+ let y = end - start
+ const len = Math.min(x, y)
+
+ const thisCopy = this.slice(thisStart, thisEnd)
+ const targetCopy = target.slice(start, end)
+
+ for (let i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i]
+ y = targetCopy[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+//
+// Arguments:
+// - buffer - a Buffer to search
+// - val - a string, Buffer, or number
+// - byteOffset - an index into `buffer`; will be clamped to an int32
+// - encoding - an optional encoding, relevant is val is a string
+// - dir - true for indexOf, false for lastIndexOf
+function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1
+
+ // Normalize byteOffset
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset
+ byteOffset = 0
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000
+ }
+ byteOffset = +byteOffset // Coerce to Number.
+ if (numberIsNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : (buffer.length - 1)
+ }
+
+ // Normalize byteOffset: negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1
+ else byteOffset = buffer.length - 1
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0
+ else return -1
+ }
+
+ // Normalize val
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding)
+ }
+
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
+ if (Buffer.isBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1
+ }
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+ } else if (typeof val === 'number') {
+ val = val & 0xFF // Search for a byte value [0-255]
+ if (typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+ }
+ }
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+ let indexSize = 1
+ let arrLength = arr.length
+ let valLength = val.length
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase()
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+ encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1
+ }
+ indexSize = 2
+ arrLength /= 2
+ valLength /= 2
+ byteOffset /= 2
+ }
+ }
+
+ function read (buf, i) {
+ if (indexSize === 1) {
+ return buf[i]
+ } else {
+ return buf.readUInt16BE(i * indexSize)
+ }
+ }
+
+ let i
+ if (dir) {
+ let foundIndex = -1
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex
+ foundIndex = -1
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
+ for (i = byteOffset; i >= 0; i--) {
+ let found = true
+ for (let j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false
+ break
+ }
+ }
+ if (found) return i
+ }
+ }
+
+ return -1
+}
+
+Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+}
+
+Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ const remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ const strLen = string.length
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ let i
+ for (i = 0; i < length; ++i) {
+ const parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (numberIsNaN(parsed)) return i
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset >>> 0
+ if (isFinite(length)) {
+ length = length >>> 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ } else {
+ throw new Error(
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+ )
+ }
+
+ const remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ let loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return asciiWrite(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end)
+ const res = []
+
+ let i = start
+ while (i < end) {
+ const firstByte = buf[i]
+ let codePoint = null
+ let bytesPerSequence = (firstByte > 0xEF)
+ ? 4
+ : (firstByte > 0xDF)
+ ? 3
+ : (firstByte > 0xBF)
+ ? 2
+ : 1
+
+ if (i + bytesPerSequence <= end) {
+ let secondByte, thirdByte, fourthByte, tempCodePoint
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1]
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ fourthByte = buf[i + 3]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD
+ bytesPerSequence = 1
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+ codePoint = 0xDC00 | codePoint & 0x3FF
+ }
+
+ res.push(codePoint)
+ i += bytesPerSequence
+ }
+
+ return decodeCodePointsArray(res)
+}
+
+// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+// the lowest limit is Chrome, with 0x10000 args.
+// We go 1 magnitude less, for safety
+const MAX_ARGUMENTS_LENGTH = 0x1000
+
+function decodeCodePointsArray (codePoints) {
+ const len = codePoints.length
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ let res = ''
+ let i = 0
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ )
+ }
+ return res
+}
+
+function asciiSlice (buf, start, end) {
+ let ret = ''
+ end = Math.min(buf.length, end)
+
+ for (let i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function latin1Slice (buf, start, end) {
+ let ret = ''
+ end = Math.min(buf.length, end)
+
+ for (let i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ const len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ let out = ''
+ for (let i = start; i < end; ++i) {
+ out += hexSliceLookupTable[buf[i]]
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ const bytes = buf.slice(start, end)
+ let res = ''
+ // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
+ for (let i = 0; i < bytes.length - 1; i += 2) {
+ res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ const len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ const newBuf = this.subarray(start, end)
+ // Return an augmented `Uint8Array` instance
+ Object.setPrototypeOf(newBuf, Buffer.prototype)
+
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUintLE =
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ let val = this[offset]
+ let mul = 1
+ let i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUintBE =
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ let val = this[offset + --byteLength]
+ let mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUint8 =
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUint16LE =
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUint16BE =
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUint32LE =
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUint32BE =
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {
+ offset = offset >>> 0
+ validateNumber(offset, 'offset')
+ const first = this[offset]
+ const last = this[offset + 7]
+ if (first === undefined || last === undefined) {
+ boundsError(offset, this.length - 8)
+ }
+
+ const lo = first +
+ this[++offset] * 2 ** 8 +
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 24
+
+ const hi = this[++offset] +
+ this[++offset] * 2 ** 8 +
+ this[++offset] * 2 ** 16 +
+ last * 2 ** 24
+
+ return BigInt(lo) + (BigInt(hi) << BigInt(32))
+})
+
+Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {
+ offset = offset >>> 0
+ validateNumber(offset, 'offset')
+ const first = this[offset]
+ const last = this[offset + 7]
+ if (first === undefined || last === undefined) {
+ boundsError(offset, this.length - 8)
+ }
+
+ const hi = first * 2 ** 24 +
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 8 +
+ this[++offset]
+
+ const lo = this[++offset] * 2 ** 24 +
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 8 +
+ last
+
+ return (BigInt(hi) << BigInt(32)) + BigInt(lo)
+})
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ let val = this[offset]
+ let mul = 1
+ let i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ let i = byteLength
+ let mul = 1
+ let val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ const val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ const val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {
+ offset = offset >>> 0
+ validateNumber(offset, 'offset')
+ const first = this[offset]
+ const last = this[offset + 7]
+ if (first === undefined || last === undefined) {
+ boundsError(offset, this.length - 8)
+ }
+
+ const val = this[offset + 4] +
+ this[offset + 5] * 2 ** 8 +
+ this[offset + 6] * 2 ** 16 +
+ (last << 24) // Overflow
+
+ return (BigInt(val) << BigInt(32)) +
+ BigInt(first +
+ this[++offset] * 2 ** 8 +
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 24)
+})
+
+Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {
+ offset = offset >>> 0
+ validateNumber(offset, 'offset')
+ const first = this[offset]
+ const last = this[offset + 7]
+ if (first === undefined || last === undefined) {
+ boundsError(offset, this.length - 8)
+ }
+
+ const val = (first << 24) + // Overflow
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 8 +
+ this[++offset]
+
+ return (BigInt(val) << BigInt(32)) +
+ BigInt(this[++offset] * 2 ** 24 +
+ this[++offset] * 2 ** 16 +
+ this[++offset] * 2 ** 8 +
+ last)
+})
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+}
+
+Buffer.prototype.writeUintLE =
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ const maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ let mul = 1
+ let i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUintBE =
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ const maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ let i = byteLength - 1
+ let mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUint8 =
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeUint16LE =
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeUint16BE =
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeUint32LE =
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeUint32BE =
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+function wrtBigUInt64LE (buf, value, offset, min, max) {
+ checkIntBI(value, min, max, buf, offset, 7)
+
+ let lo = Number(value & BigInt(0xffffffff))
+ buf[offset++] = lo
+ lo = lo >> 8
+ buf[offset++] = lo
+ lo = lo >> 8
+ buf[offset++] = lo
+ lo = lo >> 8
+ buf[offset++] = lo
+ let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
+ buf[offset++] = hi
+ hi = hi >> 8
+ buf[offset++] = hi
+ hi = hi >> 8
+ buf[offset++] = hi
+ hi = hi >> 8
+ buf[offset++] = hi
+ return offset
+}
+
+function wrtBigUInt64BE (buf, value, offset, min, max) {
+ checkIntBI(value, min, max, buf, offset, 7)
+
+ let lo = Number(value & BigInt(0xffffffff))
+ buf[offset + 7] = lo
+ lo = lo >> 8
+ buf[offset + 6] = lo
+ lo = lo >> 8
+ buf[offset + 5] = lo
+ lo = lo >> 8
+ buf[offset + 4] = lo
+ let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
+ buf[offset + 3] = hi
+ hi = hi >> 8
+ buf[offset + 2] = hi
+ hi = hi >> 8
+ buf[offset + 1] = hi
+ hi = hi >> 8
+ buf[offset] = hi
+ return offset + 8
+}
+
+Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {
+ return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
+})
+
+Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {
+ return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
+})
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ const limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ let i = 0
+ let mul = 1
+ let sub = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ const limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ let i = byteLength - 1
+ let mul = 1
+ let sub = 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {
+ return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
+})
+
+Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {
+ return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
+})
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ if (offset < 0) throw new RangeError('Index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ const len = end - start
+
+ if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
+ // Use built-in when available, missing from IE11
+ this.copyWithin(targetStart, start, end)
+ } else {
+ Uint8Array.prototype.set.call(
+ target,
+ this.subarray(start, end),
+ targetStart
+ )
+ }
+
+ return len
+}
+
+// Usage:
+// buffer.fill(number[, offset[, end]])
+// buffer.fill(buffer[, offset[, end]])
+// buffer.fill(string[, offset[, end]][, encoding])
+Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start
+ start = 0
+ end = this.length
+ } else if (typeof end === 'string') {
+ encoding = end
+ end = this.length
+ }
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string')
+ }
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+ if (val.length === 1) {
+ const code = val.charCodeAt(0)
+ if ((encoding === 'utf8' && code < 128) ||
+ encoding === 'latin1') {
+ // Fast path: If `val` fits into a single byte, use that numeric value.
+ val = code
+ }
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255
+ } else if (typeof val === 'boolean') {
+ val = Number(val)
+ }
+
+ // Invalid ranges are not set to a default, so can range check early.
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index')
+ }
+
+ if (end <= start) {
+ return this
+ }
+
+ start = start >>> 0
+ end = end === undefined ? this.length : end >>> 0
+
+ if (!val) val = 0
+
+ let i
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val
+ }
+ } else {
+ const bytes = Buffer.isBuffer(val)
+ ? val
+ : Buffer.from(val, encoding)
+ const len = bytes.length
+ if (len === 0) {
+ throw new TypeError('The value "' + val +
+ '" is invalid for argument "value"')
+ }
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+// CUSTOM ERRORS
+// =============
+
+// Simplified versions from Node, changed for Buffer-only usage
+const errors = {}
+function E (sym, getMessage, Base) {
+ errors[sym] = class NodeError extends Base {
+ constructor () {
+ super()
+
+ Object.defineProperty(this, 'message', {
+ value: getMessage.apply(this, arguments),
+ writable: true,
+ configurable: true
+ })
+
+ // Add the error code to the name to include it in the stack trace.
+ this.name = `${this.name} [${sym}]`
+ // Access the stack to generate the error message including the error code
+ // from the name.
+ this.stack // eslint-disable-line no-unused-expressions
+ // Reset the name to the actual name.
+ delete this.name
+ }
+
+ get code () {
+ return sym
+ }
+
+ set code (value) {
+ Object.defineProperty(this, 'code', {
+ configurable: true,
+ enumerable: true,
+ value,
+ writable: true
+ })
+ }
+
+ toString () {
+ return `${this.name} [${sym}]: ${this.message}`
+ }
+ }
+}
+
+E('ERR_BUFFER_OUT_OF_BOUNDS',
+ function (name) {
+ if (name) {
+ return `${name} is outside of buffer bounds`
+ }
+
+ return 'Attempt to access memory outside buffer bounds'
+ }, RangeError)
+E('ERR_INVALID_ARG_TYPE',
+ function (name, actual) {
+ return `The "${name}" argument must be of type number. Received type ${typeof actual}`
+ }, TypeError)
+E('ERR_OUT_OF_RANGE',
+ function (str, range, input) {
+ let msg = `The value of "${str}" is out of range.`
+ let received = input
+ if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
+ received = addNumericalSeparator(String(input))
+ } else if (typeof input === 'bigint') {
+ received = String(input)
+ if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
+ received = addNumericalSeparator(received)
+ }
+ received += 'n'
+ }
+ msg += ` It must be ${range}. Received ${received}`
+ return msg
+ }, RangeError)
+
+function addNumericalSeparator (val) {
+ let res = ''
+ let i = val.length
+ const start = val[0] === '-' ? 1 : 0
+ for (; i >= start + 4; i -= 3) {
+ res = `_${val.slice(i - 3, i)}${res}`
+ }
+ return `${val.slice(0, i)}${res}`
+}
+
+// CHECK FUNCTIONS
+// ===============
+
+function checkBounds (buf, offset, byteLength) {
+ validateNumber(offset, 'offset')
+ if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
+ boundsError(offset, buf.length - (byteLength + 1))
+ }
+}
+
+function checkIntBI (value, min, max, buf, offset, byteLength) {
+ if (value > max || value < min) {
+ const n = typeof min === 'bigint' ? 'n' : ''
+ let range
+ if (byteLength > 3) {
+ if (min === 0 || min === BigInt(0)) {
+ range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`
+ } else {
+ range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +
+ `${(byteLength + 1) * 8 - 1}${n}`
+ }
+ } else {
+ range = `>= ${min}${n} and <= ${max}${n}`
+ }
+ throw new errors.ERR_OUT_OF_RANGE('value', range, value)
+ }
+ checkBounds(buf, offset, byteLength)
+}
+
+function validateNumber (value, name) {
+ if (typeof value !== 'number') {
+ throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)
+ }
+}
+
+function boundsError (value, length, type) {
+ if (Math.floor(value) !== value) {
+ validateNumber(value, type)
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)
+ }
+
+ if (length < 0) {
+ throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()
+ }
+
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset',
+ `>= ${type ? 1 : 0} and <= ${length}`,
+ value)
+}
+
+// HELPER FUNCTIONS
+// ================
+
+const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
+
+function base64clean (str) {
+ // Node takes equal signs as end of the Base64 encoding
+ str = str.split('=')[0]
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = str.trim().replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ let codePoint
+ const length = string.length
+ let leadSurrogate = null
+ const bytes = []
+
+ for (let i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ }
+
+ leadSurrogate = null
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ const byteArray = []
+ for (let i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ let c, hi, lo
+ const byteArray = []
+ for (let i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ let i
+ for (i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
+// the `instanceof` check but they should be treated as of that type.
+// See: https://github.com/feross/buffer/issues/166
+function isInstance (obj, type) {
+ return obj instanceof type ||
+ (obj != null && obj.constructor != null && obj.constructor.name != null &&
+ obj.constructor.name === type.name)
+}
+function numberIsNaN (obj) {
+ // For IE11 support
+ return obj !== obj // eslint-disable-line no-self-compare
+}
+
+// Create lookup table for `toString('hex')`
+// See: https://github.com/feross/buffer/issues/219
+const hexSliceLookupTable = (function () {
+ const alphabet = '0123456789abcdef'
+ const table = new Array(256)
+ for (let i = 0; i < 16; ++i) {
+ const i16 = i * 16
+ for (let j = 0; j < 16; ++j) {
+ table[i16 + j] = alphabet[i] + alphabet[j]
+ }
+ }
+ return table
+})()
+
+// Return not function with Error if BigInt not supported
+function defineBigIntMethod (fn) {
+ return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn
+}
+
+function BufferBigIntNotDefined () {
+ throw new Error('BigInt not supported')
+}
diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..ca1ad9a7078842734ba1f3e459c06c3d8d6c96af
--- /dev/null
+++ b/node_modules/buffer/package.json
@@ -0,0 +1,93 @@
+{
+ "name": "buffer",
+ "description": "Node.js Buffer API, for the browser",
+ "version": "6.0.3",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "https://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/buffer/issues"
+ },
+ "contributors": [
+ "Romain Beauxis ",
+ "James Halliday "
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ },
+ "devDependencies": {
+ "airtap": "^3.0.0",
+ "benchmark": "^2.1.4",
+ "browserify": "^17.0.0",
+ "concat-stream": "^2.0.0",
+ "hyperquest": "^2.1.3",
+ "is-buffer": "^2.0.5",
+ "is-nan": "^1.3.0",
+ "split": "^1.0.1",
+ "standard": "*",
+ "tape": "^5.0.1",
+ "through2": "^4.0.2",
+ "uglify-js": "^3.11.5"
+ },
+ "homepage": "https://github.com/feross/buffer",
+ "jspm": {
+ "map": {
+ "./index.js": {
+ "node": "@node/buffer"
+ }
+ }
+ },
+ "keywords": [
+ "arraybuffer",
+ "browser",
+ "browserify",
+ "buffer",
+ "compatible",
+ "dataview",
+ "uint8array"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/buffer.git"
+ },
+ "scripts": {
+ "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html",
+ "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js",
+ "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c",
+ "test": "standard && node ./bin/test.js",
+ "test-browser-old": "airtap -- test/*.js",
+ "test-browser-old-local": "airtap --local -- test/*.js",
+ "test-browser-new": "airtap -- test/*.js test/node/*.js",
+ "test-browser-new-local": "airtap --local -- test/*.js test/node/*.js",
+ "test-node": "tape test/*.js test/node/*.js",
+ "update-authors": "./bin/update-authors.sh"
+ },
+ "standard": {
+ "ignore": [
+ "test/node/**/*.js",
+ "test/common.js",
+ "test/_polyfill.js",
+ "perf/**/*.js"
+ ]
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+}
diff --git a/node_modules/busboy/.eslintrc.js b/node_modules/busboy/.eslintrc.js
new file mode 100644
index 0000000000000000000000000000000000000000..be9311d02655a22381f13078bfe868bcbd85b3a6
--- /dev/null
+++ b/node_modules/busboy/.eslintrc.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = {
+ extends: '@mscdex/eslint-config',
+};
diff --git a/node_modules/busboy/.github/workflows/ci.yml b/node_modules/busboy/.github/workflows/ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..799bae04adb62ae5b327afff21a37b8ab841ec2f
--- /dev/null
+++ b/node_modules/busboy/.github/workflows/ci.yml
@@ -0,0 +1,24 @@
+name: CI
+
+on:
+ pull_request:
+ push:
+ branches: [ master ]
+
+jobs:
+ tests-linux:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version: [10.16.0, 10.x, 12.x, 14.x, 16.x]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Install module
+ run: npm install
+ - name: Run tests
+ run: npm test
diff --git a/node_modules/busboy/.github/workflows/lint.yml b/node_modules/busboy/.github/workflows/lint.yml
new file mode 100644
index 0000000000000000000000000000000000000000..9f9e1f589a30be583a860f928382b3033c38749d
--- /dev/null
+++ b/node_modules/busboy/.github/workflows/lint.yml
@@ -0,0 +1,23 @@
+name: lint
+
+on:
+ pull_request:
+ push:
+ branches: [ master ]
+
+env:
+ NODE_VERSION: 16.x
+
+jobs:
+ lint-js:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ env.NODE_VERSION }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ - name: Install ESLint + ESLint configs/plugins
+ run: npm install --only=dev
+ - name: Lint files
+ run: npm run lint
diff --git a/node_modules/busboy/LICENSE b/node_modules/busboy/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..290762e94f4e2f2b52cc13ae4f2b63ac0269bfd1
--- /dev/null
+++ b/node_modules/busboy/LICENSE
@@ -0,0 +1,19 @@
+Copyright Brian White. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/busboy/README.md b/node_modules/busboy/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..654af30455614e47ad22cf53d1235f7c928bf42a
--- /dev/null
+++ b/node_modules/busboy/README.md
@@ -0,0 +1,191 @@
+# Description
+
+A node.js module for parsing incoming HTML form data.
+
+Changes (breaking or otherwise) in v1.0.0 can be found [here](https://github.com/mscdex/busboy/issues/266).
+
+# Requirements
+
+* [node.js](http://nodejs.org/) -- v10.16.0 or newer
+
+
+# Install
+
+ npm install busboy
+
+
+# Examples
+
+* Parsing (multipart) with default options:
+
+```js
+const http = require('http');
+
+const busboy = require('busboy');
+
+http.createServer((req, res) => {
+ if (req.method === 'POST') {
+ console.log('POST request');
+ const bb = busboy({ headers: req.headers });
+ bb.on('file', (name, file, info) => {
+ const { filename, encoding, mimeType } = info;
+ console.log(
+ `File [${name}]: filename: %j, encoding: %j, mimeType: %j`,
+ filename,
+ encoding,
+ mimeType
+ );
+ file.on('data', (data) => {
+ console.log(`File [${name}] got ${data.length} bytes`);
+ }).on('close', () => {
+ console.log(`File [${name}] done`);
+ });
+ });
+ bb.on('field', (name, val, info) => {
+ console.log(`Field [${name}]: value: %j`, val);
+ });
+ bb.on('close', () => {
+ console.log('Done parsing form!');
+ res.writeHead(303, { Connection: 'close', Location: '/' });
+ res.end();
+ });
+ req.pipe(bb);
+ } else if (req.method === 'GET') {
+ res.writeHead(200, { Connection: 'close' });
+ res.end(`
+
+
+
+
+
+
+ `);
+ }
+}).listen(8000, () => {
+ console.log('Listening for requests');
+});
+
+// Example output:
+//
+// Listening for requests
+// < ... form submitted ... >
+// POST request
+// File [filefield]: filename: "logo.jpg", encoding: "binary", mime: "image/jpeg"
+// File [filefield] got 11912 bytes
+// Field [textfield]: value: "testing! :-)"
+// File [filefield] done
+// Done parsing form!
+```
+
+* Save all incoming files to disk:
+
+```js
+const { randomFillSync } = require('crypto');
+const fs = require('fs');
+const http = require('http');
+const os = require('os');
+const path = require('path');
+
+const busboy = require('busboy');
+
+const random = (() => {
+ const buf = Buffer.alloc(16);
+ return () => randomFillSync(buf).toString('hex');
+})();
+
+http.createServer((req, res) => {
+ if (req.method === 'POST') {
+ const bb = busboy({ headers: req.headers });
+ bb.on('file', (name, file, info) => {
+ const saveTo = path.join(os.tmpdir(), `busboy-upload-${random()}`);
+ file.pipe(fs.createWriteStream(saveTo));
+ });
+ bb.on('close', () => {
+ res.writeHead(200, { 'Connection': 'close' });
+ res.end(`That's all folks!`);
+ });
+ req.pipe(bb);
+ return;
+ }
+ res.writeHead(404);
+ res.end();
+}).listen(8000, () => {
+ console.log('Listening for requests');
+});
+```
+
+
+# API
+
+## Exports
+
+`busboy` exports a single function:
+
+**( _function_ )**(< _object_ >config) - Creates and returns a new _Writable_ form parser stream.
+
+* Valid `config` properties:
+
+ * **headers** - _object_ - These are the HTTP headers of the incoming request, which are used by individual parsers.
+
+ * **highWaterMark** - _integer_ - highWaterMark to use for the parser stream. **Default:** node's _stream.Writable_ default.
+
+ * **fileHwm** - _integer_ - highWaterMark to use for individual file streams. **Default:** node's _stream.Readable_ default.
+
+ * **defCharset** - _string_ - Default character set to use when one isn't defined. **Default:** `'utf8'`.
+
+ * **defParamCharset** - _string_ - For multipart forms, the default character set to use for values of part header parameters (e.g. filename) that are not extended parameters (that contain an explicit charset). **Default:** `'latin1'`.
+
+ * **preservePath** - _boolean_ - If paths in filenames from file parts in a `'multipart/form-data'` request shall be preserved. **Default:** `false`.
+
+ * **limits** - _object_ - Various limits on incoming data. Valid properties are:
+
+ * **fieldNameSize** - _integer_ - Max field name size (in bytes). **Default:** `100`.
+
+ * **fieldSize** - _integer_ - Max field value size (in bytes). **Default:** `1048576` (1MB).
+
+ * **fields** - _integer_ - Max number of non-file fields. **Default:** `Infinity`.
+
+ * **fileSize** - _integer_ - For multipart forms, the max file size (in bytes). **Default:** `Infinity`.
+
+ * **files** - _integer_ - For multipart forms, the max number of file fields. **Default:** `Infinity`.
+
+ * **parts** - _integer_ - For multipart forms, the max number of parts (fields + files). **Default:** `Infinity`.
+
+ * **headerPairs** - _integer_ - For multipart forms, the max number of header key-value pairs to parse. **Default:** `2000` (same as node's http module).
+
+This function can throw exceptions if there is something wrong with the values in `config`. For example, if the Content-Type in `headers` is missing entirely, is not a supported type, or is missing the boundary for `'multipart/form-data'` requests.
+
+## (Special) Parser stream events
+
+* **file**(< _string_ >name, < _Readable_ >stream, < _object_ >info) - Emitted for each new file found. `name` contains the form field name. `stream` is a _Readable_ stream containing the file's data. No transformations/conversions (e.g. base64 to raw binary) are done on the file's data. `info` contains the following properties:
+
+ * `filename` - _string_ - If supplied, this contains the file's filename. **WARNING:** You should almost _never_ use this value as-is (especially if you are using `preservePath: true` in your `config`) as it could contain malicious input. You are better off generating your own (safe) filenames, or at the very least using a hash of the filename.
+
+ * `encoding` - _string_ - The file's `'Content-Transfer-Encoding'` value.
+
+ * `mimeType` - _string_ - The file's `'Content-Type'` value.
+
+ **Note:** If you listen for this event, you should always consume the `stream` whether you care about its contents or not (you can simply do `stream.resume();` if you want to discard/skip the contents), otherwise the `'finish'`/`'close'` event will never fire on the busboy parser stream.
+ However, if you aren't accepting files, you can either simply not listen for the `'file'` event at all or set `limits.files` to `0`, and any/all files will be automatically skipped (these skipped files will still count towards any configured `limits.files` and `limits.parts` limits though).
+
+ **Note:** If a configured `limits.fileSize` limit was reached for a file, `stream` will both have a boolean property `truncated` set to `true` (best checked at the end of the stream) and emit a `'limit'` event to notify you when this happens.
+
+* **field**(< _string_ >name, < _string_ >value, < _object_ >info) - Emitted for each new non-file field found. `name` contains the form field name. `value` contains the string value of the field. `info` contains the following properties:
+
+ * `nameTruncated` - _boolean_ - Whether `name` was truncated or not (due to a configured `limits.fieldNameSize` limit)
+
+ * `valueTruncated` - _boolean_ - Whether `value` was truncated or not (due to a configured `limits.fieldSize` limit)
+
+ * `encoding` - _string_ - The field's `'Content-Transfer-Encoding'` value.
+
+ * `mimeType` - _string_ - The field's `'Content-Type'` value.
+
+* **partsLimit**() - Emitted when the configured `limits.parts` limit has been reached. No more `'file'` or `'field'` events will be emitted.
+
+* **filesLimit**() - Emitted when the configured `limits.files` limit has been reached. No more `'file'` events will be emitted.
+
+* **fieldsLimit**() - Emitted when the configured `limits.fields` limit has been reached. No more `'field'` events will be emitted.
diff --git a/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js b/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js
new file mode 100644
index 0000000000000000000000000000000000000000..ef15729ea65c38a6c470d7abe63211efb0945c22
--- /dev/null
+++ b/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js
@@ -0,0 +1,149 @@
+'use strict';
+
+function createMultipartBuffers(boundary, sizes) {
+ const bufs = [];
+ for (let i = 0; i < sizes.length; ++i) {
+ const mb = sizes[i] * 1024 * 1024;
+ bufs.push(Buffer.from([
+ `--${boundary}`,
+ `content-disposition: form-data; name="field${i + 1}"`,
+ '',
+ '0'.repeat(mb),
+ '',
+ ].join('\r\n')));
+ }
+ bufs.push(Buffer.from([
+ `--${boundary}--`,
+ '',
+ ].join('\r\n')));
+ return bufs;
+}
+
+const boundary = '-----------------------------168072824752491622650073';
+const buffers = createMultipartBuffers(boundary, [
+ 10,
+ 10,
+ 10,
+ 20,
+ 50,
+]);
+const calls = {
+ partBegin: 0,
+ headerField: 0,
+ headerValue: 0,
+ headerEnd: 0,
+ headersEnd: 0,
+ partData: 0,
+ partEnd: 0,
+ end: 0,
+};
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ },
+ });
+ parser.on('field', (name, val, info) => {
+ ++calls.partBegin;
+ ++calls.partData;
+ ++calls.partEnd;
+ }).on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+ break;
+ }
+
+ case 'formidable': {
+ const { MultipartParser } = require('formidable');
+
+ const parser = new MultipartParser();
+ parser.initWithBoundary(boundary);
+ parser.on('data', ({ name }) => {
+ ++calls[name];
+ if (name === 'end')
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+
+ break;
+ }
+
+ case 'multiparty': {
+ const { Readable } = require('stream');
+
+ const { Form } = require('multiparty');
+
+ const form = new Form({
+ maxFieldsSize: Infinity,
+ maxFields: Infinity,
+ maxFilesSize: Infinity,
+ autoFields: false,
+ autoFiles: false,
+ });
+
+ const req = new Readable({ read: () => {} });
+ req.headers = {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ };
+
+ function hijack(name, fn) {
+ const oldFn = form[name];
+ form[name] = function() {
+ fn();
+ return oldFn.apply(this, arguments);
+ };
+ }
+
+ hijack('onParseHeaderField', () => {
+ ++calls.headerField;
+ });
+ hijack('onParseHeaderValue', () => {
+ ++calls.headerValue;
+ });
+ hijack('onParsePartBegin', () => {
+ ++calls.partBegin;
+ });
+ hijack('onParsePartData', () => {
+ ++calls.partData;
+ });
+ hijack('onParsePartEnd', () => {
+ ++calls.partEnd;
+ });
+
+ form.on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ }).on('part', (p) => p.resume());
+
+ console.time(moduleName);
+ form.parse(req);
+ for (const buf of buffers)
+ req.push(buf);
+ req.push(null);
+
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js b/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js
new file mode 100644
index 0000000000000000000000000000000000000000..f32d421c735d323b2b0d7ef478b1d612a939b1a5
--- /dev/null
+++ b/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js
@@ -0,0 +1,143 @@
+'use strict';
+
+function createMultipartBuffers(boundary, sizes) {
+ const bufs = [];
+ for (let i = 0; i < sizes.length; ++i) {
+ const mb = sizes[i] * 1024 * 1024;
+ bufs.push(Buffer.from([
+ `--${boundary}`,
+ `content-disposition: form-data; name="field${i + 1}"`,
+ '',
+ '0'.repeat(mb),
+ '',
+ ].join('\r\n')));
+ }
+ bufs.push(Buffer.from([
+ `--${boundary}--`,
+ '',
+ ].join('\r\n')));
+ return bufs;
+}
+
+const boundary = '-----------------------------168072824752491622650073';
+const buffers = createMultipartBuffers(boundary, (new Array(100)).fill(1));
+const calls = {
+ partBegin: 0,
+ headerField: 0,
+ headerValue: 0,
+ headerEnd: 0,
+ headersEnd: 0,
+ partData: 0,
+ partEnd: 0,
+ end: 0,
+};
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ },
+ });
+ parser.on('field', (name, val, info) => {
+ ++calls.partBegin;
+ ++calls.partData;
+ ++calls.partEnd;
+ }).on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+ break;
+ }
+
+ case 'formidable': {
+ const { MultipartParser } = require('formidable');
+
+ const parser = new MultipartParser();
+ parser.initWithBoundary(boundary);
+ parser.on('data', ({ name }) => {
+ ++calls[name];
+ if (name === 'end')
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+
+ break;
+ }
+
+ case 'multiparty': {
+ const { Readable } = require('stream');
+
+ const { Form } = require('multiparty');
+
+ const form = new Form({
+ maxFieldsSize: Infinity,
+ maxFields: Infinity,
+ maxFilesSize: Infinity,
+ autoFields: false,
+ autoFiles: false,
+ });
+
+ const req = new Readable({ read: () => {} });
+ req.headers = {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ };
+
+ function hijack(name, fn) {
+ const oldFn = form[name];
+ form[name] = function() {
+ fn();
+ return oldFn.apply(this, arguments);
+ };
+ }
+
+ hijack('onParseHeaderField', () => {
+ ++calls.headerField;
+ });
+ hijack('onParseHeaderValue', () => {
+ ++calls.headerValue;
+ });
+ hijack('onParsePartBegin', () => {
+ ++calls.partBegin;
+ });
+ hijack('onParsePartData', () => {
+ ++calls.partData;
+ });
+ hijack('onParsePartEnd', () => {
+ ++calls.partEnd;
+ });
+
+ form.on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ }).on('part', (p) => p.resume());
+
+ console.time(moduleName);
+ form.parse(req);
+ for (const buf of buffers)
+ req.push(buf);
+ req.push(null);
+
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/bench/bench-multipart-files-100mb-big.js b/node_modules/busboy/bench/bench-multipart-files-100mb-big.js
new file mode 100644
index 0000000000000000000000000000000000000000..b46bdee02cdded28483eb8bba655e56695abd6fa
--- /dev/null
+++ b/node_modules/busboy/bench/bench-multipart-files-100mb-big.js
@@ -0,0 +1,154 @@
+'use strict';
+
+function createMultipartBuffers(boundary, sizes) {
+ const bufs = [];
+ for (let i = 0; i < sizes.length; ++i) {
+ const mb = sizes[i] * 1024 * 1024;
+ bufs.push(Buffer.from([
+ `--${boundary}`,
+ `content-disposition: form-data; name="file${i + 1}"; `
+ + `filename="random${i + 1}.bin"`,
+ 'content-type: application/octet-stream',
+ '',
+ '0'.repeat(mb),
+ '',
+ ].join('\r\n')));
+ }
+ bufs.push(Buffer.from([
+ `--${boundary}--`,
+ '',
+ ].join('\r\n')));
+ return bufs;
+}
+
+const boundary = '-----------------------------168072824752491622650073';
+const buffers = createMultipartBuffers(boundary, [
+ 10,
+ 10,
+ 10,
+ 20,
+ 50,
+]);
+const calls = {
+ partBegin: 0,
+ headerField: 0,
+ headerValue: 0,
+ headerEnd: 0,
+ headersEnd: 0,
+ partData: 0,
+ partEnd: 0,
+ end: 0,
+};
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ },
+ });
+ parser.on('file', (name, stream, info) => {
+ ++calls.partBegin;
+ stream.on('data', (chunk) => {
+ ++calls.partData;
+ }).on('end', () => {
+ ++calls.partEnd;
+ });
+ }).on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+ break;
+ }
+
+ case 'formidable': {
+ const { MultipartParser } = require('formidable');
+
+ const parser = new MultipartParser();
+ parser.initWithBoundary(boundary);
+ parser.on('data', ({ name }) => {
+ ++calls[name];
+ if (name === 'end')
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+
+ break;
+ }
+
+ case 'multiparty': {
+ const { Readable } = require('stream');
+
+ const { Form } = require('multiparty');
+
+ const form = new Form({
+ maxFieldsSize: Infinity,
+ maxFields: Infinity,
+ maxFilesSize: Infinity,
+ autoFields: false,
+ autoFiles: false,
+ });
+
+ const req = new Readable({ read: () => {} });
+ req.headers = {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ };
+
+ function hijack(name, fn) {
+ const oldFn = form[name];
+ form[name] = function() {
+ fn();
+ return oldFn.apply(this, arguments);
+ };
+ }
+
+ hijack('onParseHeaderField', () => {
+ ++calls.headerField;
+ });
+ hijack('onParseHeaderValue', () => {
+ ++calls.headerValue;
+ });
+ hijack('onParsePartBegin', () => {
+ ++calls.partBegin;
+ });
+ hijack('onParsePartData', () => {
+ ++calls.partData;
+ });
+ hijack('onParsePartEnd', () => {
+ ++calls.partEnd;
+ });
+
+ form.on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ }).on('part', (p) => p.resume());
+
+ console.time(moduleName);
+ form.parse(req);
+ for (const buf of buffers)
+ req.push(buf);
+ req.push(null);
+
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/bench/bench-multipart-files-100mb-small.js b/node_modules/busboy/bench/bench-multipart-files-100mb-small.js
new file mode 100644
index 0000000000000000000000000000000000000000..46b5dffb0c74d8e06000f8ee453ecdb4b2d5a0ec
--- /dev/null
+++ b/node_modules/busboy/bench/bench-multipart-files-100mb-small.js
@@ -0,0 +1,148 @@
+'use strict';
+
+function createMultipartBuffers(boundary, sizes) {
+ const bufs = [];
+ for (let i = 0; i < sizes.length; ++i) {
+ const mb = sizes[i] * 1024 * 1024;
+ bufs.push(Buffer.from([
+ `--${boundary}`,
+ `content-disposition: form-data; name="file${i + 1}"; `
+ + `filename="random${i + 1}.bin"`,
+ 'content-type: application/octet-stream',
+ '',
+ '0'.repeat(mb),
+ '',
+ ].join('\r\n')));
+ }
+ bufs.push(Buffer.from([
+ `--${boundary}--`,
+ '',
+ ].join('\r\n')));
+ return bufs;
+}
+
+const boundary = '-----------------------------168072824752491622650073';
+const buffers = createMultipartBuffers(boundary, (new Array(100)).fill(1));
+const calls = {
+ partBegin: 0,
+ headerField: 0,
+ headerValue: 0,
+ headerEnd: 0,
+ headersEnd: 0,
+ partData: 0,
+ partEnd: 0,
+ end: 0,
+};
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ },
+ });
+ parser.on('file', (name, stream, info) => {
+ ++calls.partBegin;
+ stream.on('data', (chunk) => {
+ ++calls.partData;
+ }).on('end', () => {
+ ++calls.partEnd;
+ });
+ }).on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+ break;
+ }
+
+ case 'formidable': {
+ const { MultipartParser } = require('formidable');
+
+ const parser = new MultipartParser();
+ parser.initWithBoundary(boundary);
+ parser.on('data', ({ name }) => {
+ ++calls[name];
+ if (name === 'end')
+ console.timeEnd(moduleName);
+ });
+
+ console.time(moduleName);
+ for (const buf of buffers)
+ parser.write(buf);
+
+ break;
+ }
+
+ case 'multiparty': {
+ const { Readable } = require('stream');
+
+ const { Form } = require('multiparty');
+
+ const form = new Form({
+ maxFieldsSize: Infinity,
+ maxFields: Infinity,
+ maxFilesSize: Infinity,
+ autoFields: false,
+ autoFiles: false,
+ });
+
+ const req = new Readable({ read: () => {} });
+ req.headers = {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ };
+
+ function hijack(name, fn) {
+ const oldFn = form[name];
+ form[name] = function() {
+ fn();
+ return oldFn.apply(this, arguments);
+ };
+ }
+
+ hijack('onParseHeaderField', () => {
+ ++calls.headerField;
+ });
+ hijack('onParseHeaderValue', () => {
+ ++calls.headerValue;
+ });
+ hijack('onParsePartBegin', () => {
+ ++calls.partBegin;
+ });
+ hijack('onParsePartData', () => {
+ ++calls.partData;
+ });
+ hijack('onParsePartEnd', () => {
+ ++calls.partEnd;
+ });
+
+ form.on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ }).on('part', (p) => p.resume());
+
+ console.time(moduleName);
+ form.parse(req);
+ for (const buf of buffers)
+ req.push(buf);
+ req.push(null);
+
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js b/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c337df2ef951f6a36aabac8894211f06573ce6e
--- /dev/null
+++ b/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js
@@ -0,0 +1,101 @@
+'use strict';
+
+const buffers = [
+ Buffer.from(
+ (new Array(100)).fill('').map((_, i) => `key${i}=value${i}`).join('&')
+ ),
+];
+const calls = {
+ field: 0,
+ end: 0,
+};
+
+let n = 3e3;
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ console.time(moduleName);
+ (function next() {
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
+ },
+ });
+ parser.on('field', (name, val, info) => {
+ ++calls.field;
+ }).on('close', () => {
+ ++calls.end;
+ if (--n === 0)
+ console.timeEnd(moduleName);
+ else
+ process.nextTick(next);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ })();
+ break;
+ }
+
+ case 'formidable': {
+ const QuerystringParser =
+ require('formidable/src/parsers/Querystring.js');
+
+ console.time(moduleName);
+ (function next() {
+ const parser = new QuerystringParser();
+ parser.on('data', (obj) => {
+ ++calls.field;
+ }).on('end', () => {
+ ++calls.end;
+ if (--n === 0)
+ console.timeEnd(moduleName);
+ else
+ process.nextTick(next);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ })();
+ break;
+ }
+
+ case 'formidable-streaming': {
+ const QuerystringParser =
+ require('formidable/src/parsers/StreamingQuerystring.js');
+
+ console.time(moduleName);
+ (function next() {
+ const parser = new QuerystringParser();
+ parser.on('data', (obj) => {
+ ++calls.field;
+ }).on('end', () => {
+ ++calls.end;
+ if (--n === 0)
+ console.timeEnd(moduleName);
+ else
+ process.nextTick(next);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ })();
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js b/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js
new file mode 100644
index 0000000000000000000000000000000000000000..1f5645cb8cc43fb299c3577027b2cf39b5d9c286
--- /dev/null
+++ b/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js
@@ -0,0 +1,84 @@
+'use strict';
+
+const buffers = [
+ Buffer.from(
+ (new Array(900)).fill('').map((_, i) => `key${i}=value${i}`).join('&')
+ ),
+];
+const calls = {
+ field: 0,
+ end: 0,
+};
+
+const moduleName = process.argv[2];
+switch (moduleName) {
+ case 'busboy': {
+ const busboy = require('busboy');
+
+ console.time(moduleName);
+ const parser = busboy({
+ limits: {
+ fieldSizeLimit: Infinity,
+ },
+ headers: {
+ 'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
+ },
+ });
+ parser.on('field', (name, val, info) => {
+ ++calls.field;
+ }).on('close', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ break;
+ }
+
+ case 'formidable': {
+ const QuerystringParser =
+ require('formidable/src/parsers/Querystring.js');
+
+ console.time(moduleName);
+ const parser = new QuerystringParser();
+ parser.on('data', (obj) => {
+ ++calls.field;
+ }).on('end', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ break;
+ }
+
+ case 'formidable-streaming': {
+ const QuerystringParser =
+ require('formidable/src/parsers/StreamingQuerystring.js');
+
+ console.time(moduleName);
+ const parser = new QuerystringParser();
+ parser.on('data', (obj) => {
+ ++calls.field;
+ }).on('end', () => {
+ ++calls.end;
+ console.timeEnd(moduleName);
+ });
+
+ for (const buf of buffers)
+ parser.write(buf);
+ parser.end();
+ break;
+ }
+
+ default:
+ if (moduleName === undefined)
+ console.error('Missing parser module name');
+ else
+ console.error(`Invalid parser module name: ${moduleName}`);
+ process.exit(1);
+}
diff --git a/node_modules/busboy/lib/index.js b/node_modules/busboy/lib/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..873272d93cf34c7d3c973a8204a23f479c36655c
--- /dev/null
+++ b/node_modules/busboy/lib/index.js
@@ -0,0 +1,57 @@
+'use strict';
+
+const { parseContentType } = require('./utils.js');
+
+function getInstance(cfg) {
+ const headers = cfg.headers;
+ const conType = parseContentType(headers['content-type']);
+ if (!conType)
+ throw new Error('Malformed content type');
+
+ for (const type of TYPES) {
+ const matched = type.detect(conType);
+ if (!matched)
+ continue;
+
+ const instanceCfg = {
+ limits: cfg.limits,
+ headers,
+ conType,
+ highWaterMark: undefined,
+ fileHwm: undefined,
+ defCharset: undefined,
+ defParamCharset: undefined,
+ preservePath: false,
+ };
+ if (cfg.highWaterMark)
+ instanceCfg.highWaterMark = cfg.highWaterMark;
+ if (cfg.fileHwm)
+ instanceCfg.fileHwm = cfg.fileHwm;
+ instanceCfg.defCharset = cfg.defCharset;
+ instanceCfg.defParamCharset = cfg.defParamCharset;
+ instanceCfg.preservePath = cfg.preservePath;
+ return new type(instanceCfg);
+ }
+
+ throw new Error(`Unsupported content type: ${headers['content-type']}`);
+}
+
+// Note: types are explicitly listed here for easier bundling
+// See: https://github.com/mscdex/busboy/issues/121
+const TYPES = [
+ require('./types/multipart'),
+ require('./types/urlencoded'),
+].filter(function(typemod) { return typeof typemod.detect === 'function'; });
+
+module.exports = (cfg) => {
+ if (typeof cfg !== 'object' || cfg === null)
+ cfg = {};
+
+ if (typeof cfg.headers !== 'object'
+ || cfg.headers === null
+ || typeof cfg.headers['content-type'] !== 'string') {
+ throw new Error('Missing Content-Type');
+ }
+
+ return getInstance(cfg);
+};
diff --git a/node_modules/busboy/lib/types/multipart.js b/node_modules/busboy/lib/types/multipart.js
new file mode 100644
index 0000000000000000000000000000000000000000..cc0d7bb6638a12cb0572c95d515a10d6ddbb68cb
--- /dev/null
+++ b/node_modules/busboy/lib/types/multipart.js
@@ -0,0 +1,653 @@
+'use strict';
+
+const { Readable, Writable } = require('stream');
+
+const StreamSearch = require('streamsearch');
+
+const {
+ basename,
+ convertToUTF8,
+ getDecoder,
+ parseContentType,
+ parseDisposition,
+} = require('../utils.js');
+
+const BUF_CRLF = Buffer.from('\r\n');
+const BUF_CR = Buffer.from('\r');
+const BUF_DASH = Buffer.from('-');
+
+function noop() {}
+
+const MAX_HEADER_PAIRS = 2000; // From node
+const MAX_HEADER_SIZE = 16 * 1024; // From node (its default value)
+
+const HPARSER_NAME = 0;
+const HPARSER_PRE_OWS = 1;
+const HPARSER_VALUE = 2;
+class HeaderParser {
+ constructor(cb) {
+ this.header = Object.create(null);
+ this.pairCount = 0;
+ this.byteCount = 0;
+ this.state = HPARSER_NAME;
+ this.name = '';
+ this.value = '';
+ this.crlf = 0;
+ this.cb = cb;
+ }
+
+ reset() {
+ this.header = Object.create(null);
+ this.pairCount = 0;
+ this.byteCount = 0;
+ this.state = HPARSER_NAME;
+ this.name = '';
+ this.value = '';
+ this.crlf = 0;
+ }
+
+ push(chunk, pos, end) {
+ let start = pos;
+ while (pos < end) {
+ switch (this.state) {
+ case HPARSER_NAME: {
+ let done = false;
+ for (; pos < end; ++pos) {
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ const code = chunk[pos];
+ if (TOKEN[code] !== 1) {
+ if (code !== 58/* ':' */)
+ return -1;
+ this.name += chunk.latin1Slice(start, pos);
+ if (this.name.length === 0)
+ return -1;
+ ++pos;
+ done = true;
+ this.state = HPARSER_PRE_OWS;
+ break;
+ }
+ }
+ if (!done) {
+ this.name += chunk.latin1Slice(start, pos);
+ break;
+ }
+ // FALLTHROUGH
+ }
+ case HPARSER_PRE_OWS: {
+ // Skip optional whitespace
+ let done = false;
+ for (; pos < end; ++pos) {
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ const code = chunk[pos];
+ if (code !== 32/* ' ' */ && code !== 9/* '\t' */) {
+ start = pos;
+ done = true;
+ this.state = HPARSER_VALUE;
+ break;
+ }
+ }
+ if (!done)
+ break;
+ // FALLTHROUGH
+ }
+ case HPARSER_VALUE:
+ switch (this.crlf) {
+ case 0: // Nothing yet
+ for (; pos < end; ++pos) {
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ const code = chunk[pos];
+ if (FIELD_VCHAR[code] !== 1) {
+ if (code !== 13/* '\r' */)
+ return -1;
+ ++this.crlf;
+ break;
+ }
+ }
+ this.value += chunk.latin1Slice(start, pos++);
+ break;
+ case 1: // Received CR
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ if (chunk[pos++] !== 10/* '\n' */)
+ return -1;
+ ++this.crlf;
+ break;
+ case 2: { // Received CR LF
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ const code = chunk[pos];
+ if (code === 32/* ' ' */ || code === 9/* '\t' */) {
+ // Folded value
+ start = pos;
+ this.crlf = 0;
+ } else {
+ if (++this.pairCount < MAX_HEADER_PAIRS) {
+ this.name = this.name.toLowerCase();
+ if (this.header[this.name] === undefined)
+ this.header[this.name] = [this.value];
+ else
+ this.header[this.name].push(this.value);
+ }
+ if (code === 13/* '\r' */) {
+ ++this.crlf;
+ ++pos;
+ } else {
+ // Assume start of next header field name
+ start = pos;
+ this.crlf = 0;
+ this.state = HPARSER_NAME;
+ this.name = '';
+ this.value = '';
+ }
+ }
+ break;
+ }
+ case 3: { // Received CR LF CR
+ if (this.byteCount === MAX_HEADER_SIZE)
+ return -1;
+ ++this.byteCount;
+ if (chunk[pos++] !== 10/* '\n' */)
+ return -1;
+ // End of header
+ const header = this.header;
+ this.reset();
+ this.cb(header);
+ return pos;
+ }
+ }
+ break;
+ }
+ }
+
+ return pos;
+ }
+}
+
+class FileStream extends Readable {
+ constructor(opts, owner) {
+ super(opts);
+ this.truncated = false;
+ this._readcb = null;
+ this.once('end', () => {
+ // We need to make sure that we call any outstanding _writecb() that is
+ // associated with this file so that processing of the rest of the form
+ // can continue. This may not happen if the file stream ends right after
+ // backpressure kicks in, so we force it here.
+ this._read();
+ if (--owner._fileEndsLeft === 0 && owner._finalcb) {
+ const cb = owner._finalcb;
+ owner._finalcb = null;
+ // Make sure other 'end' event handlers get a chance to be executed
+ // before busboy's 'finish' event is emitted
+ process.nextTick(cb);
+ }
+ });
+ }
+ _read(n) {
+ const cb = this._readcb;
+ if (cb) {
+ this._readcb = null;
+ cb();
+ }
+ }
+}
+
+const ignoreData = {
+ push: (chunk, pos) => {},
+ destroy: () => {},
+};
+
+function callAndUnsetCb(self, err) {
+ const cb = self._writecb;
+ self._writecb = null;
+ if (err)
+ self.destroy(err);
+ else if (cb)
+ cb();
+}
+
+function nullDecoder(val, hint) {
+ return val;
+}
+
+class Multipart extends Writable {
+ constructor(cfg) {
+ const streamOpts = {
+ autoDestroy: true,
+ emitClose: true,
+ highWaterMark: (typeof cfg.highWaterMark === 'number'
+ ? cfg.highWaterMark
+ : undefined),
+ };
+ super(streamOpts);
+
+ if (!cfg.conType.params || typeof cfg.conType.params.boundary !== 'string')
+ throw new Error('Multipart: Boundary not found');
+
+ const boundary = cfg.conType.params.boundary;
+ const paramDecoder = (typeof cfg.defParamCharset === 'string'
+ && cfg.defParamCharset
+ ? getDecoder(cfg.defParamCharset)
+ : nullDecoder);
+ const defCharset = (cfg.defCharset || 'utf8');
+ const preservePath = cfg.preservePath;
+ const fileOpts = {
+ autoDestroy: true,
+ emitClose: true,
+ highWaterMark: (typeof cfg.fileHwm === 'number'
+ ? cfg.fileHwm
+ : undefined),
+ };
+
+ const limits = cfg.limits;
+ const fieldSizeLimit = (limits && typeof limits.fieldSize === 'number'
+ ? limits.fieldSize
+ : 1 * 1024 * 1024);
+ const fileSizeLimit = (limits && typeof limits.fileSize === 'number'
+ ? limits.fileSize
+ : Infinity);
+ const filesLimit = (limits && typeof limits.files === 'number'
+ ? limits.files
+ : Infinity);
+ const fieldsLimit = (limits && typeof limits.fields === 'number'
+ ? limits.fields
+ : Infinity);
+ const partsLimit = (limits && typeof limits.parts === 'number'
+ ? limits.parts
+ : Infinity);
+
+ let parts = -1; // Account for initial boundary
+ let fields = 0;
+ let files = 0;
+ let skipPart = false;
+
+ this._fileEndsLeft = 0;
+ this._fileStream = undefined;
+ this._complete = false;
+ let fileSize = 0;
+
+ let field;
+ let fieldSize = 0;
+ let partCharset;
+ let partEncoding;
+ let partType;
+ let partName;
+ let partTruncated = false;
+
+ let hitFilesLimit = false;
+ let hitFieldsLimit = false;
+
+ this._hparser = null;
+ const hparser = new HeaderParser((header) => {
+ this._hparser = null;
+ skipPart = false;
+
+ partType = 'text/plain';
+ partCharset = defCharset;
+ partEncoding = '7bit';
+ partName = undefined;
+ partTruncated = false;
+
+ let filename;
+ if (!header['content-disposition']) {
+ skipPart = true;
+ return;
+ }
+
+ const disp = parseDisposition(header['content-disposition'][0],
+ paramDecoder);
+ if (!disp || disp.type !== 'form-data') {
+ skipPart = true;
+ return;
+ }
+
+ if (disp.params) {
+ if (disp.params.name)
+ partName = disp.params.name;
+
+ if (disp.params['filename*'])
+ filename = disp.params['filename*'];
+ else if (disp.params.filename)
+ filename = disp.params.filename;
+
+ if (filename !== undefined && !preservePath)
+ filename = basename(filename);
+ }
+
+ if (header['content-type']) {
+ const conType = parseContentType(header['content-type'][0]);
+ if (conType) {
+ partType = `${conType.type}/${conType.subtype}`;
+ if (conType.params && typeof conType.params.charset === 'string')
+ partCharset = conType.params.charset.toLowerCase();
+ }
+ }
+
+ if (header['content-transfer-encoding'])
+ partEncoding = header['content-transfer-encoding'][0].toLowerCase();
+
+ if (partType === 'application/octet-stream' || filename !== undefined) {
+ // File
+
+ if (files === filesLimit) {
+ if (!hitFilesLimit) {
+ hitFilesLimit = true;
+ this.emit('filesLimit');
+ }
+ skipPart = true;
+ return;
+ }
+ ++files;
+
+ if (this.listenerCount('file') === 0) {
+ skipPart = true;
+ return;
+ }
+
+ fileSize = 0;
+ this._fileStream = new FileStream(fileOpts, this);
+ ++this._fileEndsLeft;
+ this.emit(
+ 'file',
+ partName,
+ this._fileStream,
+ { filename,
+ encoding: partEncoding,
+ mimeType: partType }
+ );
+ } else {
+ // Non-file
+
+ if (fields === fieldsLimit) {
+ if (!hitFieldsLimit) {
+ hitFieldsLimit = true;
+ this.emit('fieldsLimit');
+ }
+ skipPart = true;
+ return;
+ }
+ ++fields;
+
+ if (this.listenerCount('field') === 0) {
+ skipPart = true;
+ return;
+ }
+
+ field = [];
+ fieldSize = 0;
+ }
+ });
+
+ let matchPostBoundary = 0;
+ const ssCb = (isMatch, data, start, end, isDataSafe) => {
+retrydata:
+ while (data) {
+ if (this._hparser !== null) {
+ const ret = this._hparser.push(data, start, end);
+ if (ret === -1) {
+ this._hparser = null;
+ hparser.reset();
+ this.emit('error', new Error('Malformed part header'));
+ break;
+ }
+ start = ret;
+ }
+
+ if (start === end)
+ break;
+
+ if (matchPostBoundary !== 0) {
+ if (matchPostBoundary === 1) {
+ switch (data[start]) {
+ case 45: // '-'
+ // Try matching '--' after boundary
+ matchPostBoundary = 2;
+ ++start;
+ break;
+ case 13: // '\r'
+ // Try matching CR LF before header
+ matchPostBoundary = 3;
+ ++start;
+ break;
+ default:
+ matchPostBoundary = 0;
+ }
+ if (start === end)
+ return;
+ }
+
+ if (matchPostBoundary === 2) {
+ matchPostBoundary = 0;
+ if (data[start] === 45/* '-' */) {
+ // End of multipart data
+ this._complete = true;
+ this._bparser = ignoreData;
+ return;
+ }
+ // We saw something other than '-', so put the dash we consumed
+ // "back"
+ const writecb = this._writecb;
+ this._writecb = noop;
+ ssCb(false, BUF_DASH, 0, 1, false);
+ this._writecb = writecb;
+ } else if (matchPostBoundary === 3) {
+ matchPostBoundary = 0;
+ if (data[start] === 10/* '\n' */) {
+ ++start;
+ if (parts >= partsLimit)
+ break;
+ // Prepare the header parser
+ this._hparser = hparser;
+ if (start === end)
+ break;
+ // Process the remaining data as a header
+ continue retrydata;
+ } else {
+ // We saw something other than LF, so put the CR we consumed
+ // "back"
+ const writecb = this._writecb;
+ this._writecb = noop;
+ ssCb(false, BUF_CR, 0, 1, false);
+ this._writecb = writecb;
+ }
+ }
+ }
+
+ if (!skipPart) {
+ if (this._fileStream) {
+ let chunk;
+ const actualLen = Math.min(end - start, fileSizeLimit - fileSize);
+ if (!isDataSafe) {
+ chunk = Buffer.allocUnsafe(actualLen);
+ data.copy(chunk, 0, start, start + actualLen);
+ } else {
+ chunk = data.slice(start, start + actualLen);
+ }
+
+ fileSize += chunk.length;
+ if (fileSize === fileSizeLimit) {
+ if (chunk.length > 0)
+ this._fileStream.push(chunk);
+ this._fileStream.emit('limit');
+ this._fileStream.truncated = true;
+ skipPart = true;
+ } else if (!this._fileStream.push(chunk)) {
+ if (this._writecb)
+ this._fileStream._readcb = this._writecb;
+ this._writecb = null;
+ }
+ } else if (field !== undefined) {
+ let chunk;
+ const actualLen = Math.min(
+ end - start,
+ fieldSizeLimit - fieldSize
+ );
+ if (!isDataSafe) {
+ chunk = Buffer.allocUnsafe(actualLen);
+ data.copy(chunk, 0, start, start + actualLen);
+ } else {
+ chunk = data.slice(start, start + actualLen);
+ }
+
+ fieldSize += actualLen;
+ field.push(chunk);
+ if (fieldSize === fieldSizeLimit) {
+ skipPart = true;
+ partTruncated = true;
+ }
+ }
+ }
+
+ break;
+ }
+
+ if (isMatch) {
+ matchPostBoundary = 1;
+
+ if (this._fileStream) {
+ // End the active file stream if the previous part was a file
+ this._fileStream.push(null);
+ this._fileStream = null;
+ } else if (field !== undefined) {
+ let data;
+ switch (field.length) {
+ case 0:
+ data = '';
+ break;
+ case 1:
+ data = convertToUTF8(field[0], partCharset, 0);
+ break;
+ default:
+ data = convertToUTF8(
+ Buffer.concat(field, fieldSize),
+ partCharset,
+ 0
+ );
+ }
+ field = undefined;
+ fieldSize = 0;
+ this.emit(
+ 'field',
+ partName,
+ data,
+ { nameTruncated: false,
+ valueTruncated: partTruncated,
+ encoding: partEncoding,
+ mimeType: partType }
+ );
+ }
+
+ if (++parts === partsLimit)
+ this.emit('partsLimit');
+ }
+ };
+ this._bparser = new StreamSearch(`\r\n--${boundary}`, ssCb);
+
+ this._writecb = null;
+ this._finalcb = null;
+
+ // Just in case there is no preamble
+ this.write(BUF_CRLF);
+ }
+
+ static detect(conType) {
+ return (conType.type === 'multipart' && conType.subtype === 'form-data');
+ }
+
+ _write(chunk, enc, cb) {
+ this._writecb = cb;
+ this._bparser.push(chunk, 0);
+ if (this._writecb)
+ callAndUnsetCb(this);
+ }
+
+ _destroy(err, cb) {
+ this._hparser = null;
+ this._bparser = ignoreData;
+ if (!err)
+ err = checkEndState(this);
+ const fileStream = this._fileStream;
+ if (fileStream) {
+ this._fileStream = null;
+ fileStream.destroy(err);
+ }
+ cb(err);
+ }
+
+ _final(cb) {
+ this._bparser.destroy();
+ if (!this._complete)
+ return cb(new Error('Unexpected end of form'));
+ if (this._fileEndsLeft)
+ this._finalcb = finalcb.bind(null, this, cb);
+ else
+ finalcb(this, cb);
+ }
+}
+
+function finalcb(self, cb, err) {
+ if (err)
+ return cb(err);
+ err = checkEndState(self);
+ cb(err);
+}
+
+function checkEndState(self) {
+ if (self._hparser)
+ return new Error('Malformed part header');
+ const fileStream = self._fileStream;
+ if (fileStream) {
+ self._fileStream = null;
+ fileStream.destroy(new Error('Unexpected end of file'));
+ }
+ if (!self._complete)
+ return new Error('Unexpected end of form');
+}
+
+const TOKEN = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+];
+
+const FIELD_VCHAR = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+];
+
+module.exports = Multipart;
diff --git a/node_modules/busboy/lib/types/urlencoded.js b/node_modules/busboy/lib/types/urlencoded.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c463a25899a72ab94b17f0a29b937e0c0c3ee97
--- /dev/null
+++ b/node_modules/busboy/lib/types/urlencoded.js
@@ -0,0 +1,350 @@
+'use strict';
+
+const { Writable } = require('stream');
+
+const { getDecoder } = require('../utils.js');
+
+class URLEncoded extends Writable {
+ constructor(cfg) {
+ const streamOpts = {
+ autoDestroy: true,
+ emitClose: true,
+ highWaterMark: (typeof cfg.highWaterMark === 'number'
+ ? cfg.highWaterMark
+ : undefined),
+ };
+ super(streamOpts);
+
+ let charset = (cfg.defCharset || 'utf8');
+ if (cfg.conType.params && typeof cfg.conType.params.charset === 'string')
+ charset = cfg.conType.params.charset;
+
+ this.charset = charset;
+
+ const limits = cfg.limits;
+ this.fieldSizeLimit = (limits && typeof limits.fieldSize === 'number'
+ ? limits.fieldSize
+ : 1 * 1024 * 1024);
+ this.fieldsLimit = (limits && typeof limits.fields === 'number'
+ ? limits.fields
+ : Infinity);
+ this.fieldNameSizeLimit = (
+ limits && typeof limits.fieldNameSize === 'number'
+ ? limits.fieldNameSize
+ : 100
+ );
+
+ this._inKey = true;
+ this._keyTrunc = false;
+ this._valTrunc = false;
+ this._bytesKey = 0;
+ this._bytesVal = 0;
+ this._fields = 0;
+ this._key = '';
+ this._val = '';
+ this._byte = -2;
+ this._lastPos = 0;
+ this._encode = 0;
+ this._decoder = getDecoder(charset);
+ }
+
+ static detect(conType) {
+ return (conType.type === 'application'
+ && conType.subtype === 'x-www-form-urlencoded');
+ }
+
+ _write(chunk, enc, cb) {
+ if (this._fields >= this.fieldsLimit)
+ return cb();
+
+ let i = 0;
+ const len = chunk.length;
+ this._lastPos = 0;
+
+ // Check if we last ended mid-percent-encoded byte
+ if (this._byte !== -2) {
+ i = readPctEnc(this, chunk, i, len);
+ if (i === -1)
+ return cb(new Error('Malformed urlencoded form'));
+ if (i >= len)
+ return cb();
+ if (this._inKey)
+ ++this._bytesKey;
+ else
+ ++this._bytesVal;
+ }
+
+main:
+ while (i < len) {
+ if (this._inKey) {
+ // Parsing key
+
+ i = skipKeyBytes(this, chunk, i, len);
+
+ while (i < len) {
+ switch (chunk[i]) {
+ case 61: // '='
+ if (this._lastPos < i)
+ this._key += chunk.latin1Slice(this._lastPos, i);
+ this._lastPos = ++i;
+ this._key = this._decoder(this._key, this._encode);
+ this._encode = 0;
+ this._inKey = false;
+ continue main;
+ case 38: // '&'
+ if (this._lastPos < i)
+ this._key += chunk.latin1Slice(this._lastPos, i);
+ this._lastPos = ++i;
+ this._key = this._decoder(this._key, this._encode);
+ this._encode = 0;
+ if (this._bytesKey > 0) {
+ this.emit(
+ 'field',
+ this._key,
+ '',
+ { nameTruncated: this._keyTrunc,
+ valueTruncated: false,
+ encoding: this.charset,
+ mimeType: 'text/plain' }
+ );
+ }
+ this._key = '';
+ this._val = '';
+ this._keyTrunc = false;
+ this._valTrunc = false;
+ this._bytesKey = 0;
+ this._bytesVal = 0;
+ if (++this._fields >= this.fieldsLimit) {
+ this.emit('fieldsLimit');
+ return cb();
+ }
+ continue;
+ case 43: // '+'
+ if (this._lastPos < i)
+ this._key += chunk.latin1Slice(this._lastPos, i);
+ this._key += ' ';
+ this._lastPos = i + 1;
+ break;
+ case 37: // '%'
+ if (this._encode === 0)
+ this._encode = 1;
+ if (this._lastPos < i)
+ this._key += chunk.latin1Slice(this._lastPos, i);
+ this._lastPos = i + 1;
+ this._byte = -1;
+ i = readPctEnc(this, chunk, i + 1, len);
+ if (i === -1)
+ return cb(new Error('Malformed urlencoded form'));
+ if (i >= len)
+ return cb();
+ ++this._bytesKey;
+ i = skipKeyBytes(this, chunk, i, len);
+ continue;
+ }
+ ++i;
+ ++this._bytesKey;
+ i = skipKeyBytes(this, chunk, i, len);
+ }
+ if (this._lastPos < i)
+ this._key += chunk.latin1Slice(this._lastPos, i);
+ } else {
+ // Parsing value
+
+ i = skipValBytes(this, chunk, i, len);
+
+ while (i < len) {
+ switch (chunk[i]) {
+ case 38: // '&'
+ if (this._lastPos < i)
+ this._val += chunk.latin1Slice(this._lastPos, i);
+ this._lastPos = ++i;
+ this._inKey = true;
+ this._val = this._decoder(this._val, this._encode);
+ this._encode = 0;
+ if (this._bytesKey > 0 || this._bytesVal > 0) {
+ this.emit(
+ 'field',
+ this._key,
+ this._val,
+ { nameTruncated: this._keyTrunc,
+ valueTruncated: this._valTrunc,
+ encoding: this.charset,
+ mimeType: 'text/plain' }
+ );
+ }
+ this._key = '';
+ this._val = '';
+ this._keyTrunc = false;
+ this._valTrunc = false;
+ this._bytesKey = 0;
+ this._bytesVal = 0;
+ if (++this._fields >= this.fieldsLimit) {
+ this.emit('fieldsLimit');
+ return cb();
+ }
+ continue main;
+ case 43: // '+'
+ if (this._lastPos < i)
+ this._val += chunk.latin1Slice(this._lastPos, i);
+ this._val += ' ';
+ this._lastPos = i + 1;
+ break;
+ case 37: // '%'
+ if (this._encode === 0)
+ this._encode = 1;
+ if (this._lastPos < i)
+ this._val += chunk.latin1Slice(this._lastPos, i);
+ this._lastPos = i + 1;
+ this._byte = -1;
+ i = readPctEnc(this, chunk, i + 1, len);
+ if (i === -1)
+ return cb(new Error('Malformed urlencoded form'));
+ if (i >= len)
+ return cb();
+ ++this._bytesVal;
+ i = skipValBytes(this, chunk, i, len);
+ continue;
+ }
+ ++i;
+ ++this._bytesVal;
+ i = skipValBytes(this, chunk, i, len);
+ }
+ if (this._lastPos < i)
+ this._val += chunk.latin1Slice(this._lastPos, i);
+ }
+ }
+
+ cb();
+ }
+
+ _final(cb) {
+ if (this._byte !== -2)
+ return cb(new Error('Malformed urlencoded form'));
+ if (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) {
+ if (this._inKey)
+ this._key = this._decoder(this._key, this._encode);
+ else
+ this._val = this._decoder(this._val, this._encode);
+ this.emit(
+ 'field',
+ this._key,
+ this._val,
+ { nameTruncated: this._keyTrunc,
+ valueTruncated: this._valTrunc,
+ encoding: this.charset,
+ mimeType: 'text/plain' }
+ );
+ }
+ cb();
+ }
+}
+
+function readPctEnc(self, chunk, pos, len) {
+ if (pos >= len)
+ return len;
+
+ if (self._byte === -1) {
+ // We saw a '%' but no hex characters yet
+ const hexUpper = HEX_VALUES[chunk[pos++]];
+ if (hexUpper === -1)
+ return -1;
+
+ if (hexUpper >= 8)
+ self._encode = 2; // Indicate high bits detected
+
+ if (pos < len) {
+ // Both hex characters are in this chunk
+ const hexLower = HEX_VALUES[chunk[pos++]];
+ if (hexLower === -1)
+ return -1;
+
+ if (self._inKey)
+ self._key += String.fromCharCode((hexUpper << 4) + hexLower);
+ else
+ self._val += String.fromCharCode((hexUpper << 4) + hexLower);
+
+ self._byte = -2;
+ self._lastPos = pos;
+ } else {
+ // Only one hex character was available in this chunk
+ self._byte = hexUpper;
+ }
+ } else {
+ // We saw only one hex character so far
+ const hexLower = HEX_VALUES[chunk[pos++]];
+ if (hexLower === -1)
+ return -1;
+
+ if (self._inKey)
+ self._key += String.fromCharCode((self._byte << 4) + hexLower);
+ else
+ self._val += String.fromCharCode((self._byte << 4) + hexLower);
+
+ self._byte = -2;
+ self._lastPos = pos;
+ }
+
+ return pos;
+}
+
+function skipKeyBytes(self, chunk, pos, len) {
+ // Skip bytes if we've truncated
+ if (self._bytesKey > self.fieldNameSizeLimit) {
+ if (!self._keyTrunc) {
+ if (self._lastPos < pos)
+ self._key += chunk.latin1Slice(self._lastPos, pos - 1);
+ }
+ self._keyTrunc = true;
+ for (; pos < len; ++pos) {
+ const code = chunk[pos];
+ if (code === 61/* '=' */ || code === 38/* '&' */)
+ break;
+ ++self._bytesKey;
+ }
+ self._lastPos = pos;
+ }
+
+ return pos;
+}
+
+function skipValBytes(self, chunk, pos, len) {
+ // Skip bytes if we've truncated
+ if (self._bytesVal > self.fieldSizeLimit) {
+ if (!self._valTrunc) {
+ if (self._lastPos < pos)
+ self._val += chunk.latin1Slice(self._lastPos, pos - 1);
+ }
+ self._valTrunc = true;
+ for (; pos < len; ++pos) {
+ if (chunk[pos] === 38/* '&' */)
+ break;
+ ++self._bytesVal;
+ }
+ self._lastPos = pos;
+ }
+
+ return pos;
+}
+
+/* eslint-disable no-multi-spaces */
+const HEX_VALUES = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+];
+/* eslint-enable no-multi-spaces */
+
+module.exports = URLEncoded;
diff --git a/node_modules/busboy/lib/utils.js b/node_modules/busboy/lib/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..8274f6c3aef47ad929b2e2a4772c23fd6f0644d8
--- /dev/null
+++ b/node_modules/busboy/lib/utils.js
@@ -0,0 +1,596 @@
+'use strict';
+
+function parseContentType(str) {
+ if (str.length === 0)
+ return;
+
+ const params = Object.create(null);
+ let i = 0;
+
+ // Parse type
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ if (code !== 47/* '/' */ || i === 0)
+ return;
+ break;
+ }
+ }
+ // Check for type without subtype
+ if (i === str.length)
+ return;
+
+ const type = str.slice(0, i).toLowerCase();
+
+ // Parse subtype
+ const subtypeStart = ++i;
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ // Make sure we have a subtype
+ if (i === subtypeStart)
+ return;
+
+ if (parseContentTypeParams(str, i, params) === undefined)
+ return;
+ break;
+ }
+ }
+ // Make sure we have a subtype
+ if (i === subtypeStart)
+ return;
+
+ const subtype = str.slice(subtypeStart, i).toLowerCase();
+
+ return { type, subtype, params };
+}
+
+function parseContentTypeParams(str, i, params) {
+ while (i < str.length) {
+ // Consume whitespace
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
+ break;
+ }
+
+ // Ended on whitespace
+ if (i === str.length)
+ break;
+
+ // Check for malformed parameter
+ if (str.charCodeAt(i++) !== 59/* ';' */)
+ return;
+
+ // Consume whitespace
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
+ break;
+ }
+
+ // Ended on whitespace (malformed)
+ if (i === str.length)
+ return;
+
+ let name;
+ const nameStart = i;
+ // Parse parameter name
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ if (code !== 61/* '=' */)
+ return;
+ break;
+ }
+ }
+
+ // No value (malformed)
+ if (i === str.length)
+ return;
+
+ name = str.slice(nameStart, i);
+ ++i; // Skip over '='
+
+ // No value (malformed)
+ if (i === str.length)
+ return;
+
+ let value = '';
+ let valueStart;
+ if (str.charCodeAt(i) === 34/* '"' */) {
+ valueStart = ++i;
+ let escaping = false;
+ // Parse quoted value
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code === 92/* '\\' */) {
+ if (escaping) {
+ valueStart = i;
+ escaping = false;
+ } else {
+ value += str.slice(valueStart, i);
+ escaping = true;
+ }
+ continue;
+ }
+ if (code === 34/* '"' */) {
+ if (escaping) {
+ valueStart = i;
+ escaping = false;
+ continue;
+ }
+ value += str.slice(valueStart, i);
+ break;
+ }
+ if (escaping) {
+ valueStart = i - 1;
+ escaping = false;
+ }
+ // Invalid unescaped quoted character (malformed)
+ if (QDTEXT[code] !== 1)
+ return;
+ }
+
+ // No end quote (malformed)
+ if (i === str.length)
+ return;
+
+ ++i; // Skip over double quote
+ } else {
+ valueStart = i;
+ // Parse unquoted value
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ // No value (malformed)
+ if (i === valueStart)
+ return;
+ break;
+ }
+ }
+ value = str.slice(valueStart, i);
+ }
+
+ name = name.toLowerCase();
+ if (params[name] === undefined)
+ params[name] = value;
+ }
+
+ return params;
+}
+
+function parseDisposition(str, defDecoder) {
+ if (str.length === 0)
+ return;
+
+ const params = Object.create(null);
+ let i = 0;
+
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ if (parseDispositionParams(str, i, params, defDecoder) === undefined)
+ return;
+ break;
+ }
+ }
+
+ const type = str.slice(0, i).toLowerCase();
+
+ return { type, params };
+}
+
+function parseDispositionParams(str, i, params, defDecoder) {
+ while (i < str.length) {
+ // Consume whitespace
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
+ break;
+ }
+
+ // Ended on whitespace
+ if (i === str.length)
+ break;
+
+ // Check for malformed parameter
+ if (str.charCodeAt(i++) !== 59/* ';' */)
+ return;
+
+ // Consume whitespace
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
+ break;
+ }
+
+ // Ended on whitespace (malformed)
+ if (i === str.length)
+ return;
+
+ let name;
+ const nameStart = i;
+ // Parse parameter name
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ if (code === 61/* '=' */)
+ break;
+ return;
+ }
+ }
+
+ // No value (malformed)
+ if (i === str.length)
+ return;
+
+ let value = '';
+ let valueStart;
+ let charset;
+ //~ let lang;
+ name = str.slice(nameStart, i);
+ if (name.charCodeAt(name.length - 1) === 42/* '*' */) {
+ // Extended value
+
+ const charsetStart = ++i;
+ // Parse charset name
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (CHARSET[code] !== 1) {
+ if (code !== 39/* '\'' */)
+ return;
+ break;
+ }
+ }
+
+ // Incomplete charset (malformed)
+ if (i === str.length)
+ return;
+
+ charset = str.slice(charsetStart, i);
+ ++i; // Skip over the '\''
+
+ //~ const langStart = ++i;
+ // Parse language name
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code === 39/* '\'' */)
+ break;
+ }
+
+ // Incomplete language (malformed)
+ if (i === str.length)
+ return;
+
+ //~ lang = str.slice(langStart, i);
+ ++i; // Skip over the '\''
+
+ // No value (malformed)
+ if (i === str.length)
+ return;
+
+ valueStart = i;
+
+ let encode = 0;
+ // Parse value
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (EXTENDED_VALUE[code] !== 1) {
+ if (code === 37/* '%' */) {
+ let hexUpper;
+ let hexLower;
+ if (i + 2 < str.length
+ && (hexUpper = HEX_VALUES[str.charCodeAt(i + 1)]) !== -1
+ && (hexLower = HEX_VALUES[str.charCodeAt(i + 2)]) !== -1) {
+ const byteVal = (hexUpper << 4) + hexLower;
+ value += str.slice(valueStart, i);
+ value += String.fromCharCode(byteVal);
+ i += 2;
+ valueStart = i + 1;
+ if (byteVal >= 128)
+ encode = 2;
+ else if (encode === 0)
+ encode = 1;
+ continue;
+ }
+ // '%' disallowed in non-percent encoded contexts (malformed)
+ return;
+ }
+ break;
+ }
+ }
+
+ value += str.slice(valueStart, i);
+ value = convertToUTF8(value, charset, encode);
+ if (value === undefined)
+ return;
+ } else {
+ // Non-extended value
+
+ ++i; // Skip over '='
+
+ // No value (malformed)
+ if (i === str.length)
+ return;
+
+ if (str.charCodeAt(i) === 34/* '"' */) {
+ valueStart = ++i;
+ let escaping = false;
+ // Parse quoted value
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (code === 92/* '\\' */) {
+ if (escaping) {
+ valueStart = i;
+ escaping = false;
+ } else {
+ value += str.slice(valueStart, i);
+ escaping = true;
+ }
+ continue;
+ }
+ if (code === 34/* '"' */) {
+ if (escaping) {
+ valueStart = i;
+ escaping = false;
+ continue;
+ }
+ value += str.slice(valueStart, i);
+ break;
+ }
+ if (escaping) {
+ valueStart = i - 1;
+ escaping = false;
+ }
+ // Invalid unescaped quoted character (malformed)
+ if (QDTEXT[code] !== 1)
+ return;
+ }
+
+ // No end quote (malformed)
+ if (i === str.length)
+ return;
+
+ ++i; // Skip over double quote
+ } else {
+ valueStart = i;
+ // Parse unquoted value
+ for (; i < str.length; ++i) {
+ const code = str.charCodeAt(i);
+ if (TOKEN[code] !== 1) {
+ // No value (malformed)
+ if (i === valueStart)
+ return;
+ break;
+ }
+ }
+ value = str.slice(valueStart, i);
+ }
+
+ value = defDecoder(value, 2);
+ if (value === undefined)
+ return;
+ }
+
+ name = name.toLowerCase();
+ if (params[name] === undefined)
+ params[name] = value;
+ }
+
+ return params;
+}
+
+function getDecoder(charset) {
+ let lc;
+ while (true) {
+ switch (charset) {
+ case 'utf-8':
+ case 'utf8':
+ return decoders.utf8;
+ case 'latin1':
+ case 'ascii': // TODO: Make these a separate, strict decoder?
+ case 'us-ascii':
+ case 'iso-8859-1':
+ case 'iso8859-1':
+ case 'iso88591':
+ case 'iso_8859-1':
+ case 'windows-1252':
+ case 'iso_8859-1:1987':
+ case 'cp1252':
+ case 'x-cp1252':
+ return decoders.latin1;
+ case 'utf16le':
+ case 'utf-16le':
+ case 'ucs2':
+ case 'ucs-2':
+ return decoders.utf16le;
+ case 'base64':
+ return decoders.base64;
+ default:
+ if (lc === undefined) {
+ lc = true;
+ charset = charset.toLowerCase();
+ continue;
+ }
+ return decoders.other.bind(charset);
+ }
+ }
+}
+
+const decoders = {
+ utf8: (data, hint) => {
+ if (data.length === 0)
+ return '';
+ if (typeof data === 'string') {
+ // If `data` never had any percent-encoded bytes or never had any that
+ // were outside of the ASCII range, then we can safely just return the
+ // input since UTF-8 is ASCII compatible
+ if (hint < 2)
+ return data;
+
+ data = Buffer.from(data, 'latin1');
+ }
+ return data.utf8Slice(0, data.length);
+ },
+
+ latin1: (data, hint) => {
+ if (data.length === 0)
+ return '';
+ if (typeof data === 'string')
+ return data;
+ return data.latin1Slice(0, data.length);
+ },
+
+ utf16le: (data, hint) => {
+ if (data.length === 0)
+ return '';
+ if (typeof data === 'string')
+ data = Buffer.from(data, 'latin1');
+ return data.ucs2Slice(0, data.length);
+ },
+
+ base64: (data, hint) => {
+ if (data.length === 0)
+ return '';
+ if (typeof data === 'string')
+ data = Buffer.from(data, 'latin1');
+ return data.base64Slice(0, data.length);
+ },
+
+ other: (data, hint) => {
+ if (data.length === 0)
+ return '';
+ if (typeof data === 'string')
+ data = Buffer.from(data, 'latin1');
+ try {
+ const decoder = new TextDecoder(this);
+ return decoder.decode(data);
+ } catch {}
+ },
+};
+
+function convertToUTF8(data, charset, hint) {
+ const decode = getDecoder(charset);
+ if (decode)
+ return decode(data, hint);
+}
+
+function basename(path) {
+ if (typeof path !== 'string')
+ return '';
+ for (let i = path.length - 1; i >= 0; --i) {
+ switch (path.charCodeAt(i)) {
+ case 0x2F: // '/'
+ case 0x5C: // '\'
+ path = path.slice(i + 1);
+ return (path === '..' || path === '.' ? '' : path);
+ }
+ }
+ return (path === '..' || path === '.' ? '' : path);
+}
+
+const TOKEN = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+];
+
+const QDTEXT = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+];
+
+const CHARSET = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+];
+
+const EXTENDED_VALUE = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+];
+
+/* eslint-disable no-multi-spaces */
+const HEX_VALUES = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+];
+/* eslint-enable no-multi-spaces */
+
+module.exports = {
+ basename,
+ convertToUTF8,
+ getDecoder,
+ parseContentType,
+ parseDisposition,
+};
diff --git a/node_modules/busboy/package.json b/node_modules/busboy/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..ac2577fe2c5873d1f171955eecce4caa5578fdbd
--- /dev/null
+++ b/node_modules/busboy/package.json
@@ -0,0 +1,22 @@
+{ "name": "busboy",
+ "version": "1.6.0",
+ "author": "Brian White ",
+ "description": "A streaming parser for HTML form data for node.js",
+ "main": "./lib/index.js",
+ "dependencies": {
+ "streamsearch": "^1.1.0"
+ },
+ "devDependencies": {
+ "@mscdex/eslint-config": "^1.1.0",
+ "eslint": "^7.32.0"
+ },
+ "scripts": {
+ "test": "node test/test.js",
+ "lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib test bench",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "engines": { "node": ">=10.16.0" },
+ "keywords": [ "uploads", "forms", "multipart", "form-data" ],
+ "licenses": [ { "type": "MIT", "url": "http://github.com/mscdex/busboy/raw/master/LICENSE" } ],
+ "repository": { "type": "git", "url": "http://github.com/mscdex/busboy.git" }
+}
diff --git a/node_modules/busboy/test/common.js b/node_modules/busboy/test/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..fb82ad81b1b9ef0e07164e6bfecd8391264ef2c2
--- /dev/null
+++ b/node_modules/busboy/test/common.js
@@ -0,0 +1,109 @@
+'use strict';
+
+const assert = require('assert');
+const { inspect } = require('util');
+
+const mustCallChecks = [];
+
+function noop() {}
+
+function runCallChecks(exitCode) {
+ if (exitCode !== 0) return;
+
+ const failed = mustCallChecks.filter((context) => {
+ if ('minimum' in context) {
+ context.messageSegment = `at least ${context.minimum}`;
+ return context.actual < context.minimum;
+ }
+ context.messageSegment = `exactly ${context.exact}`;
+ return context.actual !== context.exact;
+ });
+
+ failed.forEach((context) => {
+ console.error('Mismatched %s function calls. Expected %s, actual %d.',
+ context.name,
+ context.messageSegment,
+ context.actual);
+ console.error(context.stack.split('\n').slice(2).join('\n'));
+ });
+
+ if (failed.length)
+ process.exit(1);
+}
+
+function mustCall(fn, exact) {
+ return _mustCallInner(fn, exact, 'exact');
+}
+
+function mustCallAtLeast(fn, minimum) {
+ return _mustCallInner(fn, minimum, 'minimum');
+}
+
+function _mustCallInner(fn, criteria = 1, field) {
+ if (process._exiting)
+ throw new Error('Cannot use common.mustCall*() in process exit handler');
+
+ if (typeof fn === 'number') {
+ criteria = fn;
+ fn = noop;
+ } else if (fn === undefined) {
+ fn = noop;
+ }
+
+ if (typeof criteria !== 'number')
+ throw new TypeError(`Invalid ${field} value: ${criteria}`);
+
+ const context = {
+ [field]: criteria,
+ actual: 0,
+ stack: inspect(new Error()),
+ name: fn.name || ''
+ };
+
+ // Add the exit listener only once to avoid listener leak warnings
+ if (mustCallChecks.length === 0)
+ process.on('exit', runCallChecks);
+
+ mustCallChecks.push(context);
+
+ function wrapped(...args) {
+ ++context.actual;
+ return fn.call(this, ...args);
+ }
+ // TODO: remove origFn?
+ wrapped.origFn = fn;
+
+ return wrapped;
+}
+
+function getCallSite(top) {
+ const originalStackFormatter = Error.prepareStackTrace;
+ Error.prepareStackTrace = (err, stack) =>
+ `${stack[0].getFileName()}:${stack[0].getLineNumber()}`;
+ const err = new Error();
+ Error.captureStackTrace(err, top);
+ // With the V8 Error API, the stack is not formatted until it is accessed
+ // eslint-disable-next-line no-unused-expressions
+ err.stack;
+ Error.prepareStackTrace = originalStackFormatter;
+ return err.stack;
+}
+
+function mustNotCall(msg) {
+ const callSite = getCallSite(mustNotCall);
+ return function mustNotCall(...args) {
+ args = args.map(inspect).join(', ');
+ const argsInfo = (args.length > 0
+ ? `\ncalled with arguments: ${args}`
+ : '');
+ assert.fail(
+ `${msg || 'function should not have been called'} at ${callSite}`
+ + argsInfo);
+ };
+}
+
+module.exports = {
+ mustCall,
+ mustCallAtLeast,
+ mustNotCall,
+};
diff --git a/node_modules/busboy/test/test-types-multipart-charsets.js b/node_modules/busboy/test/test-types-multipart-charsets.js
new file mode 100644
index 0000000000000000000000000000000000000000..ed9c38aeb6c1f3f85c9eb0efa071349504dbfde6
--- /dev/null
+++ b/node_modules/busboy/test/test-types-multipart-charsets.js
@@ -0,0 +1,94 @@
+'use strict';
+
+const assert = require('assert');
+const { inspect } = require('util');
+
+const { mustCall } = require(`${__dirname}/common.js`);
+
+const busboy = require('..');
+
+const input = Buffer.from([
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="テスト.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'A'.repeat(1023),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+].join('\r\n'));
+const boundary = '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k';
+const expected = [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('A'.repeat(1023)),
+ info: {
+ filename: 'テスト.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+];
+const bb = busboy({
+ defParamCharset: 'utf8',
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ }
+});
+const results = [];
+
+bb.on('field', (name, val, info) => {
+ results.push({ type: 'field', name, val, info });
+});
+
+bb.on('file', (name, stream, info) => {
+ const data = [];
+ let nb = 0;
+ const file = {
+ type: 'file',
+ name,
+ data: null,
+ info,
+ limited: false,
+ };
+ results.push(file);
+ stream.on('data', (d) => {
+ data.push(d);
+ nb += d.length;
+ }).on('limit', () => {
+ file.limited = true;
+ }).on('close', () => {
+ file.data = Buffer.concat(data, nb);
+ assert.strictEqual(stream.truncated, file.limited);
+ }).once('error', (err) => {
+ file.err = err.message;
+ });
+});
+
+bb.on('error', (err) => {
+ results.push({ error: err.message });
+});
+
+bb.on('partsLimit', () => {
+ results.push('partsLimit');
+});
+
+bb.on('filesLimit', () => {
+ results.push('filesLimit');
+});
+
+bb.on('fieldsLimit', () => {
+ results.push('fieldsLimit');
+});
+
+bb.on('close', mustCall(() => {
+ assert.deepStrictEqual(
+ results,
+ expected,
+ 'Results mismatch.\n'
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(expected)}`
+ );
+}));
+
+bb.end(input);
diff --git a/node_modules/busboy/test/test-types-multipart-stream-pause.js b/node_modules/busboy/test/test-types-multipart-stream-pause.js
new file mode 100644
index 0000000000000000000000000000000000000000..df7268a4b17f73af6e1087785e45a8fec2445703
--- /dev/null
+++ b/node_modules/busboy/test/test-types-multipart-stream-pause.js
@@ -0,0 +1,102 @@
+'use strict';
+
+const assert = require('assert');
+const { randomFillSync } = require('crypto');
+const { inspect } = require('util');
+
+const busboy = require('..');
+
+const { mustCall } = require('./common.js');
+
+const BOUNDARY = 'u2KxIV5yF1y+xUspOQCCZopaVgeV6Jxihv35XQJmuTx8X3sh';
+
+function formDataSection(key, value) {
+ return Buffer.from(
+ `\r\n--${BOUNDARY}`
+ + `\r\nContent-Disposition: form-data; name="${key}"`
+ + `\r\n\r\n${value}`
+ );
+}
+
+function formDataFile(key, filename, contentType) {
+ const buf = Buffer.allocUnsafe(100000);
+ return Buffer.concat([
+ Buffer.from(`\r\n--${BOUNDARY}\r\n`),
+ Buffer.from(`Content-Disposition: form-data; name="${key}"`
+ + `; filename="${filename}"\r\n`),
+ Buffer.from(`Content-Type: ${contentType}\r\n\r\n`),
+ randomFillSync(buf)
+ ]);
+}
+
+const reqChunks = [
+ Buffer.concat([
+ formDataFile('file', 'file.bin', 'application/octet-stream'),
+ formDataSection('foo', 'foo value'),
+ ]),
+ formDataSection('bar', 'bar value'),
+ Buffer.from(`\r\n--${BOUNDARY}--\r\n`)
+];
+const bb = busboy({
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${BOUNDARY}`
+ }
+});
+const expected = [
+ { type: 'file',
+ name: 'file',
+ info: {
+ filename: 'file.bin',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ },
+ { type: 'field',
+ name: 'foo',
+ val: 'foo value',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'field',
+ name: 'bar',
+ val: 'bar value',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+];
+const results = [];
+
+bb.on('field', (name, val, info) => {
+ results.push({ type: 'field', name, val, info });
+});
+
+bb.on('file', (name, stream, info) => {
+ results.push({ type: 'file', name, info });
+ // Simulate a pipe where the destination is pausing (perhaps due to waiting
+ // for file system write to finish)
+ setTimeout(() => {
+ stream.resume();
+ }, 10);
+});
+
+bb.on('close', mustCall(() => {
+ assert.deepStrictEqual(
+ results,
+ expected,
+ 'Results mismatch.\n'
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(expected)}`
+ );
+}));
+
+for (const chunk of reqChunks)
+ bb.write(chunk);
+bb.end();
diff --git a/node_modules/busboy/test/test-types-multipart.js b/node_modules/busboy/test/test-types-multipart.js
new file mode 100644
index 0000000000000000000000000000000000000000..9755642ad9060cbcdb2e2e97c1d3b484815d355d
--- /dev/null
+++ b/node_modules/busboy/test/test-types-multipart.js
@@ -0,0 +1,1053 @@
+'use strict';
+
+const assert = require('assert');
+const { inspect } = require('util');
+
+const busboy = require('..');
+
+const active = new Map();
+
+const tests = [
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'super alpha file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_1"',
+ '',
+ 'super beta file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'A'.repeat(1023),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="1k_b.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'B'.repeat(1023),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'super alpha file',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'field',
+ name: 'file_name_1',
+ val: 'super beta file',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('A'.repeat(1023)),
+ info: {
+ filename: '1k_a.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_1',
+ data: Buffer.from('B'.repeat(1023)),
+ info: {
+ filename: '1k_b.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Fields and files'
+ },
+ { source: [
+ ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: form-data; name="cont"',
+ '',
+ 'some random content',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: form-data; name="pass"',
+ '',
+ 'some random pass',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: form-data; name=bit',
+ '',
+ '2',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--'
+ ].join('\r\n')
+ ],
+ boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ expected: [
+ { type: 'field',
+ name: 'cont',
+ val: 'some random content',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'field',
+ name: 'pass',
+ val: 'some random pass',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'field',
+ name: 'bit',
+ val: '2',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ ],
+ what: 'Fields only'
+ },
+ { source: [
+ ''
+ ],
+ boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ expected: [
+ { error: 'Unexpected end of form' },
+ ],
+ what: 'No fields and no files'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'super alpha file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ fileSize: 13,
+ fieldSize: 5
+ },
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'super',
+ info: {
+ nameTruncated: false,
+ valueTruncated: true,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('ABCDEFGHIJKLM'),
+ info: {
+ filename: '1k_a.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: true,
+ },
+ ],
+ what: 'Fields and files (limits)'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'super alpha file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ files: 0
+ },
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'super alpha file',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ 'filesLimit',
+ ],
+ what: 'Fields and files (limits: 0 files)'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'super alpha file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_1"',
+ '',
+ 'super beta file',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'A'.repeat(1023),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="1k_b.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'B'.repeat(1023),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'super alpha file',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ { type: 'field',
+ name: 'file_name_1',
+ val: 'super beta file',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ ],
+ events: ['field'],
+ what: 'Fields and (ignored) files'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="/tmp/1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="C:\\files\\1k_b.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_2"; filename="relative/1k_c.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: '1k_a.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_1',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: '1k_b.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_2',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: '1k_c.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Files with filenames containing paths'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="/absolute/1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="C:\\absolute\\1k_b.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_2"; filename="relative/1k_c.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ preservePath: true,
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: '/absolute/1k_a.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_1',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: 'C:\\absolute\\1k_b.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_2',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: 'relative/1k_c.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Paths to be preserved through the preservePath option'
+ },
+ { source: [
+ ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: form-data; name="cont"',
+ 'Content-Type: ',
+ '',
+ 'some random content',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: ',
+ '',
+ 'some random pass',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--'
+ ].join('\r\n')
+ ],
+ boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ expected: [
+ { type: 'field',
+ name: 'cont',
+ val: 'some random content',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ ],
+ what: 'Empty content-type and empty content-disposition'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="file"; filename*=utf-8\'\'n%C3%A4me.txt',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--'
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'file',
+ data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ info: {
+ filename: 'näme.txt',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Unicode filenames'
+ },
+ { source: [
+ ['--asdasdasdasd\r\n',
+ 'Content-Type: text/plain\r\n',
+ 'Content-Disposition: form-data; name="foo"\r\n',
+ '\r\n',
+ 'asd\r\n',
+ '--asdasdasdasd--'
+ ].join(':)')
+ ],
+ boundary: 'asdasdasdasd',
+ expected: [
+ { error: 'Malformed part header' },
+ { error: 'Unexpected end of form' },
+ ],
+ what: 'Stopped mid-header'
+ },
+ { source: [
+ ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ 'Content-Disposition: form-data; name="cont"',
+ 'Content-Type: application/json',
+ '',
+ '{}',
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--',
+ ].join('\r\n')
+ ],
+ boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ expected: [
+ { type: 'field',
+ name: 'cont',
+ val: '{}',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'application/json',
+ },
+ },
+ ],
+ what: 'content-type for fields'
+ },
+ { source: [
+ '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--',
+ ],
+ boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY',
+ expected: [],
+ what: 'empty form'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name=upload_file_0; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ 'Content-Transfer-Encoding: binary',
+ '',
+ '',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.alloc(0),
+ info: {
+ filename: '1k_a.dat',
+ encoding: 'binary',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ err: 'Unexpected end of form',
+ },
+ { error: 'Unexpected end of form' },
+ ],
+ what: 'Stopped mid-file #1'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name=upload_file_0; filename="1k_a.dat"',
+ 'Content-Type: application/octet-stream',
+ '',
+ 'a',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('a'),
+ info: {
+ filename: '1k_a.dat',
+ encoding: '7bit',
+ mimeType: 'application/octet-stream',
+ },
+ limited: false,
+ err: 'Unexpected end of form',
+ },
+ { error: 'Unexpected end of form' },
+ ],
+ what: 'Stopped mid-file #2'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'a',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('a'),
+ info: {
+ filename: 'notes.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Text file with charset'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: ',
+ ' text/plain; charset=utf8',
+ '',
+ 'a',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('a'),
+ info: {
+ filename: 'notes.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Folded header value'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'a',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [],
+ what: 'No Content-Disposition'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'a'.repeat(64 * 1024),
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: ',
+ ' text/plain; charset=utf8',
+ '',
+ 'bc',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ fieldSize: Infinity,
+ },
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('bc'),
+ info: {
+ filename: 'notes.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ events: [ 'file' ],
+ what: 'Skip field parts if no listener'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'a',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: ',
+ ' text/plain; charset=utf8',
+ '',
+ 'bc',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ parts: 1,
+ },
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'a',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ 'partsLimit',
+ ],
+ what: 'Parts limit'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_0"',
+ '',
+ 'a',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; name="file_name_1"',
+ '',
+ 'b',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ fields: 1,
+ },
+ expected: [
+ { type: 'field',
+ name: 'file_name_0',
+ val: 'a',
+ info: {
+ nameTruncated: false,
+ valueTruncated: false,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ },
+ 'fieldsLimit',
+ ],
+ what: 'Fields limit'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'ab',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="notes2.txt"',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'cd',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ limits: {
+ files: 1,
+ },
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('ab'),
+ info: {
+ filename: 'notes.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ 'filesLimit',
+ ],
+ what: 'Files limit'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + `name="upload_file_0"; filename="${'a'.repeat(64 * 1024)}.txt"`,
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'ab',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_1"; filename="notes2.txt"',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'cd',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { error: 'Malformed part header' },
+ { type: 'file',
+ name: 'upload_file_1',
+ data: Buffer.from('cd'),
+ info: {
+ filename: 'notes2.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Oversized part header'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + 'name="upload_file_0"; filename="notes.txt"',
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'a'.repeat(31) + '\r',
+ ].join('\r\n'),
+ 'b'.repeat(40),
+ '\r\n-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ fileHwm: 32,
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('a'.repeat(31) + '\r' + 'b'.repeat(40)),
+ info: {
+ filename: 'notes.txt',
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Lookbehind data should not stall file streams'
+ },
+ { source: [
+ ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + `name="upload_file_0"; filename="${'a'.repeat(8 * 1024)}.txt"`,
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'ab',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + `name="upload_file_1"; filename="${'b'.repeat(8 * 1024)}.txt"`,
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'cd',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ 'Content-Disposition: form-data; '
+ + `name="upload_file_2"; filename="${'c'.repeat(8 * 1024)}.txt"`,
+ 'Content-Type: text/plain; charset=utf8',
+ '',
+ 'ef',
+ '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--',
+ ].join('\r\n')
+ ],
+ boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k',
+ expected: [
+ { type: 'file',
+ name: 'upload_file_0',
+ data: Buffer.from('ab'),
+ info: {
+ filename: `${'a'.repeat(8 * 1024)}.txt`,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_1',
+ data: Buffer.from('cd'),
+ info: {
+ filename: `${'b'.repeat(8 * 1024)}.txt`,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ { type: 'file',
+ name: 'upload_file_2',
+ data: Buffer.from('ef'),
+ info: {
+ filename: `${'c'.repeat(8 * 1024)}.txt`,
+ encoding: '7bit',
+ mimeType: 'text/plain',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Header size limit should be per part'
+ },
+ { source: [
+ '\r\n--d1bf46b3-aa33-4061-b28d-6c5ced8b08ee\r\n',
+ 'Content-Type: application/gzip\r\n'
+ + 'Content-Encoding: gzip\r\n'
+ + 'Content-Disposition: form-data; name=batch-1; filename=batch-1'
+ + '\r\n\r\n',
+ '\r\n--d1bf46b3-aa33-4061-b28d-6c5ced8b08ee--',
+ ],
+ boundary: 'd1bf46b3-aa33-4061-b28d-6c5ced8b08ee',
+ expected: [
+ { type: 'file',
+ name: 'batch-1',
+ data: Buffer.alloc(0),
+ info: {
+ filename: 'batch-1',
+ encoding: '7bit',
+ mimeType: 'application/gzip',
+ },
+ limited: false,
+ },
+ ],
+ what: 'Empty part'
+ },
+];
+
+for (const test of tests) {
+ active.set(test, 1);
+
+ const { what, boundary, events, limits, preservePath, fileHwm } = test;
+ const bb = busboy({
+ fileHwm,
+ limits,
+ preservePath,
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ }
+ });
+ const results = [];
+
+ if (events === undefined || events.includes('field')) {
+ bb.on('field', (name, val, info) => {
+ results.push({ type: 'field', name, val, info });
+ });
+ }
+
+ if (events === undefined || events.includes('file')) {
+ bb.on('file', (name, stream, info) => {
+ const data = [];
+ let nb = 0;
+ const file = {
+ type: 'file',
+ name,
+ data: null,
+ info,
+ limited: false,
+ };
+ results.push(file);
+ stream.on('data', (d) => {
+ data.push(d);
+ nb += d.length;
+ }).on('limit', () => {
+ file.limited = true;
+ }).on('close', () => {
+ file.data = Buffer.concat(data, nb);
+ assert.strictEqual(stream.truncated, file.limited);
+ }).once('error', (err) => {
+ file.err = err.message;
+ });
+ });
+ }
+
+ bb.on('error', (err) => {
+ results.push({ error: err.message });
+ });
+
+ bb.on('partsLimit', () => {
+ results.push('partsLimit');
+ });
+
+ bb.on('filesLimit', () => {
+ results.push('filesLimit');
+ });
+
+ bb.on('fieldsLimit', () => {
+ results.push('fieldsLimit');
+ });
+
+ bb.on('close', () => {
+ active.delete(test);
+
+ assert.deepStrictEqual(
+ results,
+ test.expected,
+ `[${what}] Results mismatch.\n`
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(test.expected)}`
+ );
+ });
+
+ for (const src of test.source) {
+ const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src);
+ bb.write(buf);
+ }
+ bb.end();
+}
+
+// Byte-by-byte versions
+for (let test of tests) {
+ test = { ...test };
+ test.what += ' (byte-by-byte)';
+ active.set(test, 1);
+
+ const { what, boundary, events, limits, preservePath, fileHwm } = test;
+ const bb = busboy({
+ fileHwm,
+ limits,
+ preservePath,
+ headers: {
+ 'content-type': `multipart/form-data; boundary=${boundary}`,
+ }
+ });
+ const results = [];
+
+ if (events === undefined || events.includes('field')) {
+ bb.on('field', (name, val, info) => {
+ results.push({ type: 'field', name, val, info });
+ });
+ }
+
+ if (events === undefined || events.includes('file')) {
+ bb.on('file', (name, stream, info) => {
+ const data = [];
+ let nb = 0;
+ const file = {
+ type: 'file',
+ name,
+ data: null,
+ info,
+ limited: false,
+ };
+ results.push(file);
+ stream.on('data', (d) => {
+ data.push(d);
+ nb += d.length;
+ }).on('limit', () => {
+ file.limited = true;
+ }).on('close', () => {
+ file.data = Buffer.concat(data, nb);
+ assert.strictEqual(stream.truncated, file.limited);
+ }).once('error', (err) => {
+ file.err = err.message;
+ });
+ });
+ }
+
+ bb.on('error', (err) => {
+ results.push({ error: err.message });
+ });
+
+ bb.on('partsLimit', () => {
+ results.push('partsLimit');
+ });
+
+ bb.on('filesLimit', () => {
+ results.push('filesLimit');
+ });
+
+ bb.on('fieldsLimit', () => {
+ results.push('fieldsLimit');
+ });
+
+ bb.on('close', () => {
+ active.delete(test);
+
+ assert.deepStrictEqual(
+ results,
+ test.expected,
+ `[${what}] Results mismatch.\n`
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(test.expected)}`
+ );
+ });
+
+ for (const src of test.source) {
+ const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src);
+ for (let i = 0; i < buf.length; ++i)
+ bb.write(buf.slice(i, i + 1));
+ }
+ bb.end();
+}
+
+{
+ let exception = false;
+ process.once('uncaughtException', (ex) => {
+ exception = true;
+ throw ex;
+ });
+ process.on('exit', () => {
+ if (exception || active.size === 0)
+ return;
+ process.exitCode = 1;
+ console.error('==========================');
+ console.error(`${active.size} test(s) did not finish:`);
+ console.error('==========================');
+ console.error(Array.from(active.keys()).map((v) => v.what).join('\n'));
+ });
+}
diff --git a/node_modules/busboy/test/test-types-urlencoded.js b/node_modules/busboy/test/test-types-urlencoded.js
new file mode 100644
index 0000000000000000000000000000000000000000..c35962b973f29a69951ed7eae08c0abe6dfbb7da
--- /dev/null
+++ b/node_modules/busboy/test/test-types-urlencoded.js
@@ -0,0 +1,488 @@
+'use strict';
+
+const assert = require('assert');
+const { transcode } = require('buffer');
+const { inspect } = require('util');
+
+const busboy = require('..');
+
+const active = new Map();
+
+const tests = [
+ { source: ['foo'],
+ expected: [
+ ['foo',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Unassigned value'
+ },
+ { source: ['foo=bar'],
+ expected: [
+ ['foo',
+ 'bar',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned value'
+ },
+ { source: ['foo&bar=baz'],
+ expected: [
+ ['foo',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['bar',
+ 'baz',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Unassigned and assigned value'
+ },
+ { source: ['foo=bar&baz'],
+ expected: [
+ ['foo',
+ 'bar',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['baz',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned and unassigned value'
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['foo',
+ 'bar',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['baz',
+ 'bla',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Two assigned values'
+ },
+ { source: ['foo&bar'],
+ expected: [
+ ['foo',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['bar',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Two unassigned values'
+ },
+ { source: ['foo&bar&'],
+ expected: [
+ ['foo',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['bar',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Two unassigned values and ampersand'
+ },
+ { source: ['foo+1=bar+baz%2Bquux'],
+ expected: [
+ ['foo 1',
+ 'bar baz+quux',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned key and value with (plus) space'
+ },
+ { source: ['foo=bar%20baz%21'],
+ expected: [
+ ['foo',
+ 'bar baz!',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned value with encoded bytes'
+ },
+ { source: ['foo%20bar=baz%20bla%21'],
+ expected: [
+ ['foo bar',
+ 'baz bla!',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned value with encoded bytes #2'
+ },
+ { source: ['foo=bar%20baz%21&num=1000'],
+ expected: [
+ ['foo',
+ 'bar baz!',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['num',
+ '1000',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Two assigned values, one with encoded bytes'
+ },
+ { source: [
+ Array.from(transcode(Buffer.from('foo'), 'utf8', 'utf16le')).map(
+ (n) => `%${n.toString(16).padStart(2, '0')}`
+ ).join(''),
+ '=',
+ Array.from(transcode(Buffer.from('😀!'), 'utf8', 'utf16le')).map(
+ (n) => `%${n.toString(16).padStart(2, '0')}`
+ ).join(''),
+ ],
+ expected: [
+ ['foo',
+ '😀!',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'UTF-16LE',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ charset: 'UTF-16LE',
+ what: 'Encoded value with multi-byte charset'
+ },
+ { source: [
+ 'foo=<',
+ Array.from(transcode(Buffer.from('©:^þ'), 'utf8', 'latin1')).map(
+ (n) => `%${n.toString(16).padStart(2, '0')}`
+ ).join(''),
+ ],
+ expected: [
+ ['foo',
+ '<©:^þ',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'ISO-8859-1',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ charset: 'ISO-8859-1',
+ what: 'Encoded value with single-byte, ASCII-compatible, non-UTF8 charset'
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [],
+ what: 'Limits: zero fields',
+ limits: { fields: 0 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['foo',
+ 'bar',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: one field',
+ limits: { fields: 1 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['foo',
+ 'bar',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['baz',
+ 'bla',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: field part lengths match limits',
+ limits: { fieldNameSize: 3, fieldSize: 3 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['fo',
+ 'bar',
+ { nameTruncated: true,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['ba',
+ 'bla',
+ { nameTruncated: true,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: truncated field name',
+ limits: { fieldNameSize: 2 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['foo',
+ 'ba',
+ { nameTruncated: false,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['baz',
+ 'bl',
+ { nameTruncated: false,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: truncated field value',
+ limits: { fieldSize: 2 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['fo',
+ 'ba',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['ba',
+ 'bl',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: truncated field name and value',
+ limits: { fieldNameSize: 2, fieldSize: 2 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['fo',
+ '',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['ba',
+ '',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: truncated field name and zero value limit',
+ limits: { fieldNameSize: 2, fieldSize: 0 }
+ },
+ { source: ['foo=bar&baz=bla'],
+ expected: [
+ ['',
+ '',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ['',
+ '',
+ { nameTruncated: true,
+ valueTruncated: true,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Limits: truncated zero field name and zero value limit',
+ limits: { fieldNameSize: 0, fieldSize: 0 }
+ },
+ { source: ['&'],
+ expected: [],
+ what: 'Ampersand'
+ },
+ { source: ['&&&&&'],
+ expected: [],
+ what: 'Many ampersands'
+ },
+ { source: ['='],
+ expected: [
+ ['',
+ '',
+ { nameTruncated: false,
+ valueTruncated: false,
+ encoding: 'utf-8',
+ mimeType: 'text/plain' },
+ ],
+ ],
+ what: 'Assigned value, empty name and value'
+ },
+ { source: [''],
+ expected: [],
+ what: 'Nothing'
+ },
+];
+
+for (const test of tests) {
+ active.set(test, 1);
+
+ const { what } = test;
+ const charset = test.charset || 'utf-8';
+ const bb = busboy({
+ limits: test.limits,
+ headers: {
+ 'content-type': `application/x-www-form-urlencoded; charset=${charset}`,
+ },
+ });
+ const results = [];
+
+ bb.on('field', (key, val, info) => {
+ results.push([key, val, info]);
+ });
+
+ bb.on('file', () => {
+ throw new Error(`[${what}] Unexpected file`);
+ });
+
+ bb.on('close', () => {
+ active.delete(test);
+
+ assert.deepStrictEqual(
+ results,
+ test.expected,
+ `[${what}] Results mismatch.\n`
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(test.expected)}`
+ );
+ });
+
+ for (const src of test.source) {
+ const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src);
+ bb.write(buf);
+ }
+ bb.end();
+}
+
+// Byte-by-byte versions
+for (let test of tests) {
+ test = { ...test };
+ test.what += ' (byte-by-byte)';
+ active.set(test, 1);
+
+ const { what } = test;
+ const charset = test.charset || 'utf-8';
+ const bb = busboy({
+ limits: test.limits,
+ headers: {
+ 'content-type': `application/x-www-form-urlencoded; charset="${charset}"`,
+ },
+ });
+ const results = [];
+
+ bb.on('field', (key, val, info) => {
+ results.push([key, val, info]);
+ });
+
+ bb.on('file', () => {
+ throw new Error(`[${what}] Unexpected file`);
+ });
+
+ bb.on('close', () => {
+ active.delete(test);
+
+ assert.deepStrictEqual(
+ results,
+ test.expected,
+ `[${what}] Results mismatch.\n`
+ + `Parsed: ${inspect(results)}\n`
+ + `Expected: ${inspect(test.expected)}`
+ );
+ });
+
+ for (const src of test.source) {
+ const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src);
+ for (let i = 0; i < buf.length; ++i)
+ bb.write(buf.slice(i, i + 1));
+ }
+ bb.end();
+}
+
+{
+ let exception = false;
+ process.once('uncaughtException', (ex) => {
+ exception = true;
+ throw ex;
+ });
+ process.on('exit', () => {
+ if (exception || active.size === 0)
+ return;
+ process.exitCode = 1;
+ console.error('==========================');
+ console.error(`${active.size} test(s) did not finish:`);
+ console.error('==========================');
+ console.error(Array.from(active.keys()).map((v) => v.what).join('\n'));
+ });
+}
diff --git a/node_modules/busboy/test/test.js b/node_modules/busboy/test/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..d0380f29de7842d0f5451b79c93c77067b421324
--- /dev/null
+++ b/node_modules/busboy/test/test.js
@@ -0,0 +1,20 @@
+'use strict';
+
+const { spawnSync } = require('child_process');
+const { readdirSync } = require('fs');
+const { join } = require('path');
+
+const files = readdirSync(__dirname).sort();
+for (const filename of files) {
+ if (filename.startsWith('test-')) {
+ const path = join(__dirname, filename);
+ console.log(`> Running ${filename} ...`);
+ const result = spawnSync(`${process.argv0} ${path}`, {
+ shell: true,
+ stdio: 'inherit',
+ windowsHide: true
+ });
+ if (result.status !== 0)
+ process.exitCode = 1;
+ }
+}
diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md
new file mode 100644
index 0000000000000000000000000000000000000000..d60ce0e6df2efd3f83c08b098d1b7b683b96ec84
--- /dev/null
+++ b/node_modules/bytes/History.md
@@ -0,0 +1,97 @@
+3.1.2 / 2022-01-27
+==================
+
+ * Fix return value for un-parsable strings
+
+3.1.1 / 2021-11-15
+==================
+
+ * Fix "thousandsSeparator" incorrecting formatting fractional part
+
+3.1.0 / 2019-01-22
+==================
+
+ * Add petabyte (`pb`) support
+
+3.0.0 / 2017-08-31
+==================
+
+ * Change "kB" to "KB" in format output
+ * Remove support for Node.js 0.6
+ * Remove support for ComponentJS
+
+2.5.0 / 2017-03-24
+==================
+
+ * Add option "unit"
+
+2.4.0 / 2016-06-01
+==================
+
+ * Add option "unitSeparator"
+
+2.3.0 / 2016-02-15
+==================
+
+ * Drop partial bytes on all parsed units
+ * Fix non-finite numbers to `.format` to return `null`
+ * Fix parsing byte string that looks like hex
+ * perf: hoist regular expressions
+
+2.2.0 / 2015-11-13
+==================
+
+ * add option "decimalPlaces"
+ * add option "fixedDecimals"
+
+2.1.0 / 2015-05-21
+==================
+
+ * add `.format` export
+ * add `.parse` export
+
+2.0.2 / 2015-05-20
+==================
+
+ * remove map recreation
+ * remove unnecessary object construction
+
+2.0.1 / 2015-05-07
+==================
+
+ * fix browserify require
+ * remove node.extend dependency
+
+2.0.0 / 2015-04-12
+==================
+
+ * add option "case"
+ * add option "thousandsSeparator"
+ * return "null" on invalid parse input
+ * support proper round-trip: bytes(bytes(num)) === num
+ * units no longer case sensitive when parsing
+
+1.0.0 / 2014-05-05
+==================
+
+ * add negative support. fixes #6
+
+0.3.0 / 2014-03-19
+==================
+
+ * added terabyte support
+
+0.2.1 / 2013-04-01
+==================
+
+ * add .component
+
+0.2.0 / 2012-10-28
+==================
+
+ * bytes(200).should.eql('200b')
+
+0.1.0 / 2012-07-04
+==================
+
+ * add bytes to string conversion [yields]
diff --git a/node_modules/bytes/LICENSE b/node_modules/bytes/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..63e95a96338a608c218a7ef5805629878aaa951f
--- /dev/null
+++ b/node_modules/bytes/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 TJ Holowaychuk
+Copyright (c) 2015 Jed Watson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/bytes/Readme.md b/node_modules/bytes/Readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..5790e23e328e045e66ec6f0b98526157b6c2abcf
--- /dev/null
+++ b/node_modules/bytes/Readme.md
@@ -0,0 +1,152 @@
+# Bytes utility
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Build Status][ci-image]][ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa.
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```bash
+$ npm install bytes
+```
+
+## Usage
+
+```js
+var bytes = require('bytes');
+```
+
+#### bytes(number|string value, [options]): number|string|null
+
+Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`.
+
+**Arguments**
+
+| Name | Type | Description |
+|---------|----------|--------------------|
+| value | `number`|`string` | Number value to format or string value to parse |
+| options | `Object` | Conversion options for `format` |
+
+**Returns**
+
+| Name | Type | Description |
+|---------|------------------|-------------------------------------------------|
+| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. |
+
+**Example**
+
+```js
+bytes(1024);
+// output: '1KB'
+
+bytes('1KB');
+// output: 1024
+```
+
+#### bytes.format(number value, [options]): string|null
+
+Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is
+ rounded.
+
+**Arguments**
+
+| Name | Type | Description |
+|---------|----------|--------------------|
+| value | `number` | Value in bytes |
+| options | `Object` | Conversion options |
+
+**Options**
+
+| Property | Type | Description |
+|-------------------|--------|-----------------------------------------------------------------------------------------|
+| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. |
+| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` |
+| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. |
+| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). |
+| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. |
+
+**Returns**
+
+| Name | Type | Description |
+|---------|------------------|-------------------------------------------------|
+| results | `string`|`null` | Return null upon error. String value otherwise. |
+
+**Example**
+
+```js
+bytes.format(1024);
+// output: '1KB'
+
+bytes.format(1000);
+// output: '1000B'
+
+bytes.format(1000, {thousandsSeparator: ' '});
+// output: '1 000B'
+
+bytes.format(1024 * 1.7, {decimalPlaces: 0});
+// output: '2KB'
+
+bytes.format(1024, {unitSeparator: ' '});
+// output: '1 KB'
+```
+
+#### bytes.parse(string|number value): number|null
+
+Parse the string value into an integer in bytes. If no unit is given, or `value`
+is a number, it is assumed the value is in bytes.
+
+Supported units and abbreviations are as follows and are case-insensitive:
+
+ * `b` for bytes
+ * `kb` for kilobytes
+ * `mb` for megabytes
+ * `gb` for gigabytes
+ * `tb` for terabytes
+ * `pb` for petabytes
+
+The units are in powers of two, not ten. This means 1kb = 1024b according to this parser.
+
+**Arguments**
+
+| Name | Type | Description |
+|---------------|--------|--------------------|
+| value | `string`|`number` | String to parse, or number in bytes. |
+
+**Returns**
+
+| Name | Type | Description |
+|---------|-------------|-------------------------|
+| results | `number`|`null` | Return null upon error. Value in bytes otherwise. |
+
+**Example**
+
+```js
+bytes.parse('1KB');
+// output: 1024
+
+bytes.parse('1024');
+// output: 1024
+
+bytes.parse(1024);
+// output: 1024
+```
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci
+[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci
+[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master
+[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master
+[downloads-image]: https://badgen.net/npm/dm/bytes
+[downloads-url]: https://npmjs.org/package/bytes
+[npm-image]: https://badgen.net/npm/v/bytes
+[npm-url]: https://npmjs.org/package/bytes
diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..6f2d0f89e1258564bad95175159e1d8a6abd9ddf
--- /dev/null
+++ b/node_modules/bytes/index.js
@@ -0,0 +1,170 @@
+/*!
+ * bytes
+ * Copyright(c) 2012-2014 TJ Holowaychuk
+ * Copyright(c) 2015 Jed Watson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = bytes;
+module.exports.format = format;
+module.exports.parse = parse;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
+
+var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
+
+var map = {
+ b: 1,
+ kb: 1 << 10,
+ mb: 1 << 20,
+ gb: 1 << 30,
+ tb: Math.pow(1024, 4),
+ pb: Math.pow(1024, 5),
+};
+
+var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
+
+/**
+ * Convert the given value in bytes into a string or parse to string to an integer in bytes.
+ *
+ * @param {string|number} value
+ * @param {{
+ * case: [string],
+ * decimalPlaces: [number]
+ * fixedDecimals: [boolean]
+ * thousandsSeparator: [string]
+ * unitSeparator: [string]
+ * }} [options] bytes options.
+ *
+ * @returns {string|number|null}
+ */
+
+function bytes(value, options) {
+ if (typeof value === 'string') {
+ return parse(value);
+ }
+
+ if (typeof value === 'number') {
+ return format(value, options);
+ }
+
+ return null;
+}
+
+/**
+ * Format the given value in bytes into a string.
+ *
+ * If the value is negative, it is kept as such. If it is a float,
+ * it is rounded.
+ *
+ * @param {number} value
+ * @param {object} [options]
+ * @param {number} [options.decimalPlaces=2]
+ * @param {number} [options.fixedDecimals=false]
+ * @param {string} [options.thousandsSeparator=]
+ * @param {string} [options.unit=]
+ * @param {string} [options.unitSeparator=]
+ *
+ * @returns {string|null}
+ * @public
+ */
+
+function format(value, options) {
+ if (!Number.isFinite(value)) {
+ return null;
+ }
+
+ var mag = Math.abs(value);
+ var thousandsSeparator = (options && options.thousandsSeparator) || '';
+ var unitSeparator = (options && options.unitSeparator) || '';
+ var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
+ var fixedDecimals = Boolean(options && options.fixedDecimals);
+ var unit = (options && options.unit) || '';
+
+ if (!unit || !map[unit.toLowerCase()]) {
+ if (mag >= map.pb) {
+ unit = 'PB';
+ } else if (mag >= map.tb) {
+ unit = 'TB';
+ } else if (mag >= map.gb) {
+ unit = 'GB';
+ } else if (mag >= map.mb) {
+ unit = 'MB';
+ } else if (mag >= map.kb) {
+ unit = 'KB';
+ } else {
+ unit = 'B';
+ }
+ }
+
+ var val = value / map[unit.toLowerCase()];
+ var str = val.toFixed(decimalPlaces);
+
+ if (!fixedDecimals) {
+ str = str.replace(formatDecimalsRegExp, '$1');
+ }
+
+ if (thousandsSeparator) {
+ str = str.split('.').map(function (s, i) {
+ return i === 0
+ ? s.replace(formatThousandsRegExp, thousandsSeparator)
+ : s
+ }).join('.');
+ }
+
+ return str + unitSeparator + unit;
+}
+
+/**
+ * Parse the string value into an integer in bytes.
+ *
+ * If no unit is given, it is assumed the value is in bytes.
+ *
+ * @param {number|string} val
+ *
+ * @returns {number|null}
+ * @public
+ */
+
+function parse(val) {
+ if (typeof val === 'number' && !isNaN(val)) {
+ return val;
+ }
+
+ if (typeof val !== 'string') {
+ return null;
+ }
+
+ // Test if the string passed is valid
+ var results = parseRegExp.exec(val);
+ var floatValue;
+ var unit = 'b';
+
+ if (!results) {
+ // Nothing could be extracted from the given string
+ floatValue = parseInt(val, 10);
+ unit = 'b'
+ } else {
+ // Retrieve the value and the unit
+ floatValue = parseFloat(results[1]);
+ unit = results[4].toLowerCase();
+ }
+
+ if (isNaN(floatValue)) {
+ return null;
+ }
+
+ return Math.floor(map[unit] * floatValue);
+}
diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..f2b6a8b0e3c9020746409617bcd562c9368be451
--- /dev/null
+++ b/node_modules/bytes/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "bytes",
+ "description": "Utility to parse a string bytes to bytes and vice-versa",
+ "version": "3.1.2",
+ "author": "TJ Holowaychuk (http://tjholowaychuk.com)",
+ "contributors": [
+ "Jed Watson ",
+ "Théo FIDRY "
+ ],
+ "license": "MIT",
+ "keywords": [
+ "byte",
+ "bytes",
+ "utility",
+ "parse",
+ "parser",
+ "convert",
+ "converter"
+ ],
+ "repository": "visionmedia/bytes.js",
+ "devDependencies": {
+ "eslint": "7.32.0",
+ "eslint-plugin-markdown": "2.2.1",
+ "mocha": "9.2.0",
+ "nyc": "15.1.0"
+ },
+ "files": [
+ "History.md",
+ "LICENSE",
+ "Readme.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --check-leaks --reporter spec",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
+ }
+}
diff --git a/node_modules/call-bind-apply-helpers/.eslintrc b/node_modules/call-bind-apply-helpers/.eslintrc
new file mode 100644
index 0000000000000000000000000000000000000000..201e859be230a5390ae41935c6f8d5f2ab1dbb5f
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/.eslintrc
@@ -0,0 +1,17 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "func-name-matching": 0,
+ "id-length": 0,
+ "new-cap": [2, {
+ "capIsNewExceptions": [
+ "GetIntrinsic",
+ ],
+ }],
+ "no-extra-parens": 0,
+ "no-magic-numbers": 0,
+ },
+}
diff --git a/node_modules/call-bind-apply-helpers/.github/FUNDING.yml b/node_modules/call-bind-apply-helpers/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..0011e9d65fcaefeaccd7c79a0357e8f2214695ed
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/call-bind-apply-helpers
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/call-bind-apply-helpers/.nycrc b/node_modules/call-bind-apply-helpers/.nycrc
new file mode 100644
index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/.nycrc
@@ -0,0 +1,9 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/call-bind-apply-helpers/CHANGELOG.md b/node_modules/call-bind-apply-helpers/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..24849428bae69540a59077dd4d6b3d15ab7b097b
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/CHANGELOG.md
@@ -0,0 +1,30 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12
+
+### Commits
+
+- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1)
+- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1)
+
+## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08
+
+### Commits
+
+- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8)
+- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75)
+- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940)
+
+## v1.0.0 - 2024-12-05
+
+### Commits
+
+- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04)
+- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f)
+- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603)
+- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930)
diff --git a/node_modules/call-bind-apply-helpers/LICENSE b/node_modules/call-bind-apply-helpers/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f82f38963b0d282b529f64def2bcd40be3a9a947
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/call-bind-apply-helpers/README.md b/node_modules/call-bind-apply-helpers/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..8fc0dae1b3f6b0a22322a21b40b0f51665eadfb0
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/README.md
@@ -0,0 +1,62 @@
+# call-bind-apply-helpers [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+Helper functions around Function call/apply/bind, for use in `call-bind`.
+
+The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`.
+Please use `call-bind` unless you have a very good reason not to.
+
+## Getting started
+
+```sh
+npm install --save call-bind-apply-helpers
+```
+
+## Usage/Examples
+
+```js
+const assert = require('assert');
+const callBindBasic = require('call-bind-apply-helpers');
+
+function f(a, b) {
+ assert.equal(this, 1);
+ assert.equal(a, 2);
+ assert.equal(b, 3);
+ assert.equal(arguments.length, 2);
+}
+
+const fBound = callBindBasic([f, 1]);
+
+delete Function.prototype.call;
+delete Function.prototype.bind;
+
+fBound(2, 3);
+```
+
+## Tests
+
+Clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/call-bind-apply-helpers
+[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg
+[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg
+[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers
+[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg
+[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers
+[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers
+[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions
diff --git a/node_modules/call-bind-apply-helpers/actualApply.d.ts b/node_modules/call-bind-apply-helpers/actualApply.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b87286a21e3eda5e94932818c21e2bd20b30e905
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/actualApply.d.ts
@@ -0,0 +1 @@
+export = Reflect.apply;
\ No newline at end of file
diff --git a/node_modules/call-bind-apply-helpers/actualApply.js b/node_modules/call-bind-apply-helpers/actualApply.js
new file mode 100644
index 0000000000000000000000000000000000000000..ffa51355dc7e5d3eb24f602f85f6ae57d087d310
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/actualApply.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var bind = require('function-bind');
+
+var $apply = require('./functionApply');
+var $call = require('./functionCall');
+var $reflectApply = require('./reflectApply');
+
+/** @type {import('./actualApply')} */
+module.exports = $reflectApply || bind.call($call, $apply);
diff --git a/node_modules/call-bind-apply-helpers/applyBind.d.ts b/node_modules/call-bind-apply-helpers/applyBind.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d176c1ab30e5193071f5f6a6b6e8aaa4402476c6
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/applyBind.d.ts
@@ -0,0 +1,19 @@
+import actualApply from './actualApply';
+
+type TupleSplitHead = T['length'] extends N
+ ? T
+ : T extends [...infer R, any]
+ ? TupleSplitHead
+ : never
+
+type TupleSplitTail = O['length'] extends N
+ ? T
+ : T extends [infer F, ...infer R]
+ ? TupleSplitTail<[...R], N, [...O, F]>
+ : never
+
+type TupleSplit = [TupleSplitHead, TupleSplitTail]
+
+declare function applyBind(...args: TupleSplit, 2>[1]): ReturnType;
+
+export = applyBind;
\ No newline at end of file
diff --git a/node_modules/call-bind-apply-helpers/applyBind.js b/node_modules/call-bind-apply-helpers/applyBind.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2b7723147450c8094f98d20d88a5170a4173bbb
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/applyBind.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var bind = require('function-bind');
+var $apply = require('./functionApply');
+var actualApply = require('./actualApply');
+
+/** @type {import('./applyBind')} */
+module.exports = function applyBind() {
+ return actualApply(bind, $apply, arguments);
+};
diff --git a/node_modules/call-bind-apply-helpers/functionApply.d.ts b/node_modules/call-bind-apply-helpers/functionApply.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1f6e11b3d0e95337b67b81b962b4c6abe69ed7ae
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/functionApply.d.ts
@@ -0,0 +1 @@
+export = Function.prototype.apply;
\ No newline at end of file
diff --git a/node_modules/call-bind-apply-helpers/functionApply.js b/node_modules/call-bind-apply-helpers/functionApply.js
new file mode 100644
index 0000000000000000000000000000000000000000..c71df9c2bcf07ca4340530058d0662661f29ec95
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/functionApply.js
@@ -0,0 +1,4 @@
+'use strict';
+
+/** @type {import('./functionApply')} */
+module.exports = Function.prototype.apply;
diff --git a/node_modules/call-bind-apply-helpers/functionCall.d.ts b/node_modules/call-bind-apply-helpers/functionCall.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..15e93df350fb6b8552c6ba89289966a8b998064e
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/functionCall.d.ts
@@ -0,0 +1 @@
+export = Function.prototype.call;
\ No newline at end of file
diff --git a/node_modules/call-bind-apply-helpers/functionCall.js b/node_modules/call-bind-apply-helpers/functionCall.js
new file mode 100644
index 0000000000000000000000000000000000000000..7a8d8735752ef518698f1fe62b4edd16725898a8
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/functionCall.js
@@ -0,0 +1,4 @@
+'use strict';
+
+/** @type {import('./functionCall')} */
+module.exports = Function.prototype.call;
diff --git a/node_modules/call-bind-apply-helpers/index.d.ts b/node_modules/call-bind-apply-helpers/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..541516bd0f23194a87482e272f48439100b70c73
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/index.d.ts
@@ -0,0 +1,64 @@
+type RemoveFromTuple<
+ Tuple extends readonly unknown[],
+ RemoveCount extends number,
+ Index extends 1[] = []
+> = Index["length"] extends RemoveCount
+ ? Tuple
+ : Tuple extends [infer First, ...infer Rest]
+ ? RemoveFromTuple
+ : Tuple;
+
+type ConcatTuples<
+ Prefix extends readonly unknown[],
+ Suffix extends readonly unknown[]
+> = [...Prefix, ...Suffix];
+
+type ExtractFunctionParams = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R
+ ? { thisArg: TThis; params: P; returnType: R }
+ : never;
+
+type BindFunction<
+ T extends (this: any, ...args: any[]) => any,
+ TThis,
+ TBoundArgs extends readonly unknown[],
+ ReceiverBound extends boolean
+> = ExtractFunctionParams extends {
+ thisArg: infer OrigThis;
+ params: infer P extends readonly unknown[];
+ returnType: infer R;
+}
+ ? ReceiverBound extends true
+ ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest]
+ ? [TThis, ...Rest] // Replace `this` with `thisArg`
+ : R
+ : >>(
+ thisArg: U,
+ ...args: RemainingArgs
+ ) => R extends [OrigThis, ...infer Rest]
+ ? [U, ...ConcatTuples] // Preserve bound args in return type
+ : R
+ : never;
+
+declare function callBind<
+ const T extends (this: any, ...args: any[]) => any,
+ Extracted extends ExtractFunctionParams,
+ const TBoundArgs extends Partial & readonly unknown[],
+ const TThis extends Extracted["thisArg"]
+>(
+ args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
+): BindFunction;
+
+declare function callBind<
+ const T extends (this: any, ...args: any[]) => any,
+ Extracted extends ExtractFunctionParams,
+ const TBoundArgs extends Partial & readonly unknown[]
+>(
+ args: [fn: T, ...boundArgs: TBoundArgs]
+): BindFunction;
+
+declare function callBind(
+ args: [fn: Exclude, ...rest: TArgs]
+): never;
+
+// export as namespace callBind;
+export = callBind;
diff --git a/node_modules/call-bind-apply-helpers/index.js b/node_modules/call-bind-apply-helpers/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..2f6dab4c10431239352ab4626e326bf4e97cad5c
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/index.js
@@ -0,0 +1,15 @@
+'use strict';
+
+var bind = require('function-bind');
+var $TypeError = require('es-errors/type');
+
+var $call = require('./functionCall');
+var $actualApply = require('./actualApply');
+
+/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
+module.exports = function callBindBasic(args) {
+ if (args.length < 1 || typeof args[0] !== 'function') {
+ throw new $TypeError('a function is required');
+ }
+ return $actualApply(bind, $call, args);
+};
diff --git a/node_modules/call-bind-apply-helpers/package.json b/node_modules/call-bind-apply-helpers/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..923b8be2f14c65e78fd75a4fd34aba94fb733274
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/package.json
@@ -0,0 +1,85 @@
+{
+ "name": "call-bind-apply-helpers",
+ "version": "1.0.2",
+ "description": "Helper functions around Function call/apply/bind, for use in `call-bind`",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./actualApply": "./actualApply.js",
+ "./applyBind": "./applyBind.js",
+ "./functionApply": "./functionApply.js",
+ "./functionCall": "./functionCall.js",
+ "./reflectApply": "./reflectApply.js",
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=auto",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "prelint": "evalmd README.md",
+ "lint": "eslint --ext=.js,.mjs .",
+ "postlint": "tsc -p . && attw -P",
+ "pretest": "npm run lint",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@'>=10.2' audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ljharb/call-bind-apply-helpers.git"
+ },
+ "author": "Jordan Harband ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/ljharb/call-bind-apply-helpers/issues"
+ },
+ "homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.17.3",
+ "@ljharb/eslint-config": "^21.1.1",
+ "@ljharb/tsconfig": "^0.2.3",
+ "@types/for-each": "^0.3.3",
+ "@types/function-bind": "^1.1.10",
+ "@types/object-inspect": "^1.13.0",
+ "@types/tape": "^5.8.1",
+ "auto-changelog": "^2.5.0",
+ "encoding": "^0.1.13",
+ "es-value-fixtures": "^1.7.1",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "for-each": "^0.3.5",
+ "has-strict-mode": "^1.1.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "object-inspect": "^1.13.4",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.9.0",
+ "typescript": "next"
+ },
+ "testling": {
+ "files": "test/index.js"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+}
diff --git a/node_modules/call-bind-apply-helpers/reflectApply.d.ts b/node_modules/call-bind-apply-helpers/reflectApply.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6b2ae764c54541ae224d93bb49e8f176260601b6
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/reflectApply.d.ts
@@ -0,0 +1,3 @@
+declare const reflectApply: false | typeof Reflect.apply;
+
+export = reflectApply;
diff --git a/node_modules/call-bind-apply-helpers/reflectApply.js b/node_modules/call-bind-apply-helpers/reflectApply.js
new file mode 100644
index 0000000000000000000000000000000000000000..3d03caa695a5dd65a5aebbd2819621e757bda420
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/reflectApply.js
@@ -0,0 +1,4 @@
+'use strict';
+
+/** @type {import('./reflectApply')} */
+module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
diff --git a/node_modules/call-bind-apply-helpers/test/index.js b/node_modules/call-bind-apply-helpers/test/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..1cdc89ed4925c800751b44108a2e78305224d07c
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/test/index.js
@@ -0,0 +1,63 @@
+'use strict';
+
+var callBind = require('../');
+var hasStrictMode = require('has-strict-mode')();
+var forEach = require('for-each');
+var inspect = require('object-inspect');
+var v = require('es-value-fixtures');
+
+var test = require('tape');
+
+test('callBindBasic', function (t) {
+ forEach(v.nonFunctions, function (nonFunction) {
+ t['throws'](
+ // @ts-expect-error
+ function () { callBind([nonFunction]); },
+ TypeError,
+ inspect(nonFunction) + ' is not a function'
+ );
+ });
+
+ var sentinel = { sentinel: true };
+ /** @type {(this: T, a: A, b: B) => [T | undefined, A, B]} */
+ var func = function (a, b) {
+ // eslint-disable-next-line no-invalid-this
+ return [!hasStrictMode && this === global ? undefined : this, a, b];
+ };
+ t.equal(func.length, 2, 'original function length is 2');
+
+ /** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */
+ var bound = callBind([func]);
+ /** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */
+ var boundR = callBind([func, sentinel]);
+ /** type {((b: number) => [typeof sentinel, number, typeof b])} */
+ var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]);
+
+ // @ts-expect-error
+ t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args');
+
+ // @ts-expect-error
+ t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
+ // @ts-expect-error
+ t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args');
+ // @ts-expect-error
+ t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
+ // @ts-expect-error
+ t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
+
+ t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
+ t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args');
+ t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
+ t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
+
+ // @ts-expect-error
+ t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
+ // @ts-expect-error
+ t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args');
+ // @ts-expect-error
+ t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
+ // @ts-expect-error
+ t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
+
+ t.end();
+});
diff --git a/node_modules/call-bind-apply-helpers/tsconfig.json b/node_modules/call-bind-apply-helpers/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..aef9993084c3643257b6d6aea21f76017caf92a7
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@ljharb/tsconfig",
+ "compilerOptions": {
+ "target": "es2021",
+ },
+ "exclude": [
+ "coverage",
+ ],
+}
\ No newline at end of file
diff --git a/node_modules/call-bound/.eslintrc b/node_modules/call-bound/.eslintrc
new file mode 100644
index 0000000000000000000000000000000000000000..2612ed8fefad45d3a68ae842a28e0353ebcb5cf1
--- /dev/null
+++ b/node_modules/call-bound/.eslintrc
@@ -0,0 +1,13 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "new-cap": [2, {
+ "capIsNewExceptions": [
+ "GetIntrinsic",
+ ],
+ }],
+ },
+}
diff --git a/node_modules/call-bound/.github/FUNDING.yml b/node_modules/call-bound/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..2a2a13571375d28b56577ad1f91bddabde753f33
--- /dev/null
+++ b/node_modules/call-bound/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/call-bound
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/call-bound/.nycrc b/node_modules/call-bound/.nycrc
new file mode 100644
index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897
--- /dev/null
+++ b/node_modules/call-bound/.nycrc
@@ -0,0 +1,9 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/call-bound/CHANGELOG.md b/node_modules/call-bound/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..8bde4e9a56313204c5cc43fceb634a5d0c69d6ca
--- /dev/null
+++ b/node_modules/call-bound/CHANGELOG.md
@@ -0,0 +1,42 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03
+
+### Commits
+
+- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff)
+- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719)
+- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8)
+
+## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15
+
+### Commits
+
+- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be)
+- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e)
+- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49)
+- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7)
+
+## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10
+
+### Commits
+
+- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5)
+- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14)
+- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871)
+
+## v1.0.1 - 2024-12-05
+
+### Commits
+
+- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d)
+- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9)
+- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275)
+- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb)
+- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8)
+- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97)
diff --git a/node_modules/call-bound/LICENSE b/node_modules/call-bound/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f82f38963b0d282b529f64def2bcd40be3a9a947
--- /dev/null
+++ b/node_modules/call-bound/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/call-bound/README.md b/node_modules/call-bound/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..a44e43e56e07b9dce55d14eba09dcbbaf2024303
--- /dev/null
+++ b/node_modules/call-bound/README.md
@@ -0,0 +1,53 @@
+# call-bound [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
+
+## Getting started
+
+```sh
+npm install --save call-bound
+```
+
+## Usage/Examples
+
+```js
+const assert = require('assert');
+const callBound = require('call-bound');
+
+const slice = callBound('Array.prototype.slice');
+
+delete Function.prototype.call;
+delete Function.prototype.bind;
+delete Array.prototype.slice;
+
+assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
+```
+
+## Tests
+
+Clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/call-bound
+[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg
+[deps-svg]: https://david-dm.org/ljharb/call-bound.svg
+[deps-url]: https://david-dm.org/ljharb/call-bound
+[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg
+[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/call-bound.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=call-bound
+[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound
+[actions-url]: https://github.com/ljharb/call-bound/actions
diff --git a/node_modules/call-bound/index.d.ts b/node_modules/call-bound/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5562f00ed88c9b9c1ba622ef9c06a95b34d972c1
--- /dev/null
+++ b/node_modules/call-bound/index.d.ts
@@ -0,0 +1,94 @@
+type Intrinsic = typeof globalThis;
+
+type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`;
+
+type IntrinsicPath = IntrinsicName | `${StripPercents}.${string}` | `%${StripPercents}.${string}%`;
+
+type AllowMissing = boolean;
+
+type StripPercents = T extends `%${infer U}%` ? U : T;
+
+type BindMethodPrecise =
+ F extends (this: infer This, ...args: infer Args) => infer R
+ ? (obj: This, ...args: Args) => R
+ : F extends {
+ (this: infer This1, ...args: infer Args1): infer R1;
+ (this: infer This2, ...args: infer Args2): infer R2
+ }
+ ? {
+ (obj: This1, ...args: Args1): R1;
+ (obj: This2, ...args: Args2): R2
+ }
+ : never
+
+// Extract method type from a prototype
+type GetPrototypeMethod =
+ (typeof globalThis)[T] extends { prototype: any }
+ ? M extends keyof (typeof globalThis)[T]['prototype']
+ ? (typeof globalThis)[T]['prototype'][M]
+ : never
+ : never
+
+// Get static property/method
+type GetStaticMember =
+ P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never
+
+// Type that maps string path to actual bound function or value with better precision
+type BoundIntrinsic =
+ S extends `${infer Obj}.prototype.${infer Method}`
+ ? Obj extends keyof typeof globalThis
+ ? BindMethodPrecise>
+ : unknown
+ : S extends `${infer Obj}.${infer Prop}`
+ ? Obj extends keyof typeof globalThis
+ ? GetStaticMember
+ : unknown
+ : unknown
+
+declare function arraySlice(array: readonly T[], start?: number, end?: number): T[];
+declare function arraySlice(array: ArrayLike, start?: number, end?: number): T[];
+declare function arraySlice(array: IArguments, start?: number, end?: number): T[];
+
+// Special cases for methods that need explicit typing
+interface SpecialCases {
+ '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean;
+ '%String.prototype.replace%': {
+ (str: string, searchValue: string | RegExp, replaceValue: string): string;
+ (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string
+ };
+ '%Object.prototype.toString%': (obj: {}) => string;
+ '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean;
+ '%Array.prototype.slice%': typeof arraySlice;
+ '%Array.prototype.map%': (array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[];
+ '%Array.prototype.filter%': (array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[];
+ '%Array.prototype.indexOf%': (array: readonly T[], searchElement: T, fromIndex?: number) => number;
+ '%Function.prototype.apply%': (fn: (...args: A) => R, thisArg: any, args: A) => R;
+ '%Function.prototype.call%': (fn: (...args: A) => R, thisArg: any, ...args: A) => R;
+ '%Function.prototype.bind%': (fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R;
+ '%Promise.prototype.then%': {
+ (promise: Promise, onfulfilled: (value: T) => R | PromiseLike): Promise;
+ (promise: Promise, onfulfilled: ((value: T) => R | PromiseLike) | undefined | null, onrejected: (reason: any) => R | PromiseLike): Promise;
+ };
+ '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean;
+ '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null;
+ '%Error.prototype.toString%': (error: Error) => string;
+ '%TypeError.prototype.toString%': (error: TypeError) => string;
+ '%String.prototype.split%': (
+ obj: unknown,
+ splitter: string | RegExp | {
+ [Symbol.split](string: string, limit?: number): string[];
+ },
+ limit?: number | undefined
+ ) => string[];
+}
+
+/**
+ * Returns a bound function for a prototype method, or a value for a static property.
+ *
+ * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice')
+ * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false)
+ */
+declare function callBound, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents}%`];
+declare function callBound, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic;
+
+export = callBound;
diff --git a/node_modules/call-bound/index.js b/node_modules/call-bound/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e9ade749d90b7eb0eebdb0626c0f22355c833389
--- /dev/null
+++ b/node_modules/call-bound/index.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var GetIntrinsic = require('get-intrinsic');
+
+var callBindBasic = require('call-bind-apply-helpers');
+
+/** @type {(thisArg: string, searchString: string, position?: number) => number} */
+var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
+
+/** @type {import('.')} */
+module.exports = function callBoundIntrinsic(name, allowMissing) {
+ /* eslint no-extra-parens: 0 */
+
+ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
+ return callBindBasic(/** @type {const} */ ([intrinsic]));
+ }
+ return intrinsic;
+};
diff --git a/node_modules/call-bound/package.json b/node_modules/call-bound/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..d542db430ed3b58551bbfa688d47c591e9150cb7
--- /dev/null
+++ b/node_modules/call-bound/package.json
@@ -0,0 +1,99 @@
+{
+ "name": "call-bound",
+ "version": "1.0.4",
+ "description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=auto",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "prelint": "evalmd README.md",
+ "lint": "eslint --ext=.js,.mjs .",
+ "postlint": "tsc -p . && attw -P",
+ "pretest": "npm run lint",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@'>=10.2' audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ljharb/call-bound.git"
+ },
+ "keywords": [
+ "javascript",
+ "ecmascript",
+ "es",
+ "js",
+ "callbind",
+ "callbound",
+ "call",
+ "bind",
+ "bound",
+ "call-bind",
+ "call-bound",
+ "function",
+ "es-abstract"
+ ],
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/ljharb/call-bound/issues"
+ },
+ "homepage": "https://github.com/ljharb/call-bound#readme",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.17.4",
+ "@ljharb/eslint-config": "^21.1.1",
+ "@ljharb/tsconfig": "^0.3.0",
+ "@types/call-bind": "^1.0.5",
+ "@types/get-intrinsic": "^1.2.3",
+ "@types/tape": "^5.8.1",
+ "auto-changelog": "^2.5.0",
+ "encoding": "^0.1.13",
+ "es-value-fixtures": "^1.7.1",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "for-each": "^0.3.5",
+ "gopd": "^1.2.0",
+ "has-strict-mode": "^1.1.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "object-inspect": "^1.13.4",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.9.0",
+ "typescript": "next"
+ },
+ "testling": {
+ "files": "test/index.js"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+}
diff --git a/node_modules/call-bound/test/index.js b/node_modules/call-bound/test/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a2fc9f0f2286539446cb61339c6c8d837275b1c2
--- /dev/null
+++ b/node_modules/call-bound/test/index.js
@@ -0,0 +1,61 @@
+'use strict';
+
+var test = require('tape');
+
+var callBound = require('../');
+
+/** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */
+
+test('callBound', function (t) {
+ // static primitive
+ t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
+ t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
+
+ // static non-function object
+ t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
+ t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
+ t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
+ t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
+
+ // static function
+ t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
+ t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
+
+ // prototype primitive
+ t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
+ t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
+
+ var x = callBound('Object.prototype.toString');
+ var y = callBound('%Object.prototype.toString%');
+
+ // prototype function
+ t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself');
+ t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
+ t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
+ t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
+
+ t['throws'](
+ // @ts-expect-error
+ function () { callBound('does not exist'); },
+ SyntaxError,
+ 'nonexistent intrinsic throws'
+ );
+ t['throws'](
+ // @ts-expect-error
+ function () { callBound('does not exist', true); },
+ SyntaxError,
+ 'allowMissing arg still throws for unknown intrinsic'
+ );
+
+ t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
+ st['throws'](
+ function () { callBound('WeakRef'); },
+ TypeError,
+ 'real but absent intrinsic throws'
+ );
+ st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/call-bound/tsconfig.json b/node_modules/call-bound/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..8976d98b8e07a7672dabcca3d68e6852d8462d5e
--- /dev/null
+++ b/node_modules/call-bound/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "@ljharb/tsconfig",
+ "compilerOptions": {
+ "target": "ESNext",
+ "lib": ["es2024"],
+ },
+ "exclude": [
+ "coverage",
+ ],
+}
diff --git a/node_modules/color-convert/CHANGELOG.md b/node_modules/color-convert/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..0a7bce4fd570ab5f2f7ad89f8456ee0ad26de1f5
--- /dev/null
+++ b/node_modules/color-convert/CHANGELOG.md
@@ -0,0 +1,54 @@
+# 1.0.0 - 2016-01-07
+
+- Removed: unused speed test
+- Added: Automatic routing between previously unsupported conversions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `convert()` class
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: all functions to lookup dictionary
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: `ansi` to `ansi256`
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Fixed: argument grouping for functions requiring only one argument
+([#27](https://github.com/Qix-/color-convert/pull/27))
+
+# 0.6.0 - 2015-07-23
+
+- Added: methods to handle
+[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
+ - rgb2ansi16
+ - rgb2ansi
+ - hsl2ansi16
+ - hsl2ansi
+ - hsv2ansi16
+ - hsv2ansi
+ - hwb2ansi16
+ - hwb2ansi
+ - cmyk2ansi16
+ - cmyk2ansi
+ - keyword2ansi16
+ - keyword2ansi
+ - ansi162rgb
+ - ansi162hsl
+ - ansi162hsv
+ - ansi162hwb
+ - ansi162cmyk
+ - ansi162keyword
+ - ansi2rgb
+ - ansi2hsl
+ - ansi2hsv
+ - ansi2hwb
+ - ansi2cmyk
+ - ansi2keyword
+([#18](https://github.com/harthur/color-convert/pull/18))
+
+# 0.5.3 - 2015-06-02
+
+- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
+([#15](https://github.com/harthur/color-convert/issues/15))
+
+---
+
+Check out commit logs for older releases
diff --git a/node_modules/color-convert/LICENSE b/node_modules/color-convert/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..5b4c386f9269b30a21f15145cd966c50017c2a3f
--- /dev/null
+++ b/node_modules/color-convert/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2011-2016 Heather Arthur
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/color-convert/README.md b/node_modules/color-convert/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..d4b08fc369948daacc146dcde0f63c3a79039852
--- /dev/null
+++ b/node_modules/color-convert/README.md
@@ -0,0 +1,68 @@
+# color-convert
+
+[](https://travis-ci.org/Qix-/color-convert)
+
+Color-convert is a color conversion library for JavaScript and node.
+It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
+convert.keyword.rgb('blue'); // [0, 0, 255]
+
+var rgbChannels = convert.rgb.channels; // 3
+var cmykChannels = convert.cmyk.channels; // 4
+var ansiChannels = convert.ansi16.channels; // 1
+```
+
+# Install
+
+```console
+$ npm install color-convert
+```
+
+# API
+
+Simply get the property of the _from_ and _to_ conversion that you're looking for.
+
+All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
+
+All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
+
+```js
+var convert = require('color-convert');
+
+// Hex to LAB
+convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
+convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
+
+// RGB to CMYK
+convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
+convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
+```
+
+### Arrays
+All functions that accept multiple arguments also support passing an array.
+
+Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hex(123, 45, 67); // '7B2D43'
+convert.rgb.hex([123, 45, 67]); // '7B2D43'
+```
+
+## Routing
+
+Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
+
+Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
+
+# Contribute
+
+If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
+
+# License
+Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
diff --git a/node_modules/color-convert/conversions.js b/node_modules/color-convert/conversions.js
new file mode 100644
index 0000000000000000000000000000000000000000..2657f265c9e1022ed06a232f4da4db578d3d3fb0
--- /dev/null
+++ b/node_modules/color-convert/conversions.js
@@ -0,0 +1,839 @@
+/* MIT license */
+/* eslint-disable no-mixed-operators */
+const cssKeywords = require('color-name');
+
+// NOTE: conversions should only return primitive values (i.e. arrays, or
+// values that give correct `typeof` results).
+// do not use box values types (i.e. Number(), String(), etc.)
+
+const reverseKeywords = {};
+for (const key of Object.keys(cssKeywords)) {
+ reverseKeywords[cssKeywords[key]] = key;
+}
+
+const convert = {
+ rgb: {channels: 3, labels: 'rgb'},
+ hsl: {channels: 3, labels: 'hsl'},
+ hsv: {channels: 3, labels: 'hsv'},
+ hwb: {channels: 3, labels: 'hwb'},
+ cmyk: {channels: 4, labels: 'cmyk'},
+ xyz: {channels: 3, labels: 'xyz'},
+ lab: {channels: 3, labels: 'lab'},
+ lch: {channels: 3, labels: 'lch'},
+ hex: {channels: 1, labels: ['hex']},
+ keyword: {channels: 1, labels: ['keyword']},
+ ansi16: {channels: 1, labels: ['ansi16']},
+ ansi256: {channels: 1, labels: ['ansi256']},
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
+ gray: {channels: 1, labels: ['gray']}
+};
+
+module.exports = convert;
+
+// Hide .channels and .labels properties
+for (const model of Object.keys(convert)) {
+ if (!('channels' in convert[model])) {
+ throw new Error('missing channels property: ' + model);
+ }
+
+ if (!('labels' in convert[model])) {
+ throw new Error('missing channel labels property: ' + model);
+ }
+
+ if (convert[model].labels.length !== convert[model].channels) {
+ throw new Error('channel and label counts mismatch: ' + model);
+ }
+
+ const {channels, labels} = convert[model];
+ delete convert[model].channels;
+ delete convert[model].labels;
+ Object.defineProperty(convert[model], 'channels', {value: channels});
+ Object.defineProperty(convert[model], 'labels', {value: labels});
+}
+
+convert.rgb.hsl = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const min = Math.min(r, g, b);
+ const max = Math.max(r, g, b);
+ const delta = max - min;
+ let h;
+ let s;
+
+ if (max === min) {
+ h = 0;
+ } else if (r === max) {
+ h = (g - b) / delta;
+ } else if (g === max) {
+ h = 2 + (b - r) / delta;
+ } else if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+
+ h = Math.min(h * 60, 360);
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ const l = (min + max) / 2;
+
+ if (max === min) {
+ s = 0;
+ } else if (l <= 0.5) {
+ s = delta / (max + min);
+ } else {
+ s = delta / (2 - max - min);
+ }
+
+ return [h, s * 100, l * 100];
+};
+
+convert.rgb.hsv = function (rgb) {
+ let rdif;
+ let gdif;
+ let bdif;
+ let h;
+ let s;
+
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const v = Math.max(r, g, b);
+ const diff = v - Math.min(r, g, b);
+ const diffc = function (c) {
+ return (v - c) / 6 / diff + 1 / 2;
+ };
+
+ if (diff === 0) {
+ h = 0;
+ s = 0;
+ } else {
+ s = diff / v;
+ rdif = diffc(r);
+ gdif = diffc(g);
+ bdif = diffc(b);
+
+ if (r === v) {
+ h = bdif - gdif;
+ } else if (g === v) {
+ h = (1 / 3) + rdif - bdif;
+ } else if (b === v) {
+ h = (2 / 3) + gdif - rdif;
+ }
+
+ if (h < 0) {
+ h += 1;
+ } else if (h > 1) {
+ h -= 1;
+ }
+ }
+
+ return [
+ h * 360,
+ s * 100,
+ v * 100
+ ];
+};
+
+convert.rgb.hwb = function (rgb) {
+ const r = rgb[0];
+ const g = rgb[1];
+ let b = rgb[2];
+ const h = convert.rgb.hsl(rgb)[0];
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
+
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
+
+ return [h, w * 100, b * 100];
+};
+
+convert.rgb.cmyk = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+
+ const k = Math.min(1 - r, 1 - g, 1 - b);
+ const c = (1 - r - k) / (1 - k) || 0;
+ const m = (1 - g - k) / (1 - k) || 0;
+ const y = (1 - b - k) / (1 - k) || 0;
+
+ return [c * 100, m * 100, y * 100, k * 100];
+};
+
+function comparativeDistance(x, y) {
+ /*
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
+ */
+ return (
+ ((x[0] - y[0]) ** 2) +
+ ((x[1] - y[1]) ** 2) +
+ ((x[2] - y[2]) ** 2)
+ );
+}
+
+convert.rgb.keyword = function (rgb) {
+ const reversed = reverseKeywords[rgb];
+ if (reversed) {
+ return reversed;
+ }
+
+ let currentClosestDistance = Infinity;
+ let currentClosestKeyword;
+
+ for (const keyword of Object.keys(cssKeywords)) {
+ const value = cssKeywords[keyword];
+
+ // Compute comparative distance
+ const distance = comparativeDistance(rgb, value);
+
+ // Check if its less, if so set as closest
+ if (distance < currentClosestDistance) {
+ currentClosestDistance = distance;
+ currentClosestKeyword = keyword;
+ }
+ }
+
+ return currentClosestKeyword;
+};
+
+convert.keyword.rgb = function (keyword) {
+ return cssKeywords[keyword];
+};
+
+convert.rgb.xyz = function (rgb) {
+ let r = rgb[0] / 255;
+ let g = rgb[1] / 255;
+ let b = rgb[2] / 255;
+
+ // Assume sRGB
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
+
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
+
+ return [x * 100, y * 100, z * 100];
+};
+
+convert.rgb.lab = function (rgb) {
+ const xyz = convert.rgb.xyz(rgb);
+ let x = xyz[0];
+ let y = xyz[1];
+ let z = xyz[2];
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
+
+ const l = (116 * y) - 16;
+ const a = 500 * (x - y);
+ const b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.hsl.rgb = function (hsl) {
+ const h = hsl[0] / 360;
+ const s = hsl[1] / 100;
+ const l = hsl[2] / 100;
+ let t2;
+ let t3;
+ let val;
+
+ if (s === 0) {
+ val = l * 255;
+ return [val, val, val];
+ }
+
+ if (l < 0.5) {
+ t2 = l * (1 + s);
+ } else {
+ t2 = l + s - l * s;
+ }
+
+ const t1 = 2 * l - t2;
+
+ const rgb = [0, 0, 0];
+ for (let i = 0; i < 3; i++) {
+ t3 = h + 1 / 3 * -(i - 1);
+ if (t3 < 0) {
+ t3++;
+ }
+
+ if (t3 > 1) {
+ t3--;
+ }
+
+ if (6 * t3 < 1) {
+ val = t1 + (t2 - t1) * 6 * t3;
+ } else if (2 * t3 < 1) {
+ val = t2;
+ } else if (3 * t3 < 2) {
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+ } else {
+ val = t1;
+ }
+
+ rgb[i] = val * 255;
+ }
+
+ return rgb;
+};
+
+convert.hsl.hsv = function (hsl) {
+ const h = hsl[0];
+ let s = hsl[1] / 100;
+ let l = hsl[2] / 100;
+ let smin = s;
+ const lmin = Math.max(l, 0.01);
+
+ l *= 2;
+ s *= (l <= 1) ? l : 2 - l;
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
+ const v = (l + s) / 2;
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
+
+ return [h, sv * 100, v * 100];
+};
+
+convert.hsv.rgb = function (hsv) {
+ const h = hsv[0] / 60;
+ const s = hsv[1] / 100;
+ let v = hsv[2] / 100;
+ const hi = Math.floor(h) % 6;
+
+ const f = h - Math.floor(h);
+ const p = 255 * v * (1 - s);
+ const q = 255 * v * (1 - (s * f));
+ const t = 255 * v * (1 - (s * (1 - f)));
+ v *= 255;
+
+ switch (hi) {
+ case 0:
+ return [v, t, p];
+ case 1:
+ return [q, v, p];
+ case 2:
+ return [p, v, t];
+ case 3:
+ return [p, q, v];
+ case 4:
+ return [t, p, v];
+ case 5:
+ return [v, p, q];
+ }
+};
+
+convert.hsv.hsl = function (hsv) {
+ const h = hsv[0];
+ const s = hsv[1] / 100;
+ const v = hsv[2] / 100;
+ const vmin = Math.max(v, 0.01);
+ let sl;
+ let l;
+
+ l = (2 - s) * v;
+ const lmin = (2 - s) * vmin;
+ sl = s * vmin;
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
+ sl = sl || 0;
+ l /= 2;
+
+ return [h, sl * 100, l * 100];
+};
+
+// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
+convert.hwb.rgb = function (hwb) {
+ const h = hwb[0] / 360;
+ let wh = hwb[1] / 100;
+ let bl = hwb[2] / 100;
+ const ratio = wh + bl;
+ let f;
+
+ // Wh + bl cant be > 1
+ if (ratio > 1) {
+ wh /= ratio;
+ bl /= ratio;
+ }
+
+ const i = Math.floor(6 * h);
+ const v = 1 - bl;
+ f = 6 * h - i;
+
+ if ((i & 0x01) !== 0) {
+ f = 1 - f;
+ }
+
+ const n = wh + f * (v - wh); // Linear interpolation
+
+ let r;
+ let g;
+ let b;
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
+ switch (i) {
+ default:
+ case 6:
+ case 0: r = v; g = n; b = wh; break;
+ case 1: r = n; g = v; b = wh; break;
+ case 2: r = wh; g = v; b = n; break;
+ case 3: r = wh; g = n; b = v; break;
+ case 4: r = n; g = wh; b = v; break;
+ case 5: r = v; g = wh; b = n; break;
+ }
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.cmyk.rgb = function (cmyk) {
+ const c = cmyk[0] / 100;
+ const m = cmyk[1] / 100;
+ const y = cmyk[2] / 100;
+ const k = cmyk[3] / 100;
+
+ const r = 1 - Math.min(1, c * (1 - k) + k);
+ const g = 1 - Math.min(1, m * (1 - k) + k);
+ const b = 1 - Math.min(1, y * (1 - k) + k);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.rgb = function (xyz) {
+ const x = xyz[0] / 100;
+ const y = xyz[1] / 100;
+ const z = xyz[2] / 100;
+ let r;
+ let g;
+ let b;
+
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
+
+ // Assume sRGB
+ r = r > 0.0031308
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
+ : r * 12.92;
+
+ g = g > 0.0031308
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
+ : g * 12.92;
+
+ b = b > 0.0031308
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
+ : b * 12.92;
+
+ r = Math.min(Math.max(0, r), 1);
+ g = Math.min(Math.max(0, g), 1);
+ b = Math.min(Math.max(0, b), 1);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.lab = function (xyz) {
+ let x = xyz[0];
+ let y = xyz[1];
+ let z = xyz[2];
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
+
+ const l = (116 * y) - 16;
+ const a = 500 * (x - y);
+ const b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.lab.xyz = function (lab) {
+ const l = lab[0];
+ const a = lab[1];
+ const b = lab[2];
+ let x;
+ let y;
+ let z;
+
+ y = (l + 16) / 116;
+ x = a / 500 + y;
+ z = y - b / 200;
+
+ const y2 = y ** 3;
+ const x2 = x ** 3;
+ const z2 = z ** 3;
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
+
+ x *= 95.047;
+ y *= 100;
+ z *= 108.883;
+
+ return [x, y, z];
+};
+
+convert.lab.lch = function (lab) {
+ const l = lab[0];
+ const a = lab[1];
+ const b = lab[2];
+ let h;
+
+ const hr = Math.atan2(b, a);
+ h = hr * 360 / 2 / Math.PI;
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ const c = Math.sqrt(a * a + b * b);
+
+ return [l, c, h];
+};
+
+convert.lch.lab = function (lch) {
+ const l = lch[0];
+ const c = lch[1];
+ const h = lch[2];
+
+ const hr = h / 360 * 2 * Math.PI;
+ const a = c * Math.cos(hr);
+ const b = c * Math.sin(hr);
+
+ return [l, a, b];
+};
+
+convert.rgb.ansi16 = function (args, saturation = null) {
+ const [r, g, b] = args;
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
+
+ value = Math.round(value / 50);
+
+ if (value === 0) {
+ return 30;
+ }
+
+ let ansi = 30
+ + ((Math.round(b / 255) << 2)
+ | (Math.round(g / 255) << 1)
+ | Math.round(r / 255));
+
+ if (value === 2) {
+ ansi += 60;
+ }
+
+ return ansi;
+};
+
+convert.hsv.ansi16 = function (args) {
+ // Optimization here; we already know the value and don't need to get
+ // it converted for us.
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
+};
+
+convert.rgb.ansi256 = function (args) {
+ const r = args[0];
+ const g = args[1];
+ const b = args[2];
+
+ // We use the extended greyscale palette here, with the exception of
+ // black and white. normal palette only has 4 greyscale shades.
+ if (r === g && g === b) {
+ if (r < 8) {
+ return 16;
+ }
+
+ if (r > 248) {
+ return 231;
+ }
+
+ return Math.round(((r - 8) / 247) * 24) + 232;
+ }
+
+ const ansi = 16
+ + (36 * Math.round(r / 255 * 5))
+ + (6 * Math.round(g / 255 * 5))
+ + Math.round(b / 255 * 5);
+
+ return ansi;
+};
+
+convert.ansi16.rgb = function (args) {
+ let color = args % 10;
+
+ // Handle greyscale
+ if (color === 0 || color === 7) {
+ if (args > 50) {
+ color += 3.5;
+ }
+
+ color = color / 10.5 * 255;
+
+ return [color, color, color];
+ }
+
+ const mult = (~~(args > 50) + 1) * 0.5;
+ const r = ((color & 1) * mult) * 255;
+ const g = (((color >> 1) & 1) * mult) * 255;
+ const b = (((color >> 2) & 1) * mult) * 255;
+
+ return [r, g, b];
+};
+
+convert.ansi256.rgb = function (args) {
+ // Handle greyscale
+ if (args >= 232) {
+ const c = (args - 232) * 10 + 8;
+ return [c, c, c];
+ }
+
+ args -= 16;
+
+ let rem;
+ const r = Math.floor(args / 36) / 5 * 255;
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
+ const b = (rem % 6) / 5 * 255;
+
+ return [r, g, b];
+};
+
+convert.rgb.hex = function (args) {
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
+ + ((Math.round(args[1]) & 0xFF) << 8)
+ + (Math.round(args[2]) & 0xFF);
+
+ const string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.hex.rgb = function (args) {
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+ if (!match) {
+ return [0, 0, 0];
+ }
+
+ let colorString = match[0];
+
+ if (match[0].length === 3) {
+ colorString = colorString.split('').map(char => {
+ return char + char;
+ }).join('');
+ }
+
+ const integer = parseInt(colorString, 16);
+ const r = (integer >> 16) & 0xFF;
+ const g = (integer >> 8) & 0xFF;
+ const b = integer & 0xFF;
+
+ return [r, g, b];
+};
+
+convert.rgb.hcg = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const max = Math.max(Math.max(r, g), b);
+ const min = Math.min(Math.min(r, g), b);
+ const chroma = (max - min);
+ let grayscale;
+ let hue;
+
+ if (chroma < 1) {
+ grayscale = min / (1 - chroma);
+ } else {
+ grayscale = 0;
+ }
+
+ if (chroma <= 0) {
+ hue = 0;
+ } else
+ if (max === r) {
+ hue = ((g - b) / chroma) % 6;
+ } else
+ if (max === g) {
+ hue = 2 + (b - r) / chroma;
+ } else {
+ hue = 4 + (r - g) / chroma;
+ }
+
+ hue /= 6;
+ hue %= 1;
+
+ return [hue * 360, chroma * 100, grayscale * 100];
+};
+
+convert.hsl.hcg = function (hsl) {
+ const s = hsl[1] / 100;
+ const l = hsl[2] / 100;
+
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
+
+ let f = 0;
+ if (c < 1.0) {
+ f = (l - 0.5 * c) / (1.0 - c);
+ }
+
+ return [hsl[0], c * 100, f * 100];
+};
+
+convert.hsv.hcg = function (hsv) {
+ const s = hsv[1] / 100;
+ const v = hsv[2] / 100;
+
+ const c = s * v;
+ let f = 0;
+
+ if (c < 1.0) {
+ f = (v - c) / (1 - c);
+ }
+
+ return [hsv[0], c * 100, f * 100];
+};
+
+convert.hcg.rgb = function (hcg) {
+ const h = hcg[0] / 360;
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ if (c === 0.0) {
+ return [g * 255, g * 255, g * 255];
+ }
+
+ const pure = [0, 0, 0];
+ const hi = (h % 1) * 6;
+ const v = hi % 1;
+ const w = 1 - v;
+ let mg = 0;
+
+ /* eslint-disable max-statements-per-line */
+ switch (Math.floor(hi)) {
+ case 0:
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
+ case 1:
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
+ case 2:
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
+ case 3:
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
+ case 4:
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
+ default:
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
+ }
+ /* eslint-enable max-statements-per-line */
+
+ mg = (1.0 - c) * g;
+
+ return [
+ (c * pure[0] + mg) * 255,
+ (c * pure[1] + mg) * 255,
+ (c * pure[2] + mg) * 255
+ ];
+};
+
+convert.hcg.hsv = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ const v = c + g * (1.0 - c);
+ let f = 0;
+
+ if (v > 0.0) {
+ f = c / v;
+ }
+
+ return [hcg[0], f * 100, v * 100];
+};
+
+convert.hcg.hsl = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ const l = g * (1.0 - c) + 0.5 * c;
+ let s = 0;
+
+ if (l > 0.0 && l < 0.5) {
+ s = c / (2 * l);
+ } else
+ if (l >= 0.5 && l < 1.0) {
+ s = c / (2 * (1 - l));
+ }
+
+ return [hcg[0], s * 100, l * 100];
+};
+
+convert.hcg.hwb = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+ const v = c + g * (1.0 - c);
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
+};
+
+convert.hwb.hcg = function (hwb) {
+ const w = hwb[1] / 100;
+ const b = hwb[2] / 100;
+ const v = 1 - b;
+ const c = v - w;
+ let g = 0;
+
+ if (c < 1) {
+ g = (v - c) / (1 - c);
+ }
+
+ return [hwb[0], c * 100, g * 100];
+};
+
+convert.apple.rgb = function (apple) {
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
+};
+
+convert.rgb.apple = function (rgb) {
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
+};
+
+convert.gray.rgb = function (args) {
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
+};
+
+convert.gray.hsl = function (args) {
+ return [0, 0, args[0]];
+};
+
+convert.gray.hsv = convert.gray.hsl;
+
+convert.gray.hwb = function (gray) {
+ return [0, 100, gray[0]];
+};
+
+convert.gray.cmyk = function (gray) {
+ return [0, 0, 0, gray[0]];
+};
+
+convert.gray.lab = function (gray) {
+ return [gray[0], 0, 0];
+};
+
+convert.gray.hex = function (gray) {
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
+ const integer = (val << 16) + (val << 8) + val;
+
+ const string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.rgb.gray = function (rgb) {
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
+ return [val / 255 * 100];
+};
diff --git a/node_modules/color-convert/index.js b/node_modules/color-convert/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..b648e5737be6168bff5137cb1a5a897e55ce193d
--- /dev/null
+++ b/node_modules/color-convert/index.js
@@ -0,0 +1,81 @@
+const conversions = require('./conversions');
+const route = require('./route');
+
+const convert = {};
+
+const models = Object.keys(conversions);
+
+function wrapRaw(fn) {
+ const wrappedFn = function (...args) {
+ const arg0 = args[0];
+ if (arg0 === undefined || arg0 === null) {
+ return arg0;
+ }
+
+ if (arg0.length > 1) {
+ args = arg0;
+ }
+
+ return fn(args);
+ };
+
+ // Preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+function wrapRounded(fn) {
+ const wrappedFn = function (...args) {
+ const arg0 = args[0];
+
+ if (arg0 === undefined || arg0 === null) {
+ return arg0;
+ }
+
+ if (arg0.length > 1) {
+ args = arg0;
+ }
+
+ const result = fn(args);
+
+ // We're assuming the result is an array here.
+ // see notice in conversions.js; don't use box types
+ // in conversion functions.
+ if (typeof result === 'object') {
+ for (let len = result.length, i = 0; i < len; i++) {
+ result[i] = Math.round(result[i]);
+ }
+ }
+
+ return result;
+ };
+
+ // Preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+models.forEach(fromModel => {
+ convert[fromModel] = {};
+
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
+
+ const routes = route(fromModel);
+ const routeModels = Object.keys(routes);
+
+ routeModels.forEach(toModel => {
+ const fn = routes[toModel];
+
+ convert[fromModel][toModel] = wrapRounded(fn);
+ convert[fromModel][toModel].raw = wrapRaw(fn);
+ });
+});
+
+module.exports = convert;
diff --git a/node_modules/color-convert/package.json b/node_modules/color-convert/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6e48000c7c98fd844af784fb2fdf7060f13ed0b1
--- /dev/null
+++ b/node_modules/color-convert/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "color-convert",
+ "description": "Plain color conversion functions",
+ "version": "2.0.1",
+ "author": "Heather Arthur ",
+ "license": "MIT",
+ "repository": "Qix-/color-convert",
+ "scripts": {
+ "pretest": "xo",
+ "test": "node test/basic.js"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ },
+ "keywords": [
+ "color",
+ "colour",
+ "convert",
+ "converter",
+ "conversion",
+ "rgb",
+ "hsl",
+ "hsv",
+ "hwb",
+ "cmyk",
+ "ansi",
+ "ansi16"
+ ],
+ "files": [
+ "index.js",
+ "conversions.js",
+ "route.js"
+ ],
+ "xo": {
+ "rules": {
+ "default-case": 0,
+ "no-inline-comments": 0,
+ "operator-linebreak": 0
+ }
+ },
+ "devDependencies": {
+ "chalk": "^2.4.2",
+ "xo": "^0.24.0"
+ },
+ "dependencies": {
+ "color-name": "~1.1.4"
+ }
+}
diff --git a/node_modules/color-convert/route.js b/node_modules/color-convert/route.js
new file mode 100644
index 0000000000000000000000000000000000000000..1a08521b5a001793a0a2c705d442a29949b1f051
--- /dev/null
+++ b/node_modules/color-convert/route.js
@@ -0,0 +1,97 @@
+const conversions = require('./conversions');
+
+/*
+ This function routes a model to all other models.
+
+ all functions that are routed have a property `.conversion` attached
+ to the returned synthetic function. This property is an array
+ of strings, each with the steps in between the 'from' and 'to'
+ color models (inclusive).
+
+ conversions that are not possible simply are not included.
+*/
+
+function buildGraph() {
+ const graph = {};
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
+ const models = Object.keys(conversions);
+
+ for (let len = models.length, i = 0; i < len; i++) {
+ graph[models[i]] = {
+ // http://jsperf.com/1-vs-infinity
+ // micro-opt, but this is simple.
+ distance: -1,
+ parent: null
+ };
+ }
+
+ return graph;
+}
+
+// https://en.wikipedia.org/wiki/Breadth-first_search
+function deriveBFS(fromModel) {
+ const graph = buildGraph();
+ const queue = [fromModel]; // Unshift -> queue -> pop
+
+ graph[fromModel].distance = 0;
+
+ while (queue.length) {
+ const current = queue.pop();
+ const adjacents = Object.keys(conversions[current]);
+
+ for (let len = adjacents.length, i = 0; i < len; i++) {
+ const adjacent = adjacents[i];
+ const node = graph[adjacent];
+
+ if (node.distance === -1) {
+ node.distance = graph[current].distance + 1;
+ node.parent = current;
+ queue.unshift(adjacent);
+ }
+ }
+ }
+
+ return graph;
+}
+
+function link(from, to) {
+ return function (args) {
+ return to(from(args));
+ };
+}
+
+function wrapConversion(toModel, graph) {
+ const path = [graph[toModel].parent, toModel];
+ let fn = conversions[graph[toModel].parent][toModel];
+
+ let cur = graph[toModel].parent;
+ while (graph[cur].parent) {
+ path.unshift(graph[cur].parent);
+ fn = link(conversions[graph[cur].parent][cur], fn);
+ cur = graph[cur].parent;
+ }
+
+ fn.conversion = path;
+ return fn;
+}
+
+module.exports = function (fromModel) {
+ const graph = deriveBFS(fromModel);
+ const conversion = {};
+
+ const models = Object.keys(graph);
+ for (let len = models.length, i = 0; i < len; i++) {
+ const toModel = models[i];
+ const node = graph[toModel];
+
+ if (node.parent === null) {
+ // No possible conversion, or this node is the source model.
+ continue;
+ }
+
+ conversion[toModel] = wrapConversion(toModel, graph);
+ }
+
+ return conversion;
+};
+
diff --git a/node_modules/color-name/LICENSE b/node_modules/color-name/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..4d9802a89e299942d0ddef0240077019c5676ea7
--- /dev/null
+++ b/node_modules/color-name/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2015 Dmitry Ivanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/color-name/README.md b/node_modules/color-name/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..3611a6b523fe851a404b82b38d38ffb22921d2f4
--- /dev/null
+++ b/node_modules/color-name/README.md
@@ -0,0 +1,11 @@
+A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
+
+[](https://nodei.co/npm/color-name/)
+
+
+```js
+var colors = require('color-name');
+colors.red //[255,0,0]
+```
+
+
diff --git a/node_modules/color-name/index.js b/node_modules/color-name/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e42aa68a542d9e176b5fd050c35b1af11659b2a3
--- /dev/null
+++ b/node_modules/color-name/index.js
@@ -0,0 +1,152 @@
+'use strict'
+
+module.exports = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aqua": [0, 255, 255],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [220, 20, 60],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkgrey": [169, 169, 169],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkslategrey": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dimgrey": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "fuchsia": [255, 0, 255],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "grey": [128, 128, 128],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgray": [211, 211, 211],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightslategrey": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "rebeccapurple": [102, 51, 153],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "slategrey": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
diff --git a/node_modules/color-name/package.json b/node_modules/color-name/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..7acc90285c96fbbe8b6f12ef32cd2384a72e6f62
--- /dev/null
+++ b/node_modules/color-name/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "color-name",
+ "version": "1.1.4",
+ "description": "A list of color names and its values",
+ "main": "index.js",
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:colorjs/color-name.git"
+ },
+ "keywords": [
+ "color-name",
+ "color",
+ "color-keyword",
+ "keyword"
+ ],
+ "author": "DY ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/colorjs/color-name/issues"
+ },
+ "homepage": "https://github.com/colorjs/color-name"
+}
diff --git a/node_modules/compress-commons/LICENSE b/node_modules/compress-commons/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..56420a6a06bd156003ce69970b50c67176f2afe5
--- /dev/null
+++ b/node_modules/compress-commons/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2014 Chris Talkington, contributors.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/compress-commons/README.md b/node_modules/compress-commons/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..6a74ce1480b347c94ccb40782a07f43740102186
--- /dev/null
+++ b/node_modules/compress-commons/README.md
@@ -0,0 +1,25 @@
+# Compress Commons
+
+Compress Commons is a library that defines a common interface for working with archive formats within node.
+
+[](https://nodei.co/npm/compress-commons/)
+
+## Install
+
+```bash
+npm install compress-commons --save
+```
+
+You can also use `npm install https://github.com/archiverjs/node-compress-commons/archive/master.tar.gz` to test upcoming versions.
+
+## Things of Interest
+
+- [Changelog](https://github.com/archiverjs/node-compress-commons/releases)
+- [Contributing](https://github.com/archiverjs/node-compress-commons/blob/master/CONTRIBUTING.md)
+- [MIT License](https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT)
+
+## Credits
+
+Concept inspired by [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/)™.
+
+Some logic derived from [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/)™ and [OpenJDK 7](http://openjdk.java.net/).
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/archive-entry.js b/node_modules/compress-commons/lib/archivers/archive-entry.js
new file mode 100644
index 0000000000000000000000000000000000000000..86bc59886a2392c35c759cad28325c61bfcd6b8e
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/archive-entry.js
@@ -0,0 +1,16 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var ArchiveEntry = module.exports = function() {};
+
+ArchiveEntry.prototype.getName = function() {};
+
+ArchiveEntry.prototype.getSize = function() {};
+
+ArchiveEntry.prototype.getLastModifiedDate = function() {};
+
+ArchiveEntry.prototype.isDirectory = function() {};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/archive-output-stream.js b/node_modules/compress-commons/lib/archivers/archive-output-stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..d349b5e6c0a35ab3828078b0e59449b1642efe52
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/archive-output-stream.js
@@ -0,0 +1,118 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var inherits = require('util').inherits;
+var isStream = require('is-stream');
+var Transform = require('readable-stream').Transform;
+
+var ArchiveEntry = require('./archive-entry');
+var util = require('../util');
+
+var ArchiveOutputStream = module.exports = function(options) {
+ if (!(this instanceof ArchiveOutputStream)) {
+ return new ArchiveOutputStream(options);
+ }
+
+ Transform.call(this, options);
+
+ this.offset = 0;
+ this._archive = {
+ finish: false,
+ finished: false,
+ processing: false
+ };
+};
+
+inherits(ArchiveOutputStream, Transform);
+
+ArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) {
+ // scaffold only
+};
+
+ArchiveOutputStream.prototype._appendStream = function(zae, source, callback) {
+ // scaffold only
+};
+
+ArchiveOutputStream.prototype._emitErrorCallback = function(err) {
+ if (err) {
+ this.emit('error', err);
+ }
+};
+
+ArchiveOutputStream.prototype._finish = function(ae) {
+ // scaffold only
+};
+
+ArchiveOutputStream.prototype._normalizeEntry = function(ae) {
+ // scaffold only
+};
+
+ArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) {
+ callback(null, chunk);
+};
+
+ArchiveOutputStream.prototype.entry = function(ae, source, callback) {
+ source = source || null;
+
+ if (typeof callback !== 'function') {
+ callback = this._emitErrorCallback.bind(this);
+ }
+
+ if (!(ae instanceof ArchiveEntry)) {
+ callback(new Error('not a valid instance of ArchiveEntry'));
+ return;
+ }
+
+ if (this._archive.finish || this._archive.finished) {
+ callback(new Error('unacceptable entry after finish'));
+ return;
+ }
+
+ if (this._archive.processing) {
+ callback(new Error('already processing an entry'));
+ return;
+ }
+
+ this._archive.processing = true;
+ this._normalizeEntry(ae);
+ this._entry = ae;
+
+ source = util.normalizeInputSource(source);
+
+ if (Buffer.isBuffer(source)) {
+ this._appendBuffer(ae, source, callback);
+ } else if (isStream(source)) {
+ this._appendStream(ae, source, callback);
+ } else {
+ this._archive.processing = false;
+ callback(new Error('input source must be valid Stream or Buffer instance'));
+ return;
+ }
+
+ return this;
+};
+
+ArchiveOutputStream.prototype.finish = function() {
+ if (this._archive.processing) {
+ this._archive.finish = true;
+ return;
+ }
+
+ this._finish();
+};
+
+ArchiveOutputStream.prototype.getBytesWritten = function() {
+ return this.offset;
+};
+
+ArchiveOutputStream.prototype.write = function(chunk, cb) {
+ if (chunk) {
+ this.offset += chunk.length;
+ }
+
+ return Transform.prototype.write.call(this, chunk, cb);
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/zip/constants.js b/node_modules/compress-commons/lib/archivers/zip/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..c30b3250b6ce7519ddd594b6a4bddbd395f04fe1
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/constants.js
@@ -0,0 +1,71 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+module.exports = {
+ WORD: 4,
+ DWORD: 8,
+ EMPTY: Buffer.alloc(0),
+
+ SHORT: 2,
+ SHORT_MASK: 0xffff,
+ SHORT_SHIFT: 16,
+ SHORT_ZERO: Buffer.from(Array(2)),
+ LONG: 4,
+ LONG_ZERO: Buffer.from(Array(4)),
+
+ MIN_VERSION_INITIAL: 10,
+ MIN_VERSION_DATA_DESCRIPTOR: 20,
+ MIN_VERSION_ZIP64: 45,
+ VERSION_MADEBY: 45,
+
+ METHOD_STORED: 0,
+ METHOD_DEFLATED: 8,
+
+ PLATFORM_UNIX: 3,
+ PLATFORM_FAT: 0,
+
+ SIG_LFH: 0x04034b50,
+ SIG_DD: 0x08074b50,
+ SIG_CFH: 0x02014b50,
+ SIG_EOCD: 0x06054b50,
+ SIG_ZIP64_EOCD: 0x06064B50,
+ SIG_ZIP64_EOCD_LOC: 0x07064B50,
+
+ ZIP64_MAGIC_SHORT: 0xffff,
+ ZIP64_MAGIC: 0xffffffff,
+ ZIP64_EXTRA_ID: 0x0001,
+
+ ZLIB_NO_COMPRESSION: 0,
+ ZLIB_BEST_SPEED: 1,
+ ZLIB_BEST_COMPRESSION: 9,
+ ZLIB_DEFAULT_COMPRESSION: -1,
+
+ MODE_MASK: 0xFFF,
+ DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
+ DEFAULT_DIR_MODE: 16877, // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
+
+ EXT_FILE_ATTR_DIR: 1106051088, // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D)
+ EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0
+
+ // Unix file types
+ S_IFMT: 61440, // 0170000 type of file mask
+ S_IFIFO: 4096, // 010000 named pipe (fifo)
+ S_IFCHR: 8192, // 020000 character special
+ S_IFDIR: 16384, // 040000 directory
+ S_IFBLK: 24576, // 060000 block special
+ S_IFREG: 32768, // 0100000 regular
+ S_IFLNK: 40960, // 0120000 symbolic link
+ S_IFSOCK: 49152, // 0140000 socket
+
+ // DOS file type flags
+ S_DOS_A: 32, // 040 Archive
+ S_DOS_D: 16, // 020 Directory
+ S_DOS_V: 8, // 010 Volume
+ S_DOS_S: 4, // 04 System
+ S_DOS_H: 2, // 02 Hidden
+ S_DOS_R: 1 // 01 Read Only
+};
diff --git a/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js b/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js
new file mode 100644
index 0000000000000000000000000000000000000000..62703996a1bae9c36ff137795a8100bde4aadc9f
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js
@@ -0,0 +1,101 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var zipUtil = require('./util');
+
+var DATA_DESCRIPTOR_FLAG = 1 << 3;
+var ENCRYPTION_FLAG = 1 << 0;
+var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2;
+var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1;
+var STRONG_ENCRYPTION_FLAG = 1 << 6;
+var UFT8_NAMES_FLAG = 1 << 11;
+
+var GeneralPurposeBit = module.exports = function() {
+ if (!(this instanceof GeneralPurposeBit)) {
+ return new GeneralPurposeBit();
+ }
+
+ this.descriptor = false;
+ this.encryption = false;
+ this.utf8 = false;
+ this.numberOfShannonFanoTrees = 0;
+ this.strongEncryption = false;
+ this.slidingDictionarySize = 0;
+
+ return this;
+};
+
+GeneralPurposeBit.prototype.encode = function() {
+ return zipUtil.getShortBytes(
+ (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) |
+ (this.utf8 ? UFT8_NAMES_FLAG : 0) |
+ (this.encryption ? ENCRYPTION_FLAG : 0) |
+ (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0)
+ );
+};
+
+GeneralPurposeBit.prototype.parse = function(buf, offset) {
+ var flag = zipUtil.getShortBytesValue(buf, offset);
+ var gbp = new GeneralPurposeBit();
+
+ gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0);
+ gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0);
+ gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0);
+ gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0);
+ gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096);
+ gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2);
+
+ return gbp;
+};
+
+GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) {
+ this.numberOfShannonFanoTrees = n;
+};
+
+GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() {
+ return this.numberOfShannonFanoTrees;
+};
+
+GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) {
+ this.slidingDictionarySize = n;
+};
+
+GeneralPurposeBit.prototype.getSlidingDictionarySize = function() {
+ return this.slidingDictionarySize;
+};
+
+GeneralPurposeBit.prototype.useDataDescriptor = function(b) {
+ this.descriptor = b;
+};
+
+GeneralPurposeBit.prototype.usesDataDescriptor = function() {
+ return this.descriptor;
+};
+
+GeneralPurposeBit.prototype.useEncryption = function(b) {
+ this.encryption = b;
+};
+
+GeneralPurposeBit.prototype.usesEncryption = function() {
+ return this.encryption;
+};
+
+GeneralPurposeBit.prototype.useStrongEncryption = function(b) {
+ this.strongEncryption = b;
+};
+
+GeneralPurposeBit.prototype.usesStrongEncryption = function() {
+ return this.strongEncryption;
+};
+
+GeneralPurposeBit.prototype.useUTF8ForNames = function(b) {
+ this.utf8 = b;
+};
+
+GeneralPurposeBit.prototype.usesUTF8ForNames = function() {
+ return this.utf8;
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/zip/unix-stat.js b/node_modules/compress-commons/lib/archivers/zip/unix-stat.js
new file mode 100644
index 0000000000000000000000000000000000000000..1326cd1d836d483b31346e7cb0fc5c06ef7e731b
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/unix-stat.js
@@ -0,0 +1,53 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+module.exports = {
+ /**
+ * Bits used for permissions (and sticky bit)
+ */
+ PERM_MASK: 4095, // 07777
+
+ /**
+ * Bits used to indicate the filesystem object type.
+ */
+ FILE_TYPE_FLAG: 61440, // 0170000
+
+ /**
+ * Indicates symbolic links.
+ */
+ LINK_FLAG: 40960, // 0120000
+
+ /**
+ * Indicates plain files.
+ */
+ FILE_FLAG: 32768, // 0100000
+
+ /**
+ * Indicates directories.
+ */
+ DIR_FLAG: 16384, // 040000
+
+ // ----------------------------------------------------------
+ // somewhat arbitrary choices that are quite common for shared
+ // installations
+ // -----------------------------------------------------------
+
+ /**
+ * Default permissions for symbolic links.
+ */
+ DEFAULT_LINK_PERM: 511, // 0777
+
+ /**
+ * Default permissions for directories.
+ */
+ DEFAULT_DIR_PERM: 493, // 0755
+
+ /**
+ * Default permissions for plain files.
+ */
+ DEFAULT_FILE_PERM: 420 // 0644
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/zip/util.js b/node_modules/compress-commons/lib/archivers/zip/util.js
new file mode 100644
index 0000000000000000000000000000000000000000..22055ae515bc98a86bb366cbef48e566f01e3727
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/util.js
@@ -0,0 +1,74 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var util = module.exports = {};
+
+util.dateToDos = function(d, forceLocalTime) {
+ forceLocalTime = forceLocalTime || false;
+
+ var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear();
+
+ if (year < 1980) {
+ return 2162688; // 1980-1-1 00:00:00
+ } else if (year >= 2044) {
+ return 2141175677; // 2043-12-31 23:59:58
+ }
+
+ var val = {
+ year: year,
+ month: forceLocalTime ? d.getMonth() : d.getUTCMonth(),
+ date: forceLocalTime ? d.getDate() : d.getUTCDate(),
+ hours: forceLocalTime ? d.getHours() : d.getUTCHours(),
+ minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(),
+ seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds()
+ };
+
+ return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) |
+ (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2);
+};
+
+util.dosToDate = function(dos) {
+ return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1);
+};
+
+util.fromDosTime = function(buf) {
+ return util.dosToDate(buf.readUInt32LE(0));
+};
+
+util.getEightBytes = function(v) {
+ var buf = Buffer.alloc(8);
+ buf.writeUInt32LE(v % 0x0100000000, 0);
+ buf.writeUInt32LE((v / 0x0100000000) | 0, 4);
+
+ return buf;
+};
+
+util.getShortBytes = function(v) {
+ var buf = Buffer.alloc(2);
+ buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0);
+
+ return buf;
+};
+
+util.getShortBytesValue = function(buf, offset) {
+ return buf.readUInt16LE(offset);
+};
+
+util.getLongBytes = function(v) {
+ var buf = Buffer.alloc(4);
+ buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0);
+
+ return buf;
+};
+
+util.getLongBytesValue = function(buf, offset) {
+ return buf.readUInt32LE(offset);
+};
+
+util.toDosTime = function(d) {
+ return util.getLongBytes(util.dateToDos(d));
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js b/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js
new file mode 100644
index 0000000000000000000000000000000000000000..c53ad0ad8fe1b34f080e6138e8eba6bd4b87dfe1
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js
@@ -0,0 +1,413 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var inherits = require('util').inherits;
+var normalizePath = require('normalize-path');
+
+var ArchiveEntry = require('../archive-entry');
+var GeneralPurposeBit = require('./general-purpose-bit');
+var UnixStat = require('./unix-stat');
+
+var constants = require('./constants');
+var zipUtil = require('./util');
+
+var ZipArchiveEntry = module.exports = function(name) {
+ if (!(this instanceof ZipArchiveEntry)) {
+ return new ZipArchiveEntry(name);
+ }
+
+ ArchiveEntry.call(this);
+
+ this.platform = constants.PLATFORM_FAT;
+ this.method = -1;
+
+ this.name = null;
+ this.size = 0;
+ this.csize = 0;
+ this.gpb = new GeneralPurposeBit();
+ this.crc = 0;
+ this.time = -1;
+
+ this.minver = constants.MIN_VERSION_INITIAL;
+ this.mode = -1;
+ this.extra = null;
+ this.exattr = 0;
+ this.inattr = 0;
+ this.comment = null;
+
+ if (name) {
+ this.setName(name);
+ }
+};
+
+inherits(ZipArchiveEntry, ArchiveEntry);
+
+/**
+ * Returns the extra fields related to the entry.
+ *
+ * @returns {Buffer}
+ */
+ZipArchiveEntry.prototype.getCentralDirectoryExtra = function() {
+ return this.getExtra();
+};
+
+/**
+ * Returns the comment set for the entry.
+ *
+ * @returns {string}
+ */
+ZipArchiveEntry.prototype.getComment = function() {
+ return this.comment !== null ? this.comment : '';
+};
+
+/**
+ * Returns the compressed size of the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getCompressedSize = function() {
+ return this.csize;
+};
+
+/**
+ * Returns the CRC32 digest for the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getCrc = function() {
+ return this.crc;
+};
+
+/**
+ * Returns the external file attributes for the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getExternalAttributes = function() {
+ return this.exattr;
+};
+
+/**
+ * Returns the extra fields related to the entry.
+ *
+ * @returns {Buffer}
+ */
+ZipArchiveEntry.prototype.getExtra = function() {
+ return this.extra !== null ? this.extra : constants.EMPTY;
+};
+
+/**
+ * Returns the general purpose bits related to the entry.
+ *
+ * @returns {GeneralPurposeBit}
+ */
+ZipArchiveEntry.prototype.getGeneralPurposeBit = function() {
+ return this.gpb;
+};
+
+/**
+ * Returns the internal file attributes for the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getInternalAttributes = function() {
+ return this.inattr;
+};
+
+/**
+ * Returns the last modified date of the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getLastModifiedDate = function() {
+ return this.getTime();
+};
+
+/**
+ * Returns the extra fields related to the entry.
+ *
+ * @returns {Buffer}
+ */
+ZipArchiveEntry.prototype.getLocalFileDataExtra = function() {
+ return this.getExtra();
+};
+
+/**
+ * Returns the compression method used on the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getMethod = function() {
+ return this.method;
+};
+
+/**
+ * Returns the filename of the entry.
+ *
+ * @returns {string}
+ */
+ZipArchiveEntry.prototype.getName = function() {
+ return this.name;
+};
+
+/**
+ * Returns the platform on which the entry was made.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getPlatform = function() {
+ return this.platform;
+};
+
+/**
+ * Returns the size of the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getSize = function() {
+ return this.size;
+};
+
+/**
+ * Returns a date object representing the last modified date of the entry.
+ *
+ * @returns {number|Date}
+ */
+ZipArchiveEntry.prototype.getTime = function() {
+ return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1;
+};
+
+/**
+ * Returns the DOS timestamp for the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getTimeDos = function() {
+ return this.time !== -1 ? this.time : 0;
+};
+
+/**
+ * Returns the UNIX file permissions for the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getUnixMode = function() {
+ return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK);
+};
+
+/**
+ * Returns the version of ZIP needed to extract the entry.
+ *
+ * @returns {number}
+ */
+ZipArchiveEntry.prototype.getVersionNeededToExtract = function() {
+ return this.minver;
+};
+
+/**
+ * Sets the comment of the entry.
+ *
+ * @param comment
+ */
+ZipArchiveEntry.prototype.setComment = function(comment) {
+ if (Buffer.byteLength(comment) !== comment.length) {
+ this.getGeneralPurposeBit().useUTF8ForNames(true);
+ }
+
+ this.comment = comment;
+};
+
+/**
+ * Sets the compressed size of the entry.
+ *
+ * @param size
+ */
+ZipArchiveEntry.prototype.setCompressedSize = function(size) {
+ if (size < 0) {
+ throw new Error('invalid entry compressed size');
+ }
+
+ this.csize = size;
+};
+
+/**
+ * Sets the checksum of the entry.
+ *
+ * @param crc
+ */
+ZipArchiveEntry.prototype.setCrc = function(crc) {
+ if (crc < 0) {
+ throw new Error('invalid entry crc32');
+ }
+
+ this.crc = crc;
+};
+
+/**
+ * Sets the external file attributes of the entry.
+ *
+ * @param attr
+ */
+ZipArchiveEntry.prototype.setExternalAttributes = function(attr) {
+ this.exattr = attr >>> 0;
+};
+
+/**
+ * Sets the extra fields related to the entry.
+ *
+ * @param extra
+ */
+ZipArchiveEntry.prototype.setExtra = function(extra) {
+ this.extra = extra;
+};
+
+/**
+ * Sets the general purpose bits related to the entry.
+ *
+ * @param gpb
+ */
+ZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) {
+ if (!(gpb instanceof GeneralPurposeBit)) {
+ throw new Error('invalid entry GeneralPurposeBit');
+ }
+
+ this.gpb = gpb;
+};
+
+/**
+ * Sets the internal file attributes of the entry.
+ *
+ * @param attr
+ */
+ZipArchiveEntry.prototype.setInternalAttributes = function(attr) {
+ this.inattr = attr;
+};
+
+/**
+ * Sets the compression method of the entry.
+ *
+ * @param method
+ */
+ZipArchiveEntry.prototype.setMethod = function(method) {
+ if (method < 0) {
+ throw new Error('invalid entry compression method');
+ }
+
+ this.method = method;
+};
+
+/**
+ * Sets the name of the entry.
+ *
+ * @param name
+ * @param prependSlash
+ */
+ZipArchiveEntry.prototype.setName = function(name, prependSlash = false) {
+ name = normalizePath(name, false)
+ .replace(/^\w+:/, '')
+ .replace(/^(\.\.\/|\/)+/, '');
+
+ if (prependSlash) {
+ name = `/${name}`;
+ }
+
+ if (Buffer.byteLength(name) !== name.length) {
+ this.getGeneralPurposeBit().useUTF8ForNames(true);
+ }
+
+ this.name = name;
+};
+
+/**
+ * Sets the platform on which the entry was made.
+ *
+ * @param platform
+ */
+ZipArchiveEntry.prototype.setPlatform = function(platform) {
+ this.platform = platform;
+};
+
+/**
+ * Sets the size of the entry.
+ *
+ * @param size
+ */
+ZipArchiveEntry.prototype.setSize = function(size) {
+ if (size < 0) {
+ throw new Error('invalid entry size');
+ }
+
+ this.size = size;
+};
+
+/**
+ * Sets the time of the entry.
+ *
+ * @param time
+ * @param forceLocalTime
+ */
+ZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) {
+ if (!(time instanceof Date)) {
+ throw new Error('invalid entry time');
+ }
+
+ this.time = zipUtil.dateToDos(time, forceLocalTime);
+};
+
+/**
+ * Sets the UNIX file permissions for the entry.
+ *
+ * @param mode
+ */
+ZipArchiveEntry.prototype.setUnixMode = function(mode) {
+ mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG;
+
+ var extattr = 0;
+ extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A);
+
+ this.setExternalAttributes(extattr);
+ this.mode = mode & constants.MODE_MASK;
+ this.platform = constants.PLATFORM_UNIX;
+};
+
+/**
+ * Sets the version of ZIP needed to extract this entry.
+ *
+ * @param minver
+ */
+ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) {
+ this.minver = minver;
+};
+
+/**
+ * Returns true if this entry represents a directory.
+ *
+ * @returns {boolean}
+ */
+ZipArchiveEntry.prototype.isDirectory = function() {
+ return this.getName().slice(-1) === '/';
+};
+
+/**
+ * Returns true if this entry represents a unix symlink,
+ * in which case the entry's content contains the target path
+ * for the symlink.
+ *
+ * @returns {boolean}
+ */
+ZipArchiveEntry.prototype.isUnixSymlink = function() {
+ return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG;
+};
+
+/**
+ * Returns true if this entry is using the ZIP64 extension of ZIP.
+ *
+ * @returns {boolean}
+ */
+ZipArchiveEntry.prototype.isZip64 = function() {
+ return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC;
+};
diff --git a/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js b/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..f56cea93a76a78f382bc5989a4dfe8462c7d1eb8
--- /dev/null
+++ b/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js
@@ -0,0 +1,437 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var inherits = require('util').inherits;
+var crc32 = require('crc-32');
+var {CRC32Stream} = require('crc32-stream');
+var {DeflateCRC32Stream} = require('crc32-stream');
+
+var ArchiveOutputStream = require('../archive-output-stream');
+var ZipArchiveEntry = require('./zip-archive-entry');
+var GeneralPurposeBit = require('./general-purpose-bit');
+
+var constants = require('./constants');
+var util = require('../../util');
+var zipUtil = require('./util');
+
+var ZipArchiveOutputStream = module.exports = function(options) {
+ if (!(this instanceof ZipArchiveOutputStream)) {
+ return new ZipArchiveOutputStream(options);
+ }
+
+ options = this.options = this._defaults(options);
+
+ ArchiveOutputStream.call(this, options);
+
+ this._entry = null;
+ this._entries = [];
+ this._archive = {
+ centralLength: 0,
+ centralOffset: 0,
+ comment: '',
+ finish: false,
+ finished: false,
+ processing: false,
+ forceZip64: options.forceZip64,
+ forceLocalTime: options.forceLocalTime
+ };
+};
+
+inherits(ZipArchiveOutputStream, ArchiveOutputStream);
+
+ZipArchiveOutputStream.prototype._afterAppend = function(ae) {
+ this._entries.push(ae);
+
+ if (ae.getGeneralPurposeBit().usesDataDescriptor()) {
+ this._writeDataDescriptor(ae);
+ }
+
+ this._archive.processing = false;
+ this._entry = null;
+
+ if (this._archive.finish && !this._archive.finished) {
+ this._finish();
+ }
+};
+
+ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) {
+ if (source.length === 0) {
+ ae.setMethod(constants.METHOD_STORED);
+ }
+
+ var method = ae.getMethod();
+
+ if (method === constants.METHOD_STORED) {
+ ae.setSize(source.length);
+ ae.setCompressedSize(source.length);
+ ae.setCrc(crc32.buf(source) >>> 0);
+ }
+
+ this._writeLocalFileHeader(ae);
+
+ if (method === constants.METHOD_STORED) {
+ this.write(source);
+ this._afterAppend(ae);
+ callback(null, ae);
+ return;
+ } else if (method === constants.METHOD_DEFLATED) {
+ this._smartStream(ae, callback).end(source);
+ return;
+ } else {
+ callback(new Error('compression method ' + method + ' not implemented'));
+ return;
+ }
+};
+
+ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) {
+ ae.getGeneralPurposeBit().useDataDescriptor(true);
+ ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR);
+
+ this._writeLocalFileHeader(ae);
+
+ var smart = this._smartStream(ae, callback);
+ source.once('error', function(err) {
+ smart.emit('error', err);
+ smart.end();
+ })
+ source.pipe(smart);
+};
+
+ZipArchiveOutputStream.prototype._defaults = function(o) {
+ if (typeof o !== 'object') {
+ o = {};
+ }
+
+ if (typeof o.zlib !== 'object') {
+ o.zlib = {};
+ }
+
+ if (typeof o.zlib.level !== 'number') {
+ o.zlib.level = constants.ZLIB_BEST_SPEED;
+ }
+
+ o.forceZip64 = !!o.forceZip64;
+ o.forceLocalTime = !!o.forceLocalTime;
+
+ return o;
+};
+
+ZipArchiveOutputStream.prototype._finish = function() {
+ this._archive.centralOffset = this.offset;
+
+ this._entries.forEach(function(ae) {
+ this._writeCentralFileHeader(ae);
+ }.bind(this));
+
+ this._archive.centralLength = this.offset - this._archive.centralOffset;
+
+ if (this.isZip64()) {
+ this._writeCentralDirectoryZip64();
+ }
+
+ this._writeCentralDirectoryEnd();
+
+ this._archive.processing = false;
+ this._archive.finish = true;
+ this._archive.finished = true;
+ this.end();
+};
+
+ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) {
+ if (ae.getMethod() === -1) {
+ ae.setMethod(constants.METHOD_DEFLATED);
+ }
+
+ if (ae.getMethod() === constants.METHOD_DEFLATED) {
+ ae.getGeneralPurposeBit().useDataDescriptor(true);
+ ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR);
+ }
+
+ if (ae.getTime() === -1) {
+ ae.setTime(new Date(), this._archive.forceLocalTime);
+ }
+
+ ae._offsets = {
+ file: 0,
+ data: 0,
+ contents: 0,
+ };
+};
+
+ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) {
+ var deflate = ae.getMethod() === constants.METHOD_DEFLATED;
+ var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();
+ var error = null;
+
+ function handleStuff() {
+ var digest = process.digest().readUInt32BE(0);
+ ae.setCrc(digest);
+ ae.setSize(process.size());
+ ae.setCompressedSize(process.size(true));
+ this._afterAppend(ae);
+ callback(error, ae);
+ }
+
+ process.once('end', handleStuff.bind(this));
+ process.once('error', function(err) {
+ error = err;
+ });
+
+ process.pipe(this, { end: false });
+
+ return process;
+};
+
+ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() {
+ var records = this._entries.length;
+ var size = this._archive.centralLength;
+ var offset = this._archive.centralOffset;
+
+ if (this.isZip64()) {
+ records = constants.ZIP64_MAGIC_SHORT;
+ size = constants.ZIP64_MAGIC;
+ offset = constants.ZIP64_MAGIC;
+ }
+
+ // signature
+ this.write(zipUtil.getLongBytes(constants.SIG_EOCD));
+
+ // disk numbers
+ this.write(constants.SHORT_ZERO);
+ this.write(constants.SHORT_ZERO);
+
+ // number of entries
+ this.write(zipUtil.getShortBytes(records));
+ this.write(zipUtil.getShortBytes(records));
+
+ // length and location of CD
+ this.write(zipUtil.getLongBytes(size));
+ this.write(zipUtil.getLongBytes(offset));
+
+ // archive comment
+ var comment = this.getComment();
+ var commentLength = Buffer.byteLength(comment);
+ this.write(zipUtil.getShortBytes(commentLength));
+ this.write(comment);
+};
+
+ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() {
+ // signature
+ this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD));
+
+ // size of the ZIP64 EOCD record
+ this.write(zipUtil.getEightBytes(44));
+
+ // version made by
+ this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64));
+
+ // version to extract
+ this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64));
+
+ // disk numbers
+ this.write(constants.LONG_ZERO);
+ this.write(constants.LONG_ZERO);
+
+ // number of entries
+ this.write(zipUtil.getEightBytes(this._entries.length));
+ this.write(zipUtil.getEightBytes(this._entries.length));
+
+ // length and location of CD
+ this.write(zipUtil.getEightBytes(this._archive.centralLength));
+ this.write(zipUtil.getEightBytes(this._archive.centralOffset));
+
+ // extensible data sector
+ // not implemented at this time
+
+ // end of central directory locator
+ this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC));
+
+ // disk number holding the ZIP64 EOCD record
+ this.write(constants.LONG_ZERO);
+
+ // relative offset of the ZIP64 EOCD record
+ this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength));
+
+ // total number of disks
+ this.write(zipUtil.getLongBytes(1));
+};
+
+ZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) {
+ var gpb = ae.getGeneralPurposeBit();
+ var method = ae.getMethod();
+ var fileOffset = ae._offsets.file;
+
+ var size = ae.getSize();
+ var compressedSize = ae.getCompressedSize();
+
+ if (ae.isZip64() || fileOffset > constants.ZIP64_MAGIC) {
+ size = constants.ZIP64_MAGIC;
+ compressedSize = constants.ZIP64_MAGIC;
+ fileOffset = constants.ZIP64_MAGIC;
+
+ ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
+
+ var extraBuf = Buffer.concat([
+ zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID),
+ zipUtil.getShortBytes(24),
+ zipUtil.getEightBytes(ae.getSize()),
+ zipUtil.getEightBytes(ae.getCompressedSize()),
+ zipUtil.getEightBytes(ae._offsets.file)
+ ], 28);
+
+ ae.setExtra(extraBuf);
+ }
+
+ // signature
+ this.write(zipUtil.getLongBytes(constants.SIG_CFH));
+
+ // version made by
+ this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY));
+
+ // version to extract and general bit flag
+ this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));
+ this.write(gpb.encode());
+
+ // compression method
+ this.write(zipUtil.getShortBytes(method));
+
+ // datetime
+ this.write(zipUtil.getLongBytes(ae.getTimeDos()));
+
+ // crc32 checksum
+ this.write(zipUtil.getLongBytes(ae.getCrc()));
+
+ // sizes
+ this.write(zipUtil.getLongBytes(compressedSize));
+ this.write(zipUtil.getLongBytes(size));
+
+ var name = ae.getName();
+ var comment = ae.getComment();
+ var extra = ae.getCentralDirectoryExtra();
+
+ if (gpb.usesUTF8ForNames()) {
+ name = Buffer.from(name);
+ comment = Buffer.from(comment);
+ }
+
+ // name length
+ this.write(zipUtil.getShortBytes(name.length));
+
+ // extra length
+ this.write(zipUtil.getShortBytes(extra.length));
+
+ // comments length
+ this.write(zipUtil.getShortBytes(comment.length));
+
+ // disk number start
+ this.write(constants.SHORT_ZERO);
+
+ // internal attributes
+ this.write(zipUtil.getShortBytes(ae.getInternalAttributes()));
+
+ // external attributes
+ this.write(zipUtil.getLongBytes(ae.getExternalAttributes()));
+
+ // relative offset of LFH
+ this.write(zipUtil.getLongBytes(fileOffset));
+
+ // name
+ this.write(name);
+
+ // extra
+ this.write(extra);
+
+ // comment
+ this.write(comment);
+};
+
+ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) {
+ // signature
+ this.write(zipUtil.getLongBytes(constants.SIG_DD));
+
+ // crc32 checksum
+ this.write(zipUtil.getLongBytes(ae.getCrc()));
+
+ // sizes
+ if (ae.isZip64()) {
+ this.write(zipUtil.getEightBytes(ae.getCompressedSize()));
+ this.write(zipUtil.getEightBytes(ae.getSize()));
+ } else {
+ this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
+ this.write(zipUtil.getLongBytes(ae.getSize()));
+ }
+};
+
+ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
+ var gpb = ae.getGeneralPurposeBit();
+ var method = ae.getMethod();
+ var name = ae.getName();
+ var extra = ae.getLocalFileDataExtra();
+
+ if (ae.isZip64()) {
+ gpb.useDataDescriptor(true);
+ ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
+ }
+
+ if (gpb.usesUTF8ForNames()) {
+ name = Buffer.from(name);
+ }
+
+ ae._offsets.file = this.offset;
+
+ // signature
+ this.write(zipUtil.getLongBytes(constants.SIG_LFH));
+
+ // version to extract and general bit flag
+ this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));
+ this.write(gpb.encode());
+
+ // compression method
+ this.write(zipUtil.getShortBytes(method));
+
+ // datetime
+ this.write(zipUtil.getLongBytes(ae.getTimeDos()));
+
+ ae._offsets.data = this.offset;
+
+ // crc32 checksum and sizes
+ if (gpb.usesDataDescriptor()) {
+ this.write(constants.LONG_ZERO);
+ this.write(constants.LONG_ZERO);
+ this.write(constants.LONG_ZERO);
+ } else {
+ this.write(zipUtil.getLongBytes(ae.getCrc()));
+ this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
+ this.write(zipUtil.getLongBytes(ae.getSize()));
+ }
+
+ // name length
+ this.write(zipUtil.getShortBytes(name.length));
+
+ // extra length
+ this.write(zipUtil.getShortBytes(extra.length));
+
+ // name
+ this.write(name);
+
+ // extra
+ this.write(extra);
+
+ ae._offsets.contents = this.offset;
+};
+
+ZipArchiveOutputStream.prototype.getComment = function(comment) {
+ return this._archive.comment !== null ? this._archive.comment : '';
+};
+
+ZipArchiveOutputStream.prototype.isZip64 = function() {
+ return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC;
+};
+
+ZipArchiveOutputStream.prototype.setComment = function(comment) {
+ this._archive.comment = comment;
+};
diff --git a/node_modules/compress-commons/lib/compress-commons.js b/node_modules/compress-commons/lib/compress-commons.js
new file mode 100644
index 0000000000000000000000000000000000000000..ef3bc1dbed1addba642eb382a9641d708eb9d884
--- /dev/null
+++ b/node_modules/compress-commons/lib/compress-commons.js
@@ -0,0 +1,13 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+module.exports = {
+ ArchiveEntry: require('./archivers/archive-entry'),
+ ZipArchiveEntry: require('./archivers/zip/zip-archive-entry'),
+ ArchiveOutputStream: require('./archivers/archive-output-stream'),
+ ZipArchiveOutputStream: require('./archivers/zip/zip-archive-output-stream')
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/lib/util/index.js b/node_modules/compress-commons/lib/util/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..0fcc60f963eec3778bb7b81fd5d776fd53b3dbcb
--- /dev/null
+++ b/node_modules/compress-commons/lib/util/index.js
@@ -0,0 +1,27 @@
+/**
+ * node-compress-commons
+ *
+ * Copyright (c) 2014 Chris Talkington, contributors.
+ * Licensed under the MIT license.
+ * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
+ */
+var Stream = require('stream').Stream;
+var PassThrough = require('readable-stream').PassThrough;
+var isStream = require('is-stream');
+
+var util = module.exports = {};
+
+util.normalizeInputSource = function(source) {
+ if (source === null) {
+ return Buffer.alloc(0);
+ } else if (typeof source === 'string') {
+ return Buffer.from(source);
+ } else if (isStream(source) && !source._readableState) {
+ var normalized = new PassThrough();
+ source.pipe(normalized);
+
+ return normalized;
+ }
+
+ return source;
+};
\ No newline at end of file
diff --git a/node_modules/compress-commons/package.json b/node_modules/compress-commons/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..d5c45b2d4bb3c22456a96fe2dab5564c4252a31f
--- /dev/null
+++ b/node_modules/compress-commons/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "compress-commons",
+ "version": "6.0.2",
+ "description": "a library that defines a common interface for working with archive formats within node",
+ "homepage": "https://github.com/archiverjs/node-compress-commons",
+ "author": {
+ "name": "Chris Talkington",
+ "url": "http://christalkington.com/"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/archiverjs/node-compress-commons.git"
+ },
+ "bugs": {
+ "url": "https://github.com/archiverjs/node-compress-commons/issues"
+ },
+ "license": "MIT",
+ "main": "lib/compress-commons.js",
+ "files": [
+ "lib"
+ ],
+ "engines": {
+ "node": ">= 14"
+ },
+ "scripts": {
+ "test": "mocha --reporter dot"
+ },
+ "dependencies": {
+ "crc-32": "^1.2.0",
+ "crc32-stream": "^6.0.0",
+ "is-stream": "^2.0.1",
+ "normalize-path": "^3.0.0",
+ "readable-stream": "^4.0.0"
+ },
+ "devDependencies": {
+ "chai": "4.4.1",
+ "mkdirp": "3.0.1",
+ "mocha": "10.3.0",
+ "rimraf": "5.0.5"
+ },
+ "keywords": [
+ "compress",
+ "commons",
+ "archive"
+ ]
+}
diff --git a/node_modules/concat-stream/LICENSE b/node_modules/concat-stream/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..99c130e1de342703106a2032f2d8f8329fea1af4
--- /dev/null
+++ b/node_modules/concat-stream/LICENSE
@@ -0,0 +1,24 @@
+The MIT License
+
+Copyright (c) 2013 Max Ogden
+
+Permission is hereby granted, free of charge,
+to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to
+deal in the Software without restriction, including
+without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom
+the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/concat-stream/index.js b/node_modules/concat-stream/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..dd672a761b2f8212455353b05385b85573424567
--- /dev/null
+++ b/node_modules/concat-stream/index.js
@@ -0,0 +1,144 @@
+var Writable = require('readable-stream').Writable
+var inherits = require('inherits')
+var bufferFrom = require('buffer-from')
+
+if (typeof Uint8Array === 'undefined') {
+ var U8 = require('typedarray').Uint8Array
+} else {
+ var U8 = Uint8Array
+}
+
+function ConcatStream(opts, cb) {
+ if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)
+
+ if (typeof opts === 'function') {
+ cb = opts
+ opts = {}
+ }
+ if (!opts) opts = {}
+
+ var encoding = opts.encoding
+ var shouldInferEncoding = false
+
+ if (!encoding) {
+ shouldInferEncoding = true
+ } else {
+ encoding = String(encoding).toLowerCase()
+ if (encoding === 'u8' || encoding === 'uint8') {
+ encoding = 'uint8array'
+ }
+ }
+
+ Writable.call(this, { objectMode: true })
+
+ this.encoding = encoding
+ this.shouldInferEncoding = shouldInferEncoding
+
+ if (cb) this.on('finish', function () { cb(this.getBody()) })
+ this.body = []
+}
+
+module.exports = ConcatStream
+inherits(ConcatStream, Writable)
+
+ConcatStream.prototype._write = function(chunk, enc, next) {
+ this.body.push(chunk)
+ next()
+}
+
+ConcatStream.prototype.inferEncoding = function (buff) {
+ var firstBuffer = buff === undefined ? this.body[0] : buff;
+ if (Buffer.isBuffer(firstBuffer)) return 'buffer'
+ if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array'
+ if (Array.isArray(firstBuffer)) return 'array'
+ if (typeof firstBuffer === 'string') return 'string'
+ if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object'
+ return 'buffer'
+}
+
+ConcatStream.prototype.getBody = function () {
+ if (!this.encoding && this.body.length === 0) return []
+ if (this.shouldInferEncoding) this.encoding = this.inferEncoding()
+ if (this.encoding === 'array') return arrayConcat(this.body)
+ if (this.encoding === 'string') return stringConcat(this.body)
+ if (this.encoding === 'buffer') return bufferConcat(this.body)
+ if (this.encoding === 'uint8array') return u8Concat(this.body)
+ return this.body
+}
+
+var isArray = Array.isArray || function (arr) {
+ return Object.prototype.toString.call(arr) == '[object Array]'
+}
+
+function isArrayish (arr) {
+ return /Array\]$/.test(Object.prototype.toString.call(arr))
+}
+
+function isBufferish (p) {
+ return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function')
+}
+
+function stringConcat (parts) {
+ var strings = []
+ var needsToString = false
+ for (var i = 0; i < parts.length; i++) {
+ var p = parts[i]
+ if (typeof p === 'string') {
+ strings.push(p)
+ } else if (Buffer.isBuffer(p)) {
+ strings.push(p)
+ } else if (isBufferish(p)) {
+ strings.push(bufferFrom(p))
+ } else {
+ strings.push(bufferFrom(String(p)))
+ }
+ }
+ if (Buffer.isBuffer(parts[0])) {
+ strings = Buffer.concat(strings)
+ strings = strings.toString('utf8')
+ } else {
+ strings = strings.join('')
+ }
+ return strings
+}
+
+function bufferConcat (parts) {
+ var bufs = []
+ for (var i = 0; i < parts.length; i++) {
+ var p = parts[i]
+ if (Buffer.isBuffer(p)) {
+ bufs.push(p)
+ } else if (isBufferish(p)) {
+ bufs.push(bufferFrom(p))
+ } else {
+ bufs.push(bufferFrom(String(p)))
+ }
+ }
+ return Buffer.concat(bufs)
+}
+
+function arrayConcat (parts) {
+ var res = []
+ for (var i = 0; i < parts.length; i++) {
+ res.push.apply(res, parts[i])
+ }
+ return res
+}
+
+function u8Concat (parts) {
+ var len = 0
+ for (var i = 0; i < parts.length; i++) {
+ if (typeof parts[i] === 'string') {
+ parts[i] = bufferFrom(parts[i])
+ }
+ len += parts[i].length
+ }
+ var u8 = new U8(len)
+ for (var i = 0, offset = 0; i < parts.length; i++) {
+ var part = parts[i]
+ for (var j = 0; j < part.length; j++) {
+ u8[offset++] = part[j]
+ }
+ }
+ return u8
+}
diff --git a/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644
index 0000000000000000000000000000000000000000..f478d58dca85b2c396e2da8a2251be0071c4e9e0
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+* (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+* (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md b/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644
index 0000000000000000000000000000000000000000..16ffb93f24bece9519cc4a220a0c1d3c91481453
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited. There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting. This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions. If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer. If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus. See
+"WG Membership" above.
diff --git a/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/node_modules/concat-stream/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..2873b3b2e595072e66330369d83e8af46655970c
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/LICENSE
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/node_modules/concat-stream/node_modules/readable-stream/README.md b/node_modules/concat-stream/node_modules/readable-stream/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..19117c1a059d1bfa7c6ff04d430bf21bb05b0621
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/README.md
@@ -0,0 +1,106 @@
+# readable-stream
+
+***Node.js core streams for userland*** [](https://travis-ci.com/nodejs/readable-stream)
+
+
+[](https://nodei.co/npm/readable-stream/)
+[](https://nodei.co/npm/readable-stream/)
+
+
+[](https://saucelabs.com/u/readabe-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+This package is a mirror of the streams implementations in Node.js.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+## Version 3.x.x
+
+v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows:
+
+1. Error codes: https://github.com/nodejs/node/pull/13310,
+ https://github.com/nodejs/node/pull/13291,
+ https://github.com/nodejs/node/pull/16589,
+ https://github.com/nodejs/node/pull/15042,
+ https://github.com/nodejs/node/pull/15665,
+ https://github.com/nodejs/readable-stream/pull/344
+2. 'readable' have precedence over flowing
+ https://github.com/nodejs/node/pull/18994
+3. make virtual methods errors consistent
+ https://github.com/nodejs/node/pull/18813
+4. updated streams error handling
+ https://github.com/nodejs/node/pull/18438
+5. writable.end should return this.
+ https://github.com/nodejs/node/pull/18780
+6. readable continues to read when push('')
+ https://github.com/nodejs/node/pull/18211
+7. add custom inspect to BufferList
+ https://github.com/nodejs/node/pull/17907
+8. always defer 'readable' with nextTick
+ https://github.com/nodejs/node/pull/17979
+
+## Version 2.x.x
+v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11.
+
+### Big Thanks
+
+Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce]
+
+# Usage
+
+You can swap your `require('stream')` with `require('readable-stream')`
+without any changes, if you are just using one of the main classes and
+functions.
+
+```js
+const {
+ Readable,
+ Writable,
+ Transform,
+ Duplex,
+ pipeline,
+ finished
+} = require('readable-stream')
+````
+
+Note that `require('stream')` will return `Stream`, while
+`require('readable-stream')` will return `Readable`. We discourage using
+whatever is exported directly, but rather use one of the properties as
+shown in the example above.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+
+## Team Members
+
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
+ - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
+* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com>
+
+[sauce]: https://saucelabs.com
diff --git a/node_modules/concat-stream/node_modules/readable-stream/errors-browser.js b/node_modules/concat-stream/node_modules/readable-stream/errors-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..fb8e73e1893b100932468397b89076261f47ae61
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/errors-browser.js
@@ -0,0 +1,127 @@
+'use strict';
+
+function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
+
+var codes = {};
+
+function createErrorType(code, message, Base) {
+ if (!Base) {
+ Base = Error;
+ }
+
+ function getMessage(arg1, arg2, arg3) {
+ if (typeof message === 'string') {
+ return message;
+ } else {
+ return message(arg1, arg2, arg3);
+ }
+ }
+
+ var NodeError =
+ /*#__PURE__*/
+ function (_Base) {
+ _inheritsLoose(NodeError, _Base);
+
+ function NodeError(arg1, arg2, arg3) {
+ return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
+ }
+
+ return NodeError;
+ }(Base);
+
+ NodeError.prototype.name = Base.name;
+ NodeError.prototype.code = code;
+ codes[code] = NodeError;
+} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
+
+
+function oneOf(expected, thing) {
+ if (Array.isArray(expected)) {
+ var len = expected.length;
+ expected = expected.map(function (i) {
+ return String(i);
+ });
+
+ if (len > 2) {
+ return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
+ } else if (len === 2) {
+ return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
+ } else {
+ return "of ".concat(thing, " ").concat(expected[0]);
+ }
+ } else {
+ return "of ".concat(thing, " ").concat(String(expected));
+ }
+} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
+
+
+function startsWith(str, search, pos) {
+ return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
+} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
+
+
+function endsWith(str, search, this_len) {
+ if (this_len === undefined || this_len > str.length) {
+ this_len = str.length;
+ }
+
+ return str.substring(this_len - search.length, this_len) === search;
+} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
+
+
+function includes(str, search, start) {
+ if (typeof start !== 'number') {
+ start = 0;
+ }
+
+ if (start + search.length > str.length) {
+ return false;
+ } else {
+ return str.indexOf(search, start) !== -1;
+ }
+}
+
+createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
+ return 'The value "' + value + '" is invalid for option "' + name + '"';
+}, TypeError);
+createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
+ // determiner: 'must be' or 'must not be'
+ var determiner;
+
+ if (typeof expected === 'string' && startsWith(expected, 'not ')) {
+ determiner = 'must not be';
+ expected = expected.replace(/^not /, '');
+ } else {
+ determiner = 'must be';
+ }
+
+ var msg;
+
+ if (endsWith(name, ' argument')) {
+ // For cases like 'first argument'
+ msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
+ } else {
+ var type = includes(name, '.') ? 'property' : 'argument';
+ msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
+ }
+
+ msg += ". Received type ".concat(typeof actual);
+ return msg;
+}, TypeError);
+createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
+createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
+ return 'The ' + name + ' method is not implemented';
+});
+createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
+createErrorType('ERR_STREAM_DESTROYED', function (name) {
+ return 'Cannot call ' + name + ' after a stream was destroyed';
+});
+createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
+createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
+createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
+createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
+createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
+ return 'Unknown encoding: ' + arg;
+}, TypeError);
+createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
+module.exports.codes = codes;
diff --git a/node_modules/concat-stream/node_modules/readable-stream/errors.js b/node_modules/concat-stream/node_modules/readable-stream/errors.js
new file mode 100644
index 0000000000000000000000000000000000000000..8471526d6e7f752d581942611d749ef6355ad1f5
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/errors.js
@@ -0,0 +1,116 @@
+'use strict';
+
+const codes = {};
+
+function createErrorType(code, message, Base) {
+ if (!Base) {
+ Base = Error
+ }
+
+ function getMessage (arg1, arg2, arg3) {
+ if (typeof message === 'string') {
+ return message
+ } else {
+ return message(arg1, arg2, arg3)
+ }
+ }
+
+ class NodeError extends Base {
+ constructor (arg1, arg2, arg3) {
+ super(getMessage(arg1, arg2, arg3));
+ }
+ }
+
+ NodeError.prototype.name = Base.name;
+ NodeError.prototype.code = code;
+
+ codes[code] = NodeError;
+}
+
+// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
+function oneOf(expected, thing) {
+ if (Array.isArray(expected)) {
+ const len = expected.length;
+ expected = expected.map((i) => String(i));
+ if (len > 2) {
+ return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` +
+ expected[len - 1];
+ } else if (len === 2) {
+ return `one of ${thing} ${expected[0]} or ${expected[1]}`;
+ } else {
+ return `of ${thing} ${expected[0]}`;
+ }
+ } else {
+ return `of ${thing} ${String(expected)}`;
+ }
+}
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
+function startsWith(str, search, pos) {
+ return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
+}
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
+function endsWith(str, search, this_len) {
+ if (this_len === undefined || this_len > str.length) {
+ this_len = str.length;
+ }
+ return str.substring(this_len - search.length, this_len) === search;
+}
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
+function includes(str, search, start) {
+ if (typeof start !== 'number') {
+ start = 0;
+ }
+
+ if (start + search.length > str.length) {
+ return false;
+ } else {
+ return str.indexOf(search, start) !== -1;
+ }
+}
+
+createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
+ return 'The value "' + value + '" is invalid for option "' + name + '"'
+}, TypeError);
+createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
+ // determiner: 'must be' or 'must not be'
+ let determiner;
+ if (typeof expected === 'string' && startsWith(expected, 'not ')) {
+ determiner = 'must not be';
+ expected = expected.replace(/^not /, '');
+ } else {
+ determiner = 'must be';
+ }
+
+ let msg;
+ if (endsWith(name, ' argument')) {
+ // For cases like 'first argument'
+ msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`;
+ } else {
+ const type = includes(name, '.') ? 'property' : 'argument';
+ msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`;
+ }
+
+ msg += `. Received type ${typeof actual}`;
+ return msg;
+}, TypeError);
+createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
+createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
+ return 'The ' + name + ' method is not implemented'
+});
+createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
+createErrorType('ERR_STREAM_DESTROYED', function (name) {
+ return 'Cannot call ' + name + ' after a stream was destroyed';
+});
+createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
+createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
+createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
+createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
+createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
+ return 'Unknown encoding: ' + arg
+}, TypeError);
+createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
+
+module.exports.codes = codes;
diff --git a/node_modules/concat-stream/node_modules/readable-stream/experimentalWarning.js b/node_modules/concat-stream/node_modules/readable-stream/experimentalWarning.js
new file mode 100644
index 0000000000000000000000000000000000000000..78e841495bf24d46a2995496bdf2816935b1e66e
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/experimentalWarning.js
@@ -0,0 +1,17 @@
+'use strict'
+
+var experimentalWarnings = new Set();
+
+function emitExperimentalWarning(feature) {
+ if (experimentalWarnings.has(feature)) return;
+ var msg = feature + ' is an experimental feature. This feature could ' +
+ 'change at any time';
+ experimentalWarnings.add(feature);
+ process.emitWarning(msg, 'ExperimentalWarning');
+}
+
+function noop() {}
+
+module.exports.emitExperimentalWarning = process.emitWarning
+ ? emitExperimentalWarning
+ : noop;
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000000000000000000000000000000000000..19abfa604d5ef7bf3646c1a70a848c3f0df8105a
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,126 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/**/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+};
+/**/
+
+module.exports = Duplex;
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+require('inherits')(Duplex, Readable);
+{
+ // Allow the keys array to be GC'ed.
+ var keys = objectKeys(Writable.prototype);
+ for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+ }
+}
+function Duplex(options) {
+ if (!(this instanceof Duplex)) return new Duplex(options);
+ Readable.call(this, options);
+ Writable.call(this, options);
+ this.allowHalfOpen = true;
+ if (options) {
+ if (options.readable === false) this.readable = false;
+ if (options.writable === false) this.writable = false;
+ if (options.allowHalfOpen === false) {
+ this.allowHalfOpen = false;
+ this.once('end', onend);
+ }
+ }
+}
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState.highWaterMark;
+ }
+});
+Object.defineProperty(Duplex.prototype, 'writableBuffer', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState && this._writableState.getBuffer();
+ }
+});
+Object.defineProperty(Duplex.prototype, 'writableLength', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState.length;
+ }
+});
+
+// the no-half-open enforcer
+function onend() {
+ // If the writable side ended, then we're ok.
+ if (this._writableState.ended) return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ process.nextTick(onEndNT, this);
+}
+function onEndNT(self) {
+ self.end();
+}
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed && this._writableState.destroyed;
+ },
+ set: function set(value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ this._writableState.destroyed = value;
+ }
+});
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000000000000000000000000000000000000..24a6bdde2903fac66f638e578b831a7600761207
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,37 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+var Transform = require('./_stream_transform');
+require('inherits')(PassThrough, Transform);
+function PassThrough(options) {
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
+ Transform.call(this, options);
+}
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+ cb(null, chunk);
+};
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000000000000000000000000000000000000..df1f608d532606ba1df4eeaf3b6f577791dcd9ad
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,1027 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+module.exports = Readable;
+
+/**/
+var Duplex;
+/**/
+
+Readable.ReadableState = ReadableState;
+
+/**/
+var EE = require('events').EventEmitter;
+var EElistenerCount = function EElistenerCount(emitter, type) {
+ return emitter.listeners(type).length;
+};
+/**/
+
+/**/
+var Stream = require('./internal/streams/stream');
+/**/
+
+var Buffer = require('buffer').Buffer;
+var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/**/
+var debugUtil = require('util');
+var debug;
+if (debugUtil && debugUtil.debuglog) {
+ debug = debugUtil.debuglog('stream');
+} else {
+ debug = function debug() {};
+}
+/**/
+
+var BufferList = require('./internal/streams/buffer_list');
+var destroyImpl = require('./internal/streams/destroy');
+var _require = require('./internal/streams/state'),
+ getHighWaterMark = _require.getHighWaterMark;
+var _require$codes = require('../errors').codes,
+ ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
+ ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
+ ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
+ ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
+
+// Lazy loaded to improve the startup performance.
+var StringDecoder;
+var createReadableStreamAsyncIterator;
+var from;
+require('inherits')(Readable, Stream);
+var errorOrDestroy = destroyImpl.errorOrDestroy;
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+function prependListener(emitter, event, fn) {
+ // Sadly this is not cacheable as some libraries bundle their own
+ // event emitter implementation with them.
+ if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+ // This is a hack to make sure that our error handler is attached before any
+ // userland ones. NEVER DO THIS. This is here only because this code needs
+ // to continue to work with older versions of Node.js that do not include
+ // the prependListener() method. The goal is to eventually remove this hack.
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+function ReadableState(options, stream, isDuplex) {
+ Duplex = Duplex || require('./_stream_duplex');
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+ if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);
+
+ // A linked list is used to store data chunks instead of an array because the
+ // linked list can remove elements from the beginning faster than
+ // array.shift()
+ this.buffer = new BufferList();
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
+ // immediately, or on a later tick. We set this to true at first, because
+ // any actions that shouldn't happen until "later" should generally also
+ // not happen before the first read call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+ this.resumeScheduled = false;
+ this.paused = true;
+
+ // Should close be emitted on destroy. Defaults to true.
+ this.emitClose = options.emitClose !== false;
+
+ // Should .destroy() be called after 'end' (and potentially 'finish')
+ this.autoDestroy = !!options.autoDestroy;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+function Readable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+ if (!(this instanceof Readable)) return new Readable(options);
+
+ // Checking for a Stream.Duplex instance is faster here instead of inside
+ // the ReadableState constructor, at least with V8 6.5
+ var isDuplex = this instanceof Duplex;
+ this._readableState = new ReadableState(options, this, isDuplex);
+
+ // legacy
+ this.readable = true;
+ if (options) {
+ if (typeof options.read === 'function') this._read = options.read;
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+ }
+ Stream.call(this);
+}
+Object.defineProperty(Readable.prototype, 'destroyed', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ if (this._readableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed;
+ },
+ set: function set(value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._readableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ }
+});
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+ cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+ var state = this._readableState;
+ var skipChunkCheck;
+ if (!state.objectMode) {
+ if (typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = Buffer.from(chunk, encoding);
+ encoding = '';
+ }
+ skipChunkCheck = true;
+ }
+ } else {
+ skipChunkCheck = true;
+ }
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+ return readableAddChunk(this, chunk, null, true, false);
+};
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+ debug('readableAddChunk', chunk);
+ var state = stream._readableState;
+ if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else {
+ var er;
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+ if (er) {
+ errorOrDestroy(stream, er);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+ if (addToFront) {
+ if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
+ } else if (state.ended) {
+ errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
+ } else if (state.destroyed) {
+ return false;
+ } else {
+ state.reading = false;
+ if (state.decoder && !encoding) {
+ chunk = state.decoder.write(chunk);
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+ } else {
+ addChunk(stream, state, chunk, false);
+ }
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ maybeReadMore(stream, state);
+ }
+ }
+
+ // We can push more data if we are below the highWaterMark.
+ // Also, if we have no data yet, we can stand some more bytes.
+ // This is to work around cases where hwm=0, such as the repl.
+ return !state.ended && (state.length < state.highWaterMark || state.length === 0);
+}
+function addChunk(stream, state, chunk, addToFront) {
+ if (state.flowing && state.length === 0 && !state.sync) {
+ state.awaitDrain = 0;
+ stream.emit('data', chunk);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+ if (state.needReadable) emitReadable(stream);
+ }
+ maybeReadMore(stream, state);
+}
+function chunkInvalid(state, chunk) {
+ var er;
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
+ }
+ return er;
+}
+Readable.prototype.isPaused = function () {
+ return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ var decoder = new StringDecoder(enc);
+ this._readableState.decoder = decoder;
+ // If setEncoding(null), decoder.encoding equals utf8
+ this._readableState.encoding = this._readableState.decoder.encoding;
+
+ // Iterate over current buffer to convert already stored Buffers:
+ var p = this._readableState.buffer.head;
+ var content = '';
+ while (p !== null) {
+ content += decoder.write(p.data);
+ p = p.next;
+ }
+ this._readableState.buffer.clear();
+ if (content !== '') this._readableState.buffer.push(content);
+ this._readableState.length = content.length;
+ return this;
+};
+
+// Don't raise the hwm > 1GB
+var MAX_HWM = 0x40000000;
+function computeNewHighWaterMark(n) {
+ if (n >= MAX_HWM) {
+ // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
+ // tiny amounts
+ n--;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ n++;
+ }
+ return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
+ if (state.objectMode) return 1;
+ if (n !== n) {
+ // Only flow one buffer at a time
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+ }
+ // If we're asking for more than the current hwm, then raise the hwm.
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+ if (n <= state.length) return n;
+ // Don't have enough
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ }
+ return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+ debug('read', n);
+ n = parseInt(n, 10);
+ var state = this._readableState;
+ var nOrig = n;
+ if (n !== 0) state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ return null;
+ }
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0) endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ } else if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0) state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (!state.reading) n = howMuchToRead(nOrig, state);
+ }
+ var ret;
+ if (n > 0) ret = fromList(n, state);else ret = null;
+ if (ret === null) {
+ state.needReadable = state.length <= state.highWaterMark;
+ n = 0;
+ } else {
+ state.length -= n;
+ state.awaitDrain = 0;
+ }
+ if (state.length === 0) {
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (!state.ended) state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended) endReadable(this);
+ }
+ if (ret !== null) this.emit('data', ret);
+ return ret;
+};
+function onEofChunk(stream, state) {
+ debug('onEofChunk');
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+ if (state.sync) {
+ // if we are sync, wait until next tick to emit the data.
+ // Otherwise we risk emitting data in the flow()
+ // the readable code triggers during a read() call
+ emitReadable(stream);
+ } else {
+ // emit 'readable' now to make sure it gets picked up.
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ state.emittedReadable = true;
+ emitReadable_(stream);
+ }
+ }
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ debug('emitReadable', state.needReadable, state.emittedReadable);
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ process.nextTick(emitReadable_, stream);
+ }
+}
+function emitReadable_(stream) {
+ var state = stream._readableState;
+ debug('emitReadable_', state.destroyed, state.length, state.ended);
+ if (!state.destroyed && (state.length || state.ended)) {
+ stream.emit('readable');
+ state.emittedReadable = false;
+ }
+
+ // The stream needs another readable event if
+ // 1. It is not flowing, as the flow mechanism will take
+ // care of it.
+ // 2. It is not ended.
+ // 3. It is below the highWaterMark, so we can schedule
+ // another readable later.
+ state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
+ flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ process.nextTick(maybeReadMore_, stream, state);
+ }
+}
+function maybeReadMore_(stream, state) {
+ // Attempt to read more data if we should.
+ //
+ // The conditions for reading more data are (one of):
+ // - Not enough data buffered (state.length < state.highWaterMark). The loop
+ // is responsible for filling the buffer with enough data if such data
+ // is available. If highWaterMark is 0 and we are not in the flowing mode
+ // we should _not_ attempt to buffer any extra data. We'll get more data
+ // when the stream consumer calls read() instead.
+ // - No data in the buffer, and the stream is in flowing mode. In this mode
+ // the loop below is responsible for ensuring read() is called. Failing to
+ // call read here would abort the flow and there's no other mechanism for
+ // continuing the flow if the stream consumer has just subscribed to the
+ // 'data' event.
+ //
+ // In addition to the above conditions to keep reading data, the following
+ // conditions prevent the data from being read:
+ // - The stream has ended (state.ended).
+ // - There is already a pending 'read' operation (state.reading). This is a
+ // case where the the stream has called the implementation defined _read()
+ // method, but they are processing the call asynchronously and have _not_
+ // called push() with new data. In this case we skip performing more
+ // read()s. The execution ends in this method again after the _read() ends
+ // up calling push() with more data.
+ while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
+ var len = state.length;
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+ errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
+};
+Readable.prototype.pipe = function (dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+ var endFn = doEnd ? onend : unpipe;
+ if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable, unpipeInfo) {
+ debug('onunpipe');
+ if (readable === src) {
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+ unpipeInfo.hasUnpiped = true;
+ cleanup();
+ }
+ }
+ }
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+ var cleanedUp = false;
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', unpipe);
+ src.removeListener('data', ondata);
+ cleanedUp = true;
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ }
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ var ret = dest.write(chunk);
+ debug('dest.write', ret);
+ if (ret === false) {
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ // => Check whether `dest` is still a piping destination.
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+ debug('false write response, pause', state.awaitDrain);
+ state.awaitDrain++;
+ }
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
+ }
+
+ // Make sure our error handler is attached before userland ones.
+ prependListener(dest, 'error', onerror);
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+ return dest;
+};
+function pipeOnDrain(src) {
+ return function pipeOnDrainFunctionResult() {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain) state.awaitDrain--;
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+Readable.prototype.unpipe = function (dest) {
+ var state = this._readableState;
+ var unpipeInfo = {
+ hasUnpiped: false
+ };
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0) return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes) return this;
+ if (!dest) dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
+ hasUnpiped: false
+ });
+ return this;
+ }
+
+ // try to find the right one.
+ var index = indexOf(state.pipes, dest);
+ if (index === -1) return this;
+ state.pipes.splice(index, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
+ dest.emit('unpipe', this, unpipeInfo);
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+ var state = this._readableState;
+ if (ev === 'data') {
+ // update readableListening so that resume() may be a no-op
+ // a few lines down. This is needed to support once('readable').
+ state.readableListening = this.listenerCount('readable') > 0;
+
+ // Try start flowing on next tick if stream isn't explicitly paused
+ if (state.flowing !== false) this.resume();
+ } else if (ev === 'readable') {
+ if (!state.endEmitted && !state.readableListening) {
+ state.readableListening = state.needReadable = true;
+ state.flowing = false;
+ state.emittedReadable = false;
+ debug('on readable', state.length, state.reading);
+ if (state.length) {
+ emitReadable(this);
+ } else if (!state.reading) {
+ process.nextTick(nReadingNextTick, this);
+ }
+ }
+ }
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+Readable.prototype.removeListener = function (ev, fn) {
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
+ if (ev === 'readable') {
+ // We need to check if there is someone still listening to
+ // readable and reset the state. However this needs to happen
+ // after readable has been emitted but before I/O (nextTick) to
+ // support once('readable', fn) cycles. This means that calling
+ // resume within the same tick will have no
+ // effect.
+ process.nextTick(updateReadableListening, this);
+ }
+ return res;
+};
+Readable.prototype.removeAllListeners = function (ev) {
+ var res = Stream.prototype.removeAllListeners.apply(this, arguments);
+ if (ev === 'readable' || ev === undefined) {
+ // We need to check if there is someone still listening to
+ // readable and reset the state. However this needs to happen
+ // after readable has been emitted but before I/O (nextTick) to
+ // support once('readable', fn) cycles. This means that calling
+ // resume within the same tick will have no
+ // effect.
+ process.nextTick(updateReadableListening, this);
+ }
+ return res;
+};
+function updateReadableListening(self) {
+ var state = self._readableState;
+ state.readableListening = self.listenerCount('readable') > 0;
+ if (state.resumeScheduled && !state.paused) {
+ // flowing needs to be set to true now, otherwise
+ // the upcoming resume will not flow.
+ state.flowing = true;
+
+ // crude way to check if we should resume
+ } else if (self.listenerCount('data') > 0) {
+ self.resume();
+ }
+}
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ // we flow only if there is no one listening
+ // for readable, but we still have to call
+ // resume()
+ state.flowing = !state.readableListening;
+ resume(this, state);
+ }
+ state.paused = false;
+ return this;
+};
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ process.nextTick(resume_, stream, state);
+ }
+}
+function resume_(stream, state) {
+ debug('resume', state.reading);
+ if (!state.reading) {
+ stream.read(0);
+ }
+ state.resumeScheduled = false;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading) stream.read(0);
+}
+Readable.prototype.pause = function () {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (this._readableState.flowing !== false) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ this._readableState.paused = true;
+ return this;
+};
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ while (state.flowing && stream.read() !== null);
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+ var _this = this;
+ var state = this._readableState;
+ var paused = false;
+ stream.on('end', function () {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) _this.push(chunk);
+ }
+ _this.push(null);
+ });
+ stream.on('data', function (chunk) {
+ debug('wrapped data');
+ if (state.decoder) chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+ var ret = _this.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function methodWrap(method) {
+ return function methodWrapReturnFunction() {
+ return stream[method].apply(stream, arguments);
+ };
+ }(i);
+ }
+ }
+
+ // proxy certain important events.
+ for (var n = 0; n < kProxyEvents.length; n++) {
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+ }
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ this._read = function (n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+ return this;
+};
+if (typeof Symbol === 'function') {
+ Readable.prototype[Symbol.asyncIterator] = function () {
+ if (createReadableStreamAsyncIterator === undefined) {
+ createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');
+ }
+ return createReadableStreamAsyncIterator(this);
+ };
+}
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._readableState.highWaterMark;
+ }
+});
+Object.defineProperty(Readable.prototype, 'readableBuffer', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._readableState && this._readableState.buffer;
+ }
+});
+Object.defineProperty(Readable.prototype, 'readableFlowing', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._readableState.flowing;
+ },
+ set: function set(state) {
+ if (this._readableState) {
+ this._readableState.flowing = state;
+ }
+ }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+Object.defineProperty(Readable.prototype, 'readableLength', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._readableState.length;
+ }
+});
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+ // nothing buffered
+ if (state.length === 0) return null;
+ var ret;
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+ // read it all, truncate the list
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
+ state.buffer.clear();
+ } else {
+ // read part of list
+ ret = state.buffer.consume(n, state.decoder);
+ }
+ return ret;
+}
+function endReadable(stream) {
+ var state = stream._readableState;
+ debug('endReadable', state.endEmitted);
+ if (!state.endEmitted) {
+ state.ended = true;
+ process.nextTick(endReadableNT, state, stream);
+ }
+}
+function endReadableNT(state, stream) {
+ debug('endReadableNT', state.endEmitted, state.length);
+
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ if (state.autoDestroy) {
+ // In case of duplex streams we need a way to detect
+ // if the writable side is ready for autoDestroy as well
+ var wState = stream._writableState;
+ if (!wState || wState.autoDestroy && wState.finished) {
+ stream.destroy();
+ }
+ }
+ }
+}
+if (typeof Symbol === 'function') {
+ Readable.from = function (iterable, opts) {
+ if (from === undefined) {
+ from = require('./internal/streams/from');
+ }
+ return from(Readable, iterable, opts);
+ };
+}
+function indexOf(xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000000000000000000000000000000000000..1ccb7157be8b8c35df891c2c0905685a144a2e9a
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,190 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+var _require$codes = require('../errors').codes,
+ ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
+ ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
+ ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
+ ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
+var Duplex = require('./_stream_duplex');
+require('inherits')(Transform, Duplex);
+function afterTransform(er, data) {
+ var ts = this._transformState;
+ ts.transforming = false;
+ var cb = ts.writecb;
+ if (cb === null) {
+ return this.emit('error', new ERR_MULTIPLE_CALLBACK());
+ }
+ ts.writechunk = null;
+ ts.writecb = null;
+ if (data != null)
+ // single equals check for both `null` and `undefined`
+ this.push(data);
+ cb(er);
+ var rs = this._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ this._read(rs.highWaterMark);
+ }
+}
+function Transform(options) {
+ if (!(this instanceof Transform)) return new Transform(options);
+ Duplex.call(this, options);
+ this._transformState = {
+ afterTransform: afterTransform.bind(this),
+ needTransform: false,
+ transforming: false,
+ writecb: null,
+ writechunk: null,
+ writeencoding: null
+ };
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+ if (options) {
+ if (typeof options.transform === 'function') this._transform = options.transform;
+ if (typeof options.flush === 'function') this._flush = options.flush;
+ }
+
+ // When the writable side finishes, then flush out anything remaining.
+ this.on('prefinish', prefinish);
+}
+function prefinish() {
+ var _this = this;
+ if (typeof this._flush === 'function' && !this._readableState.destroyed) {
+ this._flush(function (er, data) {
+ done(_this, er, data);
+ });
+ } else {
+ done(this, null, null);
+ }
+}
+Transform.prototype.push = function (chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+ cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
+};
+Transform.prototype._write = function (chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+ var ts = this._transformState;
+ if (ts.writechunk !== null && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+Transform.prototype._destroy = function (err, cb) {
+ Duplex.prototype._destroy.call(this, err, function (err2) {
+ cb(err2);
+ });
+};
+function done(stream, er, data) {
+ if (er) return stream.emit('error', er);
+ if (data != null)
+ // single equals check for both `null` and `undefined`
+ stream.push(data);
+
+ // TODO(BridgeAR): Write a test for these two error cases
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
+ if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
+ return stream.push(null);
+}
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000000000000000000000000000000000000..292415e23a192be6b7a7f35db37befa489117552
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,641 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+module.exports = Writable;
+
+/* */
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+ this.next = null;
+ this.entry = null;
+ this.finish = function () {
+ onCorkedFinish(_this, state);
+ };
+}
+/* */
+
+/**/
+var Duplex;
+/**/
+
+Writable.WritableState = WritableState;
+
+/**/
+var internalUtil = {
+ deprecate: require('util-deprecate')
+};
+/**/
+
+/**/
+var Stream = require('./internal/streams/stream');
+/**/
+
+var Buffer = require('buffer').Buffer;
+var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+var destroyImpl = require('./internal/streams/destroy');
+var _require = require('./internal/streams/state'),
+ getHighWaterMark = _require.getHighWaterMark;
+var _require$codes = require('../errors').codes,
+ ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
+ ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
+ ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
+ ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
+ ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
+ ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
+ ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
+ ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
+var errorOrDestroy = destroyImpl.errorOrDestroy;
+require('inherits')(Writable, Stream);
+function nop() {}
+function WritableState(options, stream, isDuplex) {
+ Duplex = Duplex || require('./_stream_duplex');
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream,
+ // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
+ if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);
+
+ // if _final has been called
+ this.finalCalled = false;
+
+ // drain event flag.
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // Should close be emitted on destroy. Defaults to true.
+ this.emitClose = options.emitClose !== false;
+
+ // Should .destroy() be called after 'finish' (and potentially 'end')
+ this.autoDestroy = !!options.autoDestroy;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // allocate the first CorkedRequest, there is always
+ // one allocated and free to use, and we maintain at most two
+ this.corkedRequestsFree = new CorkedRequest(this);
+}
+WritableState.prototype.getBuffer = function getBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function writableStateBufferGetter() {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+ });
+ } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+ realHasInstance = Function.prototype[Symbol.hasInstance];
+ Object.defineProperty(Writable, Symbol.hasInstance, {
+ value: function value(object) {
+ if (realHasInstance.call(this, object)) return true;
+ if (this !== Writable) return false;
+ return object && object._writableState instanceof WritableState;
+ }
+ });
+} else {
+ realHasInstance = function realHasInstance(object) {
+ return object instanceof this;
+ };
+}
+function Writable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, too.
+ // `realHasInstance` is necessary because using plain `instanceof`
+ // would return false, as no `_writableState` property is attached.
+
+ // Trying to use the custom `instanceof` for Writable here will also break the
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
+ // `_writableState` that would lead to infinite recursion.
+
+ // Checking for a Stream.Duplex instance is faster here instead of inside
+ // the WritableState constructor, at least with V8 6.5
+ var isDuplex = this instanceof Duplex;
+ if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
+ this._writableState = new WritableState(options, this, isDuplex);
+
+ // legacy.
+ this.writable = true;
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+ if (typeof options.writev === 'function') this._writev = options.writev;
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+ if (typeof options.final === 'function') this._final = options.final;
+ }
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
+};
+function writeAfterEnd(stream, cb) {
+ var er = new ERR_STREAM_WRITE_AFTER_END();
+ // TODO: defer error events consistently everywhere, not just the cb
+ errorOrDestroy(stream, er);
+ process.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+ var er;
+ if (chunk === null) {
+ er = new ERR_STREAM_NULL_VALUES();
+ } else if (typeof chunk !== 'string' && !state.objectMode) {
+ er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
+ }
+ if (er) {
+ errorOrDestroy(stream, er);
+ process.nextTick(cb, er);
+ return false;
+ }
+ return true;
+}
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
+ if (isBuf && !Buffer.isBuffer(chunk)) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+ if (typeof cb !== 'function') cb = nop;
+ if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ }
+ return ret;
+};
+Writable.prototype.cork = function () {
+ this._writableState.corked++;
+};
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+ if (state.corked) {
+ state.corked--;
+ if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
+ this._writableState.defaultEncoding = encoding;
+ return this;
+};
+Object.defineProperty(Writable.prototype, 'writableBuffer', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState && this._writableState.getBuffer();
+ }
+});
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = Buffer.from(chunk, encoding);
+ }
+ return chunk;
+}
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+ if (!isBuf) {
+ var newChunk = decodeChunk(state, chunk, encoding);
+ if (chunk !== newChunk) {
+ isBuf = true;
+ encoding = 'buffer';
+ chunk = newChunk;
+ }
+ }
+ var len = state.objectMode ? 1 : chunk.length;
+ state.length += len;
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = {
+ chunk: chunk,
+ encoding: encoding,
+ isBuf: isBuf,
+ callback: cb,
+ next: null
+ };
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+ return ret;
+}
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+ if (sync) {
+ // defer the callback if we are being called synchronously
+ // to avoid piling up things on the stack
+ process.nextTick(cb, er);
+ // this can emit finish, and it will always happen
+ // after error
+ process.nextTick(finishMaybe, stream, state);
+ stream._writableState.errorEmitted = true;
+ errorOrDestroy(stream, er);
+ } else {
+ // the caller expect this to happen before if
+ // it is async
+ cb(er);
+ stream._writableState.errorEmitted = true;
+ errorOrDestroy(stream, er);
+ // this can emit finish, but finish must
+ // always follow error
+ finishMaybe(stream, state);
+ }
+}
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+ if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
+ onwriteStateUpdate(state);
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state) || stream.destroyed;
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+ if (sync) {
+ process.nextTick(afterWrite, stream, state, finished, cb);
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+ var count = 0;
+ var allBuffers = true;
+ while (entry) {
+ buffer[count] = entry;
+ if (!entry.isBuf) allBuffers = false;
+ entry = entry.next;
+ count += 1;
+ }
+ buffer.allBuffers = allBuffers;
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is almost always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ if (holder.next) {
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ state.corkedRequestsFree = new CorkedRequest(state);
+ }
+ state.bufferedRequestCount = 0;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ state.bufferedRequestCount--;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
+};
+Writable.prototype._writev = null;
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending) endWritable(this, state, cb);
+ return this;
+};
+Object.defineProperty(Writable.prototype, 'writableLength', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ return this._writableState.length;
+ }
+});
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+ stream._final(function (err) {
+ state.pendingcb--;
+ if (err) {
+ errorOrDestroy(stream, err);
+ }
+ state.prefinished = true;
+ stream.emit('prefinish');
+ finishMaybe(stream, state);
+ });
+}
+function prefinish(stream, state) {
+ if (!state.prefinished && !state.finalCalled) {
+ if (typeof stream._final === 'function' && !state.destroyed) {
+ state.pendingcb++;
+ state.finalCalled = true;
+ process.nextTick(callFinal, stream, state);
+ } else {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+ }
+}
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ prefinish(stream, state);
+ if (state.pendingcb === 0) {
+ state.finished = true;
+ stream.emit('finish');
+ if (state.autoDestroy) {
+ // In case of duplex streams we need a way to detect
+ // if the readable side is ready for autoDestroy as well
+ var rState = stream._readableState;
+ if (!rState || rState.autoDestroy && rState.endEmitted) {
+ stream.destroy();
+ }
+ }
+ }
+ }
+ return need;
+}
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+function onCorkedFinish(corkReq, state, err) {
+ var entry = corkReq.entry;
+ corkReq.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+
+ // reuse the free corkReq.
+ state.corkedRequestsFree.next = corkReq;
+}
+Object.defineProperty(Writable.prototype, 'destroyed', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function get() {
+ if (this._writableState === undefined) {
+ return false;
+ }
+ return this._writableState.destroyed;
+ },
+ set: function set(value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._writableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._writableState.destroyed = value;
+ }
+});
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+ cb(err);
+};
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js
new file mode 100644
index 0000000000000000000000000000000000000000..742c5a4674794d9e7667c02dcbeb44bf8001b4d6
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js
@@ -0,0 +1,180 @@
+'use strict';
+
+var _Object$setPrototypeO;
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
+function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
+var finished = require('./end-of-stream');
+var kLastResolve = Symbol('lastResolve');
+var kLastReject = Symbol('lastReject');
+var kError = Symbol('error');
+var kEnded = Symbol('ended');
+var kLastPromise = Symbol('lastPromise');
+var kHandlePromise = Symbol('handlePromise');
+var kStream = Symbol('stream');
+function createIterResult(value, done) {
+ return {
+ value: value,
+ done: done
+ };
+}
+function readAndResolve(iter) {
+ var resolve = iter[kLastResolve];
+ if (resolve !== null) {
+ var data = iter[kStream].read();
+ // we defer if data is null
+ // we can be expecting either 'end' or
+ // 'error'
+ if (data !== null) {
+ iter[kLastPromise] = null;
+ iter[kLastResolve] = null;
+ iter[kLastReject] = null;
+ resolve(createIterResult(data, false));
+ }
+ }
+}
+function onReadable(iter) {
+ // we wait for the next tick, because it might
+ // emit an error with process.nextTick
+ process.nextTick(readAndResolve, iter);
+}
+function wrapForNext(lastPromise, iter) {
+ return function (resolve, reject) {
+ lastPromise.then(function () {
+ if (iter[kEnded]) {
+ resolve(createIterResult(undefined, true));
+ return;
+ }
+ iter[kHandlePromise](resolve, reject);
+ }, reject);
+ };
+}
+var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
+var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
+ get stream() {
+ return this[kStream];
+ },
+ next: function next() {
+ var _this = this;
+ // if we have detected an error in the meanwhile
+ // reject straight away
+ var error = this[kError];
+ if (error !== null) {
+ return Promise.reject(error);
+ }
+ if (this[kEnded]) {
+ return Promise.resolve(createIterResult(undefined, true));
+ }
+ if (this[kStream].destroyed) {
+ // We need to defer via nextTick because if .destroy(err) is
+ // called, the error will be emitted via nextTick, and
+ // we cannot guarantee that there is no error lingering around
+ // waiting to be emitted.
+ return new Promise(function (resolve, reject) {
+ process.nextTick(function () {
+ if (_this[kError]) {
+ reject(_this[kError]);
+ } else {
+ resolve(createIterResult(undefined, true));
+ }
+ });
+ });
+ }
+
+ // if we have multiple next() calls
+ // we will wait for the previous Promise to finish
+ // this logic is optimized to support for await loops,
+ // where next() is only called once at a time
+ var lastPromise = this[kLastPromise];
+ var promise;
+ if (lastPromise) {
+ promise = new Promise(wrapForNext(lastPromise, this));
+ } else {
+ // fast path needed to support multiple this.push()
+ // without triggering the next() queue
+ var data = this[kStream].read();
+ if (data !== null) {
+ return Promise.resolve(createIterResult(data, false));
+ }
+ promise = new Promise(this[kHandlePromise]);
+ }
+ this[kLastPromise] = promise;
+ return promise;
+ }
+}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
+ return this;
+}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
+ var _this2 = this;
+ // destroy(err, cb) is a private API
+ // we can guarantee we have that here, because we control the
+ // Readable class this is attached to
+ return new Promise(function (resolve, reject) {
+ _this2[kStream].destroy(null, function (err) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(createIterResult(undefined, true));
+ });
+ });
+}), _Object$setPrototypeO), AsyncIteratorPrototype);
+var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
+ var _Object$create;
+ var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
+ value: stream,
+ writable: true
+ }), _defineProperty(_Object$create, kLastResolve, {
+ value: null,
+ writable: true
+ }), _defineProperty(_Object$create, kLastReject, {
+ value: null,
+ writable: true
+ }), _defineProperty(_Object$create, kError, {
+ value: null,
+ writable: true
+ }), _defineProperty(_Object$create, kEnded, {
+ value: stream._readableState.endEmitted,
+ writable: true
+ }), _defineProperty(_Object$create, kHandlePromise, {
+ value: function value(resolve, reject) {
+ var data = iterator[kStream].read();
+ if (data) {
+ iterator[kLastPromise] = null;
+ iterator[kLastResolve] = null;
+ iterator[kLastReject] = null;
+ resolve(createIterResult(data, false));
+ } else {
+ iterator[kLastResolve] = resolve;
+ iterator[kLastReject] = reject;
+ }
+ },
+ writable: true
+ }), _Object$create));
+ iterator[kLastPromise] = null;
+ finished(stream, function (err) {
+ if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
+ var reject = iterator[kLastReject];
+ // reject if we are waiting for data in the Promise
+ // returned by next() and store the error
+ if (reject !== null) {
+ iterator[kLastPromise] = null;
+ iterator[kLastResolve] = null;
+ iterator[kLastReject] = null;
+ reject(err);
+ }
+ iterator[kError] = err;
+ return;
+ }
+ var resolve = iterator[kLastResolve];
+ if (resolve !== null) {
+ iterator[kLastPromise] = null;
+ iterator[kLastResolve] = null;
+ iterator[kLastReject] = null;
+ resolve(createIterResult(undefined, true));
+ }
+ iterator[kEnded] = true;
+ });
+ stream.on('readable', onReadable.bind(null, iterator));
+ return iterator;
+};
+module.exports = createReadableStreamAsyncIterator;
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js
new file mode 100644
index 0000000000000000000000000000000000000000..69bda497d35f347f1a510eef0fe2408e8d31923c
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js
@@ -0,0 +1,183 @@
+'use strict';
+
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
+function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
+var _require = require('buffer'),
+ Buffer = _require.Buffer;
+var _require2 = require('util'),
+ inspect = _require2.inspect;
+var custom = inspect && inspect.custom || 'inspect';
+function copyBuffer(src, target, offset) {
+ Buffer.prototype.copy.call(src, target, offset);
+}
+module.exports = /*#__PURE__*/function () {
+ function BufferList() {
+ _classCallCheck(this, BufferList);
+ this.head = null;
+ this.tail = null;
+ this.length = 0;
+ }
+ _createClass(BufferList, [{
+ key: "push",
+ value: function push(v) {
+ var entry = {
+ data: v,
+ next: null
+ };
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
+ this.tail = entry;
+ ++this.length;
+ }
+ }, {
+ key: "unshift",
+ value: function unshift(v) {
+ var entry = {
+ data: v,
+ next: this.head
+ };
+ if (this.length === 0) this.tail = entry;
+ this.head = entry;
+ ++this.length;
+ }
+ }, {
+ key: "shift",
+ value: function shift() {
+ if (this.length === 0) return;
+ var ret = this.head.data;
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+ --this.length;
+ return ret;
+ }
+ }, {
+ key: "clear",
+ value: function clear() {
+ this.head = this.tail = null;
+ this.length = 0;
+ }
+ }, {
+ key: "join",
+ value: function join(s) {
+ if (this.length === 0) return '';
+ var p = this.head;
+ var ret = '' + p.data;
+ while (p = p.next) ret += s + p.data;
+ return ret;
+ }
+ }, {
+ key: "concat",
+ value: function concat(n) {
+ if (this.length === 0) return Buffer.alloc(0);
+ var ret = Buffer.allocUnsafe(n >>> 0);
+ var p = this.head;
+ var i = 0;
+ while (p) {
+ copyBuffer(p.data, ret, i);
+ i += p.data.length;
+ p = p.next;
+ }
+ return ret;
+ }
+
+ // Consumes a specified amount of bytes or characters from the buffered data.
+ }, {
+ key: "consume",
+ value: function consume(n, hasStrings) {
+ var ret;
+ if (n < this.head.data.length) {
+ // `slice` is the same for buffers and strings.
+ ret = this.head.data.slice(0, n);
+ this.head.data = this.head.data.slice(n);
+ } else if (n === this.head.data.length) {
+ // First chunk is a perfect match.
+ ret = this.shift();
+ } else {
+ // Result spans more than one buffer.
+ ret = hasStrings ? this._getString(n) : this._getBuffer(n);
+ }
+ return ret;
+ }
+ }, {
+ key: "first",
+ value: function first() {
+ return this.head.data;
+ }
+
+ // Consumes a specified amount of characters from the buffered data.
+ }, {
+ key: "_getString",
+ value: function _getString(n) {
+ var p = this.head;
+ var c = 1;
+ var ret = p.data;
+ n -= ret.length;
+ while (p = p.next) {
+ var str = p.data;
+ var nb = n > str.length ? str.length : n;
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
+ n -= nb;
+ if (n === 0) {
+ if (nb === str.length) {
+ ++c;
+ if (p.next) this.head = p.next;else this.head = this.tail = null;
+ } else {
+ this.head = p;
+ p.data = str.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ this.length -= c;
+ return ret;
+ }
+
+ // Consumes a specified amount of bytes from the buffered data.
+ }, {
+ key: "_getBuffer",
+ value: function _getBuffer(n) {
+ var ret = Buffer.allocUnsafe(n);
+ var p = this.head;
+ var c = 1;
+ p.data.copy(ret);
+ n -= p.data.length;
+ while (p = p.next) {
+ var buf = p.data;
+ var nb = n > buf.length ? buf.length : n;
+ buf.copy(ret, ret.length - n, 0, nb);
+ n -= nb;
+ if (n === 0) {
+ if (nb === buf.length) {
+ ++c;
+ if (p.next) this.head = p.next;else this.head = this.tail = null;
+ } else {
+ this.head = p;
+ p.data = buf.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ this.length -= c;
+ return ret;
+ }
+
+ // Make sure the linked list only shows the minimal necessary information.
+ }, {
+ key: custom,
+ value: function value(_, options) {
+ return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
+ // Only inspect one level.
+ depth: 0,
+ // It should not recurse.
+ customInspect: false
+ }));
+ }
+ }]);
+ return BufferList;
+}();
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644
index 0000000000000000000000000000000000000000..31a17c4dc463880722098b62598fe21bc9672132
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js
@@ -0,0 +1,96 @@
+'use strict';
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+ var _this = this;
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
+ if (readableDestroyed || writableDestroyed) {
+ if (cb) {
+ cb(err);
+ } else if (err) {
+ if (!this._writableState) {
+ process.nextTick(emitErrorNT, this, err);
+ } else if (!this._writableState.errorEmitted) {
+ this._writableState.errorEmitted = true;
+ process.nextTick(emitErrorNT, this, err);
+ }
+ }
+ return this;
+ }
+
+ // we set destroyed to true before firing error callbacks in order
+ // to make it re-entrance safe in case destroy() is called within callbacks
+
+ if (this._readableState) {
+ this._readableState.destroyed = true;
+ }
+
+ // if this is a duplex stream mark the writable part as destroyed as well
+ if (this._writableState) {
+ this._writableState.destroyed = true;
+ }
+ this._destroy(err || null, function (err) {
+ if (!cb && err) {
+ if (!_this._writableState) {
+ process.nextTick(emitErrorAndCloseNT, _this, err);
+ } else if (!_this._writableState.errorEmitted) {
+ _this._writableState.errorEmitted = true;
+ process.nextTick(emitErrorAndCloseNT, _this, err);
+ } else {
+ process.nextTick(emitCloseNT, _this);
+ }
+ } else if (cb) {
+ process.nextTick(emitCloseNT, _this);
+ cb(err);
+ } else {
+ process.nextTick(emitCloseNT, _this);
+ }
+ });
+ return this;
+}
+function emitErrorAndCloseNT(self, err) {
+ emitErrorNT(self, err);
+ emitCloseNT(self);
+}
+function emitCloseNT(self) {
+ if (self._writableState && !self._writableState.emitClose) return;
+ if (self._readableState && !self._readableState.emitClose) return;
+ self.emit('close');
+}
+function undestroy() {
+ if (this._readableState) {
+ this._readableState.destroyed = false;
+ this._readableState.reading = false;
+ this._readableState.ended = false;
+ this._readableState.endEmitted = false;
+ }
+ if (this._writableState) {
+ this._writableState.destroyed = false;
+ this._writableState.ended = false;
+ this._writableState.ending = false;
+ this._writableState.finalCalled = false;
+ this._writableState.prefinished = false;
+ this._writableState.finished = false;
+ this._writableState.errorEmitted = false;
+ }
+}
+function emitErrorNT(self, err) {
+ self.emit('error', err);
+}
+function errorOrDestroy(stream, err) {
+ // We have tests that rely on errors being emitted
+ // in the same tick, so changing this is semver major.
+ // For now when you opt-in to autoDestroy we allow
+ // the error to be emitted nextTick. In a future
+ // semver major update we should change the default to this.
+
+ var rState = stream._readableState;
+ var wState = stream._writableState;
+ if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
+}
+module.exports = {
+ destroy: destroy,
+ undestroy: undestroy,
+ errorOrDestroy: errorOrDestroy
+};
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..59c671b5af769bc5797843837056ae419ab22e80
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
@@ -0,0 +1,86 @@
+// Ported from https://github.com/mafintosh/end-of-stream with
+// permission from the author, Mathias Buus (@mafintosh).
+
+'use strict';
+
+var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;
+function once(callback) {
+ var called = false;
+ return function () {
+ if (called) return;
+ called = true;
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+ callback.apply(this, args);
+ };
+}
+function noop() {}
+function isRequest(stream) {
+ return stream.setHeader && typeof stream.abort === 'function';
+}
+function eos(stream, opts, callback) {
+ if (typeof opts === 'function') return eos(stream, null, opts);
+ if (!opts) opts = {};
+ callback = once(callback || noop);
+ var readable = opts.readable || opts.readable !== false && stream.readable;
+ var writable = opts.writable || opts.writable !== false && stream.writable;
+ var onlegacyfinish = function onlegacyfinish() {
+ if (!stream.writable) onfinish();
+ };
+ var writableEnded = stream._writableState && stream._writableState.finished;
+ var onfinish = function onfinish() {
+ writable = false;
+ writableEnded = true;
+ if (!readable) callback.call(stream);
+ };
+ var readableEnded = stream._readableState && stream._readableState.endEmitted;
+ var onend = function onend() {
+ readable = false;
+ readableEnded = true;
+ if (!writable) callback.call(stream);
+ };
+ var onerror = function onerror(err) {
+ callback.call(stream, err);
+ };
+ var onclose = function onclose() {
+ var err;
+ if (readable && !readableEnded) {
+ if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
+ return callback.call(stream, err);
+ }
+ if (writable && !writableEnded) {
+ if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
+ return callback.call(stream, err);
+ }
+ };
+ var onrequest = function onrequest() {
+ stream.req.on('finish', onfinish);
+ };
+ if (isRequest(stream)) {
+ stream.on('complete', onfinish);
+ stream.on('abort', onclose);
+ if (stream.req) onrequest();else stream.on('request', onrequest);
+ } else if (writable && !stream._writableState) {
+ // legacy streams
+ stream.on('end', onlegacyfinish);
+ stream.on('close', onlegacyfinish);
+ }
+ stream.on('end', onend);
+ stream.on('finish', onfinish);
+ if (opts.error !== false) stream.on('error', onerror);
+ stream.on('close', onclose);
+ return function () {
+ stream.removeListener('complete', onfinish);
+ stream.removeListener('abort', onclose);
+ stream.removeListener('request', onrequest);
+ if (stream.req) stream.req.removeListener('finish', onfinish);
+ stream.removeListener('end', onlegacyfinish);
+ stream.removeListener('close', onlegacyfinish);
+ stream.removeListener('finish', onfinish);
+ stream.removeListener('end', onend);
+ stream.removeListener('error', onerror);
+ stream.removeListener('close', onclose);
+ };
+}
+module.exports = eos;
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..a4ce56f3c90f60d3416e8e0328375c4b20213872
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js
@@ -0,0 +1,3 @@
+module.exports = function () {
+ throw new Error('Readable.from is not available in the browser')
+};
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from.js
new file mode 100644
index 0000000000000000000000000000000000000000..0a34ee92e3df85fd31734c3d95a43697df8fbbb9
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from.js
@@ -0,0 +1,52 @@
+'use strict';
+
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
+function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
+var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE;
+function from(Readable, iterable, opts) {
+ var iterator;
+ if (iterable && typeof iterable.next === 'function') {
+ iterator = iterable;
+ } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable);
+ var readable = new Readable(_objectSpread({
+ objectMode: true
+ }, opts));
+ // Reading boolean to protect against _read
+ // being called before last iteration completion.
+ var reading = false;
+ readable._read = function () {
+ if (!reading) {
+ reading = true;
+ next();
+ }
+ };
+ function next() {
+ return _next2.apply(this, arguments);
+ }
+ function _next2() {
+ _next2 = _asyncToGenerator(function* () {
+ try {
+ var _yield$iterator$next = yield iterator.next(),
+ value = _yield$iterator$next.value,
+ done = _yield$iterator$next.done;
+ if (done) {
+ readable.push(null);
+ } else if (readable.push(yield value)) {
+ next();
+ } else {
+ reading = false;
+ }
+ } catch (err) {
+ readable.destroy(err);
+ }
+ });
+ return _next2.apply(this, arguments);
+ }
+ return readable;
+}
+module.exports = from;
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6f39241f98dd890dda9d4dbea076540ed43cabc
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js
@@ -0,0 +1,86 @@
+// Ported from https://github.com/mafintosh/pump with
+// permission from the author, Mathias Buus (@mafintosh).
+
+'use strict';
+
+var eos;
+function once(callback) {
+ var called = false;
+ return function () {
+ if (called) return;
+ called = true;
+ callback.apply(void 0, arguments);
+ };
+}
+var _require$codes = require('../../../errors').codes,
+ ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
+ ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
+function noop(err) {
+ // Rethrow the error if it exists to avoid swallowing it
+ if (err) throw err;
+}
+function isRequest(stream) {
+ return stream.setHeader && typeof stream.abort === 'function';
+}
+function destroyer(stream, reading, writing, callback) {
+ callback = once(callback);
+ var closed = false;
+ stream.on('close', function () {
+ closed = true;
+ });
+ if (eos === undefined) eos = require('./end-of-stream');
+ eos(stream, {
+ readable: reading,
+ writable: writing
+ }, function (err) {
+ if (err) return callback(err);
+ closed = true;
+ callback();
+ });
+ var destroyed = false;
+ return function (err) {
+ if (closed) return;
+ if (destroyed) return;
+ destroyed = true;
+
+ // request.destroy just do .end - .abort is what we want
+ if (isRequest(stream)) return stream.abort();
+ if (typeof stream.destroy === 'function') return stream.destroy();
+ callback(err || new ERR_STREAM_DESTROYED('pipe'));
+ };
+}
+function call(fn) {
+ fn();
+}
+function pipe(from, to) {
+ return from.pipe(to);
+}
+function popCallback(streams) {
+ if (!streams.length) return noop;
+ if (typeof streams[streams.length - 1] !== 'function') return noop;
+ return streams.pop();
+}
+function pipeline() {
+ for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
+ streams[_key] = arguments[_key];
+ }
+ var callback = popCallback(streams);
+ if (Array.isArray(streams[0])) streams = streams[0];
+ if (streams.length < 2) {
+ throw new ERR_MISSING_ARGS('streams');
+ }
+ var error;
+ var destroys = streams.map(function (stream, i) {
+ var reading = i < streams.length - 1;
+ var writing = i > 0;
+ return destroyer(stream, reading, writing, function (err) {
+ if (!error) error = err;
+ if (err) destroys.forEach(call);
+ if (reading) return;
+ destroys.forEach(call);
+ callback(error);
+ });
+ });
+ return streams.reduce(pipe);
+}
+module.exports = pipeline;
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/state.js
new file mode 100644
index 0000000000000000000000000000000000000000..3fbf8927e00179deca5a8855b4b4c17da9450676
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/state.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
+function highWaterMarkFrom(options, isDuplex, duplexKey) {
+ return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
+}
+function getHighWaterMark(state, options, duplexKey, isDuplex) {
+ var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
+ if (hwm != null) {
+ if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
+ var name = isDuplex ? duplexKey : 'highWaterMark';
+ throw new ERR_INVALID_OPT_VALUE(name, hwm);
+ }
+ return Math.floor(hwm);
+ }
+
+ // Default value
+ return state.objectMode ? 16 : 16 * 1024;
+}
+module.exports = {
+ getHighWaterMark: getHighWaterMark
+};
\ No newline at end of file
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..9332a3fdae7060505c0a081614e697fa6cb56dc0
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..ce2ad5b6ee57f4778a1f4838f7970093c7941c1c
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/node_modules/concat-stream/node_modules/readable-stream/package.json b/node_modules/concat-stream/node_modules/readable-stream/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..ade59e71aa0f170b4ec49a32cf0d04ab5f73ad86
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "readable-stream",
+ "version": "3.6.2",
+ "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "main": "readable.js",
+ "engines": {
+ "node": ">= 6"
+ },
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "devDependencies": {
+ "@babel/cli": "^7.2.0",
+ "@babel/core": "^7.2.0",
+ "@babel/polyfill": "^7.0.0",
+ "@babel/preset-env": "^7.2.0",
+ "airtap": "0.0.9",
+ "assert": "^1.4.0",
+ "bl": "^2.0.0",
+ "deep-strict-equal": "^0.2.0",
+ "events.once": "^2.0.2",
+ "glob": "^7.1.2",
+ "gunzip-maybe": "^1.4.1",
+ "hyperquest": "^2.1.3",
+ "lolex": "^2.6.0",
+ "nyc": "^11.0.0",
+ "pump": "^3.0.0",
+ "rimraf": "^2.6.2",
+ "tap": "^12.0.0",
+ "tape": "^4.9.0",
+ "tar-fs": "^1.16.2",
+ "util-promisify": "^2.1.0"
+ },
+ "scripts": {
+ "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js",
+ "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap",
+ "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js",
+ "test-browser-local": "airtap --open --local -- test/browser.js",
+ "cover": "nyc npm test",
+ "report": "nyc report --reporter=lcov",
+ "update-browser-errors": "babel -o errors-browser.js errors.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream"
+ },
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "browser": {
+ "util": false,
+ "worker_threads": false,
+ "./errors": "./errors-browser.js",
+ "./readable.js": "./readable-browser.js",
+ "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js",
+ "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+ },
+ "nyc": {
+ "include": [
+ "lib/**.js"
+ ]
+ },
+ "license": "MIT"
+}
diff --git a/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js b/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..adbf60de832f9d6e066625f09d708670291e1bfd
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js
@@ -0,0 +1,9 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
+exports.finished = require('./lib/internal/streams/end-of-stream.js');
+exports.pipeline = require('./lib/internal/streams/pipeline.js');
diff --git a/node_modules/concat-stream/node_modules/readable-stream/readable.js b/node_modules/concat-stream/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e0ca120ded827e5ba3343f826fa7462a841e092
--- /dev/null
+++ b/node_modules/concat-stream/node_modules/readable-stream/readable.js
@@ -0,0 +1,16 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+ module.exports = Stream.Readable;
+ Object.assign(module.exports, Stream);
+ module.exports.Stream = Stream;
+} else {
+ exports = module.exports = require('./lib/_stream_readable.js');
+ exports.Stream = Stream || exports;
+ exports.Readable = exports;
+ exports.Writable = require('./lib/_stream_writable.js');
+ exports.Duplex = require('./lib/_stream_duplex.js');
+ exports.Transform = require('./lib/_stream_transform.js');
+ exports.PassThrough = require('./lib/_stream_passthrough.js');
+ exports.finished = require('./lib/internal/streams/end-of-stream.js');
+ exports.pipeline = require('./lib/internal/streams/pipeline.js');
+}
diff --git a/node_modules/concat-stream/package.json b/node_modules/concat-stream/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..379782860f581fdb3f7c4b371f395a57d2a459ee
--- /dev/null
+++ b/node_modules/concat-stream/package.json
@@ -0,0 +1,55 @@
+{
+ "name": "concat-stream",
+ "version": "2.0.0",
+ "description": "writable stream that concatenates strings or binary data and calls a callback with the result",
+ "tags": [
+ "stream",
+ "simple",
+ "util",
+ "utility"
+ ],
+ "author": "Max Ogden ",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/maxogden/concat-stream.git"
+ },
+ "bugs": {
+ "url": "http://github.com/maxogden/concat-stream/issues"
+ },
+ "engines": [
+ "node >= 6.0"
+ ],
+ "main": "index.js",
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "test": "tape test/*.js test/server/*.js"
+ },
+ "license": "MIT",
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^3.0.2",
+ "typedarray": "^0.0.6"
+ },
+ "devDependencies": {
+ "tape": "^4.6.3"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/17..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ }
+}
diff --git a/node_modules/concat-stream/readme.md b/node_modules/concat-stream/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..7aa19c4fb104c31236f8419f421f848d7159ef8d
--- /dev/null
+++ b/node_modules/concat-stream/readme.md
@@ -0,0 +1,102 @@
+# concat-stream
+
+Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer.
+
+[](https://travis-ci.org/maxogden/concat-stream)
+
+[](https://nodei.co/npm/concat-stream/)
+
+### description
+
+Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.
+
+Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).
+
+There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.
+
+## Related
+
+`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
+
+### examples
+
+#### Buffers
+
+```js
+var fs = require('fs')
+var concat = require('concat-stream')
+
+var readStream = fs.createReadStream('cat.png')
+var concatStream = concat(gotPicture)
+
+readStream.on('error', handleError)
+readStream.pipe(concatStream)
+
+function gotPicture(imageBuffer) {
+ // imageBuffer is all of `cat.png` as a node.js Buffer
+}
+
+function handleError(err) {
+ // handle your error appropriately here, e.g.:
+ console.error(err) // print the error to STDERR
+ process.exit(1) // exit program with non-zero exit code
+}
+
+```
+
+#### Arrays
+
+```js
+var write = concat(function(data) {})
+write.write([1,2,3])
+write.write([4,5,6])
+write.end()
+// data will be [1,2,3,4,5,6] in the above callback
+```
+
+#### Uint8Arrays
+
+```js
+var write = concat(function(data) {})
+var a = new Uint8Array(3)
+a[0] = 97; a[1] = 98; a[2] = 99
+write.write(a)
+write.write('!')
+write.end(Buffer.from('!!1'))
+```
+
+See `test/` for more examples
+
+# methods
+
+```js
+var concat = require('concat-stream')
+```
+
+## var writable = concat(opts={}, cb)
+
+Return a `writable` stream that will fire `cb(data)` with all of the data that
+was written to the stream. Data can be written to `writable` as strings,
+Buffers, arrays of byte integers, and Uint8Arrays.
+
+By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason.
+
+* `string` - get a string
+* `buffer` - get back a Buffer
+* `array` - get an array of byte integers
+* `uint8array`, `u8`, `uint8` - get back a Uint8Array
+* `object`, get back an array of Objects
+
+If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.
+
+If nothing is written to `writable` then `data` will be an empty array `[]`.
+
+# error handling
+
+`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors.
+
+We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code.
+
+# license
+
+MIT LICENSE
diff --git a/node_modules/content-disposition/HISTORY.md b/node_modules/content-disposition/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..1a3b308b5ccc1e13b1a24b255faf0766cefa5e10
--- /dev/null
+++ b/node_modules/content-disposition/HISTORY.md
@@ -0,0 +1,72 @@
+1.0.1 / 2025-11-18
+=================
+
+ * Updated `engines` field to Node@18 or higher (fixed reference, see 1.0.0)
+ * Remove dependency `safe-buffer`
+
+1.0.0 / 2024-08-31
+==================
+
+ * drop node <18
+ * allow utf8 as alias for utf-8
+
+0.5.4 / 2021-12-10
+==================
+
+ * deps: safe-buffer@5.2.1
+
+0.5.3 / 2018-12-17
+==================
+
+ * Use `safe-buffer` for improved Buffer API
+
+0.5.2 / 2016-12-08
+==================
+
+ * Fix `parse` to accept any linear whitespace character
+
+0.5.1 / 2016-01-17
+==================
+
+ * perf: enable strict mode
+
+0.5.0 / 2014-10-11
+==================
+
+ * Add `parse` function
+
+0.4.0 / 2014-09-21
+==================
+
+ * Expand non-Unicode `filename` to the full ISO-8859-1 charset
+
+0.3.0 / 2014-09-20
+==================
+
+ * Add `fallback` option
+ * Add `type` option
+
+0.2.0 / 2014-09-19
+==================
+
+ * Reduce ambiguity of file names with hex escape in buggy browsers
+
+0.1.2 / 2014-09-19
+==================
+
+ * Fix periodic invalid Unicode filename header
+
+0.1.1 / 2014-09-19
+==================
+
+ * Fix invalid characters appearing in `filename*` parameter
+
+0.1.0 / 2014-09-18
+==================
+
+ * Make the `filename` argument optional
+
+0.0.0 / 2014-09-18
+==================
+
+ * Initial release
diff --git a/node_modules/content-disposition/LICENSE b/node_modules/content-disposition/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..84441fbb5709262c2bfc9b5ff0166ad4f024a1b8
--- /dev/null
+++ b/node_modules/content-disposition/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/content-disposition/README.md b/node_modules/content-disposition/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..fbedc2f85ebfc13317208745cc52d952b71a2ee2
--- /dev/null
+++ b/node_modules/content-disposition/README.md
@@ -0,0 +1,142 @@
+# content-disposition
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][github-actions-ci-image]][github-actions-ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create and parse HTTP `Content-Disposition` header
+
+## Installation
+
+```sh
+$ npm install content-disposition
+```
+
+## API
+
+```js
+const contentDisposition = require('content-disposition')
+```
+
+### contentDisposition(filename, options)
+
+Create an attachment `Content-Disposition` header value using the given file name,
+if supplied. The `filename` is optional and if no file name is desired, but you
+want to specify `options`, set `filename` to `undefined`.
+
+```js
+res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf'))
+```
+
+**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this
+header through a means different from `setHeader` in Node.js, you'll want to specify
+the `'binary'` encoding in Node.js.
+
+#### Options
+
+`contentDisposition` accepts these properties in the options object.
+
+##### fallback
+
+If the `filename` option is outside ISO-8859-1, then the file name is actually
+stored in a supplemental field for clients that support Unicode file names and
+a ISO-8859-1 version of the file name is automatically generated.
+
+This specifies the ISO-8859-1 file name to override the automatic generation or
+disables the generation all together, defaults to `true`.
+
+ - A string will specify the ISO-8859-1 file name to use in place of automatic
+ generation.
+ - `false` will disable including a ISO-8859-1 file name and only include the
+ Unicode version (unless the file name is already ISO-8859-1).
+ - `true` will enable automatic generation if the file name is outside ISO-8859-1.
+
+If the `filename` option is ISO-8859-1 and this option is specified and has a
+different value, then the `filename` option is encoded in the extended field
+and this set as the fallback field, even though they are both ISO-8859-1.
+
+##### type
+
+Specifies the disposition type, defaults to `"attachment"`. This can also be
+`"inline"`, or any other value (all values except inline are treated like
+`attachment`, but can convey additional information if both parties agree to
+it). The type is normalized to lower-case.
+
+### contentDisposition.parse(string)
+
+```js
+const disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt')
+```
+
+Parse a `Content-Disposition` header string. This automatically handles extended
+("Unicode") parameters by decoding them and providing them under the standard
+parameter name. This will return an object with the following properties (examples
+are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`):
+
+ - `type`: The disposition type (always lower case). Example: `'attachment'`
+
+ - `parameters`: An object of the parameters in the disposition (name of parameter
+ always lower case and extended versions replace non-extended versions). Example:
+ `{filename: "€ rates.txt"}`
+
+## Examples
+
+### Send a file for download
+
+```js
+const contentDisposition = require('content-disposition')
+const destroy = require('destroy')
+const fs = require('fs')
+const http = require('http')
+const onFinished = require('on-finished')
+
+const filePath = '/path/to/public/plans.pdf'
+
+http.createServer(function onRequest (req, res) {
+ // set headers
+ res.setHeader('Content-Type', 'application/pdf')
+ res.setHeader('Content-Disposition', contentDisposition(filePath))
+
+ // send file
+ const stream = fs.createReadStream(filePath)
+ stream.pipe(res)
+ onFinished(res, function () {
+ destroy(stream)
+ })
+})
+```
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## References
+
+- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616]
+- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987]
+- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266]
+- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231]
+
+[rfc-2616]: https://tools.ietf.org/html/rfc2616
+[rfc-5987]: https://tools.ietf.org/html/rfc5987
+[rfc-6266]: https://tools.ietf.org/html/rfc6266
+[tc-2231]: http://greenbytes.de/tech/tc2231/
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/content-disposition
+[npm-url]: https://npmjs.org/package/content-disposition
+[node-version-image]: https://img.shields.io/node/v/content-disposition
+[node-version-url]: https://nodejs.org/en/download
+[coveralls-image]: https://img.shields.io/coverallsCoverage/github/jshttp/content-disposition
+[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/content-disposition
+[downloads-url]: https://npmjs.org/package/content-disposition
+[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-disposition/ci.yml
+[github-actions-ci-url]: https://github.com/jshttp/content-disposition/actions/workflows/ci.yml
diff --git a/node_modules/content-disposition/index.js b/node_modules/content-disposition/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..efcd9ca7513e9a04aeecedf875f47b1ad3aacce9
--- /dev/null
+++ b/node_modules/content-disposition/index.js
@@ -0,0 +1,458 @@
+/*!
+ * content-disposition
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = contentDisposition
+module.exports.parse = parse
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var basename = require('path').basename
+
+/**
+ * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%")
+ * @private
+ */
+
+var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex
+
+/**
+ * RegExp to match percent encoding escape.
+ * @private
+ */
+
+var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/
+var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g
+
+/**
+ * RegExp to match non-latin1 characters.
+ * @private
+ */
+
+var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
+
+/**
+ * RegExp to match quoted-pair in RFC 2616
+ *
+ * quoted-pair = "\" CHAR
+ * CHAR =
+ * @private
+ */
+
+var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex
+
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 2616
+ * @private
+ */
+
+var QUOTE_REGEXP = /([\\"])/g
+
+/**
+ * RegExp for various RFC 2616 grammar
+ *
+ * parameter = token "=" ( token | quoted-string )
+ * token = 1*
+ * separators = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+ * | "{" | "}" | SP | HT
+ * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
+ * qdtext = >
+ * quoted-pair = "\" CHAR
+ * CHAR =
+ * TEXT =
+ * LWS = [CRLF] 1*( SP | HT )
+ * CRLF = CR LF
+ * CR =
+ * LF =
+ * SP =
+ * HT =
+ * CTL =
+ * OCTET =
+ * @private
+ */
+
+var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex
+var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/
+var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
+
+/**
+ * RegExp for various RFC 5987 grammar
+ *
+ * ext-value = charset "'" [ language ] "'" value-chars
+ * charset = "UTF-8" / "ISO-8859-1" / mime-charset
+ * mime-charset = 1*mime-charsetc
+ * mime-charsetc = ALPHA / DIGIT
+ * / "!" / "#" / "$" / "%" / "&"
+ * / "+" / "-" / "^" / "_" / "`"
+ * / "{" / "}" / "~"
+ * language = ( 2*3ALPHA [ extlang ] )
+ * / 4ALPHA
+ * / 5*8ALPHA
+ * extlang = *3( "-" 3ALPHA )
+ * value-chars = *( pct-encoded / attr-char )
+ * pct-encoded = "%" HEXDIG HEXDIG
+ * attr-char = ALPHA / DIGIT
+ * / "!" / "#" / "$" / "&" / "+" / "-" / "."
+ * / "^" / "_" / "`" / "|" / "~"
+ * @private
+ */
+
+var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/
+
+/**
+ * RegExp for various RFC 6266 grammar
+ *
+ * disposition-type = "inline" | "attachment" | disp-ext-type
+ * disp-ext-type = token
+ * disposition-parm = filename-parm | disp-ext-parm
+ * filename-parm = "filename" "=" value
+ * | "filename*" "=" ext-value
+ * disp-ext-parm = token "=" value
+ * | ext-token "=" ext-value
+ * ext-token =
+ * @private
+ */
+
+var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex
+
+/**
+ * Create an attachment Content-Disposition header.
+ *
+ * @param {string} [filename]
+ * @param {object} [options]
+ * @param {string} [options.type=attachment]
+ * @param {string|boolean} [options.fallback=true]
+ * @return {string}
+ * @public
+ */
+
+function contentDisposition (filename, options) {
+ var opts = options || {}
+
+ // get type
+ var type = opts.type || 'attachment'
+
+ // get parameters
+ var params = createparams(filename, opts.fallback)
+
+ // format into string
+ return format(new ContentDisposition(type, params))
+}
+
+/**
+ * Create parameters object from filename and fallback.
+ *
+ * @param {string} [filename]
+ * @param {string|boolean} [fallback=true]
+ * @return {object}
+ * @private
+ */
+
+function createparams (filename, fallback) {
+ if (filename === undefined) {
+ return
+ }
+
+ var params = {}
+
+ if (typeof filename !== 'string') {
+ throw new TypeError('filename must be a string')
+ }
+
+ // fallback defaults to true
+ if (fallback === undefined) {
+ fallback = true
+ }
+
+ if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {
+ throw new TypeError('fallback must be a string or boolean')
+ }
+
+ if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {
+ throw new TypeError('fallback must be ISO-8859-1 string')
+ }
+
+ // restrict to file base name
+ var name = basename(filename)
+
+ // determine if name is suitable for quoted string
+ var isQuotedString = TEXT_REGEXP.test(name)
+
+ // generate fallback name
+ var fallbackName = typeof fallback !== 'string'
+ ? fallback && getlatin1(name)
+ : basename(fallback)
+ var hasFallback = typeof fallbackName === 'string' && fallbackName !== name
+
+ // set extended filename parameter
+ if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
+ params['filename*'] = name
+ }
+
+ // set filename parameter
+ if (isQuotedString || hasFallback) {
+ params.filename = hasFallback
+ ? fallbackName
+ : name
+ }
+
+ return params
+}
+
+/**
+ * Format object to Content-Disposition header.
+ *
+ * @param {object} obj
+ * @param {string} obj.type
+ * @param {object} [obj.parameters]
+ * @return {string}
+ * @private
+ */
+
+function format (obj) {
+ var parameters = obj.parameters
+ var type = obj.type
+
+ if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {
+ throw new TypeError('invalid type')
+ }
+
+ // start with normalized type
+ var string = String(type).toLowerCase()
+
+ // append parameters
+ if (parameters && typeof parameters === 'object') {
+ var param
+ var params = Object.keys(parameters).sort()
+
+ for (var i = 0; i < params.length; i++) {
+ param = params[i]
+
+ var val = param.slice(-1) === '*'
+ ? ustring(parameters[param])
+ : qstring(parameters[param])
+
+ string += '; ' + param + '=' + val
+ }
+ }
+
+ return string
+}
+
+/**
+ * Decode a RFC 5987 field value (gracefully).
+ *
+ * @param {string} str
+ * @return {string}
+ * @private
+ */
+
+function decodefield (str) {
+ var match = EXT_VALUE_REGEXP.exec(str)
+
+ if (!match) {
+ throw new TypeError('invalid extended field value')
+ }
+
+ var charset = match[1].toLowerCase()
+ var encoded = match[2]
+ var value
+
+ // to binary string
+ var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode)
+
+ switch (charset) {
+ case 'iso-8859-1':
+ value = getlatin1(binary)
+ break
+ case 'utf-8':
+ case 'utf8':
+ value = Buffer.from(binary, 'binary').toString('utf8')
+ break
+ default:
+ throw new TypeError('unsupported charset in extended field')
+ }
+
+ return value
+}
+
+/**
+ * Get ISO-8859-1 version of string.
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function getlatin1 (val) {
+ // simple Unicode -> ISO-8859-1 transformation
+ return String(val).replace(NON_LATIN1_REGEXP, '?')
+}
+
+/**
+ * Parse Content-Disposition header string.
+ *
+ * @param {string} string
+ * @return {object}
+ * @public
+ */
+
+function parse (string) {
+ if (!string || typeof string !== 'string') {
+ throw new TypeError('argument string is required')
+ }
+
+ var match = DISPOSITION_TYPE_REGEXP.exec(string)
+
+ if (!match) {
+ throw new TypeError('invalid type format')
+ }
+
+ // normalize type
+ var index = match[0].length
+ var type = match[1].toLowerCase()
+
+ var key
+ var names = []
+ var params = {}
+ var value
+
+ // calculate index to start at
+ index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';'
+ ? index - 1
+ : index
+
+ // match parameters
+ while ((match = PARAM_REGEXP.exec(string))) {
+ if (match.index !== index) {
+ throw new TypeError('invalid parameter format')
+ }
+
+ index += match[0].length
+ key = match[1].toLowerCase()
+ value = match[2]
+
+ if (names.indexOf(key) !== -1) {
+ throw new TypeError('invalid duplicate parameter')
+ }
+
+ names.push(key)
+
+ if (key.indexOf('*') + 1 === key.length) {
+ // decode extended value
+ key = key.slice(0, -1)
+ value = decodefield(value)
+
+ // overwrite existing value
+ params[key] = value
+ continue
+ }
+
+ if (typeof params[key] === 'string') {
+ continue
+ }
+
+ if (value[0] === '"') {
+ // remove quotes and escapes
+ value = value
+ .slice(1, -1)
+ .replace(QESC_REGEXP, '$1')
+ }
+
+ params[key] = value
+ }
+
+ if (index !== -1 && index !== string.length) {
+ throw new TypeError('invalid parameter format')
+ }
+
+ return new ContentDisposition(type, params)
+}
+
+/**
+ * Percent decode a single character.
+ *
+ * @param {string} str
+ * @param {string} hex
+ * @return {string}
+ * @private
+ */
+
+function pdecode (str, hex) {
+ return String.fromCharCode(parseInt(hex, 16))
+}
+
+/**
+ * Percent encode a single character.
+ *
+ * @param {string} char
+ * @return {string}
+ * @private
+ */
+
+function pencode (char) {
+ return '%' + String(char)
+ .charCodeAt(0)
+ .toString(16)
+ .toUpperCase()
+}
+
+/**
+ * Quote a string for HTTP.
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function qstring (val) {
+ var str = String(val)
+
+ return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
+}
+
+/**
+ * Encode a Unicode string for HTTP (RFC 5987).
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function ustring (val) {
+ var str = String(val)
+
+ // percent encode as UTF-8
+ var encoded = encodeURIComponent(str)
+ .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)
+
+ return 'UTF-8\'\'' + encoded
+}
+
+/**
+ * Class for parsed Content-Disposition header for v8 optimization
+ *
+ * @public
+ * @param {string} type
+ * @param {object} parameters
+ * @constructor
+ */
+
+function ContentDisposition (type, parameters) {
+ this.type = type
+ this.parameters = parameters
+}
diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..a44034cf9e2f5109a13c02dcaacadd99603c7285
--- /dev/null
+++ b/node_modules/content-disposition/package.json
@@ -0,0 +1,43 @@
+{
+ "name": "content-disposition",
+ "description": "Create and parse Content-Disposition header",
+ "version": "1.0.1",
+ "author": "Douglas Christopher Wilson ",
+ "license": "MIT",
+ "keywords": [
+ "content-disposition",
+ "http",
+ "rfc6266",
+ "res"
+ ],
+ "repository": "jshttp/content-disposition",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ },
+ "devDependencies": {
+ "c8": "^10.1.2",
+ "eslint": "7.32.0",
+ "eslint-config-standard": "13.0.1",
+ "eslint-plugin-import": "2.25.3",
+ "eslint-plugin-markdown": "2.2.1",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "5.2.0",
+ "eslint-plugin-standard": "4.1.0"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "node --test --test-reporter spec",
+ "test-ci": "c8 --reporter=lcovonly --reporter=text npm test",
+ "test-cov": "c8 --reporter=html --reporter=text npm test"
+ }
+}
diff --git a/node_modules/content-type/HISTORY.md b/node_modules/content-type/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..458367139eb9f0af3daa5449ff0a3d9e2e189582
--- /dev/null
+++ b/node_modules/content-type/HISTORY.md
@@ -0,0 +1,29 @@
+1.0.5 / 2023-01-29
+==================
+
+ * perf: skip value escaping when unnecessary
+
+1.0.4 / 2017-09-11
+==================
+
+ * perf: skip parameter parsing when no parameters
+
+1.0.3 / 2017-09-10
+==================
+
+ * perf: remove argument reassignment
+
+1.0.2 / 2016-05-09
+==================
+
+ * perf: enable strict mode
+
+1.0.1 / 2015-02-13
+==================
+
+ * Improve missing `Content-Type` header error message
+
+1.0.0 / 2015-02-01
+==================
+
+ * Initial implementation, derived from `media-typer@0.3.0`
diff --git a/node_modules/content-type/LICENSE b/node_modules/content-type/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..34b1a2de37216b60b749c23b6f894e51d701ecf0
--- /dev/null
+++ b/node_modules/content-type/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/content-type/README.md b/node_modules/content-type/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..c1a922a9afba84293f449dc4b661124fbac2fd5d
--- /dev/null
+++ b/node_modules/content-type/README.md
@@ -0,0 +1,94 @@
+# content-type
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][ci-image]][ci-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+Create and parse HTTP Content-Type header according to RFC 7231
+
+## Installation
+
+```sh
+$ npm install content-type
+```
+
+## API
+
+```js
+var contentType = require('content-type')
+```
+
+### contentType.parse(string)
+
+```js
+var obj = contentType.parse('image/svg+xml; charset=utf-8')
+```
+
+Parse a `Content-Type` header. This will return an object with the following
+properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The media type (the type and subtype, always lower case).
+ Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of parameter
+ always lower case). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the string is missing or invalid.
+
+### contentType.parse(req)
+
+```js
+var obj = contentType.parse(req)
+```
+
+Parse the `Content-Type` header from the given `req`. Short-cut for
+`contentType.parse(req.headers['content-type'])`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.parse(res)
+
+```js
+var obj = contentType.parse(res)
+```
+
+Parse the `Content-Type` header set on the given `res`. Short-cut for
+`contentType.parse(res.getHeader('content-type'))`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.format(obj)
+
+```js
+var str = contentType.format({
+ type: 'image/svg+xml',
+ parameters: { charset: 'utf-8' }
+})
+```
+
+Format an object into a `Content-Type` header. This will return a string of the
+content type for the given object with the following properties (examples are
+shown that produce the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of the
+ parameter will be lower-cased). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the object contains an invalid type or parameter names.
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/jshttp/content-type/master?label=ci
+[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master
+[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master
+[node-image]: https://badgen.net/npm/node/content-type
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/content-type
+[npm-url]: https://npmjs.org/package/content-type
+[npm-version-image]: https://badgen.net/npm/v/content-type
diff --git a/node_modules/content-type/index.js b/node_modules/content-type/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..41840e7bc3e48cda894597cd18e562a37a174f7c
--- /dev/null
+++ b/node_modules/content-type/index.js
@@ -0,0 +1,225 @@
+/*!
+ * content-type
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
+ *
+ * parameter = token "=" ( token / quoted-string )
+ * token = 1*tchar
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
+ * / DIGIT / ALPHA
+ * ; any VCHAR, except delimiters
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
+ * obs-text = %x80-FF
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
+ */
+var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex
+var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex
+var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
+
+/**
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
+ *
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
+ * obs-text = %x80-FF
+ */
+var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex
+
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
+ */
+var QUOTE_REGEXP = /([\\"])/g
+
+/**
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
+ *
+ * media-type = type "/" subtype
+ * type = token
+ * subtype = token
+ */
+var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.format = format
+exports.parse = parse
+
+/**
+ * Format object to media type.
+ *
+ * @param {object} obj
+ * @return {string}
+ * @public
+ */
+
+function format (obj) {
+ if (!obj || typeof obj !== 'object') {
+ throw new TypeError('argument obj is required')
+ }
+
+ var parameters = obj.parameters
+ var type = obj.type
+
+ if (!type || !TYPE_REGEXP.test(type)) {
+ throw new TypeError('invalid type')
+ }
+
+ var string = type
+
+ // append parameters
+ if (parameters && typeof parameters === 'object') {
+ var param
+ var params = Object.keys(parameters).sort()
+
+ for (var i = 0; i < params.length; i++) {
+ param = params[i]
+
+ if (!TOKEN_REGEXP.test(param)) {
+ throw new TypeError('invalid parameter name')
+ }
+
+ string += '; ' + param + '=' + qstring(parameters[param])
+ }
+ }
+
+ return string
+}
+
+/**
+ * Parse media type to object.
+ *
+ * @param {string|object} string
+ * @return {Object}
+ * @public
+ */
+
+function parse (string) {
+ if (!string) {
+ throw new TypeError('argument string is required')
+ }
+
+ // support req/res-like objects as argument
+ var header = typeof string === 'object'
+ ? getcontenttype(string)
+ : string
+
+ if (typeof header !== 'string') {
+ throw new TypeError('argument string is required to be a string')
+ }
+
+ var index = header.indexOf(';')
+ var type = index !== -1
+ ? header.slice(0, index).trim()
+ : header.trim()
+
+ if (!TYPE_REGEXP.test(type)) {
+ throw new TypeError('invalid media type')
+ }
+
+ var obj = new ContentType(type.toLowerCase())
+
+ // parse parameters
+ if (index !== -1) {
+ var key
+ var match
+ var value
+
+ PARAM_REGEXP.lastIndex = index
+
+ while ((match = PARAM_REGEXP.exec(header))) {
+ if (match.index !== index) {
+ throw new TypeError('invalid parameter format')
+ }
+
+ index += match[0].length
+ key = match[1].toLowerCase()
+ value = match[2]
+
+ if (value.charCodeAt(0) === 0x22 /* " */) {
+ // remove quotes
+ value = value.slice(1, -1)
+
+ // remove escapes
+ if (value.indexOf('\\') !== -1) {
+ value = value.replace(QESC_REGEXP, '$1')
+ }
+ }
+
+ obj.parameters[key] = value
+ }
+
+ if (index !== header.length) {
+ throw new TypeError('invalid parameter format')
+ }
+ }
+
+ return obj
+}
+
+/**
+ * Get content-type from req/res objects.
+ *
+ * @param {object}
+ * @return {Object}
+ * @private
+ */
+
+function getcontenttype (obj) {
+ var header
+
+ if (typeof obj.getHeader === 'function') {
+ // res-like
+ header = obj.getHeader('content-type')
+ } else if (typeof obj.headers === 'object') {
+ // req-like
+ header = obj.headers && obj.headers['content-type']
+ }
+
+ if (typeof header !== 'string') {
+ throw new TypeError('content-type header is missing from object')
+ }
+
+ return header
+}
+
+/**
+ * Quote a string if necessary.
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function qstring (val) {
+ var str = String(val)
+
+ // no need to quote tokens
+ if (TOKEN_REGEXP.test(str)) {
+ return str
+ }
+
+ if (str.length > 0 && !TEXT_REGEXP.test(str)) {
+ throw new TypeError('invalid parameter value')
+ }
+
+ return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
+}
+
+/**
+ * Class to represent a content type.
+ * @private
+ */
+function ContentType (type) {
+ this.parameters = Object.create(null)
+ this.type = type
+}
diff --git a/node_modules/content-type/package.json b/node_modules/content-type/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..9db19f63fb96592d8d3bced654a72d47c12cef97
--- /dev/null
+++ b/node_modules/content-type/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "content-type",
+ "description": "Create and parse HTTP Content-Type header",
+ "version": "1.0.5",
+ "author": "Douglas Christopher Wilson ",
+ "license": "MIT",
+ "keywords": [
+ "content-type",
+ "http",
+ "req",
+ "res",
+ "rfc7231"
+ ],
+ "repository": "jshttp/content-type",
+ "devDependencies": {
+ "deep-equal": "1.0.1",
+ "eslint": "8.32.0",
+ "eslint-config-standard": "15.0.1",
+ "eslint-plugin-import": "2.27.5",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "6.1.1",
+ "eslint-plugin-standard": "4.1.0",
+ "mocha": "10.2.0",
+ "nyc": "15.1.0"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --reporter spec --check-leaks --bail test/",
+ "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test",
+ "version": "node scripts/version-history.js && git add HISTORY.md"
+ }
+}
diff --git a/node_modules/cookie-signature/History.md b/node_modules/cookie-signature/History.md
new file mode 100644
index 0000000000000000000000000000000000000000..479211a7b32761ad05e3f735e511424cfbf6c7d3
--- /dev/null
+++ b/node_modules/cookie-signature/History.md
@@ -0,0 +1,70 @@
+1.2.2 / 2024-10-29
+==================
+
+* various metadata/documentation tweaks (incl. #51)
+
+
+1.2.1 / 2023-02-27
+==================
+
+* update annotations for allowed secret key types (#44, thanks @jyasskin!)
+
+
+1.2.0 / 2022-02-17
+==================
+
+* allow buffer and other node-supported types as key (#33)
+* be pickier about extra content after signed portion (#40)
+* some internal code clarity/cleanup improvements (#26)
+
+
+1.1.0 / 2018-01-18
+==================
+
+* switch to built-in `crypto.timingSafeEqual` for validation instead of previous double-hash method (thank you @jodevsa!)
+
+
+1.0.7 / 2023-04-12
+==================
+
+Later release for older node.js versions. See the [v1.0.x branch notes](https://github.com/tj/node-cookie-signature/blob/v1.0.x/History.md#107--2023-04-12).
+
+
+1.0.6 / 2015-02-03
+==================
+
+* use `npm test` instead of `make test` to run tests
+* clearer assertion messages when checking input
+
+
+1.0.5 / 2014-09-05
+==================
+
+* add license to package.json
+
+1.0.4 / 2014-06-25
+==================
+
+ * corrected avoidance of timing attacks (thanks @tenbits!)
+
+1.0.3 / 2014-01-28
+==================
+
+ * [incorrect] fix for timing attacks
+
+1.0.2 / 2014-01-28
+==================
+
+ * fix missing repository warning
+ * fix typo in test
+
+1.0.1 / 2013-04-15
+==================
+
+ * Revert "Changed underlying HMAC algo. to sha512."
+ * Revert "Fix for timing attacks on MAC verification."
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/node_modules/cookie-signature/LICENSE b/node_modules/cookie-signature/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..a2671bf753dfdc9caafbbfd3fe4a1ef6dabf15a5
--- /dev/null
+++ b/node_modules/cookie-signature/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012–2024 LearnBoost and other contributors;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/cookie-signature/Readme.md b/node_modules/cookie-signature/Readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..369af15f8511f0d6037937f1610bbc71b39f4e60
--- /dev/null
+++ b/node_modules/cookie-signature/Readme.md
@@ -0,0 +1,23 @@
+
+# cookie-signature
+
+ Sign and unsign cookies.
+
+## Example
+
+```js
+var cookie = require('cookie-signature');
+
+var val = cookie.sign('hello', 'tobiiscool');
+val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
+
+var val = cookie.sign('hello', 'tobiiscool');
+cookie.unsign(val, 'tobiiscool').should.equal('hello');
+cookie.unsign(val, 'luna').should.be.false;
+```
+
+## License
+
+MIT.
+
+See LICENSE file for details.
diff --git a/node_modules/cookie-signature/index.js b/node_modules/cookie-signature/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..3fbbddb6c11e38c4faf143ddb2ad4c8db7b869f9
--- /dev/null
+++ b/node_modules/cookie-signature/index.js
@@ -0,0 +1,47 @@
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto');
+
+/**
+ * Sign the given `val` with `secret`.
+ *
+ * @param {String} val
+ * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret
+ * @return {String}
+ * @api private
+ */
+
+exports.sign = function(val, secret){
+ if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string.");
+ if (null == secret) throw new TypeError("Secret key must be provided.");
+ return val + '.' + crypto
+ .createHmac('sha256', secret)
+ .update(val)
+ .digest('base64')
+ .replace(/\=+$/, '');
+};
+
+/**
+ * Unsign and decode the given `input` with `secret`,
+ * returning `false` if the signature is invalid.
+ *
+ * @param {String} input
+ * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret
+ * @return {String|Boolean}
+ * @api private
+ */
+
+exports.unsign = function(input, secret){
+ if ('string' != typeof input) throw new TypeError("Signed cookie string must be provided.");
+ if (null == secret) throw new TypeError("Secret key must be provided.");
+ var tentativeValue = input.slice(0, input.lastIndexOf('.')),
+ expectedInput = exports.sign(tentativeValue, secret),
+ expectedBuffer = Buffer.from(expectedInput),
+ inputBuffer = Buffer.from(input);
+ return (
+ expectedBuffer.length === inputBuffer.length &&
+ crypto.timingSafeEqual(expectedBuffer, inputBuffer)
+ ) ? tentativeValue : false;
+};
diff --git a/node_modules/cookie-signature/package.json b/node_modules/cookie-signature/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..a16004005bf42fa3d7635be323a518f126e4a760
--- /dev/null
+++ b/node_modules/cookie-signature/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "cookie-signature",
+ "version": "1.2.2",
+ "main": "index.js",
+ "description": "Sign and unsign cookies",
+ "keywords": ["cookie", "sign", "unsign"],
+ "author": "TJ Holowaychuk ",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/visionmedia/node-cookie-signature.git"
+ },
+ "dependencies": {},
+ "engines": {
+ "node": ">=6.6.0"
+ },
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*"
+ },
+ "scripts": {
+ "test": "mocha --require should --reporter spec"
+ }
+}
diff --git a/node_modules/cookie/LICENSE b/node_modules/cookie/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..058b6b4efa3f45896ae691f2558a2a1aca05bebd
--- /dev/null
+++ b/node_modules/cookie/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 Roman Shtylman
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/cookie/README.md b/node_modules/cookie/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..71fdac1110bba222a716c4b56b90028a6a9e5af4
--- /dev/null
+++ b/node_modules/cookie/README.md
@@ -0,0 +1,317 @@
+# cookie
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][ci-image]][ci-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+Basic HTTP cookie parser and serializer for HTTP servers.
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install cookie
+```
+
+## API
+
+```js
+var cookie = require('cookie');
+```
+
+### cookie.parse(str, options)
+
+Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs.
+The `str` argument is the string representing a `Cookie` header value and `options` is an
+optional object containing additional parsing options.
+
+```js
+var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2');
+// { foo: 'bar', equation: 'E=mc^2' }
+```
+
+#### Options
+
+`cookie.parse` accepts these properties in the options object.
+
+##### decode
+
+Specifies a function that will be used to decode a cookie's value. Since the value of a cookie
+has a limited character set (and must be a simple string), this function can be used to decode
+a previously-encoded cookie value into a JavaScript string or other object.
+
+The default function is the global `decodeURIComponent`, which will decode any URL-encoded
+sequences into their byte representations.
+
+**note** if an error is thrown from this function, the original, non-decoded cookie value will
+be returned as the cookie's value.
+
+### cookie.serialize(name, value, options)
+
+Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the
+name for the cookie, the `value` argument is the value to set the cookie to, and the `options`
+argument is an optional object containing additional serialization options.
+
+```js
+var setCookie = cookie.serialize('foo', 'bar');
+// foo=bar
+```
+
+#### Options
+
+`cookie.serialize` accepts these properties in the options object.
+
+##### domain
+
+Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6265-5.2.3]. By default, no
+domain is set, and most clients will consider the cookie to apply to only the current domain.
+
+##### encode
+
+Specifies a function that will be used to encode a cookie's value. Since value of a cookie
+has a limited character set (and must be a simple string), this function can be used to encode
+a value into a string suited for a cookie's value.
+
+The default function is the global `encodeURIComponent`, which will encode a JavaScript string
+into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range.
+
+##### expires
+
+Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6265-5.2.1].
+By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and
+will delete it on a condition like exiting a web browser application.
+
+**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and
+`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
+so if both are set, they should point to the same date and time.
+
+##### httpOnly
+
+Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6265-5.2.6]. When truthy,
+the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set.
+
+**note** be careful when setting this to `true`, as compliant clients will not allow client-side
+JavaScript to see the cookie in `document.cookie`.
+
+##### maxAge
+
+Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6265-5.2.2].
+The given number will be converted to an integer by rounding down. By default, no maximum age is set.
+
+**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and
+`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
+so if both are set, they should point to the same date and time.
+
+##### partitioned
+
+Specifies the `boolean` value for the [`Partitioned` `Set-Cookie`](rfc-cutler-httpbis-partitioned-cookies)
+attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not. By default, the
+`Partitioned` attribute is not set.
+
+**note** This is an attribute that has not yet been fully standardized, and may change in the future.
+This also means many clients may ignore this attribute until they understand it.
+
+More information about can be found in [the proposal](https://github.com/privacycg/CHIPS).
+
+##### path
+
+Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path
+is considered the ["default path"][rfc-6265-5.1.4].
+
+##### priority
+
+Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1].
+
+ - `'low'` will set the `Priority` attribute to `Low`.
+ - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
+ - `'high'` will set the `Priority` attribute to `High`.
+
+More information about the different priority levels can be found in
+[the specification][rfc-west-cookie-priority-00-4.1].
+
+**note** This is an attribute that has not yet been fully standardized, and may change in the future.
+This also means many clients may ignore this attribute until they understand it.
+
+##### sameSite
+
+Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-09-5.4.7].
+
+ - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
+ - `false` will not set the `SameSite` attribute.
+ - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
+ - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
+ - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
+
+More information about the different enforcement levels can be found in
+[the specification][rfc-6265bis-09-5.4.7].
+
+**note** This is an attribute that has not yet been fully standardized, and may change in the future.
+This also means many clients may ignore this attribute until they understand it.
+
+##### secure
+
+Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6265-5.2.5]. When truthy,
+the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.
+
+**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to
+the server in the future if the browser does not have an HTTPS connection.
+
+## Example
+
+The following example uses this module in conjunction with the Node.js core HTTP server
+to prompt a user for their name and display it back on future visits.
+
+```js
+var cookie = require('cookie');
+var escapeHtml = require('escape-html');
+var http = require('http');
+var url = require('url');
+
+function onRequest(req, res) {
+ // Parse the query string
+ var query = url.parse(req.url, true, true).query;
+
+ if (query && query.name) {
+ // Set a new cookie with the name
+ res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), {
+ httpOnly: true,
+ maxAge: 60 * 60 * 24 * 7 // 1 week
+ }));
+
+ // Redirect back after setting cookie
+ res.statusCode = 302;
+ res.setHeader('Location', req.headers.referer || '/');
+ res.end();
+ return;
+ }
+
+ // Parse the cookies on the request
+ var cookies = cookie.parse(req.headers.cookie || '');
+
+ // Get the visitor name set in the cookie
+ var name = cookies.name;
+
+ res.setHeader('Content-Type', 'text/html; charset=UTF-8');
+
+ if (name) {
+ res.write('Welcome back, ' + escapeHtml(name) + '!
');
+ } else {
+ res.write('Hello, new visitor!
');
+ }
+
+ res.write('');
+}
+
+http.createServer(onRequest).listen(3000);
+```
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## Benchmark
+
+```
+$ npm run bench
+
+> cookie@0.5.0 bench
+> node benchmark/index.js
+
+ node@18.18.2
+ acorn@8.10.0
+ ada@2.6.0
+ ares@1.19.1
+ brotli@1.0.9
+ cldr@43.1
+ icu@73.2
+ llhttp@6.0.11
+ modules@108
+ napi@9
+ nghttp2@1.57.0
+ nghttp3@0.7.0
+ ngtcp2@0.8.1
+ openssl@3.0.10+quic
+ simdutf@3.2.14
+ tz@2023c
+ undici@5.26.3
+ unicode@15.0
+ uv@1.44.2
+ uvwasi@0.0.18
+ v8@10.2.154.26-node.26
+ zlib@1.2.13.1-motley
+
+> node benchmark/parse-top.js
+
+ cookie.parse - top sites
+
+ 14 tests completed.
+
+ parse accounts.google.com x 2,588,913 ops/sec ±0.74% (186 runs sampled)
+ parse apple.com x 2,370,002 ops/sec ±0.69% (186 runs sampled)
+ parse cloudflare.com x 2,213,102 ops/sec ±0.88% (188 runs sampled)
+ parse docs.google.com x 2,194,157 ops/sec ±1.03% (184 runs sampled)
+ parse drive.google.com x 2,265,084 ops/sec ±0.79% (187 runs sampled)
+ parse en.wikipedia.org x 457,099 ops/sec ±0.81% (186 runs sampled)
+ parse linkedin.com x 504,407 ops/sec ±0.89% (186 runs sampled)
+ parse maps.google.com x 1,230,959 ops/sec ±0.98% (186 runs sampled)
+ parse microsoft.com x 926,294 ops/sec ±0.88% (184 runs sampled)
+ parse play.google.com x 2,311,338 ops/sec ±0.83% (185 runs sampled)
+ parse support.google.com x 1,508,850 ops/sec ±0.86% (186 runs sampled)
+ parse www.google.com x 1,022,582 ops/sec ±1.32% (182 runs sampled)
+ parse youtu.be x 332,136 ops/sec ±1.02% (185 runs sampled)
+ parse youtube.com x 323,833 ops/sec ±0.77% (183 runs sampled)
+
+> node benchmark/parse.js
+
+ cookie.parse - generic
+
+ 6 tests completed.
+
+ simple x 3,214,032 ops/sec ±1.61% (183 runs sampled)
+ decode x 587,237 ops/sec ±1.16% (187 runs sampled)
+ unquote x 2,954,618 ops/sec ±1.35% (183 runs sampled)
+ duplicates x 857,008 ops/sec ±0.89% (187 runs sampled)
+ 10 cookies x 292,133 ops/sec ±0.89% (187 runs sampled)
+ 100 cookies x 22,610 ops/sec ±0.68% (187 runs sampled)
+```
+
+## References
+
+- [RFC 6265: HTTP State Management Mechanism][rfc-6265]
+- [Same-site Cookies][rfc-6265bis-09-5.4.7]
+
+[rfc-cutler-httpbis-partitioned-cookies]: https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/
+[rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1
+[rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7
+[rfc-6265]: https://tools.ietf.org/html/rfc6265
+[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4
+[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1
+[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2
+[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3
+[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4
+[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5
+[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6
+[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/jshttp/cookie/master?label=ci
+[ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master
+[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
+[node-image]: https://badgen.net/npm/node/cookie
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/cookie
+[npm-url]: https://npmjs.org/package/cookie
+[npm-version-image]: https://badgen.net/npm/v/cookie
diff --git a/node_modules/cookie/SECURITY.md b/node_modules/cookie/SECURITY.md
new file mode 100644
index 0000000000000000000000000000000000000000..fd4a6c53a9cd1abacf91125dab3fde3163b4c412
--- /dev/null
+++ b/node_modules/cookie/SECURITY.md
@@ -0,0 +1,25 @@
+# Security Policies and Procedures
+
+## Reporting a Bug
+
+The `cookie` team and community take all security bugs seriously. Thank
+you for improving the security of the project. We appreciate your efforts and
+responsible disclosure and will make every effort to acknowledge your
+contributions.
+
+Report security bugs by emailing the current owner(s) of `cookie`. This
+information can be found in the npm registry using the command
+`npm owner ls cookie`.
+If unsure or unable to get the information from the above, open an issue
+in the [project issue tracker](https://github.com/jshttp/cookie/issues)
+asking for the current contact information.
+
+To ensure the timely response to your report, please ensure that the entirety
+of the report is contained within the email body and not solely behind a web
+link or an attachment.
+
+At least one owner will acknowledge your email within 48 hours, and will send a
+more detailed response within 48 hours indicating the next steps in handling
+your report. After the initial reply to your report, the owners will
+endeavor to keep you informed of the progress towards a fix and full
+announcement, and may ask for additional information or guidance.
diff --git a/node_modules/cookie/index.js b/node_modules/cookie/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..acd5acd6ab3cfd4441516573c5948db0ea6d7785
--- /dev/null
+++ b/node_modules/cookie/index.js
@@ -0,0 +1,335 @@
+/*!
+ * cookie
+ * Copyright(c) 2012-2014 Roman Shtylman
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.parse = parse;
+exports.serialize = serialize;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var __toString = Object.prototype.toString
+var __hasOwnProperty = Object.prototype.hasOwnProperty
+
+/**
+ * RegExp to match cookie-name in RFC 6265 sec 4.1.1
+ * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
+ * which has been replaced by the token definition in RFC 7230 appendix B.
+ *
+ * cookie-name = token
+ * token = 1*tchar
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" /
+ * "*" / "+" / "-" / "." / "^" / "_" /
+ * "`" / "|" / "~" / DIGIT / ALPHA
+ */
+
+var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
+
+/**
+ * RegExp to match cookie-value in RFC 6265 sec 4.1.1
+ *
+ * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
+ * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
+ * ; US-ASCII characters excluding CTLs,
+ * ; whitespace DQUOTE, comma, semicolon,
+ * ; and backslash
+ */
+
+var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
+
+/**
+ * RegExp to match domain-value in RFC 6265 sec 4.1.1
+ *
+ * domain-value =
+ * ; defined in [RFC1034], Section 3.5, as
+ * ; enhanced by [RFC1123], Section 2.1
+ * =