Spaces:
No application file
No application file
add up
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- index.html +1 -1
- trump-game/.DS_Store +0 -0
- trump-game/app.js +17 -0
- trump-game/node_modules/.bin/mime +1 -0
- trump-game/node_modules/.package-lock.json +755 -0
- trump-game/node_modules/accepts/HISTORY.md +243 -0
- trump-game/node_modules/accepts/LICENSE +23 -0
- trump-game/node_modules/accepts/README.md +140 -0
- trump-game/node_modules/accepts/index.js +238 -0
- trump-game/node_modules/accepts/package.json +47 -0
- trump-game/node_modules/array-flatten/LICENSE +21 -0
- trump-game/node_modules/array-flatten/README.md +43 -0
- trump-game/node_modules/array-flatten/array-flatten.js +64 -0
- trump-game/node_modules/array-flatten/package.json +39 -0
- trump-game/node_modules/body-parser/HISTORY.md +672 -0
- trump-game/node_modules/body-parser/LICENSE +23 -0
- trump-game/node_modules/body-parser/README.md +476 -0
- trump-game/node_modules/body-parser/SECURITY.md +25 -0
- trump-game/node_modules/body-parser/index.js +156 -0
- trump-game/node_modules/body-parser/lib/read.js +205 -0
- trump-game/node_modules/body-parser/lib/types/json.js +247 -0
- trump-game/node_modules/body-parser/lib/types/raw.js +101 -0
- trump-game/node_modules/body-parser/lib/types/text.js +121 -0
- trump-game/node_modules/body-parser/lib/types/urlencoded.js +307 -0
- trump-game/node_modules/body-parser/package.json +56 -0
- trump-game/node_modules/bytes/History.md +97 -0
- trump-game/node_modules/bytes/LICENSE +23 -0
- trump-game/node_modules/bytes/Readme.md +152 -0
- trump-game/node_modules/bytes/index.js +170 -0
- trump-game/node_modules/bytes/package.json +42 -0
- trump-game/node_modules/call-bind-apply-helpers/.eslintrc +16 -0
- trump-game/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- trump-game/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- trump-game/node_modules/call-bind-apply-helpers/CHANGELOG.md +23 -0
- trump-game/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- trump-game/node_modules/call-bind-apply-helpers/README.md +62 -0
- trump-game/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- trump-game/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- trump-game/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- trump-game/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- trump-game/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- trump-game/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- trump-game/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- trump-game/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- trump-game/node_modules/call-bind-apply-helpers/index.d.ts +46 -0
- trump-game/node_modules/call-bind-apply-helpers/index.js +15 -0
- trump-game/node_modules/call-bind-apply-helpers/package.json +85 -0
- trump-game/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- trump-game/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- trump-game/node_modules/call-bind-apply-helpers/test/index.js +63 -0
index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
<body>
|
| 8 |
<h1>Bienvenue</h1>
|
| 9 |
<ul>
|
| 10 |
-
<li><a href="./Mistral_hackathon_2025_MAP/">Aller au projet MAP</a></li>
|
| 11 |
<li><a href="autre_projet/">Aller à un autre projet</a></li>
|
| 12 |
</ul>
|
| 13 |
</body>
|
|
|
|
| 7 |
<body>
|
| 8 |
<h1>Bienvenue</h1>
|
| 9 |
<ul>
|
| 10 |
+
<li><a href="https://huggingface.co/spaces/remiD45/Mistral_hackathon_2025/Mistral_hackathon_2025_MAP/">Aller au projet MAP</a></li>
|
| 11 |
<li><a href="autre_projet/">Aller à un autre projet</a></li>
|
| 12 |
</ul>
|
| 13 |
</body>
|
trump-game/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
trump-game/app.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const app = express();
|
| 3 |
+
const path = require('path');
|
| 4 |
+
|
| 5 |
+
// Servir les fichiers statiques
|
| 6 |
+
app.use(express.static(path.join(__dirname, 'public')));
|
| 7 |
+
|
| 8 |
+
// Route principale
|
| 9 |
+
app.get('/', (req, res) => {
|
| 10 |
+
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
// Démarrer le serveur
|
| 14 |
+
const PORT = 3000;
|
| 15 |
+
app.listen(PORT, () => {
|
| 16 |
+
console.log(`Serveur actif sur http://localhost:${PORT}`);
|
| 17 |
+
});
|
trump-game/node_modules/.bin/mime
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
../mime/cli.js
|
trump-game/node_modules/.package-lock.json
ADDED
|
@@ -0,0 +1,755 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
| 6 |
+
"node_modules/accepts": {
|
| 7 |
+
"version": "1.3.8",
|
| 8 |
+
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
| 9 |
+
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
|
| 10 |
+
"dependencies": {
|
| 11 |
+
"mime-types": "~2.1.34",
|
| 12 |
+
"negotiator": "0.6.3"
|
| 13 |
+
},
|
| 14 |
+
"engines": {
|
| 15 |
+
"node": ">= 0.6"
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"node_modules/array-flatten": {
|
| 19 |
+
"version": "1.1.1",
|
| 20 |
+
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
| 21 |
+
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
| 22 |
+
},
|
| 23 |
+
"node_modules/body-parser": {
|
| 24 |
+
"version": "1.20.3",
|
| 25 |
+
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
|
| 26 |
+
"integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
|
| 27 |
+
"dependencies": {
|
| 28 |
+
"bytes": "3.1.2",
|
| 29 |
+
"content-type": "~1.0.5",
|
| 30 |
+
"debug": "2.6.9",
|
| 31 |
+
"depd": "2.0.0",
|
| 32 |
+
"destroy": "1.2.0",
|
| 33 |
+
"http-errors": "2.0.0",
|
| 34 |
+
"iconv-lite": "0.4.24",
|
| 35 |
+
"on-finished": "2.4.1",
|
| 36 |
+
"qs": "6.13.0",
|
| 37 |
+
"raw-body": "2.5.2",
|
| 38 |
+
"type-is": "~1.6.18",
|
| 39 |
+
"unpipe": "1.0.0"
|
| 40 |
+
},
|
| 41 |
+
"engines": {
|
| 42 |
+
"node": ">= 0.8",
|
| 43 |
+
"npm": "1.2.8000 || >= 1.4.16"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"node_modules/bytes": {
|
| 47 |
+
"version": "3.1.2",
|
| 48 |
+
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
| 49 |
+
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
| 50 |
+
"engines": {
|
| 51 |
+
"node": ">= 0.8"
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"node_modules/call-bind-apply-helpers": {
|
| 55 |
+
"version": "1.0.1",
|
| 56 |
+
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz",
|
| 57 |
+
"integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==",
|
| 58 |
+
"dependencies": {
|
| 59 |
+
"es-errors": "^1.3.0",
|
| 60 |
+
"function-bind": "^1.1.2"
|
| 61 |
+
},
|
| 62 |
+
"engines": {
|
| 63 |
+
"node": ">= 0.4"
|
| 64 |
+
}
|
| 65 |
+
},
|
| 66 |
+
"node_modules/call-bound": {
|
| 67 |
+
"version": "1.0.3",
|
| 68 |
+
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz",
|
| 69 |
+
"integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==",
|
| 70 |
+
"dependencies": {
|
| 71 |
+
"call-bind-apply-helpers": "^1.0.1",
|
| 72 |
+
"get-intrinsic": "^1.2.6"
|
| 73 |
+
},
|
| 74 |
+
"engines": {
|
| 75 |
+
"node": ">= 0.4"
|
| 76 |
+
},
|
| 77 |
+
"funding": {
|
| 78 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
"node_modules/content-disposition": {
|
| 82 |
+
"version": "0.5.4",
|
| 83 |
+
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
| 84 |
+
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
|
| 85 |
+
"dependencies": {
|
| 86 |
+
"safe-buffer": "5.2.1"
|
| 87 |
+
},
|
| 88 |
+
"engines": {
|
| 89 |
+
"node": ">= 0.6"
|
| 90 |
+
}
|
| 91 |
+
},
|
| 92 |
+
"node_modules/content-type": {
|
| 93 |
+
"version": "1.0.5",
|
| 94 |
+
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
| 95 |
+
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
| 96 |
+
"engines": {
|
| 97 |
+
"node": ">= 0.6"
|
| 98 |
+
}
|
| 99 |
+
},
|
| 100 |
+
"node_modules/cookie": {
|
| 101 |
+
"version": "0.7.1",
|
| 102 |
+
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
|
| 103 |
+
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
|
| 104 |
+
"engines": {
|
| 105 |
+
"node": ">= 0.6"
|
| 106 |
+
}
|
| 107 |
+
},
|
| 108 |
+
"node_modules/cookie-signature": {
|
| 109 |
+
"version": "1.0.6",
|
| 110 |
+
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
| 111 |
+
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
|
| 112 |
+
},
|
| 113 |
+
"node_modules/debug": {
|
| 114 |
+
"version": "2.6.9",
|
| 115 |
+
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
| 116 |
+
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
| 117 |
+
"dependencies": {
|
| 118 |
+
"ms": "2.0.0"
|
| 119 |
+
}
|
| 120 |
+
},
|
| 121 |
+
"node_modules/depd": {
|
| 122 |
+
"version": "2.0.0",
|
| 123 |
+
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
| 124 |
+
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
| 125 |
+
"engines": {
|
| 126 |
+
"node": ">= 0.8"
|
| 127 |
+
}
|
| 128 |
+
},
|
| 129 |
+
"node_modules/destroy": {
|
| 130 |
+
"version": "1.2.0",
|
| 131 |
+
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
|
| 132 |
+
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
|
| 133 |
+
"engines": {
|
| 134 |
+
"node": ">= 0.8",
|
| 135 |
+
"npm": "1.2.8000 || >= 1.4.16"
|
| 136 |
+
}
|
| 137 |
+
},
|
| 138 |
+
"node_modules/dunder-proto": {
|
| 139 |
+
"version": "1.0.1",
|
| 140 |
+
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
| 141 |
+
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
| 142 |
+
"dependencies": {
|
| 143 |
+
"call-bind-apply-helpers": "^1.0.1",
|
| 144 |
+
"es-errors": "^1.3.0",
|
| 145 |
+
"gopd": "^1.2.0"
|
| 146 |
+
},
|
| 147 |
+
"engines": {
|
| 148 |
+
"node": ">= 0.4"
|
| 149 |
+
}
|
| 150 |
+
},
|
| 151 |
+
"node_modules/ee-first": {
|
| 152 |
+
"version": "1.1.1",
|
| 153 |
+
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
| 154 |
+
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
| 155 |
+
},
|
| 156 |
+
"node_modules/encodeurl": {
|
| 157 |
+
"version": "2.0.0",
|
| 158 |
+
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
| 159 |
+
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
| 160 |
+
"engines": {
|
| 161 |
+
"node": ">= 0.8"
|
| 162 |
+
}
|
| 163 |
+
},
|
| 164 |
+
"node_modules/es-define-property": {
|
| 165 |
+
"version": "1.0.1",
|
| 166 |
+
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
| 167 |
+
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
| 168 |
+
"engines": {
|
| 169 |
+
"node": ">= 0.4"
|
| 170 |
+
}
|
| 171 |
+
},
|
| 172 |
+
"node_modules/es-errors": {
|
| 173 |
+
"version": "1.3.0",
|
| 174 |
+
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
| 175 |
+
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
| 176 |
+
"engines": {
|
| 177 |
+
"node": ">= 0.4"
|
| 178 |
+
}
|
| 179 |
+
},
|
| 180 |
+
"node_modules/es-object-atoms": {
|
| 181 |
+
"version": "1.1.1",
|
| 182 |
+
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
| 183 |
+
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
| 184 |
+
"dependencies": {
|
| 185 |
+
"es-errors": "^1.3.0"
|
| 186 |
+
},
|
| 187 |
+
"engines": {
|
| 188 |
+
"node": ">= 0.4"
|
| 189 |
+
}
|
| 190 |
+
},
|
| 191 |
+
"node_modules/escape-html": {
|
| 192 |
+
"version": "1.0.3",
|
| 193 |
+
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
| 194 |
+
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
|
| 195 |
+
},
|
| 196 |
+
"node_modules/etag": {
|
| 197 |
+
"version": "1.8.1",
|
| 198 |
+
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
| 199 |
+
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
| 200 |
+
"engines": {
|
| 201 |
+
"node": ">= 0.6"
|
| 202 |
+
}
|
| 203 |
+
},
|
| 204 |
+
"node_modules/express": {
|
| 205 |
+
"version": "4.21.2",
|
| 206 |
+
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
| 207 |
+
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
| 208 |
+
"dependencies": {
|
| 209 |
+
"accepts": "~1.3.8",
|
| 210 |
+
"array-flatten": "1.1.1",
|
| 211 |
+
"body-parser": "1.20.3",
|
| 212 |
+
"content-disposition": "0.5.4",
|
| 213 |
+
"content-type": "~1.0.4",
|
| 214 |
+
"cookie": "0.7.1",
|
| 215 |
+
"cookie-signature": "1.0.6",
|
| 216 |
+
"debug": "2.6.9",
|
| 217 |
+
"depd": "2.0.0",
|
| 218 |
+
"encodeurl": "~2.0.0",
|
| 219 |
+
"escape-html": "~1.0.3",
|
| 220 |
+
"etag": "~1.8.1",
|
| 221 |
+
"finalhandler": "1.3.1",
|
| 222 |
+
"fresh": "0.5.2",
|
| 223 |
+
"http-errors": "2.0.0",
|
| 224 |
+
"merge-descriptors": "1.0.3",
|
| 225 |
+
"methods": "~1.1.2",
|
| 226 |
+
"on-finished": "2.4.1",
|
| 227 |
+
"parseurl": "~1.3.3",
|
| 228 |
+
"path-to-regexp": "0.1.12",
|
| 229 |
+
"proxy-addr": "~2.0.7",
|
| 230 |
+
"qs": "6.13.0",
|
| 231 |
+
"range-parser": "~1.2.1",
|
| 232 |
+
"safe-buffer": "5.2.1",
|
| 233 |
+
"send": "0.19.0",
|
| 234 |
+
"serve-static": "1.16.2",
|
| 235 |
+
"setprototypeof": "1.2.0",
|
| 236 |
+
"statuses": "2.0.1",
|
| 237 |
+
"type-is": "~1.6.18",
|
| 238 |
+
"utils-merge": "1.0.1",
|
| 239 |
+
"vary": "~1.1.2"
|
| 240 |
+
},
|
| 241 |
+
"engines": {
|
| 242 |
+
"node": ">= 0.10.0"
|
| 243 |
+
},
|
| 244 |
+
"funding": {
|
| 245 |
+
"type": "opencollective",
|
| 246 |
+
"url": "https://opencollective.com/express"
|
| 247 |
+
}
|
| 248 |
+
},
|
| 249 |
+
"node_modules/finalhandler": {
|
| 250 |
+
"version": "1.3.1",
|
| 251 |
+
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
|
| 252 |
+
"integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
|
| 253 |
+
"dependencies": {
|
| 254 |
+
"debug": "2.6.9",
|
| 255 |
+
"encodeurl": "~2.0.0",
|
| 256 |
+
"escape-html": "~1.0.3",
|
| 257 |
+
"on-finished": "2.4.1",
|
| 258 |
+
"parseurl": "~1.3.3",
|
| 259 |
+
"statuses": "2.0.1",
|
| 260 |
+
"unpipe": "~1.0.0"
|
| 261 |
+
},
|
| 262 |
+
"engines": {
|
| 263 |
+
"node": ">= 0.8"
|
| 264 |
+
}
|
| 265 |
+
},
|
| 266 |
+
"node_modules/forwarded": {
|
| 267 |
+
"version": "0.2.0",
|
| 268 |
+
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
| 269 |
+
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
| 270 |
+
"engines": {
|
| 271 |
+
"node": ">= 0.6"
|
| 272 |
+
}
|
| 273 |
+
},
|
| 274 |
+
"node_modules/fresh": {
|
| 275 |
+
"version": "0.5.2",
|
| 276 |
+
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
| 277 |
+
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
|
| 278 |
+
"engines": {
|
| 279 |
+
"node": ">= 0.6"
|
| 280 |
+
}
|
| 281 |
+
},
|
| 282 |
+
"node_modules/function-bind": {
|
| 283 |
+
"version": "1.1.2",
|
| 284 |
+
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
| 285 |
+
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
| 286 |
+
"funding": {
|
| 287 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 288 |
+
}
|
| 289 |
+
},
|
| 290 |
+
"node_modules/get-intrinsic": {
|
| 291 |
+
"version": "1.2.7",
|
| 292 |
+
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz",
|
| 293 |
+
"integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==",
|
| 294 |
+
"dependencies": {
|
| 295 |
+
"call-bind-apply-helpers": "^1.0.1",
|
| 296 |
+
"es-define-property": "^1.0.1",
|
| 297 |
+
"es-errors": "^1.3.0",
|
| 298 |
+
"es-object-atoms": "^1.0.0",
|
| 299 |
+
"function-bind": "^1.1.2",
|
| 300 |
+
"get-proto": "^1.0.0",
|
| 301 |
+
"gopd": "^1.2.0",
|
| 302 |
+
"has-symbols": "^1.1.0",
|
| 303 |
+
"hasown": "^2.0.2",
|
| 304 |
+
"math-intrinsics": "^1.1.0"
|
| 305 |
+
},
|
| 306 |
+
"engines": {
|
| 307 |
+
"node": ">= 0.4"
|
| 308 |
+
},
|
| 309 |
+
"funding": {
|
| 310 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 311 |
+
}
|
| 312 |
+
},
|
| 313 |
+
"node_modules/get-proto": {
|
| 314 |
+
"version": "1.0.1",
|
| 315 |
+
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
| 316 |
+
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
| 317 |
+
"dependencies": {
|
| 318 |
+
"dunder-proto": "^1.0.1",
|
| 319 |
+
"es-object-atoms": "^1.0.0"
|
| 320 |
+
},
|
| 321 |
+
"engines": {
|
| 322 |
+
"node": ">= 0.4"
|
| 323 |
+
}
|
| 324 |
+
},
|
| 325 |
+
"node_modules/gopd": {
|
| 326 |
+
"version": "1.2.0",
|
| 327 |
+
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
| 328 |
+
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
| 329 |
+
"engines": {
|
| 330 |
+
"node": ">= 0.4"
|
| 331 |
+
},
|
| 332 |
+
"funding": {
|
| 333 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 334 |
+
}
|
| 335 |
+
},
|
| 336 |
+
"node_modules/has-symbols": {
|
| 337 |
+
"version": "1.1.0",
|
| 338 |
+
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
| 339 |
+
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
| 340 |
+
"engines": {
|
| 341 |
+
"node": ">= 0.4"
|
| 342 |
+
},
|
| 343 |
+
"funding": {
|
| 344 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 345 |
+
}
|
| 346 |
+
},
|
| 347 |
+
"node_modules/hasown": {
|
| 348 |
+
"version": "2.0.2",
|
| 349 |
+
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
| 350 |
+
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
| 351 |
+
"dependencies": {
|
| 352 |
+
"function-bind": "^1.1.2"
|
| 353 |
+
},
|
| 354 |
+
"engines": {
|
| 355 |
+
"node": ">= 0.4"
|
| 356 |
+
}
|
| 357 |
+
},
|
| 358 |
+
"node_modules/http-errors": {
|
| 359 |
+
"version": "2.0.0",
|
| 360 |
+
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
| 361 |
+
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
| 362 |
+
"dependencies": {
|
| 363 |
+
"depd": "2.0.0",
|
| 364 |
+
"inherits": "2.0.4",
|
| 365 |
+
"setprototypeof": "1.2.0",
|
| 366 |
+
"statuses": "2.0.1",
|
| 367 |
+
"toidentifier": "1.0.1"
|
| 368 |
+
},
|
| 369 |
+
"engines": {
|
| 370 |
+
"node": ">= 0.8"
|
| 371 |
+
}
|
| 372 |
+
},
|
| 373 |
+
"node_modules/iconv-lite": {
|
| 374 |
+
"version": "0.4.24",
|
| 375 |
+
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
| 376 |
+
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
| 377 |
+
"dependencies": {
|
| 378 |
+
"safer-buffer": ">= 2.1.2 < 3"
|
| 379 |
+
},
|
| 380 |
+
"engines": {
|
| 381 |
+
"node": ">=0.10.0"
|
| 382 |
+
}
|
| 383 |
+
},
|
| 384 |
+
"node_modules/inherits": {
|
| 385 |
+
"version": "2.0.4",
|
| 386 |
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
| 387 |
+
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
| 388 |
+
},
|
| 389 |
+
"node_modules/ipaddr.js": {
|
| 390 |
+
"version": "1.9.1",
|
| 391 |
+
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
| 392 |
+
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
| 393 |
+
"engines": {
|
| 394 |
+
"node": ">= 0.10"
|
| 395 |
+
}
|
| 396 |
+
},
|
| 397 |
+
"node_modules/math-intrinsics": {
|
| 398 |
+
"version": "1.1.0",
|
| 399 |
+
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
| 400 |
+
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
| 401 |
+
"engines": {
|
| 402 |
+
"node": ">= 0.4"
|
| 403 |
+
}
|
| 404 |
+
},
|
| 405 |
+
"node_modules/media-typer": {
|
| 406 |
+
"version": "0.3.0",
|
| 407 |
+
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
| 408 |
+
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
|
| 409 |
+
"engines": {
|
| 410 |
+
"node": ">= 0.6"
|
| 411 |
+
}
|
| 412 |
+
},
|
| 413 |
+
"node_modules/merge-descriptors": {
|
| 414 |
+
"version": "1.0.3",
|
| 415 |
+
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
|
| 416 |
+
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
|
| 417 |
+
"funding": {
|
| 418 |
+
"url": "https://github.com/sponsors/sindresorhus"
|
| 419 |
+
}
|
| 420 |
+
},
|
| 421 |
+
"node_modules/methods": {
|
| 422 |
+
"version": "1.1.2",
|
| 423 |
+
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
| 424 |
+
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
|
| 425 |
+
"engines": {
|
| 426 |
+
"node": ">= 0.6"
|
| 427 |
+
}
|
| 428 |
+
},
|
| 429 |
+
"node_modules/mime": {
|
| 430 |
+
"version": "1.6.0",
|
| 431 |
+
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
| 432 |
+
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
| 433 |
+
"bin": {
|
| 434 |
+
"mime": "cli.js"
|
| 435 |
+
},
|
| 436 |
+
"engines": {
|
| 437 |
+
"node": ">=4"
|
| 438 |
+
}
|
| 439 |
+
},
|
| 440 |
+
"node_modules/mime-db": {
|
| 441 |
+
"version": "1.52.0",
|
| 442 |
+
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
| 443 |
+
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
| 444 |
+
"engines": {
|
| 445 |
+
"node": ">= 0.6"
|
| 446 |
+
}
|
| 447 |
+
},
|
| 448 |
+
"node_modules/mime-types": {
|
| 449 |
+
"version": "2.1.35",
|
| 450 |
+
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
| 451 |
+
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
| 452 |
+
"dependencies": {
|
| 453 |
+
"mime-db": "1.52.0"
|
| 454 |
+
},
|
| 455 |
+
"engines": {
|
| 456 |
+
"node": ">= 0.6"
|
| 457 |
+
}
|
| 458 |
+
},
|
| 459 |
+
"node_modules/ms": {
|
| 460 |
+
"version": "2.0.0",
|
| 461 |
+
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
| 462 |
+
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
| 463 |
+
},
|
| 464 |
+
"node_modules/negotiator": {
|
| 465 |
+
"version": "0.6.3",
|
| 466 |
+
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
|
| 467 |
+
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
|
| 468 |
+
"engines": {
|
| 469 |
+
"node": ">= 0.6"
|
| 470 |
+
}
|
| 471 |
+
},
|
| 472 |
+
"node_modules/object-inspect": {
|
| 473 |
+
"version": "1.13.3",
|
| 474 |
+
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz",
|
| 475 |
+
"integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==",
|
| 476 |
+
"engines": {
|
| 477 |
+
"node": ">= 0.4"
|
| 478 |
+
},
|
| 479 |
+
"funding": {
|
| 480 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 481 |
+
}
|
| 482 |
+
},
|
| 483 |
+
"node_modules/on-finished": {
|
| 484 |
+
"version": "2.4.1",
|
| 485 |
+
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
| 486 |
+
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
| 487 |
+
"dependencies": {
|
| 488 |
+
"ee-first": "1.1.1"
|
| 489 |
+
},
|
| 490 |
+
"engines": {
|
| 491 |
+
"node": ">= 0.8"
|
| 492 |
+
}
|
| 493 |
+
},
|
| 494 |
+
"node_modules/parseurl": {
|
| 495 |
+
"version": "1.3.3",
|
| 496 |
+
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
| 497 |
+
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
| 498 |
+
"engines": {
|
| 499 |
+
"node": ">= 0.8"
|
| 500 |
+
}
|
| 501 |
+
},
|
| 502 |
+
"node_modules/path-to-regexp": {
|
| 503 |
+
"version": "0.1.12",
|
| 504 |
+
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
| 505 |
+
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
|
| 506 |
+
},
|
| 507 |
+
"node_modules/proxy-addr": {
|
| 508 |
+
"version": "2.0.7",
|
| 509 |
+
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
| 510 |
+
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
| 511 |
+
"dependencies": {
|
| 512 |
+
"forwarded": "0.2.0",
|
| 513 |
+
"ipaddr.js": "1.9.1"
|
| 514 |
+
},
|
| 515 |
+
"engines": {
|
| 516 |
+
"node": ">= 0.10"
|
| 517 |
+
}
|
| 518 |
+
},
|
| 519 |
+
"node_modules/qs": {
|
| 520 |
+
"version": "6.13.0",
|
| 521 |
+
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
| 522 |
+
"integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
|
| 523 |
+
"dependencies": {
|
| 524 |
+
"side-channel": "^1.0.6"
|
| 525 |
+
},
|
| 526 |
+
"engines": {
|
| 527 |
+
"node": ">=0.6"
|
| 528 |
+
},
|
| 529 |
+
"funding": {
|
| 530 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 531 |
+
}
|
| 532 |
+
},
|
| 533 |
+
"node_modules/range-parser": {
|
| 534 |
+
"version": "1.2.1",
|
| 535 |
+
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
| 536 |
+
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
| 537 |
+
"engines": {
|
| 538 |
+
"node": ">= 0.6"
|
| 539 |
+
}
|
| 540 |
+
},
|
| 541 |
+
"node_modules/raw-body": {
|
| 542 |
+
"version": "2.5.2",
|
| 543 |
+
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
|
| 544 |
+
"integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
|
| 545 |
+
"dependencies": {
|
| 546 |
+
"bytes": "3.1.2",
|
| 547 |
+
"http-errors": "2.0.0",
|
| 548 |
+
"iconv-lite": "0.4.24",
|
| 549 |
+
"unpipe": "1.0.0"
|
| 550 |
+
},
|
| 551 |
+
"engines": {
|
| 552 |
+
"node": ">= 0.8"
|
| 553 |
+
}
|
| 554 |
+
},
|
| 555 |
+
"node_modules/safe-buffer": {
|
| 556 |
+
"version": "5.2.1",
|
| 557 |
+
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
| 558 |
+
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
| 559 |
+
"funding": [
|
| 560 |
+
{
|
| 561 |
+
"type": "github",
|
| 562 |
+
"url": "https://github.com/sponsors/feross"
|
| 563 |
+
},
|
| 564 |
+
{
|
| 565 |
+
"type": "patreon",
|
| 566 |
+
"url": "https://www.patreon.com/feross"
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "consulting",
|
| 570 |
+
"url": "https://feross.org/support"
|
| 571 |
+
}
|
| 572 |
+
]
|
| 573 |
+
},
|
| 574 |
+
"node_modules/safer-buffer": {
|
| 575 |
+
"version": "2.1.2",
|
| 576 |
+
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
| 577 |
+
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
| 578 |
+
},
|
| 579 |
+
"node_modules/send": {
|
| 580 |
+
"version": "0.19.0",
|
| 581 |
+
"resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
|
| 582 |
+
"integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
|
| 583 |
+
"dependencies": {
|
| 584 |
+
"debug": "2.6.9",
|
| 585 |
+
"depd": "2.0.0",
|
| 586 |
+
"destroy": "1.2.0",
|
| 587 |
+
"encodeurl": "~1.0.2",
|
| 588 |
+
"escape-html": "~1.0.3",
|
| 589 |
+
"etag": "~1.8.1",
|
| 590 |
+
"fresh": "0.5.2",
|
| 591 |
+
"http-errors": "2.0.0",
|
| 592 |
+
"mime": "1.6.0",
|
| 593 |
+
"ms": "2.1.3",
|
| 594 |
+
"on-finished": "2.4.1",
|
| 595 |
+
"range-parser": "~1.2.1",
|
| 596 |
+
"statuses": "2.0.1"
|
| 597 |
+
},
|
| 598 |
+
"engines": {
|
| 599 |
+
"node": ">= 0.8.0"
|
| 600 |
+
}
|
| 601 |
+
},
|
| 602 |
+
"node_modules/send/node_modules/encodeurl": {
|
| 603 |
+
"version": "1.0.2",
|
| 604 |
+
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
| 605 |
+
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
|
| 606 |
+
"engines": {
|
| 607 |
+
"node": ">= 0.8"
|
| 608 |
+
}
|
| 609 |
+
},
|
| 610 |
+
"node_modules/send/node_modules/ms": {
|
| 611 |
+
"version": "2.1.3",
|
| 612 |
+
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
| 613 |
+
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
| 614 |
+
},
|
| 615 |
+
"node_modules/serve-static": {
|
| 616 |
+
"version": "1.16.2",
|
| 617 |
+
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
|
| 618 |
+
"integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
|
| 619 |
+
"dependencies": {
|
| 620 |
+
"encodeurl": "~2.0.0",
|
| 621 |
+
"escape-html": "~1.0.3",
|
| 622 |
+
"parseurl": "~1.3.3",
|
| 623 |
+
"send": "0.19.0"
|
| 624 |
+
},
|
| 625 |
+
"engines": {
|
| 626 |
+
"node": ">= 0.8.0"
|
| 627 |
+
}
|
| 628 |
+
},
|
| 629 |
+
"node_modules/setprototypeof": {
|
| 630 |
+
"version": "1.2.0",
|
| 631 |
+
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
| 632 |
+
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
|
| 633 |
+
},
|
| 634 |
+
"node_modules/side-channel": {
|
| 635 |
+
"version": "1.1.0",
|
| 636 |
+
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
| 637 |
+
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
| 638 |
+
"dependencies": {
|
| 639 |
+
"es-errors": "^1.3.0",
|
| 640 |
+
"object-inspect": "^1.13.3",
|
| 641 |
+
"side-channel-list": "^1.0.0",
|
| 642 |
+
"side-channel-map": "^1.0.1",
|
| 643 |
+
"side-channel-weakmap": "^1.0.2"
|
| 644 |
+
},
|
| 645 |
+
"engines": {
|
| 646 |
+
"node": ">= 0.4"
|
| 647 |
+
},
|
| 648 |
+
"funding": {
|
| 649 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 650 |
+
}
|
| 651 |
+
},
|
| 652 |
+
"node_modules/side-channel-list": {
|
| 653 |
+
"version": "1.0.0",
|
| 654 |
+
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
| 655 |
+
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
| 656 |
+
"dependencies": {
|
| 657 |
+
"es-errors": "^1.3.0",
|
| 658 |
+
"object-inspect": "^1.13.3"
|
| 659 |
+
},
|
| 660 |
+
"engines": {
|
| 661 |
+
"node": ">= 0.4"
|
| 662 |
+
},
|
| 663 |
+
"funding": {
|
| 664 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 665 |
+
}
|
| 666 |
+
},
|
| 667 |
+
"node_modules/side-channel-map": {
|
| 668 |
+
"version": "1.0.1",
|
| 669 |
+
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
| 670 |
+
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
| 671 |
+
"dependencies": {
|
| 672 |
+
"call-bound": "^1.0.2",
|
| 673 |
+
"es-errors": "^1.3.0",
|
| 674 |
+
"get-intrinsic": "^1.2.5",
|
| 675 |
+
"object-inspect": "^1.13.3"
|
| 676 |
+
},
|
| 677 |
+
"engines": {
|
| 678 |
+
"node": ">= 0.4"
|
| 679 |
+
},
|
| 680 |
+
"funding": {
|
| 681 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 682 |
+
}
|
| 683 |
+
},
|
| 684 |
+
"node_modules/side-channel-weakmap": {
|
| 685 |
+
"version": "1.0.2",
|
| 686 |
+
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
| 687 |
+
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
| 688 |
+
"dependencies": {
|
| 689 |
+
"call-bound": "^1.0.2",
|
| 690 |
+
"es-errors": "^1.3.0",
|
| 691 |
+
"get-intrinsic": "^1.2.5",
|
| 692 |
+
"object-inspect": "^1.13.3",
|
| 693 |
+
"side-channel-map": "^1.0.1"
|
| 694 |
+
},
|
| 695 |
+
"engines": {
|
| 696 |
+
"node": ">= 0.4"
|
| 697 |
+
},
|
| 698 |
+
"funding": {
|
| 699 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 700 |
+
}
|
| 701 |
+
},
|
| 702 |
+
"node_modules/statuses": {
|
| 703 |
+
"version": "2.0.1",
|
| 704 |
+
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
|
| 705 |
+
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
| 706 |
+
"engines": {
|
| 707 |
+
"node": ">= 0.8"
|
| 708 |
+
}
|
| 709 |
+
},
|
| 710 |
+
"node_modules/toidentifier": {
|
| 711 |
+
"version": "1.0.1",
|
| 712 |
+
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
| 713 |
+
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
| 714 |
+
"engines": {
|
| 715 |
+
"node": ">=0.6"
|
| 716 |
+
}
|
| 717 |
+
},
|
| 718 |
+
"node_modules/type-is": {
|
| 719 |
+
"version": "1.6.18",
|
| 720 |
+
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
| 721 |
+
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
| 722 |
+
"dependencies": {
|
| 723 |
+
"media-typer": "0.3.0",
|
| 724 |
+
"mime-types": "~2.1.24"
|
| 725 |
+
},
|
| 726 |
+
"engines": {
|
| 727 |
+
"node": ">= 0.6"
|
| 728 |
+
}
|
| 729 |
+
},
|
| 730 |
+
"node_modules/unpipe": {
|
| 731 |
+
"version": "1.0.0",
|
| 732 |
+
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
| 733 |
+
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
| 734 |
+
"engines": {
|
| 735 |
+
"node": ">= 0.8"
|
| 736 |
+
}
|
| 737 |
+
},
|
| 738 |
+
"node_modules/utils-merge": {
|
| 739 |
+
"version": "1.0.1",
|
| 740 |
+
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
| 741 |
+
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
| 742 |
+
"engines": {
|
| 743 |
+
"node": ">= 0.4.0"
|
| 744 |
+
}
|
| 745 |
+
},
|
| 746 |
+
"node_modules/vary": {
|
| 747 |
+
"version": "1.1.2",
|
| 748 |
+
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
| 749 |
+
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
| 750 |
+
"engines": {
|
| 751 |
+
"node": ">= 0.8"
|
| 752 |
+
}
|
| 753 |
+
}
|
| 754 |
+
}
|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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1.3.8 / 2022-02-02
|
| 2 |
+
==================
|
| 3 |
+
|
| 4 |
+
* deps: mime-types@~2.1.34
|
| 5 |
+
- deps: mime-db@~1.51.0
|
| 6 |
+
* deps: negotiator@0.6.3
|
| 7 |
+
|
| 8 |
+
1.3.7 / 2019-04-29
|
| 9 |
+
==================
|
| 10 |
+
|
| 11 |
+
* deps: negotiator@0.6.2
|
| 12 |
+
- Fix sorting charset, encoding, and language with extra parameters
|
| 13 |
+
|
| 14 |
+
1.3.6 / 2019-04-28
|
| 15 |
+
==================
|
| 16 |
+
|
| 17 |
+
* deps: mime-types@~2.1.24
|
| 18 |
+
- deps: mime-db@~1.40.0
|
| 19 |
+
|
| 20 |
+
1.3.5 / 2018-02-28
|
| 21 |
+
==================
|
| 22 |
+
|
| 23 |
+
* deps: mime-types@~2.1.18
|
| 24 |
+
- deps: mime-db@~1.33.0
|
| 25 |
+
|
| 26 |
+
1.3.4 / 2017-08-22
|
| 27 |
+
==================
|
| 28 |
+
|
| 29 |
+
* deps: mime-types@~2.1.16
|
| 30 |
+
- deps: mime-db@~1.29.0
|
| 31 |
+
|
| 32 |
+
1.3.3 / 2016-05-02
|
| 33 |
+
==================
|
| 34 |
+
|
| 35 |
+
* deps: mime-types@~2.1.11
|
| 36 |
+
- deps: mime-db@~1.23.0
|
| 37 |
+
* deps: negotiator@0.6.1
|
| 38 |
+
- perf: improve `Accept` parsing speed
|
| 39 |
+
- perf: improve `Accept-Charset` parsing speed
|
| 40 |
+
- perf: improve `Accept-Encoding` parsing speed
|
| 41 |
+
- perf: improve `Accept-Language` parsing speed
|
| 42 |
+
|
| 43 |
+
1.3.2 / 2016-03-08
|
| 44 |
+
==================
|
| 45 |
+
|
| 46 |
+
* deps: mime-types@~2.1.10
|
| 47 |
+
- Fix extension of `application/dash+xml`
|
| 48 |
+
- Update primary extension for `audio/mp4`
|
| 49 |
+
- deps: mime-db@~1.22.0
|
| 50 |
+
|
| 51 |
+
1.3.1 / 2016-01-19
|
| 52 |
+
==================
|
| 53 |
+
|
| 54 |
+
* deps: mime-types@~2.1.9
|
| 55 |
+
- deps: mime-db@~1.21.0
|
| 56 |
+
|
| 57 |
+
1.3.0 / 2015-09-29
|
| 58 |
+
==================
|
| 59 |
+
|
| 60 |
+
* deps: mime-types@~2.1.7
|
| 61 |
+
- deps: mime-db@~1.19.0
|
| 62 |
+
* deps: negotiator@0.6.0
|
| 63 |
+
- Fix including type extensions in parameters in `Accept` parsing
|
| 64 |
+
- Fix parsing `Accept` parameters with quoted equals
|
| 65 |
+
- Fix parsing `Accept` parameters with quoted semicolons
|
| 66 |
+
- Lazy-load modules from main entry point
|
| 67 |
+
- perf: delay type concatenation until needed
|
| 68 |
+
- perf: enable strict mode
|
| 69 |
+
- perf: hoist regular expressions
|
| 70 |
+
- perf: remove closures getting spec properties
|
| 71 |
+
- perf: remove a closure from media type parsing
|
| 72 |
+
- perf: remove property delete from media type parsing
|
| 73 |
+
|
| 74 |
+
1.2.13 / 2015-09-06
|
| 75 |
+
===================
|
| 76 |
+
|
| 77 |
+
* deps: mime-types@~2.1.6
|
| 78 |
+
- deps: mime-db@~1.18.0
|
| 79 |
+
|
| 80 |
+
1.2.12 / 2015-07-30
|
| 81 |
+
===================
|
| 82 |
+
|
| 83 |
+
* deps: mime-types@~2.1.4
|
| 84 |
+
- deps: mime-db@~1.16.0
|
| 85 |
+
|
| 86 |
+
1.2.11 / 2015-07-16
|
| 87 |
+
===================
|
| 88 |
+
|
| 89 |
+
* deps: mime-types@~2.1.3
|
| 90 |
+
- deps: mime-db@~1.15.0
|
| 91 |
+
|
| 92 |
+
1.2.10 / 2015-07-01
|
| 93 |
+
===================
|
| 94 |
+
|
| 95 |
+
* deps: mime-types@~2.1.2
|
| 96 |
+
- deps: mime-db@~1.14.0
|
| 97 |
+
|
| 98 |
+
1.2.9 / 2015-06-08
|
| 99 |
+
==================
|
| 100 |
+
|
| 101 |
+
* deps: mime-types@~2.1.1
|
| 102 |
+
- perf: fix deopt during mapping
|
| 103 |
+
|
| 104 |
+
1.2.8 / 2015-06-07
|
| 105 |
+
==================
|
| 106 |
+
|
| 107 |
+
* deps: mime-types@~2.1.0
|
| 108 |
+
- deps: mime-db@~1.13.0
|
| 109 |
+
* perf: avoid argument reassignment & argument slice
|
| 110 |
+
* perf: avoid negotiator recursive construction
|
| 111 |
+
* perf: enable strict mode
|
| 112 |
+
* perf: remove unnecessary bitwise operator
|
| 113 |
+
|
| 114 |
+
1.2.7 / 2015-05-10
|
| 115 |
+
==================
|
| 116 |
+
|
| 117 |
+
* deps: negotiator@0.5.3
|
| 118 |
+
- Fix media type parameter matching to be case-insensitive
|
| 119 |
+
|
| 120 |
+
1.2.6 / 2015-05-07
|
| 121 |
+
==================
|
| 122 |
+
|
| 123 |
+
* deps: mime-types@~2.0.11
|
| 124 |
+
- deps: mime-db@~1.9.1
|
| 125 |
+
* deps: negotiator@0.5.2
|
| 126 |
+
- Fix comparing media types with quoted values
|
| 127 |
+
- Fix splitting media types with quoted commas
|
| 128 |
+
|
| 129 |
+
1.2.5 / 2015-03-13
|
| 130 |
+
==================
|
| 131 |
+
|
| 132 |
+
* deps: mime-types@~2.0.10
|
| 133 |
+
- deps: mime-db@~1.8.0
|
| 134 |
+
|
| 135 |
+
1.2.4 / 2015-02-14
|
| 136 |
+
==================
|
| 137 |
+
|
| 138 |
+
* Support Node.js 0.6
|
| 139 |
+
* deps: mime-types@~2.0.9
|
| 140 |
+
- deps: mime-db@~1.7.0
|
| 141 |
+
* deps: negotiator@0.5.1
|
| 142 |
+
- Fix preference sorting to be stable for long acceptable lists
|
| 143 |
+
|
| 144 |
+
1.2.3 / 2015-01-31
|
| 145 |
+
==================
|
| 146 |
+
|
| 147 |
+
* deps: mime-types@~2.0.8
|
| 148 |
+
- deps: mime-db@~1.6.0
|
| 149 |
+
|
| 150 |
+
1.2.2 / 2014-12-30
|
| 151 |
+
==================
|
| 152 |
+
|
| 153 |
+
* deps: mime-types@~2.0.7
|
| 154 |
+
- deps: mime-db@~1.5.0
|
| 155 |
+
|
| 156 |
+
1.2.1 / 2014-12-30
|
| 157 |
+
==================
|
| 158 |
+
|
| 159 |
+
* deps: mime-types@~2.0.5
|
| 160 |
+
- deps: mime-db@~1.3.1
|
| 161 |
+
|
| 162 |
+
1.2.0 / 2014-12-19
|
| 163 |
+
==================
|
| 164 |
+
|
| 165 |
+
* deps: negotiator@0.5.0
|
| 166 |
+
- Fix list return order when large accepted list
|
| 167 |
+
- Fix missing identity encoding when q=0 exists
|
| 168 |
+
- Remove dynamic building of Negotiator class
|
| 169 |
+
|
| 170 |
+
1.1.4 / 2014-12-10
|
| 171 |
+
==================
|
| 172 |
+
|
| 173 |
+
* deps: mime-types@~2.0.4
|
| 174 |
+
- deps: mime-db@~1.3.0
|
| 175 |
+
|
| 176 |
+
1.1.3 / 2014-11-09
|
| 177 |
+
==================
|
| 178 |
+
|
| 179 |
+
* deps: mime-types@~2.0.3
|
| 180 |
+
- deps: mime-db@~1.2.0
|
| 181 |
+
|
| 182 |
+
1.1.2 / 2014-10-14
|
| 183 |
+
==================
|
| 184 |
+
|
| 185 |
+
* deps: negotiator@0.4.9
|
| 186 |
+
- Fix error when media type has invalid parameter
|
| 187 |
+
|
| 188 |
+
1.1.1 / 2014-09-28
|
| 189 |
+
==================
|
| 190 |
+
|
| 191 |
+
* deps: mime-types@~2.0.2
|
| 192 |
+
- deps: mime-db@~1.1.0
|
| 193 |
+
* deps: negotiator@0.4.8
|
| 194 |
+
- Fix all negotiations to be case-insensitive
|
| 195 |
+
- Stable sort preferences of same quality according to client order
|
| 196 |
+
|
| 197 |
+
1.1.0 / 2014-09-02
|
| 198 |
+
==================
|
| 199 |
+
|
| 200 |
+
* update `mime-types`
|
| 201 |
+
|
| 202 |
+
1.0.7 / 2014-07-04
|
| 203 |
+
==================
|
| 204 |
+
|
| 205 |
+
* Fix wrong type returned from `type` when match after unknown extension
|
| 206 |
+
|
| 207 |
+
1.0.6 / 2014-06-24
|
| 208 |
+
==================
|
| 209 |
+
|
| 210 |
+
* deps: negotiator@0.4.7
|
| 211 |
+
|
| 212 |
+
1.0.5 / 2014-06-20
|
| 213 |
+
==================
|
| 214 |
+
|
| 215 |
+
* fix crash when unknown extension given
|
| 216 |
+
|
| 217 |
+
1.0.4 / 2014-06-19
|
| 218 |
+
==================
|
| 219 |
+
|
| 220 |
+
* use `mime-types`
|
| 221 |
+
|
| 222 |
+
1.0.3 / 2014-06-11
|
| 223 |
+
==================
|
| 224 |
+
|
| 225 |
+
* deps: negotiator@0.4.6
|
| 226 |
+
- Order by specificity when quality is the same
|
| 227 |
+
|
| 228 |
+
1.0.2 / 2014-05-29
|
| 229 |
+
==================
|
| 230 |
+
|
| 231 |
+
* Fix interpretation when header not in request
|
| 232 |
+
* deps: pin negotiator@0.4.5
|
| 233 |
+
|
| 234 |
+
1.0.1 / 2014-01-18
|
| 235 |
+
==================
|
| 236 |
+
|
| 237 |
+
* Identity encoding isn't always acceptable
|
| 238 |
+
* deps: negotiator@~0.4.0
|
| 239 |
+
|
| 240 |
+
1.0.0 / 2013-12-27
|
| 241 |
+
==================
|
| 242 |
+
|
| 243 |
+
* Genesis
|
trump-game/node_modules/accepts/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(The MIT License)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
| 4 |
+
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 7 |
+
a copy of this software and associated documentation files (the
|
| 8 |
+
'Software'), to deal in the Software without restriction, including
|
| 9 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 10 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 11 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 12 |
+
the following conditions:
|
| 13 |
+
|
| 14 |
+
The above copyright notice and this permission notice shall be
|
| 15 |
+
included in all copies or substantial portions of the Software.
|
| 16 |
+
|
| 17 |
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
| 18 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 19 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 20 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 21 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 22 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 23 |
+
SOFTWARE OR THE USE OR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node-version-image]][node-version-url]
|
| 6 |
+
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
|
| 7 |
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
| 8 |
+
|
| 9 |
+
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
|
| 10 |
+
Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
|
| 11 |
+
|
| 12 |
+
In addition to negotiator, it allows:
|
| 13 |
+
|
| 14 |
+
- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
|
| 15 |
+
as well as `('text/html', 'application/json')`.
|
| 16 |
+
- Allows type shorthands such as `json`.
|
| 17 |
+
- Returns `false` when no types match
|
| 18 |
+
- Treats non-existent headers as `*`
|
| 19 |
+
|
| 20 |
+
## Installation
|
| 21 |
+
|
| 22 |
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
| 23 |
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
| 24 |
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
| 25 |
+
|
| 26 |
+
```sh
|
| 27 |
+
$ npm install accepts
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## API
|
| 31 |
+
|
| 32 |
+
```js
|
| 33 |
+
var accepts = require('accepts')
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### accepts(req)
|
| 37 |
+
|
| 38 |
+
Create a new `Accepts` object for the given `req`.
|
| 39 |
+
|
| 40 |
+
#### .charset(charsets)
|
| 41 |
+
|
| 42 |
+
Return the first accepted charset. If nothing in `charsets` is accepted,
|
| 43 |
+
then `false` is returned.
|
| 44 |
+
|
| 45 |
+
#### .charsets()
|
| 46 |
+
|
| 47 |
+
Return the charsets that the request accepts, in the order of the client's
|
| 48 |
+
preference (most preferred first).
|
| 49 |
+
|
| 50 |
+
#### .encoding(encodings)
|
| 51 |
+
|
| 52 |
+
Return the first accepted encoding. If nothing in `encodings` is accepted,
|
| 53 |
+
then `false` is returned.
|
| 54 |
+
|
| 55 |
+
#### .encodings()
|
| 56 |
+
|
| 57 |
+
Return the encodings that the request accepts, in the order of the client's
|
| 58 |
+
preference (most preferred first).
|
| 59 |
+
|
| 60 |
+
#### .language(languages)
|
| 61 |
+
|
| 62 |
+
Return the first accepted language. If nothing in `languages` is accepted,
|
| 63 |
+
then `false` is returned.
|
| 64 |
+
|
| 65 |
+
#### .languages()
|
| 66 |
+
|
| 67 |
+
Return the languages that the request accepts, in the order of the client's
|
| 68 |
+
preference (most preferred first).
|
| 69 |
+
|
| 70 |
+
#### .type(types)
|
| 71 |
+
|
| 72 |
+
Return the first accepted type (and it is returned as the same text as what
|
| 73 |
+
appears in the `types` array). If nothing in `types` is accepted, then `false`
|
| 74 |
+
is returned.
|
| 75 |
+
|
| 76 |
+
The `types` array can contain full MIME types or file extensions. Any value
|
| 77 |
+
that is not a full MIME types is passed to `require('mime-types').lookup`.
|
| 78 |
+
|
| 79 |
+
#### .types()
|
| 80 |
+
|
| 81 |
+
Return the types that the request accepts, in the order of the client's
|
| 82 |
+
preference (most preferred first).
|
| 83 |
+
|
| 84 |
+
## Examples
|
| 85 |
+
|
| 86 |
+
### Simple type negotiation
|
| 87 |
+
|
| 88 |
+
This simple example shows how to use `accepts` to return a different typed
|
| 89 |
+
respond body based on what the client wants to accept. The server lists it's
|
| 90 |
+
preferences in order and will get back the best match between the client and
|
| 91 |
+
server.
|
| 92 |
+
|
| 93 |
+
```js
|
| 94 |
+
var accepts = require('accepts')
|
| 95 |
+
var http = require('http')
|
| 96 |
+
|
| 97 |
+
function app (req, res) {
|
| 98 |
+
var accept = accepts(req)
|
| 99 |
+
|
| 100 |
+
// the order of this list is significant; should be server preferred order
|
| 101 |
+
switch (accept.type(['json', 'html'])) {
|
| 102 |
+
case 'json':
|
| 103 |
+
res.setHeader('Content-Type', 'application/json')
|
| 104 |
+
res.write('{"hello":"world!"}')
|
| 105 |
+
break
|
| 106 |
+
case 'html':
|
| 107 |
+
res.setHeader('Content-Type', 'text/html')
|
| 108 |
+
res.write('<b>hello, world!</b>')
|
| 109 |
+
break
|
| 110 |
+
default:
|
| 111 |
+
// the fallback is text/plain, so no need to specify it above
|
| 112 |
+
res.setHeader('Content-Type', 'text/plain')
|
| 113 |
+
res.write('hello, world!')
|
| 114 |
+
break
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
res.end()
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
http.createServer(app).listen(3000)
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
You can test this out with the cURL program:
|
| 124 |
+
```sh
|
| 125 |
+
curl -I -H'Accept: text/html' http://localhost:3000/
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
## License
|
| 129 |
+
|
| 130 |
+
[MIT](LICENSE)
|
| 131 |
+
|
| 132 |
+
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
|
| 133 |
+
[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
|
| 134 |
+
[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci
|
| 135 |
+
[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml
|
| 136 |
+
[node-version-image]: https://badgen.net/npm/node/accepts
|
| 137 |
+
[node-version-url]: https://nodejs.org/en/download
|
| 138 |
+
[npm-downloads-image]: https://badgen.net/npm/dm/accepts
|
| 139 |
+
[npm-url]: https://npmjs.org/package/accepts
|
| 140 |
+
[npm-version-image]: https://badgen.net/npm/v/accepts
|
trump-game/node_modules/accepts/index.js
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* accepts
|
| 3 |
+
* Copyright(c) 2014 Jonathan Ong
|
| 4 |
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
| 5 |
+
* MIT Licensed
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
'use strict'
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Module dependencies.
|
| 12 |
+
* @private
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
var Negotiator = require('negotiator')
|
| 16 |
+
var mime = require('mime-types')
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* Module exports.
|
| 20 |
+
* @public
|
| 21 |
+
*/
|
| 22 |
+
|
| 23 |
+
module.exports = Accepts
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Create a new Accepts object for the given req.
|
| 27 |
+
*
|
| 28 |
+
* @param {object} req
|
| 29 |
+
* @public
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
function Accepts (req) {
|
| 33 |
+
if (!(this instanceof Accepts)) {
|
| 34 |
+
return new Accepts(req)
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
this.headers = req.headers
|
| 38 |
+
this.negotiator = new Negotiator(req)
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Check if the given `type(s)` is acceptable, returning
|
| 43 |
+
* the best match when true, otherwise `undefined`, in which
|
| 44 |
+
* case you should respond with 406 "Not Acceptable".
|
| 45 |
+
*
|
| 46 |
+
* The `type` value may be a single mime type string
|
| 47 |
+
* such as "application/json", the extension name
|
| 48 |
+
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
|
| 49 |
+
* or array is given the _best_ match, if any is returned.
|
| 50 |
+
*
|
| 51 |
+
* Examples:
|
| 52 |
+
*
|
| 53 |
+
* // Accept: text/html
|
| 54 |
+
* this.types('html');
|
| 55 |
+
* // => "html"
|
| 56 |
+
*
|
| 57 |
+
* // Accept: text/*, application/json
|
| 58 |
+
* this.types('html');
|
| 59 |
+
* // => "html"
|
| 60 |
+
* this.types('text/html');
|
| 61 |
+
* // => "text/html"
|
| 62 |
+
* this.types('json', 'text');
|
| 63 |
+
* // => "json"
|
| 64 |
+
* this.types('application/json');
|
| 65 |
+
* // => "application/json"
|
| 66 |
+
*
|
| 67 |
+
* // Accept: text/*, application/json
|
| 68 |
+
* this.types('image/png');
|
| 69 |
+
* this.types('png');
|
| 70 |
+
* // => undefined
|
| 71 |
+
*
|
| 72 |
+
* // Accept: text/*;q=.5, application/json
|
| 73 |
+
* this.types(['html', 'json']);
|
| 74 |
+
* this.types('html', 'json');
|
| 75 |
+
* // => "json"
|
| 76 |
+
*
|
| 77 |
+
* @param {String|Array} types...
|
| 78 |
+
* @return {String|Array|Boolean}
|
| 79 |
+
* @public
|
| 80 |
+
*/
|
| 81 |
+
|
| 82 |
+
Accepts.prototype.type =
|
| 83 |
+
Accepts.prototype.types = function (types_) {
|
| 84 |
+
var types = types_
|
| 85 |
+
|
| 86 |
+
// support flattened arguments
|
| 87 |
+
if (types && !Array.isArray(types)) {
|
| 88 |
+
types = new Array(arguments.length)
|
| 89 |
+
for (var i = 0; i < types.length; i++) {
|
| 90 |
+
types[i] = arguments[i]
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
// no types, return all requested types
|
| 95 |
+
if (!types || types.length === 0) {
|
| 96 |
+
return this.negotiator.mediaTypes()
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
// no accept header, return first given type
|
| 100 |
+
if (!this.headers.accept) {
|
| 101 |
+
return types[0]
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
var mimes = types.map(extToMime)
|
| 105 |
+
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
|
| 106 |
+
var first = accepts[0]
|
| 107 |
+
|
| 108 |
+
return first
|
| 109 |
+
? types[mimes.indexOf(first)]
|
| 110 |
+
: false
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* Return accepted encodings or best fit based on `encodings`.
|
| 115 |
+
*
|
| 116 |
+
* Given `Accept-Encoding: gzip, deflate`
|
| 117 |
+
* an array sorted by quality is returned:
|
| 118 |
+
*
|
| 119 |
+
* ['gzip', 'deflate']
|
| 120 |
+
*
|
| 121 |
+
* @param {String|Array} encodings...
|
| 122 |
+
* @return {String|Array}
|
| 123 |
+
* @public
|
| 124 |
+
*/
|
| 125 |
+
|
| 126 |
+
Accepts.prototype.encoding =
|
| 127 |
+
Accepts.prototype.encodings = function (encodings_) {
|
| 128 |
+
var encodings = encodings_
|
| 129 |
+
|
| 130 |
+
// support flattened arguments
|
| 131 |
+
if (encodings && !Array.isArray(encodings)) {
|
| 132 |
+
encodings = new Array(arguments.length)
|
| 133 |
+
for (var i = 0; i < encodings.length; i++) {
|
| 134 |
+
encodings[i] = arguments[i]
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
// no encodings, return all requested encodings
|
| 139 |
+
if (!encodings || encodings.length === 0) {
|
| 140 |
+
return this.negotiator.encodings()
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
return this.negotiator.encodings(encodings)[0] || false
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* Return accepted charsets or best fit based on `charsets`.
|
| 148 |
+
*
|
| 149 |
+
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
| 150 |
+
* an array sorted by quality is returned:
|
| 151 |
+
*
|
| 152 |
+
* ['utf-8', 'utf-7', 'iso-8859-1']
|
| 153 |
+
*
|
| 154 |
+
* @param {String|Array} charsets...
|
| 155 |
+
* @return {String|Array}
|
| 156 |
+
* @public
|
| 157 |
+
*/
|
| 158 |
+
|
| 159 |
+
Accepts.prototype.charset =
|
| 160 |
+
Accepts.prototype.charsets = function (charsets_) {
|
| 161 |
+
var charsets = charsets_
|
| 162 |
+
|
| 163 |
+
// support flattened arguments
|
| 164 |
+
if (charsets && !Array.isArray(charsets)) {
|
| 165 |
+
charsets = new Array(arguments.length)
|
| 166 |
+
for (var i = 0; i < charsets.length; i++) {
|
| 167 |
+
charsets[i] = arguments[i]
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
// no charsets, return all requested charsets
|
| 172 |
+
if (!charsets || charsets.length === 0) {
|
| 173 |
+
return this.negotiator.charsets()
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
return this.negotiator.charsets(charsets)[0] || false
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* Return accepted languages or best fit based on `langs`.
|
| 181 |
+
*
|
| 182 |
+
* Given `Accept-Language: en;q=0.8, es, pt`
|
| 183 |
+
* an array sorted by quality is returned:
|
| 184 |
+
*
|
| 185 |
+
* ['es', 'pt', 'en']
|
| 186 |
+
*
|
| 187 |
+
* @param {String|Array} langs...
|
| 188 |
+
* @return {Array|String}
|
| 189 |
+
* @public
|
| 190 |
+
*/
|
| 191 |
+
|
| 192 |
+
Accepts.prototype.lang =
|
| 193 |
+
Accepts.prototype.langs =
|
| 194 |
+
Accepts.prototype.language =
|
| 195 |
+
Accepts.prototype.languages = function (languages_) {
|
| 196 |
+
var languages = languages_
|
| 197 |
+
|
| 198 |
+
// support flattened arguments
|
| 199 |
+
if (languages && !Array.isArray(languages)) {
|
| 200 |
+
languages = new Array(arguments.length)
|
| 201 |
+
for (var i = 0; i < languages.length; i++) {
|
| 202 |
+
languages[i] = arguments[i]
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
// no languages, return all requested languages
|
| 207 |
+
if (!languages || languages.length === 0) {
|
| 208 |
+
return this.negotiator.languages()
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
return this.negotiator.languages(languages)[0] || false
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* Convert extnames to mime.
|
| 216 |
+
*
|
| 217 |
+
* @param {String} type
|
| 218 |
+
* @return {String}
|
| 219 |
+
* @private
|
| 220 |
+
*/
|
| 221 |
+
|
| 222 |
+
function extToMime (type) {
|
| 223 |
+
return type.indexOf('/') === -1
|
| 224 |
+
? mime.lookup(type)
|
| 225 |
+
: type
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* Check if mime is valid.
|
| 230 |
+
*
|
| 231 |
+
* @param {String} type
|
| 232 |
+
* @return {String}
|
| 233 |
+
* @private
|
| 234 |
+
*/
|
| 235 |
+
|
| 236 |
+
function validMime (type) {
|
| 237 |
+
return typeof type === 'string'
|
| 238 |
+
}
|
trump-game/node_modules/accepts/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "accepts",
|
| 3 |
+
"description": "Higher-level content negotiation",
|
| 4 |
+
"version": "1.3.8",
|
| 5 |
+
"contributors": [
|
| 6 |
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
| 7 |
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
| 8 |
+
],
|
| 9 |
+
"license": "MIT",
|
| 10 |
+
"repository": "jshttp/accepts",
|
| 11 |
+
"dependencies": {
|
| 12 |
+
"mime-types": "~2.1.34",
|
| 13 |
+
"negotiator": "0.6.3"
|
| 14 |
+
},
|
| 15 |
+
"devDependencies": {
|
| 16 |
+
"deep-equal": "1.0.1",
|
| 17 |
+
"eslint": "7.32.0",
|
| 18 |
+
"eslint-config-standard": "14.1.1",
|
| 19 |
+
"eslint-plugin-import": "2.25.4",
|
| 20 |
+
"eslint-plugin-markdown": "2.2.1",
|
| 21 |
+
"eslint-plugin-node": "11.1.0",
|
| 22 |
+
"eslint-plugin-promise": "4.3.1",
|
| 23 |
+
"eslint-plugin-standard": "4.1.0",
|
| 24 |
+
"mocha": "9.2.0",
|
| 25 |
+
"nyc": "15.1.0"
|
| 26 |
+
},
|
| 27 |
+
"files": [
|
| 28 |
+
"LICENSE",
|
| 29 |
+
"HISTORY.md",
|
| 30 |
+
"index.js"
|
| 31 |
+
],
|
| 32 |
+
"engines": {
|
| 33 |
+
"node": ">= 0.6"
|
| 34 |
+
},
|
| 35 |
+
"scripts": {
|
| 36 |
+
"lint": "eslint .",
|
| 37 |
+
"test": "mocha --reporter spec --check-leaks --bail test/",
|
| 38 |
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
| 39 |
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
| 40 |
+
},
|
| 41 |
+
"keywords": [
|
| 42 |
+
"content",
|
| 43 |
+
"negotiation",
|
| 44 |
+
"accept",
|
| 45 |
+
"accepts"
|
| 46 |
+
]
|
| 47 |
+
}
|
trump-game/node_modules/array-flatten/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in
|
| 13 |
+
all copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 21 |
+
THE SOFTWARE.
|
trump-game/node_modules/array-flatten/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Array Flatten
|
| 2 |
+
|
| 3 |
+
[![NPM version][npm-image]][npm-url]
|
| 4 |
+
[![NPM downloads][downloads-image]][downloads-url]
|
| 5 |
+
[![Build status][travis-image]][travis-url]
|
| 6 |
+
[![Test coverage][coveralls-image]][coveralls-url]
|
| 7 |
+
|
| 8 |
+
> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
|
| 9 |
+
|
| 10 |
+
## Installation
|
| 11 |
+
|
| 12 |
+
```
|
| 13 |
+
npm install array-flatten --save
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
## Usage
|
| 17 |
+
|
| 18 |
+
```javascript
|
| 19 |
+
var flatten = require('array-flatten')
|
| 20 |
+
|
| 21 |
+
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
|
| 22 |
+
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
|
| 23 |
+
|
| 24 |
+
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
|
| 25 |
+
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
|
| 26 |
+
|
| 27 |
+
(function () {
|
| 28 |
+
flatten(arguments) //=> [1, 2, 3]
|
| 29 |
+
})(1, [2, 3])
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## License
|
| 33 |
+
|
| 34 |
+
MIT
|
| 35 |
+
|
| 36 |
+
[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
|
| 37 |
+
[npm-url]: https://npmjs.org/package/array-flatten
|
| 38 |
+
[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
|
| 39 |
+
[downloads-url]: https://npmjs.org/package/array-flatten
|
| 40 |
+
[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
|
| 41 |
+
[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
|
| 42 |
+
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
|
| 43 |
+
[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
|
trump-game/node_modules/array-flatten/array-flatten.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict'
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Expose `arrayFlatten`.
|
| 5 |
+
*/
|
| 6 |
+
module.exports = arrayFlatten
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Recursive flatten function with depth.
|
| 10 |
+
*
|
| 11 |
+
* @param {Array} array
|
| 12 |
+
* @param {Array} result
|
| 13 |
+
* @param {Number} depth
|
| 14 |
+
* @return {Array}
|
| 15 |
+
*/
|
| 16 |
+
function flattenWithDepth (array, result, depth) {
|
| 17 |
+
for (var i = 0; i < array.length; i++) {
|
| 18 |
+
var value = array[i]
|
| 19 |
+
|
| 20 |
+
if (depth > 0 && Array.isArray(value)) {
|
| 21 |
+
flattenWithDepth(value, result, depth - 1)
|
| 22 |
+
} else {
|
| 23 |
+
result.push(value)
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
return result
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* Recursive flatten function. Omitting depth is slightly faster.
|
| 32 |
+
*
|
| 33 |
+
* @param {Array} array
|
| 34 |
+
* @param {Array} result
|
| 35 |
+
* @return {Array}
|
| 36 |
+
*/
|
| 37 |
+
function flattenForever (array, result) {
|
| 38 |
+
for (var i = 0; i < array.length; i++) {
|
| 39 |
+
var value = array[i]
|
| 40 |
+
|
| 41 |
+
if (Array.isArray(value)) {
|
| 42 |
+
flattenForever(value, result)
|
| 43 |
+
} else {
|
| 44 |
+
result.push(value)
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
return result
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Flatten an array, with the ability to define a depth.
|
| 53 |
+
*
|
| 54 |
+
* @param {Array} array
|
| 55 |
+
* @param {Number} depth
|
| 56 |
+
* @return {Array}
|
| 57 |
+
*/
|
| 58 |
+
function arrayFlatten (array, depth) {
|
| 59 |
+
if (depth == null) {
|
| 60 |
+
return flattenForever(array, [])
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return flattenWithDepth(array, [], depth)
|
| 64 |
+
}
|
trump-game/node_modules/array-flatten/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "array-flatten",
|
| 3 |
+
"version": "1.1.1",
|
| 4 |
+
"description": "Flatten an array of nested arrays into a single flat array",
|
| 5 |
+
"main": "array-flatten.js",
|
| 6 |
+
"files": [
|
| 7 |
+
"array-flatten.js",
|
| 8 |
+
"LICENSE"
|
| 9 |
+
],
|
| 10 |
+
"scripts": {
|
| 11 |
+
"test": "istanbul cover _mocha -- -R spec"
|
| 12 |
+
},
|
| 13 |
+
"repository": {
|
| 14 |
+
"type": "git",
|
| 15 |
+
"url": "git://github.com/blakeembrey/array-flatten.git"
|
| 16 |
+
},
|
| 17 |
+
"keywords": [
|
| 18 |
+
"array",
|
| 19 |
+
"flatten",
|
| 20 |
+
"arguments",
|
| 21 |
+
"depth"
|
| 22 |
+
],
|
| 23 |
+
"author": {
|
| 24 |
+
"name": "Blake Embrey",
|
| 25 |
+
"email": "hello@blakeembrey.com",
|
| 26 |
+
"url": "http://blakeembrey.me"
|
| 27 |
+
},
|
| 28 |
+
"license": "MIT",
|
| 29 |
+
"bugs": {
|
| 30 |
+
"url": "https://github.com/blakeembrey/array-flatten/issues"
|
| 31 |
+
},
|
| 32 |
+
"homepage": "https://github.com/blakeembrey/array-flatten",
|
| 33 |
+
"devDependencies": {
|
| 34 |
+
"istanbul": "^0.3.13",
|
| 35 |
+
"mocha": "^2.2.4",
|
| 36 |
+
"pre-commit": "^1.0.7",
|
| 37 |
+
"standard": "^3.7.3"
|
| 38 |
+
}
|
| 39 |
+
}
|
trump-game/node_modules/body-parser/HISTORY.md
ADDED
|
@@ -0,0 +1,672 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1.20.3 / 2024-09-10
|
| 2 |
+
===================
|
| 3 |
+
|
| 4 |
+
* deps: qs@6.13.0
|
| 5 |
+
* add `depth` option to customize the depth level in the parser
|
| 6 |
+
* IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`)
|
| 7 |
+
|
| 8 |
+
1.20.2 / 2023-02-21
|
| 9 |
+
===================
|
| 10 |
+
|
| 11 |
+
* Fix strict json error message on Node.js 19+
|
| 12 |
+
* deps: content-type@~1.0.5
|
| 13 |
+
- perf: skip value escaping when unnecessary
|
| 14 |
+
* deps: raw-body@2.5.2
|
| 15 |
+
|
| 16 |
+
1.20.1 / 2022-10-06
|
| 17 |
+
===================
|
| 18 |
+
|
| 19 |
+
* deps: qs@6.11.0
|
| 20 |
+
* perf: remove unnecessary object clone
|
| 21 |
+
|
| 22 |
+
1.20.0 / 2022-04-02
|
| 23 |
+
===================
|
| 24 |
+
|
| 25 |
+
* Fix error message for json parse whitespace in `strict`
|
| 26 |
+
* Fix internal error when inflated body exceeds limit
|
| 27 |
+
* Prevent loss of async hooks context
|
| 28 |
+
* Prevent hanging when request already read
|
| 29 |
+
* deps: depd@2.0.0
|
| 30 |
+
- Replace internal `eval` usage with `Function` constructor
|
| 31 |
+
- Use instance methods on `process` to check for listeners
|
| 32 |
+
* deps: http-errors@2.0.0
|
| 33 |
+
- deps: depd@2.0.0
|
| 34 |
+
- deps: statuses@2.0.1
|
| 35 |
+
* deps: on-finished@2.4.1
|
| 36 |
+
* deps: qs@6.10.3
|
| 37 |
+
* deps: raw-body@2.5.1
|
| 38 |
+
- deps: http-errors@2.0.0
|
| 39 |
+
|
| 40 |
+
1.19.2 / 2022-02-15
|
| 41 |
+
===================
|
| 42 |
+
|
| 43 |
+
* deps: bytes@3.1.2
|
| 44 |
+
* deps: qs@6.9.7
|
| 45 |
+
* Fix handling of `__proto__` keys
|
| 46 |
+
* deps: raw-body@2.4.3
|
| 47 |
+
- deps: bytes@3.1.2
|
| 48 |
+
|
| 49 |
+
1.19.1 / 2021-12-10
|
| 50 |
+
===================
|
| 51 |
+
|
| 52 |
+
* deps: bytes@3.1.1
|
| 53 |
+
* deps: http-errors@1.8.1
|
| 54 |
+
- deps: inherits@2.0.4
|
| 55 |
+
- deps: toidentifier@1.0.1
|
| 56 |
+
- deps: setprototypeof@1.2.0
|
| 57 |
+
* deps: qs@6.9.6
|
| 58 |
+
* deps: raw-body@2.4.2
|
| 59 |
+
- deps: bytes@3.1.1
|
| 60 |
+
- deps: http-errors@1.8.1
|
| 61 |
+
* deps: safe-buffer@5.2.1
|
| 62 |
+
* deps: type-is@~1.6.18
|
| 63 |
+
|
| 64 |
+
1.19.0 / 2019-04-25
|
| 65 |
+
===================
|
| 66 |
+
|
| 67 |
+
* deps: bytes@3.1.0
|
| 68 |
+
- Add petabyte (`pb`) support
|
| 69 |
+
* deps: http-errors@1.7.2
|
| 70 |
+
- Set constructor name when possible
|
| 71 |
+
- deps: setprototypeof@1.1.1
|
| 72 |
+
- deps: statuses@'>= 1.5.0 < 2'
|
| 73 |
+
* deps: iconv-lite@0.4.24
|
| 74 |
+
- Added encoding MIK
|
| 75 |
+
* deps: qs@6.7.0
|
| 76 |
+
- Fix parsing array brackets after index
|
| 77 |
+
* deps: raw-body@2.4.0
|
| 78 |
+
- deps: bytes@3.1.0
|
| 79 |
+
- deps: http-errors@1.7.2
|
| 80 |
+
- deps: iconv-lite@0.4.24
|
| 81 |
+
* deps: type-is@~1.6.17
|
| 82 |
+
- deps: mime-types@~2.1.24
|
| 83 |
+
- perf: prevent internal `throw` on invalid type
|
| 84 |
+
|
| 85 |
+
1.18.3 / 2018-05-14
|
| 86 |
+
===================
|
| 87 |
+
|
| 88 |
+
* Fix stack trace for strict json parse error
|
| 89 |
+
* deps: depd@~1.1.2
|
| 90 |
+
- perf: remove argument reassignment
|
| 91 |
+
* deps: http-errors@~1.6.3
|
| 92 |
+
- deps: depd@~1.1.2
|
| 93 |
+
- deps: setprototypeof@1.1.0
|
| 94 |
+
- deps: statuses@'>= 1.3.1 < 2'
|
| 95 |
+
* deps: iconv-lite@0.4.23
|
| 96 |
+
- Fix loading encoding with year appended
|
| 97 |
+
- Fix deprecation warnings on Node.js 10+
|
| 98 |
+
* deps: qs@6.5.2
|
| 99 |
+
* deps: raw-body@2.3.3
|
| 100 |
+
- deps: http-errors@1.6.3
|
| 101 |
+
- deps: iconv-lite@0.4.23
|
| 102 |
+
* deps: type-is@~1.6.16
|
| 103 |
+
- deps: mime-types@~2.1.18
|
| 104 |
+
|
| 105 |
+
1.18.2 / 2017-09-22
|
| 106 |
+
===================
|
| 107 |
+
|
| 108 |
+
* deps: debug@2.6.9
|
| 109 |
+
* perf: remove argument reassignment
|
| 110 |
+
|
| 111 |
+
1.18.1 / 2017-09-12
|
| 112 |
+
===================
|
| 113 |
+
|
| 114 |
+
* deps: content-type@~1.0.4
|
| 115 |
+
- perf: remove argument reassignment
|
| 116 |
+
- perf: skip parameter parsing when no parameters
|
| 117 |
+
* deps: iconv-lite@0.4.19
|
| 118 |
+
- Fix ISO-8859-1 regression
|
| 119 |
+
- Update Windows-1255
|
| 120 |
+
* deps: qs@6.5.1
|
| 121 |
+
- Fix parsing & compacting very deep objects
|
| 122 |
+
* deps: raw-body@2.3.2
|
| 123 |
+
- deps: iconv-lite@0.4.19
|
| 124 |
+
|
| 125 |
+
1.18.0 / 2017-09-08
|
| 126 |
+
===================
|
| 127 |
+
|
| 128 |
+
* Fix JSON strict violation error to match native parse error
|
| 129 |
+
* Include the `body` property on verify errors
|
| 130 |
+
* Include the `type` property on all generated errors
|
| 131 |
+
* Use `http-errors` to set status code on errors
|
| 132 |
+
* deps: bytes@3.0.0
|
| 133 |
+
* deps: debug@2.6.8
|
| 134 |
+
* deps: depd@~1.1.1
|
| 135 |
+
- Remove unnecessary `Buffer` loading
|
| 136 |
+
* deps: http-errors@~1.6.2
|
| 137 |
+
- deps: depd@1.1.1
|
| 138 |
+
* deps: iconv-lite@0.4.18
|
| 139 |
+
- Add support for React Native
|
| 140 |
+
- Add a warning if not loaded as utf-8
|
| 141 |
+
- Fix CESU-8 decoding in Node.js 8
|
| 142 |
+
- Improve speed of ISO-8859-1 encoding
|
| 143 |
+
* deps: qs@6.5.0
|
| 144 |
+
* deps: raw-body@2.3.1
|
| 145 |
+
- Use `http-errors` for standard emitted errors
|
| 146 |
+
- deps: bytes@3.0.0
|
| 147 |
+
- deps: iconv-lite@0.4.18
|
| 148 |
+
- perf: skip buffer decoding on overage chunk
|
| 149 |
+
* perf: prevent internal `throw` when missing charset
|
| 150 |
+
|
| 151 |
+
1.17.2 / 2017-05-17
|
| 152 |
+
===================
|
| 153 |
+
|
| 154 |
+
* deps: debug@2.6.7
|
| 155 |
+
- Fix `DEBUG_MAX_ARRAY_LENGTH`
|
| 156 |
+
- deps: ms@2.0.0
|
| 157 |
+
* deps: type-is@~1.6.15
|
| 158 |
+
- deps: mime-types@~2.1.15
|
| 159 |
+
|
| 160 |
+
1.17.1 / 2017-03-06
|
| 161 |
+
===================
|
| 162 |
+
|
| 163 |
+
* deps: qs@6.4.0
|
| 164 |
+
- Fix regression parsing keys starting with `[`
|
| 165 |
+
|
| 166 |
+
1.17.0 / 2017-03-01
|
| 167 |
+
===================
|
| 168 |
+
|
| 169 |
+
* deps: http-errors@~1.6.1
|
| 170 |
+
- Make `message` property enumerable for `HttpError`s
|
| 171 |
+
- deps: setprototypeof@1.0.3
|
| 172 |
+
* deps: qs@6.3.1
|
| 173 |
+
- Fix compacting nested arrays
|
| 174 |
+
|
| 175 |
+
1.16.1 / 2017-02-10
|
| 176 |
+
===================
|
| 177 |
+
|
| 178 |
+
* deps: debug@2.6.1
|
| 179 |
+
- Fix deprecation messages in WebStorm and other editors
|
| 180 |
+
- Undeprecate `DEBUG_FD` set to `1` or `2`
|
| 181 |
+
|
| 182 |
+
1.16.0 / 2017-01-17
|
| 183 |
+
===================
|
| 184 |
+
|
| 185 |
+
* deps: debug@2.6.0
|
| 186 |
+
- Allow colors in workers
|
| 187 |
+
- Deprecated `DEBUG_FD` environment variable
|
| 188 |
+
- Fix error when running under React Native
|
| 189 |
+
- Use same color for same namespace
|
| 190 |
+
- deps: ms@0.7.2
|
| 191 |
+
* deps: http-errors@~1.5.1
|
| 192 |
+
- deps: inherits@2.0.3
|
| 193 |
+
- deps: setprototypeof@1.0.2
|
| 194 |
+
- deps: statuses@'>= 1.3.1 < 2'
|
| 195 |
+
* deps: iconv-lite@0.4.15
|
| 196 |
+
- Added encoding MS-31J
|
| 197 |
+
- Added encoding MS-932
|
| 198 |
+
- Added encoding MS-936
|
| 199 |
+
- Added encoding MS-949
|
| 200 |
+
- Added encoding MS-950
|
| 201 |
+
- Fix GBK/GB18030 handling of Euro character
|
| 202 |
+
* deps: qs@6.2.1
|
| 203 |
+
- Fix array parsing from skipping empty values
|
| 204 |
+
* deps: raw-body@~2.2.0
|
| 205 |
+
- deps: iconv-lite@0.4.15
|
| 206 |
+
* deps: type-is@~1.6.14
|
| 207 |
+
- deps: mime-types@~2.1.13
|
| 208 |
+
|
| 209 |
+
1.15.2 / 2016-06-19
|
| 210 |
+
===================
|
| 211 |
+
|
| 212 |
+
* deps: bytes@2.4.0
|
| 213 |
+
* deps: content-type@~1.0.2
|
| 214 |
+
- perf: enable strict mode
|
| 215 |
+
* deps: http-errors@~1.5.0
|
| 216 |
+
- Use `setprototypeof` module to replace `__proto__` setting
|
| 217 |
+
- deps: statuses@'>= 1.3.0 < 2'
|
| 218 |
+
- perf: enable strict mode
|
| 219 |
+
* deps: qs@6.2.0
|
| 220 |
+
* deps: raw-body@~2.1.7
|
| 221 |
+
- deps: bytes@2.4.0
|
| 222 |
+
- perf: remove double-cleanup on happy path
|
| 223 |
+
* deps: type-is@~1.6.13
|
| 224 |
+
- deps: mime-types@~2.1.11
|
| 225 |
+
|
| 226 |
+
1.15.1 / 2016-05-05
|
| 227 |
+
===================
|
| 228 |
+
|
| 229 |
+
* deps: bytes@2.3.0
|
| 230 |
+
- Drop partial bytes on all parsed units
|
| 231 |
+
- Fix parsing byte string that looks like hex
|
| 232 |
+
* deps: raw-body@~2.1.6
|
| 233 |
+
- deps: bytes@2.3.0
|
| 234 |
+
* deps: type-is@~1.6.12
|
| 235 |
+
- deps: mime-types@~2.1.10
|
| 236 |
+
|
| 237 |
+
1.15.0 / 2016-02-10
|
| 238 |
+
===================
|
| 239 |
+
|
| 240 |
+
* deps: http-errors@~1.4.0
|
| 241 |
+
- Add `HttpError` export, for `err instanceof createError.HttpError`
|
| 242 |
+
- deps: inherits@2.0.1
|
| 243 |
+
- deps: statuses@'>= 1.2.1 < 2'
|
| 244 |
+
* deps: qs@6.1.0
|
| 245 |
+
* deps: type-is@~1.6.11
|
| 246 |
+
- deps: mime-types@~2.1.9
|
| 247 |
+
|
| 248 |
+
1.14.2 / 2015-12-16
|
| 249 |
+
===================
|
| 250 |
+
|
| 251 |
+
* deps: bytes@2.2.0
|
| 252 |
+
* deps: iconv-lite@0.4.13
|
| 253 |
+
* deps: qs@5.2.0
|
| 254 |
+
* deps: raw-body@~2.1.5
|
| 255 |
+
- deps: bytes@2.2.0
|
| 256 |
+
- deps: iconv-lite@0.4.13
|
| 257 |
+
* deps: type-is@~1.6.10
|
| 258 |
+
- deps: mime-types@~2.1.8
|
| 259 |
+
|
| 260 |
+
1.14.1 / 2015-09-27
|
| 261 |
+
===================
|
| 262 |
+
|
| 263 |
+
* Fix issue where invalid charset results in 400 when `verify` used
|
| 264 |
+
* deps: iconv-lite@0.4.12
|
| 265 |
+
- Fix CESU-8 decoding in Node.js 4.x
|
| 266 |
+
* deps: raw-body@~2.1.4
|
| 267 |
+
- Fix masking critical errors from `iconv-lite`
|
| 268 |
+
- deps: iconv-lite@0.4.12
|
| 269 |
+
* deps: type-is@~1.6.9
|
| 270 |
+
- deps: mime-types@~2.1.7
|
| 271 |
+
|
| 272 |
+
1.14.0 / 2015-09-16
|
| 273 |
+
===================
|
| 274 |
+
|
| 275 |
+
* Fix JSON strict parse error to match syntax errors
|
| 276 |
+
* Provide static `require` analysis in `urlencoded` parser
|
| 277 |
+
* deps: depd@~1.1.0
|
| 278 |
+
- Support web browser loading
|
| 279 |
+
* deps: qs@5.1.0
|
| 280 |
+
* deps: raw-body@~2.1.3
|
| 281 |
+
- Fix sync callback when attaching data listener causes sync read
|
| 282 |
+
* deps: type-is@~1.6.8
|
| 283 |
+
- Fix type error when given invalid type to match against
|
| 284 |
+
- deps: mime-types@~2.1.6
|
| 285 |
+
|
| 286 |
+
1.13.3 / 2015-07-31
|
| 287 |
+
===================
|
| 288 |
+
|
| 289 |
+
* deps: type-is@~1.6.6
|
| 290 |
+
- deps: mime-types@~2.1.4
|
| 291 |
+
|
| 292 |
+
1.13.2 / 2015-07-05
|
| 293 |
+
===================
|
| 294 |
+
|
| 295 |
+
* deps: iconv-lite@0.4.11
|
| 296 |
+
* deps: qs@4.0.0
|
| 297 |
+
- Fix dropping parameters like `hasOwnProperty`
|
| 298 |
+
- Fix user-visible incompatibilities from 3.1.0
|
| 299 |
+
- Fix various parsing edge cases
|
| 300 |
+
* deps: raw-body@~2.1.2
|
| 301 |
+
- Fix error stack traces to skip `makeError`
|
| 302 |
+
- deps: iconv-lite@0.4.11
|
| 303 |
+
* deps: type-is@~1.6.4
|
| 304 |
+
- deps: mime-types@~2.1.2
|
| 305 |
+
- perf: enable strict mode
|
| 306 |
+
- perf: remove argument reassignment
|
| 307 |
+
|
| 308 |
+
1.13.1 / 2015-06-16
|
| 309 |
+
===================
|
| 310 |
+
|
| 311 |
+
* deps: qs@2.4.2
|
| 312 |
+
- Downgraded from 3.1.0 because of user-visible incompatibilities
|
| 313 |
+
|
| 314 |
+
1.13.0 / 2015-06-14
|
| 315 |
+
===================
|
| 316 |
+
|
| 317 |
+
* Add `statusCode` property on `Error`s, in addition to `status`
|
| 318 |
+
* Change `type` default to `application/json` for JSON parser
|
| 319 |
+
* Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser
|
| 320 |
+
* Provide static `require` analysis
|
| 321 |
+
* Use the `http-errors` module to generate errors
|
| 322 |
+
* deps: bytes@2.1.0
|
| 323 |
+
- Slight optimizations
|
| 324 |
+
* deps: iconv-lite@0.4.10
|
| 325 |
+
- The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails
|
| 326 |
+
- Leading BOM is now removed when decoding
|
| 327 |
+
* deps: on-finished@~2.3.0
|
| 328 |
+
- Add defined behavior for HTTP `CONNECT` requests
|
| 329 |
+
- Add defined behavior for HTTP `Upgrade` requests
|
| 330 |
+
- deps: ee-first@1.1.1
|
| 331 |
+
* deps: qs@3.1.0
|
| 332 |
+
- Fix dropping parameters like `hasOwnProperty`
|
| 333 |
+
- Fix various parsing edge cases
|
| 334 |
+
- Parsed object now has `null` prototype
|
| 335 |
+
* deps: raw-body@~2.1.1
|
| 336 |
+
- Use `unpipe` module for unpiping requests
|
| 337 |
+
- deps: iconv-lite@0.4.10
|
| 338 |
+
* deps: type-is@~1.6.3
|
| 339 |
+
- deps: mime-types@~2.1.1
|
| 340 |
+
- perf: reduce try block size
|
| 341 |
+
- perf: remove bitwise operations
|
| 342 |
+
* perf: enable strict mode
|
| 343 |
+
* perf: remove argument reassignment
|
| 344 |
+
* perf: remove delete call
|
| 345 |
+
|
| 346 |
+
1.12.4 / 2015-05-10
|
| 347 |
+
===================
|
| 348 |
+
|
| 349 |
+
* deps: debug@~2.2.0
|
| 350 |
+
* deps: qs@2.4.2
|
| 351 |
+
- Fix allowing parameters like `constructor`
|
| 352 |
+
* deps: on-finished@~2.2.1
|
| 353 |
+
* deps: raw-body@~2.0.1
|
| 354 |
+
- Fix a false-positive when unpiping in Node.js 0.8
|
| 355 |
+
- deps: bytes@2.0.1
|
| 356 |
+
* deps: type-is@~1.6.2
|
| 357 |
+
- deps: mime-types@~2.0.11
|
| 358 |
+
|
| 359 |
+
1.12.3 / 2015-04-15
|
| 360 |
+
===================
|
| 361 |
+
|
| 362 |
+
* Slight efficiency improvement when not debugging
|
| 363 |
+
* deps: depd@~1.0.1
|
| 364 |
+
* deps: iconv-lite@0.4.8
|
| 365 |
+
- Add encoding alias UNICODE-1-1-UTF-7
|
| 366 |
+
* deps: raw-body@1.3.4
|
| 367 |
+
- Fix hanging callback if request aborts during read
|
| 368 |
+
- deps: iconv-lite@0.4.8
|
| 369 |
+
|
| 370 |
+
1.12.2 / 2015-03-16
|
| 371 |
+
===================
|
| 372 |
+
|
| 373 |
+
* deps: qs@2.4.1
|
| 374 |
+
- Fix error when parameter `hasOwnProperty` is present
|
| 375 |
+
|
| 376 |
+
1.12.1 / 2015-03-15
|
| 377 |
+
===================
|
| 378 |
+
|
| 379 |
+
* deps: debug@~2.1.3
|
| 380 |
+
- Fix high intensity foreground color for bold
|
| 381 |
+
- deps: ms@0.7.0
|
| 382 |
+
* deps: type-is@~1.6.1
|
| 383 |
+
- deps: mime-types@~2.0.10
|
| 384 |
+
|
| 385 |
+
1.12.0 / 2015-02-13
|
| 386 |
+
===================
|
| 387 |
+
|
| 388 |
+
* add `debug` messages
|
| 389 |
+
* accept a function for the `type` option
|
| 390 |
+
* use `content-type` to parse `Content-Type` headers
|
| 391 |
+
* deps: iconv-lite@0.4.7
|
| 392 |
+
- Gracefully support enumerables on `Object.prototype`
|
| 393 |
+
* deps: raw-body@1.3.3
|
| 394 |
+
- deps: iconv-lite@0.4.7
|
| 395 |
+
* deps: type-is@~1.6.0
|
| 396 |
+
- fix argument reassignment
|
| 397 |
+
- fix false-positives in `hasBody` `Transfer-Encoding` check
|
| 398 |
+
- support wildcard for both type and subtype (`*/*`)
|
| 399 |
+
- deps: mime-types@~2.0.9
|
| 400 |
+
|
| 401 |
+
1.11.0 / 2015-01-30
|
| 402 |
+
===================
|
| 403 |
+
|
| 404 |
+
* make internal `extended: true` depth limit infinity
|
| 405 |
+
* deps: type-is@~1.5.6
|
| 406 |
+
- deps: mime-types@~2.0.8
|
| 407 |
+
|
| 408 |
+
1.10.2 / 2015-01-20
|
| 409 |
+
===================
|
| 410 |
+
|
| 411 |
+
* deps: iconv-lite@0.4.6
|
| 412 |
+
- Fix rare aliases of single-byte encodings
|
| 413 |
+
* deps: raw-body@1.3.2
|
| 414 |
+
- deps: iconv-lite@0.4.6
|
| 415 |
+
|
| 416 |
+
1.10.1 / 2015-01-01
|
| 417 |
+
===================
|
| 418 |
+
|
| 419 |
+
* deps: on-finished@~2.2.0
|
| 420 |
+
* deps: type-is@~1.5.5
|
| 421 |
+
- deps: mime-types@~2.0.7
|
| 422 |
+
|
| 423 |
+
1.10.0 / 2014-12-02
|
| 424 |
+
===================
|
| 425 |
+
|
| 426 |
+
* make internal `extended: true` array limit dynamic
|
| 427 |
+
|
| 428 |
+
1.9.3 / 2014-11-21
|
| 429 |
+
==================
|
| 430 |
+
|
| 431 |
+
* deps: iconv-lite@0.4.5
|
| 432 |
+
- Fix Windows-31J and X-SJIS encoding support
|
| 433 |
+
* deps: qs@2.3.3
|
| 434 |
+
- Fix `arrayLimit` behavior
|
| 435 |
+
* deps: raw-body@1.3.1
|
| 436 |
+
- deps: iconv-lite@0.4.5
|
| 437 |
+
* deps: type-is@~1.5.3
|
| 438 |
+
- deps: mime-types@~2.0.3
|
| 439 |
+
|
| 440 |
+
1.9.2 / 2014-10-27
|
| 441 |
+
==================
|
| 442 |
+
|
| 443 |
+
* deps: qs@2.3.2
|
| 444 |
+
- Fix parsing of mixed objects and values
|
| 445 |
+
|
| 446 |
+
1.9.1 / 2014-10-22
|
| 447 |
+
==================
|
| 448 |
+
|
| 449 |
+
* deps: on-finished@~2.1.1
|
| 450 |
+
- Fix handling of pipelined requests
|
| 451 |
+
* deps: qs@2.3.0
|
| 452 |
+
- Fix parsing of mixed implicit and explicit arrays
|
| 453 |
+
* deps: type-is@~1.5.2
|
| 454 |
+
- deps: mime-types@~2.0.2
|
| 455 |
+
|
| 456 |
+
1.9.0 / 2014-09-24
|
| 457 |
+
==================
|
| 458 |
+
|
| 459 |
+
* include the charset in "unsupported charset" error message
|
| 460 |
+
* include the encoding in "unsupported content encoding" error message
|
| 461 |
+
* deps: depd@~1.0.0
|
| 462 |
+
|
| 463 |
+
1.8.4 / 2014-09-23
|
| 464 |
+
==================
|
| 465 |
+
|
| 466 |
+
* fix content encoding to be case-insensitive
|
| 467 |
+
|
| 468 |
+
1.8.3 / 2014-09-19
|
| 469 |
+
==================
|
| 470 |
+
|
| 471 |
+
* deps: qs@2.2.4
|
| 472 |
+
- Fix issue with object keys starting with numbers truncated
|
| 473 |
+
|
| 474 |
+
1.8.2 / 2014-09-15
|
| 475 |
+
==================
|
| 476 |
+
|
| 477 |
+
* deps: depd@0.4.5
|
| 478 |
+
|
| 479 |
+
1.8.1 / 2014-09-07
|
| 480 |
+
==================
|
| 481 |
+
|
| 482 |
+
* deps: media-typer@0.3.0
|
| 483 |
+
* deps: type-is@~1.5.1
|
| 484 |
+
|
| 485 |
+
1.8.0 / 2014-09-05
|
| 486 |
+
==================
|
| 487 |
+
|
| 488 |
+
* make empty-body-handling consistent between chunked requests
|
| 489 |
+
- empty `json` produces `{}`
|
| 490 |
+
- empty `raw` produces `new Buffer(0)`
|
| 491 |
+
- empty `text` produces `''`
|
| 492 |
+
- empty `urlencoded` produces `{}`
|
| 493 |
+
* deps: qs@2.2.3
|
| 494 |
+
- Fix issue where first empty value in array is discarded
|
| 495 |
+
* deps: type-is@~1.5.0
|
| 496 |
+
- fix `hasbody` to be true for `content-length: 0`
|
| 497 |
+
|
| 498 |
+
1.7.0 / 2014-09-01
|
| 499 |
+
==================
|
| 500 |
+
|
| 501 |
+
* add `parameterLimit` option to `urlencoded` parser
|
| 502 |
+
* change `urlencoded` extended array limit to 100
|
| 503 |
+
* respond with 413 when over `parameterLimit` in `urlencoded`
|
| 504 |
+
|
| 505 |
+
1.6.7 / 2014-08-29
|
| 506 |
+
==================
|
| 507 |
+
|
| 508 |
+
* deps: qs@2.2.2
|
| 509 |
+
- Remove unnecessary cloning
|
| 510 |
+
|
| 511 |
+
1.6.6 / 2014-08-27
|
| 512 |
+
==================
|
| 513 |
+
|
| 514 |
+
* deps: qs@2.2.0
|
| 515 |
+
- Array parsing fix
|
| 516 |
+
- Performance improvements
|
| 517 |
+
|
| 518 |
+
1.6.5 / 2014-08-16
|
| 519 |
+
==================
|
| 520 |
+
|
| 521 |
+
* deps: on-finished@2.1.0
|
| 522 |
+
|
| 523 |
+
1.6.4 / 2014-08-14
|
| 524 |
+
==================
|
| 525 |
+
|
| 526 |
+
* deps: qs@1.2.2
|
| 527 |
+
|
| 528 |
+
1.6.3 / 2014-08-10
|
| 529 |
+
==================
|
| 530 |
+
|
| 531 |
+
* deps: qs@1.2.1
|
| 532 |
+
|
| 533 |
+
1.6.2 / 2014-08-07
|
| 534 |
+
==================
|
| 535 |
+
|
| 536 |
+
* deps: qs@1.2.0
|
| 537 |
+
- Fix parsing array of objects
|
| 538 |
+
|
| 539 |
+
1.6.1 / 2014-08-06
|
| 540 |
+
==================
|
| 541 |
+
|
| 542 |
+
* deps: qs@1.1.0
|
| 543 |
+
- Accept urlencoded square brackets
|
| 544 |
+
- Accept empty values in implicit array notation
|
| 545 |
+
|
| 546 |
+
1.6.0 / 2014-08-05
|
| 547 |
+
==================
|
| 548 |
+
|
| 549 |
+
* deps: qs@1.0.2
|
| 550 |
+
- Complete rewrite
|
| 551 |
+
- Limits array length to 20
|
| 552 |
+
- Limits object depth to 5
|
| 553 |
+
- Limits parameters to 1,000
|
| 554 |
+
|
| 555 |
+
1.5.2 / 2014-07-27
|
| 556 |
+
==================
|
| 557 |
+
|
| 558 |
+
* deps: depd@0.4.4
|
| 559 |
+
- Work-around v8 generating empty stack traces
|
| 560 |
+
|
| 561 |
+
1.5.1 / 2014-07-26
|
| 562 |
+
==================
|
| 563 |
+
|
| 564 |
+
* deps: depd@0.4.3
|
| 565 |
+
- Fix exception when global `Error.stackTraceLimit` is too low
|
| 566 |
+
|
| 567 |
+
1.5.0 / 2014-07-20
|
| 568 |
+
==================
|
| 569 |
+
|
| 570 |
+
* deps: depd@0.4.2
|
| 571 |
+
- Add `TRACE_DEPRECATION` environment variable
|
| 572 |
+
- Remove non-standard grey color from color output
|
| 573 |
+
- Support `--no-deprecation` argument
|
| 574 |
+
- Support `--trace-deprecation` argument
|
| 575 |
+
* deps: iconv-lite@0.4.4
|
| 576 |
+
- Added encoding UTF-7
|
| 577 |
+
* deps: raw-body@1.3.0
|
| 578 |
+
- deps: iconv-lite@0.4.4
|
| 579 |
+
- Added encoding UTF-7
|
| 580 |
+
- Fix `Cannot switch to old mode now` error on Node.js 0.10+
|
| 581 |
+
* deps: type-is@~1.3.2
|
| 582 |
+
|
| 583 |
+
1.4.3 / 2014-06-19
|
| 584 |
+
==================
|
| 585 |
+
|
| 586 |
+
* deps: type-is@1.3.1
|
| 587 |
+
- fix global variable leak
|
| 588 |
+
|
| 589 |
+
1.4.2 / 2014-06-19
|
| 590 |
+
==================
|
| 591 |
+
|
| 592 |
+
* deps: type-is@1.3.0
|
| 593 |
+
- improve type parsing
|
| 594 |
+
|
| 595 |
+
1.4.1 / 2014-06-19
|
| 596 |
+
==================
|
| 597 |
+
|
| 598 |
+
* fix urlencoded extended deprecation message
|
| 599 |
+
|
| 600 |
+
1.4.0 / 2014-06-19
|
| 601 |
+
==================
|
| 602 |
+
|
| 603 |
+
* add `text` parser
|
| 604 |
+
* add `raw` parser
|
| 605 |
+
* check accepted charset in content-type (accepts utf-8)
|
| 606 |
+
* check accepted encoding in content-encoding (accepts identity)
|
| 607 |
+
* deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed
|
| 608 |
+
* deprecate `urlencoded()` without provided `extended` option
|
| 609 |
+
* lazy-load urlencoded parsers
|
| 610 |
+
* parsers split into files for reduced mem usage
|
| 611 |
+
* support gzip and deflate bodies
|
| 612 |
+
- set `inflate: false` to turn off
|
| 613 |
+
* deps: raw-body@1.2.2
|
| 614 |
+
- Support all encodings from `iconv-lite`
|
| 615 |
+
|
| 616 |
+
1.3.1 / 2014-06-11
|
| 617 |
+
==================
|
| 618 |
+
|
| 619 |
+
* deps: type-is@1.2.1
|
| 620 |
+
- Switch dependency from mime to mime-types@1.0.0
|
| 621 |
+
|
| 622 |
+
1.3.0 / 2014-05-31
|
| 623 |
+
==================
|
| 624 |
+
|
| 625 |
+
* add `extended` option to urlencoded parser
|
| 626 |
+
|
| 627 |
+
1.2.2 / 2014-05-27
|
| 628 |
+
==================
|
| 629 |
+
|
| 630 |
+
* deps: raw-body@1.1.6
|
| 631 |
+
- assert stream encoding on node.js 0.8
|
| 632 |
+
- assert stream encoding on node.js < 0.10.6
|
| 633 |
+
- deps: bytes@1
|
| 634 |
+
|
| 635 |
+
1.2.1 / 2014-05-26
|
| 636 |
+
==================
|
| 637 |
+
|
| 638 |
+
* invoke `next(err)` after request fully read
|
| 639 |
+
- prevents hung responses and socket hang ups
|
| 640 |
+
|
| 641 |
+
1.2.0 / 2014-05-11
|
| 642 |
+
==================
|
| 643 |
+
|
| 644 |
+
* add `verify` option
|
| 645 |
+
* deps: type-is@1.2.0
|
| 646 |
+
- support suffix matching
|
| 647 |
+
|
| 648 |
+
1.1.2 / 2014-05-11
|
| 649 |
+
==================
|
| 650 |
+
|
| 651 |
+
* improve json parser speed
|
| 652 |
+
|
| 653 |
+
1.1.1 / 2014-05-11
|
| 654 |
+
==================
|
| 655 |
+
|
| 656 |
+
* fix repeated limit parsing with every request
|
| 657 |
+
|
| 658 |
+
1.1.0 / 2014-05-10
|
| 659 |
+
==================
|
| 660 |
+
|
| 661 |
+
* add `type` option
|
| 662 |
+
* deps: pin for safety and consistency
|
| 663 |
+
|
| 664 |
+
1.0.2 / 2014-04-14
|
| 665 |
+
==================
|
| 666 |
+
|
| 667 |
+
* use `type-is` module
|
| 668 |
+
|
| 669 |
+
1.0.1 / 2014-03-20
|
| 670 |
+
==================
|
| 671 |
+
|
| 672 |
+
* lower default limits to 100kb
|
trump-game/node_modules/body-parser/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(The MIT License)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
| 4 |
+
Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 7 |
+
a copy of this software and associated documentation files (the
|
| 8 |
+
'Software'), to deal in the Software without restriction, including
|
| 9 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 10 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 11 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 12 |
+
the following conditions:
|
| 13 |
+
|
| 14 |
+
The above copyright notice and this permission notice shall be
|
| 15 |
+
included in all copies or substantial portions of the Software.
|
| 16 |
+
|
| 17 |
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
| 18 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 19 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 20 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 21 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 22 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 23 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
trump-game/node_modules/body-parser/README.md
ADDED
|
@@ -0,0 +1,476 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# body-parser
|
| 2 |
+
|
| 3 |
+
[![NPM Version][npm-version-image]][npm-url]
|
| 4 |
+
[![NPM Downloads][npm-downloads-image]][npm-url]
|
| 5 |
+
[![Build Status][ci-image]][ci-url]
|
| 6 |
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
| 7 |
+
[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
|
| 8 |
+
|
| 9 |
+
Node.js body parsing middleware.
|
| 10 |
+
|
| 11 |
+
Parse incoming request bodies in a middleware before your handlers, available
|
| 12 |
+
under the `req.body` property.
|
| 13 |
+
|
| 14 |
+
**Note** As `req.body`'s shape is based on user-controlled input, all
|
| 15 |
+
properties and values in this object are untrusted and should be validated
|
| 16 |
+
before trusting. For example, `req.body.foo.toString()` may fail in multiple
|
| 17 |
+
ways, for example the `foo` property may not be there or may not be a string,
|
| 18 |
+
and `toString` may not be a function and instead a string or other user input.
|
| 19 |
+
|
| 20 |
+
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
|
| 21 |
+
|
| 22 |
+
_This does not handle multipart bodies_, due to their complex and typically
|
| 23 |
+
large nature. For multipart bodies, you may be interested in the following
|
| 24 |
+
modules:
|
| 25 |
+
|
| 26 |
+
* [busboy](https://www.npmjs.org/package/busboy#readme) and
|
| 27 |
+
[connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)
|
| 28 |
+
* [multiparty](https://www.npmjs.org/package/multiparty#readme) and
|
| 29 |
+
[connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)
|
| 30 |
+
* [formidable](https://www.npmjs.org/package/formidable#readme)
|
| 31 |
+
* [multer](https://www.npmjs.org/package/multer#readme)
|
| 32 |
+
|
| 33 |
+
This module provides the following parsers:
|
| 34 |
+
|
| 35 |
+
* [JSON body parser](#bodyparserjsonoptions)
|
| 36 |
+
* [Raw body parser](#bodyparserrawoptions)
|
| 37 |
+
* [Text body parser](#bodyparsertextoptions)
|
| 38 |
+
* [URL-encoded form body parser](#bodyparserurlencodedoptions)
|
| 39 |
+
|
| 40 |
+
Other body parsers you might be interested in:
|
| 41 |
+
|
| 42 |
+
- [body](https://www.npmjs.org/package/body#readme)
|
| 43 |
+
- [co-body](https://www.npmjs.org/package/co-body#readme)
|
| 44 |
+
|
| 45 |
+
## Installation
|
| 46 |
+
|
| 47 |
+
```sh
|
| 48 |
+
$ npm install body-parser
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## API
|
| 52 |
+
|
| 53 |
+
```js
|
| 54 |
+
var bodyParser = require('body-parser')
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
The `bodyParser` object exposes various factories to create middlewares. All
|
| 58 |
+
middlewares will populate the `req.body` property with the parsed body when
|
| 59 |
+
the `Content-Type` request header matches the `type` option, or an empty
|
| 60 |
+
object (`{}`) if there was no body to parse, the `Content-Type` was not matched,
|
| 61 |
+
or an error occurred.
|
| 62 |
+
|
| 63 |
+
The various errors returned by this module are described in the
|
| 64 |
+
[errors section](#errors).
|
| 65 |
+
|
| 66 |
+
### bodyParser.json([options])
|
| 67 |
+
|
| 68 |
+
Returns middleware that only parses `json` and only looks at requests where
|
| 69 |
+
the `Content-Type` header matches the `type` option. This parser accepts any
|
| 70 |
+
Unicode encoding of the body and supports automatic inflation of `gzip` and
|
| 71 |
+
`deflate` encodings.
|
| 72 |
+
|
| 73 |
+
A new `body` object containing the parsed data is populated on the `request`
|
| 74 |
+
object after the middleware (i.e. `req.body`).
|
| 75 |
+
|
| 76 |
+
#### Options
|
| 77 |
+
|
| 78 |
+
The `json` function takes an optional `options` object that may contain any of
|
| 79 |
+
the following keys:
|
| 80 |
+
|
| 81 |
+
##### inflate
|
| 82 |
+
|
| 83 |
+
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
| 84 |
+
`false`, deflated bodies are rejected. Defaults to `true`.
|
| 85 |
+
|
| 86 |
+
##### limit
|
| 87 |
+
|
| 88 |
+
Controls the maximum request body size. If this is a number, then the value
|
| 89 |
+
specifies the number of bytes; if it is a string, the value is passed to the
|
| 90 |
+
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
| 91 |
+
to `'100kb'`.
|
| 92 |
+
|
| 93 |
+
##### reviver
|
| 94 |
+
|
| 95 |
+
The `reviver` option is passed directly to `JSON.parse` as the second
|
| 96 |
+
argument. You can find more information on this argument
|
| 97 |
+
[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).
|
| 98 |
+
|
| 99 |
+
##### strict
|
| 100 |
+
|
| 101 |
+
When set to `true`, will only accept arrays and objects; when `false` will
|
| 102 |
+
accept anything `JSON.parse` accepts. Defaults to `true`.
|
| 103 |
+
|
| 104 |
+
##### type
|
| 105 |
+
|
| 106 |
+
The `type` option is used to determine what media type the middleware will
|
| 107 |
+
parse. This option can be a string, array of strings, or a function. If not a
|
| 108 |
+
function, `type` option is passed directly to the
|
| 109 |
+
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
| 110 |
+
be an extension name (like `json`), a mime type (like `application/json`), or
|
| 111 |
+
a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
|
| 112 |
+
option is called as `fn(req)` and the request is parsed if it returns a truthy
|
| 113 |
+
value. Defaults to `application/json`.
|
| 114 |
+
|
| 115 |
+
##### verify
|
| 116 |
+
|
| 117 |
+
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
| 118 |
+
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
| 119 |
+
encoding of the request. The parsing can be aborted by throwing an error.
|
| 120 |
+
|
| 121 |
+
### bodyParser.raw([options])
|
| 122 |
+
|
| 123 |
+
Returns middleware that parses all bodies as a `Buffer` and only looks at
|
| 124 |
+
requests where the `Content-Type` header matches the `type` option. This
|
| 125 |
+
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
| 126 |
+
|
| 127 |
+
A new `body` object containing the parsed data is populated on the `request`
|
| 128 |
+
object after the middleware (i.e. `req.body`). This will be a `Buffer` object
|
| 129 |
+
of the body.
|
| 130 |
+
|
| 131 |
+
#### Options
|
| 132 |
+
|
| 133 |
+
The `raw` function takes an optional `options` object that may contain any of
|
| 134 |
+
the following keys:
|
| 135 |
+
|
| 136 |
+
##### inflate
|
| 137 |
+
|
| 138 |
+
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
| 139 |
+
`false`, deflated bodies are rejected. Defaults to `true`.
|
| 140 |
+
|
| 141 |
+
##### limit
|
| 142 |
+
|
| 143 |
+
Controls the maximum request body size. If this is a number, then the value
|
| 144 |
+
specifies the number of bytes; if it is a string, the value is passed to the
|
| 145 |
+
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
| 146 |
+
to `'100kb'`.
|
| 147 |
+
|
| 148 |
+
##### type
|
| 149 |
+
|
| 150 |
+
The `type` option is used to determine what media type the middleware will
|
| 151 |
+
parse. This option can be a string, array of strings, or a function.
|
| 152 |
+
If not a function, `type` option is passed directly to the
|
| 153 |
+
[type-is](https://www.npmjs.org/package/type-is#readme) library and this
|
| 154 |
+
can be an extension name (like `bin`), a mime type (like
|
| 155 |
+
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
|
| 156 |
+
`application/*`). If a function, the `type` option is called as `fn(req)`
|
| 157 |
+
and the request is parsed if it returns a truthy value. Defaults to
|
| 158 |
+
`application/octet-stream`.
|
| 159 |
+
|
| 160 |
+
##### verify
|
| 161 |
+
|
| 162 |
+
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
| 163 |
+
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
| 164 |
+
encoding of the request. The parsing can be aborted by throwing an error.
|
| 165 |
+
|
| 166 |
+
### bodyParser.text([options])
|
| 167 |
+
|
| 168 |
+
Returns middleware that parses all bodies as a string and only looks at
|
| 169 |
+
requests where the `Content-Type` header matches the `type` option. This
|
| 170 |
+
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
| 171 |
+
|
| 172 |
+
A new `body` string containing the parsed data is populated on the `request`
|
| 173 |
+
object after the middleware (i.e. `req.body`). This will be a string of the
|
| 174 |
+
body.
|
| 175 |
+
|
| 176 |
+
#### Options
|
| 177 |
+
|
| 178 |
+
The `text` function takes an optional `options` object that may contain any of
|
| 179 |
+
the following keys:
|
| 180 |
+
|
| 181 |
+
##### defaultCharset
|
| 182 |
+
|
| 183 |
+
Specify the default character set for the text content if the charset is not
|
| 184 |
+
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
|
| 185 |
+
|
| 186 |
+
##### inflate
|
| 187 |
+
|
| 188 |
+
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
| 189 |
+
`false`, deflated bodies are rejected. Defaults to `true`.
|
| 190 |
+
|
| 191 |
+
##### limit
|
| 192 |
+
|
| 193 |
+
Controls the maximum request body size. If this is a number, then the value
|
| 194 |
+
specifies the number of bytes; if it is a string, the value is passed to the
|
| 195 |
+
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
| 196 |
+
to `'100kb'`.
|
| 197 |
+
|
| 198 |
+
##### type
|
| 199 |
+
|
| 200 |
+
The `type` option is used to determine what media type the middleware will
|
| 201 |
+
parse. This option can be a string, array of strings, or a function. If not
|
| 202 |
+
a function, `type` option is passed directly to the
|
| 203 |
+
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
| 204 |
+
be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
|
| 205 |
+
type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
|
| 206 |
+
option is called as `fn(req)` and the request is parsed if it returns a
|
| 207 |
+
truthy value. Defaults to `text/plain`.
|
| 208 |
+
|
| 209 |
+
##### verify
|
| 210 |
+
|
| 211 |
+
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
| 212 |
+
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
| 213 |
+
encoding of the request. The parsing can be aborted by throwing an error.
|
| 214 |
+
|
| 215 |
+
### bodyParser.urlencoded([options])
|
| 216 |
+
|
| 217 |
+
Returns middleware that only parses `urlencoded` bodies and only looks at
|
| 218 |
+
requests where the `Content-Type` header matches the `type` option. This
|
| 219 |
+
parser accepts only UTF-8 encoding of the body and supports automatic
|
| 220 |
+
inflation of `gzip` and `deflate` encodings.
|
| 221 |
+
|
| 222 |
+
A new `body` object containing the parsed data is populated on the `request`
|
| 223 |
+
object after the middleware (i.e. `req.body`). This object will contain
|
| 224 |
+
key-value pairs, where the value can be a string or array (when `extended` is
|
| 225 |
+
`false`), or any type (when `extended` is `true`).
|
| 226 |
+
|
| 227 |
+
#### Options
|
| 228 |
+
|
| 229 |
+
The `urlencoded` function takes an optional `options` object that may contain
|
| 230 |
+
any of the following keys:
|
| 231 |
+
|
| 232 |
+
##### extended
|
| 233 |
+
|
| 234 |
+
The `extended` option allows to choose between parsing the URL-encoded data
|
| 235 |
+
with the `querystring` library (when `false`) or the `qs` library (when
|
| 236 |
+
`true`). The "extended" syntax allows for rich objects and arrays to be
|
| 237 |
+
encoded into the URL-encoded format, allowing for a JSON-like experience
|
| 238 |
+
with URL-encoded. For more information, please
|
| 239 |
+
[see the qs library](https://www.npmjs.org/package/qs#readme).
|
| 240 |
+
|
| 241 |
+
Defaults to `true`, but using the default has been deprecated. Please
|
| 242 |
+
research into the difference between `qs` and `querystring` and choose the
|
| 243 |
+
appropriate setting.
|
| 244 |
+
|
| 245 |
+
##### inflate
|
| 246 |
+
|
| 247 |
+
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
| 248 |
+
`false`, deflated bodies are rejected. Defaults to `true`.
|
| 249 |
+
|
| 250 |
+
##### limit
|
| 251 |
+
|
| 252 |
+
Controls the maximum request body size. If this is a number, then the value
|
| 253 |
+
specifies the number of bytes; if it is a string, the value is passed to the
|
| 254 |
+
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
| 255 |
+
to `'100kb'`.
|
| 256 |
+
|
| 257 |
+
##### parameterLimit
|
| 258 |
+
|
| 259 |
+
The `parameterLimit` option controls the maximum number of parameters that
|
| 260 |
+
are allowed in the URL-encoded data. If a request contains more parameters
|
| 261 |
+
than this value, a 413 will be returned to the client. Defaults to `1000`.
|
| 262 |
+
|
| 263 |
+
##### type
|
| 264 |
+
|
| 265 |
+
The `type` option is used to determine what media type the middleware will
|
| 266 |
+
parse. This option can be a string, array of strings, or a function. If not
|
| 267 |
+
a function, `type` option is passed directly to the
|
| 268 |
+
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
| 269 |
+
be an extension name (like `urlencoded`), a mime type (like
|
| 270 |
+
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
|
| 271 |
+
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
|
| 272 |
+
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
|
| 273 |
+
to `application/x-www-form-urlencoded`.
|
| 274 |
+
|
| 275 |
+
##### verify
|
| 276 |
+
|
| 277 |
+
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
| 278 |
+
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
| 279 |
+
encoding of the request. The parsing can be aborted by throwing an error.
|
| 280 |
+
|
| 281 |
+
#### depth
|
| 282 |
+
|
| 283 |
+
The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
|
| 284 |
+
|
| 285 |
+
## Errors
|
| 286 |
+
|
| 287 |
+
The middlewares provided by this module create errors using the
|
| 288 |
+
[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
|
| 289 |
+
will typically have a `status`/`statusCode` property that contains the suggested
|
| 290 |
+
HTTP response code, an `expose` property to determine if the `message` property
|
| 291 |
+
should be displayed to the client, a `type` property to determine the type of
|
| 292 |
+
error without matching against the `message`, and a `body` property containing
|
| 293 |
+
the read body, if available.
|
| 294 |
+
|
| 295 |
+
The following are the common errors created, though any error can come through
|
| 296 |
+
for various reasons.
|
| 297 |
+
|
| 298 |
+
### content encoding unsupported
|
| 299 |
+
|
| 300 |
+
This error will occur when the request had a `Content-Encoding` header that
|
| 301 |
+
contained an encoding but the "inflation" option was set to `false`. The
|
| 302 |
+
`status` property is set to `415`, the `type` property is set to
|
| 303 |
+
`'encoding.unsupported'`, and the `charset` property will be set to the
|
| 304 |
+
encoding that is unsupported.
|
| 305 |
+
|
| 306 |
+
### entity parse failed
|
| 307 |
+
|
| 308 |
+
This error will occur when the request contained an entity that could not be
|
| 309 |
+
parsed by the middleware. The `status` property is set to `400`, the `type`
|
| 310 |
+
property is set to `'entity.parse.failed'`, and the `body` property is set to
|
| 311 |
+
the entity value that failed parsing.
|
| 312 |
+
|
| 313 |
+
### entity verify failed
|
| 314 |
+
|
| 315 |
+
This error will occur when the request contained an entity that could not be
|
| 316 |
+
failed verification by the defined `verify` option. The `status` property is
|
| 317 |
+
set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
|
| 318 |
+
`body` property is set to the entity value that failed verification.
|
| 319 |
+
|
| 320 |
+
### request aborted
|
| 321 |
+
|
| 322 |
+
This error will occur when the request is aborted by the client before reading
|
| 323 |
+
the body has finished. The `received` property will be set to the number of
|
| 324 |
+
bytes received before the request was aborted and the `expected` property is
|
| 325 |
+
set to the number of expected bytes. The `status` property is set to `400`
|
| 326 |
+
and `type` property is set to `'request.aborted'`.
|
| 327 |
+
|
| 328 |
+
### request entity too large
|
| 329 |
+
|
| 330 |
+
This error will occur when the request body's size is larger than the "limit"
|
| 331 |
+
option. The `limit` property will be set to the byte limit and the `length`
|
| 332 |
+
property will be set to the request body's length. The `status` property is
|
| 333 |
+
set to `413` and the `type` property is set to `'entity.too.large'`.
|
| 334 |
+
|
| 335 |
+
### request size did not match content length
|
| 336 |
+
|
| 337 |
+
This error will occur when the request's length did not match the length from
|
| 338 |
+
the `Content-Length` header. This typically occurs when the request is malformed,
|
| 339 |
+
typically when the `Content-Length` header was calculated based on characters
|
| 340 |
+
instead of bytes. The `status` property is set to `400` and the `type` property
|
| 341 |
+
is set to `'request.size.invalid'`.
|
| 342 |
+
|
| 343 |
+
### stream encoding should not be set
|
| 344 |
+
|
| 345 |
+
This error will occur when something called the `req.setEncoding` method prior
|
| 346 |
+
to this middleware. This module operates directly on bytes only and you cannot
|
| 347 |
+
call `req.setEncoding` when using this module. The `status` property is set to
|
| 348 |
+
`500` and the `type` property is set to `'stream.encoding.set'`.
|
| 349 |
+
|
| 350 |
+
### stream is not readable
|
| 351 |
+
|
| 352 |
+
This error will occur when the request is no longer readable when this middleware
|
| 353 |
+
attempts to read it. This typically means something other than a middleware from
|
| 354 |
+
this module read the request body already and the middleware was also configured to
|
| 355 |
+
read the same request. The `status` property is set to `500` and the `type`
|
| 356 |
+
property is set to `'stream.not.readable'`.
|
| 357 |
+
|
| 358 |
+
### too many parameters
|
| 359 |
+
|
| 360 |
+
This error will occur when the content of the request exceeds the configured
|
| 361 |
+
`parameterLimit` for the `urlencoded` parser. The `status` property is set to
|
| 362 |
+
`413` and the `type` property is set to `'parameters.too.many'`.
|
| 363 |
+
|
| 364 |
+
### unsupported charset "BOGUS"
|
| 365 |
+
|
| 366 |
+
This error will occur when the request had a charset parameter in the
|
| 367 |
+
`Content-Type` header, but the `iconv-lite` module does not support it OR the
|
| 368 |
+
parser does not support it. The charset is contained in the message as well
|
| 369 |
+
as in the `charset` property. The `status` property is set to `415`, the
|
| 370 |
+
`type` property is set to `'charset.unsupported'`, and the `charset` property
|
| 371 |
+
is set to the charset that is unsupported.
|
| 372 |
+
|
| 373 |
+
### unsupported content encoding "bogus"
|
| 374 |
+
|
| 375 |
+
This error will occur when the request had a `Content-Encoding` header that
|
| 376 |
+
contained an unsupported encoding. The encoding is contained in the message
|
| 377 |
+
as well as in the `encoding` property. The `status` property is set to `415`,
|
| 378 |
+
the `type` property is set to `'encoding.unsupported'`, and the `encoding`
|
| 379 |
+
property is set to the encoding that is unsupported.
|
| 380 |
+
|
| 381 |
+
### The input exceeded the depth
|
| 382 |
+
|
| 383 |
+
This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
|
| 384 |
+
|
| 385 |
+
## Examples
|
| 386 |
+
|
| 387 |
+
### Express/Connect top-level generic
|
| 388 |
+
|
| 389 |
+
This example demonstrates adding a generic JSON and URL-encoded parser as a
|
| 390 |
+
top-level middleware, which will parse the bodies of all incoming requests.
|
| 391 |
+
This is the simplest setup.
|
| 392 |
+
|
| 393 |
+
```js
|
| 394 |
+
var express = require('express')
|
| 395 |
+
var bodyParser = require('body-parser')
|
| 396 |
+
|
| 397 |
+
var app = express()
|
| 398 |
+
|
| 399 |
+
// parse application/x-www-form-urlencoded
|
| 400 |
+
app.use(bodyParser.urlencoded({ extended: false }))
|
| 401 |
+
|
| 402 |
+
// parse application/json
|
| 403 |
+
app.use(bodyParser.json())
|
| 404 |
+
|
| 405 |
+
app.use(function (req, res) {
|
| 406 |
+
res.setHeader('Content-Type', 'text/plain')
|
| 407 |
+
res.write('you posted:\n')
|
| 408 |
+
res.end(JSON.stringify(req.body, null, 2))
|
| 409 |
+
})
|
| 410 |
+
```
|
| 411 |
+
|
| 412 |
+
### Express route-specific
|
| 413 |
+
|
| 414 |
+
This example demonstrates adding body parsers specifically to the routes that
|
| 415 |
+
need them. In general, this is the most recommended way to use body-parser with
|
| 416 |
+
Express.
|
| 417 |
+
|
| 418 |
+
```js
|
| 419 |
+
var express = require('express')
|
| 420 |
+
var bodyParser = require('body-parser')
|
| 421 |
+
|
| 422 |
+
var app = express()
|
| 423 |
+
|
| 424 |
+
// create application/json parser
|
| 425 |
+
var jsonParser = bodyParser.json()
|
| 426 |
+
|
| 427 |
+
// create application/x-www-form-urlencoded parser
|
| 428 |
+
var urlencodedParser = bodyParser.urlencoded({ extended: false })
|
| 429 |
+
|
| 430 |
+
// POST /login gets urlencoded bodies
|
| 431 |
+
app.post('/login', urlencodedParser, function (req, res) {
|
| 432 |
+
res.send('welcome, ' + req.body.username)
|
| 433 |
+
})
|
| 434 |
+
|
| 435 |
+
// POST /api/users gets JSON bodies
|
| 436 |
+
app.post('/api/users', jsonParser, function (req, res) {
|
| 437 |
+
// create user in req.body
|
| 438 |
+
})
|
| 439 |
+
```
|
| 440 |
+
|
| 441 |
+
### Change accepted type for parsers
|
| 442 |
+
|
| 443 |
+
All the parsers accept a `type` option which allows you to change the
|
| 444 |
+
`Content-Type` that the middleware will parse.
|
| 445 |
+
|
| 446 |
+
```js
|
| 447 |
+
var express = require('express')
|
| 448 |
+
var bodyParser = require('body-parser')
|
| 449 |
+
|
| 450 |
+
var app = express()
|
| 451 |
+
|
| 452 |
+
// parse various different custom JSON types as JSON
|
| 453 |
+
app.use(bodyParser.json({ type: 'application/*+json' }))
|
| 454 |
+
|
| 455 |
+
// parse some custom thing into a Buffer
|
| 456 |
+
app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
|
| 457 |
+
|
| 458 |
+
// parse an HTML body into a string
|
| 459 |
+
app.use(bodyParser.text({ type: 'text/html' }))
|
| 460 |
+
```
|
| 461 |
+
|
| 462 |
+
## License
|
| 463 |
+
|
| 464 |
+
[MIT](LICENSE)
|
| 465 |
+
|
| 466 |
+
[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci
|
| 467 |
+
[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
|
| 468 |
+
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master
|
| 469 |
+
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
|
| 470 |
+
[node-version-image]: https://badgen.net/npm/node/body-parser
|
| 471 |
+
[node-version-url]: https://nodejs.org/en/download
|
| 472 |
+
[npm-downloads-image]: https://badgen.net/npm/dm/body-parser
|
| 473 |
+
[npm-url]: https://npmjs.org/package/body-parser
|
| 474 |
+
[npm-version-image]: https://badgen.net/npm/v/body-parser
|
| 475 |
+
[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
|
| 476 |
+
[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
|
trump-game/node_modules/body-parser/SECURITY.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Security Policies and Procedures
|
| 2 |
+
|
| 3 |
+
## Reporting a Bug
|
| 4 |
+
|
| 5 |
+
The Express team and community take all security bugs seriously. Thank you
|
| 6 |
+
for improving the security of Express. We appreciate your efforts and
|
| 7 |
+
responsible disclosure and will make every effort to acknowledge your
|
| 8 |
+
contributions.
|
| 9 |
+
|
| 10 |
+
Report security bugs by emailing the current owner(s) of `body-parser`. This
|
| 11 |
+
information can be found in the npm registry using the command
|
| 12 |
+
`npm owner ls body-parser`.
|
| 13 |
+
If unsure or unable to get the information from the above, open an issue
|
| 14 |
+
in the [project issue tracker](https://github.com/expressjs/body-parser/issues)
|
| 15 |
+
asking for the current contact information.
|
| 16 |
+
|
| 17 |
+
To ensure the timely response to your report, please ensure that the entirety
|
| 18 |
+
of the report is contained within the email body and not solely behind a web
|
| 19 |
+
link or an attachment.
|
| 20 |
+
|
| 21 |
+
At least one owner will acknowledge your email within 48 hours, and will send a
|
| 22 |
+
more detailed response within 48 hours indicating the next steps in handling
|
| 23 |
+
your report. After the initial reply to your report, the owners will
|
| 24 |
+
endeavor to keep you informed of the progress towards a fix and full
|
| 25 |
+
announcement, and may ask for additional information or guidance.
|
trump-game/node_modules/body-parser/index.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* body-parser
|
| 3 |
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
| 4 |
+
* MIT Licensed
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
'use strict'
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Module dependencies.
|
| 11 |
+
* @private
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
var deprecate = require('depd')('body-parser')
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Cache of loaded parsers.
|
| 18 |
+
* @private
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
var parsers = Object.create(null)
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* @typedef Parsers
|
| 25 |
+
* @type {function}
|
| 26 |
+
* @property {function} json
|
| 27 |
+
* @property {function} raw
|
| 28 |
+
* @property {function} text
|
| 29 |
+
* @property {function} urlencoded
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* Module exports.
|
| 34 |
+
* @type {Parsers}
|
| 35 |
+
*/
|
| 36 |
+
|
| 37 |
+
exports = module.exports = deprecate.function(bodyParser,
|
| 38 |
+
'bodyParser: use individual json/urlencoded middlewares')
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* JSON parser.
|
| 42 |
+
* @public
|
| 43 |
+
*/
|
| 44 |
+
|
| 45 |
+
Object.defineProperty(exports, 'json', {
|
| 46 |
+
configurable: true,
|
| 47 |
+
enumerable: true,
|
| 48 |
+
get: createParserGetter('json')
|
| 49 |
+
})
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Raw parser.
|
| 53 |
+
* @public
|
| 54 |
+
*/
|
| 55 |
+
|
| 56 |
+
Object.defineProperty(exports, 'raw', {
|
| 57 |
+
configurable: true,
|
| 58 |
+
enumerable: true,
|
| 59 |
+
get: createParserGetter('raw')
|
| 60 |
+
})
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Text parser.
|
| 64 |
+
* @public
|
| 65 |
+
*/
|
| 66 |
+
|
| 67 |
+
Object.defineProperty(exports, 'text', {
|
| 68 |
+
configurable: true,
|
| 69 |
+
enumerable: true,
|
| 70 |
+
get: createParserGetter('text')
|
| 71 |
+
})
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* URL-encoded parser.
|
| 75 |
+
* @public
|
| 76 |
+
*/
|
| 77 |
+
|
| 78 |
+
Object.defineProperty(exports, 'urlencoded', {
|
| 79 |
+
configurable: true,
|
| 80 |
+
enumerable: true,
|
| 81 |
+
get: createParserGetter('urlencoded')
|
| 82 |
+
})
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Create a middleware to parse json and urlencoded bodies.
|
| 86 |
+
*
|
| 87 |
+
* @param {object} [options]
|
| 88 |
+
* @return {function}
|
| 89 |
+
* @deprecated
|
| 90 |
+
* @public
|
| 91 |
+
*/
|
| 92 |
+
|
| 93 |
+
function bodyParser (options) {
|
| 94 |
+
// use default type for parsers
|
| 95 |
+
var opts = Object.create(options || null, {
|
| 96 |
+
type: {
|
| 97 |
+
configurable: true,
|
| 98 |
+
enumerable: true,
|
| 99 |
+
value: undefined,
|
| 100 |
+
writable: true
|
| 101 |
+
}
|
| 102 |
+
})
|
| 103 |
+
|
| 104 |
+
var _urlencoded = exports.urlencoded(opts)
|
| 105 |
+
var _json = exports.json(opts)
|
| 106 |
+
|
| 107 |
+
return function bodyParser (req, res, next) {
|
| 108 |
+
_json(req, res, function (err) {
|
| 109 |
+
if (err) return next(err)
|
| 110 |
+
_urlencoded(req, res, next)
|
| 111 |
+
})
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
/**
|
| 116 |
+
* Create a getter for loading a parser.
|
| 117 |
+
* @private
|
| 118 |
+
*/
|
| 119 |
+
|
| 120 |
+
function createParserGetter (name) {
|
| 121 |
+
return function get () {
|
| 122 |
+
return loadParser(name)
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* Load a parser module.
|
| 128 |
+
* @private
|
| 129 |
+
*/
|
| 130 |
+
|
| 131 |
+
function loadParser (parserName) {
|
| 132 |
+
var parser = parsers[parserName]
|
| 133 |
+
|
| 134 |
+
if (parser !== undefined) {
|
| 135 |
+
return parser
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
// this uses a switch for static require analysis
|
| 139 |
+
switch (parserName) {
|
| 140 |
+
case 'json':
|
| 141 |
+
parser = require('./lib/types/json')
|
| 142 |
+
break
|
| 143 |
+
case 'raw':
|
| 144 |
+
parser = require('./lib/types/raw')
|
| 145 |
+
break
|
| 146 |
+
case 'text':
|
| 147 |
+
parser = require('./lib/types/text')
|
| 148 |
+
break
|
| 149 |
+
case 'urlencoded':
|
| 150 |
+
parser = require('./lib/types/urlencoded')
|
| 151 |
+
break
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
// store to prevent invoking require()
|
| 155 |
+
return (parsers[parserName] = parser)
|
| 156 |
+
}
|
trump-game/node_modules/body-parser/lib/read.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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use strict'
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Module dependencies.
|
| 11 |
+
* @private
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
var createError = require('http-errors')
|
| 15 |
+
var destroy = require('destroy')
|
| 16 |
+
var getBody = require('raw-body')
|
| 17 |
+
var iconv = require('iconv-lite')
|
| 18 |
+
var onFinished = require('on-finished')
|
| 19 |
+
var unpipe = require('unpipe')
|
| 20 |
+
var zlib = require('zlib')
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Module exports.
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
module.exports = read
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Read a request into a buffer and parse.
|
| 30 |
+
*
|
| 31 |
+
* @param {object} req
|
| 32 |
+
* @param {object} res
|
| 33 |
+
* @param {function} next
|
| 34 |
+
* @param {function} parse
|
| 35 |
+
* @param {function} debug
|
| 36 |
+
* @param {object} options
|
| 37 |
+
* @private
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
function read (req, res, next, parse, debug, options) {
|
| 41 |
+
var length
|
| 42 |
+
var opts = options
|
| 43 |
+
var stream
|
| 44 |
+
|
| 45 |
+
// flag as parsed
|
| 46 |
+
req._body = true
|
| 47 |
+
|
| 48 |
+
// read options
|
| 49 |
+
var encoding = opts.encoding !== null
|
| 50 |
+
? opts.encoding
|
| 51 |
+
: null
|
| 52 |
+
var verify = opts.verify
|
| 53 |
+
|
| 54 |
+
try {
|
| 55 |
+
// get the content stream
|
| 56 |
+
stream = contentstream(req, debug, opts.inflate)
|
| 57 |
+
length = stream.length
|
| 58 |
+
stream.length = undefined
|
| 59 |
+
} catch (err) {
|
| 60 |
+
return next(err)
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
// set raw-body options
|
| 64 |
+
opts.length = length
|
| 65 |
+
opts.encoding = verify
|
| 66 |
+
? null
|
| 67 |
+
: encoding
|
| 68 |
+
|
| 69 |
+
// assert charset is supported
|
| 70 |
+
if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
|
| 71 |
+
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
| 72 |
+
charset: encoding.toLowerCase(),
|
| 73 |
+
type: 'charset.unsupported'
|
| 74 |
+
}))
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
// read body
|
| 78 |
+
debug('read body')
|
| 79 |
+
getBody(stream, opts, function (error, body) {
|
| 80 |
+
if (error) {
|
| 81 |
+
var _error
|
| 82 |
+
|
| 83 |
+
if (error.type === 'encoding.unsupported') {
|
| 84 |
+
// echo back charset
|
| 85 |
+
_error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
| 86 |
+
charset: encoding.toLowerCase(),
|
| 87 |
+
type: 'charset.unsupported'
|
| 88 |
+
})
|
| 89 |
+
} else {
|
| 90 |
+
// set status code on error
|
| 91 |
+
_error = createError(400, error)
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
// unpipe from stream and destroy
|
| 95 |
+
if (stream !== req) {
|
| 96 |
+
unpipe(req)
|
| 97 |
+
destroy(stream, true)
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
// read off entire request
|
| 101 |
+
dump(req, function onfinished () {
|
| 102 |
+
next(createError(400, _error))
|
| 103 |
+
})
|
| 104 |
+
return
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
// verify
|
| 108 |
+
if (verify) {
|
| 109 |
+
try {
|
| 110 |
+
debug('verify body')
|
| 111 |
+
verify(req, res, body, encoding)
|
| 112 |
+
} catch (err) {
|
| 113 |
+
next(createError(403, err, {
|
| 114 |
+
body: body,
|
| 115 |
+
type: err.type || 'entity.verify.failed'
|
| 116 |
+
}))
|
| 117 |
+
return
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
// parse
|
| 122 |
+
var str = body
|
| 123 |
+
try {
|
| 124 |
+
debug('parse body')
|
| 125 |
+
str = typeof body !== 'string' && encoding !== null
|
| 126 |
+
? iconv.decode(body, encoding)
|
| 127 |
+
: body
|
| 128 |
+
req.body = parse(str)
|
| 129 |
+
} catch (err) {
|
| 130 |
+
next(createError(400, err, {
|
| 131 |
+
body: str,
|
| 132 |
+
type: err.type || 'entity.parse.failed'
|
| 133 |
+
}))
|
| 134 |
+
return
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
next()
|
| 138 |
+
})
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* Get the content stream of the request.
|
| 143 |
+
*
|
| 144 |
+
* @param {object} req
|
| 145 |
+
* @param {function} debug
|
| 146 |
+
* @param {boolean} [inflate=true]
|
| 147 |
+
* @return {object}
|
| 148 |
+
* @api private
|
| 149 |
+
*/
|
| 150 |
+
|
| 151 |
+
function contentstream (req, debug, inflate) {
|
| 152 |
+
var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
| 153 |
+
var length = req.headers['content-length']
|
| 154 |
+
var stream
|
| 155 |
+
|
| 156 |
+
debug('content-encoding "%s"', encoding)
|
| 157 |
+
|
| 158 |
+
if (inflate === false && encoding !== 'identity') {
|
| 159 |
+
throw createError(415, 'content encoding unsupported', {
|
| 160 |
+
encoding: encoding,
|
| 161 |
+
type: 'encoding.unsupported'
|
| 162 |
+
})
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
switch (encoding) {
|
| 166 |
+
case 'deflate':
|
| 167 |
+
stream = zlib.createInflate()
|
| 168 |
+
debug('inflate body')
|
| 169 |
+
req.pipe(stream)
|
| 170 |
+
break
|
| 171 |
+
case 'gzip':
|
| 172 |
+
stream = zlib.createGunzip()
|
| 173 |
+
debug('gunzip body')
|
| 174 |
+
req.pipe(stream)
|
| 175 |
+
break
|
| 176 |
+
case 'identity':
|
| 177 |
+
stream = req
|
| 178 |
+
stream.length = length
|
| 179 |
+
break
|
| 180 |
+
default:
|
| 181 |
+
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
| 182 |
+
encoding: encoding,
|
| 183 |
+
type: 'encoding.unsupported'
|
| 184 |
+
})
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
return stream
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* Dump the contents of a request.
|
| 192 |
+
*
|
| 193 |
+
* @param {object} req
|
| 194 |
+
* @param {function} callback
|
| 195 |
+
* @api private
|
| 196 |
+
*/
|
| 197 |
+
|
| 198 |
+
function dump (req, callback) {
|
| 199 |
+
if (onFinished.isFinished(req)) {
|
| 200 |
+
callback(null)
|
| 201 |
+
} else {
|
| 202 |
+
onFinished(req, callback)
|
| 203 |
+
req.resume()
|
| 204 |
+
}
|
| 205 |
+
}
|
trump-game/node_modules/body-parser/lib/types/json.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
+
'use strict'
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Module dependencies.
|
| 12 |
+
* @private
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
var bytes = require('bytes')
|
| 16 |
+
var contentType = require('content-type')
|
| 17 |
+
var createError = require('http-errors')
|
| 18 |
+
var debug = require('debug')('body-parser:json')
|
| 19 |
+
var read = require('../read')
|
| 20 |
+
var typeis = require('type-is')
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Module exports.
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
module.exports = json
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* RegExp to match the first non-space in a string.
|
| 30 |
+
*
|
| 31 |
+
* Allowed whitespace is defined in RFC 7159:
|
| 32 |
+
*
|
| 33 |
+
* ws = *(
|
| 34 |
+
* %x20 / ; Space
|
| 35 |
+
* %x09 / ; Horizontal tab
|
| 36 |
+
* %x0A / ; Line feed or New line
|
| 37 |
+
* %x0D ) ; Carriage return
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
|
| 41 |
+
|
| 42 |
+
var JSON_SYNTAX_CHAR = '#'
|
| 43 |
+
var JSON_SYNTAX_REGEXP = /#+/g
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* Create a middleware to parse JSON bodies.
|
| 47 |
+
*
|
| 48 |
+
* @param {object} [options]
|
| 49 |
+
* @return {function}
|
| 50 |
+
* @public
|
| 51 |
+
*/
|
| 52 |
+
|
| 53 |
+
function json (options) {
|
| 54 |
+
var opts = options || {}
|
| 55 |
+
|
| 56 |
+
var limit = typeof opts.limit !== 'number'
|
| 57 |
+
? bytes.parse(opts.limit || '100kb')
|
| 58 |
+
: opts.limit
|
| 59 |
+
var inflate = opts.inflate !== false
|
| 60 |
+
var reviver = opts.reviver
|
| 61 |
+
var strict = opts.strict !== false
|
| 62 |
+
var type = opts.type || 'application/json'
|
| 63 |
+
var verify = opts.verify || false
|
| 64 |
+
|
| 65 |
+
if (verify !== false && typeof verify !== 'function') {
|
| 66 |
+
throw new TypeError('option verify must be function')
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
// create the appropriate type checking function
|
| 70 |
+
var shouldParse = typeof type !== 'function'
|
| 71 |
+
? typeChecker(type)
|
| 72 |
+
: type
|
| 73 |
+
|
| 74 |
+
function parse (body) {
|
| 75 |
+
if (body.length === 0) {
|
| 76 |
+
// special-case empty json body, as it's a common client-side mistake
|
| 77 |
+
// TODO: maybe make this configurable or part of "strict" option
|
| 78 |
+
return {}
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
if (strict) {
|
| 82 |
+
var first = firstchar(body)
|
| 83 |
+
|
| 84 |
+
if (first !== '{' && first !== '[') {
|
| 85 |
+
debug('strict violation')
|
| 86 |
+
throw createStrictSyntaxError(body, first)
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
try {
|
| 91 |
+
debug('parse json')
|
| 92 |
+
return JSON.parse(body, reviver)
|
| 93 |
+
} catch (e) {
|
| 94 |
+
throw normalizeJsonSyntaxError(e, {
|
| 95 |
+
message: e.message,
|
| 96 |
+
stack: e.stack
|
| 97 |
+
})
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
return function jsonParser (req, res, next) {
|
| 102 |
+
if (req._body) {
|
| 103 |
+
debug('body already parsed')
|
| 104 |
+
next()
|
| 105 |
+
return
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
req.body = req.body || {}
|
| 109 |
+
|
| 110 |
+
// skip requests without bodies
|
| 111 |
+
if (!typeis.hasBody(req)) {
|
| 112 |
+
debug('skip empty body')
|
| 113 |
+
next()
|
| 114 |
+
return
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
debug('content-type %j', req.headers['content-type'])
|
| 118 |
+
|
| 119 |
+
// determine if request should be parsed
|
| 120 |
+
if (!shouldParse(req)) {
|
| 121 |
+
debug('skip parsing')
|
| 122 |
+
next()
|
| 123 |
+
return
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
// assert charset per RFC 7159 sec 8.1
|
| 127 |
+
var charset = getCharset(req) || 'utf-8'
|
| 128 |
+
if (charset.slice(0, 4) !== 'utf-') {
|
| 129 |
+
debug('invalid charset')
|
| 130 |
+
next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
|
| 131 |
+
charset: charset,
|
| 132 |
+
type: 'charset.unsupported'
|
| 133 |
+
}))
|
| 134 |
+
return
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
// read
|
| 138 |
+
read(req, res, next, parse, debug, {
|
| 139 |
+
encoding: charset,
|
| 140 |
+
inflate: inflate,
|
| 141 |
+
limit: limit,
|
| 142 |
+
verify: verify
|
| 143 |
+
})
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Create strict violation syntax error matching native error.
|
| 149 |
+
*
|
| 150 |
+
* @param {string} str
|
| 151 |
+
* @param {string} char
|
| 152 |
+
* @return {Error}
|
| 153 |
+
* @private
|
| 154 |
+
*/
|
| 155 |
+
|
| 156 |
+
function createStrictSyntaxError (str, char) {
|
| 157 |
+
var index = str.indexOf(char)
|
| 158 |
+
var partial = ''
|
| 159 |
+
|
| 160 |
+
if (index !== -1) {
|
| 161 |
+
partial = str.substring(0, index) + JSON_SYNTAX_CHAR
|
| 162 |
+
|
| 163 |
+
for (var i = index + 1; i < str.length; i++) {
|
| 164 |
+
partial += JSON_SYNTAX_CHAR
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
try {
|
| 169 |
+
JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
|
| 170 |
+
} catch (e) {
|
| 171 |
+
return normalizeJsonSyntaxError(e, {
|
| 172 |
+
message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) {
|
| 173 |
+
return str.substring(index, index + placeholder.length)
|
| 174 |
+
}),
|
| 175 |
+
stack: e.stack
|
| 176 |
+
})
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
/**
|
| 181 |
+
* Get the first non-whitespace character in a string.
|
| 182 |
+
*
|
| 183 |
+
* @param {string} str
|
| 184 |
+
* @return {function}
|
| 185 |
+
* @private
|
| 186 |
+
*/
|
| 187 |
+
|
| 188 |
+
function firstchar (str) {
|
| 189 |
+
var match = FIRST_CHAR_REGEXP.exec(str)
|
| 190 |
+
|
| 191 |
+
return match
|
| 192 |
+
? match[1]
|
| 193 |
+
: undefined
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* Get the charset of a request.
|
| 198 |
+
*
|
| 199 |
+
* @param {object} req
|
| 200 |
+
* @api private
|
| 201 |
+
*/
|
| 202 |
+
|
| 203 |
+
function getCharset (req) {
|
| 204 |
+
try {
|
| 205 |
+
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
| 206 |
+
} catch (e) {
|
| 207 |
+
return undefined
|
| 208 |
+
}
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
/**
|
| 212 |
+
* Normalize a SyntaxError for JSON.parse.
|
| 213 |
+
*
|
| 214 |
+
* @param {SyntaxError} error
|
| 215 |
+
* @param {object} obj
|
| 216 |
+
* @return {SyntaxError}
|
| 217 |
+
*/
|
| 218 |
+
|
| 219 |
+
function normalizeJsonSyntaxError (error, obj) {
|
| 220 |
+
var keys = Object.getOwnPropertyNames(error)
|
| 221 |
+
|
| 222 |
+
for (var i = 0; i < keys.length; i++) {
|
| 223 |
+
var key = keys[i]
|
| 224 |
+
if (key !== 'stack' && key !== 'message') {
|
| 225 |
+
delete error[key]
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
// replace stack before message for Node.js 0.10 and below
|
| 230 |
+
error.stack = obj.stack.replace(error.message, obj.message)
|
| 231 |
+
error.message = obj.message
|
| 232 |
+
|
| 233 |
+
return error
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
/**
|
| 237 |
+
* Get the simple type checker.
|
| 238 |
+
*
|
| 239 |
+
* @param {string} type
|
| 240 |
+
* @return {function}
|
| 241 |
+
*/
|
| 242 |
+
|
| 243 |
+
function typeChecker (type) {
|
| 244 |
+
return function checkType (req) {
|
| 245 |
+
return Boolean(typeis(req, type))
|
| 246 |
+
}
|
| 247 |
+
}
|
trump-game/node_modules/body-parser/lib/types/raw.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* body-parser
|
| 3 |
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
| 4 |
+
* MIT Licensed
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
'use strict'
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Module dependencies.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
var bytes = require('bytes')
|
| 14 |
+
var debug = require('debug')('body-parser:raw')
|
| 15 |
+
var read = require('../read')
|
| 16 |
+
var typeis = require('type-is')
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* Module exports.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
module.exports = raw
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Create a middleware to parse raw bodies.
|
| 26 |
+
*
|
| 27 |
+
* @param {object} [options]
|
| 28 |
+
* @return {function}
|
| 29 |
+
* @api public
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
function raw (options) {
|
| 33 |
+
var opts = options || {}
|
| 34 |
+
|
| 35 |
+
var inflate = opts.inflate !== false
|
| 36 |
+
var limit = typeof opts.limit !== 'number'
|
| 37 |
+
? bytes.parse(opts.limit || '100kb')
|
| 38 |
+
: opts.limit
|
| 39 |
+
var type = opts.type || 'application/octet-stream'
|
| 40 |
+
var verify = opts.verify || false
|
| 41 |
+
|
| 42 |
+
if (verify !== false && typeof verify !== 'function') {
|
| 43 |
+
throw new TypeError('option verify must be function')
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
// create the appropriate type checking function
|
| 47 |
+
var shouldParse = typeof type !== 'function'
|
| 48 |
+
? typeChecker(type)
|
| 49 |
+
: type
|
| 50 |
+
|
| 51 |
+
function parse (buf) {
|
| 52 |
+
return buf
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
return function rawParser (req, res, next) {
|
| 56 |
+
if (req._body) {
|
| 57 |
+
debug('body already parsed')
|
| 58 |
+
next()
|
| 59 |
+
return
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
req.body = req.body || {}
|
| 63 |
+
|
| 64 |
+
// skip requests without bodies
|
| 65 |
+
if (!typeis.hasBody(req)) {
|
| 66 |
+
debug('skip empty body')
|
| 67 |
+
next()
|
| 68 |
+
return
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
debug('content-type %j', req.headers['content-type'])
|
| 72 |
+
|
| 73 |
+
// determine if request should be parsed
|
| 74 |
+
if (!shouldParse(req)) {
|
| 75 |
+
debug('skip parsing')
|
| 76 |
+
next()
|
| 77 |
+
return
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
// read
|
| 81 |
+
read(req, res, next, parse, debug, {
|
| 82 |
+
encoding: null,
|
| 83 |
+
inflate: inflate,
|
| 84 |
+
limit: limit,
|
| 85 |
+
verify: verify
|
| 86 |
+
})
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
/**
|
| 91 |
+
* Get the simple type checker.
|
| 92 |
+
*
|
| 93 |
+
* @param {string} type
|
| 94 |
+
* @return {function}
|
| 95 |
+
*/
|
| 96 |
+
|
| 97 |
+
function typeChecker (type) {
|
| 98 |
+
return function checkType (req) {
|
| 99 |
+
return Boolean(typeis(req, type))
|
| 100 |
+
}
|
| 101 |
+
}
|
trump-game/node_modules/body-parser/lib/types/text.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* body-parser
|
| 3 |
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
| 4 |
+
* MIT Licensed
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
'use strict'
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Module dependencies.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
var bytes = require('bytes')
|
| 14 |
+
var contentType = require('content-type')
|
| 15 |
+
var debug = require('debug')('body-parser:text')
|
| 16 |
+
var read = require('../read')
|
| 17 |
+
var typeis = require('type-is')
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Module exports.
|
| 21 |
+
*/
|
| 22 |
+
|
| 23 |
+
module.exports = text
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Create a middleware to parse text bodies.
|
| 27 |
+
*
|
| 28 |
+
* @param {object} [options]
|
| 29 |
+
* @return {function}
|
| 30 |
+
* @api public
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
function text (options) {
|
| 34 |
+
var opts = options || {}
|
| 35 |
+
|
| 36 |
+
var defaultCharset = opts.defaultCharset || 'utf-8'
|
| 37 |
+
var inflate = opts.inflate !== false
|
| 38 |
+
var limit = typeof opts.limit !== 'number'
|
| 39 |
+
? bytes.parse(opts.limit || '100kb')
|
| 40 |
+
: opts.limit
|
| 41 |
+
var type = opts.type || 'text/plain'
|
| 42 |
+
var verify = opts.verify || false
|
| 43 |
+
|
| 44 |
+
if (verify !== false && typeof verify !== 'function') {
|
| 45 |
+
throw new TypeError('option verify must be function')
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
// create the appropriate type checking function
|
| 49 |
+
var shouldParse = typeof type !== 'function'
|
| 50 |
+
? typeChecker(type)
|
| 51 |
+
: type
|
| 52 |
+
|
| 53 |
+
function parse (buf) {
|
| 54 |
+
return buf
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
return function textParser (req, res, next) {
|
| 58 |
+
if (req._body) {
|
| 59 |
+
debug('body already parsed')
|
| 60 |
+
next()
|
| 61 |
+
return
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
req.body = req.body || {}
|
| 65 |
+
|
| 66 |
+
// skip requests without bodies
|
| 67 |
+
if (!typeis.hasBody(req)) {
|
| 68 |
+
debug('skip empty body')
|
| 69 |
+
next()
|
| 70 |
+
return
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
debug('content-type %j', req.headers['content-type'])
|
| 74 |
+
|
| 75 |
+
// determine if request should be parsed
|
| 76 |
+
if (!shouldParse(req)) {
|
| 77 |
+
debug('skip parsing')
|
| 78 |
+
next()
|
| 79 |
+
return
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
// get charset
|
| 83 |
+
var charset = getCharset(req) || defaultCharset
|
| 84 |
+
|
| 85 |
+
// read
|
| 86 |
+
read(req, res, next, parse, debug, {
|
| 87 |
+
encoding: charset,
|
| 88 |
+
inflate: inflate,
|
| 89 |
+
limit: limit,
|
| 90 |
+
verify: verify
|
| 91 |
+
})
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* Get the charset of a request.
|
| 97 |
+
*
|
| 98 |
+
* @param {object} req
|
| 99 |
+
* @api private
|
| 100 |
+
*/
|
| 101 |
+
|
| 102 |
+
function getCharset (req) {
|
| 103 |
+
try {
|
| 104 |
+
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
| 105 |
+
} catch (e) {
|
| 106 |
+
return undefined
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* Get the simple type checker.
|
| 112 |
+
*
|
| 113 |
+
* @param {string} type
|
| 114 |
+
* @return {function}
|
| 115 |
+
*/
|
| 116 |
+
|
| 117 |
+
function typeChecker (type) {
|
| 118 |
+
return function checkType (req) {
|
| 119 |
+
return Boolean(typeis(req, type))
|
| 120 |
+
}
|
| 121 |
+
}
|
trump-game/node_modules/body-parser/lib/types/urlencoded.js
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* body-parser
|
| 3 |
+
* Copyright(c) 2014 Jonathan Ong
|
| 4 |
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
| 5 |
+
* MIT Licensed
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
'use strict'
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Module dependencies.
|
| 12 |
+
* @private
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
var bytes = require('bytes')
|
| 16 |
+
var contentType = require('content-type')
|
| 17 |
+
var createError = require('http-errors')
|
| 18 |
+
var debug = require('debug')('body-parser:urlencoded')
|
| 19 |
+
var deprecate = require('depd')('body-parser')
|
| 20 |
+
var read = require('../read')
|
| 21 |
+
var typeis = require('type-is')
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Module exports.
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
module.exports = urlencoded
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Cache of parser modules.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
var parsers = Object.create(null)
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* Create a middleware to parse urlencoded bodies.
|
| 37 |
+
*
|
| 38 |
+
* @param {object} [options]
|
| 39 |
+
* @return {function}
|
| 40 |
+
* @public
|
| 41 |
+
*/
|
| 42 |
+
|
| 43 |
+
function urlencoded (options) {
|
| 44 |
+
var opts = options || {}
|
| 45 |
+
|
| 46 |
+
// notice because option default will flip in next major
|
| 47 |
+
if (opts.extended === undefined) {
|
| 48 |
+
deprecate('undefined extended: provide extended option')
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
var extended = opts.extended !== false
|
| 52 |
+
var inflate = opts.inflate !== false
|
| 53 |
+
var limit = typeof opts.limit !== 'number'
|
| 54 |
+
? bytes.parse(opts.limit || '100kb')
|
| 55 |
+
: opts.limit
|
| 56 |
+
var type = opts.type || 'application/x-www-form-urlencoded'
|
| 57 |
+
var verify = opts.verify || false
|
| 58 |
+
var depth = typeof opts.depth !== 'number'
|
| 59 |
+
? Number(opts.depth || 32)
|
| 60 |
+
: opts.depth
|
| 61 |
+
|
| 62 |
+
if (verify !== false && typeof verify !== 'function') {
|
| 63 |
+
throw new TypeError('option verify must be function')
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
// create the appropriate query parser
|
| 67 |
+
var queryparse = extended
|
| 68 |
+
? extendedparser(opts)
|
| 69 |
+
: simpleparser(opts)
|
| 70 |
+
|
| 71 |
+
// create the appropriate type checking function
|
| 72 |
+
var shouldParse = typeof type !== 'function'
|
| 73 |
+
? typeChecker(type)
|
| 74 |
+
: type
|
| 75 |
+
|
| 76 |
+
function parse (body) {
|
| 77 |
+
return body.length
|
| 78 |
+
? queryparse(body)
|
| 79 |
+
: {}
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
return function urlencodedParser (req, res, next) {
|
| 83 |
+
if (req._body) {
|
| 84 |
+
debug('body already parsed')
|
| 85 |
+
next()
|
| 86 |
+
return
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
req.body = req.body || {}
|
| 90 |
+
|
| 91 |
+
// skip requests without bodies
|
| 92 |
+
if (!typeis.hasBody(req)) {
|
| 93 |
+
debug('skip empty body')
|
| 94 |
+
next()
|
| 95 |
+
return
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
debug('content-type %j', req.headers['content-type'])
|
| 99 |
+
|
| 100 |
+
// determine if request should be parsed
|
| 101 |
+
if (!shouldParse(req)) {
|
| 102 |
+
debug('skip parsing')
|
| 103 |
+
next()
|
| 104 |
+
return
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
// assert charset
|
| 108 |
+
var charset = getCharset(req) || 'utf-8'
|
| 109 |
+
if (charset !== 'utf-8') {
|
| 110 |
+
debug('invalid charset')
|
| 111 |
+
next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
|
| 112 |
+
charset: charset,
|
| 113 |
+
type: 'charset.unsupported'
|
| 114 |
+
}))
|
| 115 |
+
return
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
// read
|
| 119 |
+
read(req, res, next, parse, debug, {
|
| 120 |
+
debug: debug,
|
| 121 |
+
encoding: charset,
|
| 122 |
+
inflate: inflate,
|
| 123 |
+
limit: limit,
|
| 124 |
+
verify: verify,
|
| 125 |
+
depth: depth
|
| 126 |
+
})
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/**
|
| 131 |
+
* Get the extended query parser.
|
| 132 |
+
*
|
| 133 |
+
* @param {object} options
|
| 134 |
+
*/
|
| 135 |
+
|
| 136 |
+
function extendedparser (options) {
|
| 137 |
+
var parameterLimit = options.parameterLimit !== undefined
|
| 138 |
+
? options.parameterLimit
|
| 139 |
+
: 1000
|
| 140 |
+
|
| 141 |
+
var depth = typeof options.depth !== 'number'
|
| 142 |
+
? Number(options.depth || 32)
|
| 143 |
+
: options.depth
|
| 144 |
+
var parse = parser('qs')
|
| 145 |
+
|
| 146 |
+
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
| 147 |
+
throw new TypeError('option parameterLimit must be a positive number')
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
if (isNaN(depth) || depth < 0) {
|
| 151 |
+
throw new TypeError('option depth must be a zero or a positive number')
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
if (isFinite(parameterLimit)) {
|
| 155 |
+
parameterLimit = parameterLimit | 0
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
return function queryparse (body) {
|
| 159 |
+
var paramCount = parameterCount(body, parameterLimit)
|
| 160 |
+
|
| 161 |
+
if (paramCount === undefined) {
|
| 162 |
+
debug('too many parameters')
|
| 163 |
+
throw createError(413, 'too many parameters', {
|
| 164 |
+
type: 'parameters.too.many'
|
| 165 |
+
})
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
var arrayLimit = Math.max(100, paramCount)
|
| 169 |
+
|
| 170 |
+
debug('parse extended urlencoding')
|
| 171 |
+
try {
|
| 172 |
+
return parse(body, {
|
| 173 |
+
allowPrototypes: true,
|
| 174 |
+
arrayLimit: arrayLimit,
|
| 175 |
+
depth: depth,
|
| 176 |
+
strictDepth: true,
|
| 177 |
+
parameterLimit: parameterLimit
|
| 178 |
+
})
|
| 179 |
+
} catch (err) {
|
| 180 |
+
if (err instanceof RangeError) {
|
| 181 |
+
throw createError(400, 'The input exceeded the depth', {
|
| 182 |
+
type: 'querystring.parse.rangeError'
|
| 183 |
+
})
|
| 184 |
+
} else {
|
| 185 |
+
throw err
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
/**
|
| 192 |
+
* Get the charset of a request.
|
| 193 |
+
*
|
| 194 |
+
* @param {object} req
|
| 195 |
+
* @api private
|
| 196 |
+
*/
|
| 197 |
+
|
| 198 |
+
function getCharset (req) {
|
| 199 |
+
try {
|
| 200 |
+
return (contentType.parse(req).parameters.charset || '').toLowerCase()
|
| 201 |
+
} catch (e) {
|
| 202 |
+
return undefined
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* Count the number of parameters, stopping once limit reached
|
| 208 |
+
*
|
| 209 |
+
* @param {string} body
|
| 210 |
+
* @param {number} limit
|
| 211 |
+
* @api private
|
| 212 |
+
*/
|
| 213 |
+
|
| 214 |
+
function parameterCount (body, limit) {
|
| 215 |
+
var count = 0
|
| 216 |
+
var index = 0
|
| 217 |
+
|
| 218 |
+
while ((index = body.indexOf('&', index)) !== -1) {
|
| 219 |
+
count++
|
| 220 |
+
index++
|
| 221 |
+
|
| 222 |
+
if (count === limit) {
|
| 223 |
+
return undefined
|
| 224 |
+
}
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
return count
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
/**
|
| 231 |
+
* Get parser for module name dynamically.
|
| 232 |
+
*
|
| 233 |
+
* @param {string} name
|
| 234 |
+
* @return {function}
|
| 235 |
+
* @api private
|
| 236 |
+
*/
|
| 237 |
+
|
| 238 |
+
function parser (name) {
|
| 239 |
+
var mod = parsers[name]
|
| 240 |
+
|
| 241 |
+
if (mod !== undefined) {
|
| 242 |
+
return mod.parse
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
// this uses a switch for static require analysis
|
| 246 |
+
switch (name) {
|
| 247 |
+
case 'qs':
|
| 248 |
+
mod = require('qs')
|
| 249 |
+
break
|
| 250 |
+
case 'querystring':
|
| 251 |
+
mod = require('querystring')
|
| 252 |
+
break
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
// store to prevent invoking require()
|
| 256 |
+
parsers[name] = mod
|
| 257 |
+
|
| 258 |
+
return mod.parse
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
/**
|
| 262 |
+
* Get the simple query parser.
|
| 263 |
+
*
|
| 264 |
+
* @param {object} options
|
| 265 |
+
*/
|
| 266 |
+
|
| 267 |
+
function simpleparser (options) {
|
| 268 |
+
var parameterLimit = options.parameterLimit !== undefined
|
| 269 |
+
? options.parameterLimit
|
| 270 |
+
: 1000
|
| 271 |
+
var parse = parser('querystring')
|
| 272 |
+
|
| 273 |
+
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
| 274 |
+
throw new TypeError('option parameterLimit must be a positive number')
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
if (isFinite(parameterLimit)) {
|
| 278 |
+
parameterLimit = parameterLimit | 0
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
return function queryparse (body) {
|
| 282 |
+
var paramCount = parameterCount(body, parameterLimit)
|
| 283 |
+
|
| 284 |
+
if (paramCount === undefined) {
|
| 285 |
+
debug('too many parameters')
|
| 286 |
+
throw createError(413, 'too many parameters', {
|
| 287 |
+
type: 'parameters.too.many'
|
| 288 |
+
})
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
debug('parse urlencoding')
|
| 292 |
+
return parse(body, undefined, undefined, { maxKeys: parameterLimit })
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
/**
|
| 297 |
+
* Get the simple type checker.
|
| 298 |
+
*
|
| 299 |
+
* @param {string} type
|
| 300 |
+
* @return {function}
|
| 301 |
+
*/
|
| 302 |
+
|
| 303 |
+
function typeChecker (type) {
|
| 304 |
+
return function checkType (req) {
|
| 305 |
+
return Boolean(typeis(req, type))
|
| 306 |
+
}
|
| 307 |
+
}
|
trump-game/node_modules/body-parser/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "body-parser",
|
| 3 |
+
"description": "Node.js body parsing middleware",
|
| 4 |
+
"version": "1.20.3",
|
| 5 |
+
"contributors": [
|
| 6 |
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
| 7 |
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
| 8 |
+
],
|
| 9 |
+
"license": "MIT",
|
| 10 |
+
"repository": "expressjs/body-parser",
|
| 11 |
+
"dependencies": {
|
| 12 |
+
"bytes": "3.1.2",
|
| 13 |
+
"content-type": "~1.0.5",
|
| 14 |
+
"debug": "2.6.9",
|
| 15 |
+
"depd": "2.0.0",
|
| 16 |
+
"destroy": "1.2.0",
|
| 17 |
+
"http-errors": "2.0.0",
|
| 18 |
+
"iconv-lite": "0.4.24",
|
| 19 |
+
"on-finished": "2.4.1",
|
| 20 |
+
"qs": "6.13.0",
|
| 21 |
+
"raw-body": "2.5.2",
|
| 22 |
+
"type-is": "~1.6.18",
|
| 23 |
+
"unpipe": "1.0.0"
|
| 24 |
+
},
|
| 25 |
+
"devDependencies": {
|
| 26 |
+
"eslint": "8.34.0",
|
| 27 |
+
"eslint-config-standard": "14.1.1",
|
| 28 |
+
"eslint-plugin-import": "2.27.5",
|
| 29 |
+
"eslint-plugin-markdown": "3.0.0",
|
| 30 |
+
"eslint-plugin-node": "11.1.0",
|
| 31 |
+
"eslint-plugin-promise": "6.1.1",
|
| 32 |
+
"eslint-plugin-standard": "4.1.0",
|
| 33 |
+
"methods": "1.1.2",
|
| 34 |
+
"mocha": "10.2.0",
|
| 35 |
+
"nyc": "15.1.0",
|
| 36 |
+
"safe-buffer": "5.2.1",
|
| 37 |
+
"supertest": "6.3.3"
|
| 38 |
+
},
|
| 39 |
+
"files": [
|
| 40 |
+
"lib/",
|
| 41 |
+
"LICENSE",
|
| 42 |
+
"HISTORY.md",
|
| 43 |
+
"SECURITY.md",
|
| 44 |
+
"index.js"
|
| 45 |
+
],
|
| 46 |
+
"engines": {
|
| 47 |
+
"node": ">= 0.8",
|
| 48 |
+
"npm": "1.2.8000 || >= 1.4.16"
|
| 49 |
+
},
|
| 50 |
+
"scripts": {
|
| 51 |
+
"lint": "eslint .",
|
| 52 |
+
"test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/",
|
| 53 |
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
| 54 |
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
| 55 |
+
}
|
| 56 |
+
}
|
trump-game/node_modules/bytes/History.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
3.1.2 / 2022-01-27
|
| 2 |
+
==================
|
| 3 |
+
|
| 4 |
+
* Fix return value for un-parsable strings
|
| 5 |
+
|
| 6 |
+
3.1.1 / 2021-11-15
|
| 7 |
+
==================
|
| 8 |
+
|
| 9 |
+
* Fix "thousandsSeparator" incorrecting formatting fractional part
|
| 10 |
+
|
| 11 |
+
3.1.0 / 2019-01-22
|
| 12 |
+
==================
|
| 13 |
+
|
| 14 |
+
* Add petabyte (`pb`) support
|
| 15 |
+
|
| 16 |
+
3.0.0 / 2017-08-31
|
| 17 |
+
==================
|
| 18 |
+
|
| 19 |
+
* Change "kB" to "KB" in format output
|
| 20 |
+
* Remove support for Node.js 0.6
|
| 21 |
+
* Remove support for ComponentJS
|
| 22 |
+
|
| 23 |
+
2.5.0 / 2017-03-24
|
| 24 |
+
==================
|
| 25 |
+
|
| 26 |
+
* Add option "unit"
|
| 27 |
+
|
| 28 |
+
2.4.0 / 2016-06-01
|
| 29 |
+
==================
|
| 30 |
+
|
| 31 |
+
* Add option "unitSeparator"
|
| 32 |
+
|
| 33 |
+
2.3.0 / 2016-02-15
|
| 34 |
+
==================
|
| 35 |
+
|
| 36 |
+
* Drop partial bytes on all parsed units
|
| 37 |
+
* Fix non-finite numbers to `.format` to return `null`
|
| 38 |
+
* Fix parsing byte string that looks like hex
|
| 39 |
+
* perf: hoist regular expressions
|
| 40 |
+
|
| 41 |
+
2.2.0 / 2015-11-13
|
| 42 |
+
==================
|
| 43 |
+
|
| 44 |
+
* add option "decimalPlaces"
|
| 45 |
+
* add option "fixedDecimals"
|
| 46 |
+
|
| 47 |
+
2.1.0 / 2015-05-21
|
| 48 |
+
==================
|
| 49 |
+
|
| 50 |
+
* add `.format` export
|
| 51 |
+
* add `.parse` export
|
| 52 |
+
|
| 53 |
+
2.0.2 / 2015-05-20
|
| 54 |
+
==================
|
| 55 |
+
|
| 56 |
+
* remove map recreation
|
| 57 |
+
* remove unnecessary object construction
|
| 58 |
+
|
| 59 |
+
2.0.1 / 2015-05-07
|
| 60 |
+
==================
|
| 61 |
+
|
| 62 |
+
* fix browserify require
|
| 63 |
+
* remove node.extend dependency
|
| 64 |
+
|
| 65 |
+
2.0.0 / 2015-04-12
|
| 66 |
+
==================
|
| 67 |
+
|
| 68 |
+
* add option "case"
|
| 69 |
+
* add option "thousandsSeparator"
|
| 70 |
+
* return "null" on invalid parse input
|
| 71 |
+
* support proper round-trip: bytes(bytes(num)) === num
|
| 72 |
+
* units no longer case sensitive when parsing
|
| 73 |
+
|
| 74 |
+
1.0.0 / 2014-05-05
|
| 75 |
+
==================
|
| 76 |
+
|
| 77 |
+
* add negative support. fixes #6
|
| 78 |
+
|
| 79 |
+
0.3.0 / 2014-03-19
|
| 80 |
+
==================
|
| 81 |
+
|
| 82 |
+
* added terabyte support
|
| 83 |
+
|
| 84 |
+
0.2.1 / 2013-04-01
|
| 85 |
+
==================
|
| 86 |
+
|
| 87 |
+
* add .component
|
| 88 |
+
|
| 89 |
+
0.2.0 / 2012-10-28
|
| 90 |
+
==================
|
| 91 |
+
|
| 92 |
+
* bytes(200).should.eql('200b')
|
| 93 |
+
|
| 94 |
+
0.1.0 / 2012-07-04
|
| 95 |
+
==================
|
| 96 |
+
|
| 97 |
+
* add bytes to string conversion [yields]
|
trump-game/node_modules/bytes/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(The MIT License)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2012-2014 TJ Holowaychuk <tj@vision-media.ca>
|
| 4 |
+
Copyright (c) 2015 Jed Watson <jed.watson@me.com>
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 7 |
+
a copy of this software and associated documentation files (the
|
| 8 |
+
'Software'), to deal in the Software without restriction, including
|
| 9 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 10 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 11 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 12 |
+
the following conditions:
|
| 13 |
+
|
| 14 |
+
The above copyright notice and this permission notice shall be
|
| 15 |
+
included in all copies or substantial portions of the Software.
|
| 16 |
+
|
| 17 |
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
| 18 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 19 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 20 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 21 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 22 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 23 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
trump-game/node_modules/bytes/Readme.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Bytes utility
|
| 2 |
+
|
| 3 |
+
[![NPM Version][npm-image]][npm-url]
|
| 4 |
+
[![NPM Downloads][downloads-image]][downloads-url]
|
| 5 |
+
[![Build Status][ci-image]][ci-url]
|
| 6 |
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
| 7 |
+
|
| 8 |
+
Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa.
|
| 9 |
+
|
| 10 |
+
## Installation
|
| 11 |
+
|
| 12 |
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
| 13 |
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
| 14 |
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
| 15 |
+
|
| 16 |
+
```bash
|
| 17 |
+
$ npm install bytes
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
|
| 22 |
+
```js
|
| 23 |
+
var bytes = require('bytes');
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
#### bytes(number|string value, [options]): number|string|null
|
| 27 |
+
|
| 28 |
+
Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`.
|
| 29 |
+
|
| 30 |
+
**Arguments**
|
| 31 |
+
|
| 32 |
+
| Name | Type | Description |
|
| 33 |
+
|---------|----------|--------------------|
|
| 34 |
+
| value | `number`|`string` | Number value to format or string value to parse |
|
| 35 |
+
| options | `Object` | Conversion options for `format` |
|
| 36 |
+
|
| 37 |
+
**Returns**
|
| 38 |
+
|
| 39 |
+
| Name | Type | Description |
|
| 40 |
+
|---------|------------------|-------------------------------------------------|
|
| 41 |
+
| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. |
|
| 42 |
+
|
| 43 |
+
**Example**
|
| 44 |
+
|
| 45 |
+
```js
|
| 46 |
+
bytes(1024);
|
| 47 |
+
// output: '1KB'
|
| 48 |
+
|
| 49 |
+
bytes('1KB');
|
| 50 |
+
// output: 1024
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
#### bytes.format(number value, [options]): string|null
|
| 54 |
+
|
| 55 |
+
Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is
|
| 56 |
+
rounded.
|
| 57 |
+
|
| 58 |
+
**Arguments**
|
| 59 |
+
|
| 60 |
+
| Name | Type | Description |
|
| 61 |
+
|---------|----------|--------------------|
|
| 62 |
+
| value | `number` | Value in bytes |
|
| 63 |
+
| options | `Object` | Conversion options |
|
| 64 |
+
|
| 65 |
+
**Options**
|
| 66 |
+
|
| 67 |
+
| Property | Type | Description |
|
| 68 |
+
|-------------------|--------|-----------------------------------------------------------------------------------------|
|
| 69 |
+
| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. |
|
| 70 |
+
| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` |
|
| 71 |
+
| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. |
|
| 72 |
+
| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). |
|
| 73 |
+
| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. |
|
| 74 |
+
|
| 75 |
+
**Returns**
|
| 76 |
+
|
| 77 |
+
| Name | Type | Description |
|
| 78 |
+
|---------|------------------|-------------------------------------------------|
|
| 79 |
+
| results | `string`|`null` | Return null upon error. String value otherwise. |
|
| 80 |
+
|
| 81 |
+
**Example**
|
| 82 |
+
|
| 83 |
+
```js
|
| 84 |
+
bytes.format(1024);
|
| 85 |
+
// output: '1KB'
|
| 86 |
+
|
| 87 |
+
bytes.format(1000);
|
| 88 |
+
// output: '1000B'
|
| 89 |
+
|
| 90 |
+
bytes.format(1000, {thousandsSeparator: ' '});
|
| 91 |
+
// output: '1 000B'
|
| 92 |
+
|
| 93 |
+
bytes.format(1024 * 1.7, {decimalPlaces: 0});
|
| 94 |
+
// output: '2KB'
|
| 95 |
+
|
| 96 |
+
bytes.format(1024, {unitSeparator: ' '});
|
| 97 |
+
// output: '1 KB'
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
#### bytes.parse(string|number value): number|null
|
| 101 |
+
|
| 102 |
+
Parse the string value into an integer in bytes. If no unit is given, or `value`
|
| 103 |
+
is a number, it is assumed the value is in bytes.
|
| 104 |
+
|
| 105 |
+
Supported units and abbreviations are as follows and are case-insensitive:
|
| 106 |
+
|
| 107 |
+
* `b` for bytes
|
| 108 |
+
* `kb` for kilobytes
|
| 109 |
+
* `mb` for megabytes
|
| 110 |
+
* `gb` for gigabytes
|
| 111 |
+
* `tb` for terabytes
|
| 112 |
+
* `pb` for petabytes
|
| 113 |
+
|
| 114 |
+
The units are in powers of two, not ten. This means 1kb = 1024b according to this parser.
|
| 115 |
+
|
| 116 |
+
**Arguments**
|
| 117 |
+
|
| 118 |
+
| Name | Type | Description |
|
| 119 |
+
|---------------|--------|--------------------|
|
| 120 |
+
| value | `string`|`number` | String to parse, or number in bytes. |
|
| 121 |
+
|
| 122 |
+
**Returns**
|
| 123 |
+
|
| 124 |
+
| Name | Type | Description |
|
| 125 |
+
|---------|-------------|-------------------------|
|
| 126 |
+
| results | `number`|`null` | Return null upon error. Value in bytes otherwise. |
|
| 127 |
+
|
| 128 |
+
**Example**
|
| 129 |
+
|
| 130 |
+
```js
|
| 131 |
+
bytes.parse('1KB');
|
| 132 |
+
// output: 1024
|
| 133 |
+
|
| 134 |
+
bytes.parse('1024');
|
| 135 |
+
// output: 1024
|
| 136 |
+
|
| 137 |
+
bytes.parse(1024);
|
| 138 |
+
// output: 1024
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
## License
|
| 142 |
+
|
| 143 |
+
[MIT](LICENSE)
|
| 144 |
+
|
| 145 |
+
[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci
|
| 146 |
+
[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci
|
| 147 |
+
[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master
|
| 148 |
+
[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master
|
| 149 |
+
[downloads-image]: https://badgen.net/npm/dm/bytes
|
| 150 |
+
[downloads-url]: https://npmjs.org/package/bytes
|
| 151 |
+
[npm-image]: https://badgen.net/npm/v/bytes
|
| 152 |
+
[npm-url]: https://npmjs.org/package/bytes
|
trump-game/node_modules/bytes/index.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* bytes
|
| 3 |
+
* Copyright(c) 2012-2014 TJ Holowaychuk
|
| 4 |
+
* Copyright(c) 2015 Jed Watson
|
| 5 |
+
* MIT Licensed
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
'use strict';
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Module exports.
|
| 12 |
+
* @public
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
module.exports = bytes;
|
| 16 |
+
module.exports.format = format;
|
| 17 |
+
module.exports.parse = parse;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Module variables.
|
| 21 |
+
* @private
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
| 25 |
+
|
| 26 |
+
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
| 27 |
+
|
| 28 |
+
var map = {
|
| 29 |
+
b: 1,
|
| 30 |
+
kb: 1 << 10,
|
| 31 |
+
mb: 1 << 20,
|
| 32 |
+
gb: 1 << 30,
|
| 33 |
+
tb: Math.pow(1024, 4),
|
| 34 |
+
pb: Math.pow(1024, 5),
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Convert the given value in bytes into a string or parse to string to an integer in bytes.
|
| 41 |
+
*
|
| 42 |
+
* @param {string|number} value
|
| 43 |
+
* @param {{
|
| 44 |
+
* case: [string],
|
| 45 |
+
* decimalPlaces: [number]
|
| 46 |
+
* fixedDecimals: [boolean]
|
| 47 |
+
* thousandsSeparator: [string]
|
| 48 |
+
* unitSeparator: [string]
|
| 49 |
+
* }} [options] bytes options.
|
| 50 |
+
*
|
| 51 |
+
* @returns {string|number|null}
|
| 52 |
+
*/
|
| 53 |
+
|
| 54 |
+
function bytes(value, options) {
|
| 55 |
+
if (typeof value === 'string') {
|
| 56 |
+
return parse(value);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
if (typeof value === 'number') {
|
| 60 |
+
return format(value, options);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return null;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Format the given value in bytes into a string.
|
| 68 |
+
*
|
| 69 |
+
* If the value is negative, it is kept as such. If it is a float,
|
| 70 |
+
* it is rounded.
|
| 71 |
+
*
|
| 72 |
+
* @param {number} value
|
| 73 |
+
* @param {object} [options]
|
| 74 |
+
* @param {number} [options.decimalPlaces=2]
|
| 75 |
+
* @param {number} [options.fixedDecimals=false]
|
| 76 |
+
* @param {string} [options.thousandsSeparator=]
|
| 77 |
+
* @param {string} [options.unit=]
|
| 78 |
+
* @param {string} [options.unitSeparator=]
|
| 79 |
+
*
|
| 80 |
+
* @returns {string|null}
|
| 81 |
+
* @public
|
| 82 |
+
*/
|
| 83 |
+
|
| 84 |
+
function format(value, options) {
|
| 85 |
+
if (!Number.isFinite(value)) {
|
| 86 |
+
return null;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
var mag = Math.abs(value);
|
| 90 |
+
var thousandsSeparator = (options && options.thousandsSeparator) || '';
|
| 91 |
+
var unitSeparator = (options && options.unitSeparator) || '';
|
| 92 |
+
var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
|
| 93 |
+
var fixedDecimals = Boolean(options && options.fixedDecimals);
|
| 94 |
+
var unit = (options && options.unit) || '';
|
| 95 |
+
|
| 96 |
+
if (!unit || !map[unit.toLowerCase()]) {
|
| 97 |
+
if (mag >= map.pb) {
|
| 98 |
+
unit = 'PB';
|
| 99 |
+
} else if (mag >= map.tb) {
|
| 100 |
+
unit = 'TB';
|
| 101 |
+
} else if (mag >= map.gb) {
|
| 102 |
+
unit = 'GB';
|
| 103 |
+
} else if (mag >= map.mb) {
|
| 104 |
+
unit = 'MB';
|
| 105 |
+
} else if (mag >= map.kb) {
|
| 106 |
+
unit = 'KB';
|
| 107 |
+
} else {
|
| 108 |
+
unit = 'B';
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
var val = value / map[unit.toLowerCase()];
|
| 113 |
+
var str = val.toFixed(decimalPlaces);
|
| 114 |
+
|
| 115 |
+
if (!fixedDecimals) {
|
| 116 |
+
str = str.replace(formatDecimalsRegExp, '$1');
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if (thousandsSeparator) {
|
| 120 |
+
str = str.split('.').map(function (s, i) {
|
| 121 |
+
return i === 0
|
| 122 |
+
? s.replace(formatThousandsRegExp, thousandsSeparator)
|
| 123 |
+
: s
|
| 124 |
+
}).join('.');
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
return str + unitSeparator + unit;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/**
|
| 131 |
+
* Parse the string value into an integer in bytes.
|
| 132 |
+
*
|
| 133 |
+
* If no unit is given, it is assumed the value is in bytes.
|
| 134 |
+
*
|
| 135 |
+
* @param {number|string} val
|
| 136 |
+
*
|
| 137 |
+
* @returns {number|null}
|
| 138 |
+
* @public
|
| 139 |
+
*/
|
| 140 |
+
|
| 141 |
+
function parse(val) {
|
| 142 |
+
if (typeof val === 'number' && !isNaN(val)) {
|
| 143 |
+
return val;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
if (typeof val !== 'string') {
|
| 147 |
+
return null;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
// Test if the string passed is valid
|
| 151 |
+
var results = parseRegExp.exec(val);
|
| 152 |
+
var floatValue;
|
| 153 |
+
var unit = 'b';
|
| 154 |
+
|
| 155 |
+
if (!results) {
|
| 156 |
+
// Nothing could be extracted from the given string
|
| 157 |
+
floatValue = parseInt(val, 10);
|
| 158 |
+
unit = 'b'
|
| 159 |
+
} else {
|
| 160 |
+
// Retrieve the value and the unit
|
| 161 |
+
floatValue = parseFloat(results[1]);
|
| 162 |
+
unit = results[4].toLowerCase();
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
if (isNaN(floatValue)) {
|
| 166 |
+
return null;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
return Math.floor(map[unit] * floatValue);
|
| 170 |
+
}
|
trump-game/node_modules/bytes/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "bytes",
|
| 3 |
+
"description": "Utility to parse a string bytes to bytes and vice-versa",
|
| 4 |
+
"version": "3.1.2",
|
| 5 |
+
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
|
| 6 |
+
"contributors": [
|
| 7 |
+
"Jed Watson <jed.watson@me.com>",
|
| 8 |
+
"Théo FIDRY <theo.fidry@gmail.com>"
|
| 9 |
+
],
|
| 10 |
+
"license": "MIT",
|
| 11 |
+
"keywords": [
|
| 12 |
+
"byte",
|
| 13 |
+
"bytes",
|
| 14 |
+
"utility",
|
| 15 |
+
"parse",
|
| 16 |
+
"parser",
|
| 17 |
+
"convert",
|
| 18 |
+
"converter"
|
| 19 |
+
],
|
| 20 |
+
"repository": "visionmedia/bytes.js",
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"eslint": "7.32.0",
|
| 23 |
+
"eslint-plugin-markdown": "2.2.1",
|
| 24 |
+
"mocha": "9.2.0",
|
| 25 |
+
"nyc": "15.1.0"
|
| 26 |
+
},
|
| 27 |
+
"files": [
|
| 28 |
+
"History.md",
|
| 29 |
+
"LICENSE",
|
| 30 |
+
"Readme.md",
|
| 31 |
+
"index.js"
|
| 32 |
+
],
|
| 33 |
+
"engines": {
|
| 34 |
+
"node": ">= 0.8"
|
| 35 |
+
},
|
| 36 |
+
"scripts": {
|
| 37 |
+
"lint": "eslint .",
|
| 38 |
+
"test": "mocha --check-leaks --reporter spec",
|
| 39 |
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
| 40 |
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
| 41 |
+
}
|
| 42 |
+
}
|
trump-game/node_modules/call-bind-apply-helpers/.eslintrc
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"root": true,
|
| 3 |
+
|
| 4 |
+
"extends": "@ljharb",
|
| 5 |
+
|
| 6 |
+
"rules": {
|
| 7 |
+
"func-name-matching": 0,
|
| 8 |
+
"id-length": 0,
|
| 9 |
+
"new-cap": [2, {
|
| 10 |
+
"capIsNewExceptions": [
|
| 11 |
+
"GetIntrinsic",
|
| 12 |
+
],
|
| 13 |
+
}],
|
| 14 |
+
"no-magic-numbers": 0,
|
| 15 |
+
},
|
| 16 |
+
}
|
trump-game/node_modules/call-bind-apply-helpers/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/call-bind-apply-helpers
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
trump-game/node_modules/call-bind-apply-helpers/.nycrc
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"all": true,
|
| 3 |
+
"check-coverage": false,
|
| 4 |
+
"reporter": ["text-summary", "text", "html", "json"],
|
| 5 |
+
"exclude": [
|
| 6 |
+
"coverage",
|
| 7 |
+
"test"
|
| 8 |
+
]
|
| 9 |
+
}
|
trump-game/node_modules/call-bind-apply-helpers/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
|
| 5 |
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
| 6 |
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
+
|
| 8 |
+
## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08
|
| 9 |
+
|
| 10 |
+
### Commits
|
| 11 |
+
|
| 12 |
+
- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8)
|
| 13 |
+
- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75)
|
| 14 |
+
- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940)
|
| 15 |
+
|
| 16 |
+
## v1.0.0 - 2024-12-05
|
| 17 |
+
|
| 18 |
+
### Commits
|
| 19 |
+
|
| 20 |
+
- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04)
|
| 21 |
+
- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f)
|
| 22 |
+
- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603)
|
| 23 |
+
- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930)
|
trump-game/node_modules/call-bind-apply-helpers/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024 Jordan Harband
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
trump-game/node_modules/call-bind-apply-helpers/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# call-bind-apply-helpers <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
| 2 |
+
|
| 3 |
+
[![github actions][actions-image]][actions-url]
|
| 4 |
+
[![coverage][codecov-image]][codecov-url]
|
| 5 |
+
[![dependency status][deps-svg]][deps-url]
|
| 6 |
+
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
| 7 |
+
[![License][license-image]][license-url]
|
| 8 |
+
[![Downloads][downloads-image]][downloads-url]
|
| 9 |
+
|
| 10 |
+
[![npm badge][npm-badge-png]][package-url]
|
| 11 |
+
|
| 12 |
+
Helper functions around Function call/apply/bind, for use in `call-bind`.
|
| 13 |
+
|
| 14 |
+
The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`.
|
| 15 |
+
Please use `call-bind` unless you have a very good reason not to.
|
| 16 |
+
|
| 17 |
+
## Getting started
|
| 18 |
+
|
| 19 |
+
```sh
|
| 20 |
+
npm install --save call-bind-apply-helpers
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
## Usage/Examples
|
| 24 |
+
|
| 25 |
+
```js
|
| 26 |
+
const assert = require('assert');
|
| 27 |
+
const callBindBasic = require('call-bind-apply-helpers');
|
| 28 |
+
|
| 29 |
+
function f(a, b) {
|
| 30 |
+
assert.equal(this, 1);
|
| 31 |
+
assert.equal(a, 2);
|
| 32 |
+
assert.equal(b, 3);
|
| 33 |
+
assert.equal(arguments.length, 2);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
const fBound = callBindBasic([f, 1]);
|
| 37 |
+
|
| 38 |
+
delete Function.prototype.call;
|
| 39 |
+
delete Function.prototype.bind;
|
| 40 |
+
|
| 41 |
+
fBound(2, 3);
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Tests
|
| 45 |
+
|
| 46 |
+
Clone the repo, `npm install`, and run `npm test`
|
| 47 |
+
|
| 48 |
+
[package-url]: https://npmjs.org/package/call-bind-apply-helpers
|
| 49 |
+
[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg
|
| 50 |
+
[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg
|
| 51 |
+
[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers
|
| 52 |
+
[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg
|
| 53 |
+
[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies
|
| 54 |
+
[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true
|
| 55 |
+
[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg
|
| 56 |
+
[license-url]: LICENSE
|
| 57 |
+
[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg
|
| 58 |
+
[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers
|
| 59 |
+
[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg
|
| 60 |
+
[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/
|
| 61 |
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers
|
| 62 |
+
[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions
|
trump-game/node_modules/call-bind-apply-helpers/actualApply.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export = Reflect.apply;
|
trump-game/node_modules/call-bind-apply-helpers/actualApply.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var bind = require('function-bind');
|
| 4 |
+
|
| 5 |
+
var $apply = require('./functionApply');
|
| 6 |
+
var $call = require('./functionCall');
|
| 7 |
+
var $reflectApply = require('./reflectApply');
|
| 8 |
+
|
| 9 |
+
/** @type {import('./actualApply')} */
|
| 10 |
+
module.exports = $reflectApply || bind.call($call, $apply);
|
trump-game/node_modules/call-bind-apply-helpers/applyBind.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import actualApply from './actualApply';
|
| 2 |
+
|
| 3 |
+
type TupleSplitHead<T extends any[], N extends number> = T['length'] extends N
|
| 4 |
+
? T
|
| 5 |
+
: T extends [...infer R, any]
|
| 6 |
+
? TupleSplitHead<R, N>
|
| 7 |
+
: never
|
| 8 |
+
|
| 9 |
+
type TupleSplitTail<T, N extends number, O extends any[] = []> = O['length'] extends N
|
| 10 |
+
? T
|
| 11 |
+
: T extends [infer F, ...infer R]
|
| 12 |
+
? TupleSplitTail<[...R], N, [...O, F]>
|
| 13 |
+
: never
|
| 14 |
+
|
| 15 |
+
type TupleSplit<T extends any[], N extends number> = [TupleSplitHead<T, N>, TupleSplitTail<T, N>]
|
| 16 |
+
|
| 17 |
+
declare function applyBind(...args: TupleSplit<Parameters<typeof actualApply>, 2>[1]): ReturnType<typeof actualApply>;
|
| 18 |
+
|
| 19 |
+
export = applyBind;
|
trump-game/node_modules/call-bind-apply-helpers/applyBind.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var bind = require('function-bind');
|
| 4 |
+
var $apply = require('./functionApply');
|
| 5 |
+
var actualApply = require('./actualApply');
|
| 6 |
+
|
| 7 |
+
/** @type {import('./applyBind')} */
|
| 8 |
+
module.exports = function applyBind() {
|
| 9 |
+
return actualApply(bind, $apply, arguments);
|
| 10 |
+
};
|
trump-game/node_modules/call-bind-apply-helpers/functionApply.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export = Function.prototype.apply;
|
trump-game/node_modules/call-bind-apply-helpers/functionApply.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./functionApply')} */
|
| 4 |
+
module.exports = Function.prototype.apply;
|
trump-game/node_modules/call-bind-apply-helpers/functionCall.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export = Function.prototype.call;
|
trump-game/node_modules/call-bind-apply-helpers/functionCall.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./functionCall')} */
|
| 4 |
+
module.exports = Function.prototype.call;
|
trump-game/node_modules/call-bind-apply-helpers/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type RemoveFromTuple<
|
| 2 |
+
Tuple extends unknown[],
|
| 3 |
+
RemoveCount extends number,
|
| 4 |
+
Index extends 1[] = []
|
| 5 |
+
> = Index["length"] extends RemoveCount
|
| 6 |
+
? Tuple
|
| 7 |
+
: Tuple extends [first: unknown, ...infer Rest]
|
| 8 |
+
? RemoveFromTuple<Rest, RemoveCount, [...Index, 1]>
|
| 9 |
+
: Tuple;
|
| 10 |
+
|
| 11 |
+
type ConcatTuples<
|
| 12 |
+
Prefix extends unknown[],
|
| 13 |
+
Suffix extends unknown[]
|
| 14 |
+
> = [...Prefix, ...Suffix];
|
| 15 |
+
|
| 16 |
+
type ReplaceThis<T, NewThis> = T extends (this: infer OldThis, ...args: infer A) => infer R
|
| 17 |
+
? (this: NewThis, ...args: A) => R
|
| 18 |
+
: never;
|
| 19 |
+
|
| 20 |
+
type BindFunction<
|
| 21 |
+
TThis,
|
| 22 |
+
T extends (this: TThis, ...args: any[]) => any, // Allow specific types to propagate
|
| 23 |
+
TBoundArgs extends unknown[],
|
| 24 |
+
ReceiverBound extends boolean
|
| 25 |
+
> = ReceiverBound extends true
|
| 26 |
+
? (...args: RemoveFromTuple<Parameters<T>, TBoundArgs["length"] & number>) => ReturnType<ReplaceThis<T, TThis>>
|
| 27 |
+
: (...args: ConcatTuples<[TThis], RemoveFromTuple<Parameters<T>, TBoundArgs["length"] & number>>) => ReturnType<T>;
|
| 28 |
+
|
| 29 |
+
declare function callBind<
|
| 30 |
+
TThis,
|
| 31 |
+
T extends (this: TThis, ...args: any[]) => any,
|
| 32 |
+
TBoundArgs extends Partial<Parameters<T>>
|
| 33 |
+
>(
|
| 34 |
+
args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
|
| 35 |
+
): BindFunction<TThis, T, TBoundArgs, true>;
|
| 36 |
+
|
| 37 |
+
declare function callBind<
|
| 38 |
+
TThis,
|
| 39 |
+
T extends (this: TThis, ...args: any[]) => any,
|
| 40 |
+
TBoundArgs extends Partial<Parameters<T>>
|
| 41 |
+
>(
|
| 42 |
+
args: [fn: T, ...boundArgs: TBoundArgs]
|
| 43 |
+
): BindFunction<TThis, T, TBoundArgs, false>;
|
| 44 |
+
|
| 45 |
+
export as namespace callBind;
|
| 46 |
+
export = callBind;
|
trump-game/node_modules/call-bind-apply-helpers/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var bind = require('function-bind');
|
| 4 |
+
var $TypeError = require('es-errors/type');
|
| 5 |
+
|
| 6 |
+
var $call = require('./functionCall');
|
| 7 |
+
var $actualApply = require('./actualApply');
|
| 8 |
+
|
| 9 |
+
/** @type {import('.')} */
|
| 10 |
+
module.exports = function callBindBasic(args) {
|
| 11 |
+
if (args.length < 1 || typeof args[0] !== 'function') {
|
| 12 |
+
throw new $TypeError('a function is required');
|
| 13 |
+
}
|
| 14 |
+
return $actualApply(bind, $call, args);
|
| 15 |
+
};
|
trump-game/node_modules/call-bind-apply-helpers/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "call-bind-apply-helpers",
|
| 3 |
+
"version": "1.0.1",
|
| 4 |
+
"description": "Helper functions around Function call/apply/bind, for use in `call-bind`",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"exports": {
|
| 7 |
+
".": "./index.js",
|
| 8 |
+
"./actualApply": "./actualApply.js",
|
| 9 |
+
"./applyBind": "./applyBind.js",
|
| 10 |
+
"./functionApply": "./functionApply.js",
|
| 11 |
+
"./functionCall": "./functionCall.js",
|
| 12 |
+
"./reflectApply": "./reflectApply.js",
|
| 13 |
+
"./package.json": "./package.json"
|
| 14 |
+
},
|
| 15 |
+
"scripts": {
|
| 16 |
+
"prepack": "npmignore --auto --commentLines=auto",
|
| 17 |
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
| 18 |
+
"prepublishOnly": "safe-publish-latest",
|
| 19 |
+
"prelint": "evalmd README.md",
|
| 20 |
+
"lint": "eslint --ext=.js,.mjs .",
|
| 21 |
+
"postlint": "tsc -p . && attw -P",
|
| 22 |
+
"pretest": "npm run lint",
|
| 23 |
+
"tests-only": "nyc tape 'test/**/*.js'",
|
| 24 |
+
"test": "npm run tests-only",
|
| 25 |
+
"posttest": "npx npm@'>=10.2' audit --production",
|
| 26 |
+
"version": "auto-changelog && git add CHANGELOG.md",
|
| 27 |
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
| 28 |
+
},
|
| 29 |
+
"repository": {
|
| 30 |
+
"type": "git",
|
| 31 |
+
"url": "git+https://github.com/ljharb/call-bind-apply-helpers.git"
|
| 32 |
+
},
|
| 33 |
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
| 34 |
+
"license": "MIT",
|
| 35 |
+
"bugs": {
|
| 36 |
+
"url": "https://github.com/ljharb/call-bind-apply-helpers/issues"
|
| 37 |
+
},
|
| 38 |
+
"homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme",
|
| 39 |
+
"dependencies": {
|
| 40 |
+
"es-errors": "^1.3.0",
|
| 41 |
+
"function-bind": "^1.1.2"
|
| 42 |
+
},
|
| 43 |
+
"devDependencies": {
|
| 44 |
+
"@arethetypeswrong/cli": "^0.17.1",
|
| 45 |
+
"@ljharb/eslint-config": "^21.1.1",
|
| 46 |
+
"@ljharb/tsconfig": "^0.2.2",
|
| 47 |
+
"@types/for-each": "^0.3.3",
|
| 48 |
+
"@types/function-bind": "^1.1.10",
|
| 49 |
+
"@types/object-inspect": "^1.13.0",
|
| 50 |
+
"@types/tape": "^5.6.5",
|
| 51 |
+
"auto-changelog": "^2.5.0",
|
| 52 |
+
"encoding": "^0.1.13",
|
| 53 |
+
"es-value-fixtures": "^1.5.0",
|
| 54 |
+
"eslint": "=8.8.0",
|
| 55 |
+
"evalmd": "^0.0.19",
|
| 56 |
+
"for-each": "^0.3.3",
|
| 57 |
+
"has-strict-mode": "^1.0.1",
|
| 58 |
+
"in-publish": "^2.0.1",
|
| 59 |
+
"npmignore": "^0.3.1",
|
| 60 |
+
"nyc": "^10.3.2",
|
| 61 |
+
"object-inspect": "^1.13.3",
|
| 62 |
+
"safe-publish-latest": "^2.0.0",
|
| 63 |
+
"tape": "^5.9.0",
|
| 64 |
+
"typescript": "next"
|
| 65 |
+
},
|
| 66 |
+
"testling": {
|
| 67 |
+
"files": "test/index.js"
|
| 68 |
+
},
|
| 69 |
+
"auto-changelog": {
|
| 70 |
+
"output": "CHANGELOG.md",
|
| 71 |
+
"template": "keepachangelog",
|
| 72 |
+
"unreleased": false,
|
| 73 |
+
"commitLimit": false,
|
| 74 |
+
"backfillLimit": false,
|
| 75 |
+
"hideCredit": true
|
| 76 |
+
},
|
| 77 |
+
"publishConfig": {
|
| 78 |
+
"ignore": [
|
| 79 |
+
".github/workflows"
|
| 80 |
+
]
|
| 81 |
+
},
|
| 82 |
+
"engines": {
|
| 83 |
+
"node": ">= 0.4"
|
| 84 |
+
}
|
| 85 |
+
}
|
trump-game/node_modules/call-bind-apply-helpers/reflectApply.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const reflectApply: false | typeof Reflect.apply;
|
| 2 |
+
|
| 3 |
+
export = reflectApply;
|
trump-game/node_modules/call-bind-apply-helpers/reflectApply.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./reflectApply')} */
|
| 4 |
+
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
trump-game/node_modules/call-bind-apply-helpers/test/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var callBind = require('../');
|
| 4 |
+
var hasStrictMode = require('has-strict-mode')();
|
| 5 |
+
var forEach = require('for-each');
|
| 6 |
+
var inspect = require('object-inspect');
|
| 7 |
+
var v = require('es-value-fixtures');
|
| 8 |
+
|
| 9 |
+
var test = require('tape');
|
| 10 |
+
|
| 11 |
+
test('callBindBasic', function (t) {
|
| 12 |
+
forEach(v.nonFunctions, function (nonFunction) {
|
| 13 |
+
t['throws'](
|
| 14 |
+
// @ts-expect-error
|
| 15 |
+
function () { callBind([nonFunction]); },
|
| 16 |
+
TypeError,
|
| 17 |
+
inspect(nonFunction) + ' is not a function'
|
| 18 |
+
);
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
var sentinel = { sentinel: true };
|
| 22 |
+
/** @type {<T>(this: T, a: number, b: number) => [T | undefined, number, number]} */
|
| 23 |
+
var func = function (a, b) {
|
| 24 |
+
// eslint-disable-next-line no-invalid-this
|
| 25 |
+
return [!hasStrictMode && this === global ? undefined : this, a, b];
|
| 26 |
+
};
|
| 27 |
+
t.equal(func.length, 2, 'original function length is 2');
|
| 28 |
+
|
| 29 |
+
/** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */
|
| 30 |
+
var bound = callBind([func]);
|
| 31 |
+
/** type {((a: number, b: number) => [sentinel, typeof a, typeof b])} */
|
| 32 |
+
var boundR = callBind([func, sentinel]);
|
| 33 |
+
/** type {((b: number) => [sentinel, number, typeof b])} */
|
| 34 |
+
var boundArg = callBind([func, sentinel, 1]);
|
| 35 |
+
|
| 36 |
+
// @ts-expect-error
|
| 37 |
+
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args');
|
| 38 |
+
|
| 39 |
+
// @ts-expect-error
|
| 40 |
+
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
|
| 41 |
+
// @ts-expect-error
|
| 42 |
+
t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args');
|
| 43 |
+
// @ts-expect-error
|
| 44 |
+
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
|
| 45 |
+
// @ts-expect-error
|
| 46 |
+
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
|
| 47 |
+
|
| 48 |
+
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
|
| 49 |
+
t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args');
|
| 50 |
+
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
|
| 51 |
+
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
|
| 52 |
+
|
| 53 |
+
// @ts-expect-error
|
| 54 |
+
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
|
| 55 |
+
// @ts-expect-error
|
| 56 |
+
t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args');
|
| 57 |
+
// @ts-expect-error
|
| 58 |
+
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
|
| 59 |
+
// @ts-expect-error
|
| 60 |
+
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
|
| 61 |
+
|
| 62 |
+
t.end();
|
| 63 |
+
});
|