diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 100644 index 679bd16..0000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" -else - exec node "$basedir/../acorn/bin/acorn" "$@" -fi diff --git a/node_modules/.bin/glob b/node_modules/.bin/glob deleted file mode 100644 index 6fbc4bb..0000000 --- a/node_modules/.bin/glob +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../glob/dist/esm/bin.mjs" "$@" -else - exec node "$basedir/../glob/dist/esm/bin.mjs" "$@" -fi diff --git a/node_modules/.bin/he b/node_modules/.bin/he deleted file mode 100644 index 441322a..0000000 --- a/node_modules/.bin/he +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../he/bin/he" "$@" -else - exec node "$basedir/../he/bin/he" "$@" -fi diff --git a/node_modules/.bin/html-minifier b/node_modules/.bin/html-minifier deleted file mode 100644 index 58ab976..0000000 --- a/node_modules/.bin/html-minifier +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../html-minifier/cli.js" "$@" -else - exec node "$basedir/../html-minifier/cli.js" "$@" -fi diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 100644 index 7751de3..0000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mime/cli.js" "$@" -else - exec node "$basedir/../mime/cli.js" "$@" -fi diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which deleted file mode 100644 index b49b03f..0000000 --- a/node_modules/.bin/node-which +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" -else - exec node "$basedir/../which/bin/node-which" "$@" -fi diff --git a/node_modules/.bin/nodemon b/node_modules/.bin/nodemon deleted file mode 100644 index c477a18..0000000 --- a/node_modules/.bin/nodemon +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@" -else - exec node "$basedir/../nodemon/bin/nodemon.js" "$@" -fi diff --git a/node_modules/.bin/nodetouch b/node_modules/.bin/nodetouch deleted file mode 100644 index 3e146b4..0000000 --- a/node_modules/.bin/nodetouch +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../touch/bin/nodetouch.js" "$@" -else - exec node "$basedir/../touch/bin/nodetouch.js" "$@" -fi diff --git a/node_modules/.bin/replace-in-file b/node_modules/.bin/replace-in-file deleted file mode 100644 index 96699c1..0000000 --- a/node_modules/.bin/replace-in-file +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../replace-in-file/bin/cli.js" "$@" -else - exec node "$basedir/../replace-in-file/bin/cli.js" "$@" -fi diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 100644 index 97c5327..0000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" -else - exec node "$basedir/../semver/bin/semver.js" "$@" -fi diff --git a/node_modules/.bin/terser b/node_modules/.bin/terser deleted file mode 100644 index 8456546..0000000 --- a/node_modules/.bin/terser +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../terser/bin/terser" "$@" -else - exec node "$basedir/../terser/bin/terser" "$@" -fi diff --git a/node_modules/.bin/uglifyjs b/node_modules/.bin/uglifyjs deleted file mode 100644 index 5696938..0000000 --- a/node_modules/.bin/uglifyjs +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../uglify-js/bin/uglifyjs" "$@" -else - exec node "$basedir/../uglify-js/bin/uglifyjs" "$@" -fi diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index e278028..8cfdec9 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,17 +1,9 @@ { - "name": "cod-stats-tracker", + "name": "codtracker-js", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -135,19 +127,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -158,66 +137,106 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "license": "MIT", + "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" + }, "engines": { - "node": ">=8" + "node": ">=18" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/body-parser/node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/body-parser/node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "node_modules/body-parser/node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" }, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "license": "ISC" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" + "node": ">= 0.6" } }, "node_modules/buffer-from": { @@ -230,6 +249,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -261,20 +281,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/call-of-duty-api": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/call-of-duty-api/-/call-of-duty-api-4.1.0.tgz", - "integrity": "sha512-f5DJ6gQru6f406QVBZkkXOv0gUzFu0hykdkyKRa2Am6iWwGRVzcBK7rq+xHpNI6oTq3EFfw0T70kb38rZaezNA==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dependencies": { - "tslib": "^2.4.0", - "undici": "^5.12.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Lierrmm" - } - }, "node_modules/camel-case": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", @@ -285,133 +291,6 @@ "upper-case": "^1.1.1" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/chalk/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cheerio": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", - "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", - "license": "MIT", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.1.0", - "encoding-sniffer": "^0.2.0", - "htmlparser2": "^9.1.0", - "parse5": "^7.1.2", - "parse5-htmlparser2-tree-adapter": "^7.0.0", - "parse5-parser-stream": "^7.1.2", - "undici": "^6.19.5", - "whatwg-mimetype": "^4.0.0" - }, - "engines": { - "node": ">=18.17" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/cheerio/node_modules/undici": { - "version": "6.21.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.2.tgz", - "integrity": "sha512-uROZWze0R0itiAKVPsYhFov9LxrPMHLMEQFszeI2gCN6bnIIZ8twzBCJcN2LJrBBLfrP0t1FW0g+JmKVl8Vk1g==", - "license": "MIT", - "engines": { - "node": ">=18.17" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/clean-css": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", @@ -424,93 +303,6 @@ "node": ">= 4.0" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -535,11 +327,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -586,22 +373,6 @@ "node": ">= 8" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/css-tree": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", @@ -616,18 +387,6 @@ "npm": ">=7.0.0" } }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "license": "BSD-2-Clause", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/csso": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", @@ -666,61 +425,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "BSD-2-Clause" - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "license": "BSD-2-Clause", - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", - "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", - "license": "BSD-2-Clause", - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -759,43 +463,6 @@ "node": ">= 0.8" } }, - "node_modules/encoding-sniffer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", - "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", - "license": "MIT", - "dependencies": { - "iconv-lite": "^0.6.3", - "whatwg-encoding": "^3.1.1" - }, - "funding": { - "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" - } - }, - "node_modules/encoding-sniffer/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -823,15 +490,6 @@ "node": ">= 0.4" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -849,6 +507,7 @@ "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -890,16 +549,55 @@ "url": "https://opencollective.com/express" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", "dependencies": { - "to-regex-range": "^5.0.1" + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, "node_modules/finalhandler": { @@ -951,12 +649,6 @@ "node": ">= 0.6" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "license": "ISC" - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -965,15 +657,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -1032,18 +715,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1079,15 +750,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -1140,25 +802,6 @@ "node": ">=6" } }, - "node_modules/htmlparser2": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", - "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.1.0", - "entities": "^4.5.0" - } - }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -1175,33 +818,17 @@ } }, "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1215,27 +842,6 @@ "node": ">= 0.10" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1245,27 +851,6 @@ "node": ">=8" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1370,17 +955,6 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -1412,78 +986,6 @@ "lower-case": "^1.1.1" } }, - "node_modules/nodemon": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", - "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", - "dev": true, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/nodemon/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -1506,15 +1008,6 @@ "node": ">= 0.8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -1530,43 +1023,6 @@ "no-case": "^2.2.0" } }, - "node_modules/parse5": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", - "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", - "license": "MIT", - "dependencies": { - "entities": "^4.5.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", - "license": "MIT", - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-parser-stream": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", - "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", - "license": "MIT", - "dependencies": { - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1575,15 +1031,6 @@ "node": ">= 0.8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1614,18 +1061,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1638,12 +1073,6 @@ "node": ">= 0.10" } }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -1667,31 +1096,20 @@ } }, "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", - "iconv-lite": "0.4.24", + "iconv-lite": "0.6.3", "unpipe": "1.0.0" }, "engines": { "node": ">= 0.8" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -1701,53 +1119,6 @@ "node": ">= 0.10" } }, - "node_modules/replace-in-file": { - "version": "6.3.5", - "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-6.3.5.tgz", - "integrity": "sha512-arB9d3ENdKva2fxRnSjwBEXfK1npgyci7ZZuwysgAp7ORjHSyxz6oqIjTEv8R0Ydl4Ll7uOAZXL4vbkhGIizCg==", - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2", - "glob": "^7.2.0", - "yargs": "^17.2.1" - }, - "bin": { - "replace-in-file": "bin/cli.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/replace-in-file/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1772,18 +1143,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/send": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", @@ -1820,6 +1179,34 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/serve-favicon": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.5.0.tgz", + "integrity": "sha512-FMW2RvqNr03x+C0WxTyu6sOv21oOjkq5j8tjquWccwa6ScNyGFOGJVpuS1NmTVGBAHS07xnSKotgf2ehQmf9iA==", + "license": "MIT", + "dependencies": { + "etag": "~1.8.1", + "fresh": "0.5.2", + "ms": "2.1.1", + "parseurl": "~1.3.2", + "safe-buffer": "5.1.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-favicon/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "license": "MIT" + }, + "node_modules/serve-favicon/node_modules/safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "license": "MIT" + }, "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", @@ -1940,18 +1327,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2084,18 +1459,6 @@ "node": ">=8" } }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/terser": { "version": "5.39.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz", @@ -2114,18 +1477,6 @@ "node": ">=10" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -2134,19 +1485,11 @@ "node": ">=0.6" } }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/type-is": { "version": "1.6.18", @@ -2172,21 +1515,13 @@ "node": ">=0.8.0" } }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true - }, "node_modules/undici": { - "version": "5.28.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", - "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.6.0.tgz", + "integrity": "sha512-gaFsbThjrDGvAaD670r81RZro/s6H2PVZF640Qn0p5kZK+/rim7/mmyfp2W7VB5vOMaFM8vuFBJUaMlaZTYHlA==", + "license": "MIT", "engines": { - "node": ">=14.0" + "node": ">=20.18.1" } }, "node_modules/unpipe": { @@ -2219,39 +1554,6 @@ "node": ">= 0.8" } }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", - "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", - "license": "MIT", - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/whatwg-mimetype": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", - "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2357,89 +1659,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } } } } diff --git a/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js b/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js deleted file mode 100644 index 3c8c081..0000000 --- a/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +++ /dev/null @@ -1,213 +0,0 @@ -'use strict' - -const WritableStream = require('node:stream').Writable -const inherits = require('node:util').inherits - -const StreamSearch = require('../../streamsearch/sbmh') - -const PartStream = require('./PartStream') -const HeaderParser = require('./HeaderParser') - -const DASH = 45 -const B_ONEDASH = Buffer.from('-') -const B_CRLF = Buffer.from('\r\n') -const EMPTY_FN = function () {} - -function Dicer (cfg) { - if (!(this instanceof Dicer)) { return new Dicer(cfg) } - WritableStream.call(this, cfg) - - if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } - - if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } - - this._headerFirst = cfg.headerFirst - - this._dashes = 0 - this._parts = 0 - this._finished = false - this._realFinish = false - this._isPreamble = true - this._justMatched = false - this._firstWrite = true - this._inHeader = true - this._part = undefined - this._cb = undefined - this._ignoreData = false - this._partOpts = { highWaterMark: cfg.partHwm } - this._pause = false - - const self = this - this._hparser = new HeaderParser(cfg) - this._hparser.on('header', function (header) { - self._inHeader = false - self._part.emit('header', header) - }) -} -inherits(Dicer, WritableStream) - -Dicer.prototype.emit = function (ev) { - if (ev === 'finish' && !this._realFinish) { - if (!this._finished) { - const self = this - process.nextTick(function () { - self.emit('error', new Error('Unexpected end of multipart data')) - if (self._part && !self._ignoreData) { - const type = (self._isPreamble ? 'Preamble' : 'Part') - self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) - self._part.push(null) - process.nextTick(function () { - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) - return - } - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) - } - } else { WritableStream.prototype.emit.apply(this, arguments) } -} - -Dicer.prototype._write = function (data, encoding, cb) { - // ignore unexpected data (e.g. extra trailer data after finished) - if (!this._hparser && !this._bparser) { return cb() } - - if (this._headerFirst && this._isPreamble) { - if (!this._part) { - this._part = new PartStream(this._partOpts) - if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } - } - const r = this._hparser.push(data) - if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } - } - - // allows for "easier" testing - if (this._firstWrite) { - this._bparser.push(B_CRLF) - this._firstWrite = false - } - - this._bparser.push(data) - - if (this._pause) { this._cb = cb } else { cb() } -} - -Dicer.prototype.reset = function () { - this._part = undefined - this._bparser = undefined - this._hparser = undefined -} - -Dicer.prototype.setBoundary = function (boundary) { - const self = this - this._bparser = new StreamSearch('\r\n--' + boundary) - this._bparser.on('info', function (isMatch, data, start, end) { - self._oninfo(isMatch, data, start, end) - }) -} - -Dicer.prototype._ignore = function () { - if (this._part && !this._ignoreData) { - this._ignoreData = true - this._part.on('error', EMPTY_FN) - // we must perform some kind of read on the stream even though we are - // ignoring the data, otherwise node's Readable stream will not emit 'end' - // after pushing null to the stream - this._part.resume() - } -} - -Dicer.prototype._oninfo = function (isMatch, data, start, end) { - let buf; const self = this; let i = 0; let r; let shouldWriteMore = true - - if (!this._part && this._justMatched && data) { - while (this._dashes < 2 && (start + i) < end) { - if (data[start + i] === DASH) { - ++i - ++this._dashes - } else { - if (this._dashes) { buf = B_ONEDASH } - this._dashes = 0 - break - } - } - if (this._dashes === 2) { - if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } - this.reset() - this._finished = true - // no more parts will be added - if (self._parts === 0) { - self._realFinish = true - self.emit('finish') - self._realFinish = false - } - } - if (this._dashes) { return } - } - if (this._justMatched) { this._justMatched = false } - if (!this._part) { - this._part = new PartStream(this._partOpts) - this._part._read = function (n) { - self._unpause() - } - if (this._isPreamble && this.listenerCount('preamble') !== 0) { - this.emit('preamble', this._part) - } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { - this.emit('part', this._part) - } else { - this._ignore() - } - if (!this._isPreamble) { this._inHeader = true } - } - if (data && start < end && !this._ignoreData) { - if (this._isPreamble || !this._inHeader) { - if (buf) { shouldWriteMore = this._part.push(buf) } - shouldWriteMore = this._part.push(data.slice(start, end)) - if (!shouldWriteMore) { this._pause = true } - } else if (!this._isPreamble && this._inHeader) { - if (buf) { this._hparser.push(buf) } - r = this._hparser.push(data.slice(start, end)) - if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } - } - } - if (isMatch) { - this._hparser.reset() - if (this._isPreamble) { this._isPreamble = false } else { - if (start !== end) { - ++this._parts - this._part.on('end', function () { - if (--self._parts === 0) { - if (self._finished) { - self._realFinish = true - self.emit('finish') - self._realFinish = false - } else { - self._unpause() - } - } - }) - } - } - this._part.push(null) - this._part = undefined - this._ignoreData = false - this._justMatched = true - this._dashes = 0 - } -} - -Dicer.prototype._unpause = function () { - if (!this._pause) { return } - - this._pause = false - if (this._cb) { - const cb = this._cb - this._cb = undefined - cb() - } -} - -module.exports = Dicer diff --git a/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js b/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js deleted file mode 100644 index 65f667b..0000000 --- a/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict' - -const EventEmitter = require('node:events').EventEmitter -const inherits = require('node:util').inherits -const getLimit = require('../../../lib/utils/getLimit') - -const StreamSearch = require('../../streamsearch/sbmh') - -const B_DCRLF = Buffer.from('\r\n\r\n') -const RE_CRLF = /\r\n/g -const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex - -function HeaderParser (cfg) { - EventEmitter.call(this) - - cfg = cfg || {} - const self = this - this.nread = 0 - this.maxed = false - this.npairs = 0 - this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) - this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) - this.buffer = '' - this.header = {} - this.finished = false - this.ss = new StreamSearch(B_DCRLF) - this.ss.on('info', function (isMatch, data, start, end) { - if (data && !self.maxed) { - if (self.nread + end - start >= self.maxHeaderSize) { - end = self.maxHeaderSize - self.nread + start - self.nread = self.maxHeaderSize - self.maxed = true - } else { self.nread += (end - start) } - - self.buffer += data.toString('binary', start, end) - } - if (isMatch) { self._finish() } - }) -} -inherits(HeaderParser, EventEmitter) - -HeaderParser.prototype.push = function (data) { - const r = this.ss.push(data) - if (this.finished) { return r } -} - -HeaderParser.prototype.reset = function () { - this.finished = false - this.buffer = '' - this.header = {} - this.ss.reset() -} - -HeaderParser.prototype._finish = function () { - if (this.buffer) { this._parseHeader() } - this.ss.matches = this.ss.maxMatches - const header = this.header - this.header = {} - this.buffer = '' - this.finished = true - this.nread = this.npairs = 0 - this.maxed = false - this.emit('header', header) -} - -HeaderParser.prototype._parseHeader = function () { - if (this.npairs === this.maxHeaderPairs) { return } - - const lines = this.buffer.split(RE_CRLF) - const len = lines.length - let m, h - - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (lines[i].length === 0) { continue } - if (lines[i][0] === '\t' || lines[i][0] === ' ') { - // folded header content - // RFC2822 says to just remove the CRLF and not the whitespace following - // it, so we follow the RFC and include the leading whitespace ... - if (h) { - this.header[h][this.header[h].length - 1] += lines[i] - continue - } - } - - const posColon = lines[i].indexOf(':') - if ( - posColon === -1 || - posColon === 0 - ) { - return - } - m = RE_HDR.exec(lines[i]) - h = m[1].toLowerCase() - this.header[h] = this.header[h] || [] - this.header[h].push((m[2] || '')) - if (++this.npairs === this.maxHeaderPairs) { break } - } -} - -module.exports = HeaderParser diff --git a/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js b/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js deleted file mode 100644 index c91da1c..0000000 --- a/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -const inherits = require('node:util').inherits -const ReadableStream = require('node:stream').Readable - -function PartStream (opts) { - ReadableStream.call(this, opts) -} -inherits(PartStream, ReadableStream) - -PartStream.prototype._read = function (n) {} - -module.exports = PartStream diff --git a/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts b/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts deleted file mode 100644 index 3c5b896..0000000 --- a/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -// Type definitions for dicer 0.2 -// Project: https://github.com/mscdex/dicer -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 -/// - -import stream = require("stream"); - -// tslint:disable:unified-signatures - -/** - * A very fast streaming multipart parser for node.js. - * Dicer is a WritableStream - * - * Dicer (special) events: - * - on('finish', ()) - Emitted when all parts have been parsed and the Dicer instance has been ended. - * - on('part', (stream: PartStream)) - Emitted when a new part has been found. - * - on('preamble', (stream: PartStream)) - Emitted for preamble if you should happen to need it (can usually be ignored). - * - on('trailer', (data: Buffer)) - Emitted when trailing data was found after the terminating boundary (as with the preamble, this can usually be ignored too). - */ -export class Dicer extends stream.Writable { - /** - * Creates and returns a new Dicer instance with the following valid config settings: - * - * @param config The configuration to use - */ - constructor(config: Dicer.Config); - /** - * Sets the boundary to use for parsing and performs some initialization needed for parsing. - * You should only need to use this if you set headerFirst to true in the constructor and are parsing the boundary from the preamble header. - * - * @param boundary The boundary to use - */ - setBoundary(boundary: string): void; - addListener(event: "finish", listener: () => void): this; - addListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - addListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - addListener(event: "trailer", listener: (data: Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "part", listener: (stream: Dicer.PartStream) => void): this; - on(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - on(event: "trailer", listener: (data: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "part", listener: (stream: Dicer.PartStream) => void): this; - once(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - once(event: "trailer", listener: (data: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - prependListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - prependListener(event: "trailer", listener: (data: Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - prependOnceListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - prependOnceListener(event: "trailer", listener: (data: Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "part", listener: (stream: Dicer.PartStream) => void): this; - removeListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this; - removeListener(event: "trailer", listener: (data: Buffer) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pipe", listener: (src: stream.Readable) => void): this; - removeListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - removeListener(event: string, listener: (...args: any[]) => void): this; -} - -declare namespace Dicer { - interface Config { - /** - * This is the boundary used to detect the beginning of a new part. - */ - boundary?: string | undefined; - /** - * If true, preamble header parsing will be performed first. - */ - headerFirst?: boolean | undefined; - /** - * The maximum number of header key=>value pairs to parse Default: 2000 (same as node's http). - */ - maxHeaderPairs?: number | undefined; - } - - /** - * PartStream is a _ReadableStream_ - * - * PartStream (special) events: - * - on('header', (header: object)) - An object containing the header for this particular part. Each property value is an array of one or more string values. - */ - interface PartStream extends stream.Readable { - addListener(event: "header", listener: (header: object) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - on(event: "header", listener: (header: object) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "header", listener: (header: object) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "header", listener: (header: object) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "header", listener: (header: object) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - removeListener(event: "header", listener: (header: object) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: Buffer | string) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: string, listener: (...args: any[]) => void): this; - } -} \ No newline at end of file diff --git a/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js b/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js deleted file mode 100644 index b90c0e8..0000000 --- a/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict' - -/** - * Copyright Brian White. All rights reserved. - * - * @see https://github.com/mscdex/streamsearch - * - * 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. - * - * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation - * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool - */ -const EventEmitter = require('node:events').EventEmitter -const inherits = require('node:util').inherits - -function SBMH (needle) { - if (typeof needle === 'string') { - needle = Buffer.from(needle) - } - - if (!Buffer.isBuffer(needle)) { - throw new TypeError('The needle has to be a String or a Buffer.') - } - - const needleLength = needle.length - - if (needleLength === 0) { - throw new Error('The needle cannot be an empty String/Buffer.') - } - - if (needleLength > 256) { - throw new Error('The needle cannot have a length bigger than 256.') - } - - this.maxMatches = Infinity - this.matches = 0 - - this._occ = new Array(256) - .fill(needleLength) // Initialize occurrence table. - this._lookbehind_size = 0 - this._needle = needle - this._bufpos = 0 - - this._lookbehind = Buffer.alloc(needleLength) - - // Populate occurrence table with analysis of the needle, - // ignoring last letter. - for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var - this._occ[needle[i]] = needleLength - 1 - i - } -} -inherits(SBMH, EventEmitter) - -SBMH.prototype.reset = function () { - this._lookbehind_size = 0 - this.matches = 0 - this._bufpos = 0 -} - -SBMH.prototype.push = function (chunk, pos) { - if (!Buffer.isBuffer(chunk)) { - chunk = Buffer.from(chunk, 'binary') - } - const chlen = chunk.length - this._bufpos = pos || 0 - let r - while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } - return r -} - -SBMH.prototype._sbmh_feed = function (data) { - const len = data.length - const needle = this._needle - const needleLength = needle.length - const lastNeedleChar = needle[needleLength - 1] - - // Positive: points to a position in `data` - // pos == 3 points to data[3] - // Negative: points to a position in the lookbehind buffer - // pos == -2 points to lookbehind[lookbehind_size - 2] - let pos = -this._lookbehind_size - let ch - - if (pos < 0) { - // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool - // search with character lookup code that considers both the - // lookbehind buffer and the current round's haystack data. - // - // Loop until - // there is a match. - // or until - // we've moved past the position that requires the - // lookbehind buffer. In this case we switch to the - // optimized loop. - // or until - // the character to look at lies outside the haystack. - while (pos < 0 && pos <= len - needleLength) { - ch = this._sbmh_lookup_char(data, pos + needleLength - 1) - - if ( - ch === lastNeedleChar && - this._sbmh_memcmp(data, pos, needleLength - 1) - ) { - this._lookbehind_size = 0 - ++this.matches - this.emit('info', true) - - return (this._bufpos = pos + needleLength) - } - pos += this._occ[ch] - } - - // No match. - - if (pos < 0) { - // There's too few data for Boyer-Moore-Horspool to run, - // so let's use a different algorithm to skip as much as - // we can. - // Forward pos until - // the trailing part of lookbehind + data - // looks like the beginning of the needle - // or until - // pos == 0 - while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } - } - - if (pos >= 0) { - // Discard lookbehind buffer. - this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) - this._lookbehind_size = 0 - } else { - // Cut off part of the lookbehind buffer that has - // been processed and append the entire haystack - // into it. - const bytesToCutOff = this._lookbehind_size + pos - if (bytesToCutOff > 0) { - // The cut off data is guaranteed not to contain the needle. - this.emit('info', false, this._lookbehind, 0, bytesToCutOff) - } - - this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, - this._lookbehind_size - bytesToCutOff) - this._lookbehind_size -= bytesToCutOff - - data.copy(this._lookbehind, this._lookbehind_size) - this._lookbehind_size += len - - this._bufpos = len - return len - } - } - - pos += (pos >= 0) * this._bufpos - - // Lookbehind buffer is now empty. We only need to check if the - // needle is in the haystack. - if (data.indexOf(needle, pos) !== -1) { - pos = data.indexOf(needle, pos) - ++this.matches - if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } - - return (this._bufpos = pos + needleLength) - } else { - pos = len - needleLength - } - - // There was no match. If there's trailing haystack data that we cannot - // match yet using the Boyer-Moore-Horspool algorithm (because the trailing - // data is less than the needle size) then match using a modified - // algorithm that starts matching from the beginning instead of the end. - // Whatever trailing data is left after running this algorithm is added to - // the lookbehind buffer. - while ( - pos < len && - ( - data[pos] !== needle[0] || - ( - (Buffer.compare( - data.subarray(pos, pos + len - pos), - needle.subarray(0, len - pos) - ) !== 0) - ) - ) - ) { - ++pos - } - if (pos < len) { - data.copy(this._lookbehind, 0, pos, pos + (len - pos)) - this._lookbehind_size = len - pos - } - - // Everything until pos is guaranteed not to contain needle data. - if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } - - this._bufpos = len - return len -} - -SBMH.prototype._sbmh_lookup_char = function (data, pos) { - return (pos < 0) - ? this._lookbehind[this._lookbehind_size + pos] - : data[pos] -} - -SBMH.prototype._sbmh_memcmp = function (data, pos, len) { - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } - } - return true -} - -module.exports = SBMH diff --git a/node_modules/@fastify/busboy/lib/main.d.ts b/node_modules/@fastify/busboy/lib/main.d.ts deleted file mode 100644 index 91b6448..0000000 --- a/node_modules/@fastify/busboy/lib/main.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -// Definitions by: Jacob Baskin -// BendingBender -// Igor Savin - -/// - -import * as http from 'http'; -import { Readable, Writable } from 'stream'; -export { Dicer } from "../deps/dicer/lib/dicer"; - -export const Busboy: BusboyConstructor; -export default Busboy; - -export interface BusboyConfig { - /** - * These are the HTTP headers of the incoming request, which are used by individual parsers. - */ - headers: BusboyHeaders; - /** - * `highWaterMark` to use for this Busboy instance. - * @default WritableStream default. - */ - highWaterMark?: number | undefined; - /** - * highWaterMark to use for file streams. - * @default ReadableStream default. - */ - fileHwm?: number | undefined; - /** - * Default character set to use when one isn't defined. - * @default 'utf8' - */ - defCharset?: string | undefined; - /** - * Detect if a Part is a file. - * - * By default a file is detected if contentType - * is application/octet-stream or fileName is not - * undefined. - * - * Modify this to handle e.g. Blobs. - */ - isPartAFile?: (fieldName: string | undefined, contentType: string | undefined, fileName: string | undefined) => boolean; - /** - * If paths in the multipart 'filename' field shall be preserved. - * @default false - */ - preservePath?: boolean | undefined; - /** - * Various limits on incoming data. - */ - limits?: - | { - /** - * Max field name size (in bytes) - * @default 100 bytes - */ - fieldNameSize?: number | undefined; - /** - * Max field value size (in bytes) - * @default 1MB - */ - fieldSize?: number | undefined; - /** - * Max number of non-file fields - * @default Infinity - */ - fields?: number | undefined; - /** - * For multipart forms, the max file size (in bytes) - * @default Infinity - */ - fileSize?: number | undefined; - /** - * For multipart forms, the max number of file fields - * @default Infinity - */ - files?: number | undefined; - /** - * For multipart forms, the max number of parts (fields + files) - * @default Infinity - */ - parts?: number | undefined; - /** - * For multipart forms, the max number of header key=>value pairs to parse - * @default 2000 - */ - headerPairs?: number | undefined; - - /** - * For multipart forms, the max size of a header part - * @default 81920 - */ - headerSize?: number | undefined; - } - | undefined; -} - -export type BusboyHeaders = { 'content-type': string } & http.IncomingHttpHeaders; - -export interface BusboyFileStream extends - Readable { - - truncated: boolean; - - /** - * The number of bytes that have been read so far. - */ - bytesRead: number; -} - -export interface Busboy extends Writable { - addListener(event: Event, listener: BusboyEvents[Event]): this; - - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - on(event: Event, listener: BusboyEvents[Event]): this; - - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: Event, listener: BusboyEvents[Event]): this; - - once(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: Event, listener: BusboyEvents[Event]): this; - - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - - off(event: Event, listener: BusboyEvents[Event]): this; - - off(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: Event, listener: BusboyEvents[Event]): this; - - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: Event, listener: BusboyEvents[Event]): this; - - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; -} - -export interface BusboyEvents { - /** - * Emitted for each new file form field found. - * - * * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the - * file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents), - * otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any** - * incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically - * and safely discarded (these discarded files do still count towards `files` and `parts` limits). - * * If a configured file size limit was reached, `stream` will both have a boolean property `truncated` - * (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens. - * - * @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream. - * @param listener.mimeType Contains the 'Content-Type' value for the file stream. - */ - file: ( - fieldname: string, - stream: BusboyFileStream, - filename: string, - transferEncoding: string, - mimeType: string, - ) => void; - /** - * Emitted for each new non-file field found. - */ - field: ( - fieldname: string, - value: string, - fieldnameTruncated: boolean, - valueTruncated: boolean, - transferEncoding: string, - mimeType: string, - ) => void; - finish: () => void; - /** - * Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted. - */ - partsLimit: () => void; - /** - * Emitted when specified `files` limit has been reached. No more 'file' events will be emitted. - */ - filesLimit: () => void; - /** - * Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted. - */ - fieldsLimit: () => void; - error: (error: unknown) => void; -} - -export interface BusboyConstructor { - (options: BusboyConfig): Busboy; - - new(options: BusboyConfig): Busboy; -} - diff --git a/node_modules/@fastify/busboy/lib/main.js b/node_modules/@fastify/busboy/lib/main.js deleted file mode 100644 index 8794beb..0000000 --- a/node_modules/@fastify/busboy/lib/main.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' - -const WritableStream = require('node:stream').Writable -const { inherits } = require('node:util') -const Dicer = require('../deps/dicer/lib/Dicer') - -const MultipartParser = require('./types/multipart') -const UrlencodedParser = require('./types/urlencoded') -const parseParams = require('./utils/parseParams') - -function Busboy (opts) { - if (!(this instanceof Busboy)) { return new Busboy(opts) } - - if (typeof opts !== 'object') { - throw new TypeError('Busboy expected an options-Object.') - } - if (typeof opts.headers !== 'object') { - throw new TypeError('Busboy expected an options-Object with headers-attribute.') - } - if (typeof opts.headers['content-type'] !== 'string') { - throw new TypeError('Missing Content-Type-header.') - } - - const { - headers, - ...streamOptions - } = opts - - this.opts = { - autoDestroy: false, - ...streamOptions - } - WritableStream.call(this, this.opts) - - this._done = false - this._parser = this.getParserByHeaders(headers) - this._finished = false -} -inherits(Busboy, WritableStream) - -Busboy.prototype.emit = function (ev) { - if (ev === 'finish') { - if (!this._done) { - this._parser?.end() - return - } else if (this._finished) { - return - } - this._finished = true - } - WritableStream.prototype.emit.apply(this, arguments) -} - -Busboy.prototype.getParserByHeaders = function (headers) { - const parsed = parseParams(headers['content-type']) - - const cfg = { - defCharset: this.opts.defCharset, - fileHwm: this.opts.fileHwm, - headers, - highWaterMark: this.opts.highWaterMark, - isPartAFile: this.opts.isPartAFile, - limits: this.opts.limits, - parsedConType: parsed, - preservePath: this.opts.preservePath - } - - if (MultipartParser.detect.test(parsed[0])) { - return new MultipartParser(this, cfg) - } - if (UrlencodedParser.detect.test(parsed[0])) { - return new UrlencodedParser(this, cfg) - } - throw new Error('Unsupported Content-Type.') -} - -Busboy.prototype._write = function (chunk, encoding, cb) { - this._parser.write(chunk, cb) -} - -module.exports = Busboy -module.exports.default = Busboy -module.exports.Busboy = Busboy - -module.exports.Dicer = Dicer diff --git a/node_modules/@fastify/busboy/lib/types/multipart.js b/node_modules/@fastify/busboy/lib/types/multipart.js deleted file mode 100644 index d691eca..0000000 --- a/node_modules/@fastify/busboy/lib/types/multipart.js +++ /dev/null @@ -1,306 +0,0 @@ -'use strict' - -// TODO: -// * support 1 nested multipart level -// (see second multipart example here: -// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) -// * support limits.fieldNameSize -// -- this will require modifications to utils.parseParams - -const { Readable } = require('node:stream') -const { inherits } = require('node:util') - -const Dicer = require('../../deps/dicer/lib/Dicer') - -const parseParams = require('../utils/parseParams') -const decodeText = require('../utils/decodeText') -const basename = require('../utils/basename') -const getLimit = require('../utils/getLimit') - -const RE_BOUNDARY = /^boundary$/i -const RE_FIELD = /^form-data$/i -const RE_CHARSET = /^charset$/i -const RE_FILENAME = /^filename$/i -const RE_NAME = /^name$/i - -Multipart.detect = /^multipart\/form-data/i -function Multipart (boy, cfg) { - let i - let len - const self = this - let boundary - const limits = cfg.limits - const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) - const parsedConType = cfg.parsedConType || [] - const defCharset = cfg.defCharset || 'utf8' - const preservePath = cfg.preservePath - const fileOpts = { highWaterMark: cfg.fileHwm } - - for (i = 0, len = parsedConType.length; i < len; ++i) { - if (Array.isArray(parsedConType[i]) && - RE_BOUNDARY.test(parsedConType[i][0])) { - boundary = parsedConType[i][1] - break - } - } - - function checkFinished () { - if (nends === 0 && finished && !boy._done) { - finished = false - self.end() - } - } - - if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } - - const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) - const filesLimit = getLimit(limits, 'files', Infinity) - const fieldsLimit = getLimit(limits, 'fields', Infinity) - const partsLimit = getLimit(limits, 'parts', Infinity) - const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) - const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) - - let nfiles = 0 - let nfields = 0 - let nends = 0 - let curFile - let curField - let finished = false - - this._needDrain = false - this._pause = false - this._cb = undefined - this._nparts = 0 - this._boy = boy - - const parserCfg = { - boundary, - maxHeaderPairs: headerPairsLimit, - maxHeaderSize: headerSizeLimit, - partHwm: fileOpts.highWaterMark, - highWaterMark: cfg.highWaterMark - } - - this.parser = new Dicer(parserCfg) - this.parser.on('drain', function () { - self._needDrain = false - if (self._cb && !self._pause) { - const cb = self._cb - self._cb = undefined - cb() - } - }).on('part', function onPart (part) { - if (++self._nparts > partsLimit) { - self.parser.removeListener('part', onPart) - self.parser.on('part', skipPart) - boy.hitPartsLimit = true - boy.emit('partsLimit') - return skipPart(part) - } - - // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let - // us emit 'end' early since we know the part has ended if we are already - // seeing the next part - if (curField) { - const field = curField - field.emit('end') - field.removeAllListeners('end') - } - - part.on('header', function (header) { - let contype - let fieldname - let parsed - let charset - let encoding - let filename - let nsize = 0 - - if (header['content-type']) { - parsed = parseParams(header['content-type'][0]) - if (parsed[0]) { - contype = parsed[0].toLowerCase() - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_CHARSET.test(parsed[i][0])) { - charset = parsed[i][1].toLowerCase() - break - } - } - } - } - - if (contype === undefined) { contype = 'text/plain' } - if (charset === undefined) { charset = defCharset } - - if (header['content-disposition']) { - parsed = parseParams(header['content-disposition'][0]) - if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_NAME.test(parsed[i][0])) { - fieldname = parsed[i][1] - } else if (RE_FILENAME.test(parsed[i][0])) { - filename = parsed[i][1] - if (!preservePath) { filename = basename(filename) } - } - } - } else { return skipPart(part) } - - if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } - - let onData, - onEnd - - if (isPartAFile(fieldname, contype, filename)) { - // file/binary field - if (nfiles === filesLimit) { - if (!boy.hitFilesLimit) { - boy.hitFilesLimit = true - boy.emit('filesLimit') - } - return skipPart(part) - } - - ++nfiles - - if (boy.listenerCount('file') === 0) { - self.parser._ignore() - return - } - - ++nends - const file = new FileStream(fileOpts) - curFile = file - file.on('end', function () { - --nends - self._pause = false - checkFinished() - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - }) - file._read = function (n) { - if (!self._pause) { return } - self._pause = false - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - } - boy.emit('file', fieldname, file, filename, encoding, contype) - - onData = function (data) { - if ((nsize += data.length) > fileSizeLimit) { - const extralen = fileSizeLimit - nsize + data.length - if (extralen > 0) { file.push(data.slice(0, extralen)) } - file.truncated = true - file.bytesRead = fileSizeLimit - part.removeAllListeners('data') - file.emit('limit') - return - } else if (!file.push(data)) { self._pause = true } - - file.bytesRead = nsize - } - - onEnd = function () { - curFile = undefined - file.push(null) - } - } else { - // non-file field - if (nfields === fieldsLimit) { - if (!boy.hitFieldsLimit) { - boy.hitFieldsLimit = true - boy.emit('fieldsLimit') - } - return skipPart(part) - } - - ++nfields - ++nends - let buffer = '' - let truncated = false - curField = part - - onData = function (data) { - if ((nsize += data.length) > fieldSizeLimit) { - const extralen = (fieldSizeLimit - (nsize - data.length)) - buffer += data.toString('binary', 0, extralen) - truncated = true - part.removeAllListeners('data') - } else { buffer += data.toString('binary') } - } - - onEnd = function () { - curField = undefined - if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } - boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) - --nends - checkFinished() - } - } - - /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become - broken. Streams2/streams3 is a huge black box of confusion, but - somehow overriding the sync state seems to fix things again (and still - seems to work for previous node versions). - */ - part._readableState.sync = false - - part.on('data', onData) - part.on('end', onEnd) - }).on('error', function (err) { - if (curFile) { curFile.emit('error', err) } - }) - }).on('error', function (err) { - boy.emit('error', err) - }).on('finish', function () { - finished = true - checkFinished() - }) -} - -Multipart.prototype.write = function (chunk, cb) { - const r = this.parser.write(chunk) - if (r && !this._pause) { - cb() - } else { - this._needDrain = !r - this._cb = cb - } -} - -Multipart.prototype.end = function () { - const self = this - - if (self.parser.writable) { - self.parser.end() - } else if (!self._boy._done) { - process.nextTick(function () { - self._boy._done = true - self._boy.emit('finish') - }) - } -} - -function skipPart (part) { - part.resume() -} - -function FileStream (opts) { - Readable.call(this, opts) - - this.bytesRead = 0 - - this.truncated = false -} - -inherits(FileStream, Readable) - -FileStream.prototype._read = function (n) {} - -module.exports = Multipart diff --git a/node_modules/@fastify/busboy/lib/types/urlencoded.js b/node_modules/@fastify/busboy/lib/types/urlencoded.js deleted file mode 100644 index 6f5f784..0000000 --- a/node_modules/@fastify/busboy/lib/types/urlencoded.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict' - -const Decoder = require('../utils/Decoder') -const decodeText = require('../utils/decodeText') -const getLimit = require('../utils/getLimit') - -const RE_CHARSET = /^charset$/i - -UrlEncoded.detect = /^application\/x-www-form-urlencoded/i -function UrlEncoded (boy, cfg) { - const limits = cfg.limits - const parsedConType = cfg.parsedConType - this.boy = boy - - this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) - this.fieldsLimit = getLimit(limits, 'fields', Infinity) - - let charset - for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var - if (Array.isArray(parsedConType[i]) && - RE_CHARSET.test(parsedConType[i][0])) { - charset = parsedConType[i][1].toLowerCase() - break - } - } - - if (charset === undefined) { charset = cfg.defCharset || 'utf8' } - - this.decoder = new Decoder() - this.charset = charset - this._fields = 0 - this._state = 'key' - this._checkingBytes = true - this._bytesKey = 0 - this._bytesVal = 0 - this._key = '' - this._val = '' - this._keyTrunc = false - this._valTrunc = false - this._hitLimit = false -} - -UrlEncoded.prototype.write = function (data, cb) { - if (this._fields === this.fieldsLimit) { - if (!this.boy.hitFieldsLimit) { - this.boy.hitFieldsLimit = true - this.boy.emit('fieldsLimit') - } - return cb() - } - - let idxeq; let idxamp; let i; let p = 0; const len = data.length - - while (p < len) { - if (this._state === 'key') { - idxeq = idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x3D/* = */) { - idxeq = i - break - } else if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesKey } - } - - if (idxeq !== undefined) { - // key with assignment - if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } - this._state = 'val' - - this._hitLimit = false - this._checkingBytes = true - this._val = '' - this._bytesVal = 0 - this._valTrunc = false - this.decoder.reset() - - p = idxeq + 1 - } else if (idxamp !== undefined) { - // key with no assignment - ++this._fields - let key; const keyTrunc = this._keyTrunc - if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } - - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() - - if (key.length) { - this.boy.emit('field', decodeText(key, 'binary', this.charset), - '', - keyTrunc, - false) - } - - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._keyTrunc = true - } - } else { - if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } - p = len - } - } else { - idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesVal } - } - - if (idxamp !== undefined) { - ++this._fields - if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) - this._state = 'key' - - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() - - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._val === '' && this.fieldSizeLimit === 0) || - (this._bytesVal = this._val.length) === this.fieldSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._valTrunc = true - } - } else { - if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } - p = len - } - } - } - cb() -} - -UrlEncoded.prototype.end = function () { - if (this.boy._done) { return } - - if (this._state === 'key' && this._key.length > 0) { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - '', - this._keyTrunc, - false) - } else if (this._state === 'val') { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) - } - this.boy._done = true - this.boy.emit('finish') -} - -module.exports = UrlEncoded diff --git a/node_modules/@fastify/busboy/lib/utils/Decoder.js b/node_modules/@fastify/busboy/lib/utils/Decoder.js deleted file mode 100644 index 7917678..0000000 --- a/node_modules/@fastify/busboy/lib/utils/Decoder.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict' - -const RE_PLUS = /\+/g - -const HEX = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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 -] - -function Decoder () { - this.buffer = undefined -} -Decoder.prototype.write = function (str) { - // Replace '+' with ' ' before decoding - str = str.replace(RE_PLUS, ' ') - let res = '' - let i = 0; let p = 0; const len = str.length - for (; i < len; ++i) { - if (this.buffer !== undefined) { - if (!HEX[str.charCodeAt(i)]) { - res += '%' + this.buffer - this.buffer = undefined - --i // retry character - } else { - this.buffer += str[i] - ++p - if (this.buffer.length === 2) { - res += String.fromCharCode(parseInt(this.buffer, 16)) - this.buffer = undefined - } - } - } else if (str[i] === '%') { - if (i > p) { - res += str.substring(p, i) - p = i - } - this.buffer = '' - ++p - } - } - if (p < len && this.buffer === undefined) { res += str.substring(p) } - return res -} -Decoder.prototype.reset = function () { - this.buffer = undefined -} - -module.exports = Decoder diff --git a/node_modules/@fastify/busboy/lib/utils/basename.js b/node_modules/@fastify/busboy/lib/utils/basename.js deleted file mode 100644 index db58819..0000000 --- a/node_modules/@fastify/busboy/lib/utils/basename.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -module.exports = function basename (path) { - if (typeof path !== 'string') { return '' } - for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var - switch (path.charCodeAt(i)) { - case 0x2F: // '/' - case 0x5C: // '\' - path = path.slice(i + 1) - return (path === '..' || path === '.' ? '' : path) - } - } - return (path === '..' || path === '.' ? '' : path) -} diff --git a/node_modules/@fastify/busboy/lib/utils/decodeText.js b/node_modules/@fastify/busboy/lib/utils/decodeText.js deleted file mode 100644 index eac7d35..0000000 --- a/node_modules/@fastify/busboy/lib/utils/decodeText.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict' - -// Node has always utf-8 -const utf8Decoder = new TextDecoder('utf-8') -const textDecoders = new Map([ - ['utf-8', utf8Decoder], - ['utf8', utf8Decoder] -]) - -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, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.utf8Slice(0, data.length) - }, - - latin1: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - return data - } - return data.latin1Slice(0, data.length) - }, - - utf16le: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.ucs2Slice(0, data.length) - }, - - base64: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.base64Slice(0, data.length) - }, - - other: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - - if (textDecoders.has(this.toString())) { - try { - return textDecoders.get(this).decode(data) - } catch {} - } - return typeof data === 'string' - ? data - : data.toString() - } -} - -function decodeText (text, sourceEncoding, destEncoding) { - if (text) { - return getDecoder(destEncoding)(text, sourceEncoding) - } - return text -} - -module.exports = decodeText diff --git a/node_modules/@fastify/busboy/lib/utils/getLimit.js b/node_modules/@fastify/busboy/lib/utils/getLimit.js deleted file mode 100644 index cb64fd6..0000000 --- a/node_modules/@fastify/busboy/lib/utils/getLimit.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -module.exports = function getLimit (limits, name, defaultLimit) { - if ( - !limits || - limits[name] === undefined || - limits[name] === null - ) { return defaultLimit } - - if ( - typeof limits[name] !== 'number' || - isNaN(limits[name]) - ) { throw new TypeError('Limit ' + name + ' is not a valid number') } - - return limits[name] -} diff --git a/node_modules/@fastify/busboy/lib/utils/parseParams.js b/node_modules/@fastify/busboy/lib/utils/parseParams.js deleted file mode 100644 index 1698e62..0000000 --- a/node_modules/@fastify/busboy/lib/utils/parseParams.js +++ /dev/null @@ -1,196 +0,0 @@ -/* eslint-disable object-property-newline */ -'use strict' - -const decodeText = require('./decodeText') - -const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g - -const EncodedLookup = { - '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', - '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', - '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', - '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', - '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', - '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', - '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', - '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', - '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', - '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', - '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', - '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', - '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', - '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', - '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', - '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', - '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', - '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', - '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', - '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', - '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', - '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', - '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', - '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', - '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', - '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', - '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', - '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', - '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', - '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', - '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', - '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', - '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', - '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', - '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', - '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', - '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', - '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', - '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', - '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', - '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', - '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', - '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', - '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', - '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', - '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', - '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', - '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', - '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', - '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', - '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', - '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', - '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', - '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', - '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', - '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', - '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', - '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', - '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', - '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', - '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', - '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', - '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', - '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', - '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', - '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', - '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', - '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', - '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', - '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', - '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', - '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', - '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', - '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', - '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', - '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', - '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', - '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', - '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', - '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', - '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', - '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', - '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', - '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', - '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', - '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', - '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', - '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', - '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', - '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', - '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', - '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', - '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', - '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', - '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', - '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', - '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' -} - -function encodedReplacer (match) { - return EncodedLookup[match] -} - -const STATE_KEY = 0 -const STATE_VALUE = 1 -const STATE_CHARSET = 2 -const STATE_LANG = 3 - -function parseParams (str) { - const res = [] - let state = STATE_KEY - let charset = '' - let inquote = false - let escaping = false - let p = 0 - let tmp = '' - const len = str.length - - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - const char = str[i] - if (char === '\\' && inquote) { - if (escaping) { escaping = false } else { - escaping = true - continue - } - } else if (char === '"') { - if (!escaping) { - if (inquote) { - inquote = false - state = STATE_KEY - } else { inquote = true } - continue - } else { escaping = false } - } else { - if (escaping && inquote) { tmp += '\\' } - escaping = false - if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { - if (state === STATE_CHARSET) { - state = STATE_LANG - charset = tmp.substring(1) - } else { state = STATE_VALUE } - tmp = '' - continue - } else if (state === STATE_KEY && - (char === '*' || char === '=') && - res.length) { - state = char === '*' - ? STATE_CHARSET - : STATE_VALUE - res[p] = [tmp, undefined] - tmp = '' - continue - } else if (!inquote && char === ';') { - state = STATE_KEY - if (charset) { - if (tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } - charset = '' - } else if (tmp.length) { - tmp = decodeText(tmp, 'binary', 'utf8') - } - if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } - tmp = '' - ++p - continue - } else if (!inquote && (char === ' ' || char === '\t')) { continue } - } - tmp += char - } - if (charset && tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } else if (tmp) { - tmp = decodeText(tmp, 'binary', 'utf8') - } - - if (res[p] === undefined) { - if (tmp) { res[p] = tmp } - } else { res[p][1] = tmp } - - return res -} - -module.exports = parseParams diff --git a/node_modules/@fastify/busboy/package.json b/node_modules/@fastify/busboy/package.json deleted file mode 100644 index 83693ac..0000000 --- a/node_modules/@fastify/busboy/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "@fastify/busboy", - "version": "2.1.1", - "private": false, - "author": "Brian White ", - "contributors": [ - { - "name": "Igor Savin", - "email": "kibertoad@gmail.com", - "url": "https://github.com/kibertoad" - }, - { - "name": "Aras Abbasi", - "email": "aras.abbasi@gmail.com", - "url": "https://github.com/uzlopak" - } - ], - "description": "A streaming parser for HTML form data for node.js", - "main": "lib/main", - "type": "commonjs", - "types": "lib/main.d.ts", - "scripts": { - "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify", - "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js", - "coveralls": "nyc report --reporter=lcov", - "lint": "npm run lint:standard", - "lint:everything": "npm run lint && npm run test:types", - "lint:fix": "standard --fix", - "lint:standard": "standard --verbose | snazzy", - "test:mocha": "tap", - "test:types": "tsd", - "test:coverage": "nyc npm run test", - "test": "npm run test:mocha" - }, - "engines": { - "node": ">=14" - }, - "devDependencies": { - "@types/node": "^20.1.0", - "busboy": "^1.0.0", - "photofinish": "^1.8.0", - "snazzy": "^9.0.0", - "standard": "^17.0.0", - "tap": "^16.3.8", - "tinybench": "^2.5.1", - "tsd": "^0.30.0", - "typescript": "^5.0.2" - }, - "keywords": [ - "uploads", - "forms", - "multipart", - "form-data" - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/fastify/busboy.git" - }, - "tsd": { - "directory": "test/types", - "compilerOptions": { - "esModuleInterop": false, - "module": "commonjs", - "target": "ES2017" - } - }, - "standard": { - "globals": [ - "describe", - "it" - ], - "ignore": [ - "bench" - ] - }, - "files": [ - "README.md", - "LICENSE", - "lib/*", - "deps/encoding/*", - "deps/dicer/lib", - "deps/streamsearch/", - "deps/dicer/LICENSE" - ] -} diff --git a/node_modules/anymatch/index.d.ts b/node_modules/anymatch/index.d.ts deleted file mode 100644 index 3ef7eaa..0000000 --- a/node_modules/anymatch/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -type AnymatchFn = (testString: string) => boolean; -type AnymatchPattern = string|RegExp|AnymatchFn; -type AnymatchMatcher = AnymatchPattern|AnymatchPattern[] -type AnymatchTester = { - (testString: string|any[], returnIndex: true): number; - (testString: string|any[]): boolean; -} - -type PicomatchOptions = {dot: boolean}; - -declare const anymatch: { - (matchers: AnymatchMatcher): AnymatchTester; - (matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester; - (matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number; - (matchers: AnymatchMatcher, testString: string|any[]): boolean; -} - -export {AnymatchMatcher as Matcher} -export {AnymatchTester as Tester} -export default anymatch diff --git a/node_modules/anymatch/index.js b/node_modules/anymatch/index.js deleted file mode 100644 index 8eb73e9..0000000 --- a/node_modules/anymatch/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { value: true }); - -const picomatch = require('picomatch'); -const normalizePath = require('normalize-path'); - -/** - * @typedef {(testString: string) => boolean} AnymatchFn - * @typedef {string|RegExp|AnymatchFn} AnymatchPattern - * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher - */ -const BANG = '!'; -const DEFAULT_OPTIONS = {returnIndex: false}; -const arrify = (item) => Array.isArray(item) ? item : [item]; - -/** - * @param {AnymatchPattern} matcher - * @param {object} options - * @returns {AnymatchFn} - */ -const createPattern = (matcher, options) => { - if (typeof matcher === 'function') { - return matcher; - } - if (typeof matcher === 'string') { - const glob = picomatch(matcher, options); - return (string) => matcher === string || glob(string); - } - if (matcher instanceof RegExp) { - return (string) => matcher.test(string); - } - return (string) => false; -}; - -/** - * @param {Array} patterns - * @param {Array} negPatterns - * @param {String|Array} args - * @param {Boolean} returnIndex - * @returns {boolean|number} - */ -const matchPatterns = (patterns, negPatterns, args, returnIndex) => { - const isList = Array.isArray(args); - const _path = isList ? args[0] : args; - if (!isList && typeof _path !== 'string') { - throw new TypeError('anymatch: second argument must be a string: got ' + - Object.prototype.toString.call(_path)) - } - const path = normalizePath(_path, false); - - for (let index = 0; index < negPatterns.length; index++) { - const nglob = negPatterns[index]; - if (nglob(path)) { - return returnIndex ? -1 : false; - } - } - - const applied = isList && [path].concat(args.slice(1)); - for (let index = 0; index < patterns.length; index++) { - const pattern = patterns[index]; - if (isList ? pattern(...applied) : pattern(path)) { - return returnIndex ? index : true; - } - } - - return returnIndex ? -1 : false; -}; - -/** - * @param {AnymatchMatcher} matchers - * @param {Array|string} testString - * @param {object} options - * @returns {boolean|number|Function} - */ -const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { - if (matchers == null) { - throw new TypeError('anymatch: specify first argument'); - } - const opts = typeof options === 'boolean' ? {returnIndex: options} : options; - const returnIndex = opts.returnIndex || false; - - // Early cache for matchers. - const mtchers = arrify(matchers); - const negatedGlobs = mtchers - .filter(item => typeof item === 'string' && item.charAt(0) === BANG) - .map(item => item.slice(1)) - .map(item => picomatch(item, opts)); - const patterns = mtchers - .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) - .map(matcher => createPattern(matcher, opts)); - - if (testString == null) { - return (testString, ri = false) => { - const returnIndex = typeof ri === 'boolean' ? ri : false; - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); - } - } - - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); -}; - -anymatch.default = anymatch; -module.exports = anymatch; diff --git a/node_modules/anymatch/package.json b/node_modules/anymatch/package.json deleted file mode 100644 index 2cb2307..0000000 --- a/node_modules/anymatch/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "anymatch", - "version": "3.1.3", - "description": "Matches strings against configurable strings, globs, regular expressions, and/or functions", - "files": [ - "index.js", - "index.d.ts" - ], - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "author": { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - "license": "ISC", - "homepage": "https://github.com/micromatch/anymatch", - "repository": { - "type": "git", - "url": "https://github.com/micromatch/anymatch" - }, - "keywords": [ - "match", - "any", - "string", - "file", - "fs", - "list", - "glob", - "regex", - "regexp", - "regular", - "expression", - "function" - ], - "scripts": { - "test": "nyc mocha", - "mocha": "mocha" - }, - "devDependencies": { - "mocha": "^6.1.3", - "nyc": "^14.0.0" - }, - "engines": { - "node": ">= 8" - } -} diff --git a/node_modules/binary-extensions/binary-extensions.json b/node_modules/binary-extensions/binary-extensions.json deleted file mode 100644 index ac08048..0000000 --- a/node_modules/binary-extensions/binary-extensions.json +++ /dev/null @@ -1,263 +0,0 @@ -[ - "3dm", - "3ds", - "3g2", - "3gp", - "7z", - "a", - "aac", - "adp", - "afdesign", - "afphoto", - "afpub", - "ai", - "aif", - "aiff", - "alz", - "ape", - "apk", - "appimage", - "ar", - "arj", - "asf", - "au", - "avi", - "bak", - "baml", - "bh", - "bin", - "bk", - "bmp", - "btif", - "bz2", - "bzip2", - "cab", - "caf", - "cgm", - "class", - "cmx", - "cpio", - "cr2", - "cur", - "dat", - "dcm", - "deb", - "dex", - "djvu", - "dll", - "dmg", - "dng", - "doc", - "docm", - "docx", - "dot", - "dotm", - "dra", - "DS_Store", - "dsk", - "dts", - "dtshd", - "dvb", - "dwg", - "dxf", - "ecelp4800", - "ecelp7470", - "ecelp9600", - "egg", - "eol", - "eot", - "epub", - "exe", - "f4v", - "fbs", - "fh", - "fla", - "flac", - "flatpak", - "fli", - "flv", - "fpx", - "fst", - "fvt", - "g3", - "gh", - "gif", - "graffle", - "gz", - "gzip", - "h261", - "h263", - "h264", - "icns", - "ico", - "ief", - "img", - "ipa", - "iso", - "jar", - "jpeg", - "jpg", - "jpgv", - "jpm", - "jxr", - "key", - "ktx", - "lha", - "lib", - "lvp", - "lz", - "lzh", - "lzma", - "lzo", - "m3u", - "m4a", - "m4v", - "mar", - "mdi", - "mht", - "mid", - "midi", - "mj2", - "mka", - "mkv", - "mmr", - "mng", - "mobi", - "mov", - "movie", - "mp3", - "mp4", - "mp4a", - "mpeg", - "mpg", - "mpga", - "mxu", - "nef", - "npx", - "numbers", - "nupkg", - "o", - "odp", - "ods", - "odt", - "oga", - "ogg", - "ogv", - "otf", - "ott", - "pages", - "pbm", - "pcx", - "pdb", - "pdf", - "pea", - "pgm", - "pic", - "png", - "pnm", - "pot", - "potm", - "potx", - "ppa", - "ppam", - "ppm", - "pps", - "ppsm", - "ppsx", - "ppt", - "pptm", - "pptx", - "psd", - "pya", - "pyc", - "pyo", - "pyv", - "qt", - "rar", - "ras", - "raw", - "resources", - "rgb", - "rip", - "rlc", - "rmf", - "rmvb", - "rpm", - "rtf", - "rz", - "s3m", - "s7z", - "scpt", - "sgi", - "shar", - "snap", - "sil", - "sketch", - "slk", - "smv", - "snk", - "so", - "stl", - "suo", - "sub", - "swf", - "tar", - "tbz", - "tbz2", - "tga", - "tgz", - "thmx", - "tif", - "tiff", - "tlz", - "ttc", - "ttf", - "txz", - "udf", - "uvh", - "uvi", - "uvm", - "uvp", - "uvs", - "uvu", - "viv", - "vob", - "war", - "wav", - "wax", - "wbmp", - "wdp", - "weba", - "webm", - "webp", - "whl", - "wim", - "wm", - "wma", - "wmv", - "wmx", - "woff", - "woff2", - "wrm", - "wvx", - "xbm", - "xif", - "xla", - "xlam", - "xls", - "xlsb", - "xlsm", - "xlsx", - "xlt", - "xltm", - "xltx", - "xm", - "xmind", - "xpi", - "xpm", - "xwd", - "xz", - "z", - "zip", - "zipx" -] diff --git a/node_modules/binary-extensions/binary-extensions.json.d.ts b/node_modules/binary-extensions/binary-extensions.json.d.ts deleted file mode 100644 index 94a248c..0000000 --- a/node_modules/binary-extensions/binary-extensions.json.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const binaryExtensionsJson: readonly string[]; - -export = binaryExtensionsJson; diff --git a/node_modules/binary-extensions/index.d.ts b/node_modules/binary-extensions/index.d.ts deleted file mode 100644 index f469ac5..0000000 --- a/node_modules/binary-extensions/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** -List of binary file extensions. - -@example -``` -import binaryExtensions = require('binary-extensions'); - -console.log(binaryExtensions); -//=> ['3ds', '3g2', …] -``` -*/ -declare const binaryExtensions: readonly string[]; - -export = binaryExtensions; diff --git a/node_modules/binary-extensions/index.js b/node_modules/binary-extensions/index.js deleted file mode 100644 index d46e468..0000000 --- a/node_modules/binary-extensions/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./binary-extensions.json'); diff --git a/node_modules/binary-extensions/package.json b/node_modules/binary-extensions/package.json deleted file mode 100644 index 4710c33..0000000 --- a/node_modules/binary-extensions/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "binary-extensions", - "version": "2.3.0", - "description": "List of binary file extensions", - "license": "MIT", - "repository": "sindresorhus/binary-extensions", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "sideEffects": false, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts", - "binary-extensions.json", - "binary-extensions.json.d.ts" - ], - "keywords": [ - "binary", - "extensions", - "extension", - "file", - "json", - "list", - "array" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js index bb24d73..d722d0b 100644 --- a/node_modules/body-parser/index.js +++ b/node_modules/body-parser/index.js @@ -6,20 +6,6 @@ 'use strict' -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('body-parser') - -/** - * Cache of loaded parsers. - * @private - */ - -var parsers = Object.create(null) - /** * @typedef Parsers * @type {function} @@ -34,8 +20,7 @@ var parsers = Object.create(null) * @type {Parsers} */ -exports = module.exports = deprecate.function(bodyParser, - 'bodyParser: use individual json/urlencoded middlewares') +exports = module.exports = bodyParser /** * JSON parser. @@ -45,7 +30,7 @@ exports = module.exports = deprecate.function(bodyParser, Object.defineProperty(exports, 'json', { configurable: true, enumerable: true, - get: createParserGetter('json') + get: () => require('./lib/types/json') }) /** @@ -56,7 +41,7 @@ Object.defineProperty(exports, 'json', { Object.defineProperty(exports, 'raw', { configurable: true, enumerable: true, - get: createParserGetter('raw') + get: () => require('./lib/types/raw') }) /** @@ -67,7 +52,7 @@ Object.defineProperty(exports, 'raw', { Object.defineProperty(exports, 'text', { configurable: true, enumerable: true, - get: createParserGetter('text') + get: () => require('./lib/types/text') }) /** @@ -78,7 +63,7 @@ Object.defineProperty(exports, 'text', { Object.defineProperty(exports, 'urlencoded', { configurable: true, enumerable: true, - get: createParserGetter('urlencoded') + get: () => require('./lib/types/urlencoded') }) /** @@ -90,67 +75,6 @@ Object.defineProperty(exports, 'urlencoded', { * @public */ -function bodyParser (options) { - // use default type for parsers - var opts = Object.create(options || null, { - type: { - configurable: true, - enumerable: true, - value: undefined, - writable: true - } - }) - - var _urlencoded = exports.urlencoded(opts) - var _json = exports.json(opts) - - return function bodyParser (req, res, next) { - _json(req, res, function (err) { - if (err) return next(err) - _urlencoded(req, res, next) - }) - } -} - -/** - * Create a getter for loading a parser. - * @private - */ - -function createParserGetter (name) { - return function get () { - return loadParser(name) - } -} - -/** - * Load a parser module. - * @private - */ - -function loadParser (parserName) { - var parser = parsers[parserName] - - if (parser !== undefined) { - return parser - } - - // this uses a switch for static require analysis - switch (parserName) { - case 'json': - parser = require('./lib/types/json') - break - case 'raw': - parser = require('./lib/types/raw') - break - case 'text': - parser = require('./lib/types/text') - break - case 'urlencoded': - parser = require('./lib/types/urlencoded') - break - } - - // store to prevent invoking require() - return (parsers[parserName] = parser) +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 index fce6283..eee8b11 100644 --- a/node_modules/body-parser/lib/read.js +++ b/node_modules/body-parser/lib/read.js @@ -12,12 +12,10 @@ */ var createError = require('http-errors') -var destroy = require('destroy') var getBody = require('raw-body') var iconv = require('iconv-lite') var onFinished = require('on-finished') -var unpipe = require('unpipe') -var zlib = require('zlib') +var zlib = require('node:zlib') /** * Module exports. @@ -42,9 +40,6 @@ function read (req, res, next, parse, debug, options) { var opts = options var stream - // flag as parsed - req._body = true - // read options var encoding = opts.encoding !== null ? opts.encoding @@ -93,8 +88,8 @@ function read (req, res, next, parse, debug, options) { // unpipe from stream and destroy if (stream !== req) { - unpipe(req) - destroy(stream, true) + req.unpipe() + stream.destroy() } // read off entire request @@ -125,7 +120,7 @@ function read (req, res, next, parse, debug, options) { str = typeof body !== 'string' && encoding !== null ? iconv.decode(body, encoding) : body - req.body = parse(str) + req.body = parse(str, encoding) } catch (err) { next(createError(400, err, { body: str, @@ -151,7 +146,6 @@ function read (req, res, next, parse, debug, options) { function contentstream (req, debug, inflate) { var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() var length = req.headers['content-length'] - var stream debug('content-encoding "%s"', encoding) @@ -162,29 +156,40 @@ function contentstream (req, debug, inflate) { }) } + 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': - stream = zlib.createInflate() debug('inflate body') - req.pipe(stream) - break + return zlib.createInflate() case 'gzip': - stream = zlib.createGunzip() debug('gunzip body') - req.pipe(stream) - break - case 'identity': - stream = req - stream.length = length - break + 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' }) } - - return stream } /** diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js index 59f3f7e..078ce71 100644 --- a/node_modules/body-parser/lib/types/json.js +++ b/node_modules/body-parser/lib/types/json.js @@ -12,12 +12,12 @@ * @private */ -var bytes = require('bytes') -var contentType = require('content-type') 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. @@ -51,25 +51,10 @@ var JSON_SYNTAX_REGEXP = /#+/g */ function json (options) { - var opts = options || {} + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/json') - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var inflate = opts.inflate !== false - var reviver = opts.reviver - var strict = opts.strict !== false - var type = opts.type || 'application/json' - var verify = opts.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 + var reviver = options?.reviver + var strict = options?.strict !== false function parse (body) { if (body.length === 0) { @@ -99,13 +84,15 @@ function json (options) { } return function jsonParser (req, res, next) { - if (req._body) { + if (isFinished(req)) { debug('body already parsed') next() return } - req.body = req.body || {} + if (!('body' in req)) { + req.body = undefined + } // skip requests without bodies if (!typeis.hasBody(req)) { @@ -137,9 +124,9 @@ function json (options) { // read read(req, res, next, parse, debug, { encoding: charset, - inflate: inflate, - limit: limit, - verify: verify + inflate, + limit, + verify }) } } @@ -193,21 +180,6 @@ function firstchar (str) { : undefined } -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - /** * Normalize a SyntaxError for JSON.parse. * @@ -232,16 +204,3 @@ function normalizeJsonSyntaxError (error, obj) { return error } - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js index f5d1b67..3788ff2 100644 --- a/node_modules/body-parser/lib/types/raw.js +++ b/node_modules/body-parser/lib/types/raw.js @@ -10,10 +10,11 @@ * Module dependencies. */ -var bytes = require('bytes') 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. @@ -30,36 +31,22 @@ module.exports = raw */ function raw (options) { - var opts = options || {} - - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/octet-stream' - var verify = opts.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 + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/octet-stream') function parse (buf) { return buf } return function rawParser (req, res, next) { - if (req._body) { + if (isFinished(req)) { debug('body already parsed') next() return } - req.body = req.body || {} + if (!('body' in req)) { + req.body = undefined + } // skip requests without bodies if (!typeis.hasBody(req)) { @@ -80,22 +67,9 @@ function raw (options) { // read read(req, res, next, parse, debug, { encoding: null, - inflate: inflate, - limit: limit, - verify: verify + inflate, + limit, + verify }) } } - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js index 083a009..3e0ab1b 100644 --- a/node_modules/body-parser/lib/types/text.js +++ b/node_modules/body-parser/lib/types/text.js @@ -10,11 +10,11 @@ * Module dependencies. */ -var bytes = require('bytes') -var contentType = require('content-type') 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. @@ -31,37 +31,24 @@ module.exports = text */ function text (options) { - var opts = options || {} + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'text/plain') - var defaultCharset = opts.defaultCharset || 'utf-8' - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'text/plain' - var verify = opts.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 + var defaultCharset = options?.defaultCharset || 'utf-8' function parse (buf) { return buf } return function textParser (req, res, next) { - if (req._body) { + if (isFinished(req)) { debug('body already parsed') next() return } - req.body = req.body || {} + if (!('body' in req)) { + req.body = undefined + } // skip requests without bodies if (!typeis.hasBody(req)) { @@ -85,37 +72,9 @@ function text (options) { // read read(req, res, next, parse, debug, { encoding: charset, - inflate: inflate, - limit: limit, - verify: verify + inflate, + limit, + verify }) } } - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js index 2bd4485..f993425 100644 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ b/node_modules/body-parser/lib/types/urlencoded.js @@ -12,13 +12,13 @@ * @private */ -var bytes = require('bytes') -var contentType = require('content-type') var createError = require('http-errors') var debug = require('debug')('body-parser:urlencoded') -var deprecate = require('depd')('body-parser') +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. @@ -26,12 +26,6 @@ var typeis = require('type-is') module.exports = urlencoded -/** - * Cache of parser modules. - */ - -var parsers = Object.create(null) - /** * Create a middleware to parse urlencoded bodies. * @@ -41,52 +35,32 @@ var parsers = Object.create(null) */ function urlencoded (options) { - var opts = options || {} + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/x-www-form-urlencoded') - // notice because option default will flip in next major - if (opts.extended === undefined) { - deprecate('undefined extended: provide extended option') - } - - var extended = opts.extended !== false - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/x-www-form-urlencoded' - var verify = opts.verify || false - var depth = typeof opts.depth !== 'number' - ? Number(opts.depth || 32) - : opts.depth - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') + 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 = extended - ? extendedparser(opts) - : simpleparser(opts) + var queryparse = createQueryParser(options) - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { + function parse (body, encoding) { return body.length - ? queryparse(body) + ? queryparse(body, encoding) : {} } return function urlencodedParser (req, res, next) { - if (req._body) { + if (isFinished(req)) { debug('body already parsed') next() return } - req.body = req.body || {} + if (!('body' in req)) { + req.body = undefined + } // skip requests without bodies if (!typeis.hasBody(req)) { @@ -105,8 +79,8 @@ function urlencoded (options) { } // assert charset - var charset = getCharset(req) || 'utf-8' - if (charset !== 'utf-8') { + 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, @@ -117,12 +91,10 @@ function urlencoded (options) { // read read(req, res, next, parse, debug, { - debug: debug, encoding: charset, - inflate: inflate, - limit: limit, - verify: verify, - depth: depth + inflate, + limit, + verify }) } } @@ -133,15 +105,14 @@ function urlencoded (options) { * @param {object} options */ -function extendedparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit +function createQueryParser (options) { + var extended = Boolean(options?.extended) + var parameterLimit = options?.parameterLimit !== undefined + ? options?.parameterLimit : 1000 - - var depth = typeof options.depth !== 'number' - ? Number(options.depth || 32) - : options.depth - var parse = parser('qs') + 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') @@ -155,7 +126,7 @@ function extendedparser (options) { parameterLimit = parameterLimit | 0 } - return function queryparse (body) { + return function queryparse (body, encoding) { var paramCount = parameterCount(body, parameterLimit) if (paramCount === undefined) { @@ -165,16 +136,19 @@ function extendedparser (options) { }) } - var arrayLimit = Math.max(100, paramCount) + var arrayLimit = extended ? Math.max(100, paramCount) : 0 - debug('parse extended urlencoding') + debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') try { - return parse(body, { + return qs.parse(body, { allowPrototypes: true, arrayLimit: arrayLimit, depth: depth, - strictDepth: true, - parameterLimit: parameterLimit + charsetSentinel: charsetSentinel, + interpretNumericEntities: interpretNumericEntities, + charset: encoding, + parameterLimit: parameterLimit, + strictDepth: true }) } catch (err) { if (err instanceof RangeError) { @@ -188,21 +162,6 @@ function extendedparser (options) { } } -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - /** * Count the number of parameters, stopping once limit reached * @@ -212,96 +171,7 @@ function getCharset (req) { */ function parameterCount (body, limit) { - var count = 0 - var index = 0 + var len = body.split('&').length - while ((index = body.indexOf('&', index)) !== -1) { - count++ - index++ - - if (count === limit) { - return undefined - } - } - - return count -} - -/** - * Get parser for module name dynamically. - * - * @param {string} name - * @return {function} - * @api private - */ - -function parser (name) { - var mod = parsers[name] - - if (mod !== undefined) { - return mod.parse - } - - // this uses a switch for static require analysis - switch (name) { - case 'qs': - mod = require('qs') - break - case 'querystring': - mod = require('querystring') - break - } - - // store to prevent invoking require() - parsers[name] = mod - - return mod.parse -} - -/** - * Get the simple query parser. - * - * @param {object} options - */ - -function simpleparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('querystring') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - debug('parse urlencoding') - return parse(body, undefined, undefined, { maxKeys: parameterLimit }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } + 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 0000000..eee5d95 --- /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/nodemon/node_modules/debug/package.json b/node_modules/body-parser/node_modules/debug/package.json similarity index 100% rename from node_modules/nodemon/node_modules/debug/package.json rename to node_modules/body-parser/node_modules/debug/package.json diff --git a/node_modules/nodemon/node_modules/debug/src/browser.js b/node_modules/body-parser/node_modules/debug/src/browser.js similarity index 100% rename from node_modules/nodemon/node_modules/debug/src/browser.js rename to node_modules/body-parser/node_modules/debug/src/browser.js diff --git a/node_modules/nodemon/node_modules/debug/src/common.js b/node_modules/body-parser/node_modules/debug/src/common.js similarity index 100% rename from node_modules/nodemon/node_modules/debug/src/common.js rename to node_modules/body-parser/node_modules/debug/src/common.js diff --git a/node_modules/nodemon/node_modules/debug/src/index.js b/node_modules/body-parser/node_modules/debug/src/index.js similarity index 100% rename from node_modules/nodemon/node_modules/debug/src/index.js rename to node_modules/body-parser/node_modules/debug/src/index.js diff --git a/node_modules/nodemon/node_modules/debug/src/node.js b/node_modules/body-parser/node_modules/debug/src/node.js similarity index 100% rename from node_modules/nodemon/node_modules/debug/src/node.js rename to node_modules/body-parser/node_modules/debug/src/node.js diff --git a/node_modules/body-parser/node_modules/media-typer/index.js b/node_modules/body-parser/node_modules/media-typer/index.js new file mode 100644 index 0000000..897cae1 --- /dev/null +++ b/node_modules/body-parser/node_modules/media-typer/index.js @@ -0,0 +1,143 @@ +/*! + * media-typer + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match type in RFC 6838 + * + * type-name = restricted-name + * subtype-name = restricted-name + * restricted-name = restricted-name-first *126restricted-name-chars + * restricted-name-first = ALPHA / DIGIT + * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / + * "$" / "&" / "-" / "^" / "_" + * restricted-name-chars =/ "." ; Characters before first dot always + * ; specify a facet name + * restricted-name-chars =/ "+" ; Characters after last plus always + * ; specify a structured syntax suffix + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + * DIGIT = %x30-39 ; 0-9 + */ +var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ + +/** + * Module exports. + */ + +exports.format = format +exports.parse = parse +exports.test = test + +/** + * 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 subtype = obj.subtype + var suffix = obj.suffix + var type = obj.type + + if (!type || !TYPE_NAME_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + throw new TypeError('invalid subtype') + } + + // format as type/subtype + var string = type + '/' + subtype + + // append +suffix + if (suffix) { + if (!TYPE_NAME_REGEXP.test(suffix)) { + throw new TypeError('invalid suffix') + } + + string += '+' + suffix + } + + return string +} + +/** + * Test media type. + * + * @param {string} string + * @return {object} + * @public + */ + +function test (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + return TYPE_REGEXP.test(string.toLowerCase()) +} + +/** + * Parse media type to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var match = TYPE_REGEXP.exec(string.toLowerCase()) + + if (!match) { + throw new TypeError('invalid media type') + } + + var type = match[1] + var subtype = match[2] + var suffix + + // suffix after last + + var index = subtype.lastIndexOf('+') + if (index !== -1) { + suffix = subtype.substr(index + 1) + subtype = subtype.substr(0, index) + } + + return new MediaType(type, subtype, suffix) +} + +/** + * Class for MediaType object. + * @public + */ + +function MediaType (type, subtype, suffix) { + this.type = type + this.subtype = subtype + this.suffix = suffix +} diff --git a/node_modules/body-parser/node_modules/media-typer/package.json b/node_modules/body-parser/node_modules/media-typer/package.json new file mode 100644 index 0000000..1dca712 --- /dev/null +++ b/node_modules/body-parser/node_modules/media-typer/package.json @@ -0,0 +1,33 @@ +{ + "name": "media-typer", + "description": "Simple RFC 6838 media type parser and formatter", + "version": "1.1.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "jshttp/media-typer", + "devDependencies": { + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/node_modules/body-parser/node_modules/mime-db/db.json b/node_modules/body-parser/node_modules/mime-db/db.json new file mode 100644 index 0000000..7e74733 --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-db/db.json @@ -0,0 +1,9342 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/3gpp-ims+xml": { + "source": "iana", + "compressible": true + }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, + "application/a2l": { + "source": "iana" + }, + "application/ace+cbor": { + "source": "iana" + }, + "application/ace+json": { + "source": "iana", + "compressible": true + }, + "application/ace-groupcomm+cbor": { + "source": "iana" + }, + "application/ace-trl+cbor": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/activity+json": { + "source": "iana", + "compressible": true + }, + "application/aif+cbor": { + "source": "iana" + }, + "application/aif+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdni+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdnifilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmapparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tips+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tipsparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/appinstaller": { + "compressible": false, + "extensions": ["appinstaller"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/appx": { + "compressible": false, + "extensions": ["appx"] + }, + "application/appxbundle": { + "compressible": false, + "extensions": ["appxbundle"] + }, + "application/at+jwt": { + "source": "iana" + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomdeleted"] + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomsvc"] + }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana", + "compressible": true + }, + "application/automationml-aml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["aml"] + }, + "application/automationml-amlx+zip": { + "source": "iana", + "compressible": false, + "extensions": ["amlx"] + }, + "application/bacnet-xdd+zip": { + "source": "iana", + "compressible": false + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/bufr": { + "source": "iana" + }, + "application/c2pa": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xcs"] + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/captive+json": { + "source": "iana", + "compressible": true + }, + "application/cbor": { + "source": "iana" + }, + "application/cbor-seq": { + "source": "iana" + }, + "application/cccex": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana", + "compressible": true + }, + "application/ccxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ccxml"] + }, + "application/cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/cdfx+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdfx"] + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/ce+cbor": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana", + "compressible": true + }, + "application/cellml+xml": { + "source": "iana", + "compressible": true + }, + "application/cfw": { + "source": "iana" + }, + "application/cid-edhoc+cbor-seq": { + "source": "iana" + }, + "application/city+json": { + "source": "iana", + "compressible": true + }, + "application/city+json-seq": { + "source": "iana" + }, + "application/clr": { + "source": "iana" + }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, + "application/clue_info+xml": { + "source": "iana", + "compressible": true + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana", + "compressible": true + }, + "application/coap-eap": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/coap-payload": { + "source": "iana" + }, + "application/commonground": { + "source": "iana" + }, + "application/concise-problem-details+cbor": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/cose": { + "source": "iana" + }, + "application/cose-key": { + "source": "iana" + }, + "application/cose-key-set": { + "source": "iana" + }, + "application/cose-x509": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cpl"] + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana", + "compressible": true + }, + "application/cstadata+xml": { + "source": "iana", + "compressible": true + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cwl": { + "source": "iana", + "extensions": ["cwl"] + }, + "application/cwl+json": { + "source": "iana", + "compressible": true + }, + "application/cwl+yaml": { + "source": "iana" + }, + "application/cwt": { + "source": "iana" + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpd"] + }, + "application/dash-patch+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "compressible": true, + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana", + "compressible": true + }, + "application/dicom": { + "source": "iana", + "extensions": ["dcm"] + }, + "application/dicom+json": { + "source": "iana", + "compressible": true + }, + "application/dicom+xml": { + "source": "iana", + "compressible": true + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/dns+json": { + "source": "iana", + "compressible": true + }, + "application/dns-message": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dbk"] + }, + "application/dots+cbor": { + "source": "iana" + }, + "application/dpop+jwt": { + "source": "iana" + }, + "application/dskpp+xml": { + "source": "iana", + "compressible": true + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/eat+cwt": { + "source": "iana" + }, + "application/eat+jwt": { + "source": "iana" + }, + "application/eat-bun+cbor": { + "source": "iana" + }, + "application/eat-bun+json": { + "source": "iana", + "compressible": true + }, + "application/eat-ucs+cbor": { + "source": "iana" + }, + "application/eat-ucs+json": { + "source": "iana", + "compressible": true + }, + "application/ecmascript": { + "source": "apache", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edhoc+cbor-seq": { + "source": "iana" + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/efi": { + "source": "iana" + }, + "application/elm+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/elm+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/emergencycalldata.comment+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.control+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.ecall.msd": { + "source": "iana" + }, + "application/emergencycalldata.legacyesn+json": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.veds+xml": { + "source": "iana", + "compressible": true + }, + "application/emma+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emotionml"] + }, + "application/encaprtp": { + "source": "iana" + }, + "application/entity-statement+jwt": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana", + "compressible": true + }, + "application/epub+zip": { + "source": "iana", + "compressible": false, + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/fdt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fdt"] + }, + "application/fhir+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fhir+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fido.trusted-apps+json": { + "compressible": true + }, + "application/fits": { + "source": "iana" + }, + "application/flexfec": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false + }, + "application/framework-attributes+xml": { + "source": "iana", + "compressible": true + }, + "application/geo+json": { + "source": "iana", + "compressible": true, + "extensions": ["geojson"] + }, + "application/geo+json-seq": { + "source": "iana" + }, + "application/geopackage+sqlite3": { + "source": "iana" + }, + "application/geopose+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+xml": { + "source": "iana", + "compressible": true + }, + "application/gltf-buffer": { + "source": "iana" + }, + "application/gml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["gml"] + }, + "application/gnap-binding-jws": { + "source": "iana" + }, + "application/gnap-binding-jwsd": { + "source": "iana" + }, + "application/gnap-binding-rotation-jws": { + "source": "iana" + }, + "application/gnap-binding-rotation-jwsd": { + "source": "iana" + }, + "application/gpx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["gpx"] + }, + "application/grib": { + "source": "iana" + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false, + "extensions": ["gz"] + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana", + "compressible": true + }, + "application/hjson": { + "extensions": ["hjson"] + }, + "application/hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pkg-reply+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana", + "compressible": true, + "extensions": ["its"] + }, + "application/java-archive": { + "source": "iana", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "apache", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jf2feed+json": { + "source": "iana", + "compressible": true + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/jscalendar+json": { + "source": "iana", + "compressible": true + }, + "application/jscontact+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jsonpath": { + "source": "iana" + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+jwt": { + "source": "iana" + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana", + "compressible": true + }, + "application/kpml-response+xml": { + "source": "iana", + "compressible": true + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/lgr+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lgr"] + }, + "application/link-format": { + "source": "iana" + }, + "application/linkset": { + "source": "iana" + }, + "application/linkset+json": { + "source": "iana", + "compressible": true + }, + "application/load-control+xml": { + "source": "iana", + "compressible": true + }, + "application/logout+jwt": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana", + "compressible": true + }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mads"] + }, + "application/manifest+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana", + "compressible": true + }, + "application/mathml-presentation+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-deregister+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-envelope+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-protection-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-reception-report+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-user-service-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpf"] + }, + "application/media_control+xml": { + "source": "iana", + "compressible": true + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "compressible": true, + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "compressible": true, + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mipc": { + "source": "iana" + }, + "application/missing-blocks+cbor-seq": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, + "application/mmt-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musd"] + }, + "application/mods+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4","mpg4","mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana", + "compressible": true + }, + "application/mrb-publish+xml": { + "source": "iana", + "compressible": true + }, + "application/msc-ivr+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msc-mixer+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msix": { + "compressible": false, + "extensions": ["msix"] + }, + "application/msixbundle": { + "compressible": false, + "extensions": ["msixbundle"] + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mud+json": { + "source": "iana", + "compressible": true + }, + "application/multipart-core": { + "source": "iana" + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/n-quads": { + "source": "iana", + "extensions": ["nq"] + }, + "application/n-triples": { + "source": "iana", + "extensions": ["nt"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-groupinfo": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana", + "compressible": true + }, + "application/node": { + "source": "iana", + "extensions": ["cjs"] + }, + "application/nss": { + "source": "iana" + }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, + "application/oblivious-dns-message": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": true, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/ohttp-keys": { + "source": "iana" + }, + "application/omdoc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] + }, + "application/opc-nodeset+xml": { + "source": "iana", + "compressible": true + }, + "application/oscore": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p21": { + "source": "iana" + }, + "application/p21+zip": { + "source": "iana", + "compressible": false + }, + "application/p2p-overlay+xml": { + "source": "iana", + "compressible": true, + "extensions": ["relo"] + }, + "application/parityfec": { + "source": "iana" + }, + "application/passport": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pem-certificate-chain": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana", + "extensions": ["asc"] + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["sig","asc"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pidf-diff+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkcs8-encrypted": { + "source": "iana" + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/ppsp-tracker+json": { + "source": "iana", + "compressible": true + }, + "application/private-token-issuer-directory": { + "source": "iana" + }, + "application/private-token-request": { + "source": "iana" + }, + "application/private-token-response": { + "source": "iana" + }, + "application/problem+json": { + "source": "iana", + "compressible": true + }, + "application/problem+xml": { + "source": "iana", + "compressible": true + }, + "application/provenance+xml": { + "source": "iana", + "compressible": true, + "extensions": ["provx"] + }, + "application/provided-claims+jwt": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.cyn": { + "source": "iana", + "charset": "7-BIT" + }, + "application/prs.hpub+zip": { + "source": "iana", + "compressible": false + }, + "application/prs.implied-document+xml": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-executable": { + "source": "iana" + }, + "application/prs.implied-object+json": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-object+json-seq": { + "source": "iana" + }, + "application/prs.implied-object+yaml": { + "source": "iana" + }, + "application/prs.implied-structure": { + "source": "iana" + }, + "application/prs.mayfile": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.vcfbzip2": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsf"] + }, + "application/pskc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pskcxml"] + }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, + "application/qsig": { + "source": "iana" + }, + "application/raml+yaml": { + "compressible": true, + "extensions": ["raml"] + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf","owl"] + }, + "application/reginfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "apache" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resolve-response+jwt": { + "source": "iana" + }, + "application/resource-lists+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana", + "compressible": true + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana", + "compressible": true + }, + "application/rls-services+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rs"] + }, + "application/route-apd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rapd"] + }, + "application/route-s-tsid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sls"] + }, + "application/route-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rusd"] + }, + "application/rpki-checklist": { + "source": "iana" + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-publication": { + "source": "iana" + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-signed-tal": { + "source": "iana" + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana", + "compressible": true + }, + "application/samlmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/sarif+json": { + "source": "iana", + "compressible": true + }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, + "application/sbe": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana", + "compressible": true + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/secevent+jwt": { + "source": "iana" + }, + "application/senml+cbor": { + "source": "iana" + }, + "application/senml+json": { + "source": "iana", + "compressible": true + }, + "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { + "source": "iana", + "compressible": true + }, + "application/senml-exi": { + "source": "iana" + }, + "application/sensml+cbor": { + "source": "iana" + }, + "application/sensml+json": { + "source": "iana", + "compressible": true + }, + "application/sensml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sensmlx"] + }, + "application/sensml-exi": { + "source": "iana" + }, + "application/sep+xml": { + "source": "iana", + "compressible": true + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana", + "extensions": ["siv","sieve"] + }, + "application/simple-filter+xml": { + "source": "iana", + "compressible": true + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/sipc": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "apache" + }, + "application/smil+xml": { + "source": "iana", + "compressible": true, + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "compressible": true, + "extensions": ["srx"] + }, + "application/spdx+json": { + "source": "iana", + "compressible": true + }, + "application/spirits-event+xml": { + "source": "iana", + "compressible": true + }, + "application/sql": { + "source": "iana", + "extensions": ["sql"] + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ssdl"] + }, + "application/sslkeylogfile": { + "source": "iana" + }, + "application/ssml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ssml"] + }, + "application/st2110-41": { + "source": "iana" + }, + "application/stix+json": { + "source": "iana", + "compressible": true + }, + "application/stratum": { + "source": "iana" + }, + "application/swid+cbor": { + "source": "iana" + }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/taxii+json": { + "source": "iana", + "compressible": true + }, + "application/td+json": { + "source": "iana", + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tei","teicorpus"] + }, + "application/tetra_isi": { + "source": "iana" + }, + "application/thraud+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/tlsrpt+gzip": { + "source": "iana" + }, + "application/tlsrpt+json": { + "source": "iana", + "compressible": true + }, + "application/tm+json": { + "source": "iana", + "compressible": true + }, + "application/tnauthlist": { + "source": "iana" + }, + "application/toc+cbor": { + "source": "iana" + }, + "application/token-introspection+jwt": { + "source": "iana" + }, + "application/toml": { + "source": "iana", + "compressible": true, + "extensions": ["toml"] + }, + "application/trickle-ice-sdpfrag": { + "source": "iana" + }, + "application/trig": { + "source": "iana", + "extensions": ["trig"] + }, + "application/trust-chain+json": { + "source": "iana", + "compressible": true + }, + "application/trust-mark+jwt": { + "source": "iana" + }, + "application/trust-mark-delegation+jwt": { + "source": "iana" + }, + "application/ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ttml"] + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, + "application/ubjson": { + "compressible": false, + "extensions": ["ubj"] + }, + "application/uccs+cbor": { + "source": "iana" + }, + "application/ujcs+json": { + "source": "iana", + "compressible": true + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/urc-ressheet+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsheet"] + }, + "application/urc-targetdesc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["td"] + }, + "application/urc-uisocketdesc+xml": { + "source": "iana", + "compressible": true + }, + "application/vc": { + "source": "iana" + }, + "application/vc+cose": { + "source": "iana" + }, + "application/vc+jwt": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana", + "compressible": true + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + "source": "iana", + "compressible": true, + "extensions": ["1km"] + }, + "application/vnd.1ob": { + "source": "iana" + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3a+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ach+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc8+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-v2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.crs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.current-location-discovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gmop+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, + "application/vnd.3gpp.interworking-data": { + "source": "iana" + }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-payload": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-signalling": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.pinapp-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, + "application/vnd.3gpp.seal-group-doc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-network-qos-management-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-ue-config-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-unicast-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-user-profile-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.sms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.v2x": { + "source": "iana" + }, + "application/vnd.3gpp.vae-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acm.addressxfer+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acm.chatbot+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "compressible": false, + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "apache", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, + "application/vnd.afpc.modca": { + "source": "iana" + }, + "application/vnd.afpc.modca-cmtable": { + "source": "iana" + }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, + "application/vnd.age": { + "source": "iana", + "extensions": ["age"] + }, + "application/vnd.ah-barcode": { + "source": "apache" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + "source": "iana" + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.android.ota": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.arrow.file": { + "source": "iana" + }, + "application/vnd.apache.arrow.stream": { + "source": "iana" + }, + "application/vnd.apache.parquet": { + "source": "iana" + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.apexlang": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apothekende.reservation+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpkg"] + }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["key"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "apache" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artisan+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autodesk.fbx": { + "extensions": ["fbx"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avalon+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.avistar+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.banana-accounting": { + "source": "iana" + }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.belightsoft.lhzd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.belightsoft.lhzl+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.bint.med-content": { + "source": "iana" + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.blink-idb-value-wrapper": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.byu.uapi+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bzip3": { + "source": "iana" + }, + "application/vnd.c3voc.schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.capasystems-pg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdxml"] + }, + "application/vnd.chess-pgn": { + "source": "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.ciedi": { + "source": "iana" + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana", + "compressible": true, + "extensions": ["csl"] + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { + "source": "iana" + }, + "application/vnd.cncf.helm.chart.provenance.v1.prov": { + "source": "iana" + }, + "application/vnd.cncf.helm.config.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.comicbook+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, + "application/vnd.cryptomator.encrypted": { + "source": "iana" + }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.cyclonedx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cyclonedx+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.d3m-dataset": { + "source": "iana" + }, + "application/vnd.d3m-problem": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.datalog": { + "source": "iana" + }, + "application/vnd.datapackage+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dataresource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dbf": { + "source": "iana", + "extensions": ["dbf"] + }, + "application/vnd.dcmp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dcmp"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume.movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecip.rlp": { + "source": "iana" + }, + "application/vnd.eclipse.ditto+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.efi.img": { + "source": "iana" + }, + "application/vnd.efi.iso": { + "source": "iana" + }, + "application/vnd.eln+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.erofs": { + "source": "iana" + }, + "application/vnd.espass-espass+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "compressible": true, + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.cug+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.sci+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eu.kasparian.car+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.evolv.ecig.profile": { + "source": "iana" + }, + "application/vnd.evolv.ecig.settings": { + "source": "iana" + }, + "application/vnd.evolv.ecig.theme": { + "source": "iana" + }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "apache", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.fdsn.stationxml+xml": { + "source": "iana", + "charset": "XML-BASED", + "compressible": true + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.freelog.comic": { + "source": "iana" + }, + "application/vnd.frogans.fnc": { + "source": "apache", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "apache", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.ga4gh.passport+jwt": { + "source": "iana" + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.genozip": { + "source": "iana" + }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.catmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.ebuild": { + "source": "iana" + }, + "application/vnd.gentoo.eclass": { + "source": "iana" + }, + "application/vnd.gentoo.gpkg": { + "source": "iana" + }, + "application/vnd.gentoo.manifest": { + "source": "iana" + }, + "application/vnd.gentoo.pkgmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.xpak": { + "source": "iana" + }, + "application/vnd.geo+json": { + "source": "apache", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.pinboard": { + "source": "iana" + }, + "application/vnd.geogebra.slides": { + "source": "iana", + "extensions": ["ggs"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.gnu.taler.exchange+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gnu.taler.merchant+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.google-apps.audio": {}, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.drawing": { + "compressible": false, + "extensions": ["gdraw"] + }, + "application/vnd.google-apps.drive-sdk": { + "compressible": false + }, + "application/vnd.google-apps.file": {}, + "application/vnd.google-apps.folder": { + "compressible": false + }, + "application/vnd.google-apps.form": { + "compressible": false, + "extensions": ["gform"] + }, + "application/vnd.google-apps.fusiontable": {}, + "application/vnd.google-apps.jam": { + "compressible": false, + "extensions": ["gjam"] + }, + "application/vnd.google-apps.mail-layout": {}, + "application/vnd.google-apps.map": { + "compressible": false, + "extensions": ["gmap"] + }, + "application/vnd.google-apps.photo": {}, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.script": { + "compressible": false, + "extensions": ["gscript"] + }, + "application/vnd.google-apps.shortcut": {}, + "application/vnd.google-apps.site": { + "compressible": false, + "extensions": ["gsite"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, + "application/vnd.google-apps.unknown": {}, + "application/vnd.google-apps.video": {}, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdcf"] + }, + "application/vnd.gpxsee.map+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "compressible": true, + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.hdt": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.hsl": { + "source": "iana" + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyper-item+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "apache" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "apache", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.imagemeter.image+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.informix-visionary": { + "source": "apache" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.ipfs.ipns-record": { + "source": "iana" + }, + "application/vnd.ipld.car": { + "source": "iana" + }, + "application/vnd.ipld.dag-cbor": { + "source": "iana" + }, + "application/vnd.ipld.dag-json": { + "source": "iana" + }, + "application/vnd.ipld.raw": { + "source": "iana" + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kdl": { + "source": "iana" + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.keyman.kmp+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.keyman.kmx": { + "source": "iana" + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las": { + "source": "iana" + }, + "application/vnd.las.las+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.las.las+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lasxml"] + }, + "application/vnd.laszip": { + "source": "iana" + }, + "application/vnd.ldev.productlicensing": { + "source": "iana" + }, + "application/vnd.leap+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.liberty-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + "source": "iana", + "extensions": ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxar.archive.3tz+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.mdl": { + "source": "iana" + }, + "application/vnd.mdl-mbsdf": { + "source": "iana" + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.medicalholodeck.recordxr": { + "source": "iana" + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mermaid": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.modl": { + "source": "iana" + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-outlook": { + "compressible": false, + "extensions": ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-printschematicket+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-visio.viewer": { + "extensions": ["vdx"] + }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msgpack": { + "source": "iana" + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+cbor": { + "source": "iana" + }, + "application/vnd.nato.bindingdataobject+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bdo"] + }, + "application/vnd.nato.openxmlformats-package.iepd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nearst.inv+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nebumind.line": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nimn": { + "source": "iana" + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "apache", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oai.workflows": { + "source": "iana" + }, + "application/vnd.oai.workflows+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oai.workflows+yaml": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.base": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "apache", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-master-template": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.ocf+cbor": { + "source": "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+cbor": { + "source": "iana" + }, + "application/vnd.oma.lwm2m+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+tlv": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.omads-email+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-file+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-folder+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.onepager": { + "source": "iana" + }, + "application/vnd.onepagertamp": { + "source": "iana" + }, + "application/vnd.onepagertamx": { + "source": "iana" + }, + "application/vnd.onepagertat": { + "source": "iana" + }, + "application/vnd.onepagertatp": { + "source": "iana" + }, + "application/vnd.onepagertatx": { + "source": "iana" + }, + "application/vnd.onvif.metadata": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana", + "compressible": true, + "extensions": ["obgx"] + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osm"] + }, + "application/vnd.opentimestamps.ots": { + "source": "iana" + }, + "application/vnd.openvpi.dspx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "iana", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "iana", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "iana", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "iana" + }, + "application/vnd.patentdive": { + "source": "iana" + }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.procrate.brushset": { + "extensions": ["brushset"] + }, + "application/vnd.procreate.brush": { + "extensions": ["brush"] + }, + "application/vnd.procreate.dream": { + "extensions": ["drm"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.psfs": { + "source": "iana" + }, + "application/vnd.pt.mundusmundi": { + "source": "iana" + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtm"] + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quarantainenet": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.rar": { + "source": "iana", + "extensions": ["rar"] + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musicxml"] + }, + "application/vnd.relpipe": { + "source": "iana" + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.resilient.logic": { + "source": "iana" + }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "compressible": true, + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sar": { + "source": "iana" + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.seis+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shade-save-file": { + "source": "iana" + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.shootproof+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, + "application/vnd.sigrok.session": { + "source": "iana" + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sketchometry": { + "source": "iana" + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.smintio.portals.archive": { + "source": "iana" + }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sqlite3": { + "source": "iana" + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wadl"] + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.sybyl.mol2": { + "source": "iana" + }, + "application/vnd.sycle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.syft+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tableschema+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.tml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.tri.onesource": { + "source": "iana" + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uic.osdm+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uoml","uo"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veraison.tsm-report+cbor": { + "source": "iana" + }, + "application/vnd.veraison.tsm-report+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.veritone.aion+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vocalshaper.vsp4": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.wasmflow.wafl": { + "source": "iana" + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.dpp": { + "source": "iana" + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordlift": { + "source": "iana" + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.wv.ssp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xarin.cpj": { + "source": "iana" + }, + "application/vnd.xecrets-encrypted": { + "source": "iana" + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["vxml"] + }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, + "application/voucher-jws+json": { + "source": "iana", + "compressible": true + }, + "application/vp": { + "source": "iana" + }, + "application/vp+cose": { + "source": "iana" + }, + "application/vp+jwt": { + "source": "iana" + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/wasm": { + "source": "iana", + "compressible": true, + "extensions": ["wasm"] + }, + "application/watcherinfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wif"] + }, + "application/webpush-options+json": { + "source": "iana", + "compressible": true + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-arj": { + "compressible": false, + "extensions": ["arj"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blender": { + "extensions": ["blend"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-compressed": { + "extensions": ["rar"] + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "compressible": true, + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-ipynb+json": { + "compressible": true, + "extensions": ["ipynb"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-pki-message": { + "source": "iana" + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-virtualbox-hdd": { + "compressible": true, + "extensions": ["hdd"] + }, + "application/x-virtualbox-ova": { + "compressible": true, + "extensions": ["ova"] + }, + "application/x-virtualbox-ovf": { + "compressible": true, + "extensions": ["ovf"] + }, + "application/x-virtualbox-vbox": { + "compressible": true, + "extensions": ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + "compressible": false, + "extensions": ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + "compressible": true, + "extensions": ["vdi"] + }, + "application/x-virtualbox-vhd": { + "compressible": true, + "extensions": ["vhd"] + }, + "application/x-virtualbox-vmdk": { + "compressible": true, + "extensions": ["vmdk"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "iana", + "extensions": ["der","crt","pem"] + }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zip-compressed": { + "extensions": ["zip"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana", + "compressible": true + }, + "application/xaml+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xav"] + }, + "application/xcap-caps+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xca"] + }, + "application/xcap-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xel"] + }, + "application/xcap-error+xml": { + "source": "iana", + "compressible": true + }, + "application/xcap-ns+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xns"] + }, + "application/xcon-conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana", + "compressible": true + }, + "application/xenc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xenc"] + }, + "application/xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache", + "compressible": true + }, + "application/xliff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xlf"] + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd","rng"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/xmpp+xml": { + "source": "iana", + "compressible": true + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsl","xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yaml": { + "source": "iana" + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yang-data+cbor": { + "source": "iana" + }, + "application/yang-data+json": { + "source": "iana", + "compressible": true + }, + "application/yang-data+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+json": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-sid+json": { + "source": "iana", + "compressible": true + }, + "application/yin+xml": { + "source": "iana", + "compressible": true, + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zip+dotlottie": { + "extensions": ["lottie"] + }, + "application/zlib": { + "source": "iana" + }, + "application/zstd": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/aac": { + "source": "iana", + "extensions": ["adts","aac"] + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana", + "extensions": ["amr"] + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/evs": { + "source": "iana" + }, + "audio/flac": { + "source": "iana" + }, + "audio/flexfec": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/matroska": { + "source": "iana" + }, + "audio/melp": { + "source": "iana" + }, + "audio/melp1200": { + "source": "iana" + }, + "audio/melp2400": { + "source": "iana" + }, + "audio/melp600": { + "source": "iana" + }, + "audio/mhas": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/midi-clip": { + "source": "iana" + }, + "audio/mobile-xmf": { + "source": "iana", + "extensions": ["mxmf"] + }, + "audio/mp3": { + "compressible": false, + "extensions": ["mp3"] + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["m4a","mp4a","m4b"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx","opus"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/scip": { + "source": "iana" + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sofa": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/tsvcis": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/usac": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.presonus.multitrack": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "apache" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/collection": { + "source": "iana", + "extensions": ["ttc"] + }, + "font/otf": { + "source": "iana", + "compressible": true, + "extensions": ["otf"] + }, + "font/sfnt": { + "source": "iana" + }, + "font/ttf": { + "source": "iana", + "compressible": true, + "extensions": ["ttf"] + }, + "font/woff": { + "source": "iana", + "extensions": ["woff"] + }, + "font/woff2": { + "source": "iana", + "extensions": ["woff2"] + }, + "image/aces": { + "source": "iana", + "extensions": ["exr"] + }, + "image/apng": { + "source": "iana", + "compressible": false, + "extensions": ["apng"] + }, + "image/avci": { + "source": "iana", + "extensions": ["avci"] + }, + "image/avcs": { + "source": "iana", + "extensions": ["avcs"] + }, + "image/avif": { + "source": "iana", + "compressible": false, + "extensions": ["avif"] + }, + "image/bmp": { + "source": "iana", + "compressible": true, + "extensions": ["bmp","dib"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/dicom-rle": { + "source": "iana", + "extensions": ["drle"] + }, + "image/dpx": { + "source": "iana", + "extensions": ["dpx"] + }, + "image/emf": { + "source": "iana", + "extensions": ["emf"] + }, + "image/fits": { + "source": "iana", + "extensions": ["fits"] + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/j2c": { + "source": "iana" + }, + "image/jaii": { + "source": "iana", + "extensions": ["jaii"] + }, + "image/jais": { + "source": "iana", + "extensions": ["jais"] + }, + "image/jls": { + "source": "iana", + "extensions": ["jls"] + }, + "image/jp2": { + "source": "iana", + "compressible": false, + "extensions": ["jp2","jpg2"] + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpg","jpeg","jpe"] + }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, + "image/jpm": { + "source": "iana", + "compressible": false, + "extensions": ["jpm","jpgm"] + }, + "image/jpx": { + "source": "iana", + "compressible": false, + "extensions": ["jpx","jpf"] + }, + "image/jxl": { + "source": "iana", + "extensions": ["jxl"] + }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/ktx2": { + "source": "iana", + "extensions": ["ktx2"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false, + "extensions": ["jfif"] + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif","btf"] + }, + "image/prs.pti": { + "source": "iana", + "extensions": ["pti"] + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana", + "extensions": ["t38"] + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tif","tiff"] + }, + "image/tiff-fx": { + "source": "iana", + "extensions": ["tfx"] + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana", + "extensions": ["azv"] + }, + "image/vnd.clip": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana", + "compressible": true, + "extensions": ["ico"] + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-dds": { + "compressible": true, + "extensions": ["dds"] + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.pco.b16": { + "source": "iana", + "extensions": ["b16"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana", + "extensions": ["tap"] + }, + "image/vnd.valve.source.texture": { + "source": "iana", + "extensions": ["vtf"] + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana", + "extensions": ["pcx"] + }, + "image/webp": { + "source": "iana", + "extensions": ["webp"] + }, + "image/wmf": { + "source": "iana", + "extensions": ["wmf"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-adobe-dng": { + "extensions": ["dng"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-emf": { + "source": "iana" + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-wmf": { + "source": "iana" + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/bhttp": { + "source": "iana" + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana", + "extensions": [ + "disposition-notification" + ] + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana", + "extensions": ["u8msg"] + }, + "message/global-delivery-status": { + "source": "iana", + "extensions": ["u8dsn"] + }, + "message/global-disposition-notification": { + "source": "iana", + "extensions": ["u8mdn"] + }, + "message/global-headers": { + "source": "iana", + "extensions": ["u8hdr"] + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/mls": { + "source": "iana" + }, + "message/news": { + "source": "apache" + }, + "message/ohttp-req": { + "source": "iana" + }, + "message/ohttp-res": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime","mht","mhtml"] + }, + "message/s-http": { + "source": "apache" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "apache" + }, + "message/vnd.wfa.wsc": { + "source": "iana", + "extensions": ["wsc"] + }, + "model/3mf": { + "source": "iana", + "extensions": ["3mf"] + }, + "model/e57": { + "source": "iana" + }, + "model/gltf+json": { + "source": "iana", + "compressible": true, + "extensions": ["gltf"] + }, + "model/gltf-binary": { + "source": "iana", + "compressible": true, + "extensions": ["glb"] + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/jt": { + "source": "iana", + "extensions": ["jt"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, + "model/prc": { + "source": "iana", + "extensions": ["prc"] + }, + "model/step": { + "source": "iana", + "extensions": ["step","stp","stpnc","p21","210"] + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, + "model/step+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpz"] + }, + "model/step-xml+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpxz"] + }, + "model/stl": { + "source": "iana", + "extensions": ["stl"] + }, + "model/u3d": { + "source": "iana", + "extensions": ["u3d"] + }, + "model/vnd.bary": { + "source": "iana", + "extensions": ["bary"] + }, + "model/vnd.cld": { + "source": "iana", + "extensions": ["cld"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana", + "compressible": true + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana", + "extensions": ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana", + "extensions": ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana", + "extensions": ["x_t"] + }, + "model/vnd.pytha.pyox": { + "source": "iana", + "extensions": ["pyo","pyox"] + }, + "model/vnd.rosette.annotated-data-model": { + "source": "iana" + }, + "model/vnd.sap.vds": { + "source": "iana", + "extensions": ["vds"] + }, + "model/vnd.usda": { + "source": "iana", + "extensions": ["usda"] + }, + "model/vnd.usdz+zip": { + "source": "iana", + "compressible": false, + "extensions": ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana", + "extensions": ["bsp"] + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana", + "extensions": ["x3db"] + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana", + "extensions": ["x3dv"] + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana" + }, + "multipart/multilingual": { + "source": "iana" + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/vnd.bint.med-plus": { + "source": "iana" + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/cql": { + "source": "iana" + }, + "text/cql-expression": { + "source": "iana" + }, + "text/cql-identifier": { + "source": "iana" + }, + "text/css": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "apache" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fhirpath": { + "source": "iana" + }, + "text/flexfec": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/gff3": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hl7v2": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js","mjs"] + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "compressible": true, + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana", + "compressible": true, + "extensions": ["md","markdown"] + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana", + "charset": "UTF-8" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana", + "charset": "UTF-8" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/prs.prop.logic": { + "source": "iana" + }, + "text/prs.texi": { + "source": "iana" + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/shaclc": { + "source": "iana" + }, + "text/shex": { + "source": "iana", + "extensions": ["shex"] + }, + "text/slim": { + "extensions": ["slim","slm"] + }, + "text/spdx": { + "source": "iana", + "extensions": ["spdx"] + }, + "text/strings": { + "source": "iana" + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.ascii-art": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.exchangeable": { + "source": "iana" + }, + "text/vnd.familysearch.gedcom": { + "source": "iana", + "extensions": ["ged"] + }, + "text/vnd.ficlab.flt": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.gml": { + "source": "iana" + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.hans": { + "source": "iana" + }, + "text/vnd.hgl": { + "source": "iana" + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "apache" + }, + "text/vnd.sosi": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.vcf": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vnd.zoo.kcl": { + "source": "iana" + }, + "text/vtt": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/wgsl": { + "source": "iana", + "extensions": ["wgsl"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-org": { + "compressible": true, + "extensions": ["org"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "compressible": true, + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "iana" + }, + "video/3gpp": { + "source": "iana", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "iana" + }, + "video/3gpp2": { + "source": "iana", + "extensions": ["3g2"] + }, + "video/av1": { + "source": "iana" + }, + "video/bmpeg": { + "source": "iana" + }, + "video/bt656": { + "source": "iana" + }, + "video/celb": { + "source": "iana" + }, + "video/dv": { + "source": "iana" + }, + "video/encaprtp": { + "source": "iana" + }, + "video/evc": { + "source": "iana" + }, + "video/ffv1": { + "source": "iana" + }, + "video/flexfec": { + "source": "iana" + }, + "video/h261": { + "source": "iana", + "extensions": ["h261"] + }, + "video/h263": { + "source": "iana", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "iana" + }, + "video/h263-2000": { + "source": "iana" + }, + "video/h264": { + "source": "iana", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "iana" + }, + "video/h264-svc": { + "source": "iana" + }, + "video/h265": { + "source": "iana" + }, + "video/h266": { + "source": "iana" + }, + "video/iso.segment": { + "source": "iana", + "extensions": ["m4s"] + }, + "video/jpeg": { + "source": "iana", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "iana" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/jxsv": { + "source": "iana" + }, + "video/lottie+json": { + "source": "iana", + "compressible": true + }, + "video/matroska": { + "source": "iana" + }, + "video/matroska-3d": { + "source": "iana" + }, + "video/mj2": { + "source": "iana", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "iana" + }, + "video/mp2p": { + "source": "iana" + }, + "video/mp2t": { + "source": "iana", + "extensions": ["ts","m2t","m2ts","mts"] + }, + "video/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "iana" + }, + "video/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "iana" + }, + "video/mpv": { + "source": "iana" + }, + "video/nv": { + "source": "iana" + }, + "video/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "iana" + }, + "video/pointer": { + "source": "iana" + }, + "video/quicktime": { + "source": "iana", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raptorfec": { + "source": "iana" + }, + "video/raw": { + "source": "iana" + }, + "video/rtp-enc-aescm128": { + "source": "iana" + }, + "video/rtploopback": { + "source": "iana" + }, + "video/rtx": { + "source": "iana" + }, + "video/scip": { + "source": "iana" + }, + "video/smpte291": { + "source": "iana" + }, + "video/smpte292m": { + "source": "iana" + }, + "video/ulpfec": { + "source": "iana" + }, + "video/vc1": { + "source": "iana" + }, + "video/vc2": { + "source": "iana" + }, + "video/vnd.cctv": { + "source": "iana" + }, + "video/vnd.dece.hd": { + "source": "iana", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "iana", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "iana" + }, + "video/vnd.dece.pd": { + "source": "iana", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "iana", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "iana", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "iana" + }, + "video/vnd.directv.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dvb.file": { + "source": "iana", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "iana", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "iana" + }, + "video/vnd.motorola.video": { + "source": "iana" + }, + "video/vnd.motorola.videop": { + "source": "iana" + }, + "video/vnd.mpegurl": { + "source": "iana", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "iana", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "iana" + }, + "video/vnd.nokia.mp4vr": { + "source": "iana" + }, + "video/vnd.nokia.videovoip": { + "source": "iana" + }, + "video/vnd.objectvideo": { + "source": "iana" + }, + "video/vnd.planar": { + "source": "iana" + }, + "video/vnd.radgamettools.bink": { + "source": "iana" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "iana" + }, + "video/vnd.sealed.mpeg4": { + "source": "iana" + }, + "video/vnd.sealed.swf": { + "source": "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "iana" + }, + "video/vnd.uvvu.mp4": { + "source": "iana", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "iana", + "extensions": ["viv"] + }, + "video/vnd.youtube.yt": { + "source": "iana" + }, + "video/vp8": { + "source": "iana" + }, + "video/vp9": { + "source": "iana" + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/node_modules/body-parser/node_modules/mime-db/index.js b/node_modules/body-parser/node_modules/mime-db/index.js new file mode 100644 index 0000000..ec2be30 --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-db/index.js @@ -0,0 +1,12 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/node_modules/body-parser/node_modules/mime-db/package.json b/node_modules/body-parser/node_modules/mime-db/package.json new file mode 100644 index 0000000..289a370 --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-db/package.json @@ -0,0 +1,56 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.54.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "8.32.0", + "eslint-config-standard": "15.0.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", + "media-typer": "1.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "stream-to-array": "2.3.0", + "undici": "7.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", + "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", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/body-parser/node_modules/mime-types/index.js b/node_modules/body-parser/node_modules/mime-types/index.js new file mode 100644 index 0000000..c348cb6 --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-types/index.js @@ -0,0 +1,211 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname +var mimeScore = require('./mimeScore') + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) +exports._extensionConflicts = [] + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {boolean|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .slice(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + types[extension] = _preferredType(extension, types[extension], type) + + // DELETE (eventually): Capture extension->type maps that change as a + // result of switching to mime-score. This is just to help make reviewing + // PR #119 easier, and can be removed once that PR is approved. + const legacyType = _preferredTypeLegacy( + extension, + types[extension], + type + ) + if (legacyType !== types[extension]) { + exports._extensionConflicts.push([extension, legacyType, types[extension]]) + } + } + }) +} + +// Resolve type conflict using mime-score +function _preferredType (ext, type0, type1) { + var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 + var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 + + return score0 > score1 ? type0 : type1 +} + +// Resolve type conflict using pre-mime-score logic +function _preferredTypeLegacy (ext, type0, type1) { + var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] + + var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 + var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 + + if ( + exports.types[extension] !== 'application/octet-stream' && + (score0 > score1 || + (score0 === score1 && + exports.types[extension]?.slice(0, 12) === 'application/')) + ) { + return type0 + } + + return score0 > score1 ? type0 : type1 +} diff --git a/node_modules/body-parser/node_modules/mime-types/mimeScore.js b/node_modules/body-parser/node_modules/mime-types/mimeScore.js new file mode 100644 index 0000000..e2ecc66 --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-types/mimeScore.js @@ -0,0 +1,52 @@ +// 'mime-score' back-ported to CommonJS + +// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) +var FACET_SCORES = { + 'prs.': 100, + 'x-': 200, + 'x.': 300, + 'vnd.': 400, + default: 900 +} + +// Score mime source (Logic originally from `jshttp/mime-types` module) +var SOURCE_SCORES = { + nginx: 10, + apache: 20, + iana: 40, + default: 30 // definitions added by `jshttp/mime-db` project? +} + +var TYPE_SCORES = { + // prefer application/xml over text/xml + // prefer application/rtf over text/rtf + application: 1, + + // prefer font/woff over application/font-woff + font: 2, + + default: 0 +} + +/** + * Get each component of the score for a mime type. The sum of these is the + * total score. The higher the score, the more "official" the type. + */ +module.exports = function mimeScore (mimeType, source = 'default') { + if (mimeType === 'application/octet-stream') { + return 0 + } + + const [type, subtype] = mimeType.split('/') + + const facet = subtype.replace(/(\.|x-).*/, '$1') + + const facetScore = FACET_SCORES[facet] || FACET_SCORES.default + const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default + const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default + + // All else being equal prefer shorter types + const lengthScore = 1 - mimeType.length / 100 + + return facetScore + sourceScore + typeScore + lengthScore +} diff --git a/node_modules/body-parser/node_modules/mime-types/package.json b/node_modules/body-parser/node_modules/mime-types/package.json new file mode 100644 index 0000000..79481ae --- /dev/null +++ b/node_modules/body-parser/node_modules/mime-types/package.json @@ -0,0 +1,45 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "3.0.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": "jshttp/mime-types", + "dependencies": { + "mime-db": "^1.54.0" + }, + "devDependencies": { + "eslint": "8.33.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": "10.2.0", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js", + "mimeScore.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec test/test.js", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/nodemon/node_modules/ms/index.js b/node_modules/body-parser/node_modules/ms/index.js similarity index 100% rename from node_modules/nodemon/node_modules/ms/index.js rename to node_modules/body-parser/node_modules/ms/index.js diff --git a/node_modules/nodemon/node_modules/ms/package.json b/node_modules/body-parser/node_modules/ms/package.json similarity index 100% rename from node_modules/nodemon/node_modules/ms/package.json rename to node_modules/body-parser/node_modules/ms/package.json diff --git a/node_modules/body-parser/node_modules/qs/dist/qs.js b/node_modules/body-parser/node_modules/qs/dist/qs.js new file mode 100644 index 0000000..f37989a --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/dist/qs.js @@ -0,0 +1,141 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(p=isArray(p)?[p]:p);var f=has.call(r,d);f&&"combine"===t.duplicates?r[d]=utils.combine(r[d],p):f&&"last"!==t.duplicates||(r[d]=p)}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l);else{s=r.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,c=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&d!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=l:"__proto__"!==c&&(s[c]=l):s={0:l}}l=s}return l},parseKeys=function parseQueryStringKeys(e,t,r,i){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(a),n=l?a.slice(0,l.index):a,s=[];if(n){if(!r.plainObjects&&has.call(Object.prototype,n)&&!r.allowPrototypes)return;s.push(n)}for(var d=0;r.depth>0&&null!==(l=o.exec(a))&&d0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k0?c+y:""}; + +},{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,p=[],f=0;f=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||n===formats.RFC1738&&(40===s||41===s)?p[p.length]=u.charAt(f):s<128?p[p.length]=hexTable[s]:s<2048?p[p.length]=hexTable[192|s>>6]+hexTable[128|63&s]:s<55296||s>=57344?p[p.length]=hexTable[224|s>>12]+hexTable[128|s>>6&63]+hexTable[128|63&s]:(f+=1,s=65536+((1023&s)<<10|1023&u.charCodeAt(f)),p[p.length]=hexTable[240|s>>18]+hexTable[128|s>>12&63]+hexTable[128|s>>6&63]+hexTable[128|63&s])}c+=p.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;o-1?callBindBasic([t]):t}; + +},{"10":10,"25":25}],25:[function(require,module,exports){ +"use strict";var undefined,$Object=require(22),$Error=require(16),$EvalError=require(15),$RangeError=require(17),$ReferenceError=require(18),$SyntaxError=require(19),$TypeError=require(20),$URIError=require(21),abs=require(34),floor=require(35),max=require(37),min=require(38),pow=require(39),round=require(40),sign=require(41),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=require(30),$defineProperty=require(14),throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(31)(),getProto=require(28),$ObjectGPO=require(26),$ReflectGPO=require(27),$apply=require(8),$call=require(9),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(24),hasOwn=require(33),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,i=n.value,y=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var s=1,d=!0;s=t.length){var c=$gOPD(i,f);i=(d=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:i[f]}else d=hasOwn(i,f),i=i[f];d&&!y&&(INTRINSICS[a]=i)}}return i}; + +},{"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"33":33,"34":34,"35":35,"37":37,"38":38,"39":39,"40":40,"41":41,"8":8,"9":9}],13:[function(require,module,exports){ +"use strict";var hasProtoAccessor,callBind=require(10),gOPD=require(30);try{hasProtoAccessor=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module.exports=desc&&"function"==typeof desc.get?callBind([desc.get]):"function"==typeof $getPrototypeOf&&function getDunder(t){return $getPrototypeOf(null==t?t:$Object(t))}; + +},{"10":10,"30":30}],30:[function(require,module,exports){ +"use strict";var $gOPD=require(29);if($gOPD)try{$gOPD([],"length")}catch(g){$gOPD=null}module.exports=$gOPD; + +},{"29":29}],14:[function(require,module,exports){ +"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; + +},{}],15:[function(require,module,exports){ +"use strict";module.exports=EvalError; + +},{}],16:[function(require,module,exports){ +"use strict";module.exports=Error; + +},{}],17:[function(require,module,exports){ +"use strict";module.exports=RangeError; + +},{}],18:[function(require,module,exports){ +"use strict";module.exports=ReferenceError; + +},{}],19:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; + +},{}],21:[function(require,module,exports){ +"use strict";module.exports=URIError; + +},{}],22:[function(require,module,exports){ +"use strict";module.exports=Object; + +},{}],23:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(t,e,r){var n=r.quoteStyle||e,o=quotes[n];return o+t+o}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&!has(quotes,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var p=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=p&&p>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var u=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var s=nameOf(t),f=arrObjKeys(t,inspect);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+$join.call(f,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],b=0;b"}if(isArray(t)){if(0===t.length)return"[]";var m=arrObjKeys(t,inspect);return u&&!singleLineValues(m)?"["+indentedJoin(m,u)+"]":"[ "+$join.call(m,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:p-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,(function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))})),collectionOf("Map",mapSize.call(t),d,u)}if(isSet(t)){var j=[];return setForEach&&setForEach.call(t,(function(e){j.push(inspect(e,t))})),collectionOf("Set",setSize.call(t),j,u)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var O=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",k=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",v=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||$?"["+$join.call($concat.call([],k||[],$||[]),": ")+"] ":"");return 0===O.length?v+"{}":u?v+"{"+indentedJoin(O,u)+"}":v+"{ "+$join.call(O,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}var o=quoteREs[e.quoteStyle||"single"];return o.lastIndex=0,wrapQuotes($replace.call($replace.call(t,o,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { + return val.split(','); + } + + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split( + options.delimiter, + options.throwOnLimitExceeded ? limit + 1 : limit + ); + + if (options.throwOnLimitExceeded && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + + val = utils.maybeMap( + parseArrayValue( + part.slice(pos + 1), + options, + isArray(obj[key]) ? obj[key].length : 0 + ), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : utils.combine([], leaf); + } else { + obj = options.plainObjects ? { __proto__: null } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, check strictDepth option for throw, else just add whatever is left + + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } + + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { __proto__: null } : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { __proto__: null } : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; diff --git a/node_modules/body-parser/node_modules/qs/lib/stringify.js b/node_modules/body-parser/node_modules/qs/lib/stringify.js new file mode 100644 index 0000000..2666eaf --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/lib/stringify.js @@ -0,0 +1,356 @@ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' + ? key.value + : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + var value = obj[key]; + + if (options.skipNulls && value === null) { + continue; + } + pushToArray(keys, stringify( + value, + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; diff --git a/node_modules/body-parser/node_modules/qs/lib/utils.js b/node_modules/body-parser/node_modules/qs/lib/utils.js new file mode 100644 index 0000000..2905ff0 --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/lib/utils.js @@ -0,0 +1,268 @@ +'use strict'; + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { __proto__: null } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ( + (options && (options.plainObjects || options.allowPrototypes)) + || !has.call(Object.prototype, source) + ) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + out += arr.join(''); + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; diff --git a/node_modules/body-parser/node_modules/qs/package.json b/node_modules/body-parser/node_modules/qs/package.json new file mode 100644 index 0000000..e4144d0 --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/package.json @@ -0,0 +1,93 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.14.0", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "lib/index.js", + "sideEffects": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs", + "query", + "url", + "parse", + "stringify" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "side-channel": "^1.1.0" + }, + "devDependencies": { + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^21.1.1", + "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.7.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "glob": "=10.3.7", + "has-bigints": "^1.1.0", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "iconv-lite": "^0.5.1", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "mkdirp": "^0.5.5", + "mock-property": "^1.1.0", + "module-deps": "^6.2.3", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "tape": "^5.9.0", + "unassertify": "^3.0.1" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "readme": "evalmd README.md", + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows", + "logos", + "tea.yaml" + ] + } +} diff --git a/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js b/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js new file mode 100644 index 0000000..2b1190e --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js @@ -0,0 +1,267 @@ +'use strict'; + +module.exports = { + emptyTestCases: [ + { + input: '&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&=', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=&', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '=', + withEmptyKeys: { '': '' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + } + }, + { + input: '=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&&&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&=&=&', + withEmptyKeys: { '': ['', '', ''] }, + stringifyOutput: { + brackets: '[]=&[]=&[]=', + indices: '[0]=&[1]=&[2]=', + repeat: '=&=&=' + }, + noEmptyKeys: {} + }, + { + input: '=&a[]=b&a[1]=c', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '=a', + withEmptyKeys: { '': 'a' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=a', + indices: '=a', + repeat: '=a' + } + }, + { + input: 'a==a', + withEmptyKeys: { a: '=a' }, + noEmptyKeys: { a: '=a' }, + stringifyOutput: { + brackets: 'a==a', + indices: 'a==a', + repeat: 'a==a' + } + }, + { + input: '=&a[]=b', + withEmptyKeys: { '': '', a: ['b'] }, + stringifyOutput: { + brackets: '=&a[]=b', + indices: '=&a[0]=b', + repeat: '=&a=b' + }, + noEmptyKeys: { a: ['b'] } + }, + { + input: '=&a[]=b&a[]=c&a[2]=d', + withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c&a[]=d', + indices: '=&a[0]=b&a[1]=c&a[2]=d', + repeat: '=&a=b&a=c&a=d' + }, + noEmptyKeys: { a: ['b', 'c', 'd'] } + }, + { + input: '=a&=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: {} + }, + { + input: '=a&foo=b', + withEmptyKeys: { '': 'a', foo: 'b' }, + noEmptyKeys: { foo: 'b' }, + stringifyOutput: { + brackets: '=a&foo=b', + indices: '=a&foo=b', + repeat: '=a&foo=b' + } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[0]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[0]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '[]=a&[]=b& []=1', + withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, + stringifyOutput: { + brackets: '[]=a&[]=b& []=1', + indices: '[0]=a&[1]=b& [0]=1', + repeat: '=a&=b& =1' + }, + noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } + }, + { + input: '[0]=a&[1]=b&a[0]=1&a[1]=2', + withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, + noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, + stringifyOutput: { + brackets: '[]=a&[]=b&a[]=1&a[]=2', + indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', + repeat: '=a&=b&a=1&a=2' + } + }, + { + input: '[deep]=a&[deep]=2', + withEmptyKeys: { '': { deep: ['a', '2'] } + }, + stringifyOutput: { + brackets: '[deep][]=a&[deep][]=2', + indices: '[deep][0]=a&[deep][1]=2', + repeat: '[deep]=a&[deep]=2' + }, + noEmptyKeys: { deep: ['a', '2'] } + }, + { + input: '%5B0%5D=a&%5B1%5D=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: { 0: 'a', 1: 'b' } + } + ] +}; diff --git a/node_modules/body-parser/node_modules/qs/test/parse.js b/node_modules/body-parser/node_modules/qs/test/parse.js new file mode 100644 index 0000000..32cdfd8 --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/test/parse.js @@ -0,0 +1,1276 @@ +'use strict'; + +var test = require('tape'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); +var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); + +var qs = require('../'); +var utils = require('../lib/utils'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + + st.end(); + }); + + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + + st.end(); + }); + + t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + + st.end(); + }); + + t.test('throws when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('throws when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.test('uses original key when depth = 0', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.test('uses original key when depth = false', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); + + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = SaferBuffer.from('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('parses jquery-param strings', function (st) { + // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' + var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; + var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; + st.deepEqual(qs.parse(encoded), expected); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('does not throw when a native prototype has an enumerable property', function (st) { + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); + + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); + st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); + st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); + + var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); + st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); + st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); + + st.end(); + }); + + t.test('allows for query string prefix', function (st) { + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); + + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses string with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); + + // test cases inversed from from stringify tests + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); + + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); + + st.end(); + }); + + t.test('parses values with comma as array divider', function (st) { + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); + st.end(); + }); + + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (!isNaN(Number(str))) { + return parseFloat(str); + } + return defaultDecoder(str, defaultDecoder, charset, type); + }; + + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); + + st.end(); + }); + + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); + + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.parse('a=b&c=d'); + + restore(); + + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('does not crash when parsing deep objects', function (st) { + var parsed; + var str = 'foo'; + + for (var i = 0; i < 5000; i++) { + str += '[p]'; + } + + str += '=bar'; + + st.doesNotThrow(function () { + parsed = qs.parse(str, { depth: 5000 }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + + var depth = 0; + var ref = parsed.foo; + while ((ref = ref.p)) { + depth += 1; + } + + st.equal(depth, 5000, 'parsed is 5000 properties deep'); + + st.end(); + }); + + t.test('parses null objects correctly', { skip: !hasProto }, function (st) { + var a = { __proto__: null, b: 'c' }; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('dunder proto is ignored', function (st) { + var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; + var result = qs.parse(payload, { allowPrototypes: true }); + + st.deepEqual( + result, + { + categories: { + length: '42' + } + }, + 'silent [[Prototype]] payload' + ); + + var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); + + st.deepEqual( + plainResult, + { + __proto__: null, + categories: { + __proto__: null, + length: '42' + } + }, + 'silent [[Prototype]] payload: plain objects' + ); + + var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); + + st.notOk(Array.isArray(query.categories), 'is not an array'); + st.notOk(query.categories instanceof Array, 'is not instanceof an array'); + st.deepEqual(query.categories, { some: { json: 'toInject' } }); + st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), + { + foo: { + bar: 'stuffs' + } + }, + 'hidden values' + ); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), + { + __proto__: null, + foo: { + __proto__: null, + bar: 'stuffs' + } + }, + 'hidden values: plain objects' + ); + + st.end(); + }); + + t.test('can return null objects', { skip: !hasProto }, function (st) { + var expected = { + __proto__: null, + a: { + __proto__: null, + b: 'c', + hasOwnProperty: 'd' + } + }; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null }); + var expectedArray = { + __proto__: null, + a: { + __proto__: null, + 0: 'b', + c: 'd' + } + }; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('receives the default decoder as a second argument', function (st) { + st.plan(1); + qs.parse('a', { + decoder: function (str, defaultDecoder) { + st.equal(defaultDecoder, utils.decode); + } + }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st['throws'](function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.parse('a[b]=true', options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.parse('a=b', { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('parses an iso-8859-1 string if asked to', function (st) { + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); + st.end(); + }); + + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; + var urlEncodedOSlashInUtf8 = '%C3%B8'; + var urlEncodedNumCheckmark = '%26%2310003%3B'; + var urlEncodedNumSmiley = '%26%239786%3B'; + + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); + st.end(); + }); + + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); + st.end(); + }); + + t.test('ignores an utf8 sentinel with an unknown value', function (st) { + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { + charset: 'iso-8859-1', + decoder: function (str, defaultDecoder, charset) { + return str ? defaultDecoder(str, defaultDecoder, charset) : null; + }, + interpretNumericEntities: true + }), { foo: null, bar: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) { + st.deepEqual( + qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }), + { b: '', a: ['1,☺'] } + ); + + st.end(); + }); + + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); + st.end(); + }); + + t.test('allows for decoding keys and values differently', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); + st.end(); + }); + + t.test('parameter limit tests', function (st) { + st.test('does not throw error when within parameter limit', function (sst) { + var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean' + ); + sst.end(); + }); + + st.test('throws error when parameter limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'), + 'throws error when parameter limit is exceeded' + ); + sst.end(); + }); + + st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('silently truncates when parameter limit exceeded without error', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity }); + sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation'); + sst.end(); + }); + + st.end(); + }); + + t.test('array limit tests', function (st) { + st.test('does not throw error when array is within limit', function (sst) { + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean for array limit' + ); + sst.end(); + }); + + st.test('throws error when array limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when array limit is exceeded' + ); + sst.end(); + }); + + st.test('converts array to object if length is greater than limit', function (sst) { + var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 }); + + sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'does not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly'); + } + ); + st.end(); + }); +}); diff --git a/node_modules/body-parser/node_modules/qs/test/stringify.js b/node_modules/body-parser/node_modules/qs/test/stringify.js new file mode 100644 index 0000000..7253144 --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/test/stringify.js @@ -0,0 +1,1306 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var utils = require('../lib/utils'); +var iconv = require('iconv-lite'); +var SaferBuffer = require('safer-buffer').Buffer; +var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); +var hasBigInt = require('has-bigints')(); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies falsy values', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(null, { strictNullHandling: true }), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(0), ''); + st.end(); + }); + + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { + st.equal(qs.stringify(Symbol.iterator), ''); + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); + st.equal( + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=Symbol%28Symbol.iterator%29' + ); + st.end(); + }); + + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { + var three = BigInt(3); + var encodeWithN = function (value, defaultEncoder, charset) { + var result = defaultEncoder(value, defaultEncoder, charset); + return typeof value === 'bigint' ? result + 'n' : result; + }; + st.equal(qs.stringify(three), ''); + st.equal(qs.stringify([three]), '0=3'); + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); + st.equal(qs.stringify({ a: three }), 'a=3'); + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=3' + ); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), + 'a[]=3n' + ); + st.end(); + }); + + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('adds query prefix', function (st) { + st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); + st.end(); + }); + + t.test('with query prefix, outputs blank string given an empty object', function (st) { + st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); + st.end(); + }); + + t.test('stringifies nested falsy values', function (st) { + st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); + st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); + st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), + 'a=b%2Cc%2Cd', + 'comma => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); + + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + + st.end(); + }); + + t.test('stringifies an array value with one item vs multiple items', function (st) { + st.test('non-array item', function (s2t) { + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); + + s2t.end(); + }); + + st.test('array with a single item', function (s2t) { + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); + + s2t.end(); + }); + + st.test('array with multiple items', function (s2t) { + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); + + s2t.end(); + }); + + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); + st.end(); + }); + + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } + ), + 'a.b=c,d', + 'comma: stringifies with dots + comma' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), + '???', + 'brackets => brackets', + { skip: 'TODO: figure out what this should do' } + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty array in different arrayFormat', function (st) { + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); + // arrayFormat default + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); + // with strictNullHandling + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); + // with skipNulls + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + st.intercept(Object.prototype, 'crash', { value: 'test' }); + + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.stringify({ a: 'b', c: 'd' }); + + restore(); + + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + st['throws']( + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var circular = { + a: 'value' + }; + circular.a = circular; + st['throws']( + function () { qs.stringify(circular); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var arr = ['a']; + st.doesNotThrow( + function () { qs.stringify({ x: arr, y: arr }); }, + 'non-cyclic values do not throw' + ); + + st.end(); + }); + + t.test('non-circular duplicated references can still work', function (st) { + var hourOfDay = { + 'function': 'hour_of_day' + }; + + var p1 = { + 'function': 'gte', + arguments: [hourOfDay, 0] + }; + var p2 = { + 'function': 'lte', + arguments: [hourOfDay, 23] + }; + + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); + + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(2); + + qs.stringify({ a: 1 }, { + encoder: function (str, defaultEncoder) { + st.equal(defaultEncoder, utils.encode); + } + }); + + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st['throws'](function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + + st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { + encoder: function (buffer) { + return buffer; + } + }), 'a=a b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st['throws'](function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma' + } + ), + 'a=' + date.getTime(), + 'works with arrayFormat comma' + ); + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma', + commaRoundTrip: true + } + ), + 'a%5B%5D=' + date.getTime(), + 'works with arrayFormat comma' + ); + + st.end(); + }); + + t.test('RFC 1738 serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); + + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); + + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { + st['throws']( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + }); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' + ); + + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.stringify({ a: 'b' }, { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('respects a charset of iso-8859-1', function (st) { + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); + st.end(); + }); + + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); + st.end(); + }); + + t.test('respects an explicit charset of utf-8 (the default)', function (st) { + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); + st.end(); + }); + + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); + + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.stringify({}, options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('strictNullHandling works with custom filter', function (st) { + var filter = function (prefix, value) { + return value; + }; + + var options = { strictNullHandling: true, filter: filter }; + st.equal(qs.stringify({ key: null }, options), 'key'); + st.end(); + }); + + t.test('strictNullHandling works with null serializeDate', function (st) { + var serializeDate = function () { + return null; + }; + var options = { strictNullHandling: true, serializeDate: serializeDate }; + var date = new Date(); + st.equal(qs.stringify({ key: date }, options), 'key'); + st.end(); + }); + + t.test('allows for encoding keys and values differently', function (st) { + var encoder = function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); + st.end(); + }); + + t.test('objects inside arrays', function (st) { + var obj = { a: { b: { c: 'd', e: 'f' } } }; + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; + + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); + + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); + st.equal( + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), + '???', + 'array, comma', + { skip: 'TODO: figure out what this should do' } + ); + + st.end(); + }); + + t.test('stringifies sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); + + st.end(); + }); + + t.end(); +}); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); + + t.test('stringifies non-string keys', function (st) { + var actual = qs.stringify({ a: 'b', 'false': {} }, { + filter: ['a', false, null], + allowDots: true, + encodeDotInKeys: true + }); + + st.equal(actual, 'a=b', 'stringifies correctly'); + + st.end(); + }); +}); diff --git a/node_modules/body-parser/node_modules/qs/test/utils.js b/node_modules/body-parser/node_modules/qs/test/utils.js new file mode 100644 index 0000000..3933516 --- /dev/null +++ b/node_modules/body-parser/node_modules/qs/test/utils.js @@ -0,0 +1,262 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var SaferBuffer = require('safer-buffer').Buffer; +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); + + t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); + + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); + t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); + + var func = function f() {}; + t.deepEqual( + utils.merge(func, { foo: 'bar' }), + [func, { foo: 'bar' }], + 'functions can not be merged into' + ); + + func.bar = 'baz'; + t.deepEqual( + utils.merge({ foo: 'bar' }, func), + { foo: 'bar', bar: 'baz' }, + 'functions can be merge sources' + ); + + t.test( + 'avoids invoking array setters unnecessarily', + { skip: typeof Object.defineProperty !== 'function' }, + function (st) { + var setCount = 0; + var getCount = 0; + var observed = []; + Object.defineProperty(observed, 0, { + get: function () { + getCount += 1; + return { bar: 'baz' }; + }, + set: function () { setCount += 1; } + }); + utils.merge(observed, [null]); + st.equal(setCount, 0); + st.equal(getCount, 1); + observed[0] = observed[0]; // eslint-disable-line no-self-assign + st.equal(setCount, 1); + st.equal(getCount, 2); + st.end(); + } + ); + + t.end(); +}); + +test('assign()', function (t) { + var target = { a: 1, b: 2 }; + var source = { b: 3, c: 4 }; + var result = utils.assign(target, source); + + t.equal(result, target, 'returns the target'); + t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); + t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); + + t.end(); +}); + +test('combine()', function (t) { + t.test('both arrays', function (st) { + var a = [1]; + var b = [2]; + var combined = utils.combine(a, b); + + st.deepEqual(a, [1], 'a is not mutated'); + st.deepEqual(b, [2], 'b is not mutated'); + st.notEqual(a, combined, 'a !== combined'); + st.notEqual(b, combined, 'b !== combined'); + st.deepEqual(combined, [1, 2], 'combined is a + b'); + + st.end(); + }); + + t.test('one array, one non-array', function (st) { + var aN = 1; + var a = [aN]; + var bN = 2; + var b = [bN]; + + var combinedAnB = utils.combine(aN, b); + st.deepEqual(b, [bN], 'b is not mutated'); + st.notEqual(aN, combinedAnB, 'aN + b !== aN'); + st.notEqual(a, combinedAnB, 'aN + b !== a'); + st.notEqual(bN, combinedAnB, 'aN + b !== bN'); + st.notEqual(b, combinedAnB, 'aN + b !== b'); + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); + + var combinedABn = utils.combine(a, bN); + st.deepEqual(a, [aN], 'a is not mutated'); + st.notEqual(aN, combinedABn, 'a + bN !== aN'); + st.notEqual(a, combinedABn, 'a + bN !== a'); + st.notEqual(bN, combinedABn, 'a + bN !== bN'); + st.notEqual(b, combinedABn, 'a + bN !== b'); + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); + + st.end(); + }); + + t.test('neither is an array', function (st) { + var combined = utils.combine(1, 2); + st.notEqual(1, combined, '1 + 2 !== 1'); + st.notEqual(2, combined, '1 + 2 !== 2'); + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); + + st.end(); + }); + + t.end(); +}); + +test('decode', function (t) { + t.equal( + utils.decode('a+b'), + 'a b', + 'decodes + to space' + ); + + t.equal( + utils.decode('name%2Eobj'), + 'name.obj', + 'decodes a string' + ); + t.equal( + utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'), + 'name.obj.foo', + 'decodes a string in iso-8859-1' + ); + + t.end(); +}); + +test('encode', function (t) { + forEach(v.nullPrimitives, function (nullish) { + t['throws']( + function () { utils.encode(nullish); }, + TypeError, + inspect(nullish) + ' is not a string' + ); + }); + + t.equal(utils.encode(''), '', 'empty string returns itself'); + t.deepEqual(utils.encode([]), [], 'empty array returns itself'); + t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself'); + + t.test('symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded'); + + st.end(); + }); + + t.equal( + utils.encode('(abc)'), + '%28abc%29', + 'encodes parentheses' + ); + t.equal( + utils.encode({ toString: function () { return '(abc)'; } }), + '%28abc%29', + 'toStrings and encodes parentheses' + ); + + t.equal( + utils.encode('abc 123 💩', null, 'iso-8859-1'), + 'abc%20123%20%26%2355357%3B%26%2356489%3B', + 'encodes in iso-8859-1' + ); + + var longString = ''; + var expectedString = ''; + for (var i = 0; i < 1500; i++) { + longString += ' '; + expectedString += '%20'; + } + + t.equal( + utils.encode(longString), + expectedString, + 'encodes a long string' + ); + + t.equal( + utils.encode('\x28\x29'), + '%28%29', + 'encodes parens normally' + ); + t.equal( + utils.encode('\x28\x29', null, null, null, 'RFC1738'), + '()', + 'does not encode parens in RFC1738' + ); + + // todo RFC1738 format + + t.equal( + utils.encode('Āက豈'), + '%C4%80%E1%80%80%EF%A4%80', + 'encodes multibyte chars' + ); + + t.equal( + utils.encode('\uD83D \uDCA9'), + '%F0%9F%90%A0%F0%BA%90%80', + 'encodes lone surrogates' + ); + + t.end(); +}); + +test('isBuffer()', function (t) { + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); + }); + + var fakeBuffer = { constructor: Buffer }; + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); + + var saferBuffer = SaferBuffer.from('abc'); + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); + + var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); + t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); + t.end(); +}); + +test('isRegExp()', function (t) { + t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp'); + t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp'); + t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp'); + + forEach(v.primitives, function (primitive) { + t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp'); + }); + + t.end(); +}); diff --git a/node_modules/body-parser/node_modules/type-is/index.js b/node_modules/body-parser/node_modules/type-is/index.js new file mode 100644 index 0000000..e773845 --- /dev/null +++ b/node_modules/body-parser/node_modules/type-is/index.js @@ -0,0 +1,250 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + var i + var types = types_ + + // remove parameters and normalize + var val = tryNormalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + // Parse the type + var type = contentType.parse(value).type + + return typer.test(type) ? type : null +} + +/** + * Try to normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function tryNormalizeType (value) { + try { + return value ? normalizeType(value) : null + } catch (err) { + return null + } +} diff --git a/node_modules/body-parser/node_modules/type-is/package.json b/node_modules/body-parser/node_modules/type-is/package.json new file mode 100644 index 0000000..08586d2 --- /dev/null +++ b/node_modules/body-parser/node_modules/type-is/package.json @@ -0,0 +1,47 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.0.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json index 3c9926f..e7f763b 100644 --- a/node_modules/body-parser/package.json +++ b/node_modules/body-parser/package.json @@ -1,7 +1,7 @@ { "name": "body-parser", "description": "Node.js body parsing middleware", - "version": "1.20.3", + "version": "2.2.0", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" @@ -9,18 +9,15 @@ "license": "MIT", "repository": "expressjs/body-parser", "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "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", @@ -30,27 +27,23 @@ "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "6.1.1", "eslint-plugin-standard": "4.1.0", - "methods": "1.1.2", - "mocha": "10.2.0", - "nyc": "15.1.0", - "safe-buffer": "5.2.1", - "supertest": "6.3.3" + "mocha": "^11.1.0", + "nyc": "^17.1.0", + "supertest": "^7.0.0" }, "files": [ "lib/", "LICENSE", "HISTORY.md", - "SECURITY.md", "index.js" ], "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": ">=18" }, "scripts": { "lint": "eslint .", - "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "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/boolbase/index.js b/node_modules/boolbase/index.js deleted file mode 100644 index 8799fd9..0000000 --- a/node_modules/boolbase/index.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - trueFunc: function trueFunc(){ - return true; - }, - falseFunc: function falseFunc(){ - return false; - } -}; \ No newline at end of file diff --git a/node_modules/boolbase/package.json b/node_modules/boolbase/package.json deleted file mode 100644 index 78330a8..0000000 --- a/node_modules/boolbase/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "boolbase", - "version": "1.0.0", - "description": "two functions: One that returns true, one that returns false", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/fb55/boolbase" - }, - "keywords": [ - "boolean", - "function" - ], - "author": "Felix Boehm ", - "license": "ISC", - "bugs": { - "url": "https://github.com/fb55/boolbase/issues" - }, - "homepage": "https://github.com/fb55/boolbase" -} diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be8..0000000 --- a/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -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 identity(e) { - return e; -} - -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 || /\$$/.test(m.pre)) return [str]; - - 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) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - 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. - - // 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) - : ['']; - - 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 = concatMap(n, function(el) { return expand(el, 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 deleted file mode 100644 index a18faa8..0000000 --- a/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "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", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "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" - ] - } -} diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js deleted file mode 100644 index d222c13..0000000 --- a/node_modules/braces/index.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; - -const stringify = require('./lib/stringify'); -const compile = require('./lib/compile'); -const expand = require('./lib/expand'); -const parse = require('./lib/parse'); - -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -const braces = (input, options = {}) => { - let output = []; - - if (Array.isArray(input)) { - for (const pattern of input) { - const result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } - - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ - -braces.parse = (input, options = {}) => parse(input, options); - -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; - -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); -}; - -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - - let result = expand(input, options); - - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } - - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } - - return result; -}; - -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } - - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; - -/** - * Expose "braces" - */ - -module.exports = braces; diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js deleted file mode 100644 index dce69be..0000000 --- a/node_modules/braces/lib/compile.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const utils = require('./utils'); - -const compile = (ast, options = {}) => { - const walk = (node, parent = {}) => { - const invalidBlock = utils.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; - const invalid = invalidBlock === true || invalidNode === true; - const prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; - - if (node.isOpen === true) { - return prefix + node.value; - } - - if (node.isClose === true) { - console.log('node.isClose', prefix, node.value); - return prefix + node.value; - } - - if (node.type === 'open') { - return invalid ? prefix + node.value : '('; - } - - if (node.type === 'close') { - return invalid ? prefix + node.value : ')'; - } - - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; - } - - if (node.value) { - return node.value; - } - - if (node.nodes && node.ranges > 0) { - const args = utils.reduce(node.nodes); - const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); - - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } - - if (node.nodes) { - for (const child of node.nodes) { - output += walk(child, node); - } - } - - return output; - }; - - return walk(ast); -}; - -module.exports = compile; diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js deleted file mode 100644 index 2bb3b88..0000000 --- a/node_modules/braces/lib/constants.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -module.exports = { - MAX_LENGTH: 10000, - - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ - - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ - - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ - - CHAR_ASTERISK: '*', /* * */ - - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ -}; diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js deleted file mode 100644 index 35b2c41..0000000 --- a/node_modules/braces/lib/expand.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const stringify = require('./stringify'); -const utils = require('./utils'); - -const append = (queue = '', stash = '', enclose = false) => { - const result = []; - - queue = [].concat(queue); - stash = [].concat(stash); - - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (const item of queue) { - if (Array.isArray(item)) { - for (const value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); - } - } - } - return utils.flatten(result); -}; - -const expand = (ast, options = {}) => { - const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; - - const walk = (node, parent = {}) => { - node.queue = []; - - let p = parent; - let q = parent.queue; - - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } - - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } - - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } - - if (node.nodes && node.ranges > 0) { - const args = utils.reduce(node.nodes); - - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } - - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } - - const enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } - - for (let i = 0; i < node.nodes.length; i++) { - const child = node.nodes[i]; - - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } - - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } - - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } - - if (child.nodes) { - walk(child, node); - } - } - - return queue; - }; - - return utils.flatten(walk(ast)); -}; - -module.exports = expand; diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js deleted file mode 100644 index 3a6988e..0000000 --- a/node_modules/braces/lib/parse.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -const stringify = require('./stringify'); - -/** - * Constants - */ - -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = require('./constants'); - -/** - * parse - */ - -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - const opts = options || {}; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } - - const ast = { type: 'root', input, nodes: [] }; - const stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - const length = input.length; - let index = 0; - let depth = 0; - let value; - - /** - * Helpers - */ - - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } - - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } - - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; - - push({ type: 'bos' }); - - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); - - /** - * Invalid chars - */ - - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } - - /** - * Escaped chars - */ - - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } - - /** - * Right square bracket (literal): ']' - */ - - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } - - /** - * Left square bracket: '[' - */ - - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - - let next; - - while (index < length && (next = advance())) { - value += next; - - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } - - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } - - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; - - if (brackets === 0) { - break; - } - } - } - - push({ type: 'text', value }); - continue; - } - - /** - * Parentheses - */ - - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } - - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } - - /** - * Quotes: '|"|` - */ - - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - const open = value; - let next; - - if (options.keepQuotes !== true) { - value = ''; - } - - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } - - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - - value += next; - } - - push({ type: 'text', value }); - continue; - } - - /** - * Left curly brace: '{' - */ - - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - - const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - const brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; - - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } - - /** - * Right curly brace: '}' - */ - - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } - - const type = 'close'; - block = stack.pop(); - block.close = true; - - push({ type, value }); - depth--; - - block = stack[stack.length - 1]; - continue; - } - - /** - * Comma: ',' - */ - - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - const open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } - - push({ type: 'comma', value }); - block.commas++; - continue; - } - - /** - * Dot: '.' - */ - - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - const siblings = block.nodes; - - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; - } - - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } - - block.ranges++; - block.args = []; - continue; - } - - if (prev.type === 'range') { - siblings.pop(); - - const before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } - - push({ type: 'dot', value }); - continue; - } - - /** - * Text - */ - - push({ type: 'text', value }); - } - - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); - - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); - - // get the location of the block on parent.nodes (block's siblings) - const parent = stack[stack.length - 1]; - const index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); - - push({ type: 'eos' }); - return ast; -}; - -module.exports = parse; diff --git a/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js deleted file mode 100644 index 8bcf872..0000000 --- a/node_modules/braces/lib/stringify.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const utils = require('./utils'); - -module.exports = (ast, options = {}) => { - const stringify = (node, parent = {}) => { - const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; - - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } - - if (node.value) { - return node.value; - } - - if (node.nodes) { - for (const child of node.nodes) { - output += stringify(child); - } - } - return output; - }; - - return stringify(ast); -}; - diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js deleted file mode 100644 index d19311f..0000000 --- a/node_modules/braces/lib/utils.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; -}; - -/** - * Find a node of the given type - */ - -exports.find = (node, type) => node.nodes.find(node => node.type === type); - -/** - * Find a node of the given type - */ - -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; -}; - -/** - * Escape the given node with '\\' before node.value - */ - -exports.escapeNode = (block, n = 0, type) => { - const node = block.nodes[n]; - if (!node) return; - - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } -}; - -/** - * Returns true if the given brace node should be enclosed in literal braces - */ - -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a brace node is invalid. - */ - -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a node is an open or close node - */ - -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; -}; - -/** - * Reduce an array of text nodes. - */ - -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); - -/** - * Flatten an array - */ - -exports.flatten = (...args) => { - const result = []; - - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - const ele = arr[i]; - - if (Array.isArray(ele)) { - flat(ele); - continue; - } - - if (ele !== undefined) { - result.push(ele); - } - } - return result; - }; - - flat(args); - return result; -}; diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json deleted file mode 100644 index c3c056e..0000000 --- a/node_modules/braces/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "braces", - "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", - "version": "3.0.3", - "homepage": "https://github.com/micromatch/braces", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Elan Shanker (https://github.com/es128)", - "Eugene Sharygin (https://github.com/eush77)", - "hemanth.hm (http://h3manth.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/braces", - "bugs": { - "url": "https://github.com/micromatch/braces/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "lib" - ], - "main": "index.js", - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "mocha", - "benchmark": "node benchmark" - }, - "dependencies": { - "fill-range": "^7.1.1" - }, - "devDependencies": { - "ansi-colors": "^3.2.4", - "bash-path": "^2.0.1", - "gulp-format-md": "^2.0.0", - "mocha": "^6.1.1" - }, - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "braces", - "expand", - "expansion", - "filepath", - "fill", - "fs", - "glob", - "globbing", - "letter", - "match", - "matches", - "matching", - "number", - "numerical", - "path", - "range", - "ranges", - "sh" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - }, - "plugins": [ - "gulp-format-md" - ] - } -} diff --git a/node_modules/call-of-duty-api/dist/index.d.ts b/node_modules/call-of-duty-api/dist/index.d.ts deleted file mode 100644 index a36a135..0000000 --- a/node_modules/call-of-duty-api/dist/index.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -declare enum platforms { - All = "all", - Activision = "acti", - Battlenet = "battle", - PSN = "psn", - Steam = "steam", - Uno = "uno", - XBOX = "xbl", - ios = "ios", - NULL = "_" -} -declare enum games { - ModernWarfare = "mw", - ModernWarfare2 = "mw2", - Vanguard = "vg", - ColdWar = "cw", - NULL = "_" -} -declare enum friendActions { - Invite = "invite", - Uninvite = "uninvite", - Remove = "remove", - Block = "block", - Unblock = "unblock" -} -declare const enableDebugMode: () => boolean; -declare const disableDebugMode: () => boolean; -declare const login: (ssoToken: string) => boolean; -declare const telescopeLogin: (username: string, password: string) => Promise; -declare class WZ { - fullData: (gamertag: string, platform: platforms) => Promise; - combatHistory: (gamertag: string, platform: platforms) => Promise; - combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - breakdown: (gamertag: string, platform: platforms) => Promise; - breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - matchInfo: (matchId: string, platform: platforms) => Promise; - cleanGameMode: (mode: string) => Promise; -} -declare class MW { - fullData: (gamertag: string, platform: platforms) => Promise; - combatHistory: (gamertag: string, platform: platforms) => Promise; - combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - breakdown: (gamertag: string, platform: platforms) => Promise; - breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - matchInfo: (matchId: string, platform: platforms) => Promise; - seasonloot: (gamertag: string, platform: platforms) => Promise; - mapList: (platform: platforms) => Promise; -} -declare class MW2 { - fullData: (unoId: string) => Promise; - matches: (unoId: string) => Promise; - matchInfo: (unoId: string, matchId: string) => Promise; -} -declare class WZ2 { - fullData: (unoId: string) => Promise; - matches: (unoId: string) => Promise; - matchInfo: (unoId: string, matchId: string) => Promise; -} -declare class MW3 { - fullData: (unoId: string) => Promise; - matches: (unoId: string) => Promise; - matchInfo: (unoId: string, matchId: string) => Promise; -} -declare class WZM { - fullData: (unoId: string) => Promise; - matches: (unoId: string) => Promise; - matchInfo: (unoId: string, matchId: string) => Promise; -} -declare class CW { - fullData: (gamertag: string, platform: platforms) => Promise; - combatHistory: (gamertag: string, platform: platforms) => Promise; - combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - breakdown: (gamertag: string, platform: platforms) => Promise; - breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - seasonloot: (gamertag: string, platform: platforms) => Promise; - mapList: (platform: platforms) => Promise; - matchInfo: (matchId: string, platform: platforms) => Promise; -} -declare class VG { - fullData: (gamertag: string, platform: platforms) => Promise; - combatHistory: (gamertag: string, platform: platforms) => Promise; - combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - breakdown: (gamertag: string, platform: platforms) => Promise; - breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise; - seasonloot: (gamertag: string, platform: platforms) => Promise; - mapList: (platform: platforms) => Promise; - matchInfo: (matchId: string, platform: platforms) => Promise; -} -declare class SHOP { - purchasableItems: (gameId: string) => Promise; - bundleInformation: (title: string, bundleId: string) => Promise; - battlePassLoot: (title: games, season: number, platform: platforms) => Promise; -} -declare class USER { - friendFeed: (gamertag: string, platform: platforms) => Promise; - eventFeed: () => Promise; - loggedInIdentities: () => Promise; - codPoints: (gamertag: string, platform: platforms) => Promise; - connectedAccounts: (gamertag: string, platform: platforms) => Promise; - settings: (gamertag: string, platform: platforms) => Promise; - friendAction: (gamertag: string, platform: platforms, action: friendActions) => Promise; -} -declare class ALT { - search: (gamertag: string, platform: platforms) => Promise; - cleanWeapon: (weapon: string) => Promise; -} -declare const Warzone: WZ; -declare const ModernWarfare: MW; -declare const ModernWarfare2: MW2; -declare const Warzone2: WZ2; -declare const ModernWarfare3: MW3; -declare const WarzoneMobile: WZM; -declare const ColdWar: CW; -declare const Vanguard: VG; -declare const Store: SHOP; -declare const Me: USER; -declare const Misc: ALT; -export { login, telescopeLogin, platforms, friendActions, Warzone, ModernWarfare, ModernWarfare2, ModernWarfare3, WarzoneMobile, Warzone2, ColdWar, Vanguard, Store, Me, Misc, enableDebugMode, disableDebugMode, }; diff --git a/node_modules/call-of-duty-api/dist/index.js b/node_modules/call-of-duty-api/dist/index.js deleted file mode 100644 index 6c56463..0000000 --- a/node_modules/call-of-duty-api/dist/index.js +++ /dev/null @@ -1,766 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.disableDebugMode = exports.enableDebugMode = exports.Misc = exports.Me = exports.Store = exports.Vanguard = exports.ColdWar = exports.Warzone2 = exports.WarzoneMobile = exports.ModernWarfare3 = exports.ModernWarfare2 = exports.ModernWarfare = exports.Warzone = exports.friendActions = exports.platforms = exports.telescopeLogin = exports.login = void 0; -const tslib_1 = require("tslib"); -const undici_1 = require("undici"); -const weapon_ids_json_1 = tslib_1.__importDefault(require("./wz-data/weapon-ids.json")); -const game_modes_json_1 = tslib_1.__importDefault(require("./wz-data/game-modes.json")); -const userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; -let baseCookie = "new_SiteId=cod;ACT_SSO_LOCALE=en_US;country=US;"; -let baseSsoToken = ""; -let debugMode = false; -let baseHeaders = { - "content-type": "application/json", - cookie: baseCookie, - "user-agent": userAgent, -}; -let baseTelescopeHeaders = { - accept: "application/json, text/plain, */*", - "accept-language": "en-GB,en;q=0.9,en-US;q=0.8,fr;q=0.7,nl;q=0.6,et;q=0.5", - "cache-control": "no-cache", - pragma: "no-cache", - "sec-ch-ua": '"Chromium";v="118", "Microsoft Edge";v="118", "Not=A?Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "same-site", -}; -let basePostHeaders = { - "content-type": "text/plain", - cookie: baseCookie, - "user-agent": userAgent, -}; -let baseUrl = "https://my.callofduty.com"; -let apiPath = "/api/papi-client"; -let baseTelescopeUrl = "https://telescope.callofduty.com"; -let apiTelescopePath = "/api/ts-api"; -let loggedIn = false; -var platforms; -(function (platforms) { - platforms["All"] = "all"; - platforms["Activision"] = "acti"; - platforms["Battlenet"] = "battle"; - platforms["PSN"] = "psn"; - platforms["Steam"] = "steam"; - platforms["Uno"] = "uno"; - platforms["XBOX"] = "xbl"; - platforms["ios"] = "ios"; - platforms["NULL"] = "_"; -})(platforms || (platforms = {})); -exports.platforms = platforms; -var games; -(function (games) { - games["ModernWarfare"] = "mw"; - games["ModernWarfare2"] = "mw2"; - games["Vanguard"] = "vg"; - games["ColdWar"] = "cw"; - games["NULL"] = "_"; -})(games || (games = {})); -var telescopeGames; -(function (telescopeGames) { - telescopeGames["ModernWarfare2"] = "mw2"; - telescopeGames["Warzone2"] = "wz2"; - telescopeGames["ModernWarfare3"] = "jup"; - telescopeGames["Mobile"] = "mgl"; -})(telescopeGames || (telescopeGames = {})); -var modes; -(function (modes) { - modes["Multiplayer"] = "mp"; - modes["Warzone"] = "wz"; - modes["Warzone2"] = "wz2"; - modes["NULL"] = "_"; -})(modes || (modes = {})); -var telescopeModes; -(function (telescopeModes) { - telescopeModes["Multiplayer"] = "mp"; - telescopeModes["Outbreak"] = "ob"; -})(telescopeModes || (telescopeModes = {})); -var friendActions; -(function (friendActions) { - friendActions["Invite"] = "invite"; - friendActions["Uninvite"] = "uninvite"; - friendActions["Remove"] = "remove"; - friendActions["Block"] = "block"; - friendActions["Unblock"] = "unblock"; -})(friendActions || (friendActions = {})); -exports.friendActions = friendActions; -var generics; -(function (generics) { - generics["STEAM_UNSUPPORTED"] = "Steam platform not supported by this game. Try `battle` instead."; - generics["UNO_NO_NUMERICAL_ID"] = "You must use a numerical ID when using the platform 'uno'.\nIf using an Activision ID, please use the platform 'acti'."; -})(generics || (generics = {})); -let telescopeUnoToken = ""; -const enableDebugMode = () => (debugMode = true); -exports.enableDebugMode = enableDebugMode; -const disableDebugMode = () => (debugMode = false); -exports.disableDebugMode = disableDebugMode; -const sendTelescopeRequest = (url) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { - try { - if (!loggedIn) - throw new Error("Not Logged In!"); - let requestUrl = `${baseTelescopeUrl}${apiTelescopePath}${url}`; - if (debugMode) - console.log(`[DEBUG]`, `Request Uri: ${requestUrl}`); - baseTelescopeHeaders.authorization = `Bearer ${telescopeUnoToken}`; - const { body, statusCode } = yield (0, undici_1.request)(requestUrl, { - headers: baseTelescopeHeaders, - }); - if (statusCode >= 500) - throw new Error(`Received status code: '${statusCode}'. Route may be down or not exist.`); - let response = yield body.json(); - return response; - } - catch (exception) { - throw exception; - } -}); -const sendRequest = (url) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { - try { - if (!loggedIn) - throw new Error("Not Logged In."); - let requestUrl = `${baseUrl}${apiPath}${url}`; - if (debugMode) - console.log(`[DEBUG]`, `Request Uri: ${requestUrl}`); - if (debugMode) - console.time("Round Trip"); - const { body, statusCode } = yield (0, undici_1.request)(requestUrl, { - headers: baseHeaders, - }); - if (debugMode) - console.timeEnd("Round Trip"); - if (statusCode >= 500) - throw new Error(`Received status code: '${statusCode}'. Route may be down or not exist.`); - let response = yield body.json(); - if (debugMode) - console.log(`[DEBUG]`, `Body Size: ${JSON.stringify(response).length} bytes.`); - return response; - } - catch (exception) { - throw exception; - } -}); -const sendPostRequest = (url, data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { - try { - if (!loggedIn) - throw new Error("Not Logged In."); - let requestUrl = `${baseUrl}${apiPath}${url}`; - const { body, statusCode } = yield (0, undici_1.request)(requestUrl, { - method: "POST", - headers: basePostHeaders, - body: data, - }); - if (statusCode >= 500) - throw new Error(`Received status code: '${statusCode}'. Route may be down or not exist.`); - let response = yield body.json(); - return response; - } - catch (exception) { - throw exception; - } -}); -const cleanClientName = (gamertag) => { - return encodeURIComponent(gamertag); -}; -const login = (ssoToken) => { - if (!ssoToken || ssoToken.trim().length <= 0) - return false; - let fakeXSRF = "68e8b62e-1d9d-4ce1-b93f-cbe5ff31a041"; - baseHeaders["X-XSRF-TOKEN"] = fakeXSRF; - baseHeaders["X-CSRF-TOKEN"] = fakeXSRF; - baseHeaders["Atvi-Auth"] = ssoToken; - baseHeaders["ACT_SSO_COOKIE"] = ssoToken; - baseHeaders["atkn"] = ssoToken; - baseHeaders["cookie"] = `${baseCookie}ACT_SSO_COOKIE=${ssoToken};XSRF-TOKEN=${fakeXSRF};API_CSRF_TOKEN=${fakeXSRF};ACT_SSO_EVENT="LOGIN_SUCCESS:1644346543228";ACT_SSO_COOKIE_EXPIRY=1645556143194;comid=cod;ssoDevId=63025d09c69f47dfa2b8d5520b5b73e4;tfa_enrollment_seen=true;gtm.custom.bot.flag=human;`; - baseSsoToken = ssoToken; - basePostHeaders["X-XSRF-TOKEN"] = fakeXSRF; - basePostHeaders["X-CSRF-TOKEN"] = fakeXSRF; - basePostHeaders["Atvi-Auth"] = ssoToken; - basePostHeaders["ACT_SSO_COOKIE"] = ssoToken; - basePostHeaders["atkn"] = ssoToken; - basePostHeaders["cookie"] = `${baseCookie}ACT_SSO_COOKIE=${ssoToken};XSRF-TOKEN=${fakeXSRF};API_CSRF_TOKEN=${fakeXSRF};ACT_SSO_EVENT="LOGIN_SUCCESS:1644346543228";ACT_SSO_COOKIE_EXPIRY=1645556143194;comid=cod;ssoDevId=63025d09c69f47dfa2b8d5520b5b73e4;tfa_enrollment_seen=true;gtm.custom.bot.flag=human;`; - loggedIn = true; - return loggedIn; -}; -exports.login = login; -const telescope_login_endpoint = "https://wzm-ios-loginservice.prod.demonware.net/v1/login/uno/?titleID=7100&client=shg-cod-jup-bnet"; -const telescopeLogin = (username, password) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { - if (!username || !password) - return false; - const { body, statusCode } = yield (0, undici_1.request)(telescope_login_endpoint, { - method: "POST", - headers: baseHeaders, - body: JSON.stringify({ - platform: "ios", - hardwareType: "ios", - auth: { - email: username, - password: password, - }, - version: 1492, - }), - }); - if (statusCode === 200) { - let response = (yield body.json()); - let unoToken = response.umbrella.accessToken; - telescopeUnoToken = unoToken; - } - else if (statusCode === 403) { - let errorResponse = (yield body.json()); - console.error("Error Logging In:", errorResponse.error.msg); - } - loggedIn = statusCode == 200; - return loggedIn; -}); -exports.telescopeLogin = telescopeLogin; -const handleLookupType = (platform) => { - return platform === platforms.Uno ? "id" : "gamer"; -}; -const checkForValidPlatform = (platform, gamertag) => { - if (!Object.values(platforms).includes(platform)) - throw new Error(`Platform '${platform}' is not valid.\nTry one of the following:\n${JSON.stringify(Object.values(platforms), null, 2)}`); - if (gamertag && isNaN(Number(gamertag)) && platform === platforms.Uno) - throw new Error(generics.UNO_NO_NUMERICAL_ID); -}; -const mapGamertagToPlatform = (gamertag, platform, steamSupport = false) => { - checkForValidPlatform(platform, gamertag); - const lookupType = handleLookupType(platform); - if (!steamSupport && platform === platforms.Steam) - throw new Error(generics.STEAM_UNSUPPORTED); - if (platform == platforms.Battlenet || - platform == platforms.Activision || - platform == platforms.Uno) - if (gamertag && gamertag.length > 0) - gamertag = cleanClientName(gamertag); - if (platform === platforms.Uno || platform === platforms.Activision) - platform = platforms.Uno; - return { gamertag, _platform: platform, lookupType }; -}; -class Endpoints { - constructor(game, gamertag, platform, mode, lookupType) { - this.fullData = () => `/stats/cod/v1/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/profile/type/${this.mode}`; - this.combatHistory = () => `/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/0/end/0/details`; - this.combatHistoryWithDate = (startTime, endTime) => `/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/${startTime}/end/${endTime}/details`; - this.breakdown = () => `/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/0/end/0`; - this.breakdownWithDate = (startTime, endTime) => `/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/${startTime}/end/${endTime}`; - this.matchInfo = (matchId) => `/crm/cod/v2/title/${this.game}/platform/${this.platform}/fullMatch/wz/${matchId}/en`; - this.seasonLoot = () => `/loot/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/status/en`; - this.mapList = () => `/ce/v1/title/${this.game}/platform/${this.platform}/gameType/${this.mode}/communityMapData/availability`; - this.purchasableItems = (gameId) => `/inventory/v1/title/${gameId}/platform/psn/purchasable/public/en`; - this.bundleInformation = (gameId, bundleId) => `/inventory/v1/title/${gameId}/bundle/${bundleId}/en`; - this.battlePassLoot = (season) => `/loot/title/${this.game}/platform/${this.platform}/list/loot_season_${season}/en`; - this.friendFeed = () => `/userfeed/v1/friendFeed/platform/${this.platform}/${this.lookupType}/${this.gamertag}/friendFeedEvents/en`; - this.eventFeed = () => `/userfeed/v1/friendFeed/rendered/en/${baseSsoToken}`; - this.loggedInIdentities = () => `/crm/cod/v2/identities/${baseSsoToken}`; - this.codPoints = () => `/inventory/v1/title/mw/platform/${this.platform}/${this.lookupType}/${this.gamertag}/currency`; - this.connectedAccounts = () => `/crm/cod/v2/accounts/platform/${this.platform}/${this.lookupType}/${this.gamertag}`; - this.settings = () => `/preferences/v1/platform/${this.platform}/${this.lookupType}/${this.gamertag}/list`; - this.friendAction = (action) => `/codfriends/v1/${action}/${this.platform}/${this.lookupType}/${this.gamertag}`; - this.search = () => `/crm/cod/v2/platform/${this.platform}/username/${this.gamertag}/search`; - this.game = game; - this.gamertag = gamertag; - this.platform = platform; - this.lookupType = lookupType; - this.mode = mode; - } -} -class TelescopeEndpoints { - constructor(game, unoId, mode) { - this.lifeTime = () => `/cr/v1/title/${this.game}/lifetime?language=english&unoId=${this.unoId}`; - this.matches = () => `/cr/v1/title/${this.game}/matches?language=english&unoId=${this.unoId}`; - this.match = (matchId) => `/cr/v1/title/${this.game}/match/${matchId}?language=english&unoId=${this.unoId}`; - this.game = game; - this.unoId = unoId; - this.mode = mode; - } -} -class WZ { - constructor() { - this.fullData = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.fullData()); - }); }; - this.combatHistory = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.combatHistory()); - }); }; - this.combatHistoryWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.combatHistoryWithDate(startTime, endTime)); - }); }; - this.breakdown = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.breakdown()); - }); }; - this.breakdownWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.breakdownWithDate(startTime, endTime)); - }); }; - this.matchInfo = (matchId, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Warzone, lookupType); - return yield sendRequest(endpoint.matchInfo(matchId)); - }); }; - this.cleanGameMode = (mode) => tslib_1.__awaiter(this, void 0, void 0, function* () { - //@ts-ignore - const foundMode = game_modes_json_1.default["modes"][mode]; - if (!foundMode) - return mode; - return foundMode; - }); - } -} -class MW { - constructor() { - this.fullData = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.fullData()); - }); }; - this.combatHistory = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistory()); - }); }; - this.combatHistoryWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistoryWithDate(startTime, endTime)); - }); }; - this.breakdown = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdown()); - }); }; - this.breakdownWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdownWithDate(startTime, endTime)); - }); }; - this.matchInfo = (matchId, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.matchInfo(matchId)); - }); }; - this.seasonloot = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.seasonLoot()); - }); }; - this.mapList = (platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.ModernWarfare, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.mapList()); - }); }; - } -} -class MW2 { - constructor() { - this.fullData = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.lifeTime()); - }); - this.matches = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.matches()); - }); - this.matchInfo = (unoId, matchId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.match(matchId)); - }); - } -} -class WZ2 { - constructor() { - this.fullData = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Warzone2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.lifeTime()); - }); - this.matches = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Warzone2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.matches()); - }); - this.matchInfo = (unoId, matchId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Warzone2, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.match(matchId)); - }); - } -} -class MW3 { - constructor() { - this.fullData = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare3, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.lifeTime()); - }); - this.matches = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare3, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.matches()); - }); - this.matchInfo = (unoId, matchId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.ModernWarfare3, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.match(matchId)); - }); - } -} -class WZM { - constructor() { - this.fullData = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Mobile, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.lifeTime()); - }); - this.matches = (unoId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Mobile, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.matches()); - }); - this.matchInfo = (unoId, matchId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - var { gamertag } = mapGamertagToPlatform(unoId, platforms.Uno, true); - const endpoint = new TelescopeEndpoints(telescopeGames.Mobile, gamertag, telescopeModes.Multiplayer); - return yield sendTelescopeRequest(endpoint.match(matchId)); - }); - } -} -class CW { - constructor() { - this.fullData = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.fullData()); - }); }; - this.combatHistory = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistory()); - }); }; - this.combatHistoryWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistoryWithDate(startTime, endTime)); - }); }; - this.breakdown = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdown()); - }); }; - this.breakdownWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdownWithDate(startTime, endTime)); - }); }; - this.seasonloot = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.seasonLoot()); - }); }; - this.mapList = (platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.mapList()); - }); }; - this.matchInfo = (matchId, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.ColdWar, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.matchInfo(matchId)); - }); }; - } -} -class VG { - constructor() { - this.fullData = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.fullData()); - }); }; - this.combatHistory = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistory()); - }); }; - this.combatHistoryWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.combatHistoryWithDate(startTime, endTime)); - }); }; - this.breakdown = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdown()); - }); }; - this.breakdownWithDate = (gamertag, startTime, endTime, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.breakdownWithDate(startTime, endTime)); - }); }; - this.seasonloot = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.seasonLoot()); - }); }; - this.mapList = (platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.mapList()); - }); }; - this.matchInfo = (matchId, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(games.Vanguard, gamertag, platform, modes.Multiplayer, lookupType); - return yield sendRequest(endpoint.matchInfo(matchId)); - }); }; - } -} -class SHOP { - constructor() { - this.purchasableItems = (gameId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - const endpoint = new Endpoints(games.NULL, "", platforms.NULL, modes.NULL, ""); - return yield sendRequest(endpoint.purchasableItems(gameId)); - }); - this.bundleInformation = (title, bundleId) => tslib_1.__awaiter(this, void 0, void 0, function* () { - const endpoint = new Endpoints(games.NULL, "", platforms.NULL, modes.NULL, ""); - return yield sendRequest(endpoint.bundleInformation(title, bundleId)); - }); - this.battlePassLoot = (title, season, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform("", platform)); - const endpoint = new Endpoints(title, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.battlePassLoot(season)); - }); }; - } -} -class USER { - constructor() { - this.friendFeed = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.friendFeed()); - }); }; - this.eventFeed = () => tslib_1.__awaiter(this, void 0, void 0, function* () { - const endpoint = new Endpoints(games.NULL, "", platforms.NULL, modes.NULL, ""); - return yield sendRequest(endpoint.eventFeed()); - }); - this.loggedInIdentities = () => tslib_1.__awaiter(this, void 0, void 0, function* () { - const endpoint = new Endpoints(games.NULL, "", platforms.NULL, modes.NULL, ""); - return yield sendRequest(endpoint.loggedInIdentities()); - }); - this.codPoints = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.codPoints()); - }); }; - this.connectedAccounts = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.connectedAccounts()); - }); }; - this.settings = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.settings()); - }); }; - this.friendAction = (gamertag, platform, action) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendPostRequest(endpoint.friendAction(action), "{}"); - }); }; - } -} -class ALT { - constructor() { - this.search = (gamertag, platform) => { var gamertag, platform, lookupType; return tslib_1.__awaiter(this, void 0, void 0, function* () { - ({ - gamertag, - _platform: platform, - lookupType - } = mapGamertagToPlatform(gamertag, platform, true)); - const endpoint = new Endpoints(games.NULL, gamertag, platform, modes.NULL, lookupType); - return yield sendRequest(endpoint.search()); - }); }; - this.cleanWeapon = (weapon) => tslib_1.__awaiter(this, void 0, void 0, function* () { - //@ts-ignore - const foundWeapon = weapon_ids_json_1.default["All Weapons"][weapon]; - if (!foundWeapon) - return weapon; - return foundWeapon; - }); - } -} -const Warzone = new WZ(); -exports.Warzone = Warzone; -const ModernWarfare = new MW(); -exports.ModernWarfare = ModernWarfare; -const ModernWarfare2 = new MW2(); -exports.ModernWarfare2 = ModernWarfare2; -const Warzone2 = new WZ2(); -exports.Warzone2 = Warzone2; -const ModernWarfare3 = new MW3(); -exports.ModernWarfare3 = ModernWarfare3; -const WarzoneMobile = new WZM(); -exports.WarzoneMobile = WarzoneMobile; -const ColdWar = new CW(); -exports.ColdWar = ColdWar; -const Vanguard = new VG(); -exports.Vanguard = Vanguard; -const Store = new SHOP(); -exports.Store = Store; -const Me = new USER(); -exports.Me = Me; -const Misc = new ALT(); -exports.Misc = Misc; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/call-of-duty-api/dist/index.js.map b/node_modules/call-of-duty-api/dist/index.js.map deleted file mode 100644 index 6e5ad99..0000000 --- a/node_modules/call-of-duty-api/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,mCAAiC;AACjC,wFAAuD;AACvD,wFAAmD;AAEnD,MAAM,SAAS,GACb,qHAAqH,CAAC;AACxH,IAAI,UAAU,GAAW,iDAAiD,CAAC;AAC3E,IAAI,YAAY,GAAW,EAAE,CAAC;AAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;AAYtB,IAAI,WAAW,GAAkB;IAC/B,cAAc,EAAE,kBAAkB;IAClC,MAAM,EAAE,UAAU;IAClB,YAAY,EAAE,SAAS;CACxB,CAAC;AAEF,IAAI,oBAAoB,GAAkB;IACxC,MAAM,EAAE,mCAAmC;IAC3C,iBAAiB,EAAE,uDAAuD;IAC1E,eAAe,EAAE,UAAU;IAC3B,MAAM,EAAE,UAAU;IAClB,WAAW,EACT,oEAAoE;IACtE,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,WAAW;IACjC,gBAAgB,EAAE,OAAO;IACzB,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,EAAE,WAAW;CAC9B,CAAC;AAEF,IAAI,eAAe,GAAkB;IACnC,cAAc,EAAE,YAAY;IAC5B,MAAM,EAAE,UAAU;IAClB,YAAY,EAAE,SAAS;CACxB,CAAC;AAEF,IAAI,OAAO,GAAW,2BAA2B,CAAC;AAClD,IAAI,OAAO,GAAW,kBAAkB,CAAC;AACzC,IAAI,gBAAgB,GAAW,kCAAkC,CAAC;AAClE,IAAI,gBAAgB,GAAW,aAAa,CAAC;AAC7C,IAAI,QAAQ,GAAY,KAAK,CAAC;AAE9B,IAAK,SAUJ;AAVD,WAAK,SAAS;IACZ,wBAAW,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,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;YAClE,IAAI,CAAC,WAAW;gBAAE,OAAO,MAAM,CAAC;YAChC,OAAO,WAAW,CAAC;QACrB,CAAC,CAAA,CAAC;IACJ,CAAC;CAAA;AAED,MAAM,OAAO,GAAG,IAAI,EAAE,EAAE,CAAC;AAiBvB,0BAAO;AAhBT,MAAM,aAAa,GAAG,IAAI,EAAE,EAAE,CAAC;AAiB7B,sCAAa;AAhBf,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AAiB/B,wCAAc;AAhBhB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;AAmBzB,4BAAQ;AAlBV,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AAgB/B,wCAAc;AAfhB,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAgB9B,sCAAa;AAff,MAAM,OAAO,GAAG,IAAI,EAAE,EAAE,CAAC;AAiBvB,0BAAO;AAhBT,MAAM,QAAQ,GAAG,IAAI,EAAE,EAAE,CAAC;AAiBxB,4BAAQ;AAhBV,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;AAiBvB,sBAAK;AAhBP,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;AAiBpB,gBAAE;AAhBJ,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAiBrB,oBAAI"} \ No newline at end of file diff --git a/node_modules/call-of-duty-api/dist/wz-data/game-modes.json b/node_modules/call-of-duty-api/dist/wz-data/game-modes.json deleted file mode 100644 index c113a63..0000000 --- a/node_modules/call-of-duty-api/dist/wz-data/game-modes.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "br_25": "BR Trios", - "br_dmz_38": "Plunder Quads", - "br_71": "BR Solos", - "br_74": "BR Trios", - "br_dmz_76": "Plunder Quads", - "br_77": "BR Scopes & Scatterguns", - "br_dmz_85": "Plunder Duos", - "br_86": "Realism Battle Royale", - "br_87": "BR Solos", - "br_88": "BR Duos", - "br_89": "BR Quads", - "br_dmz_104": "Blood Money", - "brtdm_113": "Warzone Rumble", - "brtdm_rmbl": "Warzone Rumble", - "br_brsolo": "BR Solos", - "br_brduos": "BR Duos", - "br_brtrios": "BR Trios", - "br_brquads": "BR Quads", - "br_br_real": "Realism Battle Royale", - "br_dmz_plnbld": "Plunder Blood Money", - "br_brthquad": "BR 200 Quads", - "br_brduostim_name2": "BR Stimulus Duos", - "br_brtriostim_name2": "BR Stimulus Trios", - "br_dmz_pluntrios": "Plunder Trios", - "br_dmz_plunquad": "Plunder Quads", - "br_jugg_brtriojugr": "Juggernaut Royal Trios", - "br_jugg_brquadjugr": "Juggernaut Royal Quads", - "br_mini_miniroyale": "Mini Royale", - "br_brbbsolo": "BR Buyback Solos", - "br_brbbduo": "BR Buyback Duos", - "br_brbbtrio": "BR Buyback Trios", - "br_brbbquad": "BR Buyback Quads", - "br_miniroyale": "Mini Royale", - "br_kingslayer_kingsltrios": "King Slayer Trios", - "br_truckwar_trwarsquads": "Armored Royale", - "br_dmz_plndtrios": "Plunder Trios", - "br_dmz_plndquad": "Plunder Quads", - "br_zxp_zmbroy": "Zombie Royale", - "br_jugg_jugpmpkn": "Juggourdnaut Royale", - "br_brsolohwn": "BR Solo Survivor", - "br_brduohwn": "BR Duo Die", - "br_brhwntrios": "BR Trick-Or-Trios", - "br_brhwnquad": "BR Monster Quads", - "br_dmz_plndcndy": "Plunder: Candy Collector", - "br_dmz_bldmnytrio": "Blood Money Trios", - "br_dmz_bldmnyquad": "Blood Money Quads", - "br_rebirth_rbrthduos": "Rebirth Duos", - "br_rebirth_rbrthtrios": "Rebirth Trios", - "br_rebirth_rbrthquad": "Rebirth Quads", - "br_mini_rebirth_mini_royale_solo": "Rebirth Mini Royale Solos", - "br_mini_rebirth_mini_royale_duos": "Rebirth Mini Royale Duos", - "br_mini_rebirth_mini_royale_trios": "Rebirth Mini Royale Trios", - "br_mini_rebirth_mini_royale_quads": "Rebirth Mini Royale Quads", - "brtdm_wzrumval2": "Warzone Rumble in the Sheets", - "br_dmz_plndval1": "Love And Plunder", - "br_rebirth_rbrthex": "Resurgence Extreme", - "br_exfiltrios": "Exfiltration Trios", - "br_rbrthduos": "Rebirth Resurgence Duos", - "br_rbrthquad": "Rebirth Resurgence Quads", - "br_brz_brduos": "BR Duos (Containment Protocol Event)", - "br_brz_brtrios": "BR Trios (Containment Protocol Event)", - "br_brz_brquads": "BR Quads (Containment Protocol Event)", - "br_kingslayer_rebirth_king_slayer": "Rebirth King Slayer", - "br_reveal_dov": "Destruction Of Verdansk Part 1", - "br_reveal_2_dov2": "Destruction Of Verdansk Part 2", - "br_brdov_dov2": "Destruction Of Verdansk Part 2 Verdansk '84", - "br_rebirth_resurgence_trios": "Verdansk Resurgence Trios", - "br_bodycount_pwergrb": "Power Grab", - "br_rebirth_resurgence_mini": "Verdansk Resurgence Mini", - "br_plnbld": "Blood Money", - "br_plndtrios": "Plunder Trios", - "br_payload_payload": "Payload", - "br_x2_br_reveal_x2_event/event_title_x2": "Battle of Verdansk", - "br_rumble_lua_menu_mp/clash": "Rebirth Payload", - "br_rumble_clash": "Clash", - "br_dbd_dbd": "Iron Trials '84", - "br_rebirth_rebirth_rex": "Rebirth Extreme", - "br_rebirth_shsnp_name3": "Rebirth Scopes & Scatterguns", - "br_payload_pay_prom": "Payload - Promenade", - "br_gxp_gov": "Ghosts Of Verdansk", - "br_dbd_iron_trials_solos": "Iron Trials Solos", - "br_dbd_iron_trials_duos": "Iron Trials Duos", - "br_dbd_iron_trials_trios": "Iron Trials Trios", - "br_dbd_iron_trials_quads": "Iron Trials Quads", - "br_buy_back_solo": "BR Buy Back Solos", - "br_buy_back_duos": "BR Buy Back Duos", - "br_buy_back_trios": "BR Buy Back Trios", - "br_buy_back_quads": "BR Buy Back Quads", - "br_rebirth_rust_1v1": "Rebirth Resurgence Duos", - "br_vov_op_flash": "Operation: Flashback", - "br_lep_br_lep_event/ltm_gamemode": "Final Hours of Verdansk", - "br_vg_royale_solo": "Vanguard Royale Solos", - "br_vg_royale_duos": "Vanguard Royale Duos", - "br_vg_royale_trios": "Vanguard Royale Trios", - "br_vg_royale_quads": "Vanguard Royale Quads", - "br_br_solo": "BR Solos", - "br_br_duos": "BR Duos", - "br_br_trios": "BR Trios", - "br_br_quads": "BR Quads", - "br_rebirth_vg_res_44": "Vanguard Resurgence", - "br_rebirth_cal_res_royale": "Caldera Resurgence Quads", - "br_dmz_plnduo": "Plunder Duos", - "br_dmz_vg_pln_trios": "Vanguard Plunder Trios", - "br_dmz_vg_pln_quads": "Vanguard Plunder Quads", - "br_rumble_clash_caldera": "Caldera Clash", - "br_dbd_playlist_wz320/rbrthdbd_solos": "Iron Trials Rebirth Solos", - "br_dbd_playlist_wz320/rbrthdbd_duos": "Iron Trials Rebirth Duos", - "br_dbd_playlist_wz320/rbrthdbd_trios": "Iron Trials Rebirth Trios", - "br_dbd_playlist_wz320/rbrthdbd_quads": "Iron Trials Rebirth Quads", - "br_rebirth_calderaresurgence": "Caldera Resurgence", - "br_rebirth_reverse_playlist_wz325/rbrthsolos": "Rebirth Resurgence Solos", - "br_payload_playlist_wz325/rbrthpayload": "Rebirth Payload", - "br_rebirth_cdl_resurgence_rebirth_quads": "CDL Resurgence Rebirth Quads", - "br_dmz_playlist_wz325/rbrthbmo_quads": "Rebirth Blood Money Quads", - "br_playlist_wz325/br_aprl_fool_name4": "Totally Normal BR", - "br_rebirth_playlist_wz325/afd_resurgence": "Totally Normal Rebirth", - "br_dbd_playlist_wz330/cal_iron_solos": "Iron Trials Solos", - "br_dbd_playlist_wz330/cal_iron_duos": "Iron Trials Duos", - "br_dbd_playlist_wz330/cal_iron_trios": "Iron Trials Trios", - "br_dbd_playlist_wz330/cal_iron_quads": "Iron Trials Quads", - "br_mendota_playlist_wz330/op_mon": "Operation Monarch", - "br_respect_playlist_wz335/respect": "Champions of Caldera", - "br_playlist_wz335/rebirthexfilttrios": "Rebirth Exfiltration Trios", - "br_rebirth_cal_res_trios": "Caldera Resurgence Trios", - "br_rebirth_cal_res_quads": "Caldera Resurgence Quads", - "br_rebirth_reverse_playlist_wz340/fortkeep_res_solo": "Fortunes Keep Resurgence Solos", - "br_rebirth_playlist_wz340/fortkeep_res_duos": "Fortunes Keep Resurgence Duos", - "br_rebirth_playlist_wz340/fortkeep_res_trios": "Fortunes Keep Resurgence Trios", - "br_rebirth_playlist_wz340/fortkeep_res_quad": "Fortunes Keep Resurgence Quads", - "br_gold_war_playlist_wz340/gld_pldr": "Golden Plunder", - "br_tdbd_playlist_wz345/cal_titanium_solo": "Titanium Trials Solos", - "br_tdbd_playlist_wz345/cal_titanium_duos": "Titanium Trials Duos", - "br_tdbd_playlist_wz345/cal_titanium_trios": "Titanium Trials Trios", - "br_tdbd_playlist_wz345/cal_titanium_quads": "Titanium Trials Quads", - "br_rebirth_playlist_wz340/fortkeep_extreme": "Fortunes Keep Extreme", - "br_rumble_playlist_wz340/storage_town_clash_title": "Storage Town Clash", - "br_zxp_playlist_wz345/rxp": "Rebirth Of The Dead", - "br_respect_playlist_wz345/respect_solo": "Champion of Caldera Solos", - "br_respect_playlist_wz345/respect_trios": "Champion Of Caldera Trios", - "br_wsow_br_trios": "World Series Of Warzone Battle Royale Trios", - "br_olaride_playlist_wz350/olaride": "Operation: Last Call", - "br_mmp_playlist_wz350/mmp": "Sticks & Stones", - "br_rebirth_cdlr:_fortune's_keep_trios": "CDLR: Fortune's Keep Trios", - "br_mini_minibrsolo": "Mini Royale Solos", - "br_mini_minibrduos": "Mini Royale Duos", - "br_mini_minibrtrios": "Mini Royale Trios", - "br_mini_minibrquads": "Mini Royale Quads", - "br_rebirth_dbd_reverse_playlist_wz355/res_trials_solos": "Rebirth Supreme Solos", - "br_rebirth_dbd_playlist_wz355/res_trials_duos": "Rebirth Supreme Duos", - "br_rebirth_dbd_playlist_wz355/res_trials_trios": "Rebirth Supreme Trios", - "br_rebirth_dbd_playlist_wz355/res_trials_quads": "Rebirth Supreme Quads" -} diff --git a/node_modules/call-of-duty-api/dist/wz-data/weapon-ids.json b/node_modules/call-of-duty-api/dist/wz-data/weapon-ids.json deleted file mode 100644 index affb910..0000000 --- a/node_modules/call-of-duty-api/dist/wz-data/weapon-ids.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "_MODERN WARFARE WEAPONS_": "iw8_", - "iw8_pi_golf21": "Pistol_X16", - "iw8_pi_papa320": "Pistol_M19", - "iw8_pi_decho": "Pistol_.50 GS", - "iw8_pi_mike1911": "Pistol_1911", - "iw8_pi_cpapa": "Pistol_.357 Magnum", - "iw8_pi_mike9": "Pistol_Renetti", - "iw8_pi_mike": "Pistol_Sykov", - "iw8_sm_mpapa5": "SMG_MP5", - "iw8_sm_beta": "SMG_PP19 Bizon", - "iw8_sm_augolf": "SMG_AUG", - "iw8_sm_papa90": "SMG_P90", - "iw8_sm_mpapa7": "SMG_MP7", - "iw8_sm_uzulu": "SMG_UZI", - "iw8_sm_charlie9": "SMG_CX-9", - "iw8_sm_smgolf45": "SMG_Striker 45", - "iw8_sm_victor": "SMG_Fennec", - "iw8_sm_secho": "SMG_ISO", - "iw8_me_riotshield": "Special_Riot Shield", - "iw8_knife": "Special_Knife", - "iw8_me_akimboblades": "Special_Dual Kodachis", - "iw8_me_akimboblunt": "Special_Kali Sticks", - "iw8_fists": "Special_Fists", - "iw8_knifestab": "Special_Combat Knife", - "iw8_fists_mp_zmb": "Special_Fists", - "iw8_ar_mike4": "AR_M4A1", - "iw8_ar_akilo47": "AR_AK-47", - "iw8_ar_asierra12": "AR_Oden", - "iw8_ar_falpha": "AR_FR 5.56", - "iw8_ar_mcharlie": "AR_M13", - "iw8_ar_kilo433": "AR_Kilo 141", - "iw8_ar_falima": "AR_FAL", - "iw8_ar_scharlie": "AR_FN Scar 17", - "iw8_ar_tango21": "AR_RAM-7", - "iw8_ar_sierra552": "AR_Grau 5.56", - "iw8_ar_galima": "AR_CR-56 AMAX", - "iw8_ar_anovember94": "AR_AN-94", - "iw8_ar_valpha": "AR_AS VAL", - "iw8_la_rpapa7": "Launcher_RPG-7", - "iw8_la_gromeo": "Launcher_PILA", - "iw8_la_juliet": "Launcher_JOKR", - "iw8_la_kgolf": "Launcher_Strela-P", - "iw8_la_mike32": "Launcher_MGL-32 Grenade Launcher", - "iw8_sn_mike14": "Marksman_EBR-14", - "iw8_sn_kilo98": "Marksman_Kar98k", - "iw8_sn_sbeta": "Marksman_MK2 Carbine", - "iw8_sn_golf28": "Marksman_SP-R 208", - "iw8_sn_crossbow": "Marksman_Crossbow", - "iw8_sn_sksierra": "Marksman_SKS", - "iw8_sn_romeo700": "Sniper_SP-R 208", - "iw8_sn_alpha50": "Sniper_AX-50", - "iw8_sn_delta": "Sniper_Dragunov", - "iw8_sn_hdromeo": "Sniper_HDR", - "iw8_sn_xmike109": "Sniper_Rytec AMR", - "iw8_sh_dpapa12": "Shotgun_R9-0", - "iw8_sh_oscar12": "Shotgun_Origin 12", - "iw8_sh_charlie725": "Shotgun_725", - "iw8_sh_romeo870": "Shotgun_Model 680", - "iw8_sh_mike26": "Shotgun_VLK Rogue", - "iw8_sh_aalpha12": "Shotgun_JAK-12", - "iw8_lm_kilo121": "LMG_M91", - "iw8_lm_pkilo": "LMG_PKM", - "iw8_lm_lima86": "LMG_SA87", - "iw8_lm_mgolf34": "LMG_MG34", - "iw8_lm_mgolf36": "LMG_Holger-26", - "iw8_lm_mkilo3": "LMG_Bruen Mk9", - "iw8_lm_sierrax": "LMG_FiNN LMG", - "iw8_lm_dblmg": "LMG_Minigun", - "iw8_lm_slima": "LMG_RAAL MG", - "_COLD WAR WEAPONS_": "iw8_t9", - "iw8_sn_t9quickscope": "Sniper_Pelington 703", - "iw8_sn_t9standard": "Sniper_LW3 - Tundra", - "iw8_sn_t9powersemi": "Sniper_M82", - "iw8_sn_t9damagesemi": "Sniper_Type 63", - "iw8_sn_t9precisionsemi": "Sniper_DMR 14", - "iw8_sn_t9cannon": "Sniper_ZRG 20mm", - "iw8_sn_t9crossbow": "Sniper_Crossbow", - "iw8_sn_t9accurate": "Sniper_Swiss K31", - "iw8_sn_t9explosivebow": "Sniper_Explosive Tip Crossbow", - "iw8_pi_t9burst": "Pistol_Diamatti", - "iw8_pi_t9revolver": "Pistol_Magnum", - "iw8_pi_t9semiauto": "Pistol_1911", - "iw8_pi_t9fullauto": "Pistol_AMP63", - "iw8_sm_t9standard": "SMG_MP5", - "iw8_sm_t9handling": "SMG_Milano 821", - "iw8_sm_t9heavy": "SMG_AK-74u", - "iw8_sm_t9fastfire": "SMG_MAC-10", - "iw8_sm_t9burst": "SMG_KSP 45", - "iw8_sm_t9capacity": "SMG_Bullfrog", - "iw8_sm_t9powerburst": "SMG_AUG", - "iw8_sm_t9accurate": "SMG_LC10", - "iw8_sm_t9spray": "SMG_PPsh-41", - "iw8_sm_t9nailgun": "SMG_Nailgun", - "iw8_ar_t9standard": "AR_XM4", - "iw8_ar_t9damage": "AR_AK-47", - "iw8_ar_t9accurate": "AR_Krig 6", - "iw8_ar_t9mobility": "AR_QBZ-83", - "iw8_ar_t9longburst": "AR_M16", - "iw8_ar_t9fasthandling": "AR_Groza", - "iw8_ar_t9fastfire": "AR_FFAR", - "iw8_ar_t9slowhandling": "AR_Fara 83", - "iw8_ar_t9slowfire": "AR_C58", - "iw8_ar_t9soviet": "AR_Vargo-S", - "iw8_sh_t9pump": "Shotgun_Hauer 77", - "iw8_sh_t9semiauto": "Shotgun_Gallo SA12", - "iw8_sh_t9fullauto": "Shotgun_Streetsweeper", - "iw8_lm_t9accurate": "LMG_Stoner 63", - "iw8_lm_t9slowfire": "LMG_M60", - "iw8_lm_t9light": "LMG_RPD", - "iw8_lm_t9fastfire": "LMG_Ameli", - "iw8_la_t9standard": "Launcher_Cigma 2", - "iw8_la_t9freefire": "Launcher_RPG-7", - "iw8_la_t9launcher": "Launcher_M79", - "iw8_me_t9sledgehammer": "Special_Sledgehammer", - "iw8_me_t9wakizashi": "Special_Wakizashi", - "iw8_me_t9loadout": "Special_Knife", - "iw8_me_t9machete": "Special_Machete", - "iw8_me_t9etool": "Special_Shovel", - "iw8_me_t9ballisticknife": "Special_Ballistic Knife", - "iw8_me_t9bat": "Special_Baseball Bat", - "_VANGUARD WEAPONS_": "s4_", - "s4_mr_moscar": "Sniper_3-Line Rifle", - "s4_mr_kalpha98": "Sniper_Kar98k", - "s4_mr_aromeo99": "Sniper_Type 99", - "s4_mr_ptango41": "Sniper_Gorenko Anti-Tank Rifle", - "s4_pi_malpha96": "Pistol_Machine Pistol", - "s4_pi_ttango33": "Pistol_RATT", - "s4_pi_mike1911": "Pistol_1911", - "s4_pi_wecho": "Pistol_Top Break", - "s4_pi_luniform08": "Pistol_Klauser", - "s4_sm_thotel": "SMG_M1928", - "s4_sm_stango5": "SMG_Sten", - "s4_sm_mpapa40": "SMG_Mp-40", - "s4_sm_ppapa41": "SMG_PPsh-41", - "s4_sm_owhiskey": "SMG_Owen Gun", - "s4_sm_tyankee100": "SMG_Type 100", - "s4_sm_wecho43": "SMG_Welgun", - "s4_sm_fromeo57": "SMG_Marco 5", - "s4_sm_guniform45": "SMG_H4 Blixen", - "s4_sm_aromeo43": "SMG_Armaguerra 43", - "s4_sm_salpha26": "SMG_RA 225", - "s4_ar_stango44": "AR_STG-44", - "s4_ar_bromeopg": "AR_ITRA Burst", - "s4_ar_balpha": "AR_BAR", - "s4_ar_chotel41": "AR_NZ-41", - "s4_ar_voscar": "AR_Volkssturmgewehr", - "s4_ar_asierra44": "AR_AS-44", - "s4_ar_fecho": "AR_Automaton", - "s4_ar_hyankee44": "AR_Cooper Carbine", - "s4_ar_kgolf40": "AR_KG M40", - "s4_ar_promeo45": "AR_Nikita AVT", - "s4_ar_emike1": "AR_EX1", - "s4_sh_becho": "Shotgun_Einhorn Revolving", - "s4_sh_bromeo5": "Shotgun_Gracey Auto", - "s4_sh_mike97": "Shotgun_Combat Shotgun", - "s4_sh_lindia98": "Shotgun_Double Barrel", - "s4_mg_mgolf42": "LMG_MG42", - "s4_mg_dpapa27": "LMG_DP27", - "s4_mg_bromeo37": "LMG_Bren", - "s4_mg_tyankee11": "LMG_Type11", - "s4_mg_malpha7": "LMG_Whitley", - "s4_mg_aalpha52": "LMG_UGM-8", - "s4_la_m1bravo": "Launcher_M1 Bazooka", - "s4_la_palpha": "Launcher_Panzerschreck", - "s4_la_palpha42": "Launcher_Panzerfaust", - "s4_la_mkilo1": "Launcher_Mk11 Launcher", - "s4_me_rindigo": "Melee_Combat Shield", - "s4_me_knife": "Melee_FS Fighting Knife", - "s4_me_leiomano": "Melee_Sawtooth", - "s4_me_katana": "Melee_Katanah", - "s4_me_axe": "Melee_Skål Crusher", - "s4_me_sledgehammer": "Melee_Sledgehammer", - "s4_mr_m1golf": "Marksman_M1 Grand", - "s4_mr_svictor40": "Marksman_SVT-40", - "s4_mr_gecho43": "Marksman_G-43", - "s4_mr_kalpha98": "Marksman_M1916", - "_Modern Warfare 2_": "iw9_", - "iw9_ar_mike4_mp": "AR_M4", - "iw9_ar_golf3_mp": "AR_Lachman-545", - "iw9_ar_mike4": "AR_M4 Variant", - "iw9_ar_kilo53_mp": "AR_Lachman-556", - "iw9_ar_schotel_mp": "AR_TAQ-V", - "iw9_ar_akilo74": "AR_Kastov-74U", - "iw9_ar_augolf": "AR_STB 556", - "iw9_ar_akilo": "AR_Kastov 762", - "iw9_ar_mike16": "AR_M16", - "iw9_ar_scharlie": "AR_TAQ-56", - "iw9_ar_scharlie_mp": "AR_TAQ-56", - "iw9_ar_akilo105": "AR_Kastov 545", - "iw9_sm_mpapa7_mp": "SMG_Vel 46", - "iw9_sm_victor_mp": "SMG_Fennec 45", - "iw9_sm_aviktor_mp": "SMG_Vaznev-9K", - "iw9_sm_alpha57_mp": "SMG_FSS Hurricane", - "iw9_sm_papa90_mp": "SMG_SMG_PDSW 528", - "iw9_sm_beta_mp": "SMG_Minibak", - "iw9_sm_apapa_mp": "SMG_MX9", - "iw9_sm_mpapa5_mp": "SMG_Lachmann 764", - "iw9_sh_mike1014": "Shotgun_Expedite 12", - "iw9_sh_charlie725_mp": "Shotgun_Lockwood 300", - "iw9_sh_mbravo_mp": "Shotgun_Bryson 800", - "iw9_sh_mviktor_mp": "Shotgun_Bryson 890", - "iw9_sn_mromeo": "Sniper_MCPR-300", - "iw9_sn_limax": "Sniper_Signal 50", - "iw9_sn_xmike2010": "Sniper_SP-X 80", - "iw9_dm_sbeta_mp": "Sniper_Lockwood MK2", - "iw9_dm_mike24_mp": "Sniper_SP-R 208", - "iw9_pi_papa220_mp": "Pistol_P890", - "iw9_pi_golf18": "Pistol_X13", - "iw9_pi_decho_mp": "Pistol_.50 GS", - "iw9_pi_golf17_mp": "Pistol_X12", - "iw9_pi_swhiskey_mp": "Pistol_Basilisk", - "iw9_me_climbfists": "Melee_Fists", - "iw9_me_riotshield_mp": "Melee_Riot Shield", - "throwingknife_mp": "Melee_Throwing Knife", - "iw9_la_juliet_mp": "Launcher_JOKR", - "iw9_la_gromeo_mp": "Launcher_PILA", - "iw9_la_rpapa7_mp": "Launcher_RPG-7", - "iw9_la_kgolf_mp": "Launcher_Strella-P", - "iw9_lm_rkilo_mp": "LMG_RPK", - "iw9_lm_rkilo": "LMG_RPK", - "iw9_lm_ahotel_mp": "LMG_HCR 56", - "iw9_lm_slima_mp": "LMG_RAAL MG", - "iw9_lm_slima": "LMG_RAAL MG", - "iw9_lm_ngolf7_mp": "LMG_SAKIN MG38", - "iw9_lm_rkilo21_mp": "LMG_Rapp H", - "iw9_lm_foxtrot": "LMG_556 Icarus", - "iw9_br_msecho_mp": "BR_FTac Recon", - "iw9_br_msecho": "BR_FTac Recon", - "iw9_br_soscar14": "BR_SO-14", - "iw9_dm_pgolf1_mp": "DMR_LM-S", - "iw9_dm_la700": "DMR_LA-B 330", - "iw9_dm_sa700": "DMR_SA-B 50", - "iw9_dm_scromeo": "DMR_TAQ-M", - "iw9_dm_mike14": "DMR_ERB-14" -} diff --git a/node_modules/call-of-duty-api/package.json b/node_modules/call-of-duty-api/package.json deleted file mode 100644 index 4bc5bb2..0000000 --- a/node_modules/call-of-duty-api/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "call-of-duty-api", - "version": "4.1.0", - "description": "NodeJS Wrapper for the Call Of Duty API.", - "main": "dist/index", - "types": "dist/index", - "files": [ - "dist" - ], - "scripts": { - "prebuild": "rimraf dist", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Lierrmm/Node-CallOfDuty.git" - }, - "keywords": [ - "br", - "warzone", - "call-of-duty", - "call of duty", - "modern warfare", - "black ops", - "iw", - "battle royale", - "Cold War", - "cw", - "3arc", - "vanguard", - "Treyarch", - "Infinity Ward", - "Sledgehammer", - "Raven", - "Modern Warfare 2", - "Modern Warfare 3", - "Warzone 2", - "Blue Moon", - "Beenox", - "Warzone Mobile", - "WZM" - ], - "bugs": { - "url": "https://github.com/Lierrmm/Node-CallOfDuty/issues" - }, - "homepage": "https://codapi.dev", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Lierrmm" - }, - "author": "Liam Gaskell", - "license": "MIT", - "devDependencies": { - "@types/node": "^18.11.4", - "rimraf": "^3.0.2", - "typescript": "^4.8.4" - }, - "dependencies": { - "tslib": "^2.4.0", - "undici": "^5.12.0" - } -} diff --git a/node_modules/chalk/index.d.ts b/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f3..0000000 --- a/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/node_modules/chalk/node_modules/ansi-styles/index.d.ts b/node_modules/chalk/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e..0000000 --- a/node_modules/chalk/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/chalk/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581..0000000 --- a/node_modules/chalk/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index 7539328..0000000 --- a/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/chalk/node_modules/has-flag/index.d.ts b/node_modules/chalk/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c8..0000000 --- a/node_modules/chalk/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/node_modules/chalk/node_modules/has-flag/index.js b/node_modules/chalk/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1..0000000 --- a/node_modules/chalk/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/node_modules/chalk/node_modules/has-flag/package.json b/node_modules/chalk/node_modules/has-flag/package.json deleted file mode 100644 index a9cba4b..0000000 --- a/node_modules/chalk/node_modules/has-flag/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "has-flag", - "version": "4.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/chalk/node_modules/supports-color/browser.js b/node_modules/chalk/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a..0000000 --- a/node_modules/chalk/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/chalk/node_modules/supports-color/index.js deleted file mode 100644 index 6fada39..0000000 --- a/node_modules/chalk/node_modules/supports-color/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; diff --git a/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/chalk/node_modules/supports-color/package.json deleted file mode 100644 index f7182ed..0000000 --- a/node_modules/chalk/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "7.2.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "browser": "browser.js" -} diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json deleted file mode 100644 index 47c23f2..0000000 --- a/node_modules/chalk/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "chalk", - "version": "4.1.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "source", - "index.d.ts" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} diff --git a/node_modules/chalk/source/index.js b/node_modules/chalk/source/index.js deleted file mode 100644 index 75ec663..0000000 --- a/node_modules/chalk/source/index.js +++ /dev/null @@ -1,229 +0,0 @@ -'use strict'; -const ansiStyles = require('ansi-styles'); -const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color'); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = require('./util'); - -const {isArray} = Array; - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; - -const styles = Object.create(null); - -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } - - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; - -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } -} - -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; - - chalk.template.Instance = ChalkClass; - - return chalk.template; -}; - -function Chalk(options) { - return chalkFactory(options); -} - -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; -} - -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; - } -}; - -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; - -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} - -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } -}); - -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - - return { - open, - close, - openAll, - closeAll, - parent - }; -}; - -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; - - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); - - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; - - return builder; -}; - -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } - - let styler = self._styler; - - if (styler === undefined) { - return string; - } - - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); - - styler = styler.parent; - } - } - - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } - - return openAll + string + closeAll; -}; - -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; - - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } - - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } - - if (template === undefined) { - template = require('./templates'); - } - - return template(chalk, parts.join('')); -}; - -Object.defineProperties(Chalk.prototype, styles); - -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; - -module.exports = chalk; diff --git a/node_modules/chalk/source/templates.js b/node_modules/chalk/source/templates.js deleted file mode 100644 index b130949..0000000 --- a/node_modules/chalk/source/templates.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); - -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; - - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } - - return ESCAPES.get(c) || c; -} - -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - - return results; -} - -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - - const results = []; - let matches; - - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } - - return results; -} - -function buildStyle(chalk, styles) { - const enabled = {}; - - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } - - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } - - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } - - return current; -} - -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; - - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } - - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); - - chunks.push(chunk.join('')); - - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } - - return chunks.join(''); -}; diff --git a/node_modules/chalk/source/util.js b/node_modules/chalk/source/util.js deleted file mode 100644 index ca466fd..0000000 --- a/node_modules/chalk/source/util.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; diff --git a/node_modules/cheerio-select/lib/esm/helpers.d.ts b/node_modules/cheerio-select/lib/esm/helpers.d.ts deleted file mode 100644 index 13dba26..0000000 --- a/node_modules/cheerio-select/lib/esm/helpers.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AnyNode } from "domhandler"; -import type { Selector } from "css-what"; -export declare function getDocumentRoot(node: AnyNode): AnyNode; -export declare function groupSelectors(selectors: Selector[][]): [plain: Selector[][], filtered: Selector[][]]; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/helpers.d.ts.map b/node_modules/cheerio-select/lib/esm/helpers.d.ts.map deleted file mode 100644 index 689bf8d..0000000 --- a/node_modules/cheerio-select/lib/esm/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED,wBAAgB,cAAc,CAC1B,SAAS,EAAE,QAAQ,EAAE,EAAE,GACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAa/C"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/helpers.js b/node_modules/cheerio-select/lib/esm/helpers.js deleted file mode 100644 index 1e5c8d5..0000000 --- a/node_modules/cheerio-select/lib/esm/helpers.js +++ /dev/null @@ -1,20 +0,0 @@ -import { isFilter } from "./positionals.js"; -export function getDocumentRoot(node) { - while (node.parent) - node = node.parent; - return node; -} -export function groupSelectors(selectors) { - const filteredSelectors = []; - const plainSelectors = []; - for (const selector of selectors) { - if (selector.some(isFilter)) { - filteredSelectors.push(selector); - } - else { - plainSelectors.push(selector); - } - } - return [plainSelectors, filteredSelectors]; -} -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/helpers.js.map b/node_modules/cheerio-select/lib/esm/helpers.js.map deleted file mode 100644 index 2ad294d..0000000 --- a/node_modules/cheerio-select/lib/esm/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,MAAM;QAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAC1B,SAAuB;IAEvB,MAAM,iBAAiB,GAAiB,EAAE,CAAC;IAC3C,MAAM,cAAc,GAAiB,EAAE,CAAC;IAExC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAC9B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACzB,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACpC;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACjC;KACJ;IAED,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/index.d.ts b/node_modules/cheerio-select/lib/esm/index.d.ts deleted file mode 100644 index 9b6baff..0000000 --- a/node_modules/cheerio-select/lib/esm/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type Options as CSSSelectOptions } from "css-select"; -import type { Element, AnyNode, Document } from "domhandler"; -export { filters, pseudos, aliases } from "css-select"; -export interface Options extends CSSSelectOptions { - /** Optional reference to the root of the document. If not set, this will be computed when needed. */ - root?: Document; -} -export declare function is(element: Element, selector: string | ((el: Element) => boolean), options?: Options): boolean; -export declare function some(elements: Element[], selector: string | ((el: Element) => boolean), options?: Options): boolean; -export declare function filter(selector: string, elements: AnyNode[], options?: Options): Element[]; -export declare function select(selector: string | ((el: Element) => boolean), root: AnyNode | AnyNode[], options?: Options, limit?: number): Element[]; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/index.d.ts.map b/node_modules/cheerio-select/lib/esm/index.d.ts.map deleted file mode 100644 index 4127f83..0000000 --- a/node_modules/cheerio-select/lib/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,OAAO,IAAI,gBAAgB,EAEnC,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAU7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYvD,MAAM,WAAW,OAAQ,SAAQ,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;IAC/D,qGAAqG;IACrG,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,wBAAgB,EAAE,CACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAET;AAED,wBAAgB,IAAI,CAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAWT;AAsCD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,OAAY,GACtB,OAAO,EAAE,CAEX;AAoGD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,EACzB,OAAO,GAAE,OAAY,EACrB,KAAK,SAAW,GACjB,OAAO,EAAE,CA2BX"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/index.js b/node_modules/cheerio-select/lib/esm/index.js deleted file mode 100644 index ea6c7f0..0000000 --- a/node_modules/cheerio-select/lib/esm/index.js +++ /dev/null @@ -1,241 +0,0 @@ -import { parse, SelectorType, isTraversal } from "css-what"; -import { _compileToken as compileToken, prepareContext, } from "css-select"; -import * as DomUtils from "domutils"; -import * as boolbase from "boolbase"; -import { getDocumentRoot, groupSelectors } from "./helpers.js"; -import { isFilter, getLimit, } from "./positionals.js"; -// Re-export pseudo extension points -export { filters, pseudos, aliases } from "css-select"; -const UNIVERSAL_SELECTOR = { - type: SelectorType.Universal, - namespace: null, -}; -const SCOPE_PSEUDO = { - type: SelectorType.Pseudo, - name: "scope", - data: null, -}; -export function is(element, selector, options = {}) { - return some([element], selector, options); -} -export function some(elements, selector, options = {}) { - if (typeof selector === "function") - return elements.some(selector); - const [plain, filtered] = groupSelectors(parse(selector)); - return ((plain.length > 0 && elements.some(compileToken(plain, options))) || - filtered.some((sel) => filterBySelector(sel, elements, options).length > 0)); -} -function filterByPosition(filter, elems, data, options) { - const num = typeof data === "string" ? parseInt(data, 10) : NaN; - switch (filter) { - case "first": - case "lt": - // Already done in `getLimit` - return elems; - case "last": - return elems.length > 0 ? [elems[elems.length - 1]] : elems; - case "nth": - case "eq": - return isFinite(num) && Math.abs(num) < elems.length - ? [num < 0 ? elems[elems.length + num] : elems[num]] - : []; - case "gt": - return isFinite(num) ? elems.slice(num + 1) : []; - case "even": - return elems.filter((_, i) => i % 2 === 0); - case "odd": - return elems.filter((_, i) => i % 2 === 1); - case "not": { - const filtered = new Set(filterParsed(data, elems, options)); - return elems.filter((e) => !filtered.has(e)); - } - } -} -export function filter(selector, elements, options = {}) { - return filterParsed(parse(selector), elements, options); -} -/** - * Filter a set of elements by a selector. - * - * Will return elements in the original order. - * - * @param selector Selector to filter by. - * @param elements Elements to filter. - * @param options Options for selector. - */ -function filterParsed(selector, elements, options) { - if (elements.length === 0) - return []; - const [plainSelectors, filteredSelectors] = groupSelectors(selector); - let found; - if (plainSelectors.length) { - const filtered = filterElements(elements, plainSelectors, options); - // If there are no filters, just return - if (filteredSelectors.length === 0) { - return filtered; - } - // Otherwise, we have to do some filtering - if (filtered.length) { - found = new Set(filtered); - } - } - for (let i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) { - const filteredSelector = filteredSelectors[i]; - const missing = found - ? elements.filter((e) => DomUtils.isTag(e) && !found.has(e)) - : elements; - if (missing.length === 0) - break; - const filtered = filterBySelector(filteredSelector, elements, options); - if (filtered.length) { - if (!found) { - /* - * If we haven't found anything before the last selector, - * just return what we found now. - */ - if (i === filteredSelectors.length - 1) { - return filtered; - } - found = new Set(filtered); - } - else { - filtered.forEach((el) => found.add(el)); - } - } - } - return typeof found !== "undefined" - ? (found.size === elements.length - ? elements - : // Filter elements to preserve order - elements.filter((el) => found.has(el))) - : []; -} -function filterBySelector(selector, elements, options) { - var _a; - if (selector.some(isTraversal)) { - /* - * Get root node, run selector with the scope - * set to all of our nodes. - */ - const root = (_a = options.root) !== null && _a !== void 0 ? _a : getDocumentRoot(elements[0]); - const opts = { ...options, context: elements, relativeSelector: false }; - selector.push(SCOPE_PSEUDO); - return findFilterElements(root, selector, opts, true, elements.length); - } - // Performance optimization: If we don't have to traverse, just filter set. - return findFilterElements(elements, selector, options, false, elements.length); -} -export function select(selector, root, options = {}, limit = Infinity) { - if (typeof selector === "function") { - return find(root, selector); - } - const [plain, filtered] = groupSelectors(parse(selector)); - const results = filtered.map((sel) => findFilterElements(root, sel, options, true, limit)); - // Plain selectors can be queried in a single go - if (plain.length) { - results.push(findElements(root, plain, options, limit)); - } - if (results.length === 0) { - return []; - } - // If there was only a single selector, just return the result - if (results.length === 1) { - return results[0]; - } - // Sort results, filtering for duplicates - return DomUtils.uniqueSort(results.reduce((a, b) => [...a, ...b])); -} -/** - * - * @param root Element(s) to search from. - * @param selector Selector to look for. - * @param options Options for querying. - * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal. - */ -function findFilterElements(root, selector, options, queryForSelector, totalLimit) { - const filterIndex = selector.findIndex(isFilter); - const sub = selector.slice(0, filterIndex); - const filter = selector[filterIndex]; - // If we are at the end of the selector, we can limit the number of elements to retrieve. - const partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity; - /* - * Set the number of elements to retrieve. - * Eg. for :first, we only have to get a single element. - */ - const limit = getLimit(filter.name, filter.data, partLimit); - if (limit === 0) - return []; - /* - * Skip `findElements` call if our selector starts with a positional - * pseudo. - */ - const elemsNoLimit = sub.length === 0 && !Array.isArray(root) - ? DomUtils.getChildren(root).filter(DomUtils.isTag) - : sub.length === 0 - ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag) - : queryForSelector || sub.some(isTraversal) - ? findElements(root, [sub], options, limit) - : filterElements(root, [sub], options); - const elems = elemsNoLimit.slice(0, limit); - let result = filterByPosition(filter.name, elems, filter.data, options); - if (result.length === 0 || selector.length === filterIndex + 1) { - return result; - } - const remainingSelector = selector.slice(filterIndex + 1); - const remainingHasTraversal = remainingSelector.some(isTraversal); - if (remainingHasTraversal) { - if (isTraversal(remainingSelector[0])) { - const { type } = remainingSelector[0]; - if (type === SelectorType.Sibling || - type === SelectorType.Adjacent) { - // If we have a sibling traversal, we need to also look at the siblings. - result = prepareContext(result, DomUtils, true); - } - // Avoid a traversal-first selector error. - remainingSelector.unshift(UNIVERSAL_SELECTOR); - } - options = { - ...options, - // Avoid absolutizing the selector - relativeSelector: false, - /* - * Add a custom root func, to make sure traversals don't match elements - * that aren't a part of the considered tree. - */ - rootFunc: (el) => result.includes(el), - }; - } - else if (options.rootFunc && options.rootFunc !== boolbase.trueFunc) { - options = { ...options, rootFunc: boolbase.trueFunc }; - } - /* - * If we have another filter, recursively call `findFilterElements`, - * with the `recursive` flag disabled. We only have to look for more - * elements when we see a traversal. - * - * Otherwise, - */ - return remainingSelector.some(isFilter) - ? findFilterElements(result, remainingSelector, options, false, totalLimit) - : remainingHasTraversal - ? // Query existing elements to resolve traversal. - findElements(result, [remainingSelector], options, totalLimit) - : // If we don't have any more traversals, simply filter elements. - filterElements(result, [remainingSelector], options); -} -function findElements(root, sel, options, limit) { - const query = compileToken(sel, options, root); - return find(root, query, limit); -} -function find(root, query, limit = Infinity) { - const elems = prepareContext(root, DomUtils, query.shouldTestNextSiblings); - return DomUtils.find((node) => DomUtils.isTag(node) && query(node), elems, true, limit); -} -function filterElements(elements, sel, options) { - const els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag); - if (els.length === 0) - return els; - const query = compileToken(sel, options); - return query === boolbase.trueFunc ? els : els.filter(query); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/index.js.map b/node_modules/cheerio-select/lib/esm/index.js.map deleted file mode 100644 index ed9f158..0000000 --- a/node_modules/cheerio-select/lib/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAiB,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EACH,aAAa,IAAI,YAAY,EAE7B,cAAc,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEH,QAAQ,EAER,QAAQ,GACX,MAAM,kBAAkB,CAAC;AAE1B,oCAAoC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,kBAAkB,GAAa;IACjC,IAAI,EAAE,YAAY,CAAC,SAAS;IAC5B,SAAS,EAAE,IAAI;CAClB,CAAC;AACF,MAAM,YAAY,GAAa;IAC3B,IAAI,EAAE,YAAY,CAAC,MAAM;IACzB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,IAAI;CACb,CAAC;AAOF,MAAM,UAAU,EAAE,CACd,OAAgB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QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/package.json b/node_modules/cheerio-select/lib/esm/package.json deleted file mode 100644 index 089153b..0000000 --- a/node_modules/cheerio-select/lib/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} diff --git a/node_modules/cheerio-select/lib/esm/positionals.d.ts b/node_modules/cheerio-select/lib/esm/positionals.d.ts deleted file mode 100644 index 5315dd3..0000000 --- a/node_modules/cheerio-select/lib/esm/positionals.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Selector, PseudoSelector } from "css-what"; -export declare type Filter = "first" | "last" | "eq" | "nth" | "gt" | "lt" | "even" | "odd" | "not"; -export declare const filterNames: Set; -export interface CheerioSelector extends PseudoSelector { - name: Filter; - data: string | null; -} -export declare function isFilter(s: Selector): s is CheerioSelector; -export declare function getLimit(filter: Filter, data: string | null, partLimit: number): number; -//# sourceMappingURL=positionals.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/positionals.d.ts.map b/node_modules/cheerio-select/lib/esm/positionals.d.ts.map deleted file mode 100644 index 0e0db37..0000000 --- a/node_modules/cheerio-select/lib/esm/positionals.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"positionals.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,oBAAY,MAAM,GACZ,OAAO,GACP,MAAM,GACN,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,KAAK,GACL,KAAK,CAAC;AACZ,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CASlC,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,IAAI,eAAe,CAS1D;AAED,wBAAgB,QAAQ,CACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,SAAS,EAAE,MAAM,GAClB,MAAM,CAyBR"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/positionals.js b/node_modules/cheerio-select/lib/esm/positionals.js deleted file mode 100644 index 61f5d6e..0000000 --- a/node_modules/cheerio-select/lib/esm/positionals.js +++ /dev/null @@ -1,47 +0,0 @@ -export const filterNames = new Set([ - "first", - "last", - "eq", - "gt", - "nth", - "lt", - "even", - "odd", -]); -export function isFilter(s) { - if (s.type !== "pseudo") - return false; - if (filterNames.has(s.name)) - return true; - if (s.name === "not" && Array.isArray(s.data)) { - // Only consider `:not` with embedded filters - return s.data.some((s) => s.some(isFilter)); - } - return false; -} -export function getLimit(filter, data, partLimit) { - const num = data != null ? parseInt(data, 10) : NaN; - switch (filter) { - case "first": - return 1; - case "nth": - case "eq": - return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0; - case "lt": - return isFinite(num) - ? num >= 0 - ? Math.min(num, partLimit) - : Infinity - : 0; - case "gt": - return isFinite(num) ? Infinity : 0; - case "odd": - return 2 * partLimit; - case "even": - return 2 * partLimit - 1; - case "last": - case "not": - return Infinity; - } -} -//# sourceMappingURL=positionals.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/esm/positionals.js.map b/node_modules/cheerio-select/lib/esm/positionals.js.map deleted file mode 100644 index 0b26c24..0000000 --- a/node_modules/cheerio-select/lib/esm/positionals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"positionals.js","sourceRoot":"https://raw.githubusercontent.com/cheeri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CAAC,GAAG,CAAC;gBAChB,CAAC,CAAC,GAAG,IAAI,CAAC;oBACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;oBAC1B,CAAC,CAAC,QAAQ;gBACd,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,KAAK;YACN,OAAO,CAAC,GAAG,SAAS,CAAC;QACzB,KAAK,MAAM;YACP,OAAO,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACN,OAAO,QAAQ,CAAC;KACvB;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.d.ts b/node_modules/cheerio-select/lib/helpers.d.ts deleted file mode 100644 index 13dba26..0000000 --- a/node_modules/cheerio-select/lib/helpers.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AnyNode } from "domhandler"; -import type { Selector } from "css-what"; -export declare function getDocumentRoot(node: AnyNode): AnyNode; -export declare function groupSelectors(selectors: Selector[][]): [plain: Selector[][], filtered: Selector[][]]; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.d.ts.map b/node_modules/cheerio-select/lib/helpers.d.ts.map deleted file mode 100644 index 689bf8d..0000000 --- a/node_modules/cheerio-select/lib/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED,wBAAgB,cAAc,CAC1B,SAAS,EAAE,QAAQ,EAAE,EAAE,GACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAa/C"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.js b/node_modules/cheerio-select/lib/helpers.js deleted file mode 100644 index f996a6c..0000000 --- a/node_modules/cheerio-select/lib/helpers.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.groupSelectors = exports.getDocumentRoot = void 0; -var positionals_js_1 = require("./positionals.js"); -function getDocumentRoot(node) { - while (node.parent) - node = node.parent; - return node; -} -exports.getDocumentRoot = getDocumentRoot; -function groupSelectors(selectors) { - var filteredSelectors = []; - var plainSelectors = []; - for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) { - var selector = selectors_1[_i]; - if (selector.some(positionals_js_1.isFilter)) { - filteredSelectors.push(selector); - } - else { - plainSelectors.push(selector); - } - } - return [plainSelectors, filteredSelectors]; -} -exports.groupSelectors = groupSelectors; -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.js.map b/node_modules/cheerio-select/lib/helpers.js.map deleted file mode 100644 index 95bf143..0000000 --- a/node_modules/cheerio-select/lib/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":";;;AAEA,mDAA4C;AAE5C,SAAgB,eAAe,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,MAAM;QAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,OAAO,IAAI,CAAC;AAChB,CAAC;AAHD,0CAGC;AAED,SAAgB,cAAc,CAC1B,SAAuB;IAEvB,IAAM,iBAAiB,GAAiB,EAAE,CAAC;IAC3C,IAAM,cAAc,GAAiB,EAAE,CAAC;IAExC,KAAuB,UAAS,EAAT,uBAAS,EAAT,uBAAS,EAAT,IAAS,EAAE;QAA7B,IAAM,QAAQ,kBAAA;QACf,IAAI,QAAQ,CAAC,IAAI,CAAC,yBAAQ,CAAC,EAAE;YACzB,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACpC;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACjC;KACJ;IAED,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAC/C,CAAC;AAfD,wCAeC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.d.ts b/node_modules/cheerio-select/lib/index.d.ts deleted file mode 100644 index 9b6baff..0000000 --- a/node_modules/cheerio-select/lib/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type Options as CSSSelectOptions } from "css-select"; -import type { Element, AnyNode, Document } from "domhandler"; -export { filters, pseudos, aliases } from "css-select"; -export interface Options extends CSSSelectOptions { - /** Optional reference to the root of the document. If not set, this will be computed when needed. */ - root?: Document; -} -export declare function is(element: Element, selector: string | ((el: Element) => boolean), options?: Options): boolean; -export declare function some(elements: Element[], selector: string | ((el: Element) => boolean), options?: Options): boolean; -export declare function filter(selector: string, elements: AnyNode[], options?: Options): Element[]; -export declare function select(selector: string | ((el: Element) => boolean), root: AnyNode | AnyNode[], options?: Options, limit?: number): Element[]; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.d.ts.map b/node_modules/cheerio-select/lib/index.d.ts.map deleted file mode 100644 index 4127f83..0000000 --- a/node_modules/cheerio-select/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,OAAO,IAAI,gBAAgB,EAEnC,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAU7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYvD,MAAM,WAAW,OAAQ,SAAQ,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;IAC/D,qGAAqG;IACrG,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,wBAAgB,EAAE,CACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAET;AAED,wBAAgB,IAAI,CAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAWT;AAsCD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,OAAY,GACtB,OAAO,EAAE,CAEX;AAoGD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,EACzB,OAAO,GAAE,OAAY,EACrB,KAAK,SAAW,GACjB,OAAO,EAAE,CA2BX"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.js b/node_modules/cheerio-select/lib/index.js deleted file mode 100644 index 9366d71..0000000 --- a/node_modules/cheerio-select/lib/index.js +++ /dev/null @@ -1,302 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.select = exports.filter = exports.some = exports.is = exports.aliases = exports.pseudos = exports.filters = void 0; -var css_what_1 = require("css-what"); -var css_select_1 = require("css-select"); -var DomUtils = __importStar(require("domutils")); -var boolbase = __importStar(require("boolbase")); -var helpers_js_1 = require("./helpers.js"); -var positionals_js_1 = require("./positionals.js"); -// Re-export pseudo extension points -var css_select_2 = require("css-select"); -Object.defineProperty(exports, "filters", { enumerable: true, get: function () { return css_select_2.filters; } }); -Object.defineProperty(exports, "pseudos", { enumerable: true, get: function () { return css_select_2.pseudos; } }); -Object.defineProperty(exports, "aliases", { enumerable: true, get: function () { return css_select_2.aliases; } }); -var UNIVERSAL_SELECTOR = { - type: css_what_1.SelectorType.Universal, - namespace: null, -}; -var SCOPE_PSEUDO = { - type: css_what_1.SelectorType.Pseudo, - name: "scope", - data: null, -}; -function is(element, selector, options) { - if (options === void 0) { options = {}; } - return some([element], selector, options); -} -exports.is = is; -function some(elements, selector, options) { - if (options === void 0) { options = {}; } - if (typeof selector === "function") - return elements.some(selector); - var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1]; - return ((plain.length > 0 && elements.some((0, css_select_1._compileToken)(plain, options))) || - filtered.some(function (sel) { return filterBySelector(sel, elements, options).length > 0; })); -} -exports.some = some; -function filterByPosition(filter, elems, data, options) { - var num = typeof data === "string" ? parseInt(data, 10) : NaN; - switch (filter) { - case "first": - case "lt": - // Already done in `getLimit` - return elems; - case "last": - return elems.length > 0 ? [elems[elems.length - 1]] : elems; - case "nth": - case "eq": - return isFinite(num) && Math.abs(num) < elems.length - ? [num < 0 ? elems[elems.length + num] : elems[num]] - : []; - case "gt": - return isFinite(num) ? elems.slice(num + 1) : []; - case "even": - return elems.filter(function (_, i) { return i % 2 === 0; }); - case "odd": - return elems.filter(function (_, i) { return i % 2 === 1; }); - case "not": { - var filtered_1 = new Set(filterParsed(data, elems, options)); - return elems.filter(function (e) { return !filtered_1.has(e); }); - } - } -} -function filter(selector, elements, options) { - if (options === void 0) { options = {}; } - return filterParsed((0, css_what_1.parse)(selector), elements, options); -} -exports.filter = filter; -/** - * Filter a set of elements by a selector. - * - * Will return elements in the original order. - * - * @param selector Selector to filter by. - * @param elements Elements to filter. - * @param options Options for selector. - */ -function filterParsed(selector, elements, options) { - if (elements.length === 0) - return []; - var _a = (0, helpers_js_1.groupSelectors)(selector), plainSelectors = _a[0], filteredSelectors = _a[1]; - var found; - if (plainSelectors.length) { - var filtered = filterElements(elements, plainSelectors, options); - // If there are no filters, just return - if (filteredSelectors.length === 0) { - return filtered; - } - // Otherwise, we have to do some filtering - if (filtered.length) { - found = new Set(filtered); - } - } - for (var i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) { - var filteredSelector = filteredSelectors[i]; - var missing = found - ? elements.filter(function (e) { return DomUtils.isTag(e) && !found.has(e); }) - : elements; - if (missing.length === 0) - break; - var filtered = filterBySelector(filteredSelector, elements, options); - if (filtered.length) { - if (!found) { - /* - * If we haven't found anything before the last selector, - * just return what we found now. - */ - if (i === filteredSelectors.length - 1) { - return filtered; - } - found = new Set(filtered); - } - else { - filtered.forEach(function (el) { return found.add(el); }); - } - } - } - return typeof found !== "undefined" - ? (found.size === elements.length - ? elements - : // Filter elements to preserve order - elements.filter(function (el) { - return found.has(el); - })) - : []; -} -function filterBySelector(selector, elements, options) { - var _a; - if (selector.some(css_what_1.isTraversal)) { - /* - * Get root node, run selector with the scope - * set to all of our nodes. - */ - var root = (_a = options.root) !== null && _a !== void 0 ? _a : (0, helpers_js_1.getDocumentRoot)(elements[0]); - var opts = __assign(__assign({}, options), { context: elements, relativeSelector: false }); - selector.push(SCOPE_PSEUDO); - return findFilterElements(root, selector, opts, true, elements.length); - } - // Performance optimization: If we don't have to traverse, just filter set. - return findFilterElements(elements, selector, options, false, elements.length); -} -function select(selector, root, options, limit) { - if (options === void 0) { options = {}; } - if (limit === void 0) { limit = Infinity; } - if (typeof selector === "function") { - return find(root, selector); - } - var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1]; - var results = filtered.map(function (sel) { - return findFilterElements(root, sel, options, true, limit); - }); - // Plain selectors can be queried in a single go - if (plain.length) { - results.push(findElements(root, plain, options, limit)); - } - if (results.length === 0) { - return []; - } - // If there was only a single selector, just return the result - if (results.length === 1) { - return results[0]; - } - // Sort results, filtering for duplicates - return DomUtils.uniqueSort(results.reduce(function (a, b) { return __spreadArray(__spreadArray([], a, true), b, true); })); -} -exports.select = select; -/** - * - * @param root Element(s) to search from. - * @param selector Selector to look for. - * @param options Options for querying. - * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal. - */ -function findFilterElements(root, selector, options, queryForSelector, totalLimit) { - var filterIndex = selector.findIndex(positionals_js_1.isFilter); - var sub = selector.slice(0, filterIndex); - var filter = selector[filterIndex]; - // If we are at the end of the selector, we can limit the number of elements to retrieve. - var partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity; - /* - * Set the number of elements to retrieve. - * Eg. for :first, we only have to get a single element. - */ - var limit = (0, positionals_js_1.getLimit)(filter.name, filter.data, partLimit); - if (limit === 0) - return []; - /* - * Skip `findElements` call if our selector starts with a positional - * pseudo. - */ - var elemsNoLimit = sub.length === 0 && !Array.isArray(root) - ? DomUtils.getChildren(root).filter(DomUtils.isTag) - : sub.length === 0 - ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag) - : queryForSelector || sub.some(css_what_1.isTraversal) - ? findElements(root, [sub], options, limit) - : filterElements(root, [sub], options); - var elems = elemsNoLimit.slice(0, limit); - var result = filterByPosition(filter.name, elems, filter.data, options); - if (result.length === 0 || selector.length === filterIndex + 1) { - return result; - } - var remainingSelector = selector.slice(filterIndex + 1); - var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal); - if (remainingHasTraversal) { - if ((0, css_what_1.isTraversal)(remainingSelector[0])) { - var type = remainingSelector[0].type; - if (type === css_what_1.SelectorType.Sibling || - type === css_what_1.SelectorType.Adjacent) { - // If we have a sibling traversal, we need to also look at the siblings. - result = (0, css_select_1.prepareContext)(result, DomUtils, true); - } - // Avoid a traversal-first selector error. - remainingSelector.unshift(UNIVERSAL_SELECTOR); - } - options = __assign(__assign({}, options), { - // Avoid absolutizing the selector - relativeSelector: false, - /* - * Add a custom root func, to make sure traversals don't match elements - * that aren't a part of the considered tree. - */ - rootFunc: function (el) { return result.includes(el); } }); - } - else if (options.rootFunc && options.rootFunc !== boolbase.trueFunc) { - options = __assign(__assign({}, options), { rootFunc: boolbase.trueFunc }); - } - /* - * If we have another filter, recursively call `findFilterElements`, - * with the `recursive` flag disabled. We only have to look for more - * elements when we see a traversal. - * - * Otherwise, - */ - return remainingSelector.some(positionals_js_1.isFilter) - ? findFilterElements(result, remainingSelector, options, false, totalLimit) - : remainingHasTraversal - ? // Query existing elements to resolve traversal. - findElements(result, [remainingSelector], options, totalLimit) - : // If we don't have any more traversals, simply filter elements. - filterElements(result, [remainingSelector], options); -} -function findElements(root, sel, options, limit) { - var query = (0, css_select_1._compileToken)(sel, options, root); - return find(root, query, limit); -} -function find(root, query, limit) { - if (limit === void 0) { limit = Infinity; } - var elems = (0, css_select_1.prepareContext)(root, DomUtils, query.shouldTestNextSiblings); - return DomUtils.find(function (node) { return DomUtils.isTag(node) && query(node); }, elems, true, limit); -} -function filterElements(elements, sel, options) { - var els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag); - if (els.length === 0) - return els; - var query = (0, css_select_1._compileToken)(sel, options); - return query === boolbase.trueFunc ? els : els.filter(query); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.js.map b/node_modules/cheerio-select/lib/index.js.map deleted file mode 100644 index 19a157e..0000000 --- a/node_modules/cheerio-select/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA2E;AAC3E,yCAIoB;AACpB,iDAAqC;AACrC,iDAAqC;AAErC,2CAA+D;AAC/D,mDAK0B;AAE1B,oCAAoC;AACpC,yCAAuD;AAA9C,qGAAA,OAAO,OAAA;AAAE,qGAAA,OAAO,OAAA;AAAE,qGAAA,OAAO,OAAA;A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,OAAA,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAnC,CAAmC,EACtD,KAAK,EACL,IAAI,EACJ,KAAK,CACK,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACnB,QAA6B,EAC7B,GAAiB,EACjB,OAAgB;IAEhB,IAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAChE,QAAQ,CAAC,KAAK,CACjB,CAAC;IAEF,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAEjC,IAAM,KAAK,GAAG,IAAA,0BAAY,EAAmB,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,KAAK,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.d.ts b/node_modules/cheerio-select/lib/positionals.d.ts deleted file mode 100644 index 5315dd3..0000000 --- a/node_modules/cheerio-select/lib/positionals.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Selector, PseudoSelector } from "css-what"; -export declare type Filter = "first" | "last" | "eq" | "nth" | "gt" | "lt" | "even" | "odd" | "not"; -export declare const filterNames: Set; -export interface CheerioSelector extends PseudoSelector { - name: Filter; - data: string | null; -} -export declare function isFilter(s: Selector): s is CheerioSelector; -export declare function getLimit(filter: Filter, data: string | null, partLimit: number): number; -//# sourceMappingURL=positionals.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.d.ts.map b/node_modules/cheerio-select/lib/positionals.d.ts.map deleted file mode 100644 index 0e0db37..0000000 --- a/node_modules/cheerio-select/lib/positionals.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"positionals.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,oBAAY,MAAM,GACZ,OAAO,GACP,MAAM,GACN,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,KAAK,GACL,KAAK,CAAC;AACZ,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CASlC,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,IAAI,eAAe,CAS1D;AAED,wBAAgB,QAAQ,CACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,SAAS,EAAE,MAAM,GAClB,MAAM,CAyBR"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.js b/node_modules/cheerio-select/lib/positionals.js deleted file mode 100644 index 754bb25..0000000 --- a/node_modules/cheerio-select/lib/positionals.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getLimit = exports.isFilter = exports.filterNames = void 0; -exports.filterNames = new Set([ - "first", - "last", - "eq", - "gt", - "nth", - "lt", - "even", - "odd", -]); -function isFilter(s) { - if (s.type !== "pseudo") - return false; - if (exports.filterNames.has(s.name)) - return true; - if (s.name === "not" && Array.isArray(s.data)) { - // Only consider `:not` with embedded filters - return s.data.some(function (s) { return s.some(isFilter); }); - } - return false; -} -exports.isFilter = isFilter; -function getLimit(filter, data, partLimit) { - var num = data != null ? parseInt(data, 10) : NaN; - switch (filter) { - case "first": - return 1; - case "nth": - case "eq": - return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0; - case "lt": - return isFinite(num) - ? num >= 0 - ? Math.min(num, partLimit) - : Infinity - : 0; - case "gt": - return isFinite(num) ? Infinity : 0; - case "odd": - return 2 * partLimit; - case "even": - return 2 * partLimit - 1; - case "last": - case "not": - return Infinity; - } -} -exports.getLimit = getLimit; -//# sourceMappingURL=positionals.js.map \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.js.map b/node_modules/cheerio-select/lib/positionals.js.map deleted file mode 100644 index eed1e88..0000000 --- a/node_modules/cheerio-select/lib/positionals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"positionals.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":";;;AAYa,QAAA,WAAW,GAAgB,IAAI,GAAG,CAAS;IACpD,OAAO;IACP,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,KAAK;CACR,CAAC,CAAC;AAOH,SAAgB,QAAQ,CAAC,CAAW;IAChC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;QAC3C,6CAA6C;QAC7C,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAhB,CAAgB,CAAC,CAAC;KAC/C;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AATD,4BASC;AAED,SAAgB,QAAQ,CACpB,MAAc,EACd,IAAmB,EACnB,SAAiB;IAEjB,IAAM,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEpD,QAAQ,MAAM,EAAE;QACZ,KAAK,OAAO;YACR,OAAO,CAAC,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,CAAC,GAAG,IAAI,CAAC;oBACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;oBAC1B,CAAC,CAAC,QAAQ;gBACd,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,KAAK;YACN,OAAO,CAAC,GAAG,SAAS,CAAC;QACzB,KAAK,MAAM;YACP,OAAO,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACN,OAAO,QAAQ,CAAC;KACvB;AACL,CAAC;AA7BD,4BA6BC"} \ No newline at end of file diff --git a/node_modules/cheerio-select/package.json b/node_modules/cheerio-select/package.json deleted file mode 100644 index 96b34cb..0000000 --- a/node_modules/cheerio-select/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "cheerio-select", - "description": "CSS selector engine supporting jQuery selectors", - "version": "2.1.0", - "author": "Felix Boehm ", - "funding": { - "url": "https://github.com/sponsors/fb55" - }, - "license": "BSD-2-Clause", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git://github.com/cheeriojs/cheerio-select.git" - }, - "directories": { - "lib": "lib/" - }, - "main": "lib/index.js", - "types": "lib/index.d.ts", - "module": "lib/esm/index.js", - "exports": { - "require": "./lib/index.js", - "import": "./lib/esm/index.js" - }, - "files": [ - "lib/**/*" - ], - "scripts": { - "test": "npm run test:jest && npm run lint", - "test:jest": "jest", - "lint": "npm run lint:es && npm run lint:prettier", - "lint:es": "eslint src", - "lint:prettier": "npm run format:prettier:raw -- --check", - "format": "npm run format:es && npm run format:prettier", - "format:es": "npm run lint:es -- --fix", - "format:prettier": "npm run format:prettier:raw -- --write", - "format:prettier:raw": "prettier '**/*.{ts,md,json,yml}'", - "build": "npm run build:cjs && npm run build:esm", - "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/cheeriojs/cheerio-select/$(git rev-parse HEAD)/src/", - "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json", - "prepare": "npm run build" - }, - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "devDependencies": { - "@types/boolbase": "^1.0.1", - "@types/jest": "^27.5.0", - "@types/node": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^5.23.0", - "@typescript-eslint/parser": "^5.23.0", - "eslint": "^8.15.0", - "eslint-config-prettier": "^8.5.0", - "htmlparser2": "^8.0.1", - "jest": "^27.5.1", - "prettier": "^2.6.2", - "ts-jest": "^27.1.4", - "typescript": "^4.6.4" - }, - "jest": { - "preset": "ts-jest", - "testEnvironment": "node", - "coverageProvider": "v8", - "moduleNameMapper": { - "^(.*)\\.js$": "$1" - } - }, - "prettier": { - "tabWidth": 4 - } -} diff --git a/node_modules/cheerio/dist/browser/api/attributes.d.ts b/node_modules/cheerio/dist/browser/api/attributes.d.ts deleted file mode 100644 index a358044..0000000 --- a/node_modules/cheerio/dist/browser/api/attributes.d.ts +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Methods for getting and modifying attributes. - * - * @module cheerio/attributes - */ -import { type AnyNode, type Element } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -/** - * Method for getting attributes. Gets the attribute value for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('ul').attr('id'); - * //=> fruits - * ``` - * - * @param name - Name of the attribute. - * @returns The attribute's value. - * @see {@link https://api.jquery.com/attr/} - */ -export declare function attr(this: Cheerio, name: string): string | undefined; -/** - * Method for getting all attributes and their values of the first element in - * the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('ul').attr(); - * //=> { id: 'fruits' } - * ``` - * - * @returns The attribute's values. - * @see {@link https://api.jquery.com/attr/} - */ -export declare function attr(this: Cheerio): Record | undefined; -/** - * Method for setting attributes. Sets the attribute value for only the first - * element in the matched set. If you set an attribute's value to `null`, you - * remove that attribute. You may also pass a `map` and `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.apple').attr('id', 'favorite').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @param value - The new value of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/attr/} - */ -export declare function attr(this: Cheerio, name: string, value?: string | null | ((this: Element, i: number, attrib: string) => string | null)): Cheerio; -/** - * Method for setting multiple attributes at once. Sets the attribute value for - * only the first element in the matched set. If you set an attribute's value to - * `null`, you remove that attribute. - * - * @category Attributes - * @example - * - * ```js - * $('.apple').attr({ id: 'favorite' }).html(); - * //=>
  • Apple
  • - * ``` - * - * @param values - Map of attribute names and values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/attr/} - */ -export declare function attr(this: Cheerio, values: Record): Cheerio; -interface StyleProp { - length: number; - [key: string]: string | number; - [index: number]: string; -} -/** - * Method for getting and setting properties. Gets the property value for only - * the first element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="checkbox"]').prop('checked'); - * //=> false - * - * $('input[type="checkbox"]').prop('checked', true).val(); - * //=> ok - * ``` - * - * @param name - Name of the property. - * @returns If `value` is specified the instance itself, otherwise the prop's - * value. - * @see {@link https://api.jquery.com/prop/} - */ -export declare function prop(this: Cheerio, name: 'tagName' | 'nodeName'): string | undefined; -export declare function prop(this: Cheerio, name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent'): string | null; -/** - * Get a parsed CSS style object. - * - * @param name - Name of the property. - * @returns The style object, or `undefined` if the element has no `style` - * attribute. - */ -export declare function prop(this: Cheerio, name: 'style'): StyleProp | undefined; -/** - * Resolve `href` or `src` of supported elements. Requires the `baseURI` option - * to be set, and a global `URL` object to be part of the environment. - * - * @example With `baseURI` set to `'https://example.com'`: - * - * ```js - * $('').prop('src'); - * //=> 'https://example.com/image.png' - * ``` - * - * @param name - Name of the property. - * @returns The resolved URL, or `undefined` if the element is not supported. - */ -export declare function prop(this: Cheerio, name: 'href' | 'src'): string | undefined; -/** - * Get a property of an element. - * - * @param name - Name of the property. - * @returns The property's value. - */ -export declare function prop(this: Cheerio, name: K): Element[K]; -/** - * Set a property of an element. - * - * @param name - Name of the property. - * @param value - Value to set the property to. - * @returns The instance itself. - */ -export declare function prop(this: Cheerio, name: K, value: Element[K] | ((this: Element, i: number, prop: K) => Element[keyof Element])): Cheerio; -/** - * Set multiple properties of an element. - * - * @example - * - * ```js - * $('input[type="checkbox"]').prop({ - * checked: true, - * disabled: false, - * }); - * ``` - * - * @param map - Object of properties to set. - * @returns The instance itself. - */ -export declare function prop(this: Cheerio, map: Record): Cheerio; -/** - * Set a property of an element. - * - * @param name - Name of the property. - * @param value - Value to set the property to. - * @returns The instance itself. - */ -export declare function prop(this: Cheerio, name: string, value: string | boolean | null | ((this: Element, i: number, prop: string) => string | boolean)): Cheerio; -/** - * Get a property of an element. - * - * @param name - The property's name. - * @returns The property's value. - */ -export declare function prop(this: Cheerio, name: string): string; -/** - * Method for getting data attributes, for only the first element in the matched - * set. - * - * @category Attributes - * @example - * - * ```js - * $('
    ').data('apple-color'); - * //=> 'red' - * ``` - * - * @param name - Name of the data attribute. - * @returns The data attribute's value, or `undefined` if the attribute does not - * exist. - * @see {@link https://api.jquery.com/data/} - */ -export declare function data(this: Cheerio, name: string): unknown | undefined; -/** - * Method for getting all of an element's data attributes, for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('
    ').data(); - * //=> { appleColor: 'red' } - * ``` - * - * @returns A map with all of the data attributes. - * @see {@link https://api.jquery.com/data/} - */ -export declare function data(this: Cheerio): Record; -/** - * Method for setting data attributes, for only the first element in the matched - * set. - * - * @category Attributes - * @example - * - * ```js - * const apple = $('.apple').data('kind', 'mac'); - * - * apple.data('kind'); - * //=> 'mac' - * ``` - * - * @param name - Name of the data attribute. - * @param value - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/data/} - */ -export declare function data(this: Cheerio, name: string, value: unknown): Cheerio; -/** - * Method for setting multiple data attributes at once, for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * const apple = $('.apple').data({ kind: 'mac' }); - * - * apple.data('kind'); - * //=> 'mac' - * ``` - * - * @param values - Map of names to values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/data/} - */ -export declare function data(this: Cheerio, values: Record): Cheerio; -/** - * Method for getting the value of input, select, and textarea. Note: Support - * for `map`, and `function` has not been added yet. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="text"]').val(); - * //=> input_text - * ``` - * - * @returns The value. - * @see {@link https://api.jquery.com/val/} - */ -export declare function val(this: Cheerio): string | undefined | string[]; -/** - * Method for setting the value of input, select, and textarea. Note: Support - * for `map`, and `function` has not been added yet. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="text"]').val('test').html(); - * //=> - * ``` - * - * @param value - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/val/} - */ -export declare function val(this: Cheerio, value: string | string[]): Cheerio; -/** - * Method for removing attributes by `name`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeAttr('class').html(); - * //=>
  • Pear
  • - * - * $('.apple').attr('id', 'favorite'); - * $('.apple').removeAttr('id class').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeAttr/} - */ -export declare function removeAttr(this: Cheerio, name: string): Cheerio; -/** - * Check to see if _any_ of the matched elements have the given `className`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').hasClass('pear'); - * //=> true - * - * $('apple').hasClass('fruit'); - * //=> false - * - * $('li').hasClass('pear'); - * //=> true - * ``` - * - * @param className - Name of the class. - * @returns Indicates if an element has the given `className`. - * @see {@link https://api.jquery.com/hasClass/} - */ -export declare function hasClass(this: Cheerio, className: string): boolean; -/** - * Adds class(es) to all of the matched elements. Also accepts a `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').addClass('fruit').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('fruit red').html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of new class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/addClass/} - */ -export declare function addClass>(this: R, value?: string | ((this: Element, i: number, className: string) => string | undefined)): R; -/** - * Removes one or more space-separated classes from the selected elements. If no - * `className` is defined, all classes will be removed. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeClass('pear').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('red').removeClass().html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the class. If not specified, removes all elements. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeClass/} - */ -export declare function removeClass>(this: R, name?: string | ((this: Element, i: number, className: string) => string | undefined)): R; -/** - * Add or remove class(es) from the matched elements, depending on either the - * class's presence or the value of the switch argument. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.apple.green').toggleClass('fruit green red').html(); - * //=>
  • Apple
  • - * - * $('.apple.green').toggleClass('fruit green red', true).html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of the class. Can also be a function. - * @param stateVal - If specified the state of the class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/toggleClass/} - */ -export declare function toggleClass>(this: R, value?: string | ((this: Element, i: number, className: string, stateVal?: boolean) => string), stateVal?: boolean): R; -export {}; -//# sourceMappingURL=attributes.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/attributes.d.ts.map b/node_modules/cheerio/dist/browser/api/attributes.d.ts.map deleted file mode 100644 index 1e09a61..0000000 --- a/node_modules/cheerio/dist/browser/api/attributes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/api/attributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAS,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAwF7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAAC;AACtB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AACtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EACF,MAAM,GACN,IAAI,GACJ,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,M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;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EACxC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAoBT;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAChE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EACF,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACxE,CAAC,CAyCH;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EACD,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACxE,CAAC,CA2CH;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EACF,MAAM,GACN,CAAC,CACC,IAAI,EAAE,OAAO,EACb,CAAC,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,OAAO,KACf,MAAM,CAAC,EAChB,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,CA+CH"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/attributes.js b/node_modules/cheerio/dist/browser/api/attributes.js deleted file mode 100644 index 0782b5b..0000000 --- a/node_modules/cheerio/dist/browser/api/attributes.js +++ /dev/null @@ -1,619 +0,0 @@ -/** - * Methods for getting and modifying attributes. - * - * @module cheerio/attributes - */ -import { text } from '../static.js'; -import { domEach, camelCase, cssCase } from '../utils.js'; -import { isTag } from 'domhandler'; -import { innerText, textContent } from 'domutils'; -const hasOwn = Object.prototype.hasOwnProperty; -const rspace = /\s+/; -const dataAttrPrefix = 'data-'; -// Attributes that are booleans -const rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i; -// Matches strings that look like JSON objects or arrays -const rbrace = /^{[^]*}$|^\[[^]*]$/; -function getAttr(elem, name, xmlMode) { - var _a; - if (!elem || !isTag(elem)) - return undefined; - (_a = elem.attribs) !== null && _a !== void 0 ? _a : (elem.attribs = {}); - // Return the entire attribs object if no attribute specified - if (!name) { - return elem.attribs; - } - if (hasOwn.call(elem.attribs, name)) { - // Get the (decoded) attribute - return !xmlMode && rboolean.test(name) ? name : elem.attribs[name]; - } - // Mimic the DOM and return text content as value for `option's` - if (elem.name === 'option' && name === 'value') { - return text(elem.children); - } - // Mimic DOM with default value for radios/checkboxes - if (elem.name === 'input' && - (elem.attribs['type'] === 'radio' || elem.attribs['type'] === 'checkbox') && - name === 'value') { - return 'on'; - } - return undefined; -} -/** - * Sets the value of an attribute. The attribute will be deleted if the value is - * `null`. - * - * @private - * @param el - The element to set the attribute on. - * @param name - The attribute's name. - * @param value - The attribute's value. - */ -function setAttr(el, name, value) { - if (value === null) { - removeAttribute(el, name); - } - else { - el.attribs[name] = `${value}`; - } -} -export function attr(name, value) { - // Set the value (with attr map support) - if (typeof name === 'object' || value !== undefined) { - if (typeof value === 'function') { - if (typeof name !== 'string') { - { - throw new Error('Bad combination of arguments.'); - } - } - return domEach(this, (el, i) => { - if (isTag(el)) - setAttr(el, name, value.call(el, i, el.attribs[name])); - }); - } - return domEach(this, (el) => { - if (!isTag(el)) - return; - if (typeof name === 'object') { - for (const objName of Object.keys(name)) { - const objValue = name[objName]; - setAttr(el, objName, objValue); - } - } - else { - setAttr(el, name, value); - } - }); - } - return arguments.length > 1 - ? this - : getAttr(this[0], name, this.options.xmlMode); -} -/** - * Gets a node's prop. - * - * @private - * @category Attributes - * @param el - Element to get the prop of. - * @param name - Name of the prop. - * @param xmlMode - Disable handling of special HTML attributes. - * @returns The prop's value. - */ -function getProp(el, name, xmlMode) { - return name in el - ? // @ts-expect-error TS doesn't like us accessing the value directly here. - el[name] - : !xmlMode && rboolean.test(name) - ? getAttr(el, name, false) !== undefined - : getAttr(el, name, xmlMode); -} -/** - * Sets the value of a prop. - * - * @private - * @param el - The element to set the prop on. - * @param name - The prop's name. - * @param value - The prop's value. - * @param xmlMode - Disable handling of special HTML attributes. - */ -function setProp(el, name, value, xmlMode) { - if (name in el) { - // @ts-expect-error Overriding value - el[name] = value; - } - else { - setAttr(el, name, !xmlMode && rboolean.test(name) ? (value ? '' : null) : `${value}`); - } -} -export function prop(name, value) { - var _a; - if (typeof name === 'string' && value === undefined) { - const el = this[0]; - if (!el || !isTag(el)) - return undefined; - switch (name) { - case 'style': { - const property = this.css(); - const keys = Object.keys(property); - for (let i = 0; i < keys.length; i++) { - property[i] = keys[i]; - } - property.length = keys.length; - return property; - } - case 'tagName': - case 'nodeName': { - return el.name.toUpperCase(); - } - case 'href': - case 'src': { - const prop = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a[name]; - if (typeof URL !== 'undefined' && - ((name === 'href' && (el.tagName === 'a' || el.tagName === 'link')) || - (name === 'src' && - (el.tagName === 'img' || - el.tagName === 'iframe' || - el.tagName === 'audio' || - el.tagName === 'video' || - el.tagName === 'source'))) && - prop !== undefined && - this.options.baseURI) { - return new URL(prop, this.options.baseURI).href; - } - return prop; - } - case 'innerText': { - return innerText(el); - } - case 'textContent': { - return textContent(el); - } - case 'outerHTML': { - return this.clone().wrap('').parent().html(); - } - case 'innerHTML': { - return this.html(); - } - default: { - return getProp(el, name, this.options.xmlMode); - } - } - } - if (typeof name === 'object' || value !== undefined) { - if (typeof value === 'function') { - if (typeof name === 'object') { - throw new TypeError('Bad combination of arguments.'); - } - return domEach(this, (el, i) => { - if (isTag(el)) { - setProp(el, name, value.call(el, i, getProp(el, name, this.options.xmlMode)), this.options.xmlMode); - } - }); - } - return domEach(this, (el) => { - if (!isTag(el)) - return; - if (typeof name === 'object') { - for (const key of Object.keys(name)) { - const val = name[key]; - setProp(el, key, val, this.options.xmlMode); - } - } - else { - setProp(el, name, value, this.options.xmlMode); - } - }); - } - return undefined; -} -/** - * Sets the value of a data attribute. - * - * @private - * @param elem - The element to set the data attribute on. - * @param name - The data attribute's name. - * @param value - The data attribute's value. - */ -function setData(elem, name, value) { - var _a; - (_a = elem.data) !== null && _a !== void 0 ? _a : (elem.data = {}); - if (typeof name === 'object') - Object.assign(elem.data, name); - else if (typeof name === 'string' && value !== undefined) { - elem.data[name] = value; - } -} -/** - * Read _all_ HTML5 `data-*` attributes from the equivalent HTML5 `data-*` - * attribute, and cache the value in the node's internal data store. - * - * @private - * @category Attributes - * @param el - Element to get the data attribute of. - * @returns A map with all of the data attributes. - */ -function readAllData(el) { - for (const domName of Object.keys(el.attribs)) { - if (!domName.startsWith(dataAttrPrefix)) { - continue; - } - const jsName = camelCase(domName.slice(dataAttrPrefix.length)); - if (!hasOwn.call(el.data, jsName)) { - el.data[jsName] = parseDataValue(el.attribs[domName]); - } - } - return el.data; -} -/** - * Read the specified attribute from the equivalent HTML5 `data-*` attribute, - * and (if present) cache the value in the node's internal data store. - * - * @private - * @category Attributes - * @param el - Element to get the data attribute of. - * @param name - Name of the data attribute. - * @returns The data attribute's value. - */ -function readData(el, name) { - const domName = dataAttrPrefix + cssCase(name); - const data = el.data; - if (hasOwn.call(data, name)) { - return data[name]; - } - if (hasOwn.call(el.attribs, domName)) { - return (data[name] = parseDataValue(el.attribs[domName])); - } - return undefined; -} -/** - * Coerce string data-* attributes to their corresponding JavaScript primitives. - * - * @private - * @category Attributes - * @param value - The value to parse. - * @returns The parsed value. - */ -function parseDataValue(value) { - if (value === 'null') - return null; - if (value === 'true') - return true; - if (value === 'false') - return false; - const num = Number(value); - if (value === String(num)) - return num; - if (rbrace.test(value)) { - try { - return JSON.parse(value); - } - catch { - /* Ignore */ - } - } - return value; -} -export function data(name, value) { - var _a; - const elem = this[0]; - if (!elem || !isTag(elem)) - return; - const dataEl = elem; - (_a = dataEl.data) !== null && _a !== void 0 ? _a : (dataEl.data = {}); - // Return the entire data object if no data specified - if (name == null) { - return readAllData(dataEl); - } - // Set the value (with attr map support) - if (typeof name === 'object' || value !== undefined) { - domEach(this, (el) => { - if (isTag(el)) { - if (typeof name === 'object') - setData(el, name); - else - setData(el, name, value); - } - }); - return this; - } - return readData(dataEl, name); -} -export function val(value) { - const querying = arguments.length === 0; - const element = this[0]; - if (!element || !isTag(element)) - return querying ? undefined : this; - switch (element.name) { - case 'textarea': { - return this.text(value); - } - case 'select': { - const option = this.find('option:selected'); - if (!querying) { - if (this.attr('multiple') == null && typeof value === 'object') { - return this; - } - this.find('option').removeAttr('selected'); - const values = typeof value === 'object' ? value : [value]; - for (const val of values) { - this.find(`option[value="${val}"]`).attr('selected', ''); - } - return this; - } - return this.attr('multiple') - ? option.toArray().map((el) => text(el.children)) - : option.attr('value'); - } - case 'input': - case 'option': { - return querying - ? this.attr('value') - : this.attr('value', value); - } - } - return undefined; -} -/** - * Remove an attribute. - * - * @private - * @param elem - Node to remove attribute from. - * @param name - Name of the attribute to remove. - */ -function removeAttribute(elem, name) { - if (!elem.attribs || !hasOwn.call(elem.attribs, name)) - return; - delete elem.attribs[name]; -} -/** - * Splits a space-separated list of names to individual names. - * - * @category Attributes - * @param names - Names to split. - * @returns - Split names. - */ -function splitNames(names) { - return names ? names.trim().split(rspace) : []; -} -/** - * Method for removing attributes by `name`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeAttr('class').html(); - * //=>
  • Pear
  • - * - * $('.apple').attr('id', 'favorite'); - * $('.apple').removeAttr('id class').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeAttr/} - */ -export function removeAttr(name) { - const attrNames = splitNames(name); - for (const attrName of attrNames) { - domEach(this, (elem) => { - if (isTag(elem)) - removeAttribute(elem, attrName); - }); - } - return this; -} -/** - * Check to see if _any_ of the matched elements have the given `className`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').hasClass('pear'); - * //=> true - * - * $('apple').hasClass('fruit'); - * //=> false - * - * $('li').hasClass('pear'); - * //=> true - * ``` - * - * @param className - Name of the class. - * @returns Indicates if an element has the given `className`. - * @see {@link https://api.jquery.com/hasClass/} - */ -export function hasClass(className) { - return this.toArray().some((elem) => { - const clazz = isTag(elem) && elem.attribs['class']; - let idx = -1; - if (clazz && className.length > 0) { - while ((idx = clazz.indexOf(className, idx + 1)) > -1) { - const end = idx + className.length; - if ((idx === 0 || rspace.test(clazz[idx - 1])) && - (end === clazz.length || rspace.test(clazz[end]))) { - return true; - } - } - } - return false; - }); -} -/** - * Adds class(es) to all of the matched elements. Also accepts a `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').addClass('fruit').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('fruit red').html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of new class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/addClass/} - */ -export function addClass(value) { - // Support functions - if (typeof value === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - const className = el.attribs['class'] || ''; - addClass.call([el], value.call(el, i, className)); - } - }); - } - // Return if no value or not a string or function - if (!value || typeof value !== 'string') - return this; - const classNames = value.split(rspace); - const numElements = this.length; - for (let i = 0; i < numElements; i++) { - const el = this[i]; - // If selected element isn't a tag, move on - if (!isTag(el)) - continue; - // If we don't already have classes — always set xmlMode to false here, as it doesn't matter for classes - const className = getAttr(el, 'class', false); - if (className) { - let setClass = ` ${className} `; - // Check if class already exists - for (const cn of classNames) { - const appendClass = `${cn} `; - if (!setClass.includes(` ${appendClass}`)) - setClass += appendClass; - } - setAttr(el, 'class', setClass.trim()); - } - else { - setAttr(el, 'class', classNames.join(' ').trim()); - } - } - return this; -} -/** - * Removes one or more space-separated classes from the selected elements. If no - * `className` is defined, all classes will be removed. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeClass('pear').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('red').removeClass().html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the class. If not specified, removes all elements. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeClass/} - */ -export function removeClass(name) { - // Handle if value is a function - if (typeof name === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - removeClass.call([el], name.call(el, i, el.attribs['class'] || '')); - } - }); - } - const classes = splitNames(name); - const numClasses = classes.length; - const removeAll = arguments.length === 0; - return domEach(this, (el) => { - if (!isTag(el)) - return; - if (removeAll) { - // Short circuit the remove all case as this is the nice one - el.attribs['class'] = ''; - } - else { - const elClasses = splitNames(el.attribs['class']); - let changed = false; - for (let j = 0; j < numClasses; j++) { - const index = elClasses.indexOf(classes[j]); - if (index >= 0) { - elClasses.splice(index, 1); - changed = true; - /* - * We have to do another pass to ensure that there are not duplicate - * classes listed - */ - j--; - } - } - if (changed) { - el.attribs['class'] = elClasses.join(' '); - } - } - }); -} -/** - * Add or remove class(es) from the matched elements, depending on either the - * class's presence or the value of the switch argument. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.apple.green').toggleClass('fruit green red').html(); - * //=>
  • Apple
  • - * - * $('.apple.green').toggleClass('fruit green red', true).html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of the class. Can also be a function. - * @param stateVal - If specified the state of the class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/toggleClass/} - */ -export function toggleClass(value, stateVal) { - // Support functions - if (typeof value === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - toggleClass.call([el], value.call(el, i, el.attribs['class'] || '', stateVal), stateVal); - } - }); - } - // Return if no value or not a string or function - if (!value || typeof value !== 'string') - return this; - const classNames = value.split(rspace); - const numClasses = classNames.length; - const state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0; - const numElements = this.length; - for (let i = 0; i < numElements; i++) { - const el = this[i]; - // If selected element isn't a tag, move on - if (!isTag(el)) - continue; - const elementClasses = splitNames(el.attribs['class']); - // Check if class already exists - for (let j = 0; j < numClasses; j++) { - // Check if the class name is currently defined - const index = elementClasses.indexOf(classNames[j]); - // Add if stateValue === true or we are toggling and there is no value - if (state >= 0 && index < 0) { - elementClasses.push(classNames[j]); - } - else if (state <= 0 && index >= 0) { - // Otherwise remove but only if the item exists - elementClasses.splice(index, 1); - } - } - el.attribs['class'] = elementClasses.join(' '); - } - return this; -} -//# sourceMappingURL=attributes.js.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/attributes.js.map b/node_modules/cheerio/dist/browser/api/attributes.js.map deleted file mode 100644 index 1c70ce1..0000000 --- a/node_modules/cheerio/dist/browser/api/attributes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../src/api/attributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,EAA8B,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC/C,MAAM,MAAM,GAAG,KAAK,CAAC;AACrB,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,+BAA+B;AAC/B,MAAM,QAAQ,GACZ,6HAA6H,CAAC;AAChI,wDAAwD;AACxD,MAAM,MAAM,GAAG,oBAA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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,2CAA2C;QAC3C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAAE,SAAS;QAEzB,MAAM,cAAc,GAAG,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAEvD,gCAAgC;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,+CAA+C;YAC/C,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAEpD,sEAAsE;YACtE,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC5B,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC;iBAAM,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBACpC,+CAA+C;gBAC/C,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAED,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/css.d.ts b/node_modules/cheerio/dist/browser/api/css.d.ts deleted file mode 100644 index 9997f34..0000000 --- a/node_modules/cheerio/dist/browser/api/css.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { type Element, type AnyNode } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -/** - * Get the value of a style property for the first element in the set of matched - * elements. - * - * @category CSS - * @param names - Optionally the names of the properties of interest. - * @returns A map of all of the style properties. - * @see {@link https://api.jquery.com/css/} - */ -export declare function css(this: Cheerio, names?: string[]): Record | undefined; -/** - * Get the value of a style property for the first element in the set of matched - * elements. - * - * @category CSS - * @param name - The name of the property. - * @returns The property value for the given name. - * @see {@link https://api.jquery.com/css/} - */ -export declare function css(this: Cheerio, name: string): string | undefined; -/** - * Set one CSS property for every matched element. - * - * @category CSS - * @param prop - The name of the property. - * @param val - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export declare function css(this: Cheerio, prop: string, val: string | ((this: Element, i: number, style: string) => string | undefined)): Cheerio; -/** - * Set multiple CSS properties for every matched element. - * - * @category CSS - * @param map - A map of property names and values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export declare function css(this: Cheerio, map: Record): Cheerio; -//# sourceMappingURL=css.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/css.d.ts.map b/node_modules/cheerio/dist/browser/api/css.d.ts.map deleted file mode 100644 index 06bff02..0000000 --- a/node_modules/cheerio/dist/browser/api/css.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../src/api/css.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AACtC;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAAC;AACtB;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EACC,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACpE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/css.js b/node_modules/cheerio/dist/browser/api/css.js deleted file mode 100644 index 0c000ec..0000000 --- a/node_modules/cheerio/dist/browser/api/css.js +++ /dev/null @@ -1,116 +0,0 @@ -import { domEach } from '../utils.js'; -import { isTag } from 'domhandler'; -/** - * Set multiple CSS properties for every matched element. - * - * @category CSS - * @param prop - The names of the properties. - * @param val - The new values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export function css(prop, val) { - if ((prop != null && val != null) || - // When `prop` is a "plain" object - (typeof prop === 'object' && !Array.isArray(prop))) { - return domEach(this, (el, i) => { - if (isTag(el)) { - // `prop` can't be an array here anymore. - setCss(el, prop, val, i); - } - }); - } - if (this.length === 0) { - return undefined; - } - return getCss(this[0], prop); -} -/** - * Set styles of all elements. - * - * @private - * @param el - Element to set style of. - * @param prop - Name of property. - * @param value - Value to set property to. - * @param idx - Optional index within the selection. - */ -function setCss(el, prop, value, idx) { - if (typeof prop === 'string') { - const styles = getCss(el); - const val = typeof value === 'function' ? value.call(el, idx, styles[prop]) : value; - if (val === '') { - delete styles[prop]; - } - else if (val != null) { - styles[prop] = val; - } - el.attribs['style'] = stringify(styles); - } - else if (typeof prop === 'object') { - const keys = Object.keys(prop); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - setCss(el, k, prop[k], i); - } - } -} -function getCss(el, prop) { - if (!el || !isTag(el)) - return; - const styles = parse(el.attribs['style']); - if (typeof prop === 'string') { - return styles[prop]; - } - if (Array.isArray(prop)) { - const newStyles = {}; - for (const item of prop) { - if (styles[item] != null) { - newStyles[item] = styles[item]; - } - } - return newStyles; - } - return styles; -} -/** - * Stringify `obj` to styles. - * - * @private - * @category CSS - * @param obj - Object to stringify. - * @returns The serialized styles. - */ -function stringify(obj) { - return Object.keys(obj).reduce((str, prop) => `${str}${str ? ' ' : ''}${prop}: ${obj[prop]};`, ''); -} -/** - * Parse `styles`. - * - * @private - * @category CSS - * @param styles - Styles to be parsed. - * @returns The parsed styles. - */ -function parse(styles) { - styles = (styles || '').trim(); - if (!styles) - return {}; - const obj = {}; - let key; - for (const str of styles.split(';')) { - const n = str.indexOf(':'); - // If there is no :, or if it is the first/last character, add to the previous item's value - if (n < 1 || n === str.length - 1) { - const trimmed = str.trimEnd(); - if (trimmed.length > 0 && key !== undefined) { - obj[key] += `;${trimmed}`; - } - } - else { - key = str.slice(0, n).trim(); - obj[key] = str.slice(n + 1).trim(); - } - } - return obj; -} -//# sourceMappingURL=css.js.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/css.js.map b/node_modules/cheerio/dist/browser/api/css.js.map deleted file mode 100644 index d09cdaf..0000000 --- a/node_modules/cheerio/dist/browser/api/css.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../src/api/css.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AAC,IAAI,EAAE,CAAC;QACrC,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/extract.d.ts b/node_modules/cheerio/dist/browser/api/extract.d.ts deleted file mode 100644 index b8d73a7..0000000 --- a/node_modules/cheerio/dist/browser/api/extract.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { AnyNode, Element } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -import type { prop } from './attributes.js'; -type ExtractDescriptorFn = (el: Element, key: string, obj: Record) => unknown; -interface ExtractDescriptor { - selector: string; - value?: string | ExtractDescriptorFn | ExtractMap; -} -type ExtractValue = string | ExtractDescriptor | [string | ExtractDescriptor]; -export interface ExtractMap { - [key: string]: ExtractValue; -} -type ExtractedValue = V extends [ - string | ExtractDescriptor -] ? NonNullable>[] : V extends string ? string | undefined : V extends ExtractDescriptor ? V['value'] extends ExtractMap ? ExtractedMap | undefined : V['value'] extends ExtractDescriptorFn ? ReturnType | undefined : ReturnType | undefined : never; -export type ExtractedMap = { - [key in keyof M]: ExtractedValue; -}; -/** - * Extract multiple values from a document, and store them in an object. - * - * @param map - An object containing key-value pairs. The keys are the names of - * the properties to be created on the object, and the values are the - * selectors to be used to extract the values. - * @returns An object containing the extracted values. - */ -export declare function extract(this: Cheerio, map: M): ExtractedMap; -export {}; -//# sourceMappingURL=extract.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/extract.d.ts.map b/node_modules/cheerio/dist/browser/api/extract.d.ts.map deleted file mode 100644 index 8bbe7ab..0000000 --- a/node_modules/cheerio/dist/browser/api/extract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/api/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAA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G;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,EAC7D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,GAAG,EAAE,CAAC,GACL,YAAY,CAAC,CAAC,CAAC,CA2BjB"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/extract.js b/node_modules/cheerio/dist/browser/api/extract.js deleted file mode 100644 index 7203789..0000000 --- a/node_modules/cheerio/dist/browser/api/extract.js +++ /dev/null @@ -1,42 +0,0 @@ -function getExtractDescr(descr) { - var _a; - if (typeof descr === 'string') { - return { selector: descr, value: 'textContent' }; - } - return { - selector: descr.selector, - value: (_a = descr.value) !== null && _a !== void 0 ? _a : 'textContent', - }; -} -/** - * Extract multiple values from a document, and store them in an object. - * - * @param map - An object containing key-value pairs. The keys are the names of - * the properties to be created on the object, and the values are the - * selectors to be used to extract the values. - * @returns An object containing the extracted values. - */ -export function extract(map) { - const ret = {}; - for (const key in map) { - const descr = map[key]; - const isArray = Array.isArray(descr); - const { selector, value } = getExtractDescr(isArray ? descr[0] : descr); - const fn = typeof value === 'function' - ? value - : typeof value === 'string' - ? (el) => this._make(el).prop(value) - : (el) => this._make(el).extract(value); - if (isArray) { - ret[key] = this._findBySelector(selector, Number.POSITIVE_INFINITY) - .map((_, el) => fn(el, key, ret)) - .get(); - } - else { - const $ = this._findBySelector(selector, 1); - ret[key] = $.length > 0 ? fn($[0], key, ret) : undefined; - } - } - return ret; -} -//# sourceMappingURL=extract.js.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/extract.js.map b/node_modules/cheerio/dist/browser/api/extract.js.map deleted file mode 100644 index b6cd793..0000000 --- a/node_modules/cheerio/dist/browser/api/extract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../src/api/extract.ts"],"names":[],"mappings":"AAwCA,SAAS,eAAe,CACtB,KAAiC;;IAEjC,IAAI,OAAO,KAAK,KAAK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AAC;iBAChC,GAAG,EAAE,CAAC;QACX,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC5C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,GAAsB,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/forms.d.ts b/node_modules/cheerio/dist/browser/api/forms.d.ts deleted file mode 100644 index dbec41e..0000000 --- a/node_modules/cheerio/dist/browser/api/forms.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { type AnyNode } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -/** - * Encode a set of form elements as a string for submission. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serialize(); - * //=> 'foo=bar' - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serialize/} - */ -export declare function serialize(this: Cheerio): string; -/** - * Encode a set of form elements as an array of names and values. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serializeArray(); - * //=> [ { name: 'foo', value: 'bar' } ] - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serializeArray/} - */ -export declare function serializeArray(this: Cheerio): { - name: string; - value: string; -}[]; -//# sourceMappingURL=forms.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/forms.d.ts.map b/node_modules/cheerio/dist/browser/api/forms.d.ts.map deleted file mode 100644 index 2ea55e4..0000000 --- a/node_modules/cheerio/dist/browser/api/forms.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../src/api/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAU7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAYrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAC9C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,EAAE,CA4CF"} \ No newline at end of file diff --git a/node_modules/cheerio/dist/browser/api/forms.js b/node_modules/cheerio/dist/browser/api/forms.js deleted file mode 100644 index 30853e1..0000000 --- a/node_modules/cheerio/dist/browser/api/forms.js +++ /dev/null @@ -1,81 +0,0 @@ -import { isTag } from 'domhandler'; -/* - * https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js - * https://github.com/jquery/jquery/blob/2.1.3/src/serialize.js - */ -const submittableSelector = 'input,select,textarea,keygen'; -const r20 = /%20/g; -const rCRLF = /\r?\n/g; -/** - * Encode a set of form elements as a string for submission. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serialize(); - * //=> 'foo=bar' - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serialize/} - */ -export function serialize() { - // Convert form elements into name/value objects - const arr = this.serializeArray(); - // Serialize each element into a key/value string - const retArr = arr.map((data) => `${encodeURIComponent(data.name)}=${encodeURIComponent(data.value)}`); - // Return the resulting serialization - return retArr.join('&').replace(r20, '+'); -} -/** - * Encode a set of form elements as an array of names and values. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serializeArray(); - * //=> [ { name: 'foo', value: 'bar' } ] - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serializeArray/} - */ -export function serializeArray() { - // Resolve all form elements from either forms or collections of form elements - return this.map((_, elem) => { - const $elem = this._make(elem); - if (isTag(elem) && elem.name === 'form') { - return $elem.find(submittableSelector).toArray(); - } - return $elem.filter(submittableSelector).toArray(); - }) - .filter( - // Verify elements have a name (`attr.name`) and are not disabled (`:enabled`) - '[name!=""]:enabled' + - // And cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`) - ':not(:submit, :button, :image, :reset, :file)' + - // And are either checked/don't have a checkable state - ':matches([checked], :not(:checkbox, :radio))') - .map((_, elem) => { - var _a; - const $elem = this._make(elem); - const name = $elem.attr('name'); // We have filtered for elements with a name before. - // If there is no value set (e.g. `undefined`, `null`), then default value to empty - const value = (_a = $elem.val()) !== null && _a !== void 0 ? _a : ''; - // If we have an array of values (e.g. `', - '
    ', -].join(''); - -export const noscript: string = [ - '', - '', - '

    Rocks!

    ', - '', -].join(''); - -export const script: string = [ - '
    ', - 'A', - '', - 'B', - '
    ', -].join(''); - -export const mixedText = '1TEXT2'; diff --git a/node_modules/cheerio/src/__tests__/deprecated.spec.ts b/node_modules/cheerio/src/__tests__/deprecated.spec.ts deleted file mode 100644 index 493b8c7..0000000 --- a/node_modules/cheerio/src/__tests__/deprecated.spec.ts +++ /dev/null @@ -1,266 +0,0 @@ -/** - * This file includes tests for deprecated APIs. The methods are expected to be - * removed in the next major release of Cheerio, but their stability should be - * maintained until that time. - */ -import { describe, it, expect, beforeEach } from 'vitest'; -import { cheerio, food, fruits } from '../__fixtures__/fixtures.js'; - -describe('deprecated APIs', () => { - describe('cheerio module', () => { - describe('.parseHTML', () => { - it('(html) : should preserve content', () => { - const html = '
    test div
    '; - expect(cheerio(cheerio.parseHTML(html)[0]).html()).toBe('test div'); - }); - }); - - describe('.merge', () => { - it('should be a function', () => { - expect(typeof cheerio.merge).toBe('function'); - }); - - // #1674 - merge, wont accept Cheerio object - it('should be a able merge array and cheerio object', () => { - const ret = cheerio.merge(cheerio(), ['elem1', 'elem2']); - expect(typeof ret).toBe('object'); - expect(ret).toHaveLength(2); - }); - - it('(arraylike, arraylike) : should modify the first array, but not the second', () => { - const arr1 = [1, 2, 3]; - const arr2 = [4, 5, 6]; - const ret = cheerio.merge(arr1, arr2); - - expect(typeof ret).toBe('object'); - expect(Array.isArray(ret)).toBe(true); - expect(ret).toBe(arr1); - expect(arr1).toHaveLength(6); - expect(arr2).toHaveLength(3); - }); - - it('(arraylike, arraylike) : should handle objects that arent arrays, but are arraylike', () => { - const arr1: ArrayLike = { - length: 3, - 0: 'a', - 1: 'b', - 2: 'c', - }; - const arr2 = { - length: 3, - 0: 'd', - 1: 'e', - 2: 'f', - }; - - cheerio.merge(arr1, arr2); - expect(arr1).toHaveLength(6); - expect(arr1[3]).toBe('d'); - expect(arr1[4]).toBe('e'); - expect(arr1[5]).toBe('f'); - expect(arr2).toHaveLength(3); - }); - - it('(?, ?) : should gracefully reject invalid inputs', () => { - expect(cheerio.merge([4], 3 as never)).toBeUndefined(); - expect(cheerio.merge({} as never, {} as never)).toBeUndefined(); - expect(cheerio.merge([], {} as never)).toBeUndefined(); - expect(cheerio.merge({} as never, [])).toBeUndefined(); - - const fakeArray = { length: 3, 0: 'a', 1: 'b', 3: 'd' }; - expect(cheerio.merge(fakeArray, [])).toBeUndefined(); - expect(cheerio.merge([], fakeArray)).toBeUndefined(); - - expect(cheerio.merge({ length: '7' } as never, [])).toBeUndefined(); - expect(cheerio.merge({ length: -1 }, [])).toBeUndefined(); - }); - - it('(?, ?) : should no-op on invalid inputs', () => { - const fakeArray1 = { length: 3, 0: 'a', 1: 'b', 3: 'd' }; - cheerio.merge(fakeArray1, []); - expect(fakeArray1).toHaveLength(3); - expect(fakeArray1[0]).toBe('a'); - expect(fakeArray1[1]).toBe('b'); - expect(fakeArray1[3]).toBe('d'); - cheerio.merge([], fakeArray1); - expect(fakeArray1).toHaveLength(3); - expect(fakeArray1[0]).toBe('a'); - expect(fakeArray1[1]).toBe('b'); - expect(fakeArray1[3]).toBe('d'); - }); - }); - - describe('.contains', () => { - let $: typeof cheerio; - - beforeEach(() => { - $ = cheerio.load(food); - }); - - it('(container, contained) : should correctly detect the provided element', () => { - const $food = $('#food'); - const $fruits = $('#fruits'); - const $apple = $('.apple'); - - expect(cheerio.contains($food[0], $fruits[0])).toBe(true); - expect(cheerio.contains($food[0], $apple[0])).toBe(true); - }); - - it('(container, other) : should not detect elements that are not contained', () => { - const $fruits = $('#fruits'); - const $vegetables = $('#vegetables'); - const $apple = $('.apple'); - - expect(cheerio.contains($vegetables[0], $apple[0])).toBe(false); - expect(cheerio.contains($fruits[0], $vegetables[0])).toBe(false); - expect(cheerio.contains($vegetables[0], $fruits[0])).toBe(false); - expect(cheerio.contains($fruits[0], $fruits[0])).toBe(false); - expect(cheerio.contains($vegetables[0], $vegetables[0])).toBe(false); - }); - }); - - describe('.root', () => { - it('returns an empty selection', () => { - const $empty = cheerio.root(); - expect($empty).toHaveLength(1); - expect($empty[0].children).toHaveLength(0); - }); - }); - }); - - describe('Cheerio function', () => { - it('.load', () => { - const $1 = cheerio.load(fruits); - const $2 = $1.load('

    Some text.

    '); - - expect($2('a')).toHaveLength(1); - }); - - /** - * The `.html` static method defined on the "loaded" Cheerio factory - * function is deprecated. - * - * In order to promote consistency with the jQuery library, users are - * encouraged to instead use the instance method of the same name. - * - * @example - * - * ```js - * const $ = cheerio.load('

    Hello, world.

    '); - * - * $('h1').html(); - * //=> '

    Hello, world.' - * ``` - * - * @example To render the markup of an entire document, invoke the - * `html` function exported by the Cheerio module with a "root" - * selection. - * - * ```js - * cheerio.html($.root()); - * //=> '

    Hello, world.

    ' - * ``` - */ - describe('.html - deprecated API', () => { - it('() : of empty cheerio object should return null', () => { - /* - * Note: the direct invocation of the Cheerio constructor function is - * also deprecated. - */ - const $ = cheerio(); - expect($.html()).toBe(null); - }); - - it('(selector) : should return the outerHTML of the selected element', () => { - const $ = cheerio.load(fruits); - expect($.html('.pear')).toBe('
  • Pear
  • '); - }); - }); - - /** - * The `.xml` static method defined on the "loaded" Cheerio factory function - * is deprecated. Users are encouraged to instead use the `xml` function - * exported by the Cheerio module. - * - * @example - * - * ```js - * cheerio.xml($.root()); - * ``` - */ - describe('.xml - deprecated API', () => { - it('() : renders XML', () => { - const $ = cheerio.load('', { xmlMode: true }); - expect($.xml()).toBe(''); - }); - }); - - /** - * The `.text` static method defined on the "loaded" Cheerio factory - * function is deprecated. - * - * In order to promote consistency with the jQuery library, users are - * encouraged to instead use the instance method of the same name. - * - * @example - * - * ```js - * const $ = cheerio.load('

    Hello, world.

    '); - * $('h1').text(); - * //=> 'Hello, world.' - * ``` - * - * @example To render the text content of an entire document, - * invoke the `text` function exported by the Cheerio module with a "root" - * selection. - * - * ```js - * cheerio.text($.root()); - * //=> 'Hello, world.' - * ``` - */ - describe('.text - deprecated API', () => { - it('(cheerio object) : should return the text contents of the specified elements', () => { - const $ = cheerio.load('This is content.'); - expect($.text($('a'))).toBe('This is content.'); - }); - - it('(cheerio object) : should omit comment nodes', () => { - const $ = cheerio.load( - 'This is not a comment.', - ); - expect($.text($('a'))).toBe('This is not a comment.'); - }); - - it('(cheerio object) : should include text contents of children recursively', () => { - const $ = cheerio.load( - 'This is
    a child with another child and not a comment followed by one last child and some final
    text.
    ', - ); - expect($.text($('a'))).toBe( - 'This is a child with another child and not a comment followed by one last child and some final text.', - ); - }); - - it('() : should return the rendered text content of the root', () => { - const $ = cheerio.load( - 'This is
    a child with another child and not a comment followed by one last child and some final
    text.
    ', - ); - expect($.text()).toBe( - 'This is a child with another child and not a comment followed by one last child and some final text.', - ); - }); - - it('(cheerio object) : should not omit script tags', () => { - const $ = cheerio.load(''); - expect($.text()).toBe('console.log("test")'); - }); - - it('(cheerio object) : should omit style tags', () => { - const $ = cheerio.load( - '', - ); - expect($.text()).toBe('.cf-hidden { display: none; }'); - }); - }); - }); -}); diff --git a/node_modules/cheerio/src/__tests__/xml.spec.ts b/node_modules/cheerio/src/__tests__/xml.spec.ts deleted file mode 100644 index 22d32fe..0000000 --- a/node_modules/cheerio/src/__tests__/xml.spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { describe, it, expect } from 'vitest'; -import { load } from '../index.js'; -import type { CheerioOptions } from '../options.js'; - -function xml(str: string, options?: CheerioOptions) { - options = { xml: true, ...options }; - const $ = load(str, options); - return $.xml(); -} - -function dom(str: string, options?: CheerioOptions) { - const $ = load('', options); - return $(str).html(); -} - -describe('render', () => { - describe('(xml)', () => { - it('should render tags correctly', () => { - const str = - ''; - expect(xml(str)).toBe( - '', - ); - }); - - it('should render tags (RSS) correctly', () => { - const str = 'http://www.github.com/'; - expect(xml(str)).toBe('http://www.github.com/'); - }); - - it('should escape entities', () => { - const str = ''; - expect(xml(str)).toBe(str); - }); - - it('should render HTML as XML', () => { - const $ = load('', null, false); - expect($.xml()).toBe(''); - }); - }); - - describe('(dom)', () => { - it('should not keep camelCase for new nodes', () => { - const str = 'hello'; - expect(dom(str, { xml: false })).toBe( - 'hello', - ); - }); - - it('should keep camelCase for new nodes', () => { - const str = 'hello'; - expect(dom(str, { xml: true })).toBe( - 'hello', - ); - }); - - it('should maintain the parsing options of distinct contexts independently', () => { - const str = 'hello'; - const $ = load('', { xml: false }); - - expect($(str).html()).toBe( - 'hello', - ); - }); - }); -}); diff --git a/node_modules/cheerio/src/api/attributes.spec.ts b/node_modules/cheerio/src/api/attributes.spec.ts deleted file mode 100644 index 9b1c64c..0000000 --- a/node_modules/cheerio/src/api/attributes.spec.ts +++ /dev/null @@ -1,1165 +0,0 @@ -import { describe, it, expect, beforeEach } from 'vitest'; -import { load, type CheerioAPI, type Cheerio } from '../index.js'; -import type { Element } from 'domhandler'; -import { - cheerio, - script, - fruits, - vegetables, - food, - chocolates, - inputs, - mixedText, -} from '../__fixtures__/fixtures.js'; - -function withClass(attr: string) { - return cheerio(`
    `); -} - -describe('$(...)', () => { - describe('.attr', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('() : should get all the attributes', () => { - const attrs = $('ul').attr(); - expect(attrs).toHaveProperty('id', 'fruits'); - }); - - it('(invalid key) : invalid attr should get undefined', () => { - const attr = $('.apple').attr('lol'); - expect(attr).toBeUndefined(); - }); - - it('(valid key) : valid attr should get value', () => { - const cls = $('.apple').attr('class'); - expect(cls).toBe('apple'); - }); - - it('(valid key) : valid attr should get name when boolean', () => { - const attr = $('').attr('autofocus'); - expect(attr).toBe('autofocus'); - }); - - it('(key, value) : should set one attr', () => { - const $pear = $('.pear').attr('id', 'pear'); - expect($('#pear')).toHaveLength(1); - expect($pear).toBeInstanceOf($); - }); - - it('(key, value) : should set multiple attr', () => { - const $el = cheerio('
    ').attr( - 'class', - 'pear', - ) as Cheerio; - - expect($el[0].attribs).toHaveProperty('class', 'pear'); - expect($el[1].attribs).toBeUndefined(); - expect($el[2].attribs).toHaveProperty('class', 'pear'); - }); - - it('(key, value) : should return an empty object for an empty object', () => { - const $src = $().attr('key', 'value'); - expect($src.length).toBe(0); - expect($src[0]).toBeUndefined(); - }); - - it('(map) : object map should set multiple attributes', () => { - $('.apple').attr({ - id: 'apple', - style: 'color:red;', - 'data-url': 'http://apple.com', - }); - const attrs = $('.apple').attr(); - expect(attrs).toHaveProperty('id', 'apple'); - expect(attrs).toHaveProperty('style', 'color:red;'); - expect(attrs).toHaveProperty('data-url', 'http://apple.com'); - }); - - it('(map, val) : should throw with wrong combination of arguments', () => { - expect(() => - $('.apple').attr( - { - id: 'apple', - style: 'color:red;', - 'data-url': 'http://apple.com', - } as never, - () => '', - ), - ).toThrow('Bad combination of arguments.'); - }); - - it('(key, function) : should call the function and update the attribute with the return value', () => { - const $fruits = $('#fruits'); - $fruits.attr('id', (index, value) => { - expect(index).toBe(0); - expect(value).toBe('fruits'); - return 'ninja'; - }); - const attrs = $fruits.attr(); - expect(attrs).toHaveProperty('id', 'ninja'); - }); - - it('(key, function) : should ignore text nodes', () => { - const $text = $(mixedText); - $text.attr('class', () => 'ninja'); - const className = $text.attr('class'); - expect(className).toBe('ninja'); - }); - - it('(key, value) : should correctly encode then decode unsafe values', () => { - const $apple = $('.apple'); - $apple.attr( - 'href', - 'http://github.com/">alert("XSS!")'); - }); - - it('(key, value) : should coerce values to a string', () => { - const $apple = $('.apple'); - $apple.attr('data-test', 1 as never); - expect($apple[0].attribs['data-test']).toBe('1'); - expect($apple.attr('data-test')).toBe('1'); - }); - - it('(key, value) : handle removed boolean attributes', () => { - const $apple = $('.apple'); - $apple.attr('autofocus', 'autofocus'); - expect($apple.attr('autofocus')).toBe('autofocus'); - $apple.removeAttr('autofocus'); - expect($apple.attr('autofocus')).toBeUndefined(); - }); - - it('(key, value) : should remove non-boolean attributes with names or values similar to boolean ones', () => { - const $apple = $('.apple'); - $apple.attr('data-autofocus', 'autofocus'); - expect($apple.attr('data-autofocus')).toBe('autofocus'); - $apple.removeAttr('data-autofocus'); - expect($apple.attr('data-autofocus')).toBeUndefined(); - }); - - it('(key, value) : should remove attributes when called with null value', () => { - const $pear = $('.pear').attr('autofocus', 'autofocus'); - expect($pear.attr('autofocus')).toBe('autofocus'); - $pear.attr('autofocus', null); - expect($pear.attr('autofocus')).toBeUndefined(); - }); - - it('(map) : should remove attributes with null values', () => { - const $pear = $('.pear').attr({ - autofocus: 'autofocus', - style: 'color:red', - }); - expect($pear.attr('autofocus')).toBe('autofocus'); - expect($pear.attr('style')).toBe('color:red'); - $pear.attr({ autofocus: null, style: 'color:blue' }); - expect($pear.attr('autofocus')).toBeUndefined(); - expect($pear.attr('style')).toBe('color:blue'); - }); - - it('(chaining) setting value and calling attr returns result', () => { - const pearAttr = $('.pear').attr('foo', 'bar').attr('foo'); - expect(pearAttr).toBe('bar'); - }); - - it('(chaining) setting attr to null returns a $', () => { - const $pear = $('.pear').attr('foo', null); - expect($pear).toBeInstanceOf($); - }); - - it('(chaining) setting attr to undefined returns a $', () => { - const $pear = $('.pear').attr('foo', undefined); - expect($('.pear')).toHaveLength(1); - expect($('.pear').attr('foo')).toBeUndefined(); - expect($pear).toBeInstanceOf($); - }); - - it("(bool) shouldn't treat boolean attributes differently in XML mode", () => { - const $xml = $.load(``, { - xml: true, - })('input'); - - expect($xml.attr('checked')).toBe('checked'); - expect($xml.attr('disabled')).toBe('yes'); - }); - }); - - describe('.prop', () => { - let $: CheerioAPI; - let checkbox: Cheerio; - - beforeEach(() => { - $ = load(inputs); - checkbox = $('input[name=checkbox_on]'); - }); - - it('(valid key) : valid prop should get value', () => { - expect(checkbox.prop('checked')).toBe(true); - checkbox.css('display', 'none'); - expect(checkbox.prop('style')).toHaveProperty('display', 'none'); - expect(checkbox.prop('style')).toHaveLength(1); - expect(checkbox.prop('style')).toContain('display'); - expect(checkbox.prop('tagName')).toBe('INPUT'); - expect(checkbox.prop('nodeName')).toBe('INPUT'); - }); - - it('(valid key) : should return on empty collection', () => { - expect($(undefined).prop('checked')).toBeUndefined(); - expect($(undefined).prop('style')).toBeUndefined(); - expect($(undefined).prop('tagName')).toBeUndefined(); - expect($(undefined).prop('nodeName')).toBeUndefined(); - }); - - it('(invalid key) : invalid prop should get undefined', () => { - expect(checkbox.prop('lol')).toBeUndefined(); - expect(checkbox.prop(4 as never)).toBeUndefined(); - expect(checkbox.prop(true as never)).toBeUndefined(); - }); - - it('(key, value) : should set prop', () => { - expect(checkbox.prop('checked')).toBe(true); - checkbox.prop('checked', false); - expect(checkbox.prop('checked')).toBe(false); - checkbox.prop('checked', true); - expect(checkbox.prop('checked')).toBe(true); - }); - - it('(key, value) : should update attribute', () => { - expect(checkbox.prop('checked')).toBe(true); - expect(checkbox.attr('checked')).toBe('checked'); - checkbox.prop('checked', false); - expect(checkbox.prop('checked')).toBe(false); - expect(checkbox.attr('checked')).toBeUndefined(); - checkbox.prop('checked', true); - expect(checkbox.prop('checked')).toBe(true); - expect(checkbox.attr('checked')).toBe('checked'); - }); - - it('(key, value) : should update namespace', () => { - const imgs = $('\n\n\n\n'); - const nsHtml = 'http://www.w3.org/1999/xhtml'; - imgs.prop('src', '#').prop('namespace', nsHtml); - expect(imgs.prop('namespace')).toBe(nsHtml); - imgs.prop('attribs', null); - expect(imgs.prop('src')).toBeUndefined(); - expect(imgs.prop('data-foo')).toBeUndefined(); - }); - - it('(key, value) : should ignore empty collection', () => { - expect($(undefined).prop('checked')).toBeUndefined(); - $(undefined).prop('checked', true); - expect($(undefined).prop('checked')).toBeUndefined(); - }); - - it('(map) : object map should set multiple props', () => { - checkbox.prop({ - id: 'check', - checked: false, - }); - expect(checkbox.prop('id')).toBe('check'); - expect(checkbox.prop('checked')).toBe(false); - }); - - it('(map, val) : should throw with wrong combination of arguments', () => { - expect(() => - $('.apple').prop( - { - id: 'check', - checked: false, - } as never, - () => '', - ), - ).toThrow('Bad combination of arguments.'); - }); - - it('(key, function) : should call the function and update the prop with the return value', () => { - checkbox.prop('checked', (index, value) => { - expect(index).toBe(0); - expect(value).toBe(true); - return false; - }); - expect(checkbox.prop('checked')).toBe(false); - }); - - it('(key, value) : should support chaining after setting props', () => { - expect(checkbox.prop('checked', false)).toBe(checkbox); - }); - - it('(invalid element/tag) : prop should return undefined', () => { - expect($(undefined).prop('prop')).toBeUndefined(); - expect($(null as never).prop('prop')).toBeUndefined(); - }); - - it('("href") : should resolve links with `baseURI`', () => { - const $ = load( - ` - example1 - example2 - example3 - example4 - `, - { baseURI: 'http://example.com/page/1' }, - ); - - expect($('#1').prop('href')).toBe('http://example.org/'); - expect($('#2').prop('href')).toBe('http://example.org/'); - expect($('#3').prop('href')).toBe('http://example.com/example.org'); - expect($('#4').prop('href')).toBe('http://example.com/page/example.org'); - - expect($(undefined).prop('href')).toBeUndefined(); - }); - - it('("src") : should resolve links with `baseURI`', () => { - const $ = load( - ` - - - - - `, - { baseURI: 'http://example.com/page/1' }, - ); - - expect($('#1').prop('src')).toBe('http://example.org/image.png'); - expect($('#2').prop('src')).toBe('http://example.org/page.html'); - expect($('#3').prop('src')).toBe( - 'http://example.com/example.org/song.mp3', - ); - expect($('#4').prop('src')).toBe( - 'http://example.com/page/example.org/image.png', - ); - - expect($(undefined).prop('src')).toBeUndefined(); - }); - - it('("outerHTML") : should render properly', () => { - const outerHtml = '
    '; - const $a = $(outerHtml); - - expect($a.prop('outerHTML')).toBe(outerHtml); - - expect($(undefined).prop('outerHTML')).toBeUndefined(); - }); - - it('("innerHTML") : should render properly', () => { - const $a = $('
    '); - - expect($a.prop('innerHTML')).toBe(''); - - expect($(undefined).prop('innerHTML')).toBeUndefined(); - }); - - it('("textContent") : should render properly', () => { - expect($('select').children().prop('textContent')).toBe( - 'Option not selected', - ); - - expect($(script).prop('textContent')).toBe('A var foo = "bar";B'); - - expect($(undefined).prop('textContent')).toBeUndefined(); - }); - - it('("textContent") : should include style and script tags', () => { - const $ = load( - 'Welcome
    Hello, testing text function,
    End of message', - ); - expect($('body').prop('textContent')).toBe( - 'Welcome Hello, testing text function,console.log("hello").cf-hidden { display: none; }End of message', - ); - expect($('style').prop('textContent')).toBe( - '.cf-hidden { display: none; }', - ); - expect($('script').prop('textContent')).toBe('console.log("hello")'); - }); - - it('("innerText") : should render properly', () => { - expect($('select').children().prop('innerText')).toBe( - 'Option not selected', - ); - - expect($(script).prop('innerText')).toBe('AB'); - - expect($(undefined).prop('innerText')).toBeUndefined(); - }); - - it('("innerText") : should omit style and script tags', () => { - const $ = load( - 'Welcome
    Hello, testing text function,
    End of message', - ); - expect($('body').prop('innerText')).toBe( - 'Welcome Hello, testing text function,End of message', - ); - expect($('style').prop('innerText')).toBe(''); - expect($('script').prop('innerText')).toBe(''); - }); - - it('(inherited properties) : prop should support inherited properties', () => { - expect($('select').prop('childNodes')).toBe($('select')[0].childNodes); - }); - - it('(key) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - expect($text($body[1]).prop('tagName')).toBeUndefined(); - - $body.prop('test-name', () => 'tester'); - expect($text('body').html()).toBe( - '1TEXT2', - ); - }); - - it("(bool) shouldn't treat boolean attributes differently in XML mode", () => { - const $xml = $.load(``, { - xml: true, - })('input'); - - expect($xml.prop('checked')).toBe('checked'); - expect($xml.prop('disabled')).toBe('yes'); - }); - }); - - describe('.data', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(chocolates); - }); - - it('() : should get all data attributes initially declared in the markup', () => { - const data = $('.linth').data(); - expect(data).toStrictEqual({ - highlight: 'Lindor', - origin: 'swiss', - }); - }); - - it('() : should get all data set via `data`', () => { - const $el = cheerio('
    '); - $el.data('a', 1); - $el.data('b', 2); - - expect($el.data()).toStrictEqual({ - a: 1, - b: 2, - }); - }); - - it('() : should get all data attributes initially declared in the markup merged with all data additionally set via `data`', () => { - const $el = cheerio('
    '); - $el.data('b', 'b-modified'); - $el.data('c', 'c'); - - expect($el.data()).toStrictEqual({ - a: 'a', - b: 'b-modified', - c: 'c', - }); - }); - - it('() : no data attribute should return an empty object', () => { - const data = $('.cailler').data(); - expect(Object.keys(data)).toHaveLength(0); - expect($('.free').data()).toBeUndefined(); - }); - - it('(invalid key) : invalid data attribute should return `undefined`', () => { - const data = $('.frey').data('lol'); - expect(data).toBeUndefined(); - }); - - it('(valid key) : valid data attribute should get value', () => { - const highlight = $('.linth').data('highlight'); - const origin = $('.linth').data('origin'); - - expect(highlight).toBe('Lindor'); - expect(origin).toBe('swiss'); - }); - - it('(key) : should translate camel-cased key values to hyphen-separated versions', () => { - const $el = cheerio( - '
    ', - ); - - expect($el.data('ThreeWordAttribute')).toBe('a'); - expect($el.data('fooBar_baz-')).toBe('b'); - }); - - it('(key) : should retrieve object values', () => { - const data = {}; - const $el = cheerio('
    '); - - $el.data('test', data); - - expect($el.data('test')).toBe(data); - }); - - it('(key) : should parse JSON data derived from the markup', () => { - const $el = cheerio('
    '); - - expect($el.data('json')).toStrictEqual([1, 2, 3]); - }); - - it('(key) : should not parse JSON data set via the `data` API', () => { - const $el = cheerio('
    '); - $el.data('json', '[1, 2, 3]'); - - expect($el.data('json')).toBe('[1, 2, 3]'); - }); - - // See https://api.jquery.com/data/ and https://bugs.jquery.com/ticket/14523 - it('(key) : should ignore the markup value after the first access', () => { - const $el = cheerio('
    '); - - expect($el.data('test')).toBe('a'); - - $el.attr('data-test', 'b'); - - expect($el.data('test')).toBe('a'); - }); - - it('(key) : should recover from malformed JSON', () => { - const $el = cheerio('
    '); - - expect($el.data('custom')).toBe('{{templatevar}}'); - }); - - it('("") : should accept the empty string as a name', () => { - const $el = cheerio('
    '); - - expect($el.data('')).toBe('a'); - }); - - it('(hyphen key) : data addribute with hyphen should be camelized ;-)', () => { - const data = $('.frey').data(); - expect(data).toStrictEqual({ - taste: 'sweet', - bestCollection: 'Mahony', - }); - }); - - it('(key, value) : should set data attribute', () => { - // Adding as object. - const a = $('.frey').data({ - balls: 'giandor', - }); - // Adding as string. - const b = $('.linth').data('snack', 'chocoletti'); - - expect(() => { - a.data(4 as never, 'throw'); - }).not.toThrow(); - expect(a.data('balls')).toStrictEqual('giandor'); - expect(b.data('snack')).toStrictEqual('chocoletti'); - }); - - it('(key, value) : should set data for all elements in the selection', () => { - $('li').data('foo', 'bar'); - - expect($('li').eq(0).data('foo')).toStrictEqual('bar'); - expect($('li').eq(1).data('foo')).toStrictEqual('bar'); - expect($('li').eq(2).data('foo')).toStrictEqual('bar'); - }); - - it('(map) : object map should set multiple data attributes', () => { - const { data } = $('.linth').data({ - id: 'Cailler', - flop: 'Pippilotti Rist', - top: 'Frigor', - url: 'http://www.cailler.ch/', - })[0] as never; - - expect(data).toHaveProperty('id', 'Cailler'); - expect(data).toHaveProperty('flop', 'Pippilotti Rist'); - expect(data).toHaveProperty('top', 'Frigor'); - expect(data).toHaveProperty('url', 'http://www.cailler.ch/'); - }); - - describe('(attr) : data-* attribute type coercion :', () => { - it('boolean', () => { - const $el = cheerio('
    '); - expect($el.data('bool')).toBe(true); - }); - - it('number', () => { - const $el = cheerio('
    '); - expect($el.data('number')).toBe(23); - }); - - it('number (scientific notation is not coerced)', () => { - const $el = cheerio('
    '); - expect($el.data('sci')).toBe('1E10'); - }); - - it('null', () => { - const $el = cheerio('
    '); - expect($el.data('null')).toBe(null); - }); - - it('object', () => { - const $el = cheerio('
    '); - expect($el.data('obj')).toStrictEqual({ a: 45 }); - }); - - it('array', () => { - const $el = cheerio('
    '); - expect($el.data('array')).toStrictEqual([1, 2, 3]); - }); - }); - - it('(key, value) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - $body.data('snack', 'chocoletti'); - - expect($text('b').data('snack')).toBe('chocoletti'); - }); - }); - - describe('.val', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(inputs); - }); - - it('(): on div should get undefined', () => { - expect($('
    ').val()).toBeUndefined(); - }); - - it('(): on select should get value', () => { - const val = $('select#one').val(); - expect(val).toBe('option_selected'); - }); - it('(): on select with no value should get text', () => { - const val = $('select#one-valueless').val(); - expect(val).toBe('Option selected'); - }); - it('(): on select with no value should get converted HTML', () => { - const val = $('select#one-html-entity').val(); - expect(val).toBe('Option '); - }); - it('(): on select with no value should get text content', () => { - const val = $('select#one-nested').val(); - expect(val).toBe('Option selected'); - }); - it('(): on option should get value', () => { - const val = $('select#one option').eq(0).val(); - expect(val).toBe('option_not_selected'); - }); - it('(): on text input should get value', () => { - const val = $('input[type="text"]').val(); - expect(val).toBe('input_text'); - }); - it('(): on checked checkbox should get value', () => { - const val = $('input[name="checkbox_on"]').val(); - expect(val).toBe('on'); - }); - it('(): on unchecked checkbox should get value', () => { - const val = $('input[name="checkbox_off"]').val(); - expect(val).toBe('off'); - }); - it('(): on valueless checkbox should get value', () => { - const val = $('input[name="checkbox_valueless"]').val(); - expect(val).toBe('on'); - }); - it('(): on radio should get value', () => { - const val = $('input[type="radio"]').val(); - expect(val).toBe('off'); - }); - it('(): on valueless radio should get value', () => { - const val = $('input[name="radio_valueless"]').val(); - expect(val).toBe('on'); - }); - it('(): on multiple select should get an array of values', () => { - const val = $('select#multi').val(); - expect(val).toStrictEqual(['2', '3']); - }); - it('(): on multiple select with no value attribute should get an array of text content', () => { - const val = $('select#multi-valueless').val(); - expect(val).toStrictEqual(['2', '3']); - }); - it('(): with no selector matches should return nothing', () => { - const val = $('.nasty').val(); - expect(val).toBeUndefined(); - }); - it('(invalid value): should only handle arrays when it has the attribute multiple', () => { - const val = $('select#one').val([]); - expect(val).not.toBeUndefined(); - }); - it('(value): on empty set should get `this`', () => { - const $empty = $([]); - expect($empty.val('test')).toBe($empty); - }); - it('(value): on input text should set value', () => { - const element = $('input[type="text"]').val('test'); - expect(element.val()).toBe('test'); - }); - it('(value): on select should set value', () => { - const element = $('select#one').val('option_not_selected'); - expect(element.val()).toBe('option_not_selected'); - }); - it('(value): on option should set value', () => { - const element = $('select#one option').eq(0).val('option_changed'); - expect(element.val()).toBe('option_changed'); - }); - it('(value): on radio should set value', () => { - const element = $('input[name="radio"]').val('off'); - expect(element.val()).toBe('off'); - }); - it('(value): on radio with special characters should set value', () => { - const element = $('input[name="radio[brackets]"]').val('off'); - expect(element.val()).toBe('off'); - }); - it('(values): on multiple select should set multiple values', () => { - const element = $('select#multi').val(['1', '3', '4']); - expect(element.val()).toHaveLength(3); - }); - }); - - describe('.removeAttr', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('(key) : should remove a single attr', () => { - const $fruits = $('#fruits'); - expect($fruits.attr('id')).not.toBeUndefined(); - $fruits.removeAttr('id'); - expect($fruits.attr('id')).toBeUndefined(); - }); - - it('(key key) : should remove multiple attrs', () => { - const $apple = $('.apple'); - $apple.attr('id', 'favorite'); - $apple.attr('size', 'small'); - - expect($apple.attr('id')).toBe('favorite'); - expect($apple.attr('class')).toBe('apple'); - expect($apple.attr('size')).toBe('small'); - $apple.removeAttr('id class'); - expect($apple.attr('id')).toBeUndefined(); - expect($apple.attr('class')).toBeUndefined(); - expect($apple.attr('size')).toBe('small'); - }); - - it('(key) : should return cheerio object', () => { - const obj = $('ul').removeAttr('id'); - expect(obj).toBeInstanceOf($); - }); - - it('(key) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - $body.addClass(() => 'test'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - - $body.removeAttr('class'); - - expect($text('body').html()).toBe(mixedText); - }); - }); - - describe('.hasClass', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('(valid class) : should return true', () => { - const cls = $('.apple').hasClass('apple'); - expect(cls).toBe(true); - - expect(withClass('foo').hasClass('foo')).toBe(true); - expect(withClass('foo bar').hasClass('foo')).toBe(true); - expect(withClass('bar foo').hasClass('foo')).toBe(true); - expect(withClass('bar foo bar').hasClass('foo')).toBe(true); - }); - - it('(invalid class) : should return false', () => { - const cls = $('#fruits').hasClass('fruits'); - expect(cls).toBe(false); - expect(withClass('foo-bar').hasClass('foo')).toBe(false); - expect(withClass('foo-bar').hasClass('foo')).toBe(false); - expect(withClass('foo-bar').hasClass('foo-ba')).toBe(false); - }); - - it('should check multiple classes', () => { - // Add a class - $('.apple').addClass('red'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('red')).toBe(true); - - // Remove one and test again - $('.apple').removeClass('apple'); - expect($('li').eq(0).hasClass('apple')).toBe(false); - }); - - it('(empty string argument) : should return false', () => { - expect(withClass('foo').hasClass('')).toBe(false); - expect(withClass('foo bar').hasClass('')).toBe(false); - expect(withClass('foo bar').removeClass('foo').hasClass('')).toBe(false); - }); - }); - - describe('.addClass', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('(first class) : should add the class to the element', () => { - const $fruits = $('#fruits'); - $fruits.addClass('fruits'); - const cls = $fruits.hasClass('fruits'); - expect(cls).toBe(true); - }); - - it('(single class) : should add the class to the element', () => { - $('.apple').addClass('fruit'); - const cls = $('.apple').hasClass('fruit'); - expect(cls).toBe(true); - }); - - it('(class): adds classes to many selected items', () => { - $('li').addClass('fruit'); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.orange').hasClass('fruit')).toBe(true); - expect($('.pear').hasClass('fruit')).toBe(true); - - // Mixed with text nodes - const $red = $('\n
      \n
    \t').addClass('red'); - expect($red).toHaveLength(3); - expect($red[0].type).toBe('text'); - expect($red[1].type).toBe('tag'); - expect($red[2].type).toBe('text'); - expect($red.hasClass('red')).toBe(true); - }); - - it('(class class class) : should add multiple classes to the element', () => { - $('.apple').addClass('fruit red tasty'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('red')).toBe(true); - expect($('.apple').hasClass('tasty')).toBe(true); - }); - - it('(fn) : should add classes returned from the function', () => { - const $fruits = $('#fruits').children().add($('#fruits')); - const args: [i: number, className: string][] = []; - const thisVals: Element[] = []; - const toAdd = ['main', 'apple red', '', undefined]; - - $fruits.addClass(function (...myArgs) { - args.push(myArgs); - thisVals.push(this); - return toAdd[myArgs[0]]; - }); - - expect(args).toStrictEqual([ - [0, ''], - [1, 'apple'], - [2, 'orange'], - [3, 'pear'], - ]); - expect(thisVals).toStrictEqual([ - $fruits[0], - $fruits[1], - $fruits[2], - $fruits[3], - ]); - expect($fruits.eq(0).hasClass('main')).toBe(true); - expect($fruits.eq(0).hasClass('apple')).toBe(false); - expect($fruits.eq(1).hasClass('apple')).toBe(true); - expect($fruits.eq(1).hasClass('red')).toBe(true); - expect($fruits.eq(2).hasClass('orange')).toBe(true); - expect($fruits.eq(3).hasClass('pear')).toBe(true); - }); - }); - - describe('.removeClass', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('() : should remove all the classes', () => { - $('.pear').addClass('fruit'); - $('.pear').removeClass(); - expect($('.pear').attr('class')).toBeUndefined(); - }); - - it('("") : should not modify class list', () => { - const $fruits = $('#fruits'); - $fruits.children().removeClass(''); - expect($('.apple')).toHaveLength(1); - }); - - it('(invalid class) : should not remove anything', () => { - $('.pear').removeClass('fruit'); - expect($('.pear').hasClass('pear')).toBe(true); - }); - - it('(no class attribute) : should not throw an exception', () => { - const $vegetables = cheerio(vegetables); - - expect(() => { - $('li', $vegetables).removeClass('vegetable'); - }).not.toThrow(); - }); - - it('(single class) : should remove a single class from the element', () => { - $('.pear').addClass('fruit'); - expect($('.pear').hasClass('fruit')).toBe(true); - $('.pear').removeClass('fruit'); - expect($('.pear').hasClass('fruit')).toBe(false); - expect($('.pear').hasClass('pear')).toBe(true); - - // Remove one class from set - const $li = $('li').removeClass('orange'); - expect($li.eq(0).attr('class')).toBe('apple'); - expect($li.eq(1).attr('class')).toBe(''); - expect($li.eq(2).attr('class')).toBe('pear'); - - // Mixed with text nodes - const $red = $('\n
      \n
    \t').removeClass( - 'one', - ); - expect($red).toHaveLength(3); - expect($red[0].type).toBe('text'); - expect($red[1].type).toBe('tag'); - expect($red[2].type).toBe('text'); - expect($red.eq(1).attr('class')).toBe(''); - expect($red.eq(1).prop('tagName')).toBe('UL'); - }); - - it('(single class) : should remove a single class from multiple classes on the element', () => { - $('.pear').addClass('fruit green tasty'); - expect($('.pear').hasClass('fruit')).toBe(true); - expect($('.pear').hasClass('green')).toBe(true); - expect($('.pear').hasClass('tasty')).toBe(true); - - $('.pear').removeClass('green'); - expect($('.pear').hasClass('fruit')).toBe(true); - expect($('.pear').hasClass('green')).toBe(false); - expect($('.pear').hasClass('tasty')).toBe(true); - }); - - it('(class class class) : should remove multiple classes from the element', () => { - $('.apple').addClass('fruit red tasty'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('red')).toBe(true); - expect($('.apple').hasClass('tasty')).toBe(true); - - $('.apple').removeClass('apple red tasty'); - expect($('.fruit').hasClass('apple')).toBe(false); - expect($('.fruit').hasClass('red')).toBe(false); - expect($('.fruit').hasClass('tasty')).toBe(false); - expect($('.fruit').hasClass('fruit')).toBe(true); - }); - - it('(class) : should remove all occurrences of a class name', () => { - const $div = cheerio('
    '); - expect($div.removeClass('x').hasClass('x')).toBe(false); - }); - - it('(fn) : should remove classes returned from the function', () => { - const $fruits = $('#fruits').children(); - const args: [number, string][] = []; - const thisVals: Element[] = []; - const toAdd = ['apple red', '', undefined]; - - $fruits.removeClass(function (...myArgs) { - args.push(myArgs); - thisVals.push(this); - return toAdd[myArgs[0]]; - }); - - expect(args).toStrictEqual([ - [0, 'apple'], - [1, 'orange'], - [2, 'pear'], - ]); - expect(thisVals).toStrictEqual([$fruits[0], $fruits[1], $fruits[2]]); - expect($fruits.eq(0).hasClass('apple')).toBe(false); - expect($fruits.eq(0).hasClass('red')).toBe(false); - expect($fruits.eq(1).hasClass('orange')).toBe(true); - expect($fruits.eq(2).hasClass('pear')).toBe(true); - }); - - it('(fn) : should no op elements without attributes', () => { - const $inputs = $(inputs); - const val = $inputs.removeClass(() => 'tasty'); - expect(val).toHaveLength(15); - }); - - it('(fn) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - $body.addClass(() => 'test'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - - $body.removeClass(() => 'test'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - }); - }); - - describe('.toggleClass', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = load(fruits); - }); - - it('(class class) : should toggle multiple classes from the element', () => { - $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('red')).toBe(false); - - $('.apple').toggleClass('apple red'); - expect($('.fruit').hasClass('apple')).toBe(false); - expect($('.fruit').hasClass('red')).toBe(true); - expect($('.fruit').hasClass('fruit')).toBe(true); - - // Mixed with text nodes - const $red = $('\n
      \n
    \t').toggleClass( - 'red', - ); - expect($red).toHaveLength(3); - expect($red.hasClass('red')).toBe(true); - expect($red.hasClass('one')).toBe(true); - $red.toggleClass('one'); - expect($red.hasClass('red')).toBe(true); - expect($red.hasClass('one')).toBe(false); - }); - - it('(class class, true) : should add multiple classes to the element', () => { - $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('red')).toBe(false); - - $('.apple').toggleClass('apple red', true); - expect($('.fruit').hasClass('apple')).toBe(true); - expect($('.fruit').hasClass('red')).toBe(true); - expect($('.fruit').hasClass('fruit')).toBe(true); - }); - - it('(class true) : should add only one instance of class', () => { - $('.apple').toggleClass('tasty', true); - $('.apple').toggleClass('tasty', true); - expect($('.apple').attr('class')).toMatch(/tasty/g); - }); - - it('(class class, false) : should remove multiple classes from the element', () => { - $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBe(true); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('red')).toBe(false); - - $('.apple').toggleClass('apple red', false); - expect($('.fruit').hasClass('apple')).toBe(false); - expect($('.fruit').hasClass('red')).toBe(false); - expect($('.fruit').hasClass('fruit')).toBe(true); - }); - - it('(fn) : should toggle classes returned from the function', () => { - const $ = load(food); - - $('.apple').addClass('fruit'); - $('.carrot').addClass('vegetable'); - expect($('.apple').hasClass('fruit')).toBe(true); - expect($('.apple').hasClass('vegetable')).toBe(false); - expect($('.orange').hasClass('fruit')).toBe(false); - expect($('.orange').hasClass('vegetable')).toBe(false); - expect($('.carrot').hasClass('fruit')).toBe(false); - expect($('.carrot').hasClass('vegetable')).toBe(true); - expect($('.sweetcorn').hasClass('fruit')).toBe(false); - expect($('.sweetcorn').hasClass('vegetable')).toBe(false); - - $('li').toggleClass(function () { - return $(this).parent().is('#fruits') ? 'fruit' : 'vegetable'; - }); - expect($('.apple').hasClass('fruit')).toBe(false); - expect($('.apple').hasClass('vegetable')).toBe(false); - expect($('.orange').hasClass('fruit')).toBe(true); - expect($('.orange').hasClass('vegetable')).toBe(false); - expect($('.carrot').hasClass('fruit')).toBe(false); - expect($('.carrot').hasClass('vegetable')).toBe(false); - expect($('.sweetcorn').hasClass('fruit')).toBe(false); - expect($('.sweetcorn').hasClass('vegetable')).toBe(true); - }); - - it('(fn) : should work with no initial class attribute', () => { - const $inputs = load(inputs); - $inputs('input, select').toggleClass(function () { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- `get` should never return undefined here. - return $inputs(this).get(0)!.tagName === 'select' - ? 'selectable' - : 'inputable'; - }); - expect($inputs('.selectable')).toHaveLength(6); - expect($inputs('.inputable')).toHaveLength(9); - }); - - it('(fn) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - $body.toggleClass(() => 'test'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - - $body.toggleClass(() => 'test'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - }); - - it('(invalid) : should be a no-op for invalid inputs', () => { - const original = $('.apple'); - const testAgainst = original.attr('class'); - expect(original.toggleClass().attr('class')).toStrictEqual(testAgainst); - - for (const value of [undefined, true, false, null, 0, 1, {}]) { - expect( - original.toggleClass(value as never).attr('class'), - ).toStrictEqual(testAgainst); - } - }); - }); -}); diff --git a/node_modules/cheerio/src/api/attributes.ts b/node_modules/cheerio/src/api/attributes.ts deleted file mode 100644 index db246e6..0000000 --- a/node_modules/cheerio/src/api/attributes.ts +++ /dev/null @@ -1,1130 +0,0 @@ -/** - * Methods for getting and modifying attributes. - * - * @module cheerio/attributes - */ - -import { text } from '../static.js'; -import { domEach, camelCase, cssCase } from '../utils.js'; -import { isTag, type AnyNode, type Element } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -import { innerText, textContent } from 'domutils'; -const hasOwn = Object.prototype.hasOwnProperty; -const rspace = /\s+/; -const dataAttrPrefix = 'data-'; - -// Attributes that are booleans -const rboolean = - /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i; -// Matches strings that look like JSON objects or arrays -const rbrace = /^{[^]*}$|^\[[^]*]$/; - -/** - * Gets a node's attribute. For boolean attributes, it will return the value's - * name should it be set. - * - * Also supports getting the `value` of several form elements. - * - * @private - * @category Attributes - * @param elem - Element to get the attribute of. - * @param name - Name of the attribute. - * @param xmlMode - Disable handling of special HTML attributes. - * @returns The attribute's value. - */ -function getAttr( - elem: AnyNode, - name: undefined, - xmlMode?: boolean, -): Record | undefined; -function getAttr( - elem: AnyNode, - name: string, - xmlMode?: boolean, -): string | undefined; -function getAttr( - elem: AnyNode, - name: string | undefined, - xmlMode?: boolean, -): Record | string | undefined { - if (!elem || !isTag(elem)) return undefined; - - elem.attribs ??= {}; - - // Return the entire attribs object if no attribute specified - if (!name) { - return elem.attribs; - } - - if (hasOwn.call(elem.attribs, name)) { - // Get the (decoded) attribute - return !xmlMode && rboolean.test(name) ? name : elem.attribs[name]; - } - - // Mimic the DOM and return text content as value for `option's` - if (elem.name === 'option' && name === 'value') { - return text(elem.children); - } - - // Mimic DOM with default value for radios/checkboxes - if ( - elem.name === 'input' && - (elem.attribs['type'] === 'radio' || elem.attribs['type'] === 'checkbox') && - name === 'value' - ) { - return 'on'; - } - - return undefined; -} - -/** - * Sets the value of an attribute. The attribute will be deleted if the value is - * `null`. - * - * @private - * @param el - The element to set the attribute on. - * @param name - The attribute's name. - * @param value - The attribute's value. - */ -function setAttr(el: Element, name: string, value: string | null) { - if (value === null) { - removeAttribute(el, name); - } else { - el.attribs[name] = `${value}`; - } -} - -/** - * Method for getting attributes. Gets the attribute value for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('ul').attr('id'); - * //=> fruits - * ``` - * - * @param name - Name of the attribute. - * @returns The attribute's value. - * @see {@link https://api.jquery.com/attr/} - */ -export function attr( - this: Cheerio, - name: string, -): string | undefined; -/** - * Method for getting all attributes and their values of the first element in - * the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('ul').attr(); - * //=> { id: 'fruits' } - * ``` - * - * @returns The attribute's values. - * @see {@link https://api.jquery.com/attr/} - */ -export function attr( - this: Cheerio, -): Record | undefined; -/** - * Method for setting attributes. Sets the attribute value for only the first - * element in the matched set. If you set an attribute's value to `null`, you - * remove that attribute. You may also pass a `map` and `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.apple').attr('id', 'favorite').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @param value - The new value of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/attr/} - */ -export function attr( - this: Cheerio, - name: string, - value?: - | string - | null - | ((this: Element, i: number, attrib: string) => string | null), -): Cheerio; -/** - * Method for setting multiple attributes at once. Sets the attribute value for - * only the first element in the matched set. If you set an attribute's value to - * `null`, you remove that attribute. - * - * @category Attributes - * @example - * - * ```js - * $('.apple').attr({ id: 'favorite' }).html(); - * //=>
  • Apple
  • - * ``` - * - * @param values - Map of attribute names and values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/attr/} - */ -export function attr( - this: Cheerio, - values: Record, -): Cheerio; -export function attr( - this: Cheerio, - name?: string | Record, - value?: - | string - | null - | ((this: Element, i: number, attrib: string) => string | null), -): string | Cheerio | undefined | Record { - // Set the value (with attr map support) - if (typeof name === 'object' || value !== undefined) { - if (typeof value === 'function') { - if (typeof name !== 'string') { - { - throw new Error('Bad combination of arguments.'); - } - } - return domEach(this, (el, i) => { - if (isTag(el)) setAttr(el, name, value.call(el, i, el.attribs[name])); - }); - } - return domEach(this, (el) => { - if (!isTag(el)) return; - - if (typeof name === 'object') { - for (const objName of Object.keys(name)) { - const objValue = name[objName]; - setAttr(el, objName, objValue); - } - } else { - setAttr(el, name as string, value as string); - } - }); - } - - return arguments.length > 1 - ? this - : getAttr(this[0], name as string, this.options.xmlMode); -} - -/** - * Gets a node's prop. - * - * @private - * @category Attributes - * @param el - Element to get the prop of. - * @param name - Name of the prop. - * @param xmlMode - Disable handling of special HTML attributes. - * @returns The prop's value. - */ -function getProp( - el: Element, - name: string, - xmlMode?: boolean, -): string | undefined | Element[keyof Element] { - return name in el - ? // @ts-expect-error TS doesn't like us accessing the value directly here. - el[name] - : !xmlMode && rboolean.test(name) - ? getAttr(el, name, false) !== undefined - : getAttr(el, name, xmlMode); -} - -/** - * Sets the value of a prop. - * - * @private - * @param el - The element to set the prop on. - * @param name - The prop's name. - * @param value - The prop's value. - * @param xmlMode - Disable handling of special HTML attributes. - */ -function setProp(el: Element, name: string, value: unknown, xmlMode?: boolean) { - if (name in el) { - // @ts-expect-error Overriding value - el[name] = value; - } else { - setAttr( - el, - name, - !xmlMode && rboolean.test(name) ? (value ? '' : null) : `${value}`, - ); - } -} - -interface StyleProp { - length: number; - [key: string]: string | number; - [index: number]: string; -} - -/** - * Method for getting and setting properties. Gets the property value for only - * the first element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="checkbox"]').prop('checked'); - * //=> false - * - * $('input[type="checkbox"]').prop('checked', true).val(); - * //=> ok - * ``` - * - * @param name - Name of the property. - * @returns If `value` is specified the instance itself, otherwise the prop's - * value. - * @see {@link https://api.jquery.com/prop/} - */ -export function prop( - this: Cheerio, - name: 'tagName' | 'nodeName', -): string | undefined; -export function prop( - this: Cheerio, - name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent', -): string | null; -/** - * Get a parsed CSS style object. - * - * @param name - Name of the property. - * @returns The style object, or `undefined` if the element has no `style` - * attribute. - */ -export function prop( - this: Cheerio, - name: 'style', -): StyleProp | undefined; -/** - * Resolve `href` or `src` of supported elements. Requires the `baseURI` option - * to be set, and a global `URL` object to be part of the environment. - * - * @example With `baseURI` set to `'https://example.com'`: - * - * ```js - * $('').prop('src'); - * //=> 'https://example.com/image.png' - * ``` - * - * @param name - Name of the property. - * @returns The resolved URL, or `undefined` if the element is not supported. - */ -export function prop( - this: Cheerio, - name: 'href' | 'src', -): string | undefined; -/** - * Get a property of an element. - * - * @param name - Name of the property. - * @returns The property's value. - */ -export function prop( - this: Cheerio, - name: K, -): Element[K]; -/** - * Set a property of an element. - * - * @param name - Name of the property. - * @param value - Value to set the property to. - * @returns The instance itself. - */ -export function prop( - this: Cheerio, - name: K, - value: - | Element[K] - | ((this: Element, i: number, prop: K) => Element[keyof Element]), -): Cheerio; -/** - * Set multiple properties of an element. - * - * @example - * - * ```js - * $('input[type="checkbox"]').prop({ - * checked: true, - * disabled: false, - * }); - * ``` - * - * @param map - Object of properties to set. - * @returns The instance itself. - */ -export function prop( - this: Cheerio, - map: Record, -): Cheerio; -/** - * Set a property of an element. - * - * @param name - Name of the property. - * @param value - Value to set the property to. - * @returns The instance itself. - */ -export function prop( - this: Cheerio, - name: string, - value: - | string - | boolean - | null - | ((this: Element, i: number, prop: string) => string | boolean), -): Cheerio; -/** - * Get a property of an element. - * - * @param name - The property's name. - * @returns The property's value. - */ -export function prop(this: Cheerio, name: string): string; -export function prop( - this: Cheerio, - name: string | Record, - value?: - | (( - this: Element, - i: number, - prop: string | undefined, - ) => string | Element[keyof Element] | boolean) - | unknown, -): Cheerio | string | undefined | null | Element[keyof Element] | StyleProp { - if (typeof name === 'string' && value === undefined) { - const el = this[0]; - - if (!el || !isTag(el)) return undefined; - - switch (name) { - case 'style': { - const property = this.css() as StyleProp; - const keys = Object.keys(property); - for (let i = 0; i < keys.length; i++) { - property[i] = keys[i]; - } - - property.length = keys.length; - - return property; - } - case 'tagName': - case 'nodeName': { - return el.name.toUpperCase(); - } - - case 'href': - case 'src': { - const prop = el.attribs?.[name]; - - if ( - typeof URL !== 'undefined' && - ((name === 'href' && (el.tagName === 'a' || el.tagName === 'link')) || - (name === 'src' && - (el.tagName === 'img' || - el.tagName === 'iframe' || - el.tagName === 'audio' || - el.tagName === 'video' || - el.tagName === 'source'))) && - prop !== undefined && - this.options.baseURI - ) { - return new URL(prop, this.options.baseURI).href; - } - - return prop; - } - - case 'innerText': { - return innerText(el); - } - - case 'textContent': { - return textContent(el); - } - - case 'outerHTML': { - return this.clone().wrap('').parent().html(); - } - - case 'innerHTML': { - return this.html(); - } - - default: { - return getProp(el, name, this.options.xmlMode); - } - } - } - - if (typeof name === 'object' || value !== undefined) { - if (typeof value === 'function') { - if (typeof name === 'object') { - throw new TypeError('Bad combination of arguments.'); - } - return domEach(this, (el, i) => { - if (isTag(el)) { - setProp( - el, - name, - value.call(el, i, getProp(el, name, this.options.xmlMode)), - this.options.xmlMode, - ); - } - }); - } - - return domEach(this, (el) => { - if (!isTag(el)) return; - - if (typeof name === 'object') { - for (const key of Object.keys(name)) { - const val = name[key]; - setProp(el, key, val, this.options.xmlMode); - } - } else { - setProp(el, name, value, this.options.xmlMode); - } - }); - } - - return undefined; -} - -/** - * An element with a data attribute. - * - * @private - */ -interface DataElement extends Element { - /** The data attribute. */ - data?: Record; -} - -/** - * Sets the value of a data attribute. - * - * @private - * @param elem - The element to set the data attribute on. - * @param name - The data attribute's name. - * @param value - The data attribute's value. - */ -function setData( - elem: DataElement, - name: string | Record, - value?: unknown, -) { - elem.data ??= {}; - - if (typeof name === 'object') Object.assign(elem.data, name); - else if (typeof name === 'string' && value !== undefined) { - elem.data[name] = value; - } -} - -/** - * Read _all_ HTML5 `data-*` attributes from the equivalent HTML5 `data-*` - * attribute, and cache the value in the node's internal data store. - * - * @private - * @category Attributes - * @param el - Element to get the data attribute of. - * @returns A map with all of the data attributes. - */ -function readAllData(el: DataElement): unknown { - for (const domName of Object.keys(el.attribs)) { - if (!domName.startsWith(dataAttrPrefix)) { - continue; - } - - const jsName = camelCase(domName.slice(dataAttrPrefix.length)); - - if (!hasOwn.call(el.data, jsName)) { - el.data![jsName] = parseDataValue(el.attribs[domName]); - } - } - - return el.data; -} - -/** - * Read the specified attribute from the equivalent HTML5 `data-*` attribute, - * and (if present) cache the value in the node's internal data store. - * - * @private - * @category Attributes - * @param el - Element to get the data attribute of. - * @param name - Name of the data attribute. - * @returns The data attribute's value. - */ -function readData(el: DataElement, name: string): unknown { - const domName = dataAttrPrefix + cssCase(name); - const data = el.data!; - - if (hasOwn.call(data, name)) { - return data[name]; - } - - if (hasOwn.call(el.attribs, domName)) { - return (data[name] = parseDataValue(el.attribs[domName])); - } - - return undefined; -} - -/** - * Coerce string data-* attributes to their corresponding JavaScript primitives. - * - * @private - * @category Attributes - * @param value - The value to parse. - * @returns The parsed value. - */ -function parseDataValue(value: string): unknown { - if (value === 'null') return null; - if (value === 'true') return true; - if (value === 'false') return false; - const num = Number(value); - if (value === String(num)) return num; - if (rbrace.test(value)) { - try { - return JSON.parse(value); - } catch { - /* Ignore */ - } - } - return value; -} - -/** - * Method for getting data attributes, for only the first element in the matched - * set. - * - * @category Attributes - * @example - * - * ```js - * $('
    ').data('apple-color'); - * //=> 'red' - * ``` - * - * @param name - Name of the data attribute. - * @returns The data attribute's value, or `undefined` if the attribute does not - * exist. - * @see {@link https://api.jquery.com/data/} - */ -export function data( - this: Cheerio, - name: string, -): unknown | undefined; -/** - * Method for getting all of an element's data attributes, for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('
    ').data(); - * //=> { appleColor: 'red' } - * ``` - * - * @returns A map with all of the data attributes. - * @see {@link https://api.jquery.com/data/} - */ -export function data( - this: Cheerio, -): Record; -/** - * Method for setting data attributes, for only the first element in the matched - * set. - * - * @category Attributes - * @example - * - * ```js - * const apple = $('.apple').data('kind', 'mac'); - * - * apple.data('kind'); - * //=> 'mac' - * ``` - * - * @param name - Name of the data attribute. - * @param value - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/data/} - */ -export function data( - this: Cheerio, - name: string, - value: unknown, -): Cheerio; -/** - * Method for setting multiple data attributes at once, for only the first - * element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * const apple = $('.apple').data({ kind: 'mac' }); - * - * apple.data('kind'); - * //=> 'mac' - * ``` - * - * @param values - Map of names to values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/data/} - */ -export function data( - this: Cheerio, - values: Record, -): Cheerio; -export function data( - this: Cheerio, - name?: string | Record, - value?: unknown, -): unknown | Cheerio | undefined | Record { - const elem = this[0]; - - if (!elem || !isTag(elem)) return; - - const dataEl: DataElement = elem; - dataEl.data ??= {}; - - // Return the entire data object if no data specified - if (name == null) { - return readAllData(dataEl); - } - - // Set the value (with attr map support) - if (typeof name === 'object' || value !== undefined) { - domEach(this, (el) => { - if (isTag(el)) { - if (typeof name === 'object') setData(el, name); - else setData(el, name, value as unknown); - } - }); - return this; - } - - return readData(dataEl, name); -} - -/** - * Method for getting the value of input, select, and textarea. Note: Support - * for `map`, and `function` has not been added yet. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="text"]').val(); - * //=> input_text - * ``` - * - * @returns The value. - * @see {@link https://api.jquery.com/val/} - */ -export function val( - this: Cheerio, -): string | undefined | string[]; -/** - * Method for setting the value of input, select, and textarea. Note: Support - * for `map`, and `function` has not been added yet. - * - * @category Attributes - * @example - * - * ```js - * $('input[type="text"]').val('test').html(); - * //=> - * ``` - * - * @param value - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/val/} - */ -export function val( - this: Cheerio, - value: string | string[], -): Cheerio; -export function val( - this: Cheerio, - value?: string | string[], -): string | string[] | Cheerio | undefined { - const querying = arguments.length === 0; - const element = this[0]; - - if (!element || !isTag(element)) return querying ? undefined : this; - - switch (element.name) { - case 'textarea': { - return this.text(value as string); - } - case 'select': { - const option = this.find('option:selected'); - if (!querying) { - if (this.attr('multiple') == null && typeof value === 'object') { - return this; - } - - this.find('option').removeAttr('selected'); - - const values = typeof value === 'object' ? value : [value]; - for (const val of values) { - this.find(`option[value="${val}"]`).attr('selected', ''); - } - - return this; - } - - return this.attr('multiple') - ? option.toArray().map((el) => text(el.children)) - : option.attr('value'); - } - case 'input': - case 'option': { - return querying - ? this.attr('value') - : this.attr('value', value as string); - } - } - - return undefined; -} - -/** - * Remove an attribute. - * - * @private - * @param elem - Node to remove attribute from. - * @param name - Name of the attribute to remove. - */ -function removeAttribute(elem: Element, name: string) { - if (!elem.attribs || !hasOwn.call(elem.attribs, name)) return; - - delete elem.attribs[name]; -} - -/** - * Splits a space-separated list of names to individual names. - * - * @category Attributes - * @param names - Names to split. - * @returns - Split names. - */ -function splitNames(names?: string): string[] { - return names ? names.trim().split(rspace) : []; -} - -/** - * Method for removing attributes by `name`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeAttr('class').html(); - * //=>
  • Pear
  • - * - * $('.apple').attr('id', 'favorite'); - * $('.apple').removeAttr('id class').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeAttr/} - */ -export function removeAttr( - this: Cheerio, - name: string, -): Cheerio { - const attrNames = splitNames(name); - - for (const attrName of attrNames) { - domEach(this, (elem) => { - if (isTag(elem)) removeAttribute(elem, attrName); - }); - } - - return this; -} - -/** - * Check to see if _any_ of the matched elements have the given `className`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').hasClass('pear'); - * //=> true - * - * $('apple').hasClass('fruit'); - * //=> false - * - * $('li').hasClass('pear'); - * //=> true - * ``` - * - * @param className - Name of the class. - * @returns Indicates if an element has the given `className`. - * @see {@link https://api.jquery.com/hasClass/} - */ -export function hasClass( - this: Cheerio, - className: string, -): boolean { - return this.toArray().some((elem) => { - const clazz = isTag(elem) && elem.attribs['class']; - let idx = -1; - - if (clazz && className.length > 0) { - while ((idx = clazz.indexOf(className, idx + 1)) > -1) { - const end = idx + className.length; - - if ( - (idx === 0 || rspace.test(clazz[idx - 1])) && - (end === clazz.length || rspace.test(clazz[end])) - ) { - return true; - } - } - } - - return false; - }); -} - -/** - * Adds class(es) to all of the matched elements. Also accepts a `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').addClass('fruit').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('fruit red').html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of new class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/addClass/} - */ -export function addClass>( - this: R, - value?: - | string - | ((this: Element, i: number, className: string) => string | undefined), -): R { - // Support functions - if (typeof value === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - const className = el.attribs['class'] || ''; - addClass.call([el], value.call(el, i, className)); - } - }); - } - - // Return if no value or not a string or function - if (!value || typeof value !== 'string') return this; - - const classNames = value.split(rspace); - const numElements = this.length; - - for (let i = 0; i < numElements; i++) { - const el = this[i]; - // If selected element isn't a tag, move on - if (!isTag(el)) continue; - - // If we don't already have classes — always set xmlMode to false here, as it doesn't matter for classes - const className = getAttr(el, 'class', false); - - if (className) { - let setClass = ` ${className} `; - - // Check if class already exists - for (const cn of classNames) { - const appendClass = `${cn} `; - if (!setClass.includes(` ${appendClass}`)) setClass += appendClass; - } - - setAttr(el, 'class', setClass.trim()); - } else { - setAttr(el, 'class', classNames.join(' ').trim()); - } - } - - return this; -} - -/** - * Removes one or more space-separated classes from the selected elements. If no - * `className` is defined, all classes will be removed. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeClass('pear').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('red').removeClass().html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the class. If not specified, removes all elements. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeClass/} - */ -export function removeClass>( - this: R, - name?: - | string - | ((this: Element, i: number, className: string) => string | undefined), -): R { - // Handle if value is a function - if (typeof name === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - removeClass.call([el], name.call(el, i, el.attribs['class'] || '')); - } - }); - } - - const classes = splitNames(name); - const numClasses = classes.length; - const removeAll = arguments.length === 0; - - return domEach(this, (el) => { - if (!isTag(el)) return; - - if (removeAll) { - // Short circuit the remove all case as this is the nice one - el.attribs['class'] = ''; - } else { - const elClasses = splitNames(el.attribs['class']); - let changed = false; - - for (let j = 0; j < numClasses; j++) { - const index = elClasses.indexOf(classes[j]); - - if (index >= 0) { - elClasses.splice(index, 1); - changed = true; - - /* - * We have to do another pass to ensure that there are not duplicate - * classes listed - */ - j--; - } - } - if (changed) { - el.attribs['class'] = elClasses.join(' '); - } - } - }); -} - -/** - * Add or remove class(es) from the matched elements, depending on either the - * class's presence or the value of the switch argument. Also accepts a - * `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.apple.green').toggleClass('fruit green red').html(); - * //=>
  • Apple
  • - * - * $('.apple.green').toggleClass('fruit green red', true).html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of the class. Can also be a function. - * @param stateVal - If specified the state of the class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/toggleClass/} - */ -export function toggleClass>( - this: R, - value?: - | string - | (( - this: Element, - i: number, - className: string, - stateVal?: boolean, - ) => string), - stateVal?: boolean, -): R { - // Support functions - if (typeof value === 'function') { - return domEach(this, (el, i) => { - if (isTag(el)) { - toggleClass.call( - [el], - value.call(el, i, el.attribs['class'] || '', stateVal), - stateVal, - ); - } - }); - } - - // Return if no value or not a string or function - if (!value || typeof value !== 'string') return this; - - const classNames = value.split(rspace); - const numClasses = classNames.length; - const state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0; - const numElements = this.length; - - for (let i = 0; i < numElements; i++) { - const el = this[i]; - // If selected element isn't a tag, move on - if (!isTag(el)) continue; - - const elementClasses = splitNames(el.attribs['class']); - - // Check if class already exists - for (let j = 0; j < numClasses; j++) { - // Check if the class name is currently defined - const index = elementClasses.indexOf(classNames[j]); - - // Add if stateValue === true or we are toggling and there is no value - if (state >= 0 && index < 0) { - elementClasses.push(classNames[j]); - } else if (state <= 0 && index >= 0) { - // Otherwise remove but only if the item exists - elementClasses.splice(index, 1); - } - } - - el.attribs['class'] = elementClasses.join(' '); - } - - return this; -} diff --git a/node_modules/cheerio/src/api/css.spec.ts b/node_modules/cheerio/src/api/css.spec.ts deleted file mode 100644 index f6455c2..0000000 --- a/node_modules/cheerio/src/api/css.spec.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { describe, it, expect, beforeEach } from 'vitest'; -import { load, type Cheerio } from '../index.js'; -import type { Element } from 'domhandler'; -import { cheerio, mixedText } from '../__fixtures__/fixtures.js'; - -describe('$(...)', () => { - describe('.css', () => { - it('(prop): should return a css property value', () => { - const el = cheerio('
  • '); - expect(el.css('hai')).toBe('there'); - }); - - it('([prop1, prop2]): should return the specified property values as an object', () => { - const el = cheerio( - '
  • ', - ); - expect(el.css(['margin', 'color'])).toStrictEqual({ - margin: '1px', - color: 'blue', - }); - }); - - it('(prop, val): should set a css property', () => { - const el = cheerio('
  • '); - el.css('color', 'red'); - expect(el.attr('style')).toBe('margin: 0; color: red;'); - expect(el.eq(1).attr('style')).toBe('color: red;'); - }); - - it('(prop, val) : should skip text nodes', () => { - const $text = load(mixedText); - const $body = $text($text('body')[0].children); - - $body.css('test', 'value'); - - expect($text('body').html()).toBe( - '1TEXT2', - ); - }); - - it('(prop, ""): should unset a css property', () => { - const el = cheerio('
  • '); - el.css('padding', ''); - expect(el.attr('style')).toBe('margin: 0;'); - }); - - it('(any, val): should ignore unsupported prop types', () => { - const el = cheerio('
  • '); - el.css(123 as never, 'test'); - expect(el.attr('style')).toBe('padding: 1px;'); - }); - - it('(prop): should not mangle embedded urls', () => { - const el = cheerio( - '
  • ', - ); - expect(el.css('background-image')).toBe( - 'url(http://example.com/img.png)', - ); - }); - - it('(prop): should ignore blank properties', () => { - const el = cheerio('
  • '); - expect(el.css()).toStrictEqual({ color: '#aaa' }); - }); - - it('(prop): should ignore blank values', () => { - const el = cheerio('
  • '); - expect(el.css()).toStrictEqual({ position: 'absolute' }); - }); - - it('(prop): should return undefined for unmatched elements', () => { - const $ = load('
  • '); - expect($('ul').css('background-image')).toBeUndefined(); - }); - - it('(prop): should return undefined for unmatched styles', () => { - const el = cheerio('
  • '); - expect(el.css('margin')).toBeUndefined(); - }); - - describe('(prop, function):', () => { - let $el: Cheerio; - beforeEach(() => { - const $ = load( - '
    ', - ); - $el = $('div'); - }); - - it('should iterate over the selection', () => { - let count = 0; - $el.css('margin', function (idx, value) { - expect(idx).toBe(count); - expect(value).toBe(`${count}px`); - expect(this).toBe($el[count]); - count++; - return undefined; - }); - expect(count).toBe(3); - }); - - it('should set each attribute independently', () => { - const values = ['4px', '', undefined]; - $el.css('margin', (idx) => values[idx]); - expect($el.eq(0).attr('style')).toBe('margin: 4px;'); - expect($el.eq(1).attr('style')).toBe(''); - expect($el.eq(2).attr('style')).toBe('margin: 2px;'); - }); - }); - - it('(obj): should set each key and val', () => { - const el = cheerio('
  • '); - el.css({ foo: 0 } as never); - expect(el.eq(0).attr('style')).toBe('padding: 0; foo: 0;'); - expect(el.eq(1).attr('style')).toBe('foo: 0;'); - }); - - describe('parser', () => { - it('should allow any whitespace between declarations', () => { - const el = cheerio('
  • '); - expect(el.css(['one', 'two', 'five'])).toStrictEqual({ - one: '0', - two: '1', - }); - }); - - it('should add malformed values to previous field (#1134)', () => { - const el = cheerio( - '', - ); - expect(el.css('background-image')).toStrictEqual( - 'url(data:image/png;base64,iVBORw0KGgo)', - ); - }); - }); - }); -}); diff --git a/node_modules/cheerio/src/api/css.ts b/node_modules/cheerio/src/api/css.ts deleted file mode 100644 index 9a1564a..0000000 --- a/node_modules/cheerio/src/api/css.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { domEach } from '../utils.js'; -import { isTag, type Element, type AnyNode } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; - -/** - * Get the value of a style property for the first element in the set of matched - * elements. - * - * @category CSS - * @param names - Optionally the names of the properties of interest. - * @returns A map of all of the style properties. - * @see {@link https://api.jquery.com/css/} - */ -export function css( - this: Cheerio, - names?: string[], -): Record | undefined; -/** - * Get the value of a style property for the first element in the set of matched - * elements. - * - * @category CSS - * @param name - The name of the property. - * @returns The property value for the given name. - * @see {@link https://api.jquery.com/css/} - */ -export function css( - this: Cheerio, - name: string, -): string | undefined; -/** - * Set one CSS property for every matched element. - * - * @category CSS - * @param prop - The name of the property. - * @param val - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export function css( - this: Cheerio, - prop: string, - val: - | string - | ((this: Element, i: number, style: string) => string | undefined), -): Cheerio; -/** - * Set multiple CSS properties for every matched element. - * - * @category CSS - * @param map - A map of property names and values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export function css( - this: Cheerio, - map: Record, -): Cheerio; -/** - * Set multiple CSS properties for every matched element. - * - * @category CSS - * @param prop - The names of the properties. - * @param val - The new values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/css/} - */ -export function css( - this: Cheerio, - prop?: string | string[] | Record, - val?: - | string - | ((this: Element, i: number, style: string) => string | undefined), -): Cheerio | Record | string | undefined { - if ( - (prop != null && val != null) || - // When `prop` is a "plain" object - (typeof prop === 'object' && !Array.isArray(prop)) - ) { - return domEach(this, (el, i) => { - if (isTag(el)) { - // `prop` can't be an array here anymore. - setCss(el, prop as string, val, i); - } - }); - } - - if (this.length === 0) { - return undefined; - } - - return getCss(this[0], prop as string); -} - -/** - * Set styles of all elements. - * - * @private - * @param el - Element to set style of. - * @param prop - Name of property. - * @param value - Value to set property to. - * @param idx - Optional index within the selection. - */ -function setCss( - el: Element, - prop: string | Record, - value: - | string - | ((this: Element, i: number, style: string) => string | undefined) - | undefined, - idx: number, -) { - if (typeof prop === 'string') { - const styles = getCss(el); - - const val = - typeof value === 'function' ? value.call(el, idx, styles[prop]) : value; - - if (val === '') { - delete styles[prop]; - } else if (val != null) { - styles[prop] = val; - } - - el.attribs['style'] = stringify(styles); - } else if (typeof prop === 'object') { - const keys = Object.keys(prop); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - setCss(el, k, prop[k], i); - } - } -} - -/** - * Get the parsed styles of the first element. - * - * @private - * @category CSS - * @param el - Element to get styles from. - * @param props - Optionally the names of the properties of interest. - * @returns The parsed styles. - */ -function getCss(el: AnyNode, props?: string[]): Record; -/** - * Get a property from the parsed styles of the first element. - * - * @private - * @category CSS - * @param el - Element to get styles from. - * @param prop - Name of the prop. - * @returns The value of the property. - */ -function getCss(el: AnyNode, prop: string): string | undefined; -function getCss( - el: AnyNode, - prop?: string | string[], -): Record | string | undefined { - if (!el || !isTag(el)) return; - - const styles = parse(el.attribs['style']); - if (typeof prop === 'string') { - return styles[prop]; - } - if (Array.isArray(prop)) { - const newStyles: Record = {}; - for (const item of prop) { - if (styles[item] != null) { - newStyles[item] = styles[item]; - } - } - return newStyles; - } - return styles; -} - -/** - * Stringify `obj` to styles. - * - * @private - * @category CSS - * @param obj - Object to stringify. - * @returns The serialized styles. - */ -function stringify(obj: Record): string { - return Object.keys(obj).reduce( - (str, prop) => `${str}${str ? ' ' : ''}${prop}: ${obj[prop]};`, - '', - ); -} - -/** - * Parse `styles`. - * - * @private - * @category CSS - * @param styles - Styles to be parsed. - * @returns The parsed styles. - */ -function parse(styles: string): Record { - styles = (styles || '').trim(); - - if (!styles) return {}; - - const obj: Record = {}; - - let key: string | undefined; - - for (const str of styles.split(';')) { - const n = str.indexOf(':'); - // If there is no :, or if it is the first/last character, add to the previous item's value - if (n < 1 || n === str.length - 1) { - const trimmed = str.trimEnd(); - if (trimmed.length > 0 && key !== undefined) { - obj[key] += `;${trimmed}`; - } - } else { - key = str.slice(0, n).trim(); - obj[key] = str.slice(n + 1).trim(); - } - } - - return obj; -} diff --git a/node_modules/cheerio/src/api/extract.spec.ts b/node_modules/cheerio/src/api/extract.spec.ts deleted file mode 100644 index b243212..0000000 --- a/node_modules/cheerio/src/api/extract.spec.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { describe, it, expect } from 'vitest'; -import * as fixtures from '../__fixtures__/fixtures.js'; -import { load } from '../load-parse.js'; - -interface RedSelObject { - red: string | undefined; - sel: string | undefined; -} - -interface RedSelMultipleObject { - red: string[]; - sel: string[]; -} - -describe('$.extract', () => { - it('() : should extract values for selectors', () => { - const $ = load(fixtures.eleven); - const $root = load(fixtures.eleven).root(); - // An empty object should lead to an empty extraction. - - // $ExpectType ExtractedMap<{}> - const emptyExtract = $root.extract({}); - expect(emptyExtract).toStrictEqual({}); - // Non-existent values should be undefined. - - // $ExpectType ExtractedMap<{ foo: string; }> - const simpleExtract = $root.extract({ foo: 'bar' }); - expect(simpleExtract).toStrictEqual({ foo: undefined }); - - // Existing values should be extracted. - expect<{ red: string | undefined }>( - $root.extract({ red: '.red' }), - ).toStrictEqual({ - red: 'Four', - }); - expect( - $root.extract({ red: '.red', sel: '.sel' }), - ).toStrictEqual({ - red: 'Four', - sel: 'Three', - }); - // Descriptors for extractions should be supported - expect( - $root.extract({ - red: { selector: '.red' }, - sel: { selector: '.sel' }, - }), - ).toStrictEqual({ red: 'Four', sel: 'Three' }); - // Should support extraction of multiple values. - - // $ExpectType ExtractedMap<{ red: [string]; sel: [string]; }> - const multipleExtract = $root.extract({ - red: ['.red'], - sel: ['.sel'], - }); - expect(multipleExtract).toStrictEqual({ - red: ['Four', 'Five', 'Nine'], - sel: ['Three', 'Nine', 'Eleven'], - }); - // Should support custom `prop`s. - expect( - $root.extract({ - red: { selector: '.red', value: 'outerHTML' }, - sel: { selector: '.sel', value: 'tagName' }, - }), - ).toStrictEqual({ red: '
  • Four
  • ', sel: 'LI' }); - // Should support custom `prop`s for multiple values. - expect<{ red: string[] }>( - $root.extract({ - red: [{ selector: '.red', value: 'outerHTML' }], - }), - ).toStrictEqual({ - red: [ - '
  • Four
  • ', - '
  • Five
  • ', - '
  • Nine
  • ', - ], - }); - // Should support custom extraction functions. - expect<{ red: string | undefined }>( - $root.extract({ - red: { - selector: '.red', - value: (el, key) => `${key}=${$(el).text()}`, - }, - }), - ).toStrictEqual({ red: 'red=Four' }); - // Should support custom extraction functions for multiple values. - expect<{ red: string[] }>( - $root.extract({ - red: [ - { - selector: '.red', - value: (el, key) => `${key}=${$(el).text()}`, - }, - ], - }), - ).toStrictEqual({ red: ['red=Four', 'red=Five', 'red=Nine'] }); - // Should support extraction objects - - // $ExpectType ExtractedMap<{ section: { selector: string; value: { red: string; sel: string; }; }; }> - const subExtractObject = $root.extract({ - section: { - selector: 'ul:nth(1)', - value: { - red: '.red', - sel: '.blue', - }, - }, - }); - - expect<{ section: RedSelObject | undefined }>( - subExtractObject, - ).toStrictEqual({ - section: { - red: 'Five', - sel: 'Seven', - }, - }); - }); -}); diff --git a/node_modules/cheerio/src/api/extract.ts b/node_modules/cheerio/src/api/extract.ts deleted file mode 100644 index 10bd529..0000000 --- a/node_modules/cheerio/src/api/extract.ts +++ /dev/null @@ -1,92 +0,0 @@ -import type { AnyNode, Element } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; -import type { prop } from './attributes.js'; - -type ExtractDescriptorFn = ( - el: Element, - key: string, - // TODO: This could be typed with ExtractedMap - obj: Record, -) => unknown; - -interface ExtractDescriptor { - selector: string; - value?: string | ExtractDescriptorFn | ExtractMap; -} - -type ExtractValue = string | ExtractDescriptor | [string | ExtractDescriptor]; - -export interface ExtractMap { - [key: string]: ExtractValue; -} - -type ExtractedValue = V extends [ - string | ExtractDescriptor, -] - ? NonNullable>[] - : V extends string - ? string | undefined - : V extends ExtractDescriptor - ? V['value'] extends ExtractMap - ? ExtractedMap | undefined - : V['value'] extends ExtractDescriptorFn - ? ReturnType | undefined - : ReturnType | undefined - : never; - -export type ExtractedMap = { - [key in keyof M]: ExtractedValue; -}; - -function getExtractDescr( - descr: string | ExtractDescriptor, -): Required { - if (typeof descr === 'string') { - return { selector: descr, value: 'textContent' }; - } - - return { - selector: descr.selector, - value: descr.value ?? 'textContent', - }; -} - -/** - * Extract multiple values from a document, and store them in an object. - * - * @param map - An object containing key-value pairs. The keys are the names of - * the properties to be created on the object, and the values are the - * selectors to be used to extract the values. - * @returns An object containing the extracted values. - */ -export function extract( - this: Cheerio, - map: M, -): ExtractedMap { - const ret: Record = {}; - - for (const key in map) { - const descr = map[key]; - const isArray = Array.isArray(descr); - - const { selector, value } = getExtractDescr(isArray ? descr[0] : descr); - - const fn: ExtractDescriptorFn = - typeof value === 'function' - ? value - : typeof value === 'string' - ? (el: Element) => this._make(el).prop(value) - : (el: Element) => this._make(el).extract(value); - - if (isArray) { - ret[key] = this._findBySelector(selector, Number.POSITIVE_INFINITY) - .map((_, el) => fn(el, key, ret)) - .get(); - } else { - const $ = this._findBySelector(selector, 1); - ret[key] = $.length > 0 ? fn($[0], key, ret) : undefined; - } - } - - return ret as ExtractedMap; -} diff --git a/node_modules/cheerio/src/api/forms.spec.ts b/node_modules/cheerio/src/api/forms.spec.ts deleted file mode 100644 index ddd3d75..0000000 --- a/node_modules/cheerio/src/api/forms.spec.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { describe, it, expect, beforeEach } from 'vitest'; -import { type CheerioAPI } from '../index.js'; -import { cheerio, forms } from '../__fixtures__/fixtures.js'; - -describe('$(...)', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = cheerio.load(forms); - }); - - describe('.serializeArray', () => { - it('() : should get form controls', () => { - expect($('form#simple').serializeArray()).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - ]); - }); - - it('() : should get nested form controls', () => { - expect($('form#nested').serializeArray()).toHaveLength(2); - const data = $('form#nested').serializeArray(); - data.sort((a, b) => (a.value > b.value ? 1 : -1)); - expect(data).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - { - name: 'vegetable', - value: 'Carrot', - }, - ]); - }); - - it('() : should not get disabled form controls', () => { - expect($('form#disabled').serializeArray()).toStrictEqual([]); - }); - - it('() : should not get form controls with the wrong type', () => { - expect($('form#submit').serializeArray()).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - ]); - }); - - it('() : should get selected options', () => { - expect($('form#select').serializeArray()).toStrictEqual([ - { - name: 'fruit', - value: 'Orange', - }, - ]); - }); - - it('() : should not get unnamed form controls', () => { - expect($('form#unnamed').serializeArray()).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - ]); - }); - - it('() : should get multiple selected options', () => { - expect($('form#multiple').serializeArray()).toHaveLength(2); - const data = $('form#multiple').serializeArray(); - data.sort((a, b) => (a.value > b.value ? 1 : -1)); - expect(data).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - { - name: 'fruit', - value: 'Orange', - }, - ]); - }); - - it('() : should get individually selected elements', () => { - const data = $('form#nested input').serializeArray(); - data.sort((a, b) => (a.value > b.value ? 1 : -1)); - expect(data).toStrictEqual([ - { - name: 'fruit', - value: 'Apple', - }, - { - name: 'vegetable', - value: 'Carrot', - }, - ]); - }); - - it('() : should standardize line breaks', () => { - expect($('form#textarea').serializeArray()).toStrictEqual([ - { - name: 'fruits', - value: 'Apple\r\nOrange', - }, - ]); - }); - - it("() : shouldn't serialize the empty string", () => { - expect($('').serializeArray()).toStrictEqual([]); - expect( - $('').serializeArray(), - ).toStrictEqual([]); - expect( - $('').serializeArray(), - ).toStrictEqual([ - { - name: 'fruit', - value: 'pineapple', - }, - ]); - }); - - it('() : should serialize inputs without value attributes', () => { - expect($('').serializeArray()).toStrictEqual([ - { - name: 'fruit', - value: '', - }, - ]); - }); - }); - - describe('.serialize', () => { - it('() : should get form controls', () => { - expect($('form#simple').serialize()).toBe('fruit=Apple'); - }); - - it('() : should get nested form controls', () => { - expect($('form#nested').serialize()).toBe('fruit=Apple&vegetable=Carrot'); - }); - - it('() : should not get disabled form controls', () => { - expect($('form#disabled').serialize()).toBe(''); - }); - - it('() : should get multiple selected options', () => { - expect($('form#multiple').serialize()).toBe('fruit=Apple&fruit=Orange'); - }); - - it("() : should encode spaces as +'s", () => { - expect($('form#spaces').serialize()).toBe('fruit=Blood+orange'); - }); - }); -}); diff --git a/node_modules/cheerio/src/api/forms.ts b/node_modules/cheerio/src/api/forms.ts deleted file mode 100644 index 902f919..0000000 --- a/node_modules/cheerio/src/api/forms.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { isTag, type AnyNode } from 'domhandler'; -import type { Cheerio } from '../cheerio.js'; - -/* - * https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js - * https://github.com/jquery/jquery/blob/2.1.3/src/serialize.js - */ -const submittableSelector = 'input,select,textarea,keygen'; -const r20 = /%20/g; -const rCRLF = /\r?\n/g; - -/** - * Encode a set of form elements as a string for submission. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serialize(); - * //=> 'foo=bar' - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serialize/} - */ -export function serialize(this: Cheerio): string { - // Convert form elements into name/value objects - const arr = this.serializeArray(); - - // Serialize each element into a key/value string - const retArr = arr.map( - (data) => - `${encodeURIComponent(data.name)}=${encodeURIComponent(data.value)}`, - ); - - // Return the resulting serialization - return retArr.join('&').replace(r20, '+'); -} - -/** - * Encode a set of form elements as an array of names and values. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serializeArray(); - * //=> [ { name: 'foo', value: 'bar' } ] - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serializeArray/} - */ -export function serializeArray( - this: Cheerio, -): { - name: string; - value: string; -}[] { - // Resolve all form elements from either forms or collections of form elements - return this.map((_, elem) => { - const $elem = this._make(elem); - if (isTag(elem) && elem.name === 'form') { - return $elem.find(submittableSelector).toArray(); - } - return $elem.filter(submittableSelector).toArray(); - }) - .filter( - // Verify elements have a name (`attr.name`) and are not disabled (`:enabled`) - '[name!=""]:enabled' + - // And cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`) - ':not(:submit, :button, :image, :reset, :file)' + - // And are either checked/don't have a checkable state - ':matches([checked], :not(:checkbox, :radio))', - // Convert each of the elements to its value(s) - ) - .map< - AnyNode, - { - name: string; - value: string; - } - >((_, elem) => { - const $elem = this._make(elem); - const name = $elem.attr('name') as string; // We have filtered for elements with a name before. - // If there is no value set (e.g. `undefined`, `null`), then default value to empty - const value = $elem.val() ?? ''; - - // If we have an array of values (e.g. `'; - -// Comments -const comment = ''; -const conditional = - ''; - -// Text -const text = 'lorem ipsum'; - -// Script -const script = ''; -const scriptEmpty = ''; - -// Style -const style = ''; -const styleEmpty = ''; - -// Directives -const directive = ''; - -function rootTest(root: Document) { - expect(root).toHaveProperty('type', 'root'); - - expect(root.nextSibling).toBe(null); - expect(root.previousSibling).toBe(null); - expect(root.parentNode).toBe(null); - - const child = root.childNodes[0]; - expect(child.parentNode).toBe(root); -} - -describe('parse', () => { - describe('evaluate', () => { - it(`should parse basic empty tags: ${basic}`, () => { - const [tag] = parse(basic, defaultOpts, true, null).children as Element[]; - expect(tag.type).toBe('tag'); - expect(tag.tagName).toBe('html'); - expect(tag.childNodes).toHaveLength(2); - }); - - it(`should handle sibling tags: ${siblings}`, () => { - const dom = parse(siblings, defaultOpts, false, null) - .children as Element[]; - const [h2, p] = dom; - - expect(dom).toHaveLength(2); - expect(h2.tagName).toBe('h2'); - expect(p.tagName).toBe('p'); - }); - - it(`should handle single tags: ${single}`, () => { - const [tag] = parse(single, defaultOpts, false, null) - .children as Element[]; - expect(tag.type).toBe('tag'); - expect(tag.tagName).toBe('br'); - expect(tag.childNodes).toHaveLength(0); - }); - - it(`should handle malformatted single tags: ${singleWrong}`, () => { - const [tag] = parse(singleWrong, defaultOpts, false, null) - .children as Element[]; - expect(tag.type).toBe('tag'); - expect(tag.tagName).toBe('br'); - expect(tag.childNodes).toHaveLength(0); - }); - - it(`should handle tags with children: ${children}`, () => { - const [tag] = parse(children, defaultOpts, true, null) - .children as Element[]; - expect(tag.type).toBe('tag'); - expect(tag.tagName).toBe('html'); - expect(tag.childNodes).toBeTruthy(); - expect(tag.childNodes[1]).toHaveProperty('tagName', 'body'); - expect((tag.childNodes[1] as Element).childNodes).toHaveLength(1); - }); - - it(`should handle tags with children: ${li}`, () => { - const [tag] = parse(li, defaultOpts, false, null).children as Element[]; - expect(tag.childNodes).toHaveLength(1); - expect(tag.childNodes[0]).toHaveProperty('data', 'Durian'); - }); - - it(`should handle tags with attributes: ${attributes}`, () => { - const attrs = parse(attributes, defaultOpts, false, null) - .children[0] as Element; - expect(attrs.attribs).toBeTruthy(); - expect(attrs.attribs).toHaveProperty('src', 'hello.png'); - expect(attrs.attribs).toHaveProperty('alt', 'man waving'); - }); - - it(`should handle value-less attributes: ${noValueAttribute}`, () => { - const attrs = parse(noValueAttribute, defaultOpts, false, null) - .children[0] as Element; - expect(attrs.attribs).toBeTruthy(); - expect(attrs.attribs).toHaveProperty('disabled', ''); - }); - - it(`should handle comments: ${comment}`, () => { - const elem = parse(comment, defaultOpts, false, null).children[0]; - expect(elem.type).toBe('comment'); - expect(elem).toHaveProperty('data', ' sexy '); - }); - - it(`should handle conditional comments: ${conditional}`, () => { - const elem = parse(conditional, defaultOpts, false, null).children[0]; - expect(elem.type).toBe('comment'); - expect(elem).toHaveProperty( - 'data', - conditional.replace('', ''), - ); - }); - - it(`should handle text: ${text}`, () => { - const text_ = parse(text, defaultOpts, false, null).children[0]; - expect(text_.type).toBe('text'); - expect(text_).toHaveProperty('data', 'lorem ipsum'); - }); - - it(`should handle script tags: ${script}`, () => { - const script_ = parse(script, defaultOpts, false, null) - .children[0] as Element; - expect(script_.type).toBe('script'); - expect(script_.tagName).toBe('script'); - expect(script_.attribs).toHaveProperty('type', 'text/javascript'); - expect(script_.childNodes).toHaveLength(1); - expect(script_.childNodes[0].type).toBe('text'); - expect(script_.childNodes[0]).toHaveProperty( - 'data', - 'alert("hi world!");', - ); - }); - - it(`should handle style tags: ${style}`, () => { - const style_ = parse(style, defaultOpts, false, null) - .children[0] as Element; - expect(style_.type).toBe('style'); - expect(style_.tagName).toBe('style'); - expect(style_.attribs).toHaveProperty('type', 'text/css'); - expect(style_.childNodes).toHaveLength(1); - expect(style_.childNodes[0].type).toBe('text'); - expect(style_.childNodes[0]).toHaveProperty( - 'data', - ' h2 { color:blue; } ', - ); - }); - - it(`should handle directives: ${directive}`, () => { - const elem = parse(directive, defaultOpts, true, null).children[0]; - expect(elem.type).toBe('directive'); - expect(elem).toHaveProperty('data', '!DOCTYPE html'); - expect(elem).toHaveProperty('name', '!doctype'); - }); - }); - - describe('.parse', () => { - // Root test utility - - it(`should add root to: ${basic}`, () => { - const root = parse(basic, defaultOpts, true, null); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0]).toHaveProperty('tagName', 'html'); - }); - - it(`should add root to: ${siblings}`, () => { - const root = parse(siblings, defaultOpts, false, null); - rootTest(root); - expect(root.childNodes).toHaveLength(2); - expect(root.childNodes[0]).toHaveProperty('tagName', 'h2'); - expect(root.childNodes[1]).toHaveProperty('tagName', 'p'); - expect(root.childNodes[1].parent).toBe(root); - }); - - it(`should add root to: ${comment}`, () => { - const root = parse(comment, defaultOpts, false, null); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0].type).toBe('comment'); - }); - - it(`should add root to: ${text}`, () => { - const root = parse(text, defaultOpts, false, null); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0].type).toBe('text'); - }); - - it(`should add root to: ${scriptEmpty}`, () => { - const root = parse(scriptEmpty, defaultOpts, false, null); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0].type).toBe('script'); - }); - - it(`should add root to: ${styleEmpty}`, () => { - const root = parse(styleEmpty, defaultOpts, false, null); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0].type).toBe('style'); - }); - - it(`should add root to: ${directive}`, () => { - const root = parse(directive, defaultOpts, true, null); - rootTest(root); - expect(root.childNodes).toHaveLength(2); - expect(root.childNodes[0].type).toBe('directive'); - }); - - it('should simply return root', () => { - const oldroot = parse(basic, defaultOpts, true, null); - const root = parse(oldroot, defaultOpts, true, null); - expect(root).toBe(oldroot); - rootTest(root); - expect(root.childNodes).toHaveLength(1); - expect(root.childNodes[0]).toHaveProperty('tagName', 'html'); - }); - - it('should expose the DOM level 1 API', () => { - const root = parse( - '

    ', - defaultOpts, - false, - null, - ).childNodes[0] as Element; - const childNodes = root.childNodes as Element[]; - - expect(childNodes).toHaveLength(3); - - expect(root.tagName).toBe('div'); - expect(root.firstChild).toBe(childNodes[0]); - expect(root.lastChild).toBe(childNodes[2]); - - expect(childNodes[0].tagName).toBe('a'); - expect(childNodes[0].previousSibling).toBe(null); - expect(childNodes[0].nextSibling).toBe(childNodes[1]); - expect(childNodes[0].parentNode).toBe(root); - expect((childNodes[0] as Element).childNodes).toHaveLength(0); - expect(childNodes[0].firstChild).toBe(null); - expect(childNodes[0].lastChild).toBe(null); - - expect(childNodes[1].tagName).toBe('span'); - expect(childNodes[1].previousSibling).toBe(childNodes[0]); - expect(childNodes[1].nextSibling).toBe(childNodes[2]); - expect(childNodes[1].parentNode).toBe(root); - expect(childNodes[1].childNodes).toHaveLength(0); - expect(childNodes[1].firstChild).toBe(null); - expect(childNodes[1].lastChild).toBe(null); - - expect(childNodes[2].tagName).toBe('p'); - expect(childNodes[2].previousSibling).toBe(childNodes[1]); - expect(childNodes[2].nextSibling).toBe(null); - expect(childNodes[2].parentNode).toBe(root); - expect(childNodes[2].childNodes).toHaveLength(0); - expect(childNodes[2].firstChild).toBe(null); - expect(childNodes[2].lastChild).toBe(null); - }); - - it('Should parse less than or equal sign sign', () => { - const root = parse('A<=B', defaultOpts, false, null); - const { childNodes } = root; - - expect(childNodes[0]).toHaveProperty('tagName', 'i'); - expect((childNodes[0] as Element).childNodes[0]).toHaveProperty( - 'data', - 'A', - ); - expect(childNodes[1]).toHaveProperty('data', '<='); - expect(childNodes[2]).toHaveProperty('tagName', 'i'); - expect((childNodes[2] as Element).childNodes[0]).toHaveProperty( - 'data', - 'B', - ); - }); - - it('Should ignore unclosed CDATA', () => { - const root = parse( - '', - defaultOpts, - false, - null, - ); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].tagName).toBe('a'); - expect(childNodes[1].tagName).toBe('script'); - expect(childNodes[1].childNodes[0]).toHaveProperty( - 'data', - 'foo // to documents', () => { - const root = parse('', defaultOpts, true, null); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].tagName).toBe('html'); - expect(childNodes[0].childNodes[0]).toHaveProperty('tagName', 'head'); - }); - - it('Should implicitly create around ', () => { - const root = parse( - '
    bar
    ', - defaultOpts, - false, - null, - ); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].tagName).toBe('table'); - expect(childNodes[0].childNodes.length).toBe(1); - expect(childNodes[0].childNodes[0]).toHaveProperty('tagName', 'tbody'); - expect((childNodes[0] as any).childNodes[0].childNodes[0]).toHaveProperty( - 'tagName', - 'tr', - ); - expect( - (childNodes[0] as any).childNodes[0].childNodes[0].childNodes[0] - .tagName, - ).toBe('td'); - expect( - (childNodes[0] as any).childNodes[0].childNodes[0].childNodes[0] - .childNodes[0].data, - ).toBe('bar'); - }); - - it('Should parse custom tag ', () => { - const root = parse('test', defaultOpts, false, null); - const childNodes = root.childNodes as Element[]; - - expect(childNodes.length).toBe(1); - expect(childNodes[0].tagName).toBe('line'); - expect(childNodes[0].childNodes[0]).toHaveProperty('data', 'test'); - }); - - it('Should properly parse misnested table tags', () => { - const root = parse( - 'i1i2i3', - defaultOpts, - false, - null, - ); - const childNodes = root.childNodes as Element[]; - - expect(childNodes.length).toBe(3); - - for (let i = 0; i < childNodes.length; i++) { - const child = childNodes[i]; - expect(child.tagName).toBe('tr'); - expect(child.childNodes[0]).toHaveProperty('tagName', 'td'); - expect((child.childNodes[0] as Element).childNodes[0]).toHaveProperty( - 'data', - `i${i + 1}`, - ); - } - }); - - it('Should correctly parse data url attributes', () => { - const html = - '
    '; - const expectedAttr = - 'font-family:"butcherman-caps"; src:url(data:font/opentype;base64,AAEA...);'; - const root = parse(html, defaultOpts, false, null); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].attribs).toHaveProperty('style', expectedAttr); - }); - - it('Should treat tag content as text', () => { - const root = parse('<xmp><h2>', defaultOpts, false, null); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].childNodes[0]).toHaveProperty('data', '

    '); - }); - - it('Should correctly parse malformed numbered entities', () => { - const root = parse('

    z&#

    ', defaultOpts, false, null); - const childNodes = root.childNodes as Element[]; - - expect(childNodes[0].childNodes[0]).toHaveProperty('data', 'z&#'); - }); - - it('Should correctly parse mismatched headings', () => { - const root = parse('

    Test

    ', defaultOpts, false, null); - const { childNodes } = root; - - expect(childNodes.length).toBe(2); - expect(childNodes[0]).toHaveProperty('tagName', 'h2'); - expect(childNodes[1]).toHaveProperty('tagName', 'div'); - }); - - it('Should correctly parse tricky
     content', () => {
    -      const root = parse(
    -        '
    \nA <- factor(A, levels = c("c","a","b"))\n
    ', - defaultOpts, - false, - null, - ); - const childNodes = root.childNodes as Element[]; - - expect(childNodes.length).toBe(1); - expect(childNodes[0].tagName).toBe('pre'); - expect(childNodes[0].childNodes[0]).toHaveProperty( - 'data', - 'A <- factor(A, levels = c("c","a","b"))\n', - ); - }); - - it('should pass the options for including the location info to parse5', () => { - const root = parse( - '

    Hello

    ', - { ...defaultOpts, sourceCodeLocationInfo: true }, - false, - null, - ); - const location = root.children[0].sourceCodeLocation; - - expect(typeof location).toBe('object'); - expect(location?.endOffset).toBe(12); - }); - }); -}); diff --git a/node_modules/cheerio/src/parse.ts b/node_modules/cheerio/src/parse.ts deleted file mode 100644 index 5706f14..0000000 --- a/node_modules/cheerio/src/parse.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { removeElement } from 'domutils'; -import { - type AnyNode, - Document, - type ParentNode, - isDocument as checkIsDocument, -} from 'domhandler'; -import type { InternalOptions } from './options.js'; - -/** - * Get the parse function with options. - * - * @param parser - The parser function. - * @returns The parse function with options. - */ -export function getParse( - parser: ( - content: string, - options: InternalOptions, - isDocument: boolean, - context: ParentNode | null, - ) => Document, -) { - /** - * Parse a HTML string or a node. - * - * @param content - The HTML string or node. - * @param options - The parser options. - * @param isDocument - If `content` is a document. - * @param context - The context node in the DOM tree. - * @returns The parsed document node. - */ - return function parse( - content: string | Document | AnyNode | AnyNode[] | Buffer, - options: InternalOptions, - isDocument: boolean, - context: ParentNode | null, - ): Document { - if (typeof Buffer !== 'undefined' && Buffer.isBuffer(content)) { - content = content.toString(); - } - - if (typeof content === 'string') { - return parser(content, options, isDocument, context); - } - - const doc = content as AnyNode | AnyNode[] | Document; - - if (!Array.isArray(doc) && checkIsDocument(doc)) { - // If `doc` is already a root, just return it - return doc; - } - - // Add conent to new root element - const root = new Document([]); - - // Update the DOM using the root - update(doc, root); - - return root; - }; -} - -/** - * Update the dom structure, for one changed layer. - * - * @param newChilds - The new children. - * @param parent - The new parent. - * @returns The parent node. - */ -export function update( - newChilds: AnyNode[] | AnyNode, - parent: ParentNode | null, -): ParentNode | null { - // Normalize - const arr = Array.isArray(newChilds) ? newChilds : [newChilds]; - - // Update parent - if (parent) { - parent.children = arr; - } else { - parent = null; - } - - // Update neighbors - for (let i = 0; i < arr.length; i++) { - const node = arr[i]; - - // Cleanly remove existing nodes from their previous structures. - if (node.parent && node.parent.children !== arr) { - removeElement(node); - } - - if (parent) { - node.prev = arr[i - 1] || null; - node.next = arr[i + 1] || null; - } else { - node.prev = node.next = null; - } - - node.parent = parent; - } - - return parent; -} diff --git a/node_modules/cheerio/src/parsers/parse5-adapter.ts b/node_modules/cheerio/src/parsers/parse5-adapter.ts deleted file mode 100644 index ca0d861..0000000 --- a/node_modules/cheerio/src/parsers/parse5-adapter.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { - type AnyNode, - type Document, - type ParentNode, - isDocument, -} from 'domhandler'; -import { parse as parseDocument, parseFragment, serializeOuter } from 'parse5'; -import { adapter as htmlparser2Adapter } from 'parse5-htmlparser2-tree-adapter'; -import type { InternalOptions } from '../options.js'; - -/** - * Parse the content with `parse5` in the context of the given `ParentNode`. - * - * @param content - The content to parse. - * @param options - A set of options to use to parse. - * @param isDocument - Whether to parse the content as a full HTML document. - * @param context - The context in which to parse the content. - * @returns The parsed content. - */ -export function parseWithParse5( - content: string, - options: InternalOptions, - isDocument: boolean, - context: ParentNode | null, -): Document { - options.treeAdapter ??= htmlparser2Adapter; - - if (options.scriptingEnabled !== false) { - options.scriptingEnabled = true; - } - - return isDocument - ? parseDocument(content, options) - : parseFragment(context, content, options); -} - -const renderOpts = { treeAdapter: htmlparser2Adapter }; - -/** - * Renders the given DOM tree with `parse5` and returns the result as a string. - * - * @param dom - The DOM tree to render. - * @returns The rendered document. - */ -export function renderWithParse5(dom: AnyNode | ArrayLike): string { - /* - * `dom-serializer` passes over the special "root" node and renders the - * node's children in its place. To mimic this behavior with `parse5`, an - * equivalent operation must be applied to the input array. - */ - const nodes = 'length' in dom ? dom : [dom]; - for (let index = 0; index < nodes.length; index += 1) { - const node = nodes[index]; - if (isDocument(node)) { - Array.prototype.splice.call(nodes, index, 1, ...node.children); - } - } - - let result = ''; - for (let index = 0; index < nodes.length; index += 1) { - const node = nodes[index]; - result += serializeOuter(node, renderOpts); - } - - return result; -} diff --git a/node_modules/cheerio/src/slim.ts b/node_modules/cheerio/src/slim.ts deleted file mode 100644 index 440d0a6..0000000 --- a/node_modules/cheerio/src/slim.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file Alternative entry point for Cheerio that always uses htmlparser2. This - * way, parse5 won't be loaded, saving some memory. - */ -import { type CheerioAPI, getLoad } from './load.js'; -import { type CheerioOptions } from './options.js'; -import { getParse } from './parse.js'; -import type { AnyNode } from 'domhandler'; -import render from 'dom-serializer'; -import { parseDocument } from 'htmlparser2'; - -export { contains, merge } from './static.js'; -export type * from './types.js'; -export type { Cheerio } from './cheerio.js'; -export type { CheerioOptions, HTMLParser2Options } from './options.js'; -export type { CheerioAPI } from './load.js'; - -/** - * Create a querying function, bound to a document created from the provided - * markup. - * - * @param content - Markup to be loaded. - * @param options - Options for the created instance. - * @param isDocument - Always `false` here, as we are always using - * `htmlparser2`. - * @returns The loaded document. - * @see {@link https://cheerio.js.org#loading} for additional usage information. - */ -export const load: ( - content: string | AnyNode | AnyNode[] | Buffer, - options?: CheerioOptions | null, - isDocument?: boolean, -) => CheerioAPI = getLoad(getParse(parseDocument), render); diff --git a/node_modules/cheerio/src/static.spec.ts b/node_modules/cheerio/src/static.spec.ts deleted file mode 100644 index 3f27234..0000000 --- a/node_modules/cheerio/src/static.spec.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { describe, it, expect, beforeEach } from 'vitest'; -import { cheerio, food, eleven } from './__fixtures__/fixtures.js'; -import { type CheerioAPI } from './index.js'; - -describe('cheerio', () => { - describe('.html', () => { - it('() : should return innerHTML; $.html(obj) should return outerHTML', () => { - const $div = cheerio( - 'div', - '
    foobar
    ', - ); - const span = $div.children()[1]; - expect(cheerio(span).html()).toBe('bar'); - expect(cheerio.html(span)).toBe('bar'); - }); - - it('() : should accept an object, an array, or a cheerio object', () => { - const $span = cheerio('foo'); - expect(cheerio.html($span[0])).toBe('foo'); - expect(cheerio.html($span)).toBe('foo'); - }); - - it('() : should be able to set to an empty string', () => { - const $elem = cheerio('foo').html(''); - expect(cheerio.html($elem)).toBe(''); - }); - - it('() : does not render the root element', () => { - const $ = cheerio.load(''); - expect(cheerio.html($.root())).toBe( - '', - ); - }); - - it('(, , ) : does not render the root element', () => { - const $ = cheerio.load('
    a div
    a span'); - const $collection = $('div').add($.root()).add('span'); - const expected = - '
    a div
    a span
    a div
    a span'; - expect(cheerio.html($collection)).toBe(expected); - }); - - it('() : does not crash with `null` as `this` value', () => { - const { html } = cheerio; - expect(html.call(null as never)).toBe(''); - expect(html.call(null as never, '#nothing')).toBe(''); - }); - }); - - describe('.text', () => { - it('(cheerio object) : should return the text contents of the specified elements', () => { - const $ = cheerio.load('This is content.'); - expect(cheerio.text($('a'))).toBe('This is content.'); - }); - - it('(cheerio object) : should omit comment nodes', () => { - const $ = cheerio.load( - 'This is not a comment.', - ); - expect(cheerio.text($('a'))).toBe('This is not a comment.'); - }); - - it('(cheerio object) : should include text contents of children recursively', () => { - const $ = cheerio.load( - 'This is
    a child with another child and not a comment followed by one last child and some final
    text.
    ', - ); - expect(cheerio.text($('a'))).toBe( - 'This is a child with another child and not a comment followed by one last child and some final text.', - ); - }); - - it('() : should return the rendered text content of the root', () => { - const $ = cheerio.load( - 'This is
    a child with another child and not a comment followed by one last child and some final
    text.
    ', - ); - expect(cheerio.text($.root())).toBe( - 'This is a child with another child and not a comment followed by one last child and some final text.', - ); - }); - - it('(cheerio object) : should not omit script tags', () => { - const $ = cheerio.load(''); - expect(cheerio.text($.root())).toBe('console.log("test")'); - }); - - it('(cheerio object) : should omit style tags', () => { - const $ = cheerio.load( - '', - ); - expect($.text()).toBe('.cf-hidden { display: none; }'); - }); - - it('() : does not crash with `null` as `this` value', () => { - const { text } = cheerio; - expect(text.call(null as never)).toBe(''); - }); - }); - - describe('.parseHTML', () => { - const $ = cheerio.load(''); - - it('() : returns null', () => { - expect($.parseHTML()).toBe(null); - }); - - it('(null) : returns null', () => { - expect($.parseHTML(null)).toBe(null); - }); - - it('("") : returns null', () => { - expect($.parseHTML('')).toBe(null); - }); - - it('(largeHtmlString) : parses large HTML strings', () => { - const html = '
    '.repeat(10); - const nodes = $.parseHTML(html); - - expect(nodes.length).toBe(10); - expect(nodes).toBeInstanceOf(Array); - }); - - it('("'; - expect($.parseHTML(html)).toHaveLength(0); - }); - - it('("'; - expect($.parseHTML(html, true)[0]).toHaveProperty('tagName', 'script'); - }); - - it('("scriptAndNonScript) : preserves non-script nodes', () => { - const html = '
    '; - expect($.parseHTML(html)[0]).toHaveProperty('tagName', 'div'); - }); - - it('(scriptAndNonScript, true) : Preserves script position', () => { - const html = '
    '; - expect($.parseHTML(html, true)[0]).toHaveProperty('tagName', 'script'); - }); - - it('(text) : returns a text node', () => { - expect($.parseHTML('text')[0].type).toBe('text'); - }); - - it('(>text) : preserves leading whitespace', () => { - expect($.parseHTML('\t
    ')[0]).toHaveProperty('data', '\t'); - }); - - it('( text) : Leading spaces are treated as text nodes', () => { - expect($.parseHTML('
    ')[0].type).toBe('text'); - }); - - it('(html) : should preserve content', () => { - const html = '
    test div
    '; - expect(cheerio($.parseHTML(html)[0]).html()).toBe('test div'); - }); - - it('(malformedHtml) : should not break', () => { - expect($.parseHTML('')).toHaveLength(1); - }); - - it('(garbageInput) : should not cause an error', () => { - expect( - $.parseHTML('<#if>

    This is a test.

    <#/if>'), - ).toBeTruthy(); - }); - - it('(text) : should return an array that is not effected by DOM manipulation methods', () => { - const $div = cheerio.load('
    '); - const elems = $div.parseHTML(''); - - $div('div').append(elems); - - expect(elems).toHaveLength(2); - }); - - it('(html, context) : should ignore context argument', () => { - const $div = cheerio.load('
    '); - const elems = $div.parseHTML('', { foo: 123 }); - - $div('div').append(elems); - - expect(elems).toHaveLength(1); - }); - - it('(html, context, keepScripts) : should ignore context argument', () => { - const $div = cheerio.load('
    '); - const elems = $div.parseHTML( - '', - { foo: 123 }, - true, - ); - - $div('div').append(elems); - - expect(elems).toHaveLength(2); - }); - }); - - describe('.merge', () => { - const $ = cheerio.load(''); - - it('should be a function', () => { - expect(typeof $.merge).toBe('function'); - }); - - it('(arraylike, arraylike) : should modify the first array, but not the second', () => { - const arr1 = [1, 2, 3]; - const arr2 = [4, 5, 6]; - - const ret = $.merge(arr1, arr2); - expect(typeof ret).toBe('object'); - expect(Array.isArray(ret)).toBe(true); - expect(ret).toBe(arr1); - expect(arr1).toHaveLength(6); - expect(arr2).toHaveLength(3); - }); - - it('(arraylike, arraylike) : should handle objects that arent arrays, but are arraylike', () => { - const arr1: ArrayLike = { - length: 3, - 0: 'a', - 1: 'b', - 2: 'c', - }; - const arr2 = { - length: 3, - 0: 'd', - 1: 'e', - 2: 'f', - }; - - $.merge(arr1, arr2); - expect(arr1).toHaveLength(6); - expect(arr1[3]).toBe('d'); - expect(arr1[4]).toBe('e'); - expect(arr1[5]).toBe('f'); - expect(arr2).toHaveLength(3); - }); - - it('(?, ?) : should gracefully reject invalid inputs', () => { - expect($.merge([4], 3 as never)).toBeFalsy(); - expect($.merge({} as never, {} as never)).toBeFalsy(); - expect($.merge([], {} as never)).toBeFalsy(); - expect($.merge({} as never, [])).toBeFalsy(); - const fakeArray1 = { length: 3, 0: 'a', 1: 'b', 3: 'd' }; - expect($.merge(fakeArray1, [])).toBeFalsy(); - expect($.merge([], fakeArray1)).toBeFalsy(); - expect($.merge({ length: '7' } as never, [])).toBeFalsy(); - expect($.merge({ length: -1 }, [])).toBeFalsy(); - }); - - it('(?, ?) : should no-op on invalid inputs', () => { - const fakeArray1 = { length: 3, 0: 'a', 1: 'b', 3: 'd' }; - $.merge(fakeArray1, []); - expect(fakeArray1).toHaveLength(3); - expect(fakeArray1[0]).toBe('a'); - expect(fakeArray1[1]).toBe('b'); - expect(fakeArray1[3]).toBe('d'); - $.merge([], fakeArray1); - expect(fakeArray1).toHaveLength(3); - expect(fakeArray1[0]).toBe('a'); - expect(fakeArray1[1]).toBe('b'); - expect(fakeArray1[3]).toBe('d'); - }); - }); - - describe('.contains', () => { - let $: CheerioAPI; - - beforeEach(() => { - $ = cheerio.load(food); - }); - - it('(container, contained) : should correctly detect the provided element', () => { - const $food = $('#food'); - const $fruits = $('#fruits'); - const $apple = $('.apple'); - - expect($.contains($food[0], $fruits[0])).toBe(true); - expect($.contains($food[0], $apple[0])).toBe(true); - }); - - it('(container, other) : should not detect elements that are not contained', () => { - const $fruits = $('#fruits'); - const $vegetables = $('#vegetables'); - const $apple = $('.apple'); - - expect($.contains($vegetables[0], $apple[0])).toBe(false); - expect($.contains($fruits[0], $vegetables[0])).toBe(false); - expect($.contains($vegetables[0], $fruits[0])).toBe(false); - expect($.contains($fruits[0], $fruits[0])).toBe(false); - expect($.contains($vegetables[0], $vegetables[0])).toBe(false); - }); - }); - - describe('.root', () => { - it('() : should return a cheerio-wrapped root object', () => { - const $ = cheerio.load('foo'); - $.root().append('
    '); - expect($.html()).toBe( - 'foo
    ', - ); - }); - }); - - describe('.extract', () => { - it('() : should extract values for selectors', () => { - const $ = cheerio.load(eleven); - - expect( - $.extract({ - red: [{ selector: '.red', value: 'outerHTML' }], - }), - ).toStrictEqual({ - red: [ - '
  • Four
  • ', - '
  • Five
  • ', - '
  • Nine
  • ', - ], - }); - }); - }); -}); diff --git a/node_modules/cheerio/src/static.ts b/node_modules/cheerio/src/static.ts deleted file mode 100644 index b26f213..0000000 --- a/node_modules/cheerio/src/static.ts +++ /dev/null @@ -1,312 +0,0 @@ -import type { BasicAcceptedElems } from './types.js'; -import type { CheerioAPI } from './load.js'; -import type { Cheerio } from './cheerio.js'; -import type { AnyNode, Document } from 'domhandler'; -import { textContent } from 'domutils'; -import { - type InternalOptions, - type CheerioOptions, - flattenOptions as flattenOptions, -} from './options.js'; -import type { ExtractedMap, ExtractMap } from './api/extract.js'; - -/** - * Helper function to render a DOM. - * - * @param that - Cheerio instance to render. - * @param dom - The DOM to render. Defaults to `that`'s root. - * @param options - Options for rendering. - * @returns The rendered document. - */ -function render( - that: CheerioAPI, - dom: BasicAcceptedElems | undefined, - options: InternalOptions, -): string { - if (!that) return ''; - - return that(dom ?? that._root.children, null, undefined, options).toString(); -} - -/** - * Checks if a passed object is an options object. - * - * @param dom - Object to check if it is an options object. - * @param options - Options object. - * @returns Whether the object is an options object. - */ -function isOptions( - dom?: BasicAcceptedElems | CheerioOptions | null, - options?: CheerioOptions, -): dom is CheerioOptions { - return ( - !options && - typeof dom === 'object' && - dom != null && - !('length' in dom) && - !('type' in dom) - ); -} - -/** - * Renders the document. - * - * @category Static - * @param options - Options for the renderer. - * @returns The rendered document. - */ -export function html(this: CheerioAPI, options?: CheerioOptions): string; -/** - * Renders the document. - * - * @category Static - * @param dom - Element to render. - * @param options - Options for the renderer. - * @returns The rendered document. - */ -export function html( - this: CheerioAPI, - dom?: BasicAcceptedElems, - options?: CheerioOptions, -): string; -export function html( - this: CheerioAPI, - dom?: BasicAcceptedElems | CheerioOptions, - options?: CheerioOptions, -): string { - /* - * Be flexible about parameters, sometimes we call html(), - * with options as only parameter - * check dom argument for dom element specific properties - * assume there is no 'length' or 'type' properties in the options object - */ - const toRender = isOptions(dom) ? ((options = dom), undefined) : dom; - - /* - * Sometimes `$.html()` is used without preloading html, - * so fallback non-existing options to the default ones. - */ - const opts = { - ...this?._options, - ...flattenOptions(options), - }; - - return render(this, toRender, opts); -} - -/** - * Render the document as XML. - * - * @category Static - * @param dom - Element to render. - * @returns THe rendered document. - */ -export function xml( - this: CheerioAPI, - dom?: BasicAcceptedElems, -): string { - const options = { ...this._options, xmlMode: true }; - - return render(this, dom, options); -} - -/** - * Render the document as text. - * - * This returns the `textContent` of the passed elements. The result will - * include the contents of ``. - this.sequenceIndex = Number(c === CharCodes.Lt); - } - }; - Tokenizer.prototype.stateCDATASequence = function (c) { - if (c === Sequences.Cdata[this.sequenceIndex]) { - if (++this.sequenceIndex === Sequences.Cdata.length) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CdataEnd; - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - } - } - else { - this.sequenceIndex = 0; - this.state = State.InDeclaration; - this.stateInDeclaration(c); // Reconsume the character - } - }; - /** - * When we wait for one specific character, we can speed things up - * by skipping through the buffer until we find it. - * - * @returns Whether the character was found. - */ - Tokenizer.prototype.fastForwardTo = function (c) { - while (++this.index < this.buffer.length + this.offset) { - if (this.buffer.charCodeAt(this.index - this.offset) === c) { - return true; - } - } - /* - * We increment the index at the end of the `parse` loop, - * so set it to `buffer.length - 1` here. - * - * TODO: Refactor `parse` to increment index before calling states. - */ - this.index = this.buffer.length + this.offset - 1; - return false; - }; - /** - * Comments and CDATA end with `-->` and `]]>`. - * - * Their common qualities are: - * - Their end sequences have a distinct character they start with. - * - That character is then repeated, so we have to check multiple repeats. - * - All characters but the start character of the sequence can be skipped. - */ - Tokenizer.prototype.stateInCommentLike = function (c) { - if (c === this.currentSequence[this.sequenceIndex]) { - if (++this.sequenceIndex === this.currentSequence.length) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, this.index, 2); - } - else { - this.cbs.oncomment(this.sectionStart, this.index, 2); - } - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - this.state = State.Text; - } - } - else if (this.sequenceIndex === 0) { - // Fast-forward to the first character of the sequence - if (this.fastForwardTo(this.currentSequence[0])) { - this.sequenceIndex = 1; - } - } - else if (c !== this.currentSequence[this.sequenceIndex - 1]) { - // Allow long sequences, eg. --->, ]]]> - this.sequenceIndex = 0; - } - }; - /** - * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. - * - * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). - * We allow anything that wouldn't end the tag. - */ - Tokenizer.prototype.isTagStartChar = function (c) { - return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c); - }; - Tokenizer.prototype.startSpecial = function (sequence, offset) { - this.isSpecial = true; - this.currentSequence = sequence; - this.sequenceIndex = offset; - this.state = State.SpecialStartSequence; - }; - Tokenizer.prototype.stateBeforeTagName = function (c) { - if (c === CharCodes.ExclamationMark) { - this.state = State.BeforeDeclaration; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Questionmark) { - this.state = State.InProcessingInstruction; - this.sectionStart = this.index + 1; - } - else if (this.isTagStartChar(c)) { - var lower = c | 0x20; - this.sectionStart = this.index; - if (this.xmlMode) { - this.state = State.InTagName; - } - else if (lower === Sequences.ScriptEnd[2]) { - this.state = State.BeforeSpecialS; - } - else if (lower === Sequences.TitleEnd[2]) { - this.state = State.BeforeSpecialT; - } - else { - this.state = State.InTagName; - } - } - else if (c === CharCodes.Slash) { - this.state = State.BeforeClosingTagName; - } - else { - this.state = State.Text; - this.stateText(c); - } - }; - Tokenizer.prototype.stateInTagName = function (c) { - if (isEndOfTagSection(c)) { - this.cbs.onopentagname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - }; - Tokenizer.prototype.stateBeforeClosingTagName = function (c) { - if (isWhitespace(c)) { - // Ignore - } - else if (c === CharCodes.Gt) { - this.state = State.Text; - } - else { - this.state = this.isTagStartChar(c) - ? State.InClosingTagName - : State.InSpecialComment; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateInClosingTagName = function (c) { - if (c === CharCodes.Gt || isWhitespace(c)) { - this.cbs.onclosetag(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.AfterClosingTagName; - this.stateAfterClosingTagName(c); - } - }; - Tokenizer.prototype.stateAfterClosingTagName = function (c) { - // Skip everything until ">" - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeAttributeName = function (c) { - if (c === CharCodes.Gt) { - this.cbs.onopentagend(this.index); - if (this.isSpecial) { - this.state = State.InSpecialTag; - this.sequenceIndex = 0; - } - else { - this.state = State.Text; - } - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Slash) { - this.state = State.InSelfClosingTag; - } - else if (!isWhitespace(c)) { - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateInSelfClosingTag = function (c) { - if (c === CharCodes.Gt) { - this.cbs.onselfclosingtag(this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - this.isSpecial = false; // Reset special state, in case of self-closing special tags - } - else if (!isWhitespace(c)) { - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - }; - Tokenizer.prototype.stateInAttributeName = function (c) { - if (c === CharCodes.Eq || isEndOfTagSection(c)) { - this.cbs.onattribname(this.sectionStart, this.index); - this.sectionStart = this.index; - this.state = State.AfterAttributeName; - this.stateAfterAttributeName(c); - } - }; - Tokenizer.prototype.stateAfterAttributeName = function (c) { - if (c === CharCodes.Eq) { - this.state = State.BeforeAttributeValue; - } - else if (c === CharCodes.Slash || c === CharCodes.Gt) { - this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); - this.sectionStart = -1; - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (!isWhitespace(c)) { - this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateBeforeAttributeValue = function (c) { - if (c === CharCodes.DoubleQuote) { - this.state = State.InAttributeValueDq; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.SingleQuote) { - this.state = State.InAttributeValueSq; - this.sectionStart = this.index + 1; - } - else if (!isWhitespace(c)) { - this.sectionStart = this.index; - this.state = State.InAttributeValueNq; - this.stateInAttributeValueNoQuotes(c); // Reconsume token - } - }; - Tokenizer.prototype.handleInAttributeValue = function (c, quote) { - if (c === quote || - (!this.decodeEntities && this.fastForwardTo(quote))) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(quote === CharCodes.DoubleQuote - ? QuoteType.Double - : QuoteType.Single, this.index + 1); - this.state = State.BeforeAttributeName; - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.startEntity(); - } - }; - Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) { - this.handleInAttributeValue(c, CharCodes.DoubleQuote); - }; - Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) { - this.handleInAttributeValue(c, CharCodes.SingleQuote); - }; - Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) { - if (isWhitespace(c) || c === CharCodes.Gt) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(QuoteType.Unquoted, this.index); - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.startEntity(); - } - }; - Tokenizer.prototype.stateBeforeDeclaration = function (c) { - if (c === CharCodes.OpeningSquareBracket) { - this.state = State.CDATASequence; - this.sequenceIndex = 0; - } - else { - this.state = - c === CharCodes.Dash - ? State.BeforeComment - : State.InDeclaration; - } - }; - Tokenizer.prototype.stateInDeclaration = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.ondeclaration(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateInProcessingInstruction = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.onprocessinginstruction(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeComment = function (c) { - if (c === CharCodes.Dash) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CommentEnd; - // Allow short comments (eg. ) - this.sequenceIndex = 2; - this.sectionStart = this.index + 1; - } - else { - this.state = State.InDeclaration; - } - }; - Tokenizer.prototype.stateInSpecialComment = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.oncomment(this.sectionStart, this.index, 0); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeSpecialS = function (c) { - var lower = c | 0x20; - if (lower === Sequences.ScriptEnd[3]) { - this.startSpecial(Sequences.ScriptEnd, 4); - } - else if (lower === Sequences.StyleEnd[3]) { - this.startSpecial(Sequences.StyleEnd, 4); - } - else { - this.state = State.InTagName; - this.stateInTagName(c); // Consume the token again - } - }; - Tokenizer.prototype.stateBeforeSpecialT = function (c) { - var lower = c | 0x20; - if (lower === Sequences.TitleEnd[3]) { - this.startSpecial(Sequences.TitleEnd, 4); - } - else if (lower === Sequences.TextareaEnd[3]) { - this.startSpecial(Sequences.TextareaEnd, 4); - } - else { - this.state = State.InTagName; - this.stateInTagName(c); // Consume the token again - } - }; - Tokenizer.prototype.startEntity = function () { - this.baseState = this.state; - this.state = State.InEntity; - this.entityStart = this.index; - this.entityDecoder.startEntity(this.xmlMode - ? decode_js_1.DecodingMode.Strict - : this.baseState === State.Text || - this.baseState === State.InSpecialTag - ? decode_js_1.DecodingMode.Legacy - : decode_js_1.DecodingMode.Attribute); - }; - Tokenizer.prototype.stateInEntity = function () { - var length = this.entityDecoder.write(this.buffer, this.index - this.offset); - // If `length` is positive, we are done with the entity. - if (length >= 0) { - this.state = this.baseState; - if (length === 0) { - this.index = this.entityStart; - } - } - else { - // Mark buffer as consumed. - this.index = this.offset + this.buffer.length - 1; - } - }; - /** - * Remove data that has already been consumed from the buffer. - */ - Tokenizer.prototype.cleanup = function () { - // If we are inside of text or attributes, emit what we already have. - if (this.running && this.sectionStart !== this.index) { - if (this.state === State.Text || - (this.state === State.InSpecialTag && this.sequenceIndex === 0)) { - this.cbs.ontext(this.sectionStart, this.index); - this.sectionStart = this.index; - } - else if (this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueNq) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = this.index; - } - } - }; - Tokenizer.prototype.shouldContinue = function () { - return this.index < this.buffer.length + this.offset && this.running; - }; - /** - * Iterates through the buffer, calling the function corresponding to the current state. - * - * States that are more likely to be hit are higher up, as a performance improvement. - */ - Tokenizer.prototype.parse = function () { - while (this.shouldContinue()) { - var c = this.buffer.charCodeAt(this.index - this.offset); - switch (this.state) { - case State.Text: { - this.stateText(c); - break; - } - case State.SpecialStartSequence: { - this.stateSpecialStartSequence(c); - break; - } - case State.InSpecialTag: { - this.stateInSpecialTag(c); - break; - } - case State.CDATASequence: { - this.stateCDATASequence(c); - break; - } - case State.InAttributeValueDq: { - this.stateInAttributeValueDoubleQuotes(c); - break; - } - case State.InAttributeName: { - this.stateInAttributeName(c); - break; - } - case State.InCommentLike: { - this.stateInCommentLike(c); - break; - } - case State.InSpecialComment: { - this.stateInSpecialComment(c); - break; - } - case State.BeforeAttributeName: { - this.stateBeforeAttributeName(c); - break; - } - case State.InTagName: { - this.stateInTagName(c); - break; - } - case State.InClosingTagName: { - this.stateInClosingTagName(c); - break; - } - case State.BeforeTagName: { - this.stateBeforeTagName(c); - break; - } - case State.AfterAttributeName: { - this.stateAfterAttributeName(c); - break; - } - case State.InAttributeValueSq: { - this.stateInAttributeValueSingleQuotes(c); - break; - } - case State.BeforeAttributeValue: { - this.stateBeforeAttributeValue(c); - break; - } - case State.BeforeClosingTagName: { - this.stateBeforeClosingTagName(c); - break; - } - case State.AfterClosingTagName: { - this.stateAfterClosingTagName(c); - break; - } - case State.BeforeSpecialS: { - this.stateBeforeSpecialS(c); - break; - } - case State.BeforeSpecialT: { - this.stateBeforeSpecialT(c); - break; - } - case State.InAttributeValueNq: { - this.stateInAttributeValueNoQuotes(c); - break; - } - case State.InSelfClosingTag: { - this.stateInSelfClosingTag(c); - break; - } - case State.InDeclaration: { - this.stateInDeclaration(c); - break; - } - case State.BeforeDeclaration: { - this.stateBeforeDeclaration(c); - break; - } - case State.BeforeComment: { - this.stateBeforeComment(c); - break; - } - case State.InProcessingInstruction: { - this.stateInProcessingInstruction(c); - break; - } - case State.InEntity: { - this.stateInEntity(); - break; - } - } - this.index++; - } - this.cleanup(); - }; - Tokenizer.prototype.finish = function () { - if (this.state === State.InEntity) { - this.entityDecoder.end(); - this.state = this.baseState; - } - this.handleTrailingData(); - this.cbs.onend(); - }; - /** Handle any trailing data. */ - Tokenizer.prototype.handleTrailingData = function () { - var endIndex = this.buffer.length + this.offset; - // If there is no remaining data, we are done. - if (this.sectionStart >= endIndex) { - return; - } - if (this.state === State.InCommentLike) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, endIndex, 0); - } - else { - this.cbs.oncomment(this.sectionStart, endIndex, 0); - } - } - else if (this.state === State.InTagName || - this.state === State.BeforeAttributeName || - this.state === State.BeforeAttributeValue || - this.state === State.AfterAttributeName || - this.state === State.InAttributeName || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueNq || - this.state === State.InClosingTagName) { - /* - * If we are currently in an opening or closing tag, us not calling the - * respective callback signals that the tag should be ignored. - */ - } - else { - this.cbs.ontext(this.sectionStart, endIndex); - } - }; - Tokenizer.prototype.emitCodePoint = function (cp, consumed) { - if (this.baseState !== State.Text && - this.baseState !== State.InSpecialTag) { - if (this.sectionStart < this.entityStart) { - this.cbs.onattribdata(this.sectionStart, this.entityStart); - } - this.sectionStart = this.entityStart + consumed; - this.index = this.sectionStart - 1; - this.cbs.onattribentity(cp); - } - else { - if (this.sectionStart < this.entityStart) { - this.cbs.ontext(this.sectionStart, this.entityStart); - } - this.sectionStart = this.entityStart + consumed; - this.index = this.sectionStart - 1; - this.cbs.ontextentity(cp, this.sectionStart); - } - }; - return Tokenizer; -}()); -exports.default = Tokenizer; -//# sourceMappingURL=Tokenizer.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/Tokenizer.js.map b/node_modules/htmlparser2/lib/Tokenizer.js.map deleted file mode 100644 index 59b8871..0000000 --- a/node_modules/htmlparser2/lib/Tokenizer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tokenizer.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["Tokenizer.ts"],"names":[],"mappings":";;;AAAA,oDAKgC;AAEhC,IAAW,SA4BV;AA5B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C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAEO,iCAAa,GAArB,UAAsB,EAAU,EAAE,QAAgB;QAC9C,IACI,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,IAAI;YAC7B,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,EACvC,CAAC;YACC,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/D,CAAC;YACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAEnC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACJ,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAEnC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IACL,gBAAC;AAAD,CAAC,AAtsBD,IAssBC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.d.ts b/node_modules/htmlparser2/lib/WritableStream.d.ts deleted file mode 100644 index 0459e27..0000000 --- a/node_modules/htmlparser2/lib/WritableStream.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -/// -import { type Handler, type ParserOptions } from "./Parser.js"; -import { Writable } from "node:stream"; -/** - * WritableStream makes the `Parser` interface available as a NodeJS stream. - * - * @see Parser - */ -export declare class WritableStream extends Writable { - private readonly _parser; - private readonly _decoder; - constructor(cbs: Partial, options?: ParserOptions); - _write(chunk: string | Buffer, encoding: string, callback: () => void): void; - _final(callback: () => void): void; -} -//# sourceMappingURL=WritableStream.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.d.ts.map b/node_modules/htmlparser2/lib/WritableStream.d.ts.map deleted file mode 100644 index dccb10e..0000000 --- a/node_modules/htmlparser2/lib/WritableStream.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WritableStream.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["WritableStream.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAKvE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;gBAEpC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa;IAKjD,MAAM,CACX,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,IAAI,GACrB,IAAI;IAOE,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CAI9C"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.js b/node_modules/htmlparser2/lib/WritableStream.js deleted file mode 100644 index 3614c31..0000000 --- a/node_modules/htmlparser2/lib/WritableStream.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WritableStream = void 0; -var Parser_js_1 = require("./Parser.js"); -/* - * NOTE: If either of these two imports produces a type error, - * please update your @types/node dependency! - */ -var node_stream_1 = require("node:stream"); -var node_string_decoder_1 = require("node:string_decoder"); -// Following the example in https://nodejs.org/api/stream.html#stream_decoding_buffers_in_a_writable_stream -function isBuffer(_chunk, encoding) { - return encoding === "buffer"; -} -/** - * WritableStream makes the `Parser` interface available as a NodeJS stream. - * - * @see Parser - */ -var WritableStream = /** @class */ (function (_super) { - __extends(WritableStream, _super); - function WritableStream(cbs, options) { - var _this = _super.call(this, { decodeStrings: false }) || this; - _this._decoder = new node_string_decoder_1.StringDecoder(); - _this._parser = new Parser_js_1.Parser(cbs, options); - return _this; - } - WritableStream.prototype._write = function (chunk, encoding, callback) { - this._parser.write(isBuffer(chunk, encoding) ? this._decoder.write(chunk) : chunk); - callback(); - }; - WritableStream.prototype._final = function (callback) { - this._parser.end(this._decoder.end()); - callback(); - }; - return WritableStream; -}(node_stream_1.Writable)); -exports.WritableStream = WritableStream; -//# sourceMappingURL=WritableStream.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.js.map b/node_modules/htmlparser2/lib/WritableStream.js.map deleted file mode 100644 index a33c95d..0000000 --- a/node_modules/htmlparser2/lib/WritableStream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WritableStream.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["WritableStream.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yCAAuE;AACvE;;;GAGG;AACH,2CAAuC;AACvC,2DAAoD;AAEpD,2GAA2G;AAC3G,SAAS,QAAQ,CAAC,MAAuB,EAAE,QAAgB;IACvD,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH;IAAoC,kCAAQ;IAIxC,wBAAY,GAAqB,EAAE,OAAuB;QACtD,YAAA,MAAK,YAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,SAAC;QAHnB,cAAQ,GAAG,IAAI,mCAAa,EAAE,CAAC;QAI5C,KAAI,CAAC,OAAO,GAAG,IAAI,kBAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;IAC5C,CAAC;IAEQ,+BAAM,GAAf,UACI,KAAsB,EACtB,QAAgB,EAChB,QAAoB;QAEpB,IAAI,CAAC,OAAO,CAAC,KAAK,CACd,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;QACF,QAAQ,EAAE,CAAC;IACf,CAAC;IAEQ,+BAAM,GAAf,UAAgB,QAAoB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE,CAAC;IACf,CAAC;IACL,qBAAC;AAAD,CAAC,AAxBD,CAAoC,sBAAQ,GAwB3C;AAxBY,wCAAc"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/Parser.d.ts b/node_modules/htmlparser2/lib/esm/Parser.d.ts deleted file mode 100644 index b617674..0000000 --- a/node_modules/htmlparser2/lib/esm/Parser.d.ts +++ /dev/null @@ -1,198 +0,0 @@ -import Tokenizer, { type Callbacks, QuoteType } from "./Tokenizer.js"; -export interface ParserOptions { - /** - * Indicates whether special tags (``. - this.sequenceIndex = Number(c === CharCodes.Lt); - } - } - stateCDATASequence(c) { - if (c === Sequences.Cdata[this.sequenceIndex]) { - if (++this.sequenceIndex === Sequences.Cdata.length) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CdataEnd; - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - } - } - else { - this.sequenceIndex = 0; - this.state = State.InDeclaration; - this.stateInDeclaration(c); // Reconsume the character - } - } - /** - * When we wait for one specific character, we can speed things up - * by skipping through the buffer until we find it. - * - * @returns Whether the character was found. - */ - fastForwardTo(c) { - while (++this.index < this.buffer.length + this.offset) { - if (this.buffer.charCodeAt(this.index - this.offset) === c) { - return true; - } - } - /* - * We increment the index at the end of the `parse` loop, - * so set it to `buffer.length - 1` here. - * - * TODO: Refactor `parse` to increment index before calling states. - */ - this.index = this.buffer.length + this.offset - 1; - return false; - } - /** - * Comments and CDATA end with `-->` and `]]>`. - * - * Their common qualities are: - * - Their end sequences have a distinct character they start with. - * - That character is then repeated, so we have to check multiple repeats. - * - All characters but the start character of the sequence can be skipped. - */ - stateInCommentLike(c) { - if (c === this.currentSequence[this.sequenceIndex]) { - if (++this.sequenceIndex === this.currentSequence.length) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, this.index, 2); - } - else { - this.cbs.oncomment(this.sectionStart, this.index, 2); - } - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - this.state = State.Text; - } - } - else if (this.sequenceIndex === 0) { - // Fast-forward to the first character of the sequence - if (this.fastForwardTo(this.currentSequence[0])) { - this.sequenceIndex = 1; - } - } - else if (c !== this.currentSequence[this.sequenceIndex - 1]) { - // Allow long sequences, eg. --->, ]]]> - this.sequenceIndex = 0; - } - } - /** - * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. - * - * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). - * We allow anything that wouldn't end the tag. - */ - isTagStartChar(c) { - return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c); - } - startSpecial(sequence, offset) { - this.isSpecial = true; - this.currentSequence = sequence; - this.sequenceIndex = offset; - this.state = State.SpecialStartSequence; - } - stateBeforeTagName(c) { - if (c === CharCodes.ExclamationMark) { - this.state = State.BeforeDeclaration; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Questionmark) { - this.state = State.InProcessingInstruction; - this.sectionStart = this.index + 1; - } - else if (this.isTagStartChar(c)) { - const lower = c | 0x20; - this.sectionStart = this.index; - if (this.xmlMode) { - this.state = State.InTagName; - } - else if (lower === Sequences.ScriptEnd[2]) { - this.state = State.BeforeSpecialS; - } - else if (lower === Sequences.TitleEnd[2]) { - this.state = State.BeforeSpecialT; - } - else { - this.state = State.InTagName; - } - } - else if (c === CharCodes.Slash) { - this.state = State.BeforeClosingTagName; - } - else { - this.state = State.Text; - this.stateText(c); - } - } - stateInTagName(c) { - if (isEndOfTagSection(c)) { - this.cbs.onopentagname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - } - stateBeforeClosingTagName(c) { - if (isWhitespace(c)) { - // Ignore - } - else if (c === CharCodes.Gt) { - this.state = State.Text; - } - else { - this.state = this.isTagStartChar(c) - ? State.InClosingTagName - : State.InSpecialComment; - this.sectionStart = this.index; - } - } - stateInClosingTagName(c) { - if (c === CharCodes.Gt || isWhitespace(c)) { - this.cbs.onclosetag(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.AfterClosingTagName; - this.stateAfterClosingTagName(c); - } - } - stateAfterClosingTagName(c) { - // Skip everything until ">" - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.state = State.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeAttributeName(c) { - if (c === CharCodes.Gt) { - this.cbs.onopentagend(this.index); - if (this.isSpecial) { - this.state = State.InSpecialTag; - this.sequenceIndex = 0; - } - else { - this.state = State.Text; - } - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Slash) { - this.state = State.InSelfClosingTag; - } - else if (!isWhitespace(c)) { - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - } - stateInSelfClosingTag(c) { - if (c === CharCodes.Gt) { - this.cbs.onselfclosingtag(this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - this.isSpecial = false; // Reset special state, in case of self-closing special tags - } - else if (!isWhitespace(c)) { - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - } - stateInAttributeName(c) { - if (c === CharCodes.Eq || isEndOfTagSection(c)) { - this.cbs.onattribname(this.sectionStart, this.index); - this.sectionStart = this.index; - this.state = State.AfterAttributeName; - this.stateAfterAttributeName(c); - } - } - stateAfterAttributeName(c) { - if (c === CharCodes.Eq) { - this.state = State.BeforeAttributeValue; - } - else if (c === CharCodes.Slash || c === CharCodes.Gt) { - this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); - this.sectionStart = -1; - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (!isWhitespace(c)) { - this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - } - stateBeforeAttributeValue(c) { - if (c === CharCodes.DoubleQuote) { - this.state = State.InAttributeValueDq; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.SingleQuote) { - this.state = State.InAttributeValueSq; - this.sectionStart = this.index + 1; - } - else if (!isWhitespace(c)) { - this.sectionStart = this.index; - this.state = State.InAttributeValueNq; - this.stateInAttributeValueNoQuotes(c); // Reconsume token - } - } - handleInAttributeValue(c, quote) { - if (c === quote || - (!this.decodeEntities && this.fastForwardTo(quote))) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(quote === CharCodes.DoubleQuote - ? QuoteType.Double - : QuoteType.Single, this.index + 1); - this.state = State.BeforeAttributeName; - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.startEntity(); - } - } - stateInAttributeValueDoubleQuotes(c) { - this.handleInAttributeValue(c, CharCodes.DoubleQuote); - } - stateInAttributeValueSingleQuotes(c) { - this.handleInAttributeValue(c, CharCodes.SingleQuote); - } - stateInAttributeValueNoQuotes(c) { - if (isWhitespace(c) || c === CharCodes.Gt) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(QuoteType.Unquoted, this.index); - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.startEntity(); - } - } - stateBeforeDeclaration(c) { - if (c === CharCodes.OpeningSquareBracket) { - this.state = State.CDATASequence; - this.sequenceIndex = 0; - } - else { - this.state = - c === CharCodes.Dash - ? State.BeforeComment - : State.InDeclaration; - } - } - stateInDeclaration(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.ondeclaration(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - } - stateInProcessingInstruction(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.onprocessinginstruction(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeComment(c) { - if (c === CharCodes.Dash) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CommentEnd; - // Allow short comments (eg. ) - this.sequenceIndex = 2; - this.sectionStart = this.index + 1; - } - else { - this.state = State.InDeclaration; - } - } - stateInSpecialComment(c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.oncomment(this.sectionStart, this.index, 0); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - } - stateBeforeSpecialS(c) { - const lower = c | 0x20; - if (lower === Sequences.ScriptEnd[3]) { - this.startSpecial(Sequences.ScriptEnd, 4); - } - else if (lower === Sequences.StyleEnd[3]) { - this.startSpecial(Sequences.StyleEnd, 4); - } - else { - this.state = State.InTagName; - this.stateInTagName(c); // Consume the token again - } - } - stateBeforeSpecialT(c) { - const lower = c | 0x20; - if (lower === Sequences.TitleEnd[3]) { - this.startSpecial(Sequences.TitleEnd, 4); - } - else if (lower === Sequences.TextareaEnd[3]) { - this.startSpecial(Sequences.TextareaEnd, 4); - } - else { - this.state = State.InTagName; - this.stateInTagName(c); // Consume the token again - } - } - startEntity() { - this.baseState = this.state; - this.state = State.InEntity; - this.entityStart = this.index; - this.entityDecoder.startEntity(this.xmlMode - ? DecodingMode.Strict - : this.baseState === State.Text || - this.baseState === State.InSpecialTag - ? DecodingMode.Legacy - : DecodingMode.Attribute); - } - stateInEntity() { - const length = this.entityDecoder.write(this.buffer, this.index - this.offset); - // If `length` is positive, we are done with the entity. - if (length >= 0) { - this.state = this.baseState; - if (length === 0) { - this.index = this.entityStart; - } - } - else { - // Mark buffer as consumed. - this.index = this.offset + this.buffer.length - 1; - } - } - /** - * Remove data that has already been consumed from the buffer. - */ - cleanup() { - // If we are inside of text or attributes, emit what we already have. - if (this.running && this.sectionStart !== this.index) { - if (this.state === State.Text || - (this.state === State.InSpecialTag && this.sequenceIndex === 0)) { - this.cbs.ontext(this.sectionStart, this.index); - this.sectionStart = this.index; - } - else if (this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueNq) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = this.index; - } - } - } - shouldContinue() { - return this.index < this.buffer.length + this.offset && this.running; - } - /** - * Iterates through the buffer, calling the function corresponding to the current state. - * - * States that are more likely to be hit are higher up, as a performance improvement. - */ - parse() { - while (this.shouldContinue()) { - const c = this.buffer.charCodeAt(this.index - this.offset); - switch (this.state) { - case State.Text: { - this.stateText(c); - break; - } - case State.SpecialStartSequence: { - this.stateSpecialStartSequence(c); - break; - } - case State.InSpecialTag: { - this.stateInSpecialTag(c); - break; - } - case State.CDATASequence: { - this.stateCDATASequence(c); - break; - } - case State.InAttributeValueDq: { - this.stateInAttributeValueDoubleQuotes(c); - break; - } - case State.InAttributeName: { - this.stateInAttributeName(c); - break; - } - case State.InCommentLike: { - this.stateInCommentLike(c); - break; - } - case State.InSpecialComment: { - this.stateInSpecialComment(c); - break; - } - case State.BeforeAttributeName: { - this.stateBeforeAttributeName(c); - break; - } - case State.InTagName: { - this.stateInTagName(c); - break; - } - case State.InClosingTagName: { - this.stateInClosingTagName(c); - break; - } - case State.BeforeTagName: { - this.stateBeforeTagName(c); - break; - } - case State.AfterAttributeName: { - this.stateAfterAttributeName(c); - break; - } - case State.InAttributeValueSq: { - this.stateInAttributeValueSingleQuotes(c); - break; - } - case State.BeforeAttributeValue: { - this.stateBeforeAttributeValue(c); - break; - } - case State.BeforeClosingTagName: { - this.stateBeforeClosingTagName(c); - break; - } - case State.AfterClosingTagName: { - this.stateAfterClosingTagName(c); - break; - } - case State.BeforeSpecialS: { - this.stateBeforeSpecialS(c); - break; - } - case State.BeforeSpecialT: { - this.stateBeforeSpecialT(c); - break; - } - case State.InAttributeValueNq: { - this.stateInAttributeValueNoQuotes(c); - break; - } - case State.InSelfClosingTag: { - this.stateInSelfClosingTag(c); - break; - } - case State.InDeclaration: { - this.stateInDeclaration(c); - break; - } - case State.BeforeDeclaration: { - this.stateBeforeDeclaration(c); - break; - } - case State.BeforeComment: { - this.stateBeforeComment(c); - break; - } - case State.InProcessingInstruction: { - this.stateInProcessingInstruction(c); - break; - } - case State.InEntity: { - this.stateInEntity(); - break; - } - } - this.index++; - } - this.cleanup(); - } - finish() { - if (this.state === State.InEntity) { - this.entityDecoder.end(); - this.state = this.baseState; - } - this.handleTrailingData(); - this.cbs.onend(); - } - /** Handle any trailing data. */ - handleTrailingData() { - const endIndex = this.buffer.length + this.offset; - // If there is no remaining data, we are done. - if (this.sectionStart >= endIndex) { - return; - } - if (this.state === State.InCommentLike) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, endIndex, 0); - } - else { - this.cbs.oncomment(this.sectionStart, endIndex, 0); - } - } - else if (this.state === State.InTagName || - this.state === State.BeforeAttributeName || - this.state === State.BeforeAttributeValue || - this.state === State.AfterAttributeName || - this.state === State.InAttributeName || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueNq || - this.state === State.InClosingTagName) { - /* - * If we are currently in an opening or closing tag, us not calling the - * respective callback signals that the tag should be ignored. - */ - } - else { - this.cbs.ontext(this.sectionStart, endIndex); - } - } - emitCodePoint(cp, consumed) { - if (this.baseState !== State.Text && - this.baseState !== State.InSpecialTag) { - if (this.sectionStart < this.entityStart) { - this.cbs.onattribdata(this.sectionStart, this.entityStart); - } - this.sectionStart = this.entityStart + consumed; - this.index = this.sectionStart - 1; - this.cbs.onattribentity(cp); - } - else { - if (this.sectionStart < this.entityStart) { - this.cbs.ontext(this.sectionStart, this.entityStart); - } - this.sectionStart = this.entityStart + consumed; - this.index = this.sectionStart - 1; - this.cbs.ontextentity(cp, this.sectionStart); - } - } -} -//# sourceMappingURL=Tokenizer.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/Tokenizer.js.map b/node_modules/htmlparser2/lib/esm/Tokenizer.js.map deleted file mode 100644 index 01b7b49..0000000 --- a/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tokenizer.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["Tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAEhC,IAAW,SA4BV;AA5BD,WAAW,SAAS;IAChB,uCAAS,CAAA;IACT,gDAAa,CAAA;IACb,kDAAc,CAAA;IACd,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,GAAG,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAEnC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACJ,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAEnC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/WritableStream.d.ts b/node_modules/htmlparser2/lib/esm/WritableStream.d.ts deleted file mode 100644 index 0459e27..0000000 --- a/node_modules/htmlparser2/lib/esm/WritableStream.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -/// -import { type Handler, type ParserOptions } from "./Parser.js"; -import { Writable } from "node:stream"; -/** - * WritableStream makes the `Parser` interface available as a NodeJS stream. - * - * @see Parser - */ -export declare class WritableStream extends Writable { - private readonly _parser; - private readonly _decoder; - constructor(cbs: Partial, options?: ParserOptions); - _write(chunk: string | Buffer, encoding: string, callback: () => void): void; - _final(callback: () => void): void; -} -//# sourceMappingURL=WritableStream.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/WritableStream.d.ts.map b/node_modules/htmlparser2/lib/esm/WritableStream.d.ts.map deleted file mode 100644 index dccb10e..0000000 --- a/node_modules/htmlparser2/lib/esm/WritableStream.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WritableStream.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["WritableStream.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAKvE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;gBAEpC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa;IAKjD,MAAM,CACX,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,IAAI,GACrB,IAAI;IAOE,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CAI9C"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/WritableStream.js b/node_modules/htmlparser2/lib/esm/WritableStream.js deleted file mode 100644 index bf6093e..0000000 --- a/node_modules/htmlparser2/lib/esm/WritableStream.js +++ /dev/null @@ -1,32 +0,0 @@ -import { Parser } from "./Parser.js"; -/* - * NOTE: If either of these two imports produces a type error, - * please update your @types/node dependency! - */ -import { Writable } from "node:stream"; -import { StringDecoder } from "node:string_decoder"; -// Following the example in https://nodejs.org/api/stream.html#stream_decoding_buffers_in_a_writable_stream -function isBuffer(_chunk, encoding) { - return encoding === "buffer"; -} -/** - * WritableStream makes the `Parser` interface available as a NodeJS stream. - * - * @see Parser - */ -export class WritableStream extends Writable { - constructor(cbs, options) { - super({ decodeStrings: false }); - this._decoder = new StringDecoder(); - this._parser = new Parser(cbs, options); - } - _write(chunk, encoding, callback) { - this._parser.write(isBuffer(chunk, encoding) ? this._decoder.write(chunk) : chunk); - callback(); - } - _final(callback) { - this._parser.end(this._decoder.end()); - callback(); - } -} -//# sourceMappingURL=WritableStream.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/WritableStream.js.map b/node_modules/htmlparser2/lib/esm/WritableStream.js.map deleted file mode 100644 index 22eba8e..0000000 --- a/node_modules/htmlparser2/lib/esm/WritableStream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WritableStream.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["WritableStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoC,MAAM,aAAa,CAAC;AACvE;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,2GAA2G;AAC3G,SAAS,QAAQ,CAAC,MAAuB,EAAE,QAAgB;IACvD,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAIxC,YAAY,GAAqB,EAAE,OAAuB;QACtD,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAHnB,aAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAI5C,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEQ,MAAM,CACX,KAAsB,EACtB,QAAgB,EAChB,QAAoB;QAEpB,IAAI,CAAC,OAAO,CAAC,KAAK,CACd,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;QACF,QAAQ,EAAE,CAAC;IACf,CAAC;IAEQ,MAAM,CAAC,QAAoB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE,CAAC;IACf,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/index.d.ts b/node_modules/htmlparser2/lib/esm/index.d.ts deleted file mode 100644 index c906b7f..0000000 --- a/node_modules/htmlparser2/lib/esm/index.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Parser, type ParserOptions } from "./Parser.js"; -export type { Handler, ParserOptions } from "./Parser.js"; -export { Parser } from "./Parser.js"; -import { type DomHandlerOptions, type ChildNode, type Element, type Document } from "domhandler"; -export { DomHandler, DomHandler as DefaultHandler, type DomHandlerOptions, } from "domhandler"; -export type Options = ParserOptions & DomHandlerOptions; -/** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - */ -export declare function parseDocument(data: string, options?: Options): Document; -/** - * Parses data, returns an array of the root nodes. - * - * Note that the root nodes still have a `Document` node as their parent. - * Use `parseDocument` to get the `Document` node instead. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - * @deprecated Use `parseDocument` instead. - */ -export declare function parseDOM(data: string, options?: Options): ChildNode[]; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with the resulting document. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - */ -export declare function createDocumentStream(callback: (error: Error | null, document: Document) => void, options?: Options, elementCallback?: (element: Element) => void): Parser; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with an array of root nodes. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - * @deprecated Use `createDocumentStream` instead. - */ -export declare function createDomStream(callback: (error: Error | null, dom: ChildNode[]) => void, options?: Options, elementCallback?: (element: Element) => void): Parser; -export { default as Tokenizer, type Callbacks as TokenizerCallbacks, QuoteType, } from "./Tokenizer.js"; -export * as ElementType from "domelementtype"; -import { type Feed } from "domutils"; -export { getFeed, type Feed } from "domutils"; -/** - * Parse a feed. - * - * @param feed The feed that should be parsed, as a string. - * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`. - */ -export declare function parseFeed(feed: string, options?: Options): Feed | null; -export * as DomUtils from "domutils"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/index.d.ts.map b/node_modules/htmlparser2/lib/esm/index.d.ts.map deleted file mode 100644 index a3745e3..0000000 --- a/node_modules/htmlparser2/lib/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,QAAQ,EAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACH,UAAU,EAEV,UAAU,IAAI,cAAc,EAC5B,KAAK,iBAAiB,GACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAIxD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAIvE;AACD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,CAErE;AACD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,EAC3D,OAAO,CAAC,EAAE,OAAO,EACjB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC7C,MAAM,CAOR;AACD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,IAAI,EACzD,OAAO,CAAC,EAAE,OAAO,EACjB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC7C,MAAM,CAGR;AAED,OAAO,EACH,OAAO,IAAI,SAAS,EACpB,KAAK,SAAS,IAAI,kBAAkB,EACpC,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAW,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAI9C;;;;;GAKG;AACH,wBAAgB,SAAS,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAiC,GAC3C,IAAI,GAAG,IAAI,CAEb;AAED,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/index.js b/node_modules/htmlparser2/lib/esm/index.js deleted file mode 100644 index 38bfe96..0000000 --- a/node_modules/htmlparser2/lib/esm/index.js +++ /dev/null @@ -1,74 +0,0 @@ -import { Parser } from "./Parser.js"; -export { Parser } from "./Parser.js"; -import { DomHandler, } from "domhandler"; -export { DomHandler, -// Old name for DomHandler -DomHandler as DefaultHandler, } from "domhandler"; -// Helper methods -/** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - */ -export function parseDocument(data, options) { - const handler = new DomHandler(undefined, options); - new Parser(handler, options).end(data); - return handler.root; -} -/** - * Parses data, returns an array of the root nodes. - * - * Note that the root nodes still have a `Document` node as their parent. - * Use `parseDocument` to get the `Document` node instead. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - * @deprecated Use `parseDocument` instead. - */ -export function parseDOM(data, options) { - return parseDocument(data, options).children; -} -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with the resulting document. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - */ -export function createDocumentStream(callback, options, elementCallback) { - const handler = new DomHandler((error) => callback(error, handler.root), options, elementCallback); - return new Parser(handler, options); -} -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with an array of root nodes. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - * @deprecated Use `createDocumentStream` instead. - */ -export function createDomStream(callback, options, elementCallback) { - const handler = new DomHandler(callback, options, elementCallback); - return new Parser(handler, options); -} -export { default as Tokenizer, QuoteType, } from "./Tokenizer.js"; -/* - * All of the following exports exist for backwards-compatibility. - * They should probably be removed eventually. - */ -export * as ElementType from "domelementtype"; -import { getFeed } from "domutils"; -export { getFeed } from "domutils"; -const parseFeedDefaultOptions = { xmlMode: true }; -/** - * Parse a feed. - * - * @param feed The feed that should be parsed, as a string. - * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`. - */ -export function parseFeed(feed, options = parseFeedDefaultOptions) { - return getFeed(parseDOM(feed, options)); -} -export * as DomUtils from "domutils"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/index.js.map b/node_modules/htmlparser2/lib/esm/index.js.map deleted file mode 100644 index e6c9566..0000000 --- a/node_modules/htmlparser2/lib/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EACH,UAAU,GAKb,MAAM,YAAY,CAAC;AAEpB,OAAO,EACH,UAAU;AACV,0BAA0B;AAC1B,UAAU,IAAI,cAAc,GAE/B,MAAM,YAAY,CAAC;AAIpB,iBAAiB;AAEjB;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,OAAiB;IACzD,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC;AACD;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,OAAiB;IACpD,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC;AACjD,CAAC;AACD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAChC,QAA2D,EAC3D,OAAiB,EACjB,eAA4C;IAE5C,MAAM,OAAO,GAAe,IAAI,UAAU,CACtC,CAAC,KAAmB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EACtD,OAAO,EACP,eAAe,CAClB,CAAC;IACF,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AACD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC3B,QAAyD,EACzD,OAAiB,EACjB,eAA4C;IAE5C,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IACnE,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,OAAO,EACH,OAAO,IAAI,SAAS,EAEpB,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAa,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAa,MAAM,UAAU,CAAC;AAE9C,MAAM,uBAAuB,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACrB,IAAY,EACZ,UAAmB,uBAAuB;IAE1C,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/esm/package.json b/node_modules/htmlparser2/lib/esm/package.json deleted file mode 100644 index 089153b..0000000 --- a/node_modules/htmlparser2/lib/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} diff --git a/node_modules/htmlparser2/lib/index.d.ts b/node_modules/htmlparser2/lib/index.d.ts deleted file mode 100644 index c906b7f..0000000 --- a/node_modules/htmlparser2/lib/index.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Parser, type ParserOptions } from "./Parser.js"; -export type { Handler, ParserOptions } from "./Parser.js"; -export { Parser } from "./Parser.js"; -import { type DomHandlerOptions, type ChildNode, type Element, type Document } from "domhandler"; -export { DomHandler, DomHandler as DefaultHandler, type DomHandlerOptions, } from "domhandler"; -export type Options = ParserOptions & DomHandlerOptions; -/** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - */ -export declare function parseDocument(data: string, options?: Options): Document; -/** - * Parses data, returns an array of the root nodes. - * - * Note that the root nodes still have a `Document` node as their parent. - * Use `parseDocument` to get the `Document` node instead. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - * @deprecated Use `parseDocument` instead. - */ -export declare function parseDOM(data: string, options?: Options): ChildNode[]; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with the resulting document. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - */ -export declare function createDocumentStream(callback: (error: Error | null, document: Document) => void, options?: Options, elementCallback?: (element: Element) => void): Parser; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with an array of root nodes. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - * @deprecated Use `createDocumentStream` instead. - */ -export declare function createDomStream(callback: (error: Error | null, dom: ChildNode[]) => void, options?: Options, elementCallback?: (element: Element) => void): Parser; -export { default as Tokenizer, type Callbacks as TokenizerCallbacks, QuoteType, } from "./Tokenizer.js"; -export * as ElementType from "domelementtype"; -import { type Feed } from "domutils"; -export { getFeed, type Feed } from "domutils"; -/** - * Parse a feed. - * - * @param feed The feed that should be parsed, as a string. - * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`. - */ -export declare function parseFeed(feed: string, options?: Options): Feed | null; -export * as DomUtils from "domutils"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/index.d.ts.map b/node_modules/htmlparser2/lib/index.d.ts.map deleted file mode 100644 index a3745e3..0000000 --- a/node_modules/htmlparser2/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2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S,EACpB,KAAK,SAAS,IAAI,kBAAkB,EACpC,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAW,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAI9C;;;;;GAKG;AACH,wBAAgB,SAAS,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAiC,GAC3C,IAAI,GAAG,IAAI,CAEb;AAED,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/index.js b/node_modules/htmlparser2/lib/index.js deleted file mode 100644 index a56fb98..0000000 --- a/node_modules/htmlparser2/lib/index.js +++ /dev/null @@ -1,114 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.QuoteType = exports.Tokenizer = exports.createDomStream = exports.createDocumentStream = exports.parseDOM = exports.parseDocument = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0; -var Parser_js_1 = require("./Parser.js"); -var Parser_js_2 = require("./Parser.js"); -Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_js_2.Parser; } }); -var domhandler_1 = require("domhandler"); -var domhandler_2 = require("domhandler"); -Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } }); -// Old name for DomHandler -Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } }); -// Helper methods -/** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - */ -function parseDocument(data, options) { - var handler = new domhandler_1.DomHandler(undefined, options); - new Parser_js_1.Parser(handler, options).end(data); - return handler.root; -} -exports.parseDocument = parseDocument; -/** - * Parses data, returns an array of the root nodes. - * - * Note that the root nodes still have a `Document` node as their parent. - * Use `parseDocument` to get the `Document` node instead. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM handler. - * @deprecated Use `parseDocument` instead. - */ -function parseDOM(data, options) { - return parseDocument(data, options).children; -} -exports.parseDOM = parseDOM; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with the resulting document. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - */ -function createDocumentStream(callback, options, elementCallback) { - var handler = new domhandler_1.DomHandler(function (error) { return callback(error, handler.root); }, options, elementCallback); - return new Parser_js_1.Parser(handler, options); -} -exports.createDocumentStream = createDocumentStream; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param callback A callback that will be called once parsing has been completed, with an array of root nodes. - * @param options Optional options for the parser and DOM handler. - * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM. - * @deprecated Use `createDocumentStream` instead. - */ -function createDomStream(callback, options, elementCallback) { - var handler = new domhandler_1.DomHandler(callback, options, elementCallback); - return new Parser_js_1.Parser(handler, options); -} -exports.createDomStream = createDomStream; -var Tokenizer_js_1 = require("./Tokenizer.js"); -Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } }); -Object.defineProperty(exports, "QuoteType", { enumerable: true, get: function () { return Tokenizer_js_1.QuoteType; } }); -/* - * All of the following exports exist for backwards-compatibility. - * They should probably be removed eventually. - */ -exports.ElementType = __importStar(require("domelementtype")); -var domutils_1 = require("domutils"); -var domutils_2 = require("domutils"); -Object.defineProperty(exports, "getFeed", { enumerable: true, get: function () { return domutils_2.getFeed; } }); -var parseFeedDefaultOptions = { xmlMode: true }; -/** - * Parse a feed. - * - * @param feed The feed that should be parsed, as a string. - * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`. - */ -function parseFeed(feed, options) { - if (options === void 0) { options = parseFeedDefaultOptions; } - return (0, domutils_1.getFeed)(parseDOM(feed, options)); -} -exports.parseFeed = parseFeed; -exports.DomUtils = __importStar(require("domutils")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/index.js.map b/node_modules/htmlparser2/lib/index.js.map deleted file mode 100644 index e8c2f54..0000000 --- a/node_modules/htmlparser2/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/htmlparser2/e2939a6c7b05d5c4845b4a2e458a4fc0a65a321d/src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAyD;AAEzD,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AAEf,yCAMoB;AAEpB,yCAKoB;AAJhB,wGAAA,UAAU,OAAA;AACV,0BAA0B;AAC1B,4GAAA,UAAU,OAAkB;AAMhC,iBAAiB;AAEjB;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,IAAY,EAAE,OAAiB;IACzD,IAA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wBAAA,EAAA,iCAA0C;IAE1C,OAAO,IAAA,kBAAO,EAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC;AALD,8BAKC;AAED,qDAAqC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/package.json b/node_modules/htmlparser2/package.json deleted file mode 100644 index 708f6a4..0000000 --- a/node_modules/htmlparser2/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "name": "htmlparser2", - "description": "Fast & forgiving HTML/XML parser", - "version": "9.1.0", - "author": "Felix Boehm ", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "MIT", - "sideEffects": false, - "keywords": [ - "html", - "parser", - "streams", - "xml", - "dom", - "rss", - "feed", - "atom" - ], - "repository": { - "type": "git", - "url": "git://github.com/fb55/htmlparser2.git" - }, - "directories": { - "lib": "lib/" - }, - "main": "lib/index.js", - "types": "lib/index.d.ts", - "module": "lib/esm/index.js", - "exports": { - ".": { - "require": "./lib/index.js", - "import": "./lib/esm/index.js" - }, - "./lib/WritableStream": { - "require": "./lib/WritableStream.js", - "import": "./lib/esm/WritableStream.js" - } - }, - "files": [ - "lib/**/*" - ], - "scripts": { - "test": "npm run test:jest && npm run lint", - "test:jest": "jest", - "lint": "npm run lint:es && npm run lint:prettier", - "lint:es": "eslint src", - "lint:prettier": "npm run format:prettier:raw -- --check", - "format": "npm run format:es && npm run format:prettier", - "format:es": "npm run lint:es -- --fix", - "format:prettier": "npm run format:prettier:raw -- --write", - "format:prettier:raw": "prettier '**/*.{ts,md,json,yml}'", - "build": "npm run build:cjs && npm run build:esm", - "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/htmlparser2/$(git rev-parse HEAD)/src/", - "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json", - "prepare": "npm run build" - }, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.1.0", - "entities": "^4.5.0" - }, - "devDependencies": { - "@types/jest": "^29.5.11", - "@types/node": "^20.10.6", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-n": "^16.6.1", - "eslint-plugin-unicorn": "^50.0.1", - "jest": "^29.7.0", - "prettier": "^3.1.1", - "ts-jest": "^29.1.1", - "typescript": "^5.3.3" - }, - "jest": { - "preset": "ts-jest", - "testEnvironment": "node", - "coverageProvider": "v8", - "moduleNameMapper": { - "^(.*)\\.js$": [ - "$1", - "$1.js" - ] - } - }, - "prettier": { - "tabWidth": 4 - } -} diff --git a/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/iconv-lite/encodings/dbcs-codec.js index 1fe3e16..fa83917 100644 --- a/node_modules/iconv-lite/encodings/dbcs-codec.js +++ b/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -49,6 +49,48 @@ function DBCSCodec(codecOptions, iconv) { for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } + this.defaultCharUnicode = iconv.defaultCharUnicode; @@ -92,30 +134,6 @@ function DBCSCodec(codecOptions, iconv) { this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); - - - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - - // Add GB18030 decode tables. - var thirdByteNodeIdx = this.decodeTables.length; - var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); - - var fourthByteNodeIdx = this.decodeTables.length; - var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); - - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; - var secondByteNode = this.decodeTables[secondByteNodeIdx]; - for (var j = 0x30; j <= 0x39; j++) - secondByteNode[j] = NODE_START - thirdByteNodeIdx; - } - for (var i = 0x81; i <= 0xFE; i++) - thirdByteNode[i] = NODE_START - fourthByteNodeIdx; - for (var i = 0x30; i <= 0x39; i++) - fourthByteNode[i] = GB18030_CODE - } } DBCSCodec.prototype.encoder = DBCSEncoder; @@ -124,7 +142,7 @@ DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; - for (; addr > 0; addr >>= 8) + for (; addr > 0; addr >>>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); @@ -249,19 +267,32 @@ DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; - if (uCode >= 0) + if (uCode >= 0) { this._setEncodeChar(uCode, mbCode); - else if (uCode <= NODE_START) - this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); - else if (uCode <= SEQ_START) + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } } + return hasValues; } @@ -388,10 +419,15 @@ DBCSEncoder.prototype.write = function(str) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } - else { + else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; } } @@ -440,7 +476,7 @@ DBCSEncoder.prototype.findIdx = findIdx; function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; - this.prevBuf = Buffer.alloc(0); + this.prevBytes = []; // Static data this.decodeTables = codec.decodeTables; @@ -452,15 +488,12 @@ function DBCSDecoder(options, codec) { DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, - prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, - seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. uCode; - if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. - prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; @@ -470,13 +503,18 @@ DBCSDecoder.prototype.write = function(buf) { } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. - //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); - i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { - var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); - var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } @@ -497,13 +535,13 @@ DBCSDecoder.prototype.write = function(buf) { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode > 0xFFFF) { + if (uCode >= 0x10000) { uCode -= 0x10000; - var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); + var uCodeLead = 0xD800 | (uCode >> 10); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; - uCode = 0xDC00 + uCode % 0x400; + uCode = 0xDC00 | (uCode & 0x3FF); } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; @@ -513,7 +551,10 @@ DBCSDecoder.prototype.write = function(buf) { } this.nodeIdx = nodeIdx; - this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + return newBuf.slice(0, j).toString('ucs2'); } @@ -521,18 +562,19 @@ DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. - while (this.prevBuf.length > 0) { + while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; - var buf = this.prevBuf.slice(1); + var bytesArr = this.prevBytes.slice(1); // Parse remaining as usual. - this.prevBuf = Buffer.alloc(0); + this.prevBytes = []; this.nodeIdx = 0; - if (buf.length > 0) - ret += this.write(buf); + if (bytesArr.length > 0) + ret += this.write(bytesArr); } + this.prevBytes = []; this.nodeIdx = 0; return ret; } @@ -544,7 +586,7 @@ function findIdx(table, val) { var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + Math.floor((r-l+1)/2); + var mid = l + ((r-l+1) >> 1); if (table[mid] <= val) l = mid; else diff --git a/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/iconv-lite/encodings/dbcs-data.js index 4b61914..0d17e58 100644 --- a/node_modules/iconv-lite/encodings/dbcs-data.js +++ b/node_modules/iconv-lite/encodings/dbcs-data.js @@ -167,7 +167,19 @@ module.exports = { 'big5hkscs': { type: '_dbcs', table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, - encodeSkipVals: [0xa2cc], + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, + ], }, 'cnbig5': 'big5hkscs', diff --git a/node_modules/iconv-lite/encodings/index.js b/node_modules/iconv-lite/encodings/index.js index e304003..d95c244 100644 --- a/node_modules/iconv-lite/encodings/index.js +++ b/node_modules/iconv-lite/encodings/index.js @@ -4,6 +4,7 @@ // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ require("./internal"), + require("./utf32"), require("./utf16"), require("./utf7"), require("./sbcs-codec"), @@ -13,7 +14,7 @@ var modules = [ require("./dbcs-data"), ]; -// Put all encoding/alias/codec definitions to single object and export it. +// Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) diff --git a/node_modules/iconv-lite/encodings/internal.js b/node_modules/iconv-lite/encodings/internal.js index 05ce38b..dc1074f 100644 --- a/node_modules/iconv-lite/encodings/internal.js +++ b/node_modules/iconv-lite/encodings/internal.js @@ -53,10 +53,20 @@ if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. function InternalDecoder(options, codec) { - StringDecoder.call(this, codec.enc); + this.decoder = new StringDecoder(codec.enc); } -InternalDecoder.prototype = StringDecoder.prototype; +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } + + return this.decoder.write(buf); +} + +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} //------------------------------------------------------------------------------ diff --git a/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/iconv-lite/encodings/sbcs-data.js index fdb81a3..066f904 100644 --- a/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/node_modules/iconv-lite/encodings/sbcs-data.js @@ -22,6 +22,11 @@ module.exports = { "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", diff --git a/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/iconv-lite/encodings/tables/gbk-added.json index 8abfa9f..b742e36 100644 --- a/node_modules/iconv-lite/encodings/tables/gbk-added.json +++ b/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -27,7 +27,7 @@ ["a7c2","",14], ["a7f2","",12], ["a896","",10], -["a8bc",""], +["a8bc","ḿ"], ["a8bf","ǹ"], ["a8c1",""], ["a8ea","",20], @@ -51,5 +51,6 @@ ["fca1","",93], ["fda1","",93], ["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], -["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93] +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] ] diff --git a/node_modules/iconv-lite/encodings/utf16.js b/node_modules/iconv-lite/encodings/utf16.js index 54765ae..97d0669 100644 --- a/node_modules/iconv-lite/encodings/utf16.js +++ b/node_modules/iconv-lite/encodings/utf16.js @@ -61,6 +61,7 @@ Utf16BEDecoder.prototype.write = function(buf) { } Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; } @@ -103,8 +104,8 @@ Utf16Encoder.prototype.end = function() { function Utf16Decoder(options, codec) { this.decoder = null; - this.initialBytes = []; - this.initialBytesLen = 0; + this.initialBufs = []; + this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; @@ -113,17 +114,22 @@ function Utf16Decoder(options, codec) { Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. - this.initialBytes.push(buf); - this.initialBytesLen += buf.length; + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; - if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. - var buf = Buffer.concat(this.initialBytes), - encoding = detectEncoding(buf, this.options.defaultEncoding); + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); - this.initialBytes.length = this.initialBytesLen = 0; + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } return this.decoder.write(buf); @@ -131,47 +137,61 @@ Utf16Decoder.prototype.write = function(buf) { Utf16Decoder.prototype.end = function() { if (!this.decoder) { - var buf = Buffer.concat(this.initialBytes), - encoding = detectEncoding(buf, this.options.defaultEncoding); + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); - var res = this.decoder.write(buf), - trail = this.decoder.end(); + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - return trail ? (res + trail) : res; + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } return this.decoder.end(); } -function detectEncoding(buf, defaultEncoding) { - var enc = defaultEncoding || 'utf-16le'; +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - if (buf.length >= 2) { - // Check BOM. - if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM - enc = 'utf-16be'; - else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM - enc = 'utf-16le'; - else { - // No BOM found. Try to deduce encoding from initial content. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions - _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } - for (var i = 0; i < _len; i += 2) { - if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; - if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } } - - if (asciiCharsBE > asciiCharsLE) - enc = 'utf-16be'; - else if (asciiCharsBE < asciiCharsLE) - enc = 'utf-16le'; } } - return enc; + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; } diff --git a/node_modules/encoding-sniffer/node_modules/iconv-lite/encodings/utf32.js b/node_modules/iconv-lite/encodings/utf32.js similarity index 100% rename from node_modules/encoding-sniffer/node_modules/iconv-lite/encodings/utf32.js rename to node_modules/iconv-lite/encodings/utf32.js diff --git a/node_modules/iconv-lite/encodings/utf7.js b/node_modules/iconv-lite/encodings/utf7.js index b7631c2..eacae34 100644 --- a/node_modules/iconv-lite/encodings/utf7.js +++ b/node_modules/iconv-lite/encodings/utf7.js @@ -74,7 +74,7 @@ Utf7Decoder.prototype.write = function(buf) { if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { - var b64str = base64Accum + buf.slice(lastI, i).toString(); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } @@ -91,7 +91,7 @@ Utf7Decoder.prototype.write = function(buf) { if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { - var b64str = base64Accum + buf.slice(lastI).toString(); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. @@ -245,7 +245,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { - var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } @@ -262,7 +262,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { - var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. diff --git a/node_modules/iconv-lite/lib/index.d.ts b/node_modules/iconv-lite/lib/index.d.ts index 0547eb3..99f200f 100644 --- a/node_modules/iconv-lite/lib/index.d.ts +++ b/node_modules/iconv-lite/lib/index.d.ts @@ -6,15 +6,22 @@ *--------------------------------------------------------------------------------------------*/ declare module 'iconv-lite' { + // Basic API export function decode(buffer: Buffer, encoding: string, options?: Options): string; export function encode(content: string, encoding: string, options?: Options): Buffer; export function encodingExists(encoding: string): boolean; + // Stream API export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + // Low-level stream APIs + export function getEncoder(encoding: string, options?: Options): EncoderStream; + + export function getDecoder(encoding: string, options?: Options): DecoderStream; } export interface Options { @@ -22,3 +29,13 @@ export interface Options { addBOM?: boolean; defaultEncoding?: string; } + +export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; +} + +export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; +} diff --git a/node_modules/iconv-lite/lib/index.js b/node_modules/iconv-lite/lib/index.js index 5391919..657701c 100644 --- a/node_modules/iconv-lite/lib/index.js +++ b/node_modules/iconv-lite/lib/index.js @@ -1,7 +1,5 @@ "use strict"; -// Some environments don't have global Buffer (e.g. React Native). -// Solution would be installing npm modules "buffer" and "stream" explicitly. var Buffer = require("safer-buffer").Buffer; var bomHandling = require("./bom-handling"), @@ -133,21 +131,50 @@ iconv.getDecoder = function getDecoder(encoding, options) { return decoder; } +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; -// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. -var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; -if (nodeVer) { + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(stream_module); - // Load streaming support in Node v0.10+ - var nodeVerArr = nodeVer.split(".").map(Number); - if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { - require("./streams")(iconv); + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; + + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } - // Load Node primitive extensions. - require("./extend-node")(iconv); + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = require("stream"); +} catch (e) {} + +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); + +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; } if ("Ā" != "\u0100") { - console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); } diff --git a/node_modules/iconv-lite/lib/streams.js b/node_modules/iconv-lite/lib/streams.js index 4409552..a150648 100644 --- a/node_modules/iconv-lite/lib/streams.js +++ b/node_modules/iconv-lite/lib/streams.js @@ -1,121 +1,109 @@ "use strict"; -var Buffer = require("buffer").Buffer, - Transform = require("stream").Transform; +var Buffer = require("safer-buffer").Buffer; +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; -// == Exports ================================================================== -module.exports = function(iconv) { - - // Additional Public API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); } - iconv.decodeStream = function decodeStream(encoding, options) { - return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } } - iconv.supportsStreams = true; + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } - // Not published yet. - iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; - iconv._collect = IconvLiteDecoderStream.prototype.collect; + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); + + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; }; - - -// == Encoder stream ======================================================= -function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); -} - -IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } -}); - -IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } -} - -IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } -} - -IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); - }); - return this; -} - - -// == Decoder stream ======================================================= -function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); -} - -IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } -}); - -IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } -} - -IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } -} - -IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; -} - diff --git a/node_modules/iconv-lite/package.json b/node_modules/iconv-lite/package.json index a7c74fc..d351115 100644 --- a/node_modules/iconv-lite/package.json +++ b/node_modules/iconv-lite/package.json @@ -1,7 +1,7 @@ { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", - "version": "0.4.24", + "version": "0.6.3", "license": "MIT", "keywords": [ "iconv", @@ -22,25 +22,23 @@ "node": ">=0.10.0" }, "scripts": { - "coverage": "istanbul cover _mocha -- --grep .", - "coverage-open": "open coverage/lcov-report/index.html", + "coverage": "c8 _mocha --grep .", "test": "mocha --reporter spec --grep ." }, "browser": { - "./lib/extend-node": false, - "./lib/streams": false + "stream": false }, "devDependencies": { - "mocha": "^3.1.0", - "request": "~2.87.0", - "unorm": "*", - "errto": "*", - "async": "*", - "istanbul": "*", - "semver": "*", - "iconv": "*" + "async": "^3.2.0", + "c8": "^7.2.0", + "errto": "^0.2.1", + "iconv": "^2.3.5", + "mocha": "^3.5.3", + "request": "^2.88.2", + "semver": "^6.3.0", + "unorm": "^1.6.0" }, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" } } diff --git a/node_modules/ignore-by-default/index.js b/node_modules/ignore-by-default/index.js deleted file mode 100644 index c65857d..0000000 --- a/node_modules/ignore-by-default/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -exports.directories = function () { - return [ - '.git', // Git repository files, see - '.nyc_output', // Temporary directory where nyc stores coverage data, see - '.sass-cache', // Cache folder for node-sass, see - 'bower_components', // Where Bower packages are installed, see - 'coverage', // Standard output directory for code coverage reports, see - 'node_modules' // Where Node modules are installed, see - ] -} diff --git a/node_modules/ignore-by-default/package.json b/node_modules/ignore-by-default/package.json deleted file mode 100644 index 38e0d2b..0000000 --- a/node_modules/ignore-by-default/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "ignore-by-default", - "version": "1.0.1", - "description": "A list of directories you should ignore by default", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "standard && node test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/novemberborn/ignore-by-default.git" - }, - "keywords": [ - "ignore", - "chokidar", - "watcher", - "exclude", - "glob", - "pattern" - ], - "author": "Mark Wubben (https://novemberborn.net/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/novemberborn/ignore-by-default/issues" - }, - "homepage": "https://github.com/novemberborn/ignore-by-default#readme", - "devDependencies": { - "figures": "^1.4.0", - "standard": "^6.0.4" - } -} diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js deleted file mode 100644 index 48202b3..0000000 --- a/node_modules/inflight/inflight.js +++ /dev/null @@ -1,54 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json deleted file mode 100644 index 6084d35..0000000 --- a/node_modules/inflight/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inflight", - "version": "1.0.6", - "description": "Add callbacks to requests in flight to avoid async duplication", - "main": "inflight.js", - "files": [ - "inflight.js" - ], - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.1.2" - }, - "scripts": { - "test": "tap test.js --100" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/inflight.git" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC" -} diff --git a/node_modules/is-binary-path/index.d.ts b/node_modules/is-binary-path/index.d.ts deleted file mode 100644 index 19dcd43..0000000 --- a/node_modules/is-binary-path/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Check if a file path is a binary file. - -@example -``` -import isBinaryPath = require('is-binary-path'); - -isBinaryPath('source/unicorn.png'); -//=> true - -isBinaryPath('source/unicorn.txt'); -//=> false -``` -*/ -declare function isBinaryPath(filePath: string): boolean; - -export = isBinaryPath; diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js deleted file mode 100644 index ef7548c..0000000 --- a/node_modules/is-binary-path/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -const path = require('path'); -const binaryExtensions = require('binary-extensions'); - -const extensions = new Set(binaryExtensions); - -module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json deleted file mode 100644 index a8d005a..0000000 --- a/node_modules/is-binary-path/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "is-binary-path", - "version": "2.1.0", - "description": "Check if a file path is a binary file", - "license": "MIT", - "repository": "sindresorhus/is-binary-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "binary", - "extensions", - "extension", - "file", - "path", - "check", - "detect", - "is" - ], - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js deleted file mode 100644 index c1d986f..0000000 --- a/node_modules/is-extglob/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } - - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); - } - - return false; -}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json deleted file mode 100644 index 7a90836..0000000 --- a/node_modules/is-extglob/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "is-extglob", - "description": "Returns true if a string has an extglob.", - "version": "2.1.1", - "homepage": "https://github.com/jonschlinkert/is-extglob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "repository": "jonschlinkert/is-extglob", - "bugs": { - "url": "https://github.com/jonschlinkert/is-extglob/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "keywords": [ - "bash", - "braces", - "check", - "exec", - "expression", - "extglob", - "glob", - "globbing", - "globstar", - "is", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-glob", - "is-glob", - "micromatch" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js deleted file mode 100644 index 620f563..0000000 --- a/node_modules/is-glob/index.js +++ /dev/null @@ -1,150 +0,0 @@ -/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -var isExtglob = require('is-extglob'); -var chars = { '{': '}', '(': ')', '[': ']'}; -var strictCheck = function(str) { - if (str[0] === '!') { - return true; - } - var index = 0; - var pipeIndex = -2; - var closeSquareIndex = -2; - var closeCurlyIndex = -2; - var closeParenIndex = -2; - var backSlashIndex = -2; - while (index < str.length) { - if (str[index] === '*') { - return true; - } - - if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { - return true; - } - - if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { - if (closeSquareIndex < index) { - closeSquareIndex = str.indexOf(']', index); - } - if (closeSquareIndex > index) { - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - } - } - - if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { - closeCurlyIndex = str.indexOf('}', index); - if (closeCurlyIndex > index) { - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { - return true; - } - } - } - - if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { - closeParenIndex = str.indexOf(')', index); - if (closeParenIndex > index) { - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - - if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { - if (pipeIndex < index) { - pipeIndex = str.indexOf('|', index); - } - if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { - closeParenIndex = str.indexOf(')', pipeIndex); - if (closeParenIndex > pipeIndex) { - backSlashIndex = str.indexOf('\\', pipeIndex); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - } - - if (str[index] === '\\') { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - - if (str[index] === '!') { - return true; - } - } else { - index++; - } - } - return false; -}; - -var relaxedCheck = function(str) { - if (str[0] === '!') { - return true; - } - var index = 0; - while (index < str.length) { - if (/[*?{}()[\]]/.test(str[index])) { - return true; - } - - if (str[index] === '\\') { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - - if (str[index] === '!') { - return true; - } - } else { - index++; - } - } - return false; -}; - -module.exports = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; - } - - if (isExtglob(str)) { - return true; - } - - var check = strictCheck; - - // optionally relax check - if (options && options.strict === false) { - check = relaxedCheck; - } - - return check(str); -}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json deleted file mode 100644 index 858af03..0000000 --- a/node_modules/is-glob/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "is-glob", - "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", - "version": "4.0.3", - "homepage": "https://github.com/micromatch/is-glob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Daniel Perez (https://tuvistavie.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/is-glob", - "bugs": { - "url": "https://github.com/micromatch/is-glob/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha && node benchmark.js" - }, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "keywords": [ - "bash", - "braces", - "check", - "exec", - "expression", - "extglob", - "glob", - "globbing", - "globstar", - "is", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "verb": { - "layout": "default", - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "assemble", - "base", - "update", - "verb" - ] - }, - "reflinks": [ - "assemble", - "bach", - "base", - "composer", - "gulp", - "has-glob", - "is-valid-glob", - "micromatch", - "npm", - "scaffold", - "verb", - "vinyl" - ] - } -} diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js deleted file mode 100644 index 27f19b7..0000000 --- a/node_modules/is-number/index.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - return false; -}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json deleted file mode 100644 index 3715072..0000000 --- a/node_modules/is-number/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "is-number", - "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", - "version": "7.0.0", - "homepage": "https://github.com/jonschlinkert/is-number", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Olsten Larck (https://i.am.charlike.online)", - "Rouven Weßling (www.rouvenwessling.de)" - ], - "repository": "jonschlinkert/is-number", - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.12.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "ansi": "^0.3.1", - "benchmark": "^2.1.4", - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "keywords": [ - "cast", - "check", - "coerce", - "coercion", - "finite", - "integer", - "is", - "isnan", - "is-nan", - "is-num", - "is-number", - "isnumber", - "isfinite", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "parseFloat", - "parseInt", - "test", - "type", - "typeof", - "value" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "related": { - "list": [ - "is-plain-object", - "is-primitive", - "isobject", - "kind-of" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js deleted file mode 100644 index fda45ad..0000000 --- a/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,947 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = (function () { try { return require('path') } catch (e) {}}()) || { - sep: '/' -} -minimatch.sep = path.sep - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } - - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } - - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } - - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } - - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } - - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - assertValidPattern(pattern) - - if (!options) options = {} - - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) - - var options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json deleted file mode 100644 index 566efdf..0000000 --- a/node_modules/minimatch/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.1.2", - "publishConfig": { - "tag": "v3-legacy" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "devDependencies": { - "tap": "^15.1.6" - }, - "license": "ISC", - "files": [ - "minimatch.js" - ] -} diff --git a/node_modules/nodemon/bin/nodemon.js b/node_modules/nodemon/bin/nodemon.js deleted file mode 100644 index 3d490f1..0000000 --- a/node_modules/nodemon/bin/nodemon.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -const cli = require('../lib/cli'); -const nodemon = require('../lib/'); -const options = cli.parse(process.argv); - -nodemon(options); - -const fs = require('fs'); - -// checks for available update and returns an instance -const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json')); - -if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) { - require('simple-update-notifier')({ pkg }); -} diff --git a/node_modules/nodemon/index.d.ts b/node_modules/nodemon/index.d.ts deleted file mode 100644 index c8e4ec2..0000000 --- a/node_modules/nodemon/index.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -import type { WatchOptions } from 'chokidar' - -export type NodemonEventHandler = - | 'start' - | 'crash' - | 'exit' - | 'quit' - | 'restart' - | 'config:update' - | 'log' - | 'readable' - | 'stdout' - | 'stderr'; - -export type NodemonEventListener = { - on(event: 'start' | 'crash' | 'readable', listener: () => void): Nodemon; - on(event: 'log', listener: (e: NodemonEventLog) => void): Nodemon; - on(event: 'stdout' | 'stderr', listener: (e: string) => void): Nodemon; - on(event: 'restart', listener: (e?: NodemonEventRestart) => void): Nodemon; - on(event: 'quit', listener: (e?: NodemonEventQuit) => void): Nodemon; - on(event: 'exit', listener: (e?: number) => void): Nodemon; - on(event: 'config:update', listener: (e?: NodemonEventConfig) => void): Nodemon; -}; - -export type Nodemon = { - removeAllListeners(event: NodemonEventHandler): Nodemon; - emit(type: NodemonEventHandler, event?: any): Nodemon; - reset(callback: Function): Nodemon; - restart(): Nodemon; - config: NodemonSettings; -} & NodemonEventListener & { - [K in keyof NodemonEventListener as "addListener"]: NodemonEventListener[K]; -} & { - [K in keyof NodemonEventListener as "once"]: NodemonEventListener[K]; -}; - -export type NodemonEventLog = { - /** - - detail: what you get with nodemon --verbose. - - status: subprocess starting, restarting. - - fail: is the subprocess crashing. - - error: is a nodemon system error. - */ - type: 'detail' | 'log' | 'status' | 'error' | 'fail'; - /** the plain text message */ - message: string; - /** contains the terminal escape codes to add colour, plus the "[nodemon]" prefix */ - colour: string; -}; - -export interface NodemonEventRestart { - matched?: { - result: string[]; - total: number; - }; -} - -export type NodemonEventQuit = 143 | 130; - -export type NodemonEventConfig = { - run: boolean; - system: { - cwd: string; - }; - required: boolean; - dirs: string[]; - timeout: number; - options: NodemonConfig; - lastStarted: number - loaded: string[] - load: (settings: NodemonSettings, ready: (config: NodemonEventConfig) => void) => void - reset: () => void -}; - -export interface NodemonExecOptions { - script: string; - scriptPosition?: number; - args?: string[] - ext?: string; // "js,mjs" etc (should really support an array of strings, but I don't think it does right now) - exec?: string; // node, python, etc - execArgs?: string[]; // args passed to node, etc, - nodeArgs?: string[]; // args passed to node, etc, -} - -export interface NodemonConfig { - /** restartable defaults to "rs" as a string the user enters */ - restartable?: false | string; - colours?: boolean; - execMap?: { [key: string]: string }; - ignoreRoot?: string[]; - watch?: string[]; - ignore?: string[]; - stdin?: boolean; - runOnChangeOnly?: boolean; - verbose?: boolean; - signal?: string; - stdout?: boolean; - watchOptions?: WatchOptions; - help?: string - version?: boolean - cwd?: string - dump?: boolean - ignore?: string[] - watch?: string[] - monitor?: string[] - spawn?: boolean - noUpdateNotifier?: boolean - legacyWatch?: boolean - pollingInterval?: number - /** @deprecated as this is "on" by default */ - js?: boolean - quiet?: boolean - configFile?: string - exitCrash?: boolean - execOptions?: NodemonExecOptions -} - -export interface NodemonSettings extends NodemonConfig, NodemonExecOptions { - events?: { [key: string]: string }; - env?: { [key: string]: string }; -} - -const nodemon: Nodemon = (settings: NodemonSettings): Nodemon => {}; - -export = nodemon; diff --git a/node_modules/nodemon/jsconfig.json b/node_modules/nodemon/jsconfig.json deleted file mode 100644 index d77141c..0000000 --- a/node_modules/nodemon/jsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "typeRoots": ["./index.d.ts", "./node_modules/@types"], - "checkJs": true - }, - "exclude": ["node_modules"] -} diff --git a/node_modules/nodemon/lib/cli/index.js b/node_modules/nodemon/lib/cli/index.js deleted file mode 100644 index bf9e809..0000000 --- a/node_modules/nodemon/lib/cli/index.js +++ /dev/null @@ -1,49 +0,0 @@ -var parse = require('./parse'); - -/** - * Converts a string to command line args, in particular - * groups together quoted values. - * This is a utility function to allow calling nodemon as a required - * library, but with the CLI args passed in (instead of an object). - * - * @param {String} string - * @return {Array} - */ -function stringToArgs(string) { - var args = []; - - var parts = string.split(' '); - var length = parts.length; - var i = 0; - var open = false; - var grouped = ''; - var lead = ''; - - for (; i < length; i++) { - lead = parts[i].substring(0, 1); - if (lead === '"' || lead === '\'') { - open = lead; - grouped = parts[i].substring(1); - } else if (open && parts[i].slice(-1) === open) { - open = false; - grouped += ' ' + parts[i].slice(0, -1); - args.push(grouped); - } else if (open) { - grouped += ' ' + parts[i]; - } else { - args.push(parts[i]); - } - } - - return args; -} - -module.exports = { - parse: function (argv) { - if (typeof argv === 'string') { - argv = stringToArgs(argv); - } - - return parse(argv); - }, -}; \ No newline at end of file diff --git a/node_modules/nodemon/lib/cli/parse.js b/node_modules/nodemon/lib/cli/parse.js deleted file mode 100644 index 560cc71..0000000 --- a/node_modules/nodemon/lib/cli/parse.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - -nodemon is a utility for node, and replaces the use of the executable -node. So the user calls `nodemon foo.js` instead. - -nodemon can be run in a number of ways: - -`nodemon` - tries to use package.json#main property to run -`nodemon` - if no package, looks for index.js -`nodemon app.js` - runs app.js -`nodemon --arg app.js --apparg` - eats arg1, and runs app.js with apparg -`nodemon --apparg` - as above, but passes apparg to package.json#main (or - index.js) -`nodemon --debug app.js - -*/ - -var fs = require('fs'); -var path = require('path'); -var existsSync = fs.existsSync || path.existsSync; - -module.exports = parse; - -/** - * Parses the command line arguments `process.argv` and returns the - * nodemon options, the user script and the executable script. - * - * @param {Array | string} argv full process arguments, including `node` leading arg - * @return {Object} { options, script, args } - */ -function parse(argv) { - if (typeof argv === 'string') { - argv = argv.split(' '); - } - - var eat = function (i, args) { - if (i <= args.length) { - return args.splice(i + 1, 1).pop(); - } - }; - - var args = argv.slice(2); - var script = null; - var nodemonOptions = { scriptPosition: null }; - - var nodemonOpt = nodemonOption.bind(null, nodemonOptions); - var lookForArgs = true; - - // move forward through the arguments - for (var i = 0; i < args.length; i++) { - // if the argument looks like a file, then stop eating - if (!script) { - if (args[i] === '.' || existsSync(args[i])) { - script = args.splice(i, 1).pop(); - - // we capture the position of the script because we'll reinsert it in - // the right place in run.js:command (though I'm not sure we should even - // take it out of the array in the first place, but this solves passing - // arguments to the exec process for now). - nodemonOptions.scriptPosition = i; - i--; - continue; - } - } - - if (lookForArgs) { - // respect the standard way of saying: hereafter belongs to my script - if (args[i] === '--') { - args.splice(i, 1); - nodemonOptions.scriptPosition = i; - // cycle back one argument, as we just ate this one up - i--; - - // ignore all further nodemon arguments - lookForArgs = false; - - // move to the next iteration - continue; - } - - if (nodemonOpt(args[i], eat.bind(null, i, args)) !== false) { - args.splice(i, 1); - // cycle back one argument, as we just ate this one up - i--; - } - } - } - - nodemonOptions.script = script; - nodemonOptions.args = args; - - return nodemonOptions; -} - - -/** - * Given an argument (ie. from process.argv), sets nodemon - * options and can eat up the argument value - * - * @param {import('../..').NodemonSettings} options object that will be updated - * @param {String} arg current argument from argv - * @param {Function} eatNext the callback to eat up the next argument in argv - * @return {Boolean} false if argument was not a nodemon arg - */ -function nodemonOption(options, arg, eatNext) { - // line separation on purpose to help legibility - if (arg === '--help' || arg === '-h' || arg === '-?') { - var help = eatNext(); - options.help = help ? help : true; - } else - - if (arg === '--version' || arg === '-v') { - options.version = true; - } else - - if (arg === '--no-update-notifier') { - options.noUpdateNotifier = true; - } else - - if (arg === '--spawn') { - options.spawn = true; - } else - - if (arg === '--dump') { - options.dump = true; - } else - - if (arg === '--verbose' || arg === '-V') { - options.verbose = true; - } else - - if (arg === '--legacy-watch' || arg === '-L') { - options.legacyWatch = true; - } else - - if (arg === '--polling-interval' || arg === '-P') { - options.pollingInterval = parseInt(eatNext(), 10); - } else - - // Depricated as this is "on" by default - if (arg === '--js') { - options.js = true; - } else - - if (arg === '--quiet' || arg === '-q') { - options.quiet = true; - } else - - if (arg === '--config') { - options.configFile = eatNext(); - } else - - if (arg === '--watch' || arg === '-w') { - if (!options.watch) { options.watch = []; } - options.watch.push(eatNext()); - } else - - if (arg === '--ignore' || arg === '-i') { - if (!options.ignore) { options.ignore = []; } - options.ignore.push(eatNext()); - } else - - if (arg === '--exitcrash') { - options.exitCrash = true; - } else - - if (arg === '--delay' || arg === '-d') { - options.delay = parseDelay(eatNext()); - } else - - if (arg === '--exec' || arg === '-x') { - options.exec = eatNext(); - } else - - if (arg === '--no-stdin' || arg === '-I') { - options.stdin = false; - } else - - if (arg === '--on-change-only' || arg === '-C') { - options.runOnChangeOnly = true; - } else - - if (arg === '--ext' || arg === '-e') { - options.ext = eatNext(); - } else - - if (arg === '--no-colours' || arg === '--no-colors') { - options.colours = false; - } else - - if (arg === '--signal' || arg === '-s') { - options.signal = eatNext(); - } else - - if (arg === '--cwd') { - options.cwd = eatNext(); - - // go ahead and change directory. This is primarily for nodemon tools like - // grunt-nodemon - we're doing this early because it will affect where the - // user script is searched for. - process.chdir(path.resolve(options.cwd)); - } else { - - // this means we didn't match - return false; - } -} - -/** - * Given an argument (ie. from nodemonOption()), will parse and return the - * equivalent millisecond value or 0 if the argument cannot be parsed - * - * @param {String} value argument value given to the --delay option - * @return {Number} millisecond equivalent of the argument - */ -function parseDelay(value) { - var millisPerSecond = 1000; - var millis = 0; - - if (value.match(/^\d*ms$/)) { - // Explicitly parse for milliseconds when using ms time specifier - millis = parseInt(value, 10); - } else { - // Otherwise, parse for seconds, with or without time specifier then convert - millis = parseFloat(value) * millisPerSecond; - } - - return isNaN(millis) ? 0 : millis; -} - diff --git a/node_modules/nodemon/lib/config/command.js b/node_modules/nodemon/lib/config/command.js deleted file mode 100644 index 9839b5c..0000000 --- a/node_modules/nodemon/lib/config/command.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = command; - -/** - * command constructs the executable command to run in a shell including the - * user script, the command arguments. - * - * @param {Object} settings Object as: - * { execOptions: { - * exec: String, - * [script: String], - * [scriptPosition: Number], - * [execArgs: Array] - * } - * } - * @return {Object} an object with the node executable and the - * arguments to the command - */ -function command(settings) { - var options = settings.execOptions; - var executable = options.exec; - var args = []; - - // after "executable" go the exec args (like --debug, etc) - if (options.execArgs) { - [].push.apply(args, options.execArgs); - } - - // then goes the user's script arguments - if (options.args) { - [].push.apply(args, options.args); - } - - // after the "executable" goes the user's script - if (options.script) { - args.splice((options.scriptPosition || 0) + - options.execArgs.length, 0, options.script); - } - - return { - executable: executable, - args: args, - }; -} diff --git a/node_modules/nodemon/lib/config/defaults.js b/node_modules/nodemon/lib/config/defaults.js deleted file mode 100644 index dc95d34..0000000 --- a/node_modules/nodemon/lib/config/defaults.js +++ /dev/null @@ -1,34 +0,0 @@ -var ignoreRoot = require('ignore-by-default').directories(); - -// default options for config.options -const defaults = { - restartable: 'rs', - colours: true, - execMap: { - py: 'python', - rb: 'ruby', - ts: 'ts-node', - // more can be added here such as ls: lsc - but please ensure it's cross - // compatible with linux, mac and windows, or make the default.js - // dynamically append the `.cmd` for node based utilities - }, - ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`), - watch: ['*.*'], - stdin: true, - runOnChangeOnly: false, - verbose: false, - signal: 'SIGUSR2', - // 'stdout' refers to the default behaviour of a required nodemon's child, - // but also includes stderr. If this is false, data is still dispatched via - // nodemon.on('stdout/stderr') - stdout: true, - watchOptions: {}, -}; - -const nodeOptions = process.env.NODE_OPTIONS || ''; // ? - -if (/--(loader|import)\b/.test(nodeOptions)) { - delete defaults.execMap.ts; -} - -module.exports = defaults; diff --git a/node_modules/nodemon/lib/config/exec.js b/node_modules/nodemon/lib/config/exec.js deleted file mode 100644 index 6d17eab..0000000 --- a/node_modules/nodemon/lib/config/exec.js +++ /dev/null @@ -1,234 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const existsSync = fs.existsSync; -const utils = require('../utils'); - -module.exports = exec; -module.exports.expandScript = expandScript; - -/** - * Reads the cwd/package.json file and looks to see if it can load a script - * and possibly an exec first from package.main, then package.start. - * - * @return {Object} exec & script if found - */ -function execFromPackage() { - // doing a try/catch because we can't use the path.exist callback pattern - // or we could, but the code would get messy, so this will do exactly - // what we're after - if the file doesn't exist, it'll throw. - try { - // note: this isn't nodemon's package, it's the user's cwd package - var pkg = require(path.join(process.cwd(), 'package.json')); - if (pkg.main !== undefined) { - // no app found to run - so give them a tip and get the feck out - return { exec: null, script: pkg.main }; - } - - if (pkg.scripts && pkg.scripts.start) { - return { exec: pkg.scripts.start }; - } - } catch (e) {} - - return null; -} - -function replace(map, str) { - var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g'); - return str.replace(re, function (all, m) { - return map[m] || all || ''; - }); -} - -function expandScript(script, ext) { - if (!ext) { - ext = '.js'; - } - if (script.indexOf(ext) !== -1) { - return script; - } - - if (existsSync(path.resolve(script))) { - return script; - } - - if (existsSync(path.resolve(script + ext))) { - return script + ext; - } - - return script; -} - -/** - * Discovers all the options required to run the script - * and if a custom exec has been passed in, then it will - * also try to work out what extensions to monitor and - * whether there's a special way of running that script. - * - * @param {Object} nodemonOptions - * @param {Object} execMap - * @return {Object} new and updated version of nodemonOptions - */ -function exec(nodemonOptions, execMap) { - if (!execMap) { - execMap = {}; - } - - var options = utils.clone(nodemonOptions || {}); - var script; - - // if there's no script passed, try to get it from the first argument - if (!options.script && (options.args || []).length) { - script = expandScript( - options.args[0], - options.ext && '.' + (options.ext || 'js').split(',')[0] - ); - - // if the script was found, shift it off our args - if (script !== options.args[0]) { - options.script = script; - options.args.shift(); - } - } - - // if there's no exec found yet, then try to read it from the local - // package.json this logic used to sit in the cli/parse, but actually the cli - // should be parsed first, then the user options (via nodemon.json) then - // finally default down to pot shots at the directory via package.json - if (!options.exec && !options.script) { - var found = execFromPackage(); - if (found !== null) { - if (found.exec) { - options.exec = found.exec; - } - if (!options.script) { - options.script = found.script; - } - if (Array.isArray(options.args) && options.scriptPosition === null) { - options.scriptPosition = options.args.length; - } - } - } - - // var options = utils.clone(nodemonOptions || {}); - script = path.basename(options.script || ''); - - var scriptExt = path.extname(script).slice(1); - - var extension = options.ext; - if (extension === undefined) { - var isJS = scriptExt === 'js' || scriptExt === 'mjs' || scriptExt === 'cjs'; - extension = isJS || !scriptExt ? 'js,mjs,cjs' : scriptExt; - extension += ',json'; // Always watch JSON files - } - - var execDefined = !!options.exec; - - // allows the user to simplify cli usage: - // https://github.com/remy/nodemon/issues/195 - // but always give preference to the user defined argument - if (!options.exec && execMap[scriptExt] !== undefined) { - options.exec = execMap[scriptExt]; - execDefined = true; - } - - options.execArgs = nodemonOptions.execArgs || []; - - if (Array.isArray(options.exec)) { - options.execArgs = options.exec; - options.exec = options.execArgs.shift(); - } - - if (options.exec === undefined) { - options.exec = 'node'; - } else { - // allow variable substitution for {{filename}} and {{pwd}} - var substitution = replace.bind(null, { - filename: options.script, - pwd: process.cwd(), - }); - - var newExec = substitution(options.exec); - if ( - newExec !== options.exec && - options.exec.indexOf('{{filename}}') !== -1 - ) { - options.script = null; - } - options.exec = newExec; - - var newExecArgs = options.execArgs.map(substitution); - if (newExecArgs.join('') !== options.execArgs.join('')) { - options.execArgs = newExecArgs; - delete options.script; - } - } - - if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) { - options.execArgs = options.execArgs.concat(options.nodeArgs); - } - - // note: indexOf('coffee') handles both .coffee and .litcoffee - if ( - !execDefined && - options.exec === 'node' && - scriptExt.indexOf('coffee') !== -1 - ) { - options.exec = 'coffee'; - - // we need to get execArgs set before the script - // for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an - // execArg, while my-flag is a script arg - var leadingArgs = (options.args || []).splice(0, options.scriptPosition); - options.execArgs = options.execArgs.concat(leadingArgs); - options.scriptPosition = 0; - - if (options.execArgs.length > 0) { - // because this is the coffee executable, we need to combine the exec args - // into a single argument after the nodejs flag - options.execArgs = ['--nodejs', options.execArgs.join(' ')]; - } - } - - if (options.exec === 'coffee') { - // don't override user specified extension tracking - if (options.ext === undefined) { - if (extension) { - extension += ','; - } - extension += 'coffee,litcoffee'; - } - - // because windows can't find 'coffee', it needs the real file 'coffee.cmd' - if (utils.isWindows) { - options.exec += '.cmd'; - } - } - - // allow users to make a mistake on the extension to monitor - // converts .js, pug => js,pug - // BIG NOTE: user can't do this: nodemon -e *.js - // because the terminal will automatically expand the glob against - // the file system :( - extension = (extension.match(/[^,*\s]+/g) || []) - .map((ext) => ext.replace(/^\./, '')) - .join(','); - - options.ext = extension; - - if (options.script) { - options.script = expandScript( - options.script, - extension && '.' + extension.split(',')[0] - ); - } - - options.env = {}; - // make sure it's an object (and since we don't have ) - if ({}.toString.apply(nodemonOptions.env) === '[object Object]') { - options.env = utils.clone(nodemonOptions.env); - } else if (nodemonOptions.env !== undefined) { - throw new Error('nodemon env values must be an object: { PORT: 8000 }'); - } - - return options; -} diff --git a/node_modules/nodemon/lib/config/index.js b/node_modules/nodemon/lib/config/index.js deleted file mode 100644 index c78c435..0000000 --- a/node_modules/nodemon/lib/config/index.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Manages the internal config of nodemon, checking for the state of support - * with fs.watch, how nodemon can watch files (using find or fs methods). - * - * This is *not* the user's config. - */ -var debug = require('debug')('nodemon'); -var load = require('./load'); -var rules = require('../rules'); -var utils = require('../utils'); -var pinVersion = require('../version').pin; -var command = require('./command'); -var rulesToMonitor = require('../monitor/match').rulesToMonitor; -var bus = utils.bus; - -function reset() { - rules.reset(); - - config.dirs = []; - config.options = { ignore: [], watch: [], monitor: [] }; - config.lastStarted = 0; - config.loaded = []; -} - -var config = { - run: false, - system: { - cwd: process.cwd(), - }, - required: false, - dirs: [], - timeout: 1000, - options: {}, -}; - -/** - * Take user defined settings, then detect the local machine capability, then - * look for local and global nodemon.json files and merge together the final - * settings with the config for nodemon. - * - * @param {Object} settings user defined settings for nodemon (typically on - * the cli) - * @param {Function} ready callback fired once the config is loaded - */ -config.load = function (settings, ready) { - reset(); - var config = this; - load(settings, config.options, config, function (options) { - config.options = options; - - if (options.watch.length === 0) { - // this is to catch when the watch is left blank - options.watch.push('*.*'); - } - - if (options['watch_interval']) { // jshint ignore:line - options.watchInterval = options['watch_interval']; // jshint ignore:line - } - - config.watchInterval = options.watchInterval || null; - if (options.signal) { - config.signal = options.signal; - } - - var cmd = command(config.options); - config.command = { - raw: cmd, - string: utils.stringify(cmd.executable, cmd.args), - }; - - // now run automatic checks on system adding to the config object - options.monitor = rulesToMonitor(options.watch, options.ignore, config); - - var cwd = process.cwd(); - debug('config: dirs', config.dirs); - if (config.dirs.length === 0) { - config.dirs.unshift(cwd); - } - - bus.emit('config:update', config); - pinVersion().then(function () { - ready(config); - }).catch(e => { - // this doesn't help testing, but does give exposure on syntax errors - console.error(e.stack); - setTimeout(() => { throw e; }, 0); - }); - }); -}; - -config.reset = reset; - -module.exports = config; diff --git a/node_modules/nodemon/lib/config/load.js b/node_modules/nodemon/lib/config/load.js deleted file mode 100644 index 7c57d32..0000000 --- a/node_modules/nodemon/lib/config/load.js +++ /dev/null @@ -1,225 +0,0 @@ -var debug = require('debug')('nodemon'); -var fs = require('fs'); -var path = require('path'); -var exists = fs.exists || path.exists; -var utils = require('../utils'); -var rules = require('../rules'); -var parse = require('../rules/parse'); -var exec = require('./exec'); -var defaults = require('./defaults'); - -module.exports = load; -module.exports.mutateExecOptions = mutateExecOptions; - -var existsSync = fs.existsSync || path.existsSync; - -function findAppScript() { - // nodemon has been run alone, so try to read the package file - // or try to read the index.js file - - var pkg = - existsSync(path.join(process.cwd(), 'package.json')) && - require(path.join(process.cwd(), 'package.json')); - if ((!pkg || pkg.main == undefined) && existsSync('./index.js')) { - return 'index.js'; - } -} - -/** - * Load the nodemon config, first reading the global root/nodemon.json, then - * the local nodemon.json to the exec and then overwriting using any user - * specified settings (i.e. from the cli) - * - * @param {Object} settings user defined settings - * @param {Object} options global options - * @param {Object} config the config object to be updated - * @param {Function} callback that receives complete config - */ -function load(settings, options, config, callback) { - config.loaded = []; - // first load the root nodemon.json - loadFile(options, config, utils.home, function (options) { - // then load the user's local configuration file - if (settings.configFile) { - options.configFile = path.resolve(settings.configFile); - } - loadFile(options, config, process.cwd(), function (options) { - // Then merge over with the user settings (parsed from the cli). - // Note that merge protects and favours existing values over new values, - // and thus command line arguments get priority - options = utils.merge(settings, options); - - // legacy support - if (!Array.isArray(options.ignore)) { - options.ignore = [options.ignore]; - } - - if (!options.ignoreRoot) { - options.ignoreRoot = defaults.ignoreRoot; - } - - // blend the user ignore and the default ignore together - if (options.ignoreRoot && options.ignore) { - if (!Array.isArray(options.ignoreRoot)) { - options.ignoreRoot = [options.ignoreRoot]; - } - options.ignore = options.ignoreRoot.concat(options.ignore); - } else { - options.ignore = defaults.ignore.concat(options.ignore); - } - - // add in any missing defaults - options = utils.merge(options, defaults); - - if (!options.script && !options.exec) { - var found = findAppScript(); - if (found) { - if (!options.args) { - options.args = []; - } - // if the script is found as a result of not being on the command - // line, then we move any of the pre double-dash args in execArgs - const n = - options.scriptPosition === null - ? options.args.length - : options.scriptPosition; - - options.execArgs = (options.execArgs || []).concat( - options.args.splice(0, n) - ); - options.scriptPosition = null; - - options.script = found; - } - } - - mutateExecOptions(options); - - if (options.quiet) { - utils.quiet(); - } - - if (options.verbose) { - utils.debug = true; - } - - // simplify the ready callback to be called after the rules are normalised - // from strings to regexp through the rules lib. Note that this gets - // created *after* options is overwritten twice in the lines above. - var ready = function (options) { - normaliseRules(options, callback); - }; - - ready(options); - }); - }); -} - -function normaliseRules(options, ready) { - // convert ignore and watch options to rules/regexp - rules.watch.add(options.watch); - rules.ignore.add(options.ignore); - - // normalise the watch and ignore arrays - options.watch = options.watch === false ? false : rules.rules.watch; - options.ignore = rules.rules.ignore; - - ready(options); -} - -/** - * Looks for a config in the current working directory, and a config in the - * user's home directory, merging the two together, giving priority to local - * config. This can then be overwritten later by command line arguments - * - * @param {Function} ready callback to pass loaded settings to - */ -function loadFile(options, config, dir, ready) { - if (!ready) { - ready = function () {}; - } - - var callback = function (settings) { - // prefer the local nodemon.json and fill in missing items using - // the global options - ready(utils.merge(settings, options)); - }; - - if (!dir) { - return callback({}); - } - - var filename = options.configFile || path.join(dir, 'nodemon.json'); - - if (config.loaded.indexOf(filename) !== -1) { - // don't bother re-parsing the same config file - return callback({}); - } - - fs.readFile(filename, 'utf8', function (err, data) { - if (err) { - if (err.code === 'ENOENT') { - if (!options.configFile && dir !== utils.home) { - // if no specified local config file and local nodemon.json - // doesn't exist, try the package.json - return loadPackageJSON(config, callback); - } - } - return callback({}); - } - - var settings = {}; - - try { - settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, '')); - if (!filename.endsWith('package.json') || settings.nodemonConfig) { - config.loaded.push(filename); - } - } catch (e) { - utils.log.fail('Failed to parse config ' + filename); - console.error(e); - process.exit(1); - } - - // options values will overwrite settings - callback(settings); - }); -} - -function loadPackageJSON(config, ready) { - if (!ready) { - ready = () => {}; - } - - const dir = process.cwd(); - const filename = path.join(dir, 'package.json'); - const packageLoadOptions = { configFile: filename }; - return loadFile(packageLoadOptions, config, dir, (settings) => { - ready(settings.nodemonConfig || {}); - }); -} - -function mutateExecOptions(options) { - // work out the execOptions based on the final config we have - options.execOptions = exec( - { - script: options.script, - exec: options.exec, - args: options.args, - scriptPosition: options.scriptPosition, - nodeArgs: options.nodeArgs, - execArgs: options.execArgs, - ext: options.ext, - env: options.env, - }, - options.execMap - ); - - // clean up values that we don't need at the top level - delete options.scriptPosition; - delete options.script; - delete options.args; - delete options.ext; - - return options; -} diff --git a/node_modules/nodemon/lib/help/index.js b/node_modules/nodemon/lib/help/index.js deleted file mode 100644 index 1054b60..0000000 --- a/node_modules/nodemon/lib/help/index.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -const supportsColor = require('supports-color'); - -module.exports = help; - -const highlight = supportsColor.stdout ? '\x1B\[$1m' : ''; - -function help(item) { - if (!item) { - item = 'help'; - } else if (item === true) { // if used with -h or --help and no args - item = 'help'; - } - - // cleanse the filename to only contain letters - // aka: /\W/g but figured this was eaiser to read - item = item.replace(/[^a-z]/gi, ''); - - try { - var dir = path.join(__dirname, '..', '..', 'doc', 'cli', item + '.txt'); - var body = fs.readFileSync(dir, 'utf8'); - return body.replace(/\\x1B\[(.)m/g, highlight); - } catch (e) { - return '"' + item + '" help can\'t be found'; - } -} diff --git a/node_modules/nodemon/lib/index.js b/node_modules/nodemon/lib/index.js deleted file mode 100644 index 0eca5c4..0000000 --- a/node_modules/nodemon/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./nodemon'); \ No newline at end of file diff --git a/node_modules/nodemon/lib/monitor/index.js b/node_modules/nodemon/lib/monitor/index.js deleted file mode 100644 index 89db029..0000000 --- a/node_modules/nodemon/lib/monitor/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - run: require('./run'), - watch: require('./watch').watch, -}; diff --git a/node_modules/nodemon/lib/monitor/match.js b/node_modules/nodemon/lib/monitor/match.js deleted file mode 100644 index 11691d7..0000000 --- a/node_modules/nodemon/lib/monitor/match.js +++ /dev/null @@ -1,287 +0,0 @@ -const minimatch = require('minimatch'); -const path = require('path'); -const fs = require('fs'); -const debug = require('debug')('nodemon:match'); -const utils = require('../utils'); - -module.exports = match; -module.exports.rulesToMonitor = rulesToMonitor; - -function rulesToMonitor(watch, ignore, config) { - var monitor = []; - - if (!Array.isArray(ignore)) { - if (ignore) { - ignore = [ignore]; - } else { - ignore = []; - } - } - - if (!Array.isArray(watch)) { - if (watch) { - watch = [watch]; - } else { - watch = []; - } - } - - if (watch && watch.length) { - monitor = utils.clone(watch); - } - - if (ignore) { - [].push.apply( - monitor, - (ignore || []).map(function (rule) { - return '!' + rule; - }) - ); - } - - var cwd = process.cwd(); - - // next check if the monitored paths are actual directories - // or just patterns - and expand the rule to include *.* - monitor = monitor.map(function (rule) { - var not = rule.slice(0, 1) === '!'; - - if (not) { - rule = rule.slice(1); - } - - if (rule === '.' || rule === '.*') { - rule = '*.*'; - } - - var dir = path.resolve(cwd, rule); - - try { - var stat = fs.statSync(dir); - if (stat.isDirectory()) { - rule = dir; - if (rule.slice(-1) !== '/') { - rule += '/'; - } - rule += '**/*'; - - // `!not` ... sorry. - if (!not) { - config.dirs.push(dir); - } - } else { - // ensures we end up in the check that tries to get a base directory - // and then adds it to the watch list - throw new Error(); - } - } catch (e) { - var base = tryBaseDir(dir); - if (!not && base) { - if (config.dirs.indexOf(base) === -1) { - config.dirs.push(base); - } - } - } - - if (rule.slice(-1) === '/') { - // just slap on a * anyway - rule += '*'; - } - - // if the url ends with * but not **/* and not *.* - // then convert to **/* - somehow it was missed :-\ - if ( - rule.slice(-4) !== '**/*' && - rule.slice(-1) === '*' && - rule.indexOf('*.') === -1 - ) { - if (rule.slice(-2) !== '**') { - rule += '*/*'; - } - } - - return (not ? '!' : '') + rule; - }); - - return monitor; -} - -function tryBaseDir(dir) { - var stat; - if (/[?*\{\[]+/.test(dir)) { - // if this is pattern, then try to find the base - try { - var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo')); - stat = fs.statSync(base); - if (stat.isDirectory()) { - return base; - } - } catch (error) { - // console.log(error); - } - } else { - try { - stat = fs.statSync(dir); - // if this path is actually a single file that exists, then just monitor - // that, *specifically*. - if (stat.isFile() || stat.isDirectory()) { - return dir; - } - } catch (e) {} - } - - return false; -} - -function match(files, monitor, ext) { - // sort the rules by highest specificity (based on number of slashes) - // ignore rules (!) get sorted highest as they take precedent - const cwd = process.cwd(); - var rules = monitor - .sort(function (a, b) { - var r = b.split(path.sep).length - a.split(path.sep).length; - var aIsIgnore = a.slice(0, 1) === '!'; - var bIsIgnore = b.slice(0, 1) === '!'; - - if (aIsIgnore || bIsIgnore) { - if (aIsIgnore) { - return -1; - } - - return 1; - } - - if (r === 0) { - return b.length - a.length; - } - return r; - }) - .map(function (s) { - var prefix = s.slice(0, 1); - - if (prefix === '!') { - if (s.indexOf('!' + cwd) === 0) { - return s; - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('!.') === 0) { - return '!' + path.resolve(cwd, s.substring(1)); - } - - return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('.') === 0) { - return path.resolve(cwd, s); - } - - if (s.indexOf(cwd) === 0) { - return s; - } - - return '**' + (prefix !== path.sep ? path.sep : '') + s; - }); - - debug('rules', rules); - - var good = []; - var whitelist = []; // files that we won't check against the extension - var ignored = 0; - var watched = 0; - var usedRules = []; - var minimatchOpts = { - dot: true, - }; - - // enable case-insensitivity on Windows - if (utils.isWindows) { - minimatchOpts.nocase = true; - } - - files.forEach(function (file) { - file = path.resolve(cwd, file); - - var matched = false; - for (var i = 0; i < rules.length; i++) { - if (rules[i].slice(0, 1) === '!') { - if (!minimatch(file, rules[i], minimatchOpts)) { - debug('ignored', file, 'rule:', rules[i]); - ignored++; - matched = true; - break; - } - } else { - debug('matched', file, 'rule:', rules[i]); - if (minimatch(file, rules[i], minimatchOpts)) { - watched++; - - // don't repeat the output if a rule is matched - if (usedRules.indexOf(rules[i]) === -1) { - usedRules.push(rules[i]); - utils.log.detail('matched rule: ' + rules[i]); - } - - // if the rule doesn't match the WATCH EVERYTHING - // but *does* match a rule that ends with *.*, then - // white list it - in that we don't run it through - // the extension check too. - if ( - rules[i] !== '**' + path.sep + '*.*' && - rules[i].slice(-3) === '*.*' - ) { - whitelist.push(file); - } else if (path.basename(file) === path.basename(rules[i])) { - // if the file matches the actual rule, then it's put on whitelist - whitelist.push(file); - } else { - good.push(file); - } - matched = true; - } else { - // utils.log.detail('no match: ' + rules[i], file); - } - } - } - if (!matched) { - ignored++; - } - }); - - // finally check the good files against the extensions that we're monitoring - if (ext) { - if (ext.indexOf(',') === -1) { - ext = '**/*.' + ext; - } else { - ext = '**/*.{' + ext + '}'; - } - - good = good.filter(function (file) { - // only compare the filename to the extension test - return minimatch(path.basename(file), ext, minimatchOpts); - }); - debug('good (filtered by ext)', good); - } else { - // else assume *.* - debug('good', good); - } - - if (whitelist.length) debug('whitelist', whitelist); - - var result = good.concat(whitelist); - - if (utils.isWindows) { - // fix for windows testing - I *think* this is okay to do - result = result.map(function (file) { - return file.slice(0, 1).toLowerCase() + file.slice(1); - }); - } - - return { - result: result, - ignored: ignored, - watched: watched, - total: files.length, - }; -} diff --git a/node_modules/nodemon/lib/monitor/run.js b/node_modules/nodemon/lib/monitor/run.js deleted file mode 100644 index 5fa7f45..0000000 --- a/node_modules/nodemon/lib/monitor/run.js +++ /dev/null @@ -1,562 +0,0 @@ -var debug = require('debug')('nodemon:run'); -const statSync = require('fs').statSync; -var utils = require('../utils'); -var bus = utils.bus; -var childProcess = require('child_process'); -var spawn = childProcess.spawn; -var exec = childProcess.exec; -var execSync = childProcess.execSync; -var fork = childProcess.fork; -var watch = require('./watch').watch; -var config = require('../config'); -var child = null; // the actual child process we spawn -var killedAfterChange = false; -var noop = () => {}; -var restart = null; -var psTree = require('pstree.remy'); -var path = require('path'); -var signals = require('./signals'); -const undefsafe = require('undefsafe'); -const osRelease = parseInt(require('os').release().split('.')[0], 10); - -function run(options) { - var cmd = config.command.raw; - // moved up - // we need restart function below in the global scope for run.kill - /*jshint validthis:true*/ - restart = run.bind(this, options); - run.restart = restart; - - // binding options with instance of run - // so that we can use it in run.kill - run.options = options; - - var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0; - if (runCmd) { - utils.log.status('starting `' + config.command.string + '`'); - } else { - // should just watch file if command is not to be run - // had another alternate approach - // to stop process being forked/spawned in the below code - // but this approach does early exit and makes code cleaner - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - return; - } - } - - config.lastStarted = Date.now(); - - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - if (config.options.stdin === false) { - stdio = [process.stdin, process.stdout, process.stderr]; - } - - var sh = 'sh'; - var shFlag = '-c'; - - const binPath = process.cwd() + '/node_modules/.bin'; - - const spawnOptions = { - env: Object.assign({}, options.execOptions.env, process.env, { - PATH: - binPath + - path.delimiter + - (undefsafe(options, '.execOptions.env.PATH') || process.env.PATH), - }), - stdio: stdio, - }; - - var executable = cmd.executable; - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - if (executable.indexOf('/') !== -1) { - executable = executable - .split(' ') - .map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }) - .join(' '); - } - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - spawnOptions.windowsHide = true; - } - - var args = runCmd ? utils.stringify(executable, cmd.args) : ':'; - var spawnArgs = [sh, [shFlag, args], spawnOptions]; - - const firstArg = cmd.args[0] || ''; - - var inBinPath = false; - try { - inBinPath = statSync(`${binPath}/${executable}`).isFile(); - } catch (e) {} - - // hasStdio allows us to correctly handle stdin piping - // see: https://git.io/vNtX3 - const hasStdio = utils.satisfies('>= 6.4.0 || < 5'); - - // forking helps with sub-process handling and tends to clean up better - // than spawning, but it should only be used under specific conditions - const shouldFork = - !config.options.spawn && - !inBinPath && - !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg - firstArg !== 'inspect' && // don't fork it's `inspect` debugger - executable === 'node' && // only fork if node - utils.version.major > 4; // only fork if node version > 4 - - if (shouldFork) { - // this assumes the first argument is the script and slices it out, since - // we're forking - var forkArgs = cmd.args.slice(1); - var env = utils.merge(options.execOptions.env, process.env); - stdio.push('ipc'); - const forkOptions = { - env: env, - stdio: stdio, - silent: !hasStdio, - }; - if (utils.isWindows) { - forkOptions.windowsHide = true; - } - child = fork(options.execOptions.script, forkArgs, forkOptions); - utils.log.detail('forking'); - debug('fork', sh, shFlag, args); - } else { - utils.log.detail('spawning'); - child = spawn.apply(null, spawnArgs); - debug('spawn', sh, shFlag, args); - } - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - - if (shouldFork) { - child.on('message', function (message, sendHandle) { - bus.emit('message', message, sendHandle); - }); - } - } - - bus.emit('start'); - - utils.log.detail('child pid: ' + child.pid); - - child.on('error', function (error) { - bus.emit('error', error); - if (error.code === 'ENOENT') { - utils.log.error('unable to run executable: "' + cmd.executable + '"'); - process.exit(1); - } else { - utils.log.error('failed to start child process: ' + error.code); - throw error; - } - }); - - child.on('exit', function (code, signal) { - if (child && child.stdin) { - process.stdin.unpipe(child.stdin); - } - - if (code === 127) { - utils.log.error( - 'failed to start process, "' + cmd.executable + '" exec not found' - ); - bus.emit('error', code); - process.exit(); - } - - // If the command failed with code 2, it may or may not be a syntax error - // See: http://git.io/fNOAR - // We will only assume a parse error, if the child failed quickly - if (code === 2 && Date.now() < config.lastStarted + 500) { - utils.log.error('process failed, unhandled exit code (2)'); - utils.log.error(''); - utils.log.error('Either the command has a syntax error,'); - utils.log.error('or it is exiting with reserved code 2.'); - utils.log.error(''); - utils.log.error('To keep nodemon running even after a code 2,'); - utils.log.error('add this to the end of your command: || exit 1'); - utils.log.error(''); - utils.log.error('Read more here: https://git.io/fNOAG'); - utils.log.error(''); - utils.log.error('nodemon will stop now so that you can fix the command.'); - utils.log.error(''); - bus.emit('error', code); - process.exit(); - } - - // In case we killed the app ourselves, set the signal thusly - if (killedAfterChange) { - killedAfterChange = false; - signal = config.signal; - } - // this is nasty, but it gives it windows support - if (utils.isWindows && signal === 'SIGTERM') { - signal = config.signal; - } - - if (signal === config.signal || code === 0) { - // this was a clean exit, so emit exit, rather than crash - debug('bus.emit(exit) via ' + config.signal); - bus.emit('exit', signal); - - // exit the monitor, but do it gracefully - if (signal === config.signal) { - return restart(); - } - - if (code === 0) { - // clean exit - wait until file change to restart - if (runCmd) { - utils.log.status('clean exit - waiting for changes before restart'); - } - child = null; - } - } else { - bus.emit('crash'); - - // support the old syntax of `exitcrash` - 2024-12-13 - if (options.exitcrash) { - options.exitCrash = true; - delete options.exitcrash; - } - - if (options.exitCrash) { - utils.log.fail('app crashed'); - if (!config.required) { - process.exit(1); - } - } else { - utils.log.fail( - 'app crashed - waiting for file changes before' + ' starting...' - ); - child = null; - } - } - - if (config.options.restartable) { - // stdin needs to kick in again to be able to listen to the - // restart command - process.stdin.resume(); - } - }); - - // moved the run.kill outside to handle both the cases - // intial start - // no start - - // connect stdin to the child process (options.stdin is on by default) - if (options.stdin) { - process.stdin.resume(); - // FIXME decide whether or not we need to decide the encoding - // process.stdin.setEncoding('utf8'); - - // swallow the stdin error if it happens - // ref: https://github.com/remy/nodemon/issues/1195 - if (hasStdio) { - child.stdin.on('error', () => {}); - process.stdin.pipe(child.stdin); - } else { - if (child.stdout) { - child.stdout.pipe(process.stdout); - } else { - utils.log.error( - 'running an unsupported version of node ' + process.version - ); - utils.log.error( - 'nodemon may not work as expected - ' + - 'please consider upgrading to LTS' - ); - } - } - - bus.once('exit', function () { - if (child && process.stdin.unpipe) { - // node > 0.8 - process.stdin.unpipe(child.stdin); - } - }); - } - - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - } -} - -function waitForSubProcesses(pid, callback) { - debug('checking ps tree for pids of ' + pid); - psTree(pid, (err, pids) => { - if (!pids.length) { - return callback(); - } - - utils.log.status( - `still waiting for ${pids.length} sub-process${ - pids.length > 2 ? 'es' : '' - } to finish...` - ); - setTimeout(() => waitForSubProcesses(pid, callback), 1000); - }); -} - -function kill(child, signal, callback) { - if (!callback) { - callback = noop; - } - - if (utils.isWindows) { - const taskKill = () => { - try { - exec('taskkill /pid ' + child.pid + ' /T /F'); - } catch (e) { - utils.log.error('Could not shutdown sub process cleanly'); - } - }; - - // We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the - // same way it is handled on a UNIX system: We are performing - // a hard shutdown without waiting for the process to clean-up. - if ( - signal === 'SIGKILL' || - osRelease < 10 || - signal === 'SIGUSR2' || - signal === 'SIGUSR1' - ) { - debug('terminating process group by force: %s', child.pid); - - // We are using the taskkill utility to terminate the whole - // process group ('/t') of the child ('/pid') by force ('/f'). - // We need to end all sub processes, because the 'child' - // process in this context is actually a cmd.exe wrapper. - taskKill(); - callback(); - return; - } - - try { - // We are using the Windows Management Instrumentation Command-line - // (wmic.exe) to resolve the sub-child process identifier, because the - // 'child' process in this context is actually a cmd.exe wrapper. - // We want to send the termination signal directly to the node process. - // The '2> nul' silences the no process found error message. - const resultBuffer = execSync( - `wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul` - ); - const result = resultBuffer.toString().match(/^[0-9]+/m); - - // If there is no sub-child process we fall back to the child process. - const processId = Array.isArray(result) ? result[0] : child.pid; - - debug('sending kill signal SIGINT to process: %s', processId); - - // We are using the standalone 'windows-kill' executable to send the - // standard POSIX signal 'SIGINT' to the node process. This fixes #1720. - const windowsKill = path.normalize( - `${__dirname}/../../bin/windows-kill.exe` - ); - - // We have to detach the 'windows-kill' execution completely from this - // process group to avoid terminating the nodemon process itself. - // See: https://github.com/alirdn/windows-kill#how-it-works--limitations - // - // Therefore we are using 'start' to create a new cmd.exe context. - // The '/min' option hides the new terminal window and the '/wait' - // option lets the process wait for the command to finish. - - execSync( - `start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}` - ); - } catch (e) { - taskKill(); - } - callback(); - } else { - // we use psTree to kill the full subtree of nodemon, because when - // spawning processes like `coffee` under the `--debug` flag, it'll spawn - // it's own child, and that can't be killed by nodemon, so psTree gives us - // an array of PIDs that have spawned under nodemon, and we send each the - // configured signal (default: SIGUSR2) signal, which fixes #335 - // note that psTree also works if `ps` is missing by looking in /proc - let sig = signal.replace('SIG', ''); - - psTree(child.pid, function (err, pids) { - // if ps isn't native to the OS, then we need to send the numeric value - // for the signal during the kill, `signals` is a lookup table for that. - if (!psTree.hasPS) { - sig = signals[signal]; - } - - // the sub processes need to be killed from smallest to largest - debug('sending kill signal to ' + pids.join(', ')); - - child.kill(signal); - - pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop)); - - waitForSubProcesses(child.pid, () => { - // finally kill the main user process - exec(`kill -${sig} ${child.pid}`, callback); - }); - }); - } -} - -run.kill = function (noRestart, callback) { - // I hate code like this :( - Remy (author of said code) - if (typeof noRestart === 'function') { - callback = noRestart; - noRestart = false; - } - - if (!callback) { - callback = noop; - } - - if (child !== null) { - // if the stdin piping is on, we need to unpipe, but also close stdin on - // the child, otherwise linux can throw EPIPE or ECONNRESET errors. - if (run.options.stdin) { - process.stdin.unpipe(child.stdin); - } - - // For the on('exit', ...) handler above the following looks like a - // crash, so we set the killedAfterChange flag if a restart is planned - if (!noRestart) { - killedAfterChange = true; - } - - /* Now kill the entire subtree of processes belonging to nodemon */ - var oldPid = child.pid; - if (child) { - kill(child, config.signal, function () { - // this seems to fix the 0.11.x issue with the "rs" restart command, - // though I'm unsure why. it seems like more data is streamed in to - // stdin after we close. - if (child && run.options.stdin && child.stdin && oldPid === child.pid) { - child.stdin.end(); - } - callback(); - }); - } - } else if (!noRestart) { - // if there's no child, then we need to manually start the process - // this is because as there was no child, the child.on('exit') event - // handler doesn't exist which would normally trigger the restart. - bus.once('start', callback); - run.restart(); - } else { - callback(); - } -}; - -run.restart = noop; - -bus.on('quit', function onQuit(code) { - if (code === undefined) { - code = 0; - } - - // remove event listener - var exitTimer = null; - var exit = function () { - clearTimeout(exitTimer); - exit = noop; // null out in case of race condition - child = null; - if (!config.required) { - // Execute all other quit listeners. - bus.listeners('quit').forEach(function (listener) { - if (listener !== onQuit) { - listener(); - } - }); - process.exit(code); - } else { - bus.emit('exit'); - } - }; - - // if we're not running already, don't bother with trying to kill - if (config.run === false) { - return exit(); - } - - // immediately try to stop any polling - config.run = false; - - if (child) { - // give up waiting for the kids after 10 seconds - exitTimer = setTimeout(exit, 10 * 1000); - child.removeAllListeners('exit'); - child.once('exit', exit); - - kill(child, 'SIGINT'); - } else { - exit(); - } -}); - -bus.on('restart', function () { - // run.kill will send a SIGINT to the child process, which will cause it - // to terminate, which in turn uses the 'exit' event handler to restart - run.kill(); -}); - -// remove the child file on exit -process.on('exit', function () { - utils.log.detail('exiting'); - if (child) { - child.kill(); - } -}); - -// because windows borks when listening for the SIG* events -if (!utils.isWindows) { - bus.once('boot', () => { - // usual suspect: ctrl+c exit - process.once('SIGINT', () => bus.emit('quit', 130)); - process.once('SIGTERM', () => { - bus.emit('quit', 143); - if (child) { - child.kill('SIGTERM'); - } - }); - }); -} - -module.exports = run; diff --git a/node_modules/nodemon/lib/monitor/signals.js b/node_modules/nodemon/lib/monitor/signals.js deleted file mode 100644 index daff6e0..0000000 --- a/node_modules/nodemon/lib/monitor/signals.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - SIGHUP: 1, - SIGINT: 2, - SIGQUIT: 3, - SIGILL: 4, - SIGTRAP: 5, - SIGABRT: 6, - SIGBUS: 7, - SIGFPE: 8, - SIGKILL: 9, - SIGUSR1: 10, - SIGSEGV: 11, - SIGUSR2: 12, - SIGPIPE: 13, - SIGALRM: 14, - SIGTERM: 15, - SIGSTKFLT: 16, - SIGCHLD: 17, - SIGCONT: 18, - SIGSTOP: 19, - SIGTSTP: 20, - SIGTTIN: 21, - SIGTTOU: 22, - SIGURG: 23, - SIGXCPU: 24, - SIGXFSZ: 25, - SIGVTALRM: 26, - SIGPROF: 27, - SIGWINCH: 28, - SIGIO: 29, - SIGPWR: 30, - SIGSYS: 31, - SIGRTMIN: 35, -} diff --git a/node_modules/nodemon/lib/monitor/watch.js b/node_modules/nodemon/lib/monitor/watch.js deleted file mode 100644 index d0ac7fe..0000000 --- a/node_modules/nodemon/lib/monitor/watch.js +++ /dev/null @@ -1,244 +0,0 @@ -module.exports.watch = watch; -module.exports.resetWatchers = resetWatchers; - -var debug = require('debug')('nodemon:watch'); -var debugRoot = require('debug')('nodemon'); -var chokidar = require('chokidar'); -var undefsafe = require('undefsafe'); -var config = require('../config'); -var path = require('path'); -var utils = require('../utils'); -var bus = utils.bus; -var match = require('./match'); -var watchers = []; -var debouncedBus; - -bus.on('reset', resetWatchers); - -function resetWatchers() { - debugRoot('resetting watchers'); - watchers.forEach(function (watcher) { - watcher.close(); - }); - watchers = []; -} - -function watch() { - if (watchers.length) { - debug('early exit on watch, still watching (%s)', watchers.length); - return; - } - - var dirs = [].slice.call(config.dirs); - - debugRoot('start watch on: %s', dirs.join(', ')); - const rootIgnored = config.options.ignore; - debugRoot('ignored', rootIgnored); - - var watchedFiles = []; - - const promise = new Promise(function (resolve) { - const dotFilePattern = /[/\\]\./; - var ignored = match.rulesToMonitor( - [], // not needed - Array.from(rootIgnored), - config - ).map(pattern => pattern.slice(1)); - - const addDotFile = dirs.filter(dir => dir.match(dotFilePattern)); - - // don't ignore dotfiles if explicitly watched. - if (addDotFile.length === 0) { - ignored.push(dotFilePattern); - } - - var watchOptions = { - ignorePermissionErrors: true, - ignored: ignored, - persistent: true, - usePolling: config.options.legacyWatch || false, - interval: config.options.pollingInterval, - // note to future developer: I've gone back and forth on adding `cwd` - // to the props and in some cases it fixes bugs but typically it causes - // bugs elsewhere (since nodemon is used is so many ways). the final - // decision is to *not* use it at all and work around it - // cwd: ... - }; - - if (utils.isWindows) { - watchOptions.disableGlobbing = true; - } - - if (utils.isIBMi) { - watchOptions.usePolling = true; - } - - if (process.env.TEST) { - watchOptions.useFsEvents = false; - } - - var watcher = chokidar.watch( - dirs, - Object.assign({}, watchOptions, config.options.watchOptions || {}) - ); - - watcher.ready = false; - - var total = 0; - - watcher.on('change', filterAndRestart); - watcher.on('unlink', filterAndRestart); - watcher.on('add', function (file) { - if (watcher.ready) { - return filterAndRestart(file); - } - - watchedFiles.push(file); - bus.emit('watching', file); - debug('chokidar watching: %s', file); - }); - watcher.on('ready', function () { - watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes - total = watchedFiles.length; - watcher.ready = true; - resolve(total); - debugRoot('watch is complete'); - }); - - watcher.on('error', function (error) { - if (error.code === 'EINVAL') { - utils.log.error( - 'Internal watch failed. Likely cause: too many ' + - 'files being watched (perhaps from the root of a drive?\n' + - 'See https://github.com/paulmillr/chokidar/issues/229 for details' - ); - } else { - utils.log.error('Internal watch failed: ' + error.message); - process.exit(1); - } - }); - - watchers.push(watcher); - }); - - return promise.catch(e => { - // this is a core error and it should break nodemon - so I have to break - // out of a promise using the setTimeout - setTimeout(() => { - throw e; - }); - }).then(function () { - utils.log.detail(`watching ${watchedFiles.length} file${ - watchedFiles.length === 1 ? '' : 's'}`); - return watchedFiles; - }); -} - -function filterAndRestart(files) { - if (!Array.isArray(files)) { - files = [files]; - } - - if (files.length) { - var cwd = process.cwd(); - if (this.options && this.options.cwd) { - cwd = this.options.cwd; - } - - utils.log.detail( - 'files triggering change check: ' + - files - .map(file => { - const res = path.relative(cwd, file); - return res; - }) - .join(', ') - ); - - // make sure the path is right and drop an empty - // filenames (sometimes on windows) - files = files.filter(Boolean).map(file => { - return path.relative(process.cwd(), path.relative(cwd, file)); - }); - - if (utils.isWindows) { - // ensure the drive letter is in uppercase (c:\foo -> C:\foo) - files = files.map(f => { - if (f.indexOf(':') === -1) { return f; } - return f[0].toUpperCase() + f.slice(1); - }); - } - - - debug('filterAndRestart on', files); - - var matched = match( - files, - config.options.monitor, - undefsafe(config, 'options.execOptions.ext') - ); - - debug('matched?', JSON.stringify(matched)); - - // if there's no matches, then test to see if the changed file is the - // running script, if so, let's allow a restart - if (config.options.execOptions && config.options.execOptions.script) { - const script = path.resolve(config.options.execOptions.script); - if (matched.result.length === 0 && script) { - const length = script.length; - files.find(file => { - if (file.substr(-length, length) === script) { - matched = { - result: [file], - total: 1, - }; - return true; - } - }); - } - } - - utils.log.detail( - 'changes after filters (before/after): ' + - [files.length, matched.result.length].join('/') - ); - - // reset the last check so we're only looking at recently modified files - config.lastStarted = Date.now(); - - if (matched.result.length) { - if (config.options.delay > 0) { - utils.log.detail('delaying restart for ' + config.options.delay + 'ms'); - if (debouncedBus === undefined) { - debouncedBus = debounce(restartBus, config.options.delay); - } - debouncedBus(matched); - } else { - return restartBus(matched); - } - } - } -} - -function restartBus(matched) { - utils.log.status('restarting due to changes...'); - matched.result.map(file => { - utils.log.detail(path.relative(process.cwd(), file)); - }); - - if (config.options.verbose) { - utils.log._log(''); - } - - bus.emit('restart', matched.result); -} - -function debounce(fn, delay) { - var timer = null; - return function () { - const context = this; - const args = arguments; - clearTimeout(timer); - timer = setTimeout(() =>fn.apply(context, args), delay); - }; -} diff --git a/node_modules/nodemon/lib/nodemon.js b/node_modules/nodemon/lib/nodemon.js deleted file mode 100644 index 75619ba..0000000 --- a/node_modules/nodemon/lib/nodemon.js +++ /dev/null @@ -1,317 +0,0 @@ -var debug = require('debug')('nodemon'); -var path = require('path'); -var monitor = require('./monitor'); -var cli = require('./cli'); -var version = require('./version'); -var util = require('util'); -var utils = require('./utils'); -var bus = utils.bus; -var help = require('./help'); -/** @type {import('..').NodemonEventConfig} */ -var config = require('./config'); -var spawn = require('./spawn'); -const defaults = require('./config/defaults') -var eventHandlers = {}; - -// this is fairly dirty, but theoretically sound since it's part of the -// stable module API -config.required = utils.isRequired; - -/** - * @param {import('..').NodemonSettings | string} settings - * @returns {import('..').Nodemon} - */ -function nodemon(settings) { - bus.emit('boot'); - nodemon.reset(); - - /** @type {import('..').NodemonSettings} */ - let options - - // allow the cli string as the argument to nodemon, and allow for - // `node nodemon -V app.js` or just `-V app.js` - if (typeof settings === 'string') { - settings = settings.trim(); - if (settings.indexOf('node') !== 0) { - if (settings.indexOf('nodemon') !== 0) { - settings = 'nodemon ' + settings; - } - settings = 'node ' + settings; - } - options = cli.parse(settings); - } else options = settings; - - // set the debug flag as early as possible to get all the detailed logging - if (options.verbose) { - utils.debug = true; - } - - if (options.help) { - if (process.stdout.isTTY) { - process.stdout._handle.setBlocking(true); // nodejs/node#6456 - } - console.log(help(options.help)); - if (!config.required) { - process.exit(0); - } - } - - if (options.version) { - version().then(function (v) { - console.log(v); - if (!config.required) { - process.exit(0); - } - }); - return; - } - - // nodemon tools like grunt-nodemon. This affects where - // the script is being run from, and will affect where - // nodemon looks for the nodemon.json files - if (options.cwd) { - // this is protection to make sure we haven't dont the chdir already... - // say like in cli/parse.js (which is where we do this once already!) - if (process.cwd() !== path.resolve(config.system.cwd, options.cwd)) { - process.chdir(options.cwd); - } - } - - config.load(options, function (config) { - if (!config.options.dump && !config.options.execOptions.script && - config.options.execOptions.exec === 'node') { - if (!config.required) { - console.log(help('usage')); - process.exit(); - } - return; - } - - // before we print anything, update the colour setting on logging - utils.colours = config.options.colours; - - // always echo out the current version - utils.log.info(version.pinned); - - const cwd = process.cwd(); - - if (config.options.cwd) { - utils.log.detail('process root: ' + cwd); - } - - config.loaded.map(file => file.replace(cwd, '.')).forEach(file => { - utils.log.detail('reading config ' + file); - }); - - if (config.options.stdin && config.options.restartable) { - // allow nodemon to restart when the use types 'rs\n' - process.stdin.resume(); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', data => { - const str = data.toString().trim().toLowerCase(); - - // if the keys entered match the restartable value, then restart! - if (str === config.options.restartable) { - bus.emit('restart'); - } else if (data.charCodeAt(0) === 12) { // ctrl+l - console.clear(); - } - }); - } else if (config.options.stdin) { - // so let's make sure we don't eat the key presses - // but also, since we're wrapping, watch out for - // special keys, like ctrl+c x 2 or '.exit' or ctrl+d or ctrl+l - var ctrlC = false; - var buffer = ''; - - process.stdin.on('data', function (data) { - data = data.toString(); - buffer += data; - const chr = data.charCodeAt(0); - - // if restartable, echo back - if (chr === 3) { - if (ctrlC) { - process.exit(0); - } - - ctrlC = true; - return; - } else if (buffer === '.exit' || chr === 4) { // ctrl+d - process.exit(); - } else if (chr === 13 || chr === 10) { // enter / carriage return - buffer = ''; - } else if (chr === 12) { // ctrl+l - console.clear(); - buffer = ''; - } - ctrlC = false; - }); - if (process.stdin.setRawMode) { - process.stdin.setRawMode(true); - } - } - - if (config.options.restartable) { - utils.log.info('to restart at any time, enter `' + - config.options.restartable + '`'); - } - - if (!config.required) { - const restartSignal = config.options.signal === 'SIGUSR2' ? 'SIGHUP' : 'SIGUSR2'; - process.on(restartSignal, nodemon.restart); - utils.bus.on('error', () => { - utils.log.fail((new Error().stack)); - }); - utils.log.detail((config.options.restartable ? 'or ' : '') + 'send ' + - restartSignal + ' to ' + process.pid + ' to restart'); - } - - const ignoring = config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - return false; - } - - rule = rule.slice(1); - - // don't notify of default ignores - if (defaults.ignoreRoot.indexOf(rule) !== -1) { - return false; - // return rule.slice(3).slice(0, -3); - } - - if (rule.startsWith(cwd)) { - return rule.replace(cwd, '.'); - } - - return rule; - }).filter(Boolean).join(' '); - if (ignoring) utils.log.detail('ignoring: ' + ignoring); - - utils.log.info('watching path(s): ' + config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - try { - rule = path.relative(process.cwd(), rule); - } catch (e) {} - - return rule; - } - - return false; - }).filter(Boolean).join(' ')); - - utils.log.info('watching extensions: ' + (config.options.execOptions.ext || '(all)')); - - if (config.options.dump) { - utils.log._log('log', '--------------'); - utils.log._log('log', 'node: ' + process.version); - utils.log._log('log', 'nodemon: ' + version.pinned); - utils.log._log('log', 'command: ' + process.argv.join(' ')); - utils.log._log('log', 'cwd: ' + cwd); - utils.log._log('log', ['OS:', process.platform, process.arch].join(' ')); - utils.log._log('log', '--------------'); - utils.log._log('log', util.inspect(config, { depth: null })); - utils.log._log('log', '--------------'); - if (!config.required) { - process.exit(); - } - - return; - } - - config.run = true; - - if (config.options.stdout === false) { - nodemon.on('start', function () { - nodemon.stdout = bus.stdout; - nodemon.stderr = bus.stderr; - - bus.emit('readable'); - }); - } - - if (config.options.events && Object.keys(config.options.events).length) { - Object.keys(config.options.events).forEach(function (key) { - utils.log.detail('bind ' + key + ' -> `' + - config.options.events[key] + '`'); - nodemon.on(key, function () { - if (config.options && config.options.events) { - spawn(config.options.events[key], config, - [].slice.apply(arguments)); - } - }); - }); - } - - monitor.run(config.options); - - }); - - return nodemon; -} - -nodemon.restart = function () { - utils.log.status('restarting child process'); - bus.emit('restart'); - return nodemon; -}; - -nodemon.addListener = nodemon.on = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.on(event, handler); - return nodemon; -}; - -nodemon.once = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.once(event, function () { - debug('bus.once(%s)', event); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - handler.apply(this, arguments); - }); - return nodemon; -}; - -nodemon.emit = function () { - bus.emit.apply(bus, [].slice.call(arguments)); - return nodemon; -}; - -nodemon.removeAllListeners = function (event) { - // unbind only the `nodemon.on` event handlers - Object.keys(eventHandlers).filter(function (e) { - return event ? e === event : true; - }).forEach(function (event) { - eventHandlers[event].forEach(function (handler) { - bus.removeListener(event, handler); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - }); - }); - - return nodemon; -}; - -nodemon.reset = function (done) { - bus.emit('reset', done); -}; - -bus.on('reset', function (done) { - debug('reset'); - nodemon.removeAllListeners(); - monitor.run.kill(true, function () { - utils.reset(); - config.reset(); - config.run = false; - if (done) { - done(); - } - }); -}); - -// expose the full config -nodemon.config = config; - -module.exports = nodemon; - diff --git a/node_modules/nodemon/lib/rules/add.js b/node_modules/nodemon/lib/rules/add.js deleted file mode 100644 index 11f1fd7..0000000 --- a/node_modules/nodemon/lib/rules/add.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -// internal -var reEscComments = /\\#/g; -// note that '^^' is used in place of escaped comments -var reUnescapeComments = /\^\^/g; -var reComments = /#.*$/; -var reEscapeChars = /[.|\-[\]()\\]/g; -var reAsterisk = /\*/g; - -module.exports = add; - -/** - * Converts file patterns or regular expressions to nodemon - * compatible RegExp matching rules. Note: the `rules` argument - * object is modified to include the new rule and new RegExp - * - * ### Example: - * - * var rules = { watch: [], ignore: [] }; - * add(rules, 'watch', '*.js'); - * add(rules, 'ignore', '/public/'); - * add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp - * add(rules, 'watch', /\d*\.js/); - * - * @param {Object} rules containing `watch` and `ignore`. Also updated during - * execution - * @param {String} which must be either "watch" or "ignore" - * @param {String|RegExp} rule the actual rule. - */ -function add(rules, which, rule) { - if (!{ ignore: 1, watch: 1}[which]) { - throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' + - 'first argument'); - } - - if (Array.isArray(rule)) { - rule.forEach(function (rule) { - add(rules, which, rule); - }); - return; - } - - // support the rule being a RegExp, but reformat it to - // the custom : format that we're working with. - if (rule instanceof RegExp) { - // rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1'); - utils.log.error('RegExp format no longer supported, but globs are.'); - return; - } - - // remove comments and trim lines - // this mess of replace methods is escaping "\#" to allow for emacs temp files - - // first up strip comments and remove blank head or tails - rule = (rule || '').replace(reEscComments, '^^') - .replace(reComments, '') - .replace(reUnescapeComments, '#').trim(); - - var regexp = false; - - if (typeof rule === 'string' && rule.substring(0, 1) === ':') { - rule = rule.substring(1); - utils.log.error('RegExp no longer supported: ' + rule); - regexp = true; - } else if (rule.length === 0) { - // blank line (or it was a comment) - return; - } - - if (regexp) { - // rules[which].push(rule); - } else { - // rule = rule.replace(reEscapeChars, '\\$&') - // .replace(reAsterisk, '.*'); - - rules[which].push(rule); - // compile a regexp of all the rules for this ignore or watch - var re = rules[which].map(function (rule) { - return rule.replace(reEscapeChars, '\\$&') - .replace(reAsterisk, '.*'); - }).join('|'); - - // used for the directory matching - rules[which].re = new RegExp(re); - } -} diff --git a/node_modules/nodemon/lib/rules/index.js b/node_modules/nodemon/lib/rules/index.js deleted file mode 100644 index 04aa92f..0000000 --- a/node_modules/nodemon/lib/rules/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; -var utils = require('../utils'); -var add = require('./add'); -var parse = require('./parse'); - -// exported -var rules = { ignore: [], watch: [] }; - -/** - * Loads a nodemon config file and populates the ignore - * and watch rules with it's contents, and calls callback - * with the new rules - * - * @param {String} filename - * @param {Function} callback - */ -function load(filename, callback) { - parse(filename, function (err, result) { - if (err) { - // we should have bombed already, but - utils.log.error(err); - callback(err); - } - - if (result.raw) { - result.raw.forEach(add.bind(null, rules, 'ignore')); - } else { - result.ignore.forEach(add.bind(null, rules, 'ignore')); - result.watch.forEach(add.bind(null, rules, 'watch')); - } - - callback(null, rules); - }); -} - -module.exports = { - reset: function () { // just used for testing - rules.ignore.length = rules.watch.length = 0; - delete rules.ignore.re; - delete rules.watch.re; - }, - load: load, - ignore: { - test: add.bind(null, rules, 'ignore'), - add: add.bind(null, rules, 'ignore'), - }, - watch: { - test: add.bind(null, rules, 'watch'), - add: add.bind(null, rules, 'watch'), - }, - add: add.bind(null, rules), - rules: rules, -}; \ No newline at end of file diff --git a/node_modules/nodemon/lib/rules/parse.js b/node_modules/nodemon/lib/rules/parse.js deleted file mode 100644 index 6e1cace..0000000 --- a/node_modules/nodemon/lib/rules/parse.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; -var fs = require('fs'); - -/** - * Parse the nodemon config file, supporting both old style - * plain text config file, and JSON version of the config - * - * @param {String} filename - * @param {Function} callback - */ -function parse(filename, callback) { - var rules = { - ignore: [], - watch: [], - }; - - fs.readFile(filename, 'utf8', function (err, content) { - - if (err) { - return callback(err); - } - - var json = null; - try { - json = JSON.parse(content); - } catch (e) {} - - if (json !== null) { - rules = { - ignore: json.ignore || [], - watch: json.watch || [], - }; - - return callback(null, rules); - } - - // otherwise return the raw file - return callback(null, { raw: content.split(/\n/) }); - }); -} - -module.exports = parse; - diff --git a/node_modules/nodemon/lib/spawn.js b/node_modules/nodemon/lib/spawn.js deleted file mode 100644 index 256734a..0000000 --- a/node_modules/nodemon/lib/spawn.js +++ /dev/null @@ -1,74 +0,0 @@ -const path = require('path'); -const utils = require('./utils'); -const merge = utils.merge; -const bus = utils.bus; -const spawn = require('child_process').spawn; - -module.exports = function spawnCommand(command, config, eventArgs) { - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - const env = merge(process.env, { FILENAME: eventArgs[0] }); - - var sh = 'sh'; - var shFlag = '-c'; - var spawnOptions = { - env: merge(config.options.execOptions.env, env), - stdio: stdio, - }; - - if (!Array.isArray(command)) { - command = [command]; - } - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - command = command.map(executable => { - if (executable.indexOf('/') === -1) { - return executable; - } - - return executable.split(' ').map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }).join(' '); - }); - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - spawnOptions.windowsHide = true; - } - - const args = command.join(' '); - const child = spawn(sh, [shFlag, args], spawnOptions); - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - } -}; diff --git a/node_modules/nodemon/lib/utils/bus.js b/node_modules/nodemon/lib/utils/bus.js deleted file mode 100644 index 4e120c5..0000000 --- a/node_modules/nodemon/lib/utils/bus.js +++ /dev/null @@ -1,44 +0,0 @@ -var events = require('events'); -var debug = require('debug')('nodemon'); -var util = require('util'); - -var Bus = function () { - events.EventEmitter.call(this); -}; - -util.inherits(Bus, events.EventEmitter); - -var bus = new Bus(); - -// /* -var collected = {}; -bus.on('newListener', function (event) { - debug('bus new listener: %s (%s)', event, bus.listeners(event).length); - if (!collected[event]) { - collected[event] = true; - bus.on(event, function () { - debug('bus emit: %s', event); - }); - } -}); - -// */ - -// proxy process messages (if forked) to the bus -process.on('message', function (event) { - debug('process.message(%s)', event); - bus.emit(event); -}); - -var emit = bus.emit; - -// if nodemon was spawned via a fork, allow upstream communication -// via process.send -if (process.send) { - bus.emit = function (event, data) { - process.send({ type: event, data: data }); - emit.apply(bus, arguments); - }; -} - -module.exports = bus; diff --git a/node_modules/nodemon/lib/utils/clone.js b/node_modules/nodemon/lib/utils/clone.js deleted file mode 100644 index 6ba6330..0000000 --- a/node_modules/nodemon/lib/utils/clone.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = clone; - -// via http://stackoverflow.com/a/728694/22617 -function clone(obj) { - // Handle the 3 simple types, and null or undefined - if (null === obj || 'object' !== typeof obj) { - return obj; - } - - var copy; - - // Handle Date - if (obj instanceof Date) { - copy = new Date(); - copy.setTime(obj.getTime()); - return copy; - } - - // Handle Array - if (obj instanceof Array) { - copy = []; - for (var i = 0, len = obj.length; i < len; i++) { - copy[i] = clone(obj[i]); - } - return copy; - } - - // Handle Object - if (obj instanceof Object) { - copy = {}; - for (var attr in obj) { - if (obj.hasOwnProperty && obj.hasOwnProperty(attr)) { - copy[attr] = clone(obj[attr]); - } - } - return copy; - } - - throw new Error('Unable to copy obj! Its type isn\'t supported.'); -} \ No newline at end of file diff --git a/node_modules/nodemon/lib/utils/colour.js b/node_modules/nodemon/lib/utils/colour.js deleted file mode 100644 index 8c1b590..0000000 --- a/node_modules/nodemon/lib/utils/colour.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Encodes a string in a colour: red, yellow or green - * @param {String} c colour to highlight in - * @param {String} str the string to encode - * @return {String} coloured string for terminal printing - */ -function colour(c, str) { - return (colour[c] || colour.black) + str + colour.black; -} - -function strip(str) { - re.lastIndex = 0; // reset position - return str.replace(re, ''); -} - -colour.red = '\x1B[31m'; -colour.yellow = '\x1B[33m'; -colour.green = '\x1B[32m'; -colour.black = '\x1B[39m'; - -var reStr = Object.keys(colour).map(key => colour[key]).join('|'); -var re = new RegExp(('(' + reStr + ')').replace(/\[/g, '\\['), 'g'); - -colour.strip = strip; - -module.exports = colour; diff --git a/node_modules/nodemon/lib/utils/index.js b/node_modules/nodemon/lib/utils/index.js deleted file mode 100644 index 9265121..0000000 --- a/node_modules/nodemon/lib/utils/index.js +++ /dev/null @@ -1,103 +0,0 @@ -var noop = function () { }; -var path = require('path'); -const semver = require('semver'); -var version = process.versions.node.split('.') || [null, null, null]; - -var utils = (module.exports = { - semver: semver, - satisfies: test => semver.satisfies(process.versions.node, test), - version: { - major: parseInt(version[0] || 0, 10), - minor: parseInt(version[1] || 0, 10), - patch: parseInt(version[2] || 0, 10), - }, - clone: require('./clone'), - merge: require('./merge'), - bus: require('./bus'), - isWindows: process.platform === 'win32', - isMac: process.platform === 'darwin', - isLinux: process.platform === 'linux', - isIBMi: require('os').type() === 'OS400', - isRequired: (function () { - var p = module.parent; - while (p) { - // in electron.js engine it happens - if (!p.filename) { - return true; - } - if (p.filename.indexOf('bin' + path.sep + 'nodemon.js') !== -1) { - return false; - } - p = p.parent; - } - - return true; - })(), - home: process.env.HOME || process.env.HOMEPATH, - quiet: function () { - // nukes the logging - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - utils.log[method] = noop; - } - } - } - }, - reset: function () { - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - delete utils.log[method]; - } - } - } - this.debug = false; - }, - regexpToText: function (t) { - return t - .replace(/\.\*\\./g, '*.') - .replace(/\\{2}/g, '^^') - .replace(/\\/g, '') - .replace(/\^\^/g, '\\'); - }, - stringify: function (exec, args) { - // serializes an executable string and array of arguments into a string - args = args || []; - - return [exec] - .concat( - args.map(function (arg) { - // if an argument contains a space, we want to show it with quotes - // around it to indicate that it is a single argument - if (arg.length > 0 && arg.indexOf(' ') === -1) { - return arg; - } - // this should correctly escape nested quotes - return JSON.stringify(arg); - }) - ) - .join(' ') - .trim(); - }, -}); - -utils.log = require('./log')(utils.isRequired); - -Object.defineProperty(utils, 'debug', { - set: function (value) { - this.log.debug = value; - }, - get: function () { - return this.log.debug; - }, -}); - -Object.defineProperty(utils, 'colours', { - set: function (value) { - this.log.useColours = value; - }, - get: function () { - return this.log.useColours; - }, -}); diff --git a/node_modules/nodemon/lib/utils/log.js b/node_modules/nodemon/lib/utils/log.js deleted file mode 100644 index 6580087..0000000 --- a/node_modules/nodemon/lib/utils/log.js +++ /dev/null @@ -1,82 +0,0 @@ -var colour = require('./colour'); -var bus = require('./bus'); -var required = false; -var useColours = true; - -var coding = { - log: 'black', - info: 'yellow', - status: 'green', - detail: 'yellow', - fail: 'red', - error: 'red', -}; - -function log(type, text) { - var msg = '[nodemon] ' + (text || ''); - - if (useColours) { - msg = colour(coding[type], msg); - } - - // always push the message through our bus, using nextTick - // to help testing and get _out of_ promises. - process.nextTick(() => { - bus.emit('log', { type: type, message: text, colour: msg }); - }); - - // but if we're running on the command line, also echo out - // question: should we actually just consume our own events? - if (!required) { - if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } - } -} - -var Logger = function (r) { - if (!(this instanceof Logger)) { - return new Logger(r); - } - this.required(r); - return this; -}; - -Object.keys(coding).forEach(function (type) { - Logger.prototype[type] = log.bind(null, type); -}); - -// detail is for messages that are turned on during debug -Logger.prototype.detail = function (msg) { - if (this.debug) { - log('detail', msg); - } -}; - -Logger.prototype.required = function (val) { - required = val; -}; - -Logger.prototype.debug = false; -Logger.prototype._log = function (type, msg) { - if (required) { - bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); - } else if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } -}; - -Object.defineProperty(Logger.prototype, 'useColours', { - set: function (val) { - useColours = val; - }, - get: function () { - return useColours; - }, -}); - -module.exports = Logger; diff --git a/node_modules/nodemon/lib/utils/merge.js b/node_modules/nodemon/lib/utils/merge.js deleted file mode 100644 index 1f3440b..0000000 --- a/node_modules/nodemon/lib/utils/merge.js +++ /dev/null @@ -1,47 +0,0 @@ -var clone = require('./clone'); - -module.exports = merge; - -function typesMatch(a, b) { - return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b)); -} - -/** - * A deep merge of the source based on the target. - * @param {Object} source [description] - * @param {Object} target [description] - * @return {Object} [description] - */ -function merge(source, target, result) { - if (result === undefined) { - result = clone(source); - } - - // merge missing values from the target to the source - Object.getOwnPropertyNames(target).forEach(function (key) { - if (source[key] === undefined) { - result[key] = target[key]; - } - }); - - Object.getOwnPropertyNames(source).forEach(function (key) { - var value = source[key]; - - if (target[key] && typesMatch(value, target[key])) { - // merge empty values - if (value === '') { - result[key] = target[key]; - } - - if (Array.isArray(value)) { - if (value.length === 0 && target[key].length) { - result[key] = target[key].slice(0); - } - } else if (typeof value === 'object') { - result[key] = merge(value, target[key]); - } - } - }); - - return result; -} \ No newline at end of file diff --git a/node_modules/nodemon/lib/version.js b/node_modules/nodemon/lib/version.js deleted file mode 100644 index d0f5104..0000000 --- a/node_modules/nodemon/lib/version.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = version; -module.exports.pin = pin; - -var fs = require('fs'); -var path = require('path'); -var exec = require('child_process').exec; -var root = null; - -function pin() { - return version().then(function (v) { - version.pinned = v; - }); -} - -function version(callback) { - // first find the package.json as this will be our root - var promise = findPackage(path.dirname(module.parent.filename)) - .then(function (dir) { - // now try to load the package - var v = require(path.resolve(dir, 'package.json')).version; - - if (v && v !== '0.0.0-development') { - return v; - } - - root = dir; - - // else we're in development, give the commit out - // get the last commit and whether the working dir is dirty - var promises = [ - branch().catch(function () { return 'master'; }), - commit().catch(function () { return ''; }), - dirty().catch(function () { return 0; }), - ]; - - // use the cached result as the export - return Promise.all(promises).then(function (res) { - var branch = res[0]; - var commit = res[1]; - var dirtyCount = parseInt(res[2], 10); - var curr = branch + ': ' + commit; - if (dirtyCount !== 0) { - curr += ' (' + dirtyCount + ' dirty files)'; - } - - return curr; - }); - }).catch(function (error) { - console.log(error.stack); - throw error; - }); - - if (callback) { - promise.then(function (res) { - callback(null, res); - }, callback); - } - - return promise; -} - -function findPackage(dir) { - if (dir === '/') { - return Promise.reject(new Error('package not found')); - } - return new Promise(function (resolve) { - fs.stat(path.resolve(dir, 'package.json'), function (error, exists) { - if (error || !exists) { - return resolve(findPackage(path.resolve(dir, '..'))); - } - - resolve(dir); - }); - }); -} - -function command(cmd) { - return new Promise(function (resolve, reject) { - exec(cmd, { cwd: root }, function (err, stdout, stderr) { - var error = stderr.trim(); - if (error) { - return reject(new Error(error)); - } - resolve(stdout.split('\n').join('')); - }); - }); -} - -function commit() { - return command('git rev-parse HEAD'); -} - -function branch() { - return command('git rev-parse --abbrev-ref HEAD'); -} - -function dirty() { - return command('expr $(git status --porcelain 2>/dev/null| ' + - 'egrep "^(M| M)" | wc -l)'); -} diff --git a/node_modules/nodemon/package.json b/node_modules/nodemon/package.json deleted file mode 100644 index bcf34c0..0000000 --- a/node_modules/nodemon/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "nodemon", - "homepage": "https://nodemon.io", - "author": { - "name": "Remy Sharp", - "url": "https://github.com/remy" - }, - "bin": { - "nodemon": "./bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "repository": { - "type": "git", - "url": "https://github.com/remy/nodemon.git" - }, - "description": "Simple monitor script for use during development of a Node.js app.", - "keywords": [ - "cli", - "monitor", - "monitor", - "development", - "restart", - "autoload", - "reload", - "terminal" - ], - "license": "MIT", - "types": "./index.d.ts", - "main": "./lib/nodemon", - "scripts": { - "commitmsg": "commitlint -e", - "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", - "lint": "eslint lib/**/*.js", - "test": "npm run lint && npm run spec", - "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", - "postspec": "npm run clean", - "clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md", - "web": "node web", - "semantic-release": "semantic-release", - "prepush": "npm run lint", - "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9" - }, - "devDependencies": { - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "async": "1.4.2", - "coffee-script": "~1.7.1", - "eslint": "^7.32.0", - "husky": "^7.0.4", - "mocha": "^2.5.3", - "nyc": "^15.1.0", - "proxyquire": "^1.8.0", - "semantic-release": "^18.0.0", - "should": "~4.0.0" - }, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "version": "3.1.9", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } -} diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js deleted file mode 100644 index 6fac553..0000000 --- a/node_modules/normalize-path/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * normalize-path - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * Released under the MIT License. - */ - -module.exports = function(path, stripTrailing) { - if (typeof path !== 'string') { - throw new TypeError('expected path to be a string'); - } - - if (path === '\\' || path === '/') return '/'; - - var len = path.length; - if (len <= 1) return path; - - // ensure that win32 namespaces has two leading slashes, so that the path is - // handled properly by the win32 version of path.parse() after being normalized - // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces - var prefix = ''; - if (len > 4 && path[3] === '\\') { - var ch = path[2]; - if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { - path = path.slice(2); - prefix = '//'; - } - } - - var segs = path.split(/[/\\]+/); - if (stripTrailing !== false && segs[segs.length - 1] === '') { - segs.pop(); - } - return prefix + segs.join('/'); -}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json deleted file mode 100644 index ad61098..0000000 --- a/node_modules/normalize-path/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "normalize-path", - "description": "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.", - "version": "3.0.0", - "homepage": "https://github.com/jonschlinkert/normalize-path", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Blaine Bublitz (https://twitter.com/BlaineBublitz)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "jonschlinkert/normalize-path", - "bugs": { - "url": "https://github.com/jonschlinkert/normalize-path/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^1.0.0", - "minimist": "^1.2.0", - "mocha": "^3.5.3" - }, - "keywords": [ - "absolute", - "backslash", - "delimiter", - "file", - "file-path", - "filepath", - "fix", - "forward", - "fp", - "fs", - "normalize", - "path", - "relative", - "separator", - "slash", - "slashes", - "trailing", - "unix", - "urix" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "description": "Other useful path-related libraries:", - "list": [ - "contains-path", - "is-absolute", - "is-relative", - "parse-filepath", - "path-ends-with", - "path-ends-with", - "unixify" - ] - }, - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/nth-check/lib/compile.d.ts b/node_modules/nth-check/lib/compile.d.ts deleted file mode 100644 index 63e9be5..0000000 --- a/node_modules/nth-check/lib/compile.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Returns a function that checks if an elements index matches the given rule - * highly optimized to return the fastest solution. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A highly optimized function that returns whether an index matches the nth-check. - * @example - * - * ```js - * const check = nthCheck.compile([2, 3]); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - * ``` - */ -export declare function compile(parsed: [a: number, b: number]): (index: number) => boolean; -/** - * Returns a function that produces a monotonously increasing sequence of indices. - * - * If the sequence has an end, the returned function will return `null` after - * the last index in the sequence. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A function that produces a sequence of indices. - * @example Always increasing (2n+3) - * - * ```js - * const gen = nthCheck.generate([2, 3]) - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value (-2n+10) - * - * ```js - * - * const gen = nthCheck.generate([-2, 5]); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export declare function generate(parsed: [a: number, b: number]): () => number | null; -//# sourceMappingURL=compile.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/compile.d.ts.map b/node_modules/nth-check/lib/compile.d.ts.map deleted file mode 100644 index bb64f76..0000000 --- a/node_modules/nth-check/lib/compile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compile.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CACnB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAgC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,MAAM,GAAG,IAAI,CA+B5E"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/compile.js b/node_modules/nth-check/lib/compile.js deleted file mode 100644 index cef1af4..0000000 --- a/node_modules/nth-check/lib/compile.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generate = exports.compile = void 0; -var boolbase_1 = __importDefault(require("boolbase")); -/** - * Returns a function that checks if an elements index matches the given rule - * highly optimized to return the fastest solution. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A highly optimized function that returns whether an index matches the nth-check. - * @example - * - * ```js - * const check = nthCheck.compile([2, 3]); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - * ``` - */ -function compile(parsed) { - var a = parsed[0]; - // Subtract 1 from `b`, to convert from one- to zero-indexed. - var b = parsed[1] - 1; - /* - * When `b <= 0`, `a * n` won't be lead to any matches for `a < 0`. - * Besides, the specification states that no elements are - * matched when `a` and `b` are 0. - * - * `b < 0` here as we subtracted 1 from `b` above. - */ - if (b < 0 && a <= 0) - return boolbase_1.default.falseFunc; - // When `a` is in the range -1..1, it matches any element (so only `b` is checked). - if (a === -1) - return function (index) { return index <= b; }; - if (a === 0) - return function (index) { return index === b; }; - // When `b <= 0` and `a === 1`, they match any element. - if (a === 1) - return b < 0 ? boolbase_1.default.trueFunc : function (index) { return index >= b; }; - /* - * Otherwise, modulo can be used to check if there is a match. - * - * Modulo doesn't care about the sign, so let's use `a`s absolute value. - */ - var absA = Math.abs(a); - // Get `b mod a`, + a if this is negative. - var bMod = ((b % absA) + absA) % absA; - return a > 1 - ? function (index) { return index >= b && index % absA === bMod; } - : function (index) { return index <= b && index % absA === bMod; }; -} -exports.compile = compile; -/** - * Returns a function that produces a monotonously increasing sequence of indices. - * - * If the sequence has an end, the returned function will return `null` after - * the last index in the sequence. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A function that produces a sequence of indices. - * @example Always increasing (2n+3) - * - * ```js - * const gen = nthCheck.generate([2, 3]) - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value (-2n+10) - * - * ```js - * - * const gen = nthCheck.generate([-2, 5]); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -function generate(parsed) { - var a = parsed[0]; - // Subtract 1 from `b`, to convert from one- to zero-indexed. - var b = parsed[1] - 1; - var n = 0; - // Make sure to always return an increasing sequence - if (a < 0) { - var aPos_1 = -a; - // Get `b mod a` - var minValue_1 = ((b % aPos_1) + aPos_1) % aPos_1; - return function () { - var val = minValue_1 + aPos_1 * n++; - return val > b ? null : val; - }; - } - if (a === 0) - return b < 0 - ? // There are no result — always return `null` - function () { return null; } - : // Return `b` exactly once - function () { return (n++ === 0 ? b : null); }; - if (b < 0) { - b += a * Math.ceil(-b / a); - } - return function () { return a * n++ + b; }; -} -exports.generate = generate; -//# sourceMappingURL=compile.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/compile.js.map b/node_modules/nth-check/lib/compile.js.map deleted file mode 100644 index 06ec5b9..0000000 --- a/node_modules/nth-check/lib/compile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compile.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAgC;AAEhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,OAAO,CACnB,MAA8B;IAE9B,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,6DAA6D;IAC7D,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExB;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,kBAAQ,CAAC,SAAS,CAAC;IAE/C,mFAAmF;IACnF,IAAI,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,UAAC,KAAK,IAAK,OAAA,KAAK,IAAI,CAAC,EAAV,CAAU,CAAC;IAC3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C,OAAO;YACH,IAAM,GAAG,GAAG,UAAQ,GAAG,MAAI,GAAG,CAAC,EAAE,CAAC;YAElC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC;KACL;IAED,IAAI,CAAC,KAAK,CAAC;QACP,OAAO,CAAC,GAAG,CAAC;YACR,CAAC,CAAC,6CAA6C;gBAC7C,cAAM,OAAA,IAAI,EAAJ,CAAI;YACZ,CAAC,CAAC,0BAA0B;gBAC1B,cAAM,OAAA,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAtB,CAAsB,CAAC;IAEvC,IAAI,CAAC,GAAG,CAAC,EAAE;QACP,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KAC9B;IAED,OAAO,cAAM,OAAA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAX,CAAW,CAAC;AAC7B,CAAC;AA/BD,4BA+BC"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/compile.d.ts b/node_modules/nth-check/lib/esm/compile.d.ts deleted file mode 100644 index 63e9be5..0000000 --- a/node_modules/nth-check/lib/esm/compile.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Returns a function that checks if an elements index matches the given rule - * highly optimized to return the fastest solution. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A highly optimized function that returns whether an index matches the nth-check. - * @example - * - * ```js - * const check = nthCheck.compile([2, 3]); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - * ``` - */ -export declare function compile(parsed: [a: number, b: number]): (index: number) => boolean; -/** - * Returns a function that produces a monotonously increasing sequence of indices. - * - * If the sequence has an end, the returned function will return `null` after - * the last index in the sequence. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A function that produces a sequence of indices. - * @example Always increasing (2n+3) - * - * ```js - * const gen = nthCheck.generate([2, 3]) - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value (-2n+10) - * - * ```js - * - * const gen = nthCheck.generate([-2, 5]); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export declare function generate(parsed: [a: number, b: number]): () => number | null; -//# sourceMappingURL=compile.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/compile.d.ts.map b/node_modules/nth-check/lib/esm/compile.d.ts.map deleted file mode 100644 index bb64f76..0000000 --- a/node_modules/nth-check/lib/esm/compile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compile.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CACnB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAgC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,MAAM,GAAG,IAAI,CA+B5E"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/compile.js b/node_modules/nth-check/lib/esm/compile.js deleted file mode 100644 index 317d378..0000000 --- a/node_modules/nth-check/lib/esm/compile.js +++ /dev/null @@ -1,113 +0,0 @@ -import boolbase from "boolbase"; -/** - * Returns a function that checks if an elements index matches the given rule - * highly optimized to return the fastest solution. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A highly optimized function that returns whether an index matches the nth-check. - * @example - * - * ```js - * const check = nthCheck.compile([2, 3]); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - * ``` - */ -export function compile(parsed) { - const a = parsed[0]; - // Subtract 1 from `b`, to convert from one- to zero-indexed. - const b = parsed[1] - 1; - /* - * When `b <= 0`, `a * n` won't be lead to any matches for `a < 0`. - * Besides, the specification states that no elements are - * matched when `a` and `b` are 0. - * - * `b < 0` here as we subtracted 1 from `b` above. - */ - if (b < 0 && a <= 0) - return boolbase.falseFunc; - // When `a` is in the range -1..1, it matches any element (so only `b` is checked). - if (a === -1) - return (index) => index <= b; - if (a === 0) - return (index) => index === b; - // When `b <= 0` and `a === 1`, they match any element. - if (a === 1) - return b < 0 ? boolbase.trueFunc : (index) => index >= b; - /* - * Otherwise, modulo can be used to check if there is a match. - * - * Modulo doesn't care about the sign, so let's use `a`s absolute value. - */ - const absA = Math.abs(a); - // Get `b mod a`, + a if this is negative. - const bMod = ((b % absA) + absA) % absA; - return a > 1 - ? (index) => index >= b && index % absA === bMod - : (index) => index <= b && index % absA === bMod; -} -/** - * Returns a function that produces a monotonously increasing sequence of indices. - * - * If the sequence has an end, the returned function will return `null` after - * the last index in the sequence. - * - * @param parsed A tuple [a, b], as returned by `parse`. - * @returns A function that produces a sequence of indices. - * @example Always increasing (2n+3) - * - * ```js - * const gen = nthCheck.generate([2, 3]) - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value (-2n+10) - * - * ```js - * - * const gen = nthCheck.generate([-2, 5]); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export function generate(parsed) { - const a = parsed[0]; - // Subtract 1 from `b`, to convert from one- to zero-indexed. - let b = parsed[1] - 1; - let n = 0; - // Make sure to always return an increasing sequence - if (a < 0) { - const aPos = -a; - // Get `b mod a` - const minValue = ((b % aPos) + aPos) % aPos; - return () => { - const val = minValue + aPos * n++; - return val > b ? null : val; - }; - } - if (a === 0) - return b < 0 - ? // There are no result — always return `null` - () => null - : // Return `b` exactly once - () => (n++ === 0 ? b : null); - if (b < 0) { - b += a * Math.ceil(-b / a); - } - return () => a * n++ + b; -} -//# sourceMappingURL=compile.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/compile.js.map b/node_modules/nth-check/lib/esm/compile.js.map deleted file mode 100644 index 8eccbba..0000000 --- a/node_modules/nth-check/lib/esm/compile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compile.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,OAAO,CACnB,MAA8B;IAE9B,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,6DAA6D;IAC7D,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExB;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC,SAAS,CAAC;IAE/C,mFAAmF;IACnF,IAAI,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;IAC3C,uDAAuD;IACvD,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC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,CAAC,CAAC,0BAA0B;gBAC1B,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,CAAC,GAAG,CAAC,EAAE;QACP,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KAC9B;IAED,OAAO,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/index.d.ts b/node_modules/nth-check/lib/esm/index.d.ts deleted file mode 100644 index 2cddd39..0000000 --- a/node_modules/nth-check/lib/esm/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { parse } from "./parse.js"; -import { compile, generate } from "./compile.js"; -export { parse, compile, generate }; -/** - * Parses and compiles a formula to a highly optimized function. - * Combination of {@link parse} and {@link compile}. - * - * If the formula doesn't match any elements, - * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`. - * Otherwise, a function accepting an _index_ is returned, which returns - * whether or not the passed _index_ matches the formula. - * - * Note: The nth-rule starts counting at `1`, the returned function at `0`. - * - * @param formula The formula to compile. - * @example - * const check = nthCheck("2n+3"); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - */ -export default function nthCheck(formula: string): (index: number) => boolean; -/** - * Parses and compiles a formula to a generator that produces a sequence of indices. - * Combination of {@link parse} and {@link generate}. - * - * @param formula The formula to compile. - * @returns A function that produces a sequence of indices. - * @example Always increasing - * - * ```js - * const gen = nthCheck.sequence('2n+3') - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value - * - * ```js - * - * const gen = nthCheck.sequence('-2n+5'); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export declare function sequence(formula: string): () => number | null; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/index.d.ts.map b/node_modules/nth-check/lib/esm/index.d.ts.map deleted file mode 100644 index 17f9cdb..0000000 --- a/node_modules/nth-check/lib/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,CAE7D"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/index.js b/node_modules/nth-check/lib/esm/index.js deleted file mode 100644 index ae0a6f8..0000000 --- a/node_modules/nth-check/lib/esm/index.js +++ /dev/null @@ -1,63 +0,0 @@ -import { parse } from "./parse.js"; -import { compile, generate } from "./compile.js"; -export { parse, compile, generate }; -/** - * Parses and compiles a formula to a highly optimized function. - * Combination of {@link parse} and {@link compile}. - * - * If the formula doesn't match any elements, - * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`. - * Otherwise, a function accepting an _index_ is returned, which returns - * whether or not the passed _index_ matches the formula. - * - * Note: The nth-rule starts counting at `1`, the returned function at `0`. - * - * @param formula The formula to compile. - * @example - * const check = nthCheck("2n+3"); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - */ -export default function nthCheck(formula) { - return compile(parse(formula)); -} -/** - * Parses and compiles a formula to a generator that produces a sequence of indices. - * Combination of {@link parse} and {@link generate}. - * - * @param formula The formula to compile. - * @returns A function that produces a sequence of indices. - * @example Always increasing - * - * ```js - * const gen = nthCheck.sequence('2n+3') - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value - * - * ```js - * - * const gen = nthCheck.sequence('-2n+5'); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export function sequence(formula) { - return generate(parse(formula)); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/index.js.map b/node_modules/nth-check/lib/esm/index.js.map deleted file mode 100644 index f0b6906..0000000 --- a/node_modules/nth-check/lib/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAe;IAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe;IACpC,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/package.json b/node_modules/nth-check/lib/esm/package.json deleted file mode 100644 index 089153b..0000000 --- a/node_modules/nth-check/lib/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} diff --git a/node_modules/nth-check/lib/esm/parse.d.ts b/node_modules/nth-check/lib/esm/parse.d.ts deleted file mode 100644 index b4f817b..0000000 --- a/node_modules/nth-check/lib/esm/parse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Parses an expression. - * - * @throws An `Error` if parsing fails. - * @returns An array containing the integer step size and the integer offset of the nth rule. - * @example nthCheck.parse("2n+3"); // returns [2, 3] - */ -export declare function parse(formula: string): [a: number, b: number]; -//# sourceMappingURL=parse.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/parse.d.ts.map b/node_modules/nth-check/lib/esm/parse.d.ts.map deleted file mode 100644 index 8cd4788..0000000 --- a/node_modules/nth-check/lib/esm/parse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CA6E7D"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/parse.js b/node_modules/nth-check/lib/esm/parse.js deleted file mode 100644 index 96d1d48..0000000 --- a/node_modules/nth-check/lib/esm/parse.js +++ /dev/null @@ -1,73 +0,0 @@ -// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo -// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f" -const whitespace = new Set([9, 10, 12, 13, 32]); -const ZERO = "0".charCodeAt(0); -const NINE = "9".charCodeAt(0); -/** - * Parses an expression. - * - * @throws An `Error` if parsing fails. - * @returns An array containing the integer step size and the integer offset of the nth rule. - * @example nthCheck.parse("2n+3"); // returns [2, 3] - */ -export function parse(formula) { - formula = formula.trim().toLowerCase(); - if (formula === "even") { - return [2, 0]; - } - else if (formula === "odd") { - return [2, 1]; - } - // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? - let idx = 0; - let a = 0; - let sign = readSign(); - let number = readNumber(); - if (idx < formula.length && formula.charAt(idx) === "n") { - idx++; - a = sign * (number !== null && number !== void 0 ? number : 1); - skipWhitespace(); - if (idx < formula.length) { - sign = readSign(); - skipWhitespace(); - number = readNumber(); - } - else { - sign = number = 0; - } - } - // Throw if there is anything else - if (number === null || idx < formula.length) { - throw new Error(`n-th rule couldn't be parsed ('${formula}')`); - } - return [a, sign * number]; - function readSign() { - if (formula.charAt(idx) === "-") { - idx++; - return -1; - } - if (formula.charAt(idx) === "+") { - idx++; - } - return 1; - } - function readNumber() { - const start = idx; - let value = 0; - while (idx < formula.length && - formula.charCodeAt(idx) >= ZERO && - formula.charCodeAt(idx) <= NINE) { - value = value * 10 + (formula.charCodeAt(idx) - ZERO); - idx++; - } - // Return `null` if we didn't read anything. - return idx === start ? null : value; - } - function skipWhitespace() { - while (idx < formula.length && - whitespace.has(formula.charCodeAt(idx))) { - idx++; - } - } -} -//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/esm/parse.js.map b/node_modules/nth-check/lib/esm/parse.js.map deleted file mode 100644 index 33b6e33..0000000 --- a/node_modules/nth-check/lib/esm/parse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,0EAA0E;AAC1E,MAAM,UAAU,GAAG,IAAI,GAAG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;QACzC,MAAM,IAAI,KAAK,CAAC,kCAAkC,OAAO,IAAI,CAAC,CAAC;KAClE;IAED,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;IAE1B,SAAS,QAAQ;QACb,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YAC7B,GAAG,EAAE,CAAC;YACN,OAAO,CAAC,CAAC,CAAC;SACb;QAED,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YAC7B,GAAG,EAAE,CAAC;SACT;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,SAAS,UAAU;QACf,MAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI;YAC/B,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,EACjC;YACE,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YACtD,GAAG,EAAE,CAAC;SACT;QAED,4CAA4C;QAC5C,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACxC,CAAC;IAED,SAAS,cAAc;QACnB,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACzC;YACE,GAAG,EAAE,CAAC;SACT;IACL,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/index.d.ts b/node_modules/nth-check/lib/index.d.ts deleted file mode 100644 index 2cddd39..0000000 --- a/node_modules/nth-check/lib/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { parse } from "./parse.js"; -import { compile, generate } from "./compile.js"; -export { parse, compile, generate }; -/** - * Parses and compiles a formula to a highly optimized function. - * Combination of {@link parse} and {@link compile}. - * - * If the formula doesn't match any elements, - * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`. - * Otherwise, a function accepting an _index_ is returned, which returns - * whether or not the passed _index_ matches the formula. - * - * Note: The nth-rule starts counting at `1`, the returned function at `0`. - * - * @param formula The formula to compile. - * @example - * const check = nthCheck("2n+3"); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - */ -export default function nthCheck(formula: string): (index: number) => boolean; -/** - * Parses and compiles a formula to a generator that produces a sequence of indices. - * Combination of {@link parse} and {@link generate}. - * - * @param formula The formula to compile. - * @returns A function that produces a sequence of indices. - * @example Always increasing - * - * ```js - * const gen = nthCheck.sequence('2n+3') - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value - * - * ```js - * - * const gen = nthCheck.sequence('-2n+5'); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -export declare function sequence(formula: string): () => number | null; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/index.d.ts.map b/node_modules/nth-check/lib/index.d.ts.map deleted file mode 100644 index 17f9cdb..0000000 --- a/node_modules/nth-check/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,CAE7D"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/index.js b/node_modules/nth-check/lib/index.js deleted file mode 100644 index 30a7e29..0000000 --- a/node_modules/nth-check/lib/index.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sequence = exports.generate = exports.compile = exports.parse = void 0; -var parse_js_1 = require("./parse.js"); -Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.parse; } }); -var compile_js_1 = require("./compile.js"); -Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compile_js_1.compile; } }); -Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return compile_js_1.generate; } }); -/** - * Parses and compiles a formula to a highly optimized function. - * Combination of {@link parse} and {@link compile}. - * - * If the formula doesn't match any elements, - * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`. - * Otherwise, a function accepting an _index_ is returned, which returns - * whether or not the passed _index_ matches the formula. - * - * Note: The nth-rule starts counting at `1`, the returned function at `0`. - * - * @param formula The formula to compile. - * @example - * const check = nthCheck("2n+3"); - * - * check(0); // `false` - * check(1); // `false` - * check(2); // `true` - * check(3); // `false` - * check(4); // `true` - * check(5); // `false` - * check(6); // `true` - */ -function nthCheck(formula) { - return (0, compile_js_1.compile)((0, parse_js_1.parse)(formula)); -} -exports.default = nthCheck; -/** - * Parses and compiles a formula to a generator that produces a sequence of indices. - * Combination of {@link parse} and {@link generate}. - * - * @param formula The formula to compile. - * @returns A function that produces a sequence of indices. - * @example Always increasing - * - * ```js - * const gen = nthCheck.sequence('2n+3') - * - * gen() // `1` - * gen() // `3` - * gen() // `5` - * gen() // `8` - * gen() // `11` - * ``` - * - * @example With end value - * - * ```js - * - * const gen = nthCheck.sequence('-2n+5'); - * - * gen() // 0 - * gen() // 2 - * gen() // 4 - * gen() // null - * ``` - */ -function sequence(formula) { - return (0, compile_js_1.generate)((0, parse_js_1.parse)(formula)); -} -exports.sequence = sequence; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/index.js.map b/node_modules/nth-check/lib/index.js.map deleted file mode 100644 index 78a1bc5..0000000 --- a/node_modules/nth-check/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAG1B,sFAHA,gBAAK,OAGA;AAFd,2CAAiD;AAEjC,wFAFP,oBAAO,OAEO;AAAE,yFAFP,qBAAQ,OAEO;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAwB,QAAQ,CAAC,OAAe;IAC5C,OAAO,IAAA,oBAAO,EAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC;AAFD,2BAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,QAAQ,CAAC,OAAe;IACpC,OAAO,IAAA,qBAAQ,EAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACpC,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/parse.d.ts b/node_modules/nth-check/lib/parse.d.ts deleted file mode 100644 index b4f817b..0000000 --- a/node_modules/nth-check/lib/parse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Parses an expression. - * - * @throws An `Error` if parsing fails. - * @returns An array containing the integer step size and the integer offset of the nth rule. - * @example nthCheck.parse("2n+3"); // returns [2, 3] - */ -export declare function parse(formula: string): [a: number, b: number]; -//# sourceMappingURL=parse.d.ts.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/parse.d.ts.map b/node_modules/nth-check/lib/parse.d.ts.map deleted file mode 100644 index 8cd4788..0000000 --- a/node_modules/nth-check/lib/parse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CA6E7D"} \ No newline at end of file diff --git a/node_modules/nth-check/lib/parse.js b/node_modules/nth-check/lib/parse.js deleted file mode 100644 index 904244c..0000000 --- a/node_modules/nth-check/lib/parse.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parse = void 0; -// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f" -var whitespace = new Set([9, 10, 12, 13, 32]); -var ZERO = "0".charCodeAt(0); -var NINE = "9".charCodeAt(0); -/** - * Parses an expression. - * - * @throws An `Error` if parsing fails. - * @returns An array containing the integer step size and the integer offset of the nth rule. - * @example nthCheck.parse("2n+3"); // returns [2, 3] - */ -function parse(formula) { - formula = formula.trim().toLowerCase(); - if (formula === "even") { - return [2, 0]; - } - else if (formula === "odd") { - return [2, 1]; - } - // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? - var idx = 0; - var a = 0; - var sign = readSign(); - var number = readNumber(); - if (idx < formula.length && formula.charAt(idx) === "n") { - idx++; - a = sign * (number !== null && number !== void 0 ? number : 1); - skipWhitespace(); - if (idx < formula.length) { - sign = readSign(); - skipWhitespace(); - number = readNumber(); - } - else { - sign = number = 0; - } - } - // Throw if there is anything else - if (number === null || idx < formula.length) { - throw new Error("n-th rule couldn't be parsed ('".concat(formula, "')")); - } - return [a, sign * number]; - function readSign() { - if (formula.charAt(idx) === "-") { - idx++; - return -1; - } - if (formula.charAt(idx) === "+") { - idx++; - } - return 1; - } - function readNumber() { - var start = idx; - var value = 0; - while (idx < formula.length && - formula.charCodeAt(idx) >= ZERO && - formula.charCodeAt(idx) <= NINE) { - value = value * 10 + (formula.charCodeAt(idx) - ZERO); - idx++; - } - // Return `null` if we didn't read anything. - return idx === start ? null : value; - } - function skipWhitespace() { - while (idx < formula.length && - whitespace.has(formula.charCodeAt(idx))) { - idx++; - } - } -} -exports.parse = parse; -//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/node_modules/nth-check/lib/parse.js.map b/node_modules/nth-check/lib/parse.js.map deleted file mode 100644 index c326b3d..0000000 --- a/node_modules/nth-check/lib/parse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts"],"names":[],"mappings":";AAAA,kEAAkE;;;AAElE,0EAA0E;AAC1E,IAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAChD,IAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC/B,IAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAE/B;;;;;;GAMG;AACH,SAAgB,KAAK,CAAC,OAAe;IACjC,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEvC,IAAI,OAAO,KAAK,MAAM,EAAE;QACpB,OAAO,CAAC,CAAC,EAAE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,SAAS,UAAU;QACf,IAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI;YAC/B,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,EACjC;YACE,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YACtD,GAAG,EAAE,CAAC;SACT;QAED,4CAA4C;QAC5C,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACxC,CAAC;IAED,SAAS,cAAc;QACnB,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACzC;YACE,GAAG,EAAE,CAAC;SACT;IACL,CAAC;AACL,CAAC;AA7ED,sBA6EC"} \ No newline at end of file diff --git a/node_modules/nth-check/package.json b/node_modules/nth-check/package.json deleted file mode 100644 index 45ebe83..0000000 --- a/node_modules/nth-check/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "nth-check", - "version": "2.1.1", - "description": "Parses and compiles CSS nth-checks to highly optimized functions.", - "author": "Felix Boehm ", - "license": "BSD-2-Clause", - "sideEffects": false, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - }, - "directories": { - "lib": "lib/" - }, - "main": "lib/index.js", - "types": "lib/index.d.ts", - "module": "lib/esm/index.js", - "exports": { - "require": "./lib/index.js", - "import": "./lib/esm/index.js" - }, - "files": [ - "lib/**/*" - ], - "scripts": { - "test": "npm run test:jest && npm run lint", - "test:jest": "jest", - "lint": "npm run lint:es && npm run lint:prettier", - "lint:es": "eslint .", - "lint:prettier": "npm run prettier -- --check", - "format": "npm run format:es && npm run format:prettier", - "format:es": "npm run lint:es -- --fix", - "format:prettier": "npm run prettier -- --write", - "prettier": "prettier '**/*.{ts,md,json,yml}'", - "build": "npm run build:cjs && npm run build:esm", - "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/nth-check/$(git rev-parse HEAD)/src/", - "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json", - "prepare": "npm run build" - }, - "repository": { - "type": "git", - "url": "https://github.com/fb55/nth-check" - }, - "keywords": [ - "nth-child", - "nth", - "css" - ], - "bugs": { - "url": "https://github.com/fb55/nth-check/issues" - }, - "homepage": "https://github.com/fb55/nth-check", - "dependencies": { - "boolbase": "^1.0.0" - }, - "devDependencies": { - "@types/boolbase": "^1.0.1", - "@types/jest": "^27.5.0", - "@types/node": "^17.0.35", - "@typescript-eslint/eslint-plugin": "^5.25.0", - "@typescript-eslint/parser": "^5.25.0", - "eslint": "^8.15.0", - "eslint-config-prettier": "^8.5.0", - "jest": "^27.5.1", - "prettier": "^2.6.2", - "ts-jest": "^27.1.4", - "typescript": "^4.6.4" - }, - "jest": { - "preset": "ts-jest", - "testEnvironment": "node", - "moduleNameMapper": { - "^(.*)\\.js$": "$1" - } - }, - "prettier": { - "tabWidth": 4 - } -} diff --git a/node_modules/once/once.js b/node_modules/once/once.js deleted file mode 100644 index 2354067..0000000 --- a/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/node_modules/once/package.json b/node_modules/once/package.json deleted file mode 100644 index 16815b2..0000000 --- a/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.0.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts b/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts deleted file mode 100644 index 47e1f66..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type TreeAdapterTypeMap, type TreeAdapter } from 'parse5'; -import { type AnyNode, type ParentNode, type ChildNode, Element, Document, ProcessingInstruction, Comment, Text } from 'domhandler'; -export type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap; -/** @internal */ -export declare function serializeDoctypeContent(name: string, publicId: string, systemId: string): string; -export declare const adapter: TreeAdapter; diff --git a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js b/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js deleted file mode 100644 index 386066b..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js +++ /dev/null @@ -1,214 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.adapter = void 0; -exports.serializeDoctypeContent = serializeDoctypeContent; -const parse5_1 = require("parse5"); -const domhandler_1 = require("domhandler"); -function enquoteDoctypeId(id) { - const quote = id.includes('"') ? "'" : '"'; - return quote + id + quote; -} -/** @internal */ -function serializeDoctypeContent(name, publicId, systemId) { - let str = '!DOCTYPE '; - if (name) { - str += name; - } - if (publicId) { - str += ` PUBLIC ${enquoteDoctypeId(publicId)}`; - } - else if (systemId) { - str += ' SYSTEM'; - } - if (systemId) { - str += ` ${enquoteDoctypeId(systemId)}`; - } - return str; -} -exports.adapter = { - // Re-exports from domhandler - isCommentNode: domhandler_1.isComment, - isElementNode: domhandler_1.isTag, - isTextNode: domhandler_1.isText, - //Node construction - createDocument() { - const node = new domhandler_1.Document([]); - node['x-mode'] = parse5_1.html.DOCUMENT_MODE.NO_QUIRKS; - return node; - }, - createDocumentFragment() { - return new domhandler_1.Document([]); - }, - createElement(tagName, namespaceURI, attrs) { - const attribs = Object.create(null); - const attribsNamespace = Object.create(null); - const attribsPrefix = Object.create(null); - for (let i = 0; i < attrs.length; i++) { - const attrName = attrs[i].name; - attribs[attrName] = attrs[i].value; - attribsNamespace[attrName] = attrs[i].namespace; - attribsPrefix[attrName] = attrs[i].prefix; - } - const node = new domhandler_1.Element(tagName, attribs, []); - node.namespace = namespaceURI; - node['x-attribsNamespace'] = attribsNamespace; - node['x-attribsPrefix'] = attribsPrefix; - return node; - }, - createCommentNode(data) { - return new domhandler_1.Comment(data); - }, - createTextNode(value) { - return new domhandler_1.Text(value); - }, - //Tree mutation - appendChild(parentNode, newNode) { - const prev = parentNode.children[parentNode.children.length - 1]; - if (prev) { - prev.next = newNode; - newNode.prev = prev; - } - parentNode.children.push(newNode); - newNode.parent = parentNode; - }, - insertBefore(parentNode, newNode, referenceNode) { - const insertionIdx = parentNode.children.indexOf(referenceNode); - const { prev } = referenceNode; - if (prev) { - prev.next = newNode; - newNode.prev = prev; - } - referenceNode.prev = newNode; - newNode.next = referenceNode; - parentNode.children.splice(insertionIdx, 0, newNode); - newNode.parent = parentNode; - }, - setTemplateContent(templateElement, contentElement) { - exports.adapter.appendChild(templateElement, contentElement); - }, - getTemplateContent(templateElement) { - return templateElement.children[0]; - }, - setDocumentType(document, name, publicId, systemId) { - const data = serializeDoctypeContent(name, publicId, systemId); - let doctypeNode = document.children.find((node) => (0, domhandler_1.isDirective)(node) && node.name === '!doctype'); - if (doctypeNode) { - doctypeNode.data = data !== null && data !== void 0 ? data : null; - } - else { - doctypeNode = new domhandler_1.ProcessingInstruction('!doctype', data); - exports.adapter.appendChild(document, doctypeNode); - } - doctypeNode['x-name'] = name; - doctypeNode['x-publicId'] = publicId; - doctypeNode['x-systemId'] = systemId; - }, - setDocumentMode(document, mode) { - document['x-mode'] = mode; - }, - getDocumentMode(document) { - return document['x-mode']; - }, - detachNode(node) { - if (node.parent) { - const idx = node.parent.children.indexOf(node); - const { prev, next } = node; - node.prev = null; - node.next = null; - if (prev) { - prev.next = next; - } - if (next) { - next.prev = prev; - } - node.parent.children.splice(idx, 1); - node.parent = null; - } - }, - insertText(parentNode, text) { - const lastChild = parentNode.children[parentNode.children.length - 1]; - if (lastChild && (0, domhandler_1.isText)(lastChild)) { - lastChild.data += text; - } - else { - exports.adapter.appendChild(parentNode, exports.adapter.createTextNode(text)); - } - }, - insertTextBefore(parentNode, text, referenceNode) { - const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; - if (prevNode && (0, domhandler_1.isText)(prevNode)) { - prevNode.data += text; - } - else { - exports.adapter.insertBefore(parentNode, exports.adapter.createTextNode(text), referenceNode); - } - }, - adoptAttributes(recipient, attrs) { - for (let i = 0; i < attrs.length; i++) { - const attrName = attrs[i].name; - if (recipient.attribs[attrName] === undefined) { - recipient.attribs[attrName] = attrs[i].value; - recipient['x-attribsNamespace'][attrName] = attrs[i].namespace; - recipient['x-attribsPrefix'][attrName] = attrs[i].prefix; - } - } - }, - //Tree traversing - getFirstChild(node) { - return node.children[0]; - }, - getChildNodes(node) { - return node.children; - }, - getParentNode(node) { - return node.parent; - }, - getAttrList(element) { - return element.attributes; - }, - //Node data - getTagName(element) { - return element.name; - }, - getNamespaceURI(element) { - return element.namespace; - }, - getTextNodeContent(textNode) { - return textNode.data; - }, - getCommentNodeContent(commentNode) { - return commentNode.data; - }, - getDocumentTypeNodeName(doctypeNode) { - var _a; - return (_a = doctypeNode['x-name']) !== null && _a !== void 0 ? _a : ''; - }, - getDocumentTypeNodePublicId(doctypeNode) { - var _a; - return (_a = doctypeNode['x-publicId']) !== null && _a !== void 0 ? _a : ''; - }, - getDocumentTypeNodeSystemId(doctypeNode) { - var _a; - return (_a = doctypeNode['x-systemId']) !== null && _a !== void 0 ? _a : ''; - }, - //Node types - isDocumentTypeNode(node) { - return (0, domhandler_1.isDirective)(node) && node.name === '!doctype'; - }, - // Source code location - setNodeSourceCodeLocation(node, location) { - if (location) { - node.startIndex = location.startOffset; - node.endIndex = location.endOffset; - } - node.sourceCodeLocation = location; - }, - getNodeSourceCodeLocation(node) { - return node.sourceCodeLocation; - }, - updateNodeSourceCodeLocation(node, endLocation) { - if (endLocation.endOffset != null) - node.endIndex = endLocation.endOffset; - node.sourceCodeLocation = Object.assign(Object.assign({}, node.sourceCodeLocation), endLocation); - }, -}; diff --git a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/package.json b/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/package.json deleted file mode 100644 index 729ac4d..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"commonjs"} diff --git a/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts b/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts deleted file mode 100644 index 47e1f66..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type TreeAdapterTypeMap, type TreeAdapter } from 'parse5'; -import { type AnyNode, type ParentNode, type ChildNode, Element, Document, ProcessingInstruction, Comment, Text } from 'domhandler'; -export type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap; -/** @internal */ -export declare function serializeDoctypeContent(name: string, publicId: string, systemId: string): string; -export declare const adapter: TreeAdapter; diff --git a/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js b/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js deleted file mode 100644 index 3927df0..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +++ /dev/null @@ -1,213 +0,0 @@ -import { html } from 'parse5'; -import { Element, Document, ProcessingInstruction, Comment, Text, isDirective, isText, isComment, isTag, } from 'domhandler'; -function enquoteDoctypeId(id) { - const quote = id.includes('"') ? "'" : '"'; - return quote + id + quote; -} -/** @internal */ -export function serializeDoctypeContent(name, publicId, systemId) { - let str = '!DOCTYPE '; - if (name) { - str += name; - } - if (publicId) { - str += ` PUBLIC ${enquoteDoctypeId(publicId)}`; - } - else if (systemId) { - str += ' SYSTEM'; - } - if (systemId) { - str += ` ${enquoteDoctypeId(systemId)}`; - } - return str; -} -export const adapter = { - // Re-exports from domhandler - isCommentNode: isComment, - isElementNode: isTag, - isTextNode: isText, - //Node construction - createDocument() { - const node = new Document([]); - node['x-mode'] = html.DOCUMENT_MODE.NO_QUIRKS; - return node; - }, - createDocumentFragment() { - return new Document([]); - }, - createElement(tagName, namespaceURI, attrs) { - const attribs = Object.create(null); - const attribsNamespace = Object.create(null); - const attribsPrefix = Object.create(null); - for (let i = 0; i < attrs.length; i++) { - const attrName = attrs[i].name; - attribs[attrName] = attrs[i].value; - attribsNamespace[attrName] = attrs[i].namespace; - attribsPrefix[attrName] = attrs[i].prefix; - } - const node = new Element(tagName, attribs, []); - node.namespace = namespaceURI; - node['x-attribsNamespace'] = attribsNamespace; - node['x-attribsPrefix'] = attribsPrefix; - return node; - }, - createCommentNode(data) { - return new Comment(data); - }, - createTextNode(value) { - return new Text(value); - }, - //Tree mutation - appendChild(parentNode, newNode) { - const prev = parentNode.children[parentNode.children.length - 1]; - if (prev) { - prev.next = newNode; - newNode.prev = prev; - } - parentNode.children.push(newNode); - newNode.parent = parentNode; - }, - insertBefore(parentNode, newNode, referenceNode) { - const insertionIdx = parentNode.children.indexOf(referenceNode); - const { prev } = referenceNode; - if (prev) { - prev.next = newNode; - newNode.prev = prev; - } - referenceNode.prev = newNode; - newNode.next = referenceNode; - parentNode.children.splice(insertionIdx, 0, newNode); - newNode.parent = parentNode; - }, - setTemplateContent(templateElement, contentElement) { - adapter.appendChild(templateElement, contentElement); - }, - getTemplateContent(templateElement) { - return templateElement.children[0]; - }, - setDocumentType(document, name, publicId, systemId) { - const data = serializeDoctypeContent(name, publicId, systemId); - let doctypeNode = document.children.find((node) => isDirective(node) && node.name === '!doctype'); - if (doctypeNode) { - doctypeNode.data = data !== null && data !== void 0 ? data : null; - } - else { - doctypeNode = new ProcessingInstruction('!doctype', data); - adapter.appendChild(document, doctypeNode); - } - doctypeNode['x-name'] = name; - doctypeNode['x-publicId'] = publicId; - doctypeNode['x-systemId'] = systemId; - }, - setDocumentMode(document, mode) { - document['x-mode'] = mode; - }, - getDocumentMode(document) { - return document['x-mode']; - }, - detachNode(node) { - if (node.parent) { - const idx = node.parent.children.indexOf(node); - const { prev, next } = node; - node.prev = null; - node.next = null; - if (prev) { - prev.next = next; - } - if (next) { - next.prev = prev; - } - node.parent.children.splice(idx, 1); - node.parent = null; - } - }, - insertText(parentNode, text) { - const lastChild = parentNode.children[parentNode.children.length - 1]; - if (lastChild && isText(lastChild)) { - lastChild.data += text; - } - else { - adapter.appendChild(parentNode, adapter.createTextNode(text)); - } - }, - insertTextBefore(parentNode, text, referenceNode) { - const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; - if (prevNode && isText(prevNode)) { - prevNode.data += text; - } - else { - adapter.insertBefore(parentNode, adapter.createTextNode(text), referenceNode); - } - }, - adoptAttributes(recipient, attrs) { - for (let i = 0; i < attrs.length; i++) { - const attrName = attrs[i].name; - if (recipient.attribs[attrName] === undefined) { - recipient.attribs[attrName] = attrs[i].value; - recipient['x-attribsNamespace'][attrName] = attrs[i].namespace; - recipient['x-attribsPrefix'][attrName] = attrs[i].prefix; - } - } - }, - //Tree traversing - getFirstChild(node) { - return node.children[0]; - }, - getChildNodes(node) { - return node.children; - }, - getParentNode(node) { - return node.parent; - }, - getAttrList(element) { - return element.attributes; - }, - //Node data - getTagName(element) { - return element.name; - }, - getNamespaceURI(element) { - return element.namespace; - }, - getTextNodeContent(textNode) { - return textNode.data; - }, - getCommentNodeContent(commentNode) { - return commentNode.data; - }, - getDocumentTypeNodeName(doctypeNode) { - var _a; - return (_a = doctypeNode['x-name']) !== null && _a !== void 0 ? _a : ''; - }, - getDocumentTypeNodePublicId(doctypeNode) { - var _a; - return (_a = doctypeNode['x-publicId']) !== null && _a !== void 0 ? _a : ''; - }, - getDocumentTypeNodeSystemId(doctypeNode) { - var _a; - return (_a = doctypeNode['x-systemId']) !== null && _a !== void 0 ? _a : ''; - }, - //Node types - isDocumentTypeNode(node) { - return isDirective(node) && node.name === '!doctype'; - }, - // Source code location - setNodeSourceCodeLocation(node, location) { - if (location) { - node.startIndex = location.startOffset; - node.endIndex = location.endOffset; - } - node.sourceCodeLocation = location; - }, - getNodeSourceCodeLocation(node) { - return node.sourceCodeLocation; - }, - updateNodeSourceCodeLocation(node, endLocation) { - if (endLocation.endOffset != null) - node.endIndex = endLocation.endOffset; - node.sourceCodeLocation = { - ...node.sourceCodeLocation, - ...endLocation, - }; - }, -}; diff --git a/node_modules/parse5-htmlparser2-tree-adapter/package.json b/node_modules/parse5-htmlparser2-tree-adapter/package.json deleted file mode 100644 index 1562d94..0000000 --- a/node_modules/parse5-htmlparser2-tree-adapter/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "parse5-htmlparser2-tree-adapter", - "type": "module", - "description": "htmlparser2 tree adapter for parse5.", - "version": "7.1.0", - "author": "Ivan Nikulin (https://github.com/inikulin)", - "contributors": "https://github.com/inikulin/parse5/graphs/contributors", - "homepage": "https://parse5.js.org", - "funding": "https://github.com/inikulin/parse5?sponsor=1", - "keywords": [ - "parse5", - "parser", - "tree adapter", - "htmlparser2" - ], - "license": "MIT", - "main": "dist/cjs/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "import": "./dist/index.js", - "require": "./dist/cjs/index.js" - }, - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "scripts": { - "build:cjs": "tsc --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json" - }, - "repository": { - "type": "git", - "url": "git://github.com/inikulin/parse5.git" - }, - "files": [ - "dist/cjs/package.json", - "dist/**/*.js", - "dist/**/*.d.ts" - ] -} diff --git a/node_modules/parse5-parser-stream/dist/cjs/index.d.ts b/node_modules/parse5-parser-stream/dist/cjs/index.d.ts deleted file mode 100644 index b4cc829..0000000 --- a/node_modules/parse5-parser-stream/dist/cjs/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/// -import { Writable } from 'node:stream'; -import { Parser, type ParserOptions, type TreeAdapterTypeMap, type DefaultTreeAdapterMap } from 'parse5'; -/** - * Streaming HTML parser with scripting support. - * A [writable stream](https://nodejs.org/api/stream.html#stream_class_stream_writable). - * - * @example - * - * ```js - * const ParserStream = require('parse5-parser-stream'); - * const http = require('http'); - * const { finished } = require('node:stream'); - * - * // Fetch the page content and obtain it's node - * http.get('http://inikulin.github.io/parse5/', res => { - * const parser = new ParserStream(); - * - * finished(parser, () => { - * console.log(parser.document.childNodes[1].childNodes[0].tagName); //> 'head' - * }); - * - * res.pipe(parser); - * }); - * ``` - * - */ -export declare class ParserStream extends Writable { - parser: Parser; - static getFragmentStream(fragmentContext?: T['parentNode'] | null, options?: ParserOptions): ParserStream; - private lastChunkWritten; - private writeCallback; - private pendingHtmlInsertions; - /** The resulting document node. */ - get document(): T['document']; - getFragment(): T['documentFragment']; - /** - * @param options Parsing options. - */ - constructor(options?: ParserOptions, parser?: Parser); - _write(chunk: string, _encoding: string, callback: () => void): void; - end(chunk?: any, encoding?: any, callback?: any): any; -} -export interface ParserStream { - /** - * Raised when parser encounters a `'); - * ``` - * - * @param event Name of the event - * @param handler - */ - on(event: 'script', handler: (scriptElement: T['element'], documentWrite: (html: string) => void, resume: () => void) => void): void; - /** - * Base event handler. - * - * @param event Name of the event - * @param handler Event handler - */ - on(event: string, handler: (...args: any[]) => void): this; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/parse5-parser-stream/dist/cjs/index.js b/node_modules/parse5-parser-stream/dist/cjs/index.js deleted file mode 100644 index a5002be..0000000 --- a/node_modules/parse5-parser-stream/dist/cjs/index.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ParserStream = void 0; -const node_stream_1 = require("node:stream"); -const parse5_1 = require("parse5"); -/* eslint-disable unicorn/consistent-function-scoping -- The rule seems to be broken here. */ -/** - * Streaming HTML parser with scripting support. - * A [writable stream](https://nodejs.org/api/stream.html#stream_class_stream_writable). - * - * @example - * - * ```js - * const ParserStream = require('parse5-parser-stream'); - * const http = require('http'); - * const { finished } = require('node:stream'); - * - * // Fetch the page content and obtain it's node - * http.get('http://inikulin.github.io/parse5/', res => { - * const parser = new ParserStream(); - * - * finished(parser, () => { - * console.log(parser.document.childNodes[1].childNodes[0].tagName); //> 'head' - * }); - * - * res.pipe(parser); - * }); - * ``` - * - */ -class ParserStream extends node_stream_1.Writable { - static getFragmentStream(fragmentContext, options) { - const parser = parse5_1.Parser.getFragmentParser(fragmentContext, options); - const stream = new ParserStream(options, parser); - return stream; - } - /** The resulting document node. */ - get document() { - return this.parser.document; - } - getFragment() { - return this.parser.getFragment(); - } - /** - * @param options Parsing options. - */ - constructor(options, parser = new parse5_1.Parser(options)) { - super({ decodeStrings: false }); - this.parser = parser; - this.lastChunkWritten = false; - this.writeCallback = undefined; - this.pendingHtmlInsertions = []; - const resume = () => { - for (let i = this.pendingHtmlInsertions.length - 1; i >= 0; i--) { - this.parser.tokenizer.insertHtmlAtCurrentPos(this.pendingHtmlInsertions[i]); - } - this.pendingHtmlInsertions.length = 0; - //NOTE: keep parsing if we don't wait for the next input chunk - this.parser.tokenizer.resume(this.writeCallback); - }; - const documentWrite = (html) => { - if (!this.parser.stopped) { - this.pendingHtmlInsertions.push(html); - } - }; - const scriptHandler = (scriptElement) => { - if (this.listenerCount('script') > 0) { - this.parser.tokenizer.pause(); - this.emit('script', scriptElement, documentWrite, resume); - } - }; - this.parser.scriptHandler = scriptHandler; - } - //WritableStream implementation - _write(chunk, _encoding, callback) { - if (typeof chunk !== 'string') { - throw new TypeError('Parser can work only with string streams.'); - } - this.writeCallback = callback; - this.parser.tokenizer.write(chunk, this.lastChunkWritten, this.writeCallback); - } - // TODO [engine:node@>=16]: Due to issues with Node < 16, we are overriding `end` instead of `_final`. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - end(chunk, encoding, callback) { - this.lastChunkWritten = true; - super.end(chunk || '', encoding, callback); - } -} -exports.ParserStream = ParserStream; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/parse5-parser-stream/dist/cjs/package.json b/node_modules/parse5-parser-stream/dist/cjs/package.json deleted file mode 100644 index 729ac4d..0000000 --- a/node_modules/parse5-parser-stream/dist/cjs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"commonjs"} diff --git a/node_modules/parse5-parser-stream/dist/index.d.ts b/node_modules/parse5-parser-stream/dist/index.d.ts deleted file mode 100644 index b4cc829..0000000 --- a/node_modules/parse5-parser-stream/dist/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/// -import { Writable } from 'node:stream'; -import { Parser, type ParserOptions, type TreeAdapterTypeMap, type DefaultTreeAdapterMap } from 'parse5'; -/** - * Streaming HTML parser with scripting support. - * A [writable stream](https://nodejs.org/api/stream.html#stream_class_stream_writable). - * - * @example - * - * ```js - * const ParserStream = require('parse5-parser-stream'); - * const http = require('http'); - * const { finished } = require('node:stream'); - * - * // Fetch the page content and obtain it's node - * http.get('http://inikulin.github.io/parse5/', res => { - * const parser = new ParserStream(); - * - * finished(parser, () => { - * console.log(parser.document.childNodes[1].childNodes[0].tagName); //> 'head' - * }); - * - * res.pipe(parser); - * }); - * ``` - * - */ -export declare class ParserStream extends Writable { - parser: Parser; - static getFragmentStream(fragmentContext?: T['parentNode'] | null, options?: ParserOptions): ParserStream; - private lastChunkWritten; - private writeCallback; - private pendingHtmlInsertions; - /** The resulting document node. */ - get document(): T['document']; - getFragment(): T['documentFragment']; - /** - * @param options Parsing options. - */ - constructor(options?: ParserOptions, parser?: Parser); - _write(chunk: string, _encoding: string, callback: () => void): void; - end(chunk?: any, encoding?: any, callback?: any): any; -} -export interface ParserStream { - /** - * Raised when parser encounters a `'); - * ``` - * - * @param event Name of the event - * @param handler - */ - on(event: 'script', handler: (scriptElement: T['element'], documentWrite: (html: string) => void, resume: () => void) => void): void; - /** - * Base event handler. - * - * @param event Name of the event - * @param handler Event handler - */ - on(event: string, handler: (...args: any[]) => void): this; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/parse5-parser-stream/dist/index.js b/node_modules/parse5-parser-stream/dist/index.js deleted file mode 100644 index 56d33dd..0000000 --- a/node_modules/parse5-parser-stream/dist/index.js +++ /dev/null @@ -1,86 +0,0 @@ -import { Writable } from 'node:stream'; -import { Parser } from 'parse5'; -/* eslint-disable unicorn/consistent-function-scoping -- The rule seems to be broken here. */ -/** - * Streaming HTML parser with scripting support. - * A [writable stream](https://nodejs.org/api/stream.html#stream_class_stream_writable). - * - * @example - * - * ```js - * const ParserStream = require('parse5-parser-stream'); - * const http = require('http'); - * const { finished } = require('node:stream'); - * - * // Fetch the page content and obtain it's node - * http.get('http://inikulin.github.io/parse5/', res => { - * const parser = new ParserStream(); - * - * finished(parser, () => { - * console.log(parser.document.childNodes[1].childNodes[0].tagName); //> 'head' - * }); - * - * res.pipe(parser); - * }); - * ``` - * - */ -export class ParserStream extends Writable { - static getFragmentStream(fragmentContext, options) { - const parser = Parser.getFragmentParser(fragmentContext, options); - const stream = new ParserStream(options, parser); - return stream; - } - /** The resulting document node. */ - get document() { - return this.parser.document; - } - getFragment() { - return this.parser.getFragment(); - } - /** - * @param options Parsing options. - */ - constructor(options, parser = new Parser(options)) { - super({ decodeStrings: false }); - this.parser = parser; - this.lastChunkWritten = false; - this.writeCallback = undefined; - this.pendingHtmlInsertions = []; - const resume = () => { - for (let i = this.pendingHtmlInsertions.length - 1; i >= 0; i--) { - this.parser.tokenizer.insertHtmlAtCurrentPos(this.pendingHtmlInsertions[i]); - } - this.pendingHtmlInsertions.length = 0; - //NOTE: keep parsing if we don't wait for the next input chunk - this.parser.tokenizer.resume(this.writeCallback); - }; - const documentWrite = (html) => { - if (!this.parser.stopped) { - this.pendingHtmlInsertions.push(html); - } - }; - const scriptHandler = (scriptElement) => { - if (this.listenerCount('script') > 0) { - this.parser.tokenizer.pause(); - this.emit('script', scriptElement, documentWrite, resume); - } - }; - this.parser.scriptHandler = scriptHandler; - } - //WritableStream implementation - _write(chunk, _encoding, callback) { - if (typeof chunk !== 'string') { - throw new TypeError('Parser can work only with string streams.'); - } - this.writeCallback = callback; - this.parser.tokenizer.write(chunk, this.lastChunkWritten, this.writeCallback); - } - // TODO [engine:node@>=16]: Due to issues with Node < 16, we are overriding `end` instead of `_final`. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - end(chunk, encoding, callback) { - this.lastChunkWritten = true; - super.end(chunk || '', encoding, callback); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/parse5-parser-stream/package.json b/node_modules/parse5-parser-stream/package.json deleted file mode 100644 index 465e217..0000000 --- a/node_modules/parse5-parser-stream/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "parse5-parser-stream", - "type": "module", - "description": "Streaming HTML parser with scripting support.", - "version": "7.1.2", - "author": "Ivan Nikulin (https://github.com/inikulin)", - "contributors": "https://github.com/inikulin/parse5/graphs/contributors", - "homepage": "https://github.com/inikulin/parse5", - "funding": "https://github.com/inikulin/parse5?sponsor=1", - "keywords": [ - "parse5", - "parser", - "stream", - "streaming" - ], - "license": "MIT", - "main": "dist/cjs/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "import": "./dist/index.js", - "require": "./dist/cjs/index.js" - }, - "dependencies": { - "parse5": "^7.0.0" - }, - "scripts": { - "build:cjs": "tsc --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json" - }, - "repository": { - "type": "git", - "url": "git://github.com/inikulin/parse5.git" - }, - "files": [ - "dist/cjs/package.json", - "dist/**/*.js", - "dist/**/*.d.ts" - ] -} diff --git a/node_modules/parse5/dist/cjs/common/doctype.d.ts b/node_modules/parse5/dist/cjs/common/doctype.d.ts deleted file mode 100644 index 993afaa..0000000 --- a/node_modules/parse5/dist/cjs/common/doctype.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { DOCUMENT_MODE } from './html.js'; -import type { DoctypeToken } from './token.js'; -export declare function isConforming(token: DoctypeToken): boolean; -export declare function getDocumentMode(token: DoctypeToken): DOCUMENT_MODE; diff --git a/node_modules/parse5/dist/cjs/common/doctype.js b/node_modules/parse5/dist/cjs/common/doctype.js deleted file mode 100644 index 82aed98..0000000 --- a/node_modules/parse5/dist/cjs/common/doctype.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isConforming = isConforming; -exports.getDocumentMode = getDocumentMode; -const html_js_1 = require("./html.js"); -//Const -const VALID_DOCTYPE_NAME = 'html'; -const VALID_SYSTEM_ID = 'about:legacy-compat'; -const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd'; -const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ - '+//silmaril//dtd html pro v0r11 19970101//', - '-//as//dtd html 3.0 aswedit + extensions//', - '-//advasoft ltd//dtd html 3.0 aswedit + extensions//', - '-//ietf//dtd html 2.0 level 1//', - '-//ietf//dtd html 2.0 level 2//', - '-//ietf//dtd html 2.0 strict level 1//', - '-//ietf//dtd html 2.0 strict level 2//', - '-//ietf//dtd html 2.0 strict//', - '-//ietf//dtd html 2.0//', - '-//ietf//dtd html 2.1e//', - '-//ietf//dtd html 3.0//', - '-//ietf//dtd html 3.2 final//', - '-//ietf//dtd html 3.2//', - '-//ietf//dtd html 3//', - '-//ietf//dtd html level 0//', - '-//ietf//dtd html level 1//', - '-//ietf//dtd html level 2//', - '-//ietf//dtd html level 3//', - '-//ietf//dtd html strict level 0//', - '-//ietf//dtd html strict level 1//', - '-//ietf//dtd html strict level 2//', - '-//ietf//dtd html strict level 3//', - '-//ietf//dtd html strict//', - '-//ietf//dtd html//', - '-//metrius//dtd metrius presentational//', - '-//microsoft//dtd internet explorer 2.0 html strict//', - '-//microsoft//dtd internet explorer 2.0 html//', - '-//microsoft//dtd internet explorer 2.0 tables//', - '-//microsoft//dtd internet explorer 3.0 html strict//', - '-//microsoft//dtd internet explorer 3.0 html//', - '-//microsoft//dtd internet explorer 3.0 tables//', - '-//netscape comm. corp.//dtd html//', - '-//netscape comm. corp.//dtd strict html//', - "-//o'reilly and associates//dtd html 2.0//", - "-//o'reilly and associates//dtd html extended 1.0//", - "-//o'reilly and associates//dtd html extended relaxed 1.0//", - '-//sq//dtd html 2.0 hotmetal + extensions//', - '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//', - '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//', - '-//spyglass//dtd html 2.0 extended//', - '-//sun microsystems corp.//dtd hotjava html//', - '-//sun microsystems corp.//dtd hotjava strict html//', - '-//w3c//dtd html 3 1995-03-24//', - '-//w3c//dtd html 3.2 draft//', - '-//w3c//dtd html 3.2 final//', - '-//w3c//dtd html 3.2//', - '-//w3c//dtd html 3.2s draft//', - '-//w3c//dtd html 4.0 frameset//', - '-//w3c//dtd html 4.0 transitional//', - '-//w3c//dtd html experimental 19960712//', - '-//w3c//dtd html experimental 970421//', - '-//w3c//dtd w3 html//', - '-//w3o//dtd w3 html 3.0//', - '-//webtechs//dtd mozilla html 2.0//', - '-//webtechs//dtd mozilla html//', -]; -const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [ - ...QUIRKS_MODE_PUBLIC_ID_PREFIXES, - '-//w3c//dtd html 4.01 frameset//', - '-//w3c//dtd html 4.01 transitional//', -]; -const QUIRKS_MODE_PUBLIC_IDS = new Set([ - '-//w3o//dtd w3 html strict 3.0//en//', - '-/w3c/dtd html 4.0 transitional/en', - 'html', -]); -const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//']; -const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [ - ...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES, - '-//w3c//dtd html 4.01 frameset//', - '-//w3c//dtd html 4.01 transitional//', -]; -//Utils -function hasPrefix(publicId, prefixes) { - return prefixes.some((prefix) => publicId.startsWith(prefix)); -} -//API -function isConforming(token) { - return (token.name === VALID_DOCTYPE_NAME && - token.publicId === null && - (token.systemId === null || token.systemId === VALID_SYSTEM_ID)); -} -function getDocumentMode(token) { - if (token.name !== VALID_DOCTYPE_NAME) { - return html_js_1.DOCUMENT_MODE.QUIRKS; - } - const { systemId } = token; - if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) { - return html_js_1.DOCUMENT_MODE.QUIRKS; - } - let { publicId } = token; - if (publicId !== null) { - publicId = publicId.toLowerCase(); - if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) { - return html_js_1.DOCUMENT_MODE.QUIRKS; - } - let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; - if (hasPrefix(publicId, prefixes)) { - return html_js_1.DOCUMENT_MODE.QUIRKS; - } - prefixes = - systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; - if (hasPrefix(publicId, prefixes)) { - return html_js_1.DOCUMENT_MODE.LIMITED_QUIRKS; - } - } - return html_js_1.DOCUMENT_MODE.NO_QUIRKS; -} diff --git a/node_modules/parse5/dist/cjs/common/error-codes.d.ts b/node_modules/parse5/dist/cjs/common/error-codes.d.ts deleted file mode 100644 index ac15bb3..0000000 --- a/node_modules/parse5/dist/cjs/common/error-codes.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { Location } from './token.js'; -export interface ParserError extends Location { - code: ERR; -} -export type ParserErrorHandler = (error: ParserError) => void; -export declare enum ERR { - controlCharacterInInputStream = "control-character-in-input-stream", - noncharacterInInputStream = "noncharacter-in-input-stream", - surrogateInInputStream = "surrogate-in-input-stream", - nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", - endTagWithAttributes = "end-tag-with-attributes", - endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", - unexpectedSolidusInTag = "unexpected-solidus-in-tag", - unexpectedNullCharacter = "unexpected-null-character", - unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", - invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", - unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", - missingEndTagName = "missing-end-tag-name", - unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", - unknownNamedCharacterReference = "unknown-named-character-reference", - missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", - unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", - unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", - eofBeforeTagName = "eof-before-tag-name", - eofInTag = "eof-in-tag", - missingAttributeValue = "missing-attribute-value", - missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", - missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", - missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", - missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", - missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", - missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", - missingDoctypePublicIdentifier = "missing-doctype-public-identifier", - missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", - abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", - abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", - cdataInHtmlContent = "cdata-in-html-content", - incorrectlyOpenedComment = "incorrectly-opened-comment", - eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", - eofInDoctype = "eof-in-doctype", - nestedComment = "nested-comment", - abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", - eofInComment = "eof-in-comment", - incorrectlyClosedComment = "incorrectly-closed-comment", - eofInCdata = "eof-in-cdata", - absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", - nullCharacterReference = "null-character-reference", - surrogateCharacterReference = "surrogate-character-reference", - characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", - controlCharacterReference = "control-character-reference", - noncharacterCharacterReference = "noncharacter-character-reference", - missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", - missingDoctypeName = "missing-doctype-name", - invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", - duplicateAttribute = "duplicate-attribute", - nonConformingDoctype = "non-conforming-doctype", - missingDoctype = "missing-doctype", - misplacedDoctype = "misplaced-doctype", - endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", - closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", - disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", - openElementsLeftAfterEof = "open-elements-left-after-eof", - abandonedHeadElementChild = "abandoned-head-element-child", - misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", - nestedNoscriptInHead = "nested-noscript-in-head", - eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text" -} diff --git a/node_modules/parse5/dist/cjs/common/error-codes.js b/node_modules/parse5/dist/cjs/common/error-codes.js deleted file mode 100644 index 573e68e..0000000 --- a/node_modules/parse5/dist/cjs/common/error-codes.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ERR = void 0; -var ERR; -(function (ERR) { - ERR["controlCharacterInInputStream"] = "control-character-in-input-stream"; - ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream"; - ERR["surrogateInInputStream"] = "surrogate-in-input-stream"; - ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus"; - ERR["endTagWithAttributes"] = "end-tag-with-attributes"; - ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus"; - ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag"; - ERR["unexpectedNullCharacter"] = "unexpected-null-character"; - ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name"; - ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name"; - ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name"; - ERR["missingEndTagName"] = "missing-end-tag-name"; - ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name"; - ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference"; - ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference"; - ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier"; - ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value"; - ERR["eofBeforeTagName"] = "eof-before-tag-name"; - ERR["eofInTag"] = "eof-in-tag"; - ERR["missingAttributeValue"] = "missing-attribute-value"; - ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes"; - ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword"; - ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers"; - ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword"; - ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier"; - ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier"; - ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier"; - ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier"; - ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier"; - ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier"; - ERR["cdataInHtmlContent"] = "cdata-in-html-content"; - ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment"; - ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text"; - ERR["eofInDoctype"] = "eof-in-doctype"; - ERR["nestedComment"] = "nested-comment"; - ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment"; - ERR["eofInComment"] = "eof-in-comment"; - ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment"; - ERR["eofInCdata"] = "eof-in-cdata"; - ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference"; - ERR["nullCharacterReference"] = "null-character-reference"; - ERR["surrogateCharacterReference"] = "surrogate-character-reference"; - ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range"; - ERR["controlCharacterReference"] = "control-character-reference"; - ERR["noncharacterCharacterReference"] = "noncharacter-character-reference"; - ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name"; - ERR["missingDoctypeName"] = "missing-doctype-name"; - ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name"; - ERR["duplicateAttribute"] = "duplicate-attribute"; - ERR["nonConformingDoctype"] = "non-conforming-doctype"; - ERR["missingDoctype"] = "missing-doctype"; - ERR["misplacedDoctype"] = "misplaced-doctype"; - ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element"; - ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements"; - ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head"; - ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof"; - ERR["abandonedHeadElementChild"] = "abandoned-head-element-child"; - ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element"; - ERR["nestedNoscriptInHead"] = "nested-noscript-in-head"; - ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text"; -})(ERR || (exports.ERR = ERR = {})); diff --git a/node_modules/parse5/dist/cjs/common/foreign-content.d.ts b/node_modules/parse5/dist/cjs/common/foreign-content.d.ts deleted file mode 100644 index d08d02b..0000000 --- a/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { TAG_ID as $, NS } from './html.js'; -import type { TagToken, Attribute } from './token.js'; -export declare const SVG_TAG_NAMES_ADJUSTMENT_MAP: Map; -export declare function causesExit(startTagToken: TagToken): boolean; -export declare function adjustTokenMathMLAttrs(token: TagToken): void; -export declare function adjustTokenSVGAttrs(token: TagToken): void; -export declare function adjustTokenXMLAttrs(token: TagToken): void; -export declare function adjustTokenSVGTagName(token: TagToken): void; -export declare function isIntegrationPoint(tn: $, ns: NS, attrs: Attribute[], foreignNS?: NS): boolean; diff --git a/node_modules/parse5/dist/cjs/common/foreign-content.js b/node_modules/parse5/dist/cjs/common/foreign-content.js deleted file mode 100644 index 2015b0c..0000000 --- a/node_modules/parse5/dist/cjs/common/foreign-content.js +++ /dev/null @@ -1,237 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = void 0; -exports.causesExit = causesExit; -exports.adjustTokenMathMLAttrs = adjustTokenMathMLAttrs; -exports.adjustTokenSVGAttrs = adjustTokenSVGAttrs; -exports.adjustTokenXMLAttrs = adjustTokenXMLAttrs; -exports.adjustTokenSVGTagName = adjustTokenSVGTagName; -exports.isIntegrationPoint = isIntegrationPoint; -const html_js_1 = require("./html.js"); -//MIME types -const MIME_TYPES = { - TEXT_HTML: 'text/html', - APPLICATION_XML: 'application/xhtml+xml', -}; -//Attributes -const DEFINITION_URL_ATTR = 'definitionurl'; -const ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL'; -const SVG_ATTRS_ADJUSTMENT_MAP = new Map([ - 'attributeName', - 'attributeType', - 'baseFrequency', - 'baseProfile', - 'calcMode', - 'clipPathUnits', - 'diffuseConstant', - 'edgeMode', - 'filterUnits', - 'glyphRef', - 'gradientTransform', - 'gradientUnits', - 'kernelMatrix', - 'kernelUnitLength', - 'keyPoints', - 'keySplines', - 'keyTimes', - 'lengthAdjust', - 'limitingConeAngle', - 'markerHeight', - 'markerUnits', - 'markerWidth', - 'maskContentUnits', - 'maskUnits', - 'numOctaves', - 'pathLength', - 'patternContentUnits', - 'patternTransform', - 'patternUnits', - 'pointsAtX', - 'pointsAtY', - 'pointsAtZ', - 'preserveAlpha', - 'preserveAspectRatio', - 'primitiveUnits', - 'refX', - 'refY', - 'repeatCount', - 'repeatDur', - 'requiredExtensions', - 'requiredFeatures', - 'specularConstant', - 'specularExponent', - 'spreadMethod', - 'startOffset', - 'stdDeviation', - 'stitchTiles', - 'surfaceScale', - 'systemLanguage', - 'tableValues', - 'targetX', - 'targetY', - 'textLength', - 'viewBox', - 'viewTarget', - 'xChannelSelector', - 'yChannelSelector', - 'zoomAndPan', -].map((attr) => [attr.toLowerCase(), attr])); -const XML_ATTRS_ADJUSTMENT_MAP = new Map([ - ['xlink:actuate', { prefix: 'xlink', name: 'actuate', namespace: html_js_1.NS.XLINK }], - ['xlink:arcrole', { prefix: 'xlink', name: 'arcrole', namespace: html_js_1.NS.XLINK }], - ['xlink:href', { prefix: 'xlink', name: 'href', namespace: html_js_1.NS.XLINK }], - ['xlink:role', { prefix: 'xlink', name: 'role', namespace: html_js_1.NS.XLINK }], - ['xlink:show', { prefix: 'xlink', name: 'show', namespace: html_js_1.NS.XLINK }], - ['xlink:title', { prefix: 'xlink', name: 'title', namespace: html_js_1.NS.XLINK }], - ['xlink:type', { prefix: 'xlink', name: 'type', namespace: html_js_1.NS.XLINK }], - ['xml:lang', { prefix: 'xml', name: 'lang', namespace: html_js_1.NS.XML }], - ['xml:space', { prefix: 'xml', name: 'space', namespace: html_js_1.NS.XML }], - ['xmlns', { prefix: '', name: 'xmlns', namespace: html_js_1.NS.XMLNS }], - ['xmlns:xlink', { prefix: 'xmlns', name: 'xlink', namespace: html_js_1.NS.XMLNS }], -]); -//SVG tag names adjustment map -exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = new Map([ - 'altGlyph', - 'altGlyphDef', - 'altGlyphItem', - 'animateColor', - 'animateMotion', - 'animateTransform', - 'clipPath', - 'feBlend', - 'feColorMatrix', - 'feComponentTransfer', - 'feComposite', - 'feConvolveMatrix', - 'feDiffuseLighting', - 'feDisplacementMap', - 'feDistantLight', - 'feFlood', - 'feFuncA', - 'feFuncB', - 'feFuncG', - 'feFuncR', - 'feGaussianBlur', - 'feImage', - 'feMerge', - 'feMergeNode', - 'feMorphology', - 'feOffset', - 'fePointLight', - 'feSpecularLighting', - 'feSpotLight', - 'feTile', - 'feTurbulence', - 'foreignObject', - 'glyphRef', - 'linearGradient', - 'radialGradient', - 'textPath', -].map((tn) => [tn.toLowerCase(), tn])); -//Tags that causes exit from foreign content -const EXITS_FOREIGN_CONTENT = new Set([ - html_js_1.TAG_ID.B, - html_js_1.TAG_ID.BIG, - html_js_1.TAG_ID.BLOCKQUOTE, - html_js_1.TAG_ID.BODY, - html_js_1.TAG_ID.BR, - html_js_1.TAG_ID.CENTER, - html_js_1.TAG_ID.CODE, - html_js_1.TAG_ID.DD, - html_js_1.TAG_ID.DIV, - html_js_1.TAG_ID.DL, - html_js_1.TAG_ID.DT, - html_js_1.TAG_ID.EM, - html_js_1.TAG_ID.EMBED, - html_js_1.TAG_ID.H1, - html_js_1.TAG_ID.H2, - html_js_1.TAG_ID.H3, - html_js_1.TAG_ID.H4, - html_js_1.TAG_ID.H5, - html_js_1.TAG_ID.H6, - html_js_1.TAG_ID.HEAD, - html_js_1.TAG_ID.HR, - html_js_1.TAG_ID.I, - html_js_1.TAG_ID.IMG, - html_js_1.TAG_ID.LI, - html_js_1.TAG_ID.LISTING, - html_js_1.TAG_ID.MENU, - html_js_1.TAG_ID.META, - html_js_1.TAG_ID.NOBR, - html_js_1.TAG_ID.OL, - html_js_1.TAG_ID.P, - html_js_1.TAG_ID.PRE, - html_js_1.TAG_ID.RUBY, - html_js_1.TAG_ID.S, - html_js_1.TAG_ID.SMALL, - html_js_1.TAG_ID.SPAN, - html_js_1.TAG_ID.STRONG, - html_js_1.TAG_ID.STRIKE, - html_js_1.TAG_ID.SUB, - html_js_1.TAG_ID.SUP, - html_js_1.TAG_ID.TABLE, - html_js_1.TAG_ID.TT, - html_js_1.TAG_ID.U, - html_js_1.TAG_ID.UL, - html_js_1.TAG_ID.VAR, -]); -//Check exit from foreign content -function causesExit(startTagToken) { - const tn = startTagToken.tagID; - const isFontWithAttrs = tn === html_js_1.TAG_ID.FONT && - startTagToken.attrs.some(({ name }) => name === html_js_1.ATTRS.COLOR || name === html_js_1.ATTRS.SIZE || name === html_js_1.ATTRS.FACE); - return isFontWithAttrs || EXITS_FOREIGN_CONTENT.has(tn); -} -//Token adjustments -function adjustTokenMathMLAttrs(token) { - for (let i = 0; i < token.attrs.length; i++) { - if (token.attrs[i].name === DEFINITION_URL_ATTR) { - token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; - break; - } - } -} -function adjustTokenSVGAttrs(token) { - for (let i = 0; i < token.attrs.length; i++) { - const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name); - if (adjustedAttrName != null) { - token.attrs[i].name = adjustedAttrName; - } - } -} -function adjustTokenXMLAttrs(token) { - for (let i = 0; i < token.attrs.length; i++) { - const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name); - if (adjustedAttrEntry) { - token.attrs[i].prefix = adjustedAttrEntry.prefix; - token.attrs[i].name = adjustedAttrEntry.name; - token.attrs[i].namespace = adjustedAttrEntry.namespace; - } - } -} -function adjustTokenSVGTagName(token) { - const adjustedTagName = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP.get(token.tagName); - if (adjustedTagName != null) { - token.tagName = adjustedTagName; - token.tagID = (0, html_js_1.getTagID)(token.tagName); - } -} -//Integration points -function isMathMLTextIntegrationPoint(tn, ns) { - return ns === html_js_1.NS.MATHML && (tn === html_js_1.TAG_ID.MI || tn === html_js_1.TAG_ID.MO || tn === html_js_1.TAG_ID.MN || tn === html_js_1.TAG_ID.MS || tn === html_js_1.TAG_ID.MTEXT); -} -function isHtmlIntegrationPoint(tn, ns, attrs) { - if (ns === html_js_1.NS.MATHML && tn === html_js_1.TAG_ID.ANNOTATION_XML) { - for (let i = 0; i < attrs.length; i++) { - if (attrs[i].name === html_js_1.ATTRS.ENCODING) { - const value = attrs[i].value.toLowerCase(); - return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; - } - } - } - return ns === html_js_1.NS.SVG && (tn === html_js_1.TAG_ID.FOREIGN_OBJECT || tn === html_js_1.TAG_ID.DESC || tn === html_js_1.TAG_ID.TITLE); -} -function isIntegrationPoint(tn, ns, attrs, foreignNS) { - return (((!foreignNS || foreignNS === html_js_1.NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) || - ((!foreignNS || foreignNS === html_js_1.NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns))); -} diff --git a/node_modules/parse5/dist/cjs/common/html.d.ts b/node_modules/parse5/dist/cjs/common/html.d.ts deleted file mode 100644 index 2fbc821..0000000 --- a/node_modules/parse5/dist/cjs/common/html.d.ts +++ /dev/null @@ -1,289 +0,0 @@ -/** All valid namespaces in HTML. */ -export declare enum NS { - HTML = "http://www.w3.org/1999/xhtml", - MATHML = "http://www.w3.org/1998/Math/MathML", - SVG = "http://www.w3.org/2000/svg", - XLINK = "http://www.w3.org/1999/xlink", - XML = "http://www.w3.org/XML/1998/namespace", - XMLNS = "http://www.w3.org/2000/xmlns/" -} -export declare enum ATTRS { - TYPE = "type", - ACTION = "action", - ENCODING = "encoding", - PROMPT = "prompt", - NAME = "name", - COLOR = "color", - FACE = "face", - SIZE = "size" -} -/** - * The mode of the document. - * - * @see {@link https://dom.spec.whatwg.org/#concept-document-limited-quirks} - */ -export declare enum DOCUMENT_MODE { - NO_QUIRKS = "no-quirks", - QUIRKS = "quirks", - LIMITED_QUIRKS = "limited-quirks" -} -export declare enum TAG_NAMES { - A = "a", - ADDRESS = "address", - ANNOTATION_XML = "annotation-xml", - APPLET = "applet", - AREA = "area", - ARTICLE = "article", - ASIDE = "aside", - B = "b", - BASE = "base", - BASEFONT = "basefont", - BGSOUND = "bgsound", - BIG = "big", - BLOCKQUOTE = "blockquote", - BODY = "body", - BR = "br", - BUTTON = "button", - CAPTION = "caption", - CENTER = "center", - CODE = "code", - COL = "col", - COLGROUP = "colgroup", - DD = "dd", - DESC = "desc", - DETAILS = "details", - DIALOG = "dialog", - DIR = "dir", - DIV = "div", - DL = "dl", - DT = "dt", - EM = "em", - EMBED = "embed", - FIELDSET = "fieldset", - FIGCAPTION = "figcaption", - FIGURE = "figure", - FONT = "font", - FOOTER = "footer", - FOREIGN_OBJECT = "foreignObject", - FORM = "form", - FRAME = "frame", - FRAMESET = "frameset", - H1 = "h1", - H2 = "h2", - H3 = "h3", - H4 = "h4", - H5 = "h5", - H6 = "h6", - HEAD = "head", - HEADER = "header", - HGROUP = "hgroup", - HR = "hr", - HTML = "html", - I = "i", - IMG = "img", - IMAGE = "image", - INPUT = "input", - IFRAME = "iframe", - KEYGEN = "keygen", - LABEL = "label", - LI = "li", - LINK = "link", - LISTING = "listing", - MAIN = "main", - MALIGNMARK = "malignmark", - MARQUEE = "marquee", - MATH = "math", - MENU = "menu", - META = "meta", - MGLYPH = "mglyph", - MI = "mi", - MO = "mo", - MN = "mn", - MS = "ms", - MTEXT = "mtext", - NAV = "nav", - NOBR = "nobr", - NOFRAMES = "noframes", - NOEMBED = "noembed", - NOSCRIPT = "noscript", - OBJECT = "object", - OL = "ol", - OPTGROUP = "optgroup", - OPTION = "option", - P = "p", - PARAM = "param", - PLAINTEXT = "plaintext", - PRE = "pre", - RB = "rb", - RP = "rp", - RT = "rt", - RTC = "rtc", - RUBY = "ruby", - S = "s", - SCRIPT = "script", - SEARCH = "search", - SECTION = "section", - SELECT = "select", - SOURCE = "source", - SMALL = "small", - SPAN = "span", - STRIKE = "strike", - STRONG = "strong", - STYLE = "style", - SUB = "sub", - SUMMARY = "summary", - SUP = "sup", - TABLE = "table", - TBODY = "tbody", - TEMPLATE = "template", - TEXTAREA = "textarea", - TFOOT = "tfoot", - TD = "td", - TH = "th", - THEAD = "thead", - TITLE = "title", - TR = "tr", - TRACK = "track", - TT = "tt", - U = "u", - UL = "ul", - SVG = "svg", - VAR = "var", - WBR = "wbr", - XMP = "xmp" -} -/** - * Tag IDs are numeric IDs for known tag names. - * - * We use tag IDs to improve the performance of tag name comparisons. - */ -export declare enum TAG_ID { - UNKNOWN = 0, - A = 1, - ADDRESS = 2, - ANNOTATION_XML = 3, - APPLET = 4, - AREA = 5, - ARTICLE = 6, - ASIDE = 7, - B = 8, - BASE = 9, - BASEFONT = 10, - BGSOUND = 11, - BIG = 12, - BLOCKQUOTE = 13, - BODY = 14, - BR = 15, - BUTTON = 16, - CAPTION = 17, - CENTER = 18, - CODE = 19, - COL = 20, - COLGROUP = 21, - DD = 22, - DESC = 23, - DETAILS = 24, - DIALOG = 25, - DIR = 26, - DIV = 27, - DL = 28, - DT = 29, - EM = 30, - EMBED = 31, - FIELDSET = 32, - FIGCAPTION = 33, - FIGURE = 34, - FONT = 35, - FOOTER = 36, - FOREIGN_OBJECT = 37, - FORM = 38, - FRAME = 39, - FRAMESET = 40, - H1 = 41, - H2 = 42, - H3 = 43, - H4 = 44, - H5 = 45, - H6 = 46, - HEAD = 47, - HEADER = 48, - HGROUP = 49, - HR = 50, - HTML = 51, - I = 52, - IMG = 53, - IMAGE = 54, - INPUT = 55, - IFRAME = 56, - KEYGEN = 57, - LABEL = 58, - LI = 59, - LINK = 60, - LISTING = 61, - MAIN = 62, - MALIGNMARK = 63, - MARQUEE = 64, - MATH = 65, - MENU = 66, - META = 67, - MGLYPH = 68, - MI = 69, - MO = 70, - MN = 71, - MS = 72, - MTEXT = 73, - NAV = 74, - NOBR = 75, - NOFRAMES = 76, - NOEMBED = 77, - NOSCRIPT = 78, - OBJECT = 79, - OL = 80, - OPTGROUP = 81, - OPTION = 82, - P = 83, - PARAM = 84, - PLAINTEXT = 85, - PRE = 86, - RB = 87, - RP = 88, - RT = 89, - RTC = 90, - RUBY = 91, - S = 92, - SCRIPT = 93, - SEARCH = 94, - SECTION = 95, - SELECT = 96, - SOURCE = 97, - SMALL = 98, - SPAN = 99, - STRIKE = 100, - STRONG = 101, - STYLE = 102, - SUB = 103, - SUMMARY = 104, - SUP = 105, - TABLE = 106, - TBODY = 107, - TEMPLATE = 108, - TEXTAREA = 109, - TFOOT = 110, - TD = 111, - TH = 112, - THEAD = 113, - TITLE = 114, - TR = 115, - TRACK = 116, - TT = 117, - U = 118, - UL = 119, - SVG = 120, - VAR = 121, - WBR = 122, - XMP = 123 -} -export declare function getTagID(tagName: string): TAG_ID; -export declare const SPECIAL_ELEMENTS: Record>; -export declare const NUMBERED_HEADERS: Set; -export declare function hasUnescapedText(tn: string, scriptingEnabled: boolean): boolean; diff --git a/node_modules/parse5/dist/cjs/common/html.js b/node_modules/parse5/dist/cjs/common/html.js deleted file mode 100644 index d18fc44..0000000 --- a/node_modules/parse5/dist/cjs/common/html.js +++ /dev/null @@ -1,528 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NUMBERED_HEADERS = exports.SPECIAL_ELEMENTS = exports.TAG_ID = exports.TAG_NAMES = exports.DOCUMENT_MODE = exports.ATTRS = exports.NS = void 0; -exports.getTagID = getTagID; -exports.hasUnescapedText = hasUnescapedText; -/** All valid namespaces in HTML. */ -var NS; -(function (NS) { - NS["HTML"] = "http://www.w3.org/1999/xhtml"; - NS["MATHML"] = "http://www.w3.org/1998/Math/MathML"; - NS["SVG"] = "http://www.w3.org/2000/svg"; - NS["XLINK"] = "http://www.w3.org/1999/xlink"; - NS["XML"] = "http://www.w3.org/XML/1998/namespace"; - NS["XMLNS"] = "http://www.w3.org/2000/xmlns/"; -})(NS || (exports.NS = NS = {})); -var ATTRS; -(function (ATTRS) { - ATTRS["TYPE"] = "type"; - ATTRS["ACTION"] = "action"; - ATTRS["ENCODING"] = "encoding"; - ATTRS["PROMPT"] = "prompt"; - ATTRS["NAME"] = "name"; - ATTRS["COLOR"] = "color"; - ATTRS["FACE"] = "face"; - ATTRS["SIZE"] = "size"; -})(ATTRS || (exports.ATTRS = ATTRS = {})); -/** - * The mode of the document. - * - * @see {@link https://dom.spec.whatwg.org/#concept-document-limited-quirks} - */ -var DOCUMENT_MODE; -(function (DOCUMENT_MODE) { - DOCUMENT_MODE["NO_QUIRKS"] = "no-quirks"; - DOCUMENT_MODE["QUIRKS"] = "quirks"; - DOCUMENT_MODE["LIMITED_QUIRKS"] = "limited-quirks"; -})(DOCUMENT_MODE || (exports.DOCUMENT_MODE = DOCUMENT_MODE = {})); -var TAG_NAMES; -(function (TAG_NAMES) { - TAG_NAMES["A"] = "a"; - TAG_NAMES["ADDRESS"] = "address"; - TAG_NAMES["ANNOTATION_XML"] = "annotation-xml"; - TAG_NAMES["APPLET"] = "applet"; - TAG_NAMES["AREA"] = "area"; - TAG_NAMES["ARTICLE"] = "article"; - TAG_NAMES["ASIDE"] = "aside"; - TAG_NAMES["B"] = "b"; - TAG_NAMES["BASE"] = "base"; - TAG_NAMES["BASEFONT"] = "basefont"; - TAG_NAMES["BGSOUND"] = "bgsound"; - TAG_NAMES["BIG"] = "big"; - TAG_NAMES["BLOCKQUOTE"] = "blockquote"; - TAG_NAMES["BODY"] = "body"; - TAG_NAMES["BR"] = "br"; - TAG_NAMES["BUTTON"] = "button"; - TAG_NAMES["CAPTION"] = "caption"; - TAG_NAMES["CENTER"] = "center"; - TAG_NAMES["CODE"] = "code"; - TAG_NAMES["COL"] = "col"; - TAG_NAMES["COLGROUP"] = "colgroup"; - TAG_NAMES["DD"] = "dd"; - TAG_NAMES["DESC"] = "desc"; - TAG_NAMES["DETAILS"] = "details"; - TAG_NAMES["DIALOG"] = "dialog"; - TAG_NAMES["DIR"] = "dir"; - TAG_NAMES["DIV"] = "div"; - TAG_NAMES["DL"] = "dl"; - TAG_NAMES["DT"] = "dt"; - TAG_NAMES["EM"] = "em"; - TAG_NAMES["EMBED"] = "embed"; - TAG_NAMES["FIELDSET"] = "fieldset"; - TAG_NAMES["FIGCAPTION"] = "figcaption"; - TAG_NAMES["FIGURE"] = "figure"; - TAG_NAMES["FONT"] = "font"; - TAG_NAMES["FOOTER"] = "footer"; - TAG_NAMES["FOREIGN_OBJECT"] = "foreignObject"; - TAG_NAMES["FORM"] = "form"; - TAG_NAMES["FRAME"] = "frame"; - TAG_NAMES["FRAMESET"] = "frameset"; - TAG_NAMES["H1"] = "h1"; - TAG_NAMES["H2"] = "h2"; - TAG_NAMES["H3"] = "h3"; - TAG_NAMES["H4"] = "h4"; - TAG_NAMES["H5"] = "h5"; - TAG_NAMES["H6"] = "h6"; - TAG_NAMES["HEAD"] = "head"; - TAG_NAMES["HEADER"] = "header"; - TAG_NAMES["HGROUP"] = "hgroup"; - TAG_NAMES["HR"] = "hr"; - TAG_NAMES["HTML"] = "html"; - TAG_NAMES["I"] = "i"; - TAG_NAMES["IMG"] = "img"; - TAG_NAMES["IMAGE"] = "image"; - TAG_NAMES["INPUT"] = "input"; - TAG_NAMES["IFRAME"] = "iframe"; - TAG_NAMES["KEYGEN"] = "keygen"; - TAG_NAMES["LABEL"] = "label"; - TAG_NAMES["LI"] = "li"; - TAG_NAMES["LINK"] = "link"; - TAG_NAMES["LISTING"] = "listing"; - TAG_NAMES["MAIN"] = "main"; - TAG_NAMES["MALIGNMARK"] = "malignmark"; - TAG_NAMES["MARQUEE"] = "marquee"; - TAG_NAMES["MATH"] = "math"; - TAG_NAMES["MENU"] = "menu"; - TAG_NAMES["META"] = "meta"; - TAG_NAMES["MGLYPH"] = "mglyph"; - TAG_NAMES["MI"] = "mi"; - TAG_NAMES["MO"] = "mo"; - TAG_NAMES["MN"] = "mn"; - TAG_NAMES["MS"] = "ms"; - TAG_NAMES["MTEXT"] = "mtext"; - TAG_NAMES["NAV"] = "nav"; - TAG_NAMES["NOBR"] = "nobr"; - TAG_NAMES["NOFRAMES"] = "noframes"; - TAG_NAMES["NOEMBED"] = "noembed"; - TAG_NAMES["NOSCRIPT"] = "noscript"; - TAG_NAMES["OBJECT"] = "object"; - TAG_NAMES["OL"] = "ol"; - TAG_NAMES["OPTGROUP"] = "optgroup"; - TAG_NAMES["OPTION"] = "option"; - TAG_NAMES["P"] = "p"; - TAG_NAMES["PARAM"] = "param"; - TAG_NAMES["PLAINTEXT"] = "plaintext"; - TAG_NAMES["PRE"] = "pre"; - TAG_NAMES["RB"] = "rb"; - TAG_NAMES["RP"] = "rp"; - TAG_NAMES["RT"] = "rt"; - TAG_NAMES["RTC"] = "rtc"; - TAG_NAMES["RUBY"] = "ruby"; - TAG_NAMES["S"] = "s"; - TAG_NAMES["SCRIPT"] = "script"; - TAG_NAMES["SEARCH"] = "search"; - TAG_NAMES["SECTION"] = "section"; - TAG_NAMES["SELECT"] = "select"; - TAG_NAMES["SOURCE"] = "source"; - TAG_NAMES["SMALL"] = "small"; - TAG_NAMES["SPAN"] = "span"; - TAG_NAMES["STRIKE"] = "strike"; - TAG_NAMES["STRONG"] = "strong"; - TAG_NAMES["STYLE"] = "style"; - TAG_NAMES["SUB"] = "sub"; - TAG_NAMES["SUMMARY"] = "summary"; - TAG_NAMES["SUP"] = "sup"; - TAG_NAMES["TABLE"] = "table"; - TAG_NAMES["TBODY"] = "tbody"; - TAG_NAMES["TEMPLATE"] = "template"; - TAG_NAMES["TEXTAREA"] = "textarea"; - TAG_NAMES["TFOOT"] = "tfoot"; - TAG_NAMES["TD"] = "td"; - TAG_NAMES["TH"] = "th"; - TAG_NAMES["THEAD"] = "thead"; - TAG_NAMES["TITLE"] = "title"; - TAG_NAMES["TR"] = "tr"; - TAG_NAMES["TRACK"] = "track"; - TAG_NAMES["TT"] = "tt"; - TAG_NAMES["U"] = "u"; - TAG_NAMES["UL"] = "ul"; - TAG_NAMES["SVG"] = "svg"; - TAG_NAMES["VAR"] = "var"; - TAG_NAMES["WBR"] = "wbr"; - TAG_NAMES["XMP"] = "xmp"; -})(TAG_NAMES || (exports.TAG_NAMES = TAG_NAMES = {})); -/** - * Tag IDs are numeric IDs for known tag names. - * - * We use tag IDs to improve the performance of tag name comparisons. - */ -var TAG_ID; -(function (TAG_ID) { - TAG_ID[TAG_ID["UNKNOWN"] = 0] = "UNKNOWN"; - TAG_ID[TAG_ID["A"] = 1] = "A"; - TAG_ID[TAG_ID["ADDRESS"] = 2] = "ADDRESS"; - TAG_ID[TAG_ID["ANNOTATION_XML"] = 3] = "ANNOTATION_XML"; - TAG_ID[TAG_ID["APPLET"] = 4] = "APPLET"; - TAG_ID[TAG_ID["AREA"] = 5] = "AREA"; - TAG_ID[TAG_ID["ARTICLE"] = 6] = "ARTICLE"; - TAG_ID[TAG_ID["ASIDE"] = 7] = "ASIDE"; - TAG_ID[TAG_ID["B"] = 8] = "B"; - TAG_ID[TAG_ID["BASE"] = 9] = "BASE"; - TAG_ID[TAG_ID["BASEFONT"] = 10] = "BASEFONT"; - TAG_ID[TAG_ID["BGSOUND"] = 11] = "BGSOUND"; - TAG_ID[TAG_ID["BIG"] = 12] = "BIG"; - TAG_ID[TAG_ID["BLOCKQUOTE"] = 13] = "BLOCKQUOTE"; - TAG_ID[TAG_ID["BODY"] = 14] = "BODY"; - TAG_ID[TAG_ID["BR"] = 15] = "BR"; - TAG_ID[TAG_ID["BUTTON"] = 16] = "BUTTON"; - TAG_ID[TAG_ID["CAPTION"] = 17] = "CAPTION"; - TAG_ID[TAG_ID["CENTER"] = 18] = "CENTER"; - TAG_ID[TAG_ID["CODE"] = 19] = "CODE"; - TAG_ID[TAG_ID["COL"] = 20] = "COL"; - TAG_ID[TAG_ID["COLGROUP"] = 21] = "COLGROUP"; - TAG_ID[TAG_ID["DD"] = 22] = "DD"; - TAG_ID[TAG_ID["DESC"] = 23] = "DESC"; - TAG_ID[TAG_ID["DETAILS"] = 24] = "DETAILS"; - TAG_ID[TAG_ID["DIALOG"] = 25] = "DIALOG"; - TAG_ID[TAG_ID["DIR"] = 26] = "DIR"; - TAG_ID[TAG_ID["DIV"] = 27] = "DIV"; - TAG_ID[TAG_ID["DL"] = 28] = "DL"; - TAG_ID[TAG_ID["DT"] = 29] = "DT"; - TAG_ID[TAG_ID["EM"] = 30] = "EM"; - TAG_ID[TAG_ID["EMBED"] = 31] = "EMBED"; - TAG_ID[TAG_ID["FIELDSET"] = 32] = "FIELDSET"; - TAG_ID[TAG_ID["FIGCAPTION"] = 33] = "FIGCAPTION"; - TAG_ID[TAG_ID["FIGURE"] = 34] = "FIGURE"; - TAG_ID[TAG_ID["FONT"] = 35] = "FONT"; - TAG_ID[TAG_ID["FOOTER"] = 36] = "FOOTER"; - TAG_ID[TAG_ID["FOREIGN_OBJECT"] = 37] = "FOREIGN_OBJECT"; - TAG_ID[TAG_ID["FORM"] = 38] = "FORM"; - TAG_ID[TAG_ID["FRAME"] = 39] = "FRAME"; - TAG_ID[TAG_ID["FRAMESET"] = 40] = "FRAMESET"; - TAG_ID[TAG_ID["H1"] = 41] = "H1"; - TAG_ID[TAG_ID["H2"] = 42] = "H2"; - TAG_ID[TAG_ID["H3"] = 43] = "H3"; - TAG_ID[TAG_ID["H4"] = 44] = "H4"; - TAG_ID[TAG_ID["H5"] = 45] = "H5"; - TAG_ID[TAG_ID["H6"] = 46] = "H6"; - TAG_ID[TAG_ID["HEAD"] = 47] = "HEAD"; - TAG_ID[TAG_ID["HEADER"] = 48] = "HEADER"; - TAG_ID[TAG_ID["HGROUP"] = 49] = "HGROUP"; - TAG_ID[TAG_ID["HR"] = 50] = "HR"; - TAG_ID[TAG_ID["HTML"] = 51] = "HTML"; - TAG_ID[TAG_ID["I"] = 52] = "I"; - TAG_ID[TAG_ID["IMG"] = 53] = "IMG"; - TAG_ID[TAG_ID["IMAGE"] = 54] = "IMAGE"; - TAG_ID[TAG_ID["INPUT"] = 55] = "INPUT"; - TAG_ID[TAG_ID["IFRAME"] = 56] = "IFRAME"; - TAG_ID[TAG_ID["KEYGEN"] = 57] = "KEYGEN"; - TAG_ID[TAG_ID["LABEL"] = 58] = "LABEL"; - TAG_ID[TAG_ID["LI"] = 59] = "LI"; - TAG_ID[TAG_ID["LINK"] = 60] = "LINK"; - TAG_ID[TAG_ID["LISTING"] = 61] = "LISTING"; - TAG_ID[TAG_ID["MAIN"] = 62] = "MAIN"; - TAG_ID[TAG_ID["MALIGNMARK"] = 63] = "MALIGNMARK"; - TAG_ID[TAG_ID["MARQUEE"] = 64] = "MARQUEE"; - TAG_ID[TAG_ID["MATH"] = 65] = "MATH"; - TAG_ID[TAG_ID["MENU"] = 66] = "MENU"; - TAG_ID[TAG_ID["META"] = 67] = "META"; - TAG_ID[TAG_ID["MGLYPH"] = 68] = "MGLYPH"; - TAG_ID[TAG_ID["MI"] = 69] = "MI"; - TAG_ID[TAG_ID["MO"] = 70] = "MO"; - TAG_ID[TAG_ID["MN"] = 71] = "MN"; - TAG_ID[TAG_ID["MS"] = 72] = "MS"; - TAG_ID[TAG_ID["MTEXT"] = 73] = "MTEXT"; - TAG_ID[TAG_ID["NAV"] = 74] = "NAV"; - TAG_ID[TAG_ID["NOBR"] = 75] = "NOBR"; - TAG_ID[TAG_ID["NOFRAMES"] = 76] = "NOFRAMES"; - TAG_ID[TAG_ID["NOEMBED"] = 77] = "NOEMBED"; - TAG_ID[TAG_ID["NOSCRIPT"] = 78] = "NOSCRIPT"; - TAG_ID[TAG_ID["OBJECT"] = 79] = "OBJECT"; - TAG_ID[TAG_ID["OL"] = 80] = "OL"; - TAG_ID[TAG_ID["OPTGROUP"] = 81] = "OPTGROUP"; - TAG_ID[TAG_ID["OPTION"] = 82] = "OPTION"; - TAG_ID[TAG_ID["P"] = 83] = "P"; - TAG_ID[TAG_ID["PARAM"] = 84] = "PARAM"; - TAG_ID[TAG_ID["PLAINTEXT"] = 85] = "PLAINTEXT"; - TAG_ID[TAG_ID["PRE"] = 86] = "PRE"; - TAG_ID[TAG_ID["RB"] = 87] = "RB"; - TAG_ID[TAG_ID["RP"] = 88] = "RP"; - TAG_ID[TAG_ID["RT"] = 89] = "RT"; - TAG_ID[TAG_ID["RTC"] = 90] = "RTC"; - TAG_ID[TAG_ID["RUBY"] = 91] = "RUBY"; - TAG_ID[TAG_ID["S"] = 92] = "S"; - TAG_ID[TAG_ID["SCRIPT"] = 93] = "SCRIPT"; - TAG_ID[TAG_ID["SEARCH"] = 94] = "SEARCH"; - TAG_ID[TAG_ID["SECTION"] = 95] = "SECTION"; - TAG_ID[TAG_ID["SELECT"] = 96] = "SELECT"; - TAG_ID[TAG_ID["SOURCE"] = 97] = "SOURCE"; - TAG_ID[TAG_ID["SMALL"] = 98] = "SMALL"; - TAG_ID[TAG_ID["SPAN"] = 99] = "SPAN"; - TAG_ID[TAG_ID["STRIKE"] = 100] = "STRIKE"; - TAG_ID[TAG_ID["STRONG"] = 101] = "STRONG"; - TAG_ID[TAG_ID["STYLE"] = 102] = "STYLE"; - TAG_ID[TAG_ID["SUB"] = 103] = "SUB"; - TAG_ID[TAG_ID["SUMMARY"] = 104] = "SUMMARY"; - TAG_ID[TAG_ID["SUP"] = 105] = "SUP"; - TAG_ID[TAG_ID["TABLE"] = 106] = "TABLE"; - TAG_ID[TAG_ID["TBODY"] = 107] = "TBODY"; - TAG_ID[TAG_ID["TEMPLATE"] = 108] = "TEMPLATE"; - TAG_ID[TAG_ID["TEXTAREA"] = 109] = "TEXTAREA"; - TAG_ID[TAG_ID["TFOOT"] = 110] = "TFOOT"; - TAG_ID[TAG_ID["TD"] = 111] = "TD"; - TAG_ID[TAG_ID["TH"] = 112] = "TH"; - TAG_ID[TAG_ID["THEAD"] = 113] = "THEAD"; - TAG_ID[TAG_ID["TITLE"] = 114] = "TITLE"; - TAG_ID[TAG_ID["TR"] = 115] = "TR"; - TAG_ID[TAG_ID["TRACK"] = 116] = "TRACK"; - TAG_ID[TAG_ID["TT"] = 117] = "TT"; - TAG_ID[TAG_ID["U"] = 118] = "U"; - TAG_ID[TAG_ID["UL"] = 119] = "UL"; - TAG_ID[TAG_ID["SVG"] = 120] = "SVG"; - TAG_ID[TAG_ID["VAR"] = 121] = "VAR"; - TAG_ID[TAG_ID["WBR"] = 122] = "WBR"; - TAG_ID[TAG_ID["XMP"] = 123] = "XMP"; -})(TAG_ID || (exports.TAG_ID = TAG_ID = {})); -const TAG_NAME_TO_ID = new Map([ - [TAG_NAMES.A, TAG_ID.A], - [TAG_NAMES.ADDRESS, TAG_ID.ADDRESS], - [TAG_NAMES.ANNOTATION_XML, TAG_ID.ANNOTATION_XML], - [TAG_NAMES.APPLET, TAG_ID.APPLET], - [TAG_NAMES.AREA, TAG_ID.AREA], - [TAG_NAMES.ARTICLE, TAG_ID.ARTICLE], - [TAG_NAMES.ASIDE, TAG_ID.ASIDE], - [TAG_NAMES.B, TAG_ID.B], - [TAG_NAMES.BASE, TAG_ID.BASE], - [TAG_NAMES.BASEFONT, TAG_ID.BASEFONT], - [TAG_NAMES.BGSOUND, TAG_ID.BGSOUND], - [TAG_NAMES.BIG, TAG_ID.BIG], - [TAG_NAMES.BLOCKQUOTE, TAG_ID.BLOCKQUOTE], - [TAG_NAMES.BODY, TAG_ID.BODY], - [TAG_NAMES.BR, TAG_ID.BR], - [TAG_NAMES.BUTTON, TAG_ID.BUTTON], - [TAG_NAMES.CAPTION, TAG_ID.CAPTION], - [TAG_NAMES.CENTER, TAG_ID.CENTER], - [TAG_NAMES.CODE, TAG_ID.CODE], - [TAG_NAMES.COL, TAG_ID.COL], - [TAG_NAMES.COLGROUP, TAG_ID.COLGROUP], - [TAG_NAMES.DD, TAG_ID.DD], - [TAG_NAMES.DESC, TAG_ID.DESC], - [TAG_NAMES.DETAILS, TAG_ID.DETAILS], - [TAG_NAMES.DIALOG, TAG_ID.DIALOG], - [TAG_NAMES.DIR, TAG_ID.DIR], - [TAG_NAMES.DIV, TAG_ID.DIV], - [TAG_NAMES.DL, TAG_ID.DL], - [TAG_NAMES.DT, TAG_ID.DT], - [TAG_NAMES.EM, TAG_ID.EM], - [TAG_NAMES.EMBED, TAG_ID.EMBED], - [TAG_NAMES.FIELDSET, TAG_ID.FIELDSET], - [TAG_NAMES.FIGCAPTION, TAG_ID.FIGCAPTION], - [TAG_NAMES.FIGURE, TAG_ID.FIGURE], - [TAG_NAMES.FONT, TAG_ID.FONT], - [TAG_NAMES.FOOTER, TAG_ID.FOOTER], - [TAG_NAMES.FOREIGN_OBJECT, TAG_ID.FOREIGN_OBJECT], - [TAG_NAMES.FORM, TAG_ID.FORM], - [TAG_NAMES.FRAME, TAG_ID.FRAME], - [TAG_NAMES.FRAMESET, TAG_ID.FRAMESET], - [TAG_NAMES.H1, TAG_ID.H1], - [TAG_NAMES.H2, TAG_ID.H2], - [TAG_NAMES.H3, TAG_ID.H3], - [TAG_NAMES.H4, TAG_ID.H4], - [TAG_NAMES.H5, TAG_ID.H5], - [TAG_NAMES.H6, TAG_ID.H6], - [TAG_NAMES.HEAD, TAG_ID.HEAD], - [TAG_NAMES.HEADER, TAG_ID.HEADER], - [TAG_NAMES.HGROUP, TAG_ID.HGROUP], - [TAG_NAMES.HR, TAG_ID.HR], - [TAG_NAMES.HTML, TAG_ID.HTML], - [TAG_NAMES.I, TAG_ID.I], - [TAG_NAMES.IMG, TAG_ID.IMG], - [TAG_NAMES.IMAGE, TAG_ID.IMAGE], - [TAG_NAMES.INPUT, TAG_ID.INPUT], - [TAG_NAMES.IFRAME, TAG_ID.IFRAME], - [TAG_NAMES.KEYGEN, TAG_ID.KEYGEN], - [TAG_NAMES.LABEL, TAG_ID.LABEL], - [TAG_NAMES.LI, TAG_ID.LI], - [TAG_NAMES.LINK, TAG_ID.LINK], - [TAG_NAMES.LISTING, TAG_ID.LISTING], - [TAG_NAMES.MAIN, TAG_ID.MAIN], - [TAG_NAMES.MALIGNMARK, TAG_ID.MALIGNMARK], - [TAG_NAMES.MARQUEE, TAG_ID.MARQUEE], - [TAG_NAMES.MATH, TAG_ID.MATH], - [TAG_NAMES.MENU, TAG_ID.MENU], - [TAG_NAMES.META, TAG_ID.META], - [TAG_NAMES.MGLYPH, TAG_ID.MGLYPH], - [TAG_NAMES.MI, TAG_ID.MI], - [TAG_NAMES.MO, TAG_ID.MO], - [TAG_NAMES.MN, TAG_ID.MN], - [TAG_NAMES.MS, TAG_ID.MS], - [TAG_NAMES.MTEXT, TAG_ID.MTEXT], - [TAG_NAMES.NAV, TAG_ID.NAV], - [TAG_NAMES.NOBR, TAG_ID.NOBR], - [TAG_NAMES.NOFRAMES, TAG_ID.NOFRAMES], - [TAG_NAMES.NOEMBED, TAG_ID.NOEMBED], - [TAG_NAMES.NOSCRIPT, TAG_ID.NOSCRIPT], - [TAG_NAMES.OBJECT, TAG_ID.OBJECT], - [TAG_NAMES.OL, TAG_ID.OL], - [TAG_NAMES.OPTGROUP, TAG_ID.OPTGROUP], - [TAG_NAMES.OPTION, TAG_ID.OPTION], - [TAG_NAMES.P, TAG_ID.P], - [TAG_NAMES.PARAM, TAG_ID.PARAM], - [TAG_NAMES.PLAINTEXT, TAG_ID.PLAINTEXT], - [TAG_NAMES.PRE, TAG_ID.PRE], - [TAG_NAMES.RB, TAG_ID.RB], - [TAG_NAMES.RP, TAG_ID.RP], - [TAG_NAMES.RT, TAG_ID.RT], - [TAG_NAMES.RTC, TAG_ID.RTC], - [TAG_NAMES.RUBY, TAG_ID.RUBY], - [TAG_NAMES.S, TAG_ID.S], - [TAG_NAMES.SCRIPT, TAG_ID.SCRIPT], - [TAG_NAMES.SEARCH, TAG_ID.SEARCH], - [TAG_NAMES.SECTION, TAG_ID.SECTION], - [TAG_NAMES.SELECT, TAG_ID.SELECT], - [TAG_NAMES.SOURCE, TAG_ID.SOURCE], - [TAG_NAMES.SMALL, TAG_ID.SMALL], - [TAG_NAMES.SPAN, TAG_ID.SPAN], - [TAG_NAMES.STRIKE, TAG_ID.STRIKE], - [TAG_NAMES.STRONG, TAG_ID.STRONG], - [TAG_NAMES.STYLE, TAG_ID.STYLE], - [TAG_NAMES.SUB, TAG_ID.SUB], - [TAG_NAMES.SUMMARY, TAG_ID.SUMMARY], - [TAG_NAMES.SUP, TAG_ID.SUP], - [TAG_NAMES.TABLE, TAG_ID.TABLE], - [TAG_NAMES.TBODY, TAG_ID.TBODY], - [TAG_NAMES.TEMPLATE, TAG_ID.TEMPLATE], - [TAG_NAMES.TEXTAREA, TAG_ID.TEXTAREA], - [TAG_NAMES.TFOOT, TAG_ID.TFOOT], - [TAG_NAMES.TD, TAG_ID.TD], - [TAG_NAMES.TH, TAG_ID.TH], - [TAG_NAMES.THEAD, TAG_ID.THEAD], - [TAG_NAMES.TITLE, TAG_ID.TITLE], - [TAG_NAMES.TR, TAG_ID.TR], - [TAG_NAMES.TRACK, TAG_ID.TRACK], - [TAG_NAMES.TT, TAG_ID.TT], - [TAG_NAMES.U, TAG_ID.U], - [TAG_NAMES.UL, TAG_ID.UL], - [TAG_NAMES.SVG, TAG_ID.SVG], - [TAG_NAMES.VAR, TAG_ID.VAR], - [TAG_NAMES.WBR, TAG_ID.WBR], - [TAG_NAMES.XMP, TAG_ID.XMP], -]); -function getTagID(tagName) { - var _a; - return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN; -} -const $ = TAG_ID; -exports.SPECIAL_ELEMENTS = { - [NS.HTML]: new Set([ - $.ADDRESS, - $.APPLET, - $.AREA, - $.ARTICLE, - $.ASIDE, - $.BASE, - $.BASEFONT, - $.BGSOUND, - $.BLOCKQUOTE, - $.BODY, - $.BR, - $.BUTTON, - $.CAPTION, - $.CENTER, - $.COL, - $.COLGROUP, - $.DD, - $.DETAILS, - $.DIR, - $.DIV, - $.DL, - $.DT, - $.EMBED, - $.FIELDSET, - $.FIGCAPTION, - $.FIGURE, - $.FOOTER, - $.FORM, - $.FRAME, - $.FRAMESET, - $.H1, - $.H2, - $.H3, - $.H4, - $.H5, - $.H6, - $.HEAD, - $.HEADER, - $.HGROUP, - $.HR, - $.HTML, - $.IFRAME, - $.IMG, - $.INPUT, - $.LI, - $.LINK, - $.LISTING, - $.MAIN, - $.MARQUEE, - $.MENU, - $.META, - $.NAV, - $.NOEMBED, - $.NOFRAMES, - $.NOSCRIPT, - $.OBJECT, - $.OL, - $.P, - $.PARAM, - $.PLAINTEXT, - $.PRE, - $.SCRIPT, - $.SECTION, - $.SELECT, - $.SOURCE, - $.STYLE, - $.SUMMARY, - $.TABLE, - $.TBODY, - $.TD, - $.TEMPLATE, - $.TEXTAREA, - $.TFOOT, - $.TH, - $.THEAD, - $.TITLE, - $.TR, - $.TRACK, - $.UL, - $.WBR, - $.XMP, - ]), - [NS.MATHML]: new Set([$.MI, $.MO, $.MN, $.MS, $.MTEXT, $.ANNOTATION_XML]), - [NS.SVG]: new Set([$.TITLE, $.FOREIGN_OBJECT, $.DESC]), - [NS.XLINK]: new Set(), - [NS.XML]: new Set(), - [NS.XMLNS]: new Set(), -}; -exports.NUMBERED_HEADERS = new Set([$.H1, $.H2, $.H3, $.H4, $.H5, $.H6]); -const UNESCAPED_TEXT = new Set([ - TAG_NAMES.STYLE, - TAG_NAMES.SCRIPT, - TAG_NAMES.XMP, - TAG_NAMES.IFRAME, - TAG_NAMES.NOEMBED, - TAG_NAMES.NOFRAMES, - TAG_NAMES.PLAINTEXT, -]); -function hasUnescapedText(tn, scriptingEnabled) { - return UNESCAPED_TEXT.has(tn) || (scriptingEnabled && tn === TAG_NAMES.NOSCRIPT); -} diff --git a/node_modules/parse5/dist/cjs/common/token.d.ts b/node_modules/parse5/dist/cjs/common/token.d.ts deleted file mode 100644 index 9bcc7dc..0000000 --- a/node_modules/parse5/dist/cjs/common/token.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { TAG_ID } from './html.js'; -export declare enum TokenType { - CHARACTER = 0, - NULL_CHARACTER = 1, - WHITESPACE_CHARACTER = 2, - START_TAG = 3, - END_TAG = 4, - COMMENT = 5, - DOCTYPE = 6, - EOF = 7, - HIBERNATION = 8 -} -export interface Location { - /** One-based line index of the first character. */ - startLine: number; - /** One-based column index of the first character. */ - startCol: number; - /** Zero-based first character index. */ - startOffset: number; - /** One-based line index of the last character. */ - endLine: number; - /** One-based column index of the last character. Points directly *after* the last character. */ - endCol: number; - /** Zero-based last character index. Points directly *after* the last character. */ - endOffset: number; -} -export interface LocationWithAttributes extends Location { - /** Start tag attributes' location info. */ - attrs?: Record; -} -export interface ElementLocation extends LocationWithAttributes { - /** Element's start tag location info. */ - startTag?: Location; - /** - * Element's end tag location info. - * This property is undefined, if the element has no closing tag. - */ - endTag?: Location; -} -interface TokenBase { - readonly type: TokenType; - location: Location | null; -} -export interface DoctypeToken extends TokenBase { - readonly type: TokenType.DOCTYPE; - name: string | null; - forceQuirks: boolean; - publicId: string | null; - systemId: string | null; -} -export interface Attribute { - /** The name of the attribute. */ - name: string; - /** The namespace of the attribute. */ - namespace?: string; - /** The namespace-related prefix of the attribute. */ - prefix?: string; - /** The value of the attribute. */ - value: string; -} -export interface TagToken extends TokenBase { - readonly type: TokenType.START_TAG | TokenType.END_TAG; - tagName: string; - /** Used to cache the ID of the tag name. */ - tagID: TAG_ID; - selfClosing: boolean; - ackSelfClosing: boolean; - attrs: Attribute[]; - location: LocationWithAttributes | null; -} -export declare function getTokenAttr(token: TagToken, attrName: string): string | null; -export interface CommentToken extends TokenBase { - readonly type: TokenType.COMMENT; - data: string; -} -export interface EOFToken extends TokenBase { - readonly type: TokenType.EOF; -} -export interface CharacterToken extends TokenBase { - type: TokenType.CHARACTER | TokenType.NULL_CHARACTER | TokenType.WHITESPACE_CHARACTER; - chars: string; -} -export type Token = DoctypeToken | TagToken | CommentToken | EOFToken | CharacterToken; -export {}; diff --git a/node_modules/parse5/dist/cjs/common/token.js b/node_modules/parse5/dist/cjs/common/token.js deleted file mode 100644 index a46f0f2..0000000 --- a/node_modules/parse5/dist/cjs/common/token.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TokenType = void 0; -exports.getTokenAttr = getTokenAttr; -var TokenType; -(function (TokenType) { - TokenType[TokenType["CHARACTER"] = 0] = "CHARACTER"; - TokenType[TokenType["NULL_CHARACTER"] = 1] = "NULL_CHARACTER"; - TokenType[TokenType["WHITESPACE_CHARACTER"] = 2] = "WHITESPACE_CHARACTER"; - TokenType[TokenType["START_TAG"] = 3] = "START_TAG"; - TokenType[TokenType["END_TAG"] = 4] = "END_TAG"; - TokenType[TokenType["COMMENT"] = 5] = "COMMENT"; - TokenType[TokenType["DOCTYPE"] = 6] = "DOCTYPE"; - TokenType[TokenType["EOF"] = 7] = "EOF"; - TokenType[TokenType["HIBERNATION"] = 8] = "HIBERNATION"; -})(TokenType || (exports.TokenType = TokenType = {})); -function getTokenAttr(token, attrName) { - for (let i = token.attrs.length - 1; i >= 0; i--) { - if (token.attrs[i].name === attrName) { - return token.attrs[i].value; - } - } - return null; -} diff --git a/node_modules/parse5/dist/cjs/common/unicode.d.ts b/node_modules/parse5/dist/cjs/common/unicode.d.ts deleted file mode 100644 index 63eda8b..0000000 --- a/node_modules/parse5/dist/cjs/common/unicode.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export declare const REPLACEMENT_CHARACTER = "\uFFFD"; -export declare enum CODE_POINTS { - EOF = -1, - NULL = 0, - TABULATION = 9, - CARRIAGE_RETURN = 13, - LINE_FEED = 10, - FORM_FEED = 12, - SPACE = 32, - EXCLAMATION_MARK = 33, - QUOTATION_MARK = 34, - AMPERSAND = 38, - APOSTROPHE = 39, - HYPHEN_MINUS = 45, - SOLIDUS = 47, - DIGIT_0 = 48, - DIGIT_9 = 57, - SEMICOLON = 59, - LESS_THAN_SIGN = 60, - EQUALS_SIGN = 61, - GREATER_THAN_SIGN = 62, - QUESTION_MARK = 63, - LATIN_CAPITAL_A = 65, - LATIN_CAPITAL_Z = 90, - RIGHT_SQUARE_BRACKET = 93, - GRAVE_ACCENT = 96, - LATIN_SMALL_A = 97, - LATIN_SMALL_Z = 122 -} -export declare const SEQUENCES: { - DASH_DASH: string; - CDATA_START: string; - DOCTYPE: string; - SCRIPT: string; - PUBLIC: string; - SYSTEM: string; -}; -export declare function isSurrogate(cp: number): boolean; -export declare function isSurrogatePair(cp: number): boolean; -export declare function getSurrogatePairCodePoint(cp1: number, cp2: number): number; -export declare function isControlCodePoint(cp: number): boolean; -export declare function isUndefinedCodePoint(cp: number): boolean; diff --git a/node_modules/parse5/dist/cjs/common/unicode.js b/node_modules/parse5/dist/cjs/common/unicode.js deleted file mode 100644 index a2b317f..0000000 --- a/node_modules/parse5/dist/cjs/common/unicode.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SEQUENCES = exports.CODE_POINTS = exports.REPLACEMENT_CHARACTER = void 0; -exports.isSurrogate = isSurrogate; -exports.isSurrogatePair = isSurrogatePair; -exports.getSurrogatePairCodePoint = getSurrogatePairCodePoint; -exports.isControlCodePoint = isControlCodePoint; -exports.isUndefinedCodePoint = isUndefinedCodePoint; -const UNDEFINED_CODE_POINTS = new Set([ - 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, - 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, - 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, - 1048575, 1114110, 1114111, -]); -exports.REPLACEMENT_CHARACTER = '\uFFFD'; -var CODE_POINTS; -(function (CODE_POINTS) { - CODE_POINTS[CODE_POINTS["EOF"] = -1] = "EOF"; - CODE_POINTS[CODE_POINTS["NULL"] = 0] = "NULL"; - CODE_POINTS[CODE_POINTS["TABULATION"] = 9] = "TABULATION"; - CODE_POINTS[CODE_POINTS["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN"; - CODE_POINTS[CODE_POINTS["LINE_FEED"] = 10] = "LINE_FEED"; - CODE_POINTS[CODE_POINTS["FORM_FEED"] = 12] = "FORM_FEED"; - CODE_POINTS[CODE_POINTS["SPACE"] = 32] = "SPACE"; - CODE_POINTS[CODE_POINTS["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK"; - CODE_POINTS[CODE_POINTS["QUOTATION_MARK"] = 34] = "QUOTATION_MARK"; - CODE_POINTS[CODE_POINTS["AMPERSAND"] = 38] = "AMPERSAND"; - CODE_POINTS[CODE_POINTS["APOSTROPHE"] = 39] = "APOSTROPHE"; - CODE_POINTS[CODE_POINTS["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS"; - CODE_POINTS[CODE_POINTS["SOLIDUS"] = 47] = "SOLIDUS"; - CODE_POINTS[CODE_POINTS["DIGIT_0"] = 48] = "DIGIT_0"; - CODE_POINTS[CODE_POINTS["DIGIT_9"] = 57] = "DIGIT_9"; - CODE_POINTS[CODE_POINTS["SEMICOLON"] = 59] = "SEMICOLON"; - CODE_POINTS[CODE_POINTS["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN"; - CODE_POINTS[CODE_POINTS["EQUALS_SIGN"] = 61] = "EQUALS_SIGN"; - CODE_POINTS[CODE_POINTS["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN"; - CODE_POINTS[CODE_POINTS["QUESTION_MARK"] = 63] = "QUESTION_MARK"; - CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_A"] = 65] = "LATIN_CAPITAL_A"; - CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_Z"] = 90] = "LATIN_CAPITAL_Z"; - CODE_POINTS[CODE_POINTS["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET"; - CODE_POINTS[CODE_POINTS["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT"; - CODE_POINTS[CODE_POINTS["LATIN_SMALL_A"] = 97] = "LATIN_SMALL_A"; - CODE_POINTS[CODE_POINTS["LATIN_SMALL_Z"] = 122] = "LATIN_SMALL_Z"; -})(CODE_POINTS || (exports.CODE_POINTS = CODE_POINTS = {})); -exports.SEQUENCES = { - DASH_DASH: '--', - CDATA_START: '[CDATA[', - DOCTYPE: 'doctype', - SCRIPT: 'script', - PUBLIC: 'public', - SYSTEM: 'system', -}; -//Surrogates -function isSurrogate(cp) { - return cp >= 55296 && cp <= 57343; -} -function isSurrogatePair(cp) { - return cp >= 56320 && cp <= 57343; -} -function getSurrogatePairCodePoint(cp1, cp2) { - return (cp1 - 55296) * 1024 + 9216 + cp2; -} -//NOTE: excluding NULL and ASCII whitespace -function isControlCodePoint(cp) { - return ((cp !== 0x20 && cp !== 0x0a && cp !== 0x0d && cp !== 0x09 && cp !== 0x0c && cp >= 0x01 && cp <= 0x1f) || - (cp >= 0x7f && cp <= 0x9f)); -} -function isUndefinedCodePoint(cp) { - return (cp >= 64976 && cp <= 65007) || UNDEFINED_CODE_POINTS.has(cp); -} diff --git a/node_modules/parse5/dist/cjs/index.d.ts b/node_modules/parse5/dist/cjs/index.d.ts deleted file mode 100644 index 25540bd..0000000 --- a/node_modules/parse5/dist/cjs/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { type ParserOptions } from './parser/index.js'; -import type { DefaultTreeAdapterMap } from './tree-adapters/default.js'; -import type { TreeAdapterTypeMap } from './tree-adapters/interface.js'; -export { type DefaultTreeAdapterMap, defaultTreeAdapter } from './tree-adapters/default.js'; -import type * as DefaultTreeAdapter from './tree-adapters/default.js'; -export declare namespace DefaultTreeAdapterTypes { - type Document = DefaultTreeAdapter.Document; - type DocumentFragment = DefaultTreeAdapter.DocumentFragment; - type Element = DefaultTreeAdapter.Element; - type CommentNode = DefaultTreeAdapter.CommentNode; - type TextNode = DefaultTreeAdapter.TextNode; - type Template = DefaultTreeAdapter.Template; - type DocumentType = DefaultTreeAdapter.DocumentType; - type ParentNode = DefaultTreeAdapter.ParentNode; - type ChildNode = DefaultTreeAdapter.ChildNode; - type Node = DefaultTreeAdapter.Node; - type DefaultTreeAdapterMap = DefaultTreeAdapter.DefaultTreeAdapterMap; -} -export type { TreeAdapter, TreeAdapterTypeMap } from './tree-adapters/interface.js'; -export { type ParserOptions, /** @internal */ Parser } from './parser/index.js'; -export { serialize, serializeOuter, type SerializerOptions } from './serializer/index.js'; -export { ERR as ErrorCodes, type ParserError, type ParserErrorHandler } from './common/error-codes.js'; -/** @internal */ -export * as foreignContent from './common/foreign-content.js'; -export * as html from './common/html.js'; -export * as Token from './common/token.js'; -/** @internal */ -export { Tokenizer, type TokenizerOptions, TokenizerMode, type TokenHandler } from './tokenizer/index.js'; -/** - * Parses an HTML string. - * - * @param html Input HTML string. - * @param options Parsing options. - * @returns Document - * - * @example - * - * ```js - * const parse5 = require('parse5'); - * - * const document = parse5.parse('Hi there!'); - * - * console.log(document.childNodes[1].tagName); //> 'html' - *``` - */ -export declare function parse(html: string, options?: ParserOptions): T['document']; -/** - * Parses an HTML fragment. - * - * @example - * - * ```js - * const parse5 = require('parse5'); - * - * const documentFragment = parse5.parseFragment('
    '); - * - * console.log(documentFragment.childNodes[0].tagName); //> 'table' - * - * // Parses the html fragment in the context of the parsed element. - * const trFragment = parse5.parseFragment(documentFragment.childNodes[0], ''); - * - * console.log(trFragment.childNodes[0].childNodes[0].tagName); //> 'td' - * ``` - * - * @param fragmentContext Parsing context element. If specified, given fragment will be parsed as if it was set to the context element's `innerHTML` property. - * @param html Input HTML fragment string. - * @param options Parsing options. - * @returns DocumentFragment - */ -export declare function parseFragment(fragmentContext: T['parentNode'] | null, html: string, options: ParserOptions): T['documentFragment']; -export declare function parseFragment(html: string, options?: ParserOptions): T['documentFragment']; diff --git a/node_modules/parse5/dist/cjs/index.js b/node_modules/parse5/dist/cjs/index.js deleted file mode 100644 index 0032389..0000000 --- a/node_modules/parse5/dist/cjs/index.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TokenizerMode = exports.Tokenizer = exports.Token = exports.html = exports.foreignContent = exports.ErrorCodes = exports.serializeOuter = exports.serialize = exports.Parser = exports.defaultTreeAdapter = void 0; -exports.parse = parse; -exports.parseFragment = parseFragment; -const index_js_1 = require("./parser/index.js"); -var default_js_1 = require("./tree-adapters/default.js"); -Object.defineProperty(exports, "defaultTreeAdapter", { enumerable: true, get: function () { return default_js_1.defaultTreeAdapter; } }); -var index_js_2 = require("./parser/index.js"); -Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return index_js_2.Parser; } }); -var index_js_3 = require("./serializer/index.js"); -Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return index_js_3.serialize; } }); -Object.defineProperty(exports, "serializeOuter", { enumerable: true, get: function () { return index_js_3.serializeOuter; } }); -var error_codes_js_1 = require("./common/error-codes.js"); -Object.defineProperty(exports, "ErrorCodes", { enumerable: true, get: function () { return error_codes_js_1.ERR; } }); -/** @internal */ -exports.foreignContent = require("./common/foreign-content.js"); -exports.html = require("./common/html.js"); -exports.Token = require("./common/token.js"); -/** @internal */ -var index_js_4 = require("./tokenizer/index.js"); -Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return index_js_4.Tokenizer; } }); -Object.defineProperty(exports, "TokenizerMode", { enumerable: true, get: function () { return index_js_4.TokenizerMode; } }); -// Shorthands -/** - * Parses an HTML string. - * - * @param html Input HTML string. - * @param options Parsing options. - * @returns Document - * - * @example - * - * ```js - * const parse5 = require('parse5'); - * - * const document = parse5.parse('Hi there!'); - * - * console.log(document.childNodes[1].tagName); //> 'html' - *``` - */ -function parse(html, options) { - return index_js_1.Parser.parse(html, options); -} -function parseFragment(fragmentContext, html, options) { - if (typeof fragmentContext === 'string') { - options = html; - html = fragmentContext; - fragmentContext = null; - } - const parser = index_js_1.Parser.getFragmentParser(fragmentContext, options); - parser.tokenizer.write(html, true); - return parser.getFragment(); -} diff --git a/node_modules/parse5/dist/cjs/package.json b/node_modules/parse5/dist/cjs/package.json deleted file mode 100644 index 729ac4d..0000000 --- a/node_modules/parse5/dist/cjs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"commonjs"} diff --git a/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts b/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts deleted file mode 100644 index 1d421b6..0000000 --- a/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { TagToken } from '../common/token.js'; -import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface.js'; -export declare enum EntryType { - Marker = 0, - Element = 1 -} -interface MarkerEntry { - type: EntryType.Marker; -} -export interface ElementEntry { - type: EntryType.Element; - element: T['element']; - token: TagToken; -} -export type Entry = MarkerEntry | ElementEntry; -export declare class FormattingElementList { - private treeAdapter; - entries: Entry[]; - bookmark: Entry | null; - constructor(treeAdapter: TreeAdapter); - private _getNoahArkConditionCandidates; - private _ensureNoahArkCondition; - insertMarker(): void; - pushElement(element: T['element'], token: TagToken): void; - insertElementAfterBookmark(element: T['element'], token: TagToken): void; - removeEntry(entry: Entry): void; - /** - * Clears the list of formatting elements up to the last marker. - * - * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker - */ - clearToLastMarker(): void; - getElementEntryInScopeWithTagName(tagName: string): ElementEntry | null; - getElementEntry(element: T['element']): ElementEntry | undefined; -} -export {}; diff --git a/node_modules/parse5/dist/cjs/parser/formatting-element-list.js b/node_modules/parse5/dist/cjs/parser/formatting-element-list.js deleted file mode 100644 index ff087a5..0000000 --- a/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +++ /dev/null @@ -1,114 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormattingElementList = exports.EntryType = void 0; -//Const -const NOAH_ARK_CAPACITY = 3; -var EntryType; -(function (EntryType) { - EntryType[EntryType["Marker"] = 0] = "Marker"; - EntryType[EntryType["Element"] = 1] = "Element"; -})(EntryType || (exports.EntryType = EntryType = {})); -const MARKER = { type: EntryType.Marker }; -//List of formatting elements -class FormattingElementList { - constructor(treeAdapter) { - this.treeAdapter = treeAdapter; - this.entries = []; - this.bookmark = null; - } - //Noah Ark's condition - //OPTIMIZATION: at first we try to find possible candidates for exclusion using - //lightweight heuristics without thorough attributes check. - _getNoahArkConditionCandidates(newElement, neAttrs) { - const candidates = []; - const neAttrsLength = neAttrs.length; - const neTagName = this.treeAdapter.getTagName(newElement); - const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); - for (let i = 0; i < this.entries.length; i++) { - const entry = this.entries[i]; - if (entry.type === EntryType.Marker) { - break; - } - const { element } = entry; - if (this.treeAdapter.getTagName(element) === neTagName && - this.treeAdapter.getNamespaceURI(element) === neNamespaceURI) { - const elementAttrs = this.treeAdapter.getAttrList(element); - if (elementAttrs.length === neAttrsLength) { - candidates.push({ idx: i, attrs: elementAttrs }); - } - } - } - return candidates; - } - _ensureNoahArkCondition(newElement) { - if (this.entries.length < NOAH_ARK_CAPACITY) - return; - const neAttrs = this.treeAdapter.getAttrList(newElement); - const candidates = this._getNoahArkConditionCandidates(newElement, neAttrs); - if (candidates.length < NOAH_ARK_CAPACITY) - return; - //NOTE: build attrs map for the new element, so we can perform fast lookups - const neAttrsMap = new Map(neAttrs.map((neAttr) => [neAttr.name, neAttr.value])); - let validCandidates = 0; - //NOTE: remove bottommost candidates, until Noah's Ark condition will not be met - for (let i = 0; i < candidates.length; i++) { - const candidate = candidates[i]; - // We know that `candidate.attrs.length === neAttrs.length` - if (candidate.attrs.every((cAttr) => neAttrsMap.get(cAttr.name) === cAttr.value)) { - validCandidates += 1; - if (validCandidates >= NOAH_ARK_CAPACITY) { - this.entries.splice(candidate.idx, 1); - } - } - } - } - //Mutations - insertMarker() { - this.entries.unshift(MARKER); - } - pushElement(element, token) { - this._ensureNoahArkCondition(element); - this.entries.unshift({ - type: EntryType.Element, - element, - token, - }); - } - insertElementAfterBookmark(element, token) { - const bookmarkIdx = this.entries.indexOf(this.bookmark); - this.entries.splice(bookmarkIdx, 0, { - type: EntryType.Element, - element, - token, - }); - } - removeEntry(entry) { - const entryIndex = this.entries.indexOf(entry); - if (entryIndex >= 0) { - this.entries.splice(entryIndex, 1); - } - } - /** - * Clears the list of formatting elements up to the last marker. - * - * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker - */ - clearToLastMarker() { - const markerIdx = this.entries.indexOf(MARKER); - if (markerIdx >= 0) { - this.entries.splice(0, markerIdx + 1); - } - else { - this.entries.length = 0; - } - } - //Search - getElementEntryInScopeWithTagName(tagName) { - const entry = this.entries.find((entry) => entry.type === EntryType.Marker || this.treeAdapter.getTagName(entry.element) === tagName); - return entry && entry.type === EntryType.Element ? entry : null; - } - getElementEntry(element) { - return this.entries.find((entry) => entry.type === EntryType.Element && entry.element === element); - } -} -exports.FormattingElementList = FormattingElementList; diff --git a/node_modules/parse5/dist/cjs/parser/index.d.ts b/node_modules/parse5/dist/cjs/parser/index.d.ts deleted file mode 100644 index 07880e1..0000000 --- a/node_modules/parse5/dist/cjs/parser/index.d.ts +++ /dev/null @@ -1,221 +0,0 @@ -import { Tokenizer, TokenizerMode, type TokenHandler } from '../tokenizer/index.js'; -import { OpenElementStack, type StackHandler } from './open-element-stack.js'; -import { FormattingElementList } from './formatting-element-list.js'; -import { ERR, type ParserErrorHandler } from '../common/error-codes.js'; -import { TAG_ID as $, NS } from '../common/html.js'; -import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface.js'; -import { type Token, type CommentToken, type CharacterToken, type TagToken, type DoctypeToken, type EOFToken, type LocationWithAttributes } from '../common/token.js'; -declare enum InsertionMode { - INITIAL = 0, - BEFORE_HTML = 1, - BEFORE_HEAD = 2, - IN_HEAD = 3, - IN_HEAD_NO_SCRIPT = 4, - AFTER_HEAD = 5, - IN_BODY = 6, - TEXT = 7, - IN_TABLE = 8, - IN_TABLE_TEXT = 9, - IN_CAPTION = 10, - IN_COLUMN_GROUP = 11, - IN_TABLE_BODY = 12, - IN_ROW = 13, - IN_CELL = 14, - IN_SELECT = 15, - IN_SELECT_IN_TABLE = 16, - IN_TEMPLATE = 17, - AFTER_BODY = 18, - IN_FRAMESET = 19, - AFTER_FRAMESET = 20, - AFTER_AFTER_BODY = 21, - AFTER_AFTER_FRAMESET = 22 -} -export interface ParserOptions { - /** - * The [scripting flag](https://html.spec.whatwg.org/multipage/parsing.html#scripting-flag). If set - * to `true`, `noscript` element content will be parsed as text. - * - * @default `true` - */ - scriptingEnabled?: boolean; - /** - * Enables source code location information. When enabled, each node (except the root node) - * will have a `sourceCodeLocation` property. If the node is not an empty element, `sourceCodeLocation` will - * be a {@link ElementLocation} object, otherwise it will be {@link Location}. - * If the element was implicitly created by the parser (as part of - * [tree correction](https://html.spec.whatwg.org/multipage/syntax.html#an-introduction-to-error-handling-and-strange-cases-in-the-parser)), - * its `sourceCodeLocation` property will be `undefined`. - * - * @default `false` - */ - sourceCodeLocationInfo?: boolean; - /** - * Specifies the resulting tree format. - * - * @default `treeAdapters.default` - */ - treeAdapter?: TreeAdapter; - /** - * Callback for parse errors. - * - * @default `null` - */ - onParseError?: ParserErrorHandler | null; -} -export declare class Parser implements TokenHandler, StackHandler { - /** @internal */ - fragmentContext: T['element'] | null; - /** @internal */ - scriptHandler: null | ((pendingScript: T['element']) => void); - treeAdapter: TreeAdapter; - /** @internal */ - onParseError: ParserErrorHandler | null; - protected currentToken: Token | null; - options: Required>; - document: T['document']; - constructor(options?: ParserOptions, document?: T['document'], - /** @internal */ - fragmentContext?: T['element'] | null, - /** @internal */ - scriptHandler?: null | ((pendingScript: T['element']) => void)); - static parse(html: string, options?: ParserOptions): T['document']; - static getFragmentParser(fragmentContext?: T['parentNode'] | null, options?: ParserOptions): Parser; - getFragment(): T['documentFragment']; - tokenizer: Tokenizer; - stopped: boolean; - /** @internal */ - insertionMode: InsertionMode; - /** @internal */ - originalInsertionMode: InsertionMode; - /** @internal */ - fragmentContextID: $; - /** @internal */ - headElement: null | T['element']; - /** @internal */ - formElement: null | T['element']; - /** @internal */ - openElements: OpenElementStack; - /** @internal */ - activeFormattingElements: FormattingElementList; - /** Indicates that the current node is not an element in the HTML namespace */ - protected currentNotInHTML: boolean; - /** - * The template insertion mode stack is maintained from the left. - * Ie. the topmost element will always have index 0. - * - * @internal - */ - tmplInsertionModeStack: InsertionMode[]; - /** @internal */ - pendingCharacterTokens: CharacterToken[]; - /** @internal */ - hasNonWhitespacePendingCharacterToken: boolean; - /** @internal */ - framesetOk: boolean; - /** @internal */ - skipNextNewLine: boolean; - /** @internal */ - fosterParentingEnabled: boolean; - /** @internal */ - _err(token: Token, code: ERR, beforeToken?: boolean): void; - /** @internal */ - onItemPush(node: T['parentNode'], tid: number, isTop: boolean): void; - /** @internal */ - onItemPop(node: T['parentNode'], isTop: boolean): void; - protected _setContextModes(current: T['parentNode'], tid: number): void; - /** @protected */ - _switchToTextParsing(currentToken: TagToken, nextTokenizerState: (typeof TokenizerMode)[keyof typeof TokenizerMode]): void; - switchToPlaintextParsing(): void; - /** @protected */ - _getAdjustedCurrentElement(): T['element']; - /** @protected */ - _findFormInFragmentContext(): void; - protected _initTokenizerForFragmentParsing(): void; - /** @protected */ - _setDocumentType(token: DoctypeToken): void; - /** @protected */ - _attachElementToTree(element: T['element'], location: LocationWithAttributes | null): void; - /** - * For self-closing tags. Add an element to the tree, but skip adding it - * to the stack. - */ - /** @protected */ - _appendElement(token: TagToken, namespaceURI: NS): void; - /** @protected */ - _insertElement(token: TagToken, namespaceURI: NS): void; - /** @protected */ - _insertFakeElement(tagName: string, tagID: $): void; - /** @protected */ - _insertTemplate(token: TagToken): void; - /** @protected */ - _insertFakeRootElement(): void; - /** @protected */ - _appendCommentNode(token: CommentToken, parent: T['parentNode']): void; - /** @protected */ - _insertCharacters(token: CharacterToken): void; - /** @protected */ - _adoptNodes(donor: T['parentNode'], recipient: T['parentNode']): void; - /** @protected */ - _setEndLocation(element: T['element'], closingToken: Token): void; - protected shouldProcessStartTagTokenInForeignContent(token: TagToken): boolean; - /** @protected */ - _processToken(token: Token): void; - /** @protected */ - _isIntegrationPoint(tid: $, element: T['element'], foreignNS?: NS): boolean; - /** @protected */ - _reconstructActiveFormattingElements(): void; - /** @protected */ - _closeTableCell(): void; - /** @protected */ - _closePElement(): void; - /** @protected */ - _resetInsertionMode(): void; - /** @protected */ - _resetInsertionModeForSelect(selectIdx: number): void; - /** @protected */ - _isElementCausesFosterParenting(tn: $): boolean; - /** @protected */ - _shouldFosterParentOnInsertion(): boolean; - /** @protected */ - _findFosterParentingLocation(): { - parent: T['parentNode']; - beforeElement: T['element'] | null; - }; - /** @protected */ - _fosterParentElement(element: T['element']): void; - /** @protected */ - _isSpecialElement(element: T['element'], id: $): boolean; - /** @internal */ - onCharacter(token: CharacterToken): void; - /** @internal */ - onNullCharacter(token: CharacterToken): void; - /** @internal */ - onComment(token: CommentToken): void; - /** @internal */ - onDoctype(token: DoctypeToken): void; - /** @internal */ - onStartTag(token: TagToken): void; - /** - * Processes a given start tag. - * - * `onStartTag` checks if a self-closing tag was recognized. When a token - * is moved inbetween multiple insertion modes, this check for self-closing - * could lead to false positives. To avoid this, `_processStartTag` is used - * for nested calls. - * - * @param token The token to process. - * @protected - */ - _processStartTag(token: TagToken): void; - /** @protected */ - _startTagOutsideForeignContent(token: TagToken): void; - /** @internal */ - onEndTag(token: TagToken): void; - /** @protected */ - _endTagOutsideForeignContent(token: TagToken): void; - /** @internal */ - onEof(token: EOFToken): void; - /** @internal */ - onWhitespaceCharacter(token: CharacterToken): void; -} -export {}; diff --git a/node_modules/parse5/dist/cjs/parser/index.js b/node_modules/parse5/dist/cjs/parser/index.js deleted file mode 100644 index 35efe74..0000000 --- a/node_modules/parse5/dist/cjs/parser/index.js +++ /dev/null @@ -1,3235 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Parser = void 0; -const index_js_1 = require("../tokenizer/index.js"); -const open_element_stack_js_1 = require("./open-element-stack.js"); -const formatting_element_list_js_1 = require("./formatting-element-list.js"); -const default_js_1 = require("../tree-adapters/default.js"); -const doctype = require("../common/doctype.js"); -const foreignContent = require("../common/foreign-content.js"); -const error_codes_js_1 = require("../common/error-codes.js"); -const unicode = require("../common/unicode.js"); -const html_js_1 = require("../common/html.js"); -const token_js_1 = require("../common/token.js"); -//Misc constants -const HIDDEN_INPUT_TYPE = 'hidden'; -//Adoption agency loops iteration count -const AA_OUTER_LOOP_ITER = 8; -const AA_INNER_LOOP_ITER = 3; -//Insertion modes -var InsertionMode; -(function (InsertionMode) { - InsertionMode[InsertionMode["INITIAL"] = 0] = "INITIAL"; - InsertionMode[InsertionMode["BEFORE_HTML"] = 1] = "BEFORE_HTML"; - InsertionMode[InsertionMode["BEFORE_HEAD"] = 2] = "BEFORE_HEAD"; - InsertionMode[InsertionMode["IN_HEAD"] = 3] = "IN_HEAD"; - InsertionMode[InsertionMode["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT"; - InsertionMode[InsertionMode["AFTER_HEAD"] = 5] = "AFTER_HEAD"; - InsertionMode[InsertionMode["IN_BODY"] = 6] = "IN_BODY"; - InsertionMode[InsertionMode["TEXT"] = 7] = "TEXT"; - InsertionMode[InsertionMode["IN_TABLE"] = 8] = "IN_TABLE"; - InsertionMode[InsertionMode["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT"; - InsertionMode[InsertionMode["IN_CAPTION"] = 10] = "IN_CAPTION"; - InsertionMode[InsertionMode["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP"; - InsertionMode[InsertionMode["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY"; - InsertionMode[InsertionMode["IN_ROW"] = 13] = "IN_ROW"; - InsertionMode[InsertionMode["IN_CELL"] = 14] = "IN_CELL"; - InsertionMode[InsertionMode["IN_SELECT"] = 15] = "IN_SELECT"; - InsertionMode[InsertionMode["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE"; - InsertionMode[InsertionMode["IN_TEMPLATE"] = 17] = "IN_TEMPLATE"; - InsertionMode[InsertionMode["AFTER_BODY"] = 18] = "AFTER_BODY"; - InsertionMode[InsertionMode["IN_FRAMESET"] = 19] = "IN_FRAMESET"; - InsertionMode[InsertionMode["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET"; - InsertionMode[InsertionMode["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY"; - InsertionMode[InsertionMode["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET"; -})(InsertionMode || (InsertionMode = {})); -const BASE_LOC = { - startLine: -1, - startCol: -1, - startOffset: -1, - endLine: -1, - endCol: -1, - endOffset: -1, -}; -const TABLE_STRUCTURE_TAGS = new Set([html_js_1.TAG_ID.TABLE, html_js_1.TAG_ID.TBODY, html_js_1.TAG_ID.TFOOT, html_js_1.TAG_ID.THEAD, html_js_1.TAG_ID.TR]); -const defaultParserOptions = { - scriptingEnabled: true, - sourceCodeLocationInfo: false, - treeAdapter: default_js_1.defaultTreeAdapter, - onParseError: null, -}; -//Parser -class Parser { - constructor(options, document, - /** @internal */ - fragmentContext = null, - /** @internal */ - scriptHandler = null) { - this.fragmentContext = fragmentContext; - this.scriptHandler = scriptHandler; - this.currentToken = null; - this.stopped = false; - /** @internal */ - this.insertionMode = InsertionMode.INITIAL; - /** @internal */ - this.originalInsertionMode = InsertionMode.INITIAL; - /** @internal */ - this.headElement = null; - /** @internal */ - this.formElement = null; - /** Indicates that the current node is not an element in the HTML namespace */ - this.currentNotInHTML = false; - /** - * The template insertion mode stack is maintained from the left. - * Ie. the topmost element will always have index 0. - * - * @internal - */ - this.tmplInsertionModeStack = []; - /** @internal */ - this.pendingCharacterTokens = []; - /** @internal */ - this.hasNonWhitespacePendingCharacterToken = false; - /** @internal */ - this.framesetOk = true; - /** @internal */ - this.skipNextNewLine = false; - /** @internal */ - this.fosterParentingEnabled = false; - this.options = Object.assign(Object.assign({}, defaultParserOptions), options); - this.treeAdapter = this.options.treeAdapter; - this.onParseError = this.options.onParseError; - // Always enable location info if we report parse errors. - if (this.onParseError) { - this.options.sourceCodeLocationInfo = true; - } - this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument(); - this.tokenizer = new index_js_1.Tokenizer(this.options, this); - this.activeFormattingElements = new formatting_element_list_js_1.FormattingElementList(this.treeAdapter); - this.fragmentContextID = fragmentContext ? (0, html_js_1.getTagID)(this.treeAdapter.getTagName(fragmentContext)) : html_js_1.TAG_ID.UNKNOWN; - this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID); - this.openElements = new open_element_stack_js_1.OpenElementStack(this.document, this.treeAdapter, this); - } - // API - static parse(html, options) { - const parser = new this(options); - parser.tokenizer.write(html, true); - return parser.document; - } - static getFragmentParser(fragmentContext, options) { - const opts = Object.assign(Object.assign({}, defaultParserOptions), options); - //NOTE: use a
    Shake it, baby