chokun7788 commited on
Commit
838cfca
·
verified ·
1 Parent(s): c068aa3

Delete test

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. test/Dockerfile +0 -7
  2. test/node_modules/.package-lock.json +0 -845
  3. test/node_modules/accepts/HISTORY.md +0 -250
  4. test/node_modules/accepts/LICENSE +0 -23
  5. test/node_modules/accepts/README.md +0 -140
  6. test/node_modules/accepts/index.js +0 -238
  7. test/node_modules/accepts/package.json +0 -47
  8. test/node_modules/body-parser/LICENSE +0 -23
  9. test/node_modules/body-parser/README.md +0 -494
  10. test/node_modules/body-parser/index.js +0 -71
  11. test/node_modules/body-parser/lib/read.js +0 -247
  12. test/node_modules/body-parser/lib/types/json.js +0 -158
  13. test/node_modules/body-parser/lib/types/raw.js +0 -42
  14. test/node_modules/body-parser/lib/types/text.js +0 -36
  15. test/node_modules/body-parser/lib/types/urlencoded.js +0 -142
  16. test/node_modules/body-parser/lib/utils.js +0 -98
  17. test/node_modules/body-parser/package.json +0 -52
  18. test/node_modules/bytes/History.md +0 -97
  19. test/node_modules/bytes/LICENSE +0 -23
  20. test/node_modules/bytes/Readme.md +0 -152
  21. test/node_modules/bytes/index.js +0 -170
  22. test/node_modules/bytes/package.json +0 -42
  23. test/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  24. test/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  25. test/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  26. test/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  27. test/node_modules/call-bind-apply-helpers/LICENSE +0 -21
  28. test/node_modules/call-bind-apply-helpers/README.md +0 -62
  29. test/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  30. test/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  31. test/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  32. test/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  33. test/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  34. test/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  35. test/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  36. test/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  37. test/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  38. test/node_modules/call-bind-apply-helpers/index.js +0 -15
  39. test/node_modules/call-bind-apply-helpers/package.json +0 -85
  40. test/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  41. test/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  42. test/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  43. test/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  44. test/node_modules/call-bound/.eslintrc +0 -13
  45. test/node_modules/call-bound/.github/FUNDING.yml +0 -12
  46. test/node_modules/call-bound/.nycrc +0 -9
  47. test/node_modules/call-bound/CHANGELOG.md +0 -42
  48. test/node_modules/call-bound/LICENSE +0 -21
  49. test/node_modules/call-bound/README.md +0 -53
  50. test/node_modules/call-bound/index.d.ts +0 -94
test/Dockerfile DELETED
@@ -1,7 +0,0 @@
1
- FROM node:18-slim
2
- WORKDIR /app
3
- COPY package*.json ./
4
- RUN npm install
5
- COPY . .
6
- EXPOSE 7860
7
- CMD ["node", "server.js"]
 
 
 
 
 
 
 
 
test/node_modules/.package-lock.json DELETED
@@ -1,845 +0,0 @@
1
- {
2
- "name": "test",
3
- "version": "1.0.0",
4
- "lockfileVersion": 3,
5
- "requires": true,
6
- "packages": {
7
- "node_modules/accepts": {
8
- "version": "2.0.0",
9
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
10
- "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
11
- "license": "MIT",
12
- "dependencies": {
13
- "mime-types": "^3.0.0",
14
- "negotiator": "^1.0.0"
15
- },
16
- "engines": {
17
- "node": ">= 0.6"
18
- }
19
- },
20
- "node_modules/body-parser": {
21
- "version": "2.2.2",
22
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",
23
- "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",
24
- "license": "MIT",
25
- "dependencies": {
26
- "bytes": "^3.1.2",
27
- "content-type": "^1.0.5",
28
- "debug": "^4.4.3",
29
- "http-errors": "^2.0.0",
30
- "iconv-lite": "^0.7.0",
31
- "on-finished": "^2.4.1",
32
- "qs": "^6.14.1",
33
- "raw-body": "^3.0.1",
34
- "type-is": "^2.0.1"
35
- },
36
- "engines": {
37
- "node": ">=18"
38
- },
39
- "funding": {
40
- "type": "opencollective",
41
- "url": "https://opencollective.com/express"
42
- }
43
- },
44
- "node_modules/bytes": {
45
- "version": "3.1.2",
46
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
47
- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
48
- "license": "MIT",
49
- "engines": {
50
- "node": ">= 0.8"
51
- }
52
- },
53
- "node_modules/call-bind-apply-helpers": {
54
- "version": "1.0.2",
55
- "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
56
- "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
57
- "license": "MIT",
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.4",
68
- "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
69
- "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
70
- "license": "MIT",
71
- "dependencies": {
72
- "call-bind-apply-helpers": "^1.0.2",
73
- "get-intrinsic": "^1.3.0"
74
- },
75
- "engines": {
76
- "node": ">= 0.4"
77
- },
78
- "funding": {
79
- "url": "https://github.com/sponsors/ljharb"
80
- }
81
- },
82
- "node_modules/content-disposition": {
83
- "version": "1.0.1",
84
- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz",
85
- "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==",
86
- "license": "MIT",
87
- "engines": {
88
- "node": ">=18"
89
- },
90
- "funding": {
91
- "type": "opencollective",
92
- "url": "https://opencollective.com/express"
93
- }
94
- },
95
- "node_modules/content-type": {
96
- "version": "1.0.5",
97
- "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
98
- "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
99
- "license": "MIT",
100
- "engines": {
101
- "node": ">= 0.6"
102
- }
103
- },
104
- "node_modules/cookie": {
105
- "version": "0.7.2",
106
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
107
- "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
108
- "license": "MIT",
109
- "engines": {
110
- "node": ">= 0.6"
111
- }
112
- },
113
- "node_modules/cookie-signature": {
114
- "version": "1.2.2",
115
- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
116
- "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
117
- "license": "MIT",
118
- "engines": {
119
- "node": ">=6.6.0"
120
- }
121
- },
122
- "node_modules/cors": {
123
- "version": "2.8.6",
124
- "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
125
- "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
126
- "license": "MIT",
127
- "dependencies": {
128
- "object-assign": "^4",
129
- "vary": "^1"
130
- },
131
- "engines": {
132
- "node": ">= 0.10"
133
- },
134
- "funding": {
135
- "type": "opencollective",
136
- "url": "https://opencollective.com/express"
137
- }
138
- },
139
- "node_modules/debug": {
140
- "version": "4.4.3",
141
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
142
- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
143
- "license": "MIT",
144
- "dependencies": {
145
- "ms": "^2.1.3"
146
- },
147
- "engines": {
148
- "node": ">=6.0"
149
- },
150
- "peerDependenciesMeta": {
151
- "supports-color": {
152
- "optional": true
153
- }
154
- }
155
- },
156
- "node_modules/depd": {
157
- "version": "2.0.0",
158
- "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
159
- "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
160
- "license": "MIT",
161
- "engines": {
162
- "node": ">= 0.8"
163
- }
164
- },
165
- "node_modules/dunder-proto": {
166
- "version": "1.0.1",
167
- "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
168
- "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
169
- "license": "MIT",
170
- "dependencies": {
171
- "call-bind-apply-helpers": "^1.0.1",
172
- "es-errors": "^1.3.0",
173
- "gopd": "^1.2.0"
174
- },
175
- "engines": {
176
- "node": ">= 0.4"
177
- }
178
- },
179
- "node_modules/ee-first": {
180
- "version": "1.1.1",
181
- "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
182
- "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
183
- "license": "MIT"
184
- },
185
- "node_modules/encodeurl": {
186
- "version": "2.0.0",
187
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
188
- "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
189
- "license": "MIT",
190
- "engines": {
191
- "node": ">= 0.8"
192
- }
193
- },
194
- "node_modules/es-define-property": {
195
- "version": "1.0.1",
196
- "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
197
- "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
198
- "license": "MIT",
199
- "engines": {
200
- "node": ">= 0.4"
201
- }
202
- },
203
- "node_modules/es-errors": {
204
- "version": "1.3.0",
205
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
206
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
207
- "license": "MIT",
208
- "engines": {
209
- "node": ">= 0.4"
210
- }
211
- },
212
- "node_modules/es-object-atoms": {
213
- "version": "1.1.1",
214
- "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
215
- "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
216
- "license": "MIT",
217
- "dependencies": {
218
- "es-errors": "^1.3.0"
219
- },
220
- "engines": {
221
- "node": ">= 0.4"
222
- }
223
- },
224
- "node_modules/escape-html": {
225
- "version": "1.0.3",
226
- "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
227
- "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
228
- "license": "MIT"
229
- },
230
- "node_modules/etag": {
231
- "version": "1.8.1",
232
- "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
233
- "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
234
- "license": "MIT",
235
- "engines": {
236
- "node": ">= 0.6"
237
- }
238
- },
239
- "node_modules/express": {
240
- "version": "5.2.1",
241
- "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
242
- "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
243
- "license": "MIT",
244
- "dependencies": {
245
- "accepts": "^2.0.0",
246
- "body-parser": "^2.2.1",
247
- "content-disposition": "^1.0.0",
248
- "content-type": "^1.0.5",
249
- "cookie": "^0.7.1",
250
- "cookie-signature": "^1.2.1",
251
- "debug": "^4.4.0",
252
- "depd": "^2.0.0",
253
- "encodeurl": "^2.0.0",
254
- "escape-html": "^1.0.3",
255
- "etag": "^1.8.1",
256
- "finalhandler": "^2.1.0",
257
- "fresh": "^2.0.0",
258
- "http-errors": "^2.0.0",
259
- "merge-descriptors": "^2.0.0",
260
- "mime-types": "^3.0.0",
261
- "on-finished": "^2.4.1",
262
- "once": "^1.4.0",
263
- "parseurl": "^1.3.3",
264
- "proxy-addr": "^2.0.7",
265
- "qs": "^6.14.0",
266
- "range-parser": "^1.2.1",
267
- "router": "^2.2.0",
268
- "send": "^1.1.0",
269
- "serve-static": "^2.2.0",
270
- "statuses": "^2.0.1",
271
- "type-is": "^2.0.1",
272
- "vary": "^1.1.2"
273
- },
274
- "engines": {
275
- "node": ">= 18"
276
- },
277
- "funding": {
278
- "type": "opencollective",
279
- "url": "https://opencollective.com/express"
280
- }
281
- },
282
- "node_modules/finalhandler": {
283
- "version": "2.1.1",
284
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
285
- "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
286
- "license": "MIT",
287
- "dependencies": {
288
- "debug": "^4.4.0",
289
- "encodeurl": "^2.0.0",
290
- "escape-html": "^1.0.3",
291
- "on-finished": "^2.4.1",
292
- "parseurl": "^1.3.3",
293
- "statuses": "^2.0.1"
294
- },
295
- "engines": {
296
- "node": ">= 18.0.0"
297
- },
298
- "funding": {
299
- "type": "opencollective",
300
- "url": "https://opencollective.com/express"
301
- }
302
- },
303
- "node_modules/forwarded": {
304
- "version": "0.2.0",
305
- "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
306
- "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
307
- "license": "MIT",
308
- "engines": {
309
- "node": ">= 0.6"
310
- }
311
- },
312
- "node_modules/fresh": {
313
- "version": "2.0.0",
314
- "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
315
- "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
316
- "license": "MIT",
317
- "engines": {
318
- "node": ">= 0.8"
319
- }
320
- },
321
- "node_modules/function-bind": {
322
- "version": "1.1.2",
323
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
324
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
325
- "license": "MIT",
326
- "funding": {
327
- "url": "https://github.com/sponsors/ljharb"
328
- }
329
- },
330
- "node_modules/get-intrinsic": {
331
- "version": "1.3.0",
332
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
333
- "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
334
- "license": "MIT",
335
- "dependencies": {
336
- "call-bind-apply-helpers": "^1.0.2",
337
- "es-define-property": "^1.0.1",
338
- "es-errors": "^1.3.0",
339
- "es-object-atoms": "^1.1.1",
340
- "function-bind": "^1.1.2",
341
- "get-proto": "^1.0.1",
342
- "gopd": "^1.2.0",
343
- "has-symbols": "^1.1.0",
344
- "hasown": "^2.0.2",
345
- "math-intrinsics": "^1.1.0"
346
- },
347
- "engines": {
348
- "node": ">= 0.4"
349
- },
350
- "funding": {
351
- "url": "https://github.com/sponsors/ljharb"
352
- }
353
- },
354
- "node_modules/get-proto": {
355
- "version": "1.0.1",
356
- "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
357
- "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
358
- "license": "MIT",
359
- "dependencies": {
360
- "dunder-proto": "^1.0.1",
361
- "es-object-atoms": "^1.0.0"
362
- },
363
- "engines": {
364
- "node": ">= 0.4"
365
- }
366
- },
367
- "node_modules/gopd": {
368
- "version": "1.2.0",
369
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
370
- "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
371
- "license": "MIT",
372
- "engines": {
373
- "node": ">= 0.4"
374
- },
375
- "funding": {
376
- "url": "https://github.com/sponsors/ljharb"
377
- }
378
- },
379
- "node_modules/has-symbols": {
380
- "version": "1.1.0",
381
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
382
- "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
383
- "license": "MIT",
384
- "engines": {
385
- "node": ">= 0.4"
386
- },
387
- "funding": {
388
- "url": "https://github.com/sponsors/ljharb"
389
- }
390
- },
391
- "node_modules/hasown": {
392
- "version": "2.0.2",
393
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
394
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
395
- "license": "MIT",
396
- "dependencies": {
397
- "function-bind": "^1.1.2"
398
- },
399
- "engines": {
400
- "node": ">= 0.4"
401
- }
402
- },
403
- "node_modules/http-errors": {
404
- "version": "2.0.1",
405
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
406
- "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
407
- "license": "MIT",
408
- "dependencies": {
409
- "depd": "~2.0.0",
410
- "inherits": "~2.0.4",
411
- "setprototypeof": "~1.2.0",
412
- "statuses": "~2.0.2",
413
- "toidentifier": "~1.0.1"
414
- },
415
- "engines": {
416
- "node": ">= 0.8"
417
- },
418
- "funding": {
419
- "type": "opencollective",
420
- "url": "https://opencollective.com/express"
421
- }
422
- },
423
- "node_modules/iconv-lite": {
424
- "version": "0.7.2",
425
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
426
- "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
427
- "license": "MIT",
428
- "dependencies": {
429
- "safer-buffer": ">= 2.1.2 < 3.0.0"
430
- },
431
- "engines": {
432
- "node": ">=0.10.0"
433
- },
434
- "funding": {
435
- "type": "opencollective",
436
- "url": "https://opencollective.com/express"
437
- }
438
- },
439
- "node_modules/inherits": {
440
- "version": "2.0.4",
441
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
442
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
443
- "license": "ISC"
444
- },
445
- "node_modules/ipaddr.js": {
446
- "version": "1.9.1",
447
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
448
- "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
449
- "license": "MIT",
450
- "engines": {
451
- "node": ">= 0.10"
452
- }
453
- },
454
- "node_modules/is-promise": {
455
- "version": "4.0.0",
456
- "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
457
- "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
458
- "license": "MIT"
459
- },
460
- "node_modules/math-intrinsics": {
461
- "version": "1.1.0",
462
- "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
463
- "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
464
- "license": "MIT",
465
- "engines": {
466
- "node": ">= 0.4"
467
- }
468
- },
469
- "node_modules/media-typer": {
470
- "version": "1.1.0",
471
- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
472
- "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
473
- "license": "MIT",
474
- "engines": {
475
- "node": ">= 0.8"
476
- }
477
- },
478
- "node_modules/merge-descriptors": {
479
- "version": "2.0.0",
480
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
481
- "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
482
- "license": "MIT",
483
- "engines": {
484
- "node": ">=18"
485
- },
486
- "funding": {
487
- "url": "https://github.com/sponsors/sindresorhus"
488
- }
489
- },
490
- "node_modules/mime-db": {
491
- "version": "1.54.0",
492
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
493
- "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
494
- "license": "MIT",
495
- "engines": {
496
- "node": ">= 0.6"
497
- }
498
- },
499
- "node_modules/mime-types": {
500
- "version": "3.0.2",
501
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
502
- "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
503
- "license": "MIT",
504
- "dependencies": {
505
- "mime-db": "^1.54.0"
506
- },
507
- "engines": {
508
- "node": ">=18"
509
- },
510
- "funding": {
511
- "type": "opencollective",
512
- "url": "https://opencollective.com/express"
513
- }
514
- },
515
- "node_modules/ms": {
516
- "version": "2.1.3",
517
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
518
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
519
- "license": "MIT"
520
- },
521
- "node_modules/negotiator": {
522
- "version": "1.0.0",
523
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
524
- "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
525
- "license": "MIT",
526
- "engines": {
527
- "node": ">= 0.6"
528
- }
529
- },
530
- "node_modules/object-assign": {
531
- "version": "4.1.1",
532
- "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
533
- "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
534
- "license": "MIT",
535
- "engines": {
536
- "node": ">=0.10.0"
537
- }
538
- },
539
- "node_modules/object-inspect": {
540
- "version": "1.13.4",
541
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
542
- "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
543
- "license": "MIT",
544
- "engines": {
545
- "node": ">= 0.4"
546
- },
547
- "funding": {
548
- "url": "https://github.com/sponsors/ljharb"
549
- }
550
- },
551
- "node_modules/on-finished": {
552
- "version": "2.4.1",
553
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
554
- "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
555
- "license": "MIT",
556
- "dependencies": {
557
- "ee-first": "1.1.1"
558
- },
559
- "engines": {
560
- "node": ">= 0.8"
561
- }
562
- },
563
- "node_modules/once": {
564
- "version": "1.4.0",
565
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
566
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
567
- "license": "ISC",
568
- "dependencies": {
569
- "wrappy": "1"
570
- }
571
- },
572
- "node_modules/parseurl": {
573
- "version": "1.3.3",
574
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
575
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
576
- "license": "MIT",
577
- "engines": {
578
- "node": ">= 0.8"
579
- }
580
- },
581
- "node_modules/path-to-regexp": {
582
- "version": "8.3.0",
583
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
584
- "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
585
- "license": "MIT",
586
- "funding": {
587
- "type": "opencollective",
588
- "url": "https://opencollective.com/express"
589
- }
590
- },
591
- "node_modules/proxy-addr": {
592
- "version": "2.0.7",
593
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
594
- "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
595
- "license": "MIT",
596
- "dependencies": {
597
- "forwarded": "0.2.0",
598
- "ipaddr.js": "1.9.1"
599
- },
600
- "engines": {
601
- "node": ">= 0.10"
602
- }
603
- },
604
- "node_modules/qs": {
605
- "version": "6.15.0",
606
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz",
607
- "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==",
608
- "license": "BSD-3-Clause",
609
- "dependencies": {
610
- "side-channel": "^1.1.0"
611
- },
612
- "engines": {
613
- "node": ">=0.6"
614
- },
615
- "funding": {
616
- "url": "https://github.com/sponsors/ljharb"
617
- }
618
- },
619
- "node_modules/range-parser": {
620
- "version": "1.2.1",
621
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
622
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
623
- "license": "MIT",
624
- "engines": {
625
- "node": ">= 0.6"
626
- }
627
- },
628
- "node_modules/raw-body": {
629
- "version": "3.0.2",
630
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
631
- "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
632
- "license": "MIT",
633
- "dependencies": {
634
- "bytes": "~3.1.2",
635
- "http-errors": "~2.0.1",
636
- "iconv-lite": "~0.7.0",
637
- "unpipe": "~1.0.0"
638
- },
639
- "engines": {
640
- "node": ">= 0.10"
641
- }
642
- },
643
- "node_modules/router": {
644
- "version": "2.2.0",
645
- "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
646
- "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
647
- "license": "MIT",
648
- "dependencies": {
649
- "debug": "^4.4.0",
650
- "depd": "^2.0.0",
651
- "is-promise": "^4.0.0",
652
- "parseurl": "^1.3.3",
653
- "path-to-regexp": "^8.0.0"
654
- },
655
- "engines": {
656
- "node": ">= 18"
657
- }
658
- },
659
- "node_modules/safer-buffer": {
660
- "version": "2.1.2",
661
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
662
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
663
- "license": "MIT"
664
- },
665
- "node_modules/send": {
666
- "version": "1.2.1",
667
- "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
668
- "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
669
- "license": "MIT",
670
- "dependencies": {
671
- "debug": "^4.4.3",
672
- "encodeurl": "^2.0.0",
673
- "escape-html": "^1.0.3",
674
- "etag": "^1.8.1",
675
- "fresh": "^2.0.0",
676
- "http-errors": "^2.0.1",
677
- "mime-types": "^3.0.2",
678
- "ms": "^2.1.3",
679
- "on-finished": "^2.4.1",
680
- "range-parser": "^1.2.1",
681
- "statuses": "^2.0.2"
682
- },
683
- "engines": {
684
- "node": ">= 18"
685
- },
686
- "funding": {
687
- "type": "opencollective",
688
- "url": "https://opencollective.com/express"
689
- }
690
- },
691
- "node_modules/serve-static": {
692
- "version": "2.2.1",
693
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
694
- "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
695
- "license": "MIT",
696
- "dependencies": {
697
- "encodeurl": "^2.0.0",
698
- "escape-html": "^1.0.3",
699
- "parseurl": "^1.3.3",
700
- "send": "^1.2.0"
701
- },
702
- "engines": {
703
- "node": ">= 18"
704
- },
705
- "funding": {
706
- "type": "opencollective",
707
- "url": "https://opencollective.com/express"
708
- }
709
- },
710
- "node_modules/setprototypeof": {
711
- "version": "1.2.0",
712
- "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
713
- "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
714
- "license": "ISC"
715
- },
716
- "node_modules/side-channel": {
717
- "version": "1.1.0",
718
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
719
- "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
720
- "license": "MIT",
721
- "dependencies": {
722
- "es-errors": "^1.3.0",
723
- "object-inspect": "^1.13.3",
724
- "side-channel-list": "^1.0.0",
725
- "side-channel-map": "^1.0.1",
726
- "side-channel-weakmap": "^1.0.2"
727
- },
728
- "engines": {
729
- "node": ">= 0.4"
730
- },
731
- "funding": {
732
- "url": "https://github.com/sponsors/ljharb"
733
- }
734
- },
735
- "node_modules/side-channel-list": {
736
- "version": "1.0.0",
737
- "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
738
- "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
739
- "license": "MIT",
740
- "dependencies": {
741
- "es-errors": "^1.3.0",
742
- "object-inspect": "^1.13.3"
743
- },
744
- "engines": {
745
- "node": ">= 0.4"
746
- },
747
- "funding": {
748
- "url": "https://github.com/sponsors/ljharb"
749
- }
750
- },
751
- "node_modules/side-channel-map": {
752
- "version": "1.0.1",
753
- "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
754
- "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
755
- "license": "MIT",
756
- "dependencies": {
757
- "call-bound": "^1.0.2",
758
- "es-errors": "^1.3.0",
759
- "get-intrinsic": "^1.2.5",
760
- "object-inspect": "^1.13.3"
761
- },
762
- "engines": {
763
- "node": ">= 0.4"
764
- },
765
- "funding": {
766
- "url": "https://github.com/sponsors/ljharb"
767
- }
768
- },
769
- "node_modules/side-channel-weakmap": {
770
- "version": "1.0.2",
771
- "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
772
- "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
773
- "license": "MIT",
774
- "dependencies": {
775
- "call-bound": "^1.0.2",
776
- "es-errors": "^1.3.0",
777
- "get-intrinsic": "^1.2.5",
778
- "object-inspect": "^1.13.3",
779
- "side-channel-map": "^1.0.1"
780
- },
781
- "engines": {
782
- "node": ">= 0.4"
783
- },
784
- "funding": {
785
- "url": "https://github.com/sponsors/ljharb"
786
- }
787
- },
788
- "node_modules/statuses": {
789
- "version": "2.0.2",
790
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
791
- "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
792
- "license": "MIT",
793
- "engines": {
794
- "node": ">= 0.8"
795
- }
796
- },
797
- "node_modules/toidentifier": {
798
- "version": "1.0.1",
799
- "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
800
- "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
801
- "license": "MIT",
802
- "engines": {
803
- "node": ">=0.6"
804
- }
805
- },
806
- "node_modules/type-is": {
807
- "version": "2.0.1",
808
- "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
809
- "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
810
- "license": "MIT",
811
- "dependencies": {
812
- "content-type": "^1.0.5",
813
- "media-typer": "^1.1.0",
814
- "mime-types": "^3.0.0"
815
- },
816
- "engines": {
817
- "node": ">= 0.6"
818
- }
819
- },
820
- "node_modules/unpipe": {
821
- "version": "1.0.0",
822
- "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
823
- "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
824
- "license": "MIT",
825
- "engines": {
826
- "node": ">= 0.8"
827
- }
828
- },
829
- "node_modules/vary": {
830
- "version": "1.1.2",
831
- "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
832
- "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
833
- "license": "MIT",
834
- "engines": {
835
- "node": ">= 0.8"
836
- }
837
- },
838
- "node_modules/wrappy": {
839
- "version": "1.0.2",
840
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
841
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
842
- "license": "ISC"
843
- }
844
- }
845
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/accepts/HISTORY.md DELETED
@@ -1,250 +0,0 @@
1
- 2.0.0 / 2024-08-31
2
- ==================
3
-
4
- * Drop node <18 support
5
- * deps: mime-types@^3.0.0
6
- * deps: negotiator@^1.0.0
7
-
8
- 1.3.8 / 2022-02-02
9
- ==================
10
-
11
- * deps: mime-types@~2.1.34
12
- - deps: mime-db@~1.51.0
13
- * deps: negotiator@0.6.3
14
-
15
- 1.3.7 / 2019-04-29
16
- ==================
17
-
18
- * deps: negotiator@0.6.2
19
- - Fix sorting charset, encoding, and language with extra parameters
20
-
21
- 1.3.6 / 2019-04-28
22
- ==================
23
-
24
- * deps: mime-types@~2.1.24
25
- - deps: mime-db@~1.40.0
26
-
27
- 1.3.5 / 2018-02-28
28
- ==================
29
-
30
- * deps: mime-types@~2.1.18
31
- - deps: mime-db@~1.33.0
32
-
33
- 1.3.4 / 2017-08-22
34
- ==================
35
-
36
- * deps: mime-types@~2.1.16
37
- - deps: mime-db@~1.29.0
38
-
39
- 1.3.3 / 2016-05-02
40
- ==================
41
-
42
- * deps: mime-types@~2.1.11
43
- - deps: mime-db@~1.23.0
44
- * deps: negotiator@0.6.1
45
- - perf: improve `Accept` parsing speed
46
- - perf: improve `Accept-Charset` parsing speed
47
- - perf: improve `Accept-Encoding` parsing speed
48
- - perf: improve `Accept-Language` parsing speed
49
-
50
- 1.3.2 / 2016-03-08
51
- ==================
52
-
53
- * deps: mime-types@~2.1.10
54
- - Fix extension of `application/dash+xml`
55
- - Update primary extension for `audio/mp4`
56
- - deps: mime-db@~1.22.0
57
-
58
- 1.3.1 / 2016-01-19
59
- ==================
60
-
61
- * deps: mime-types@~2.1.9
62
- - deps: mime-db@~1.21.0
63
-
64
- 1.3.0 / 2015-09-29
65
- ==================
66
-
67
- * deps: mime-types@~2.1.7
68
- - deps: mime-db@~1.19.0
69
- * deps: negotiator@0.6.0
70
- - Fix including type extensions in parameters in `Accept` parsing
71
- - Fix parsing `Accept` parameters with quoted equals
72
- - Fix parsing `Accept` parameters with quoted semicolons
73
- - Lazy-load modules from main entry point
74
- - perf: delay type concatenation until needed
75
- - perf: enable strict mode
76
- - perf: hoist regular expressions
77
- - perf: remove closures getting spec properties
78
- - perf: remove a closure from media type parsing
79
- - perf: remove property delete from media type parsing
80
-
81
- 1.2.13 / 2015-09-06
82
- ===================
83
-
84
- * deps: mime-types@~2.1.6
85
- - deps: mime-db@~1.18.0
86
-
87
- 1.2.12 / 2015-07-30
88
- ===================
89
-
90
- * deps: mime-types@~2.1.4
91
- - deps: mime-db@~1.16.0
92
-
93
- 1.2.11 / 2015-07-16
94
- ===================
95
-
96
- * deps: mime-types@~2.1.3
97
- - deps: mime-db@~1.15.0
98
-
99
- 1.2.10 / 2015-07-01
100
- ===================
101
-
102
- * deps: mime-types@~2.1.2
103
- - deps: mime-db@~1.14.0
104
-
105
- 1.2.9 / 2015-06-08
106
- ==================
107
-
108
- * deps: mime-types@~2.1.1
109
- - perf: fix deopt during mapping
110
-
111
- 1.2.8 / 2015-06-07
112
- ==================
113
-
114
- * deps: mime-types@~2.1.0
115
- - deps: mime-db@~1.13.0
116
- * perf: avoid argument reassignment & argument slice
117
- * perf: avoid negotiator recursive construction
118
- * perf: enable strict mode
119
- * perf: remove unnecessary bitwise operator
120
-
121
- 1.2.7 / 2015-05-10
122
- ==================
123
-
124
- * deps: negotiator@0.5.3
125
- - Fix media type parameter matching to be case-insensitive
126
-
127
- 1.2.6 / 2015-05-07
128
- ==================
129
-
130
- * deps: mime-types@~2.0.11
131
- - deps: mime-db@~1.9.1
132
- * deps: negotiator@0.5.2
133
- - Fix comparing media types with quoted values
134
- - Fix splitting media types with quoted commas
135
-
136
- 1.2.5 / 2015-03-13
137
- ==================
138
-
139
- * deps: mime-types@~2.0.10
140
- - deps: mime-db@~1.8.0
141
-
142
- 1.2.4 / 2015-02-14
143
- ==================
144
-
145
- * Support Node.js 0.6
146
- * deps: mime-types@~2.0.9
147
- - deps: mime-db@~1.7.0
148
- * deps: negotiator@0.5.1
149
- - Fix preference sorting to be stable for long acceptable lists
150
-
151
- 1.2.3 / 2015-01-31
152
- ==================
153
-
154
- * deps: mime-types@~2.0.8
155
- - deps: mime-db@~1.6.0
156
-
157
- 1.2.2 / 2014-12-30
158
- ==================
159
-
160
- * deps: mime-types@~2.0.7
161
- - deps: mime-db@~1.5.0
162
-
163
- 1.2.1 / 2014-12-30
164
- ==================
165
-
166
- * deps: mime-types@~2.0.5
167
- - deps: mime-db@~1.3.1
168
-
169
- 1.2.0 / 2014-12-19
170
- ==================
171
-
172
- * deps: negotiator@0.5.0
173
- - Fix list return order when large accepted list
174
- - Fix missing identity encoding when q=0 exists
175
- - Remove dynamic building of Negotiator class
176
-
177
- 1.1.4 / 2014-12-10
178
- ==================
179
-
180
- * deps: mime-types@~2.0.4
181
- - deps: mime-db@~1.3.0
182
-
183
- 1.1.3 / 2014-11-09
184
- ==================
185
-
186
- * deps: mime-types@~2.0.3
187
- - deps: mime-db@~1.2.0
188
-
189
- 1.1.2 / 2014-10-14
190
- ==================
191
-
192
- * deps: negotiator@0.4.9
193
- - Fix error when media type has invalid parameter
194
-
195
- 1.1.1 / 2014-09-28
196
- ==================
197
-
198
- * deps: mime-types@~2.0.2
199
- - deps: mime-db@~1.1.0
200
- * deps: negotiator@0.4.8
201
- - Fix all negotiations to be case-insensitive
202
- - Stable sort preferences of same quality according to client order
203
-
204
- 1.1.0 / 2014-09-02
205
- ==================
206
-
207
- * update `mime-types`
208
-
209
- 1.0.7 / 2014-07-04
210
- ==================
211
-
212
- * Fix wrong type returned from `type` when match after unknown extension
213
-
214
- 1.0.6 / 2014-06-24
215
- ==================
216
-
217
- * deps: negotiator@0.4.7
218
-
219
- 1.0.5 / 2014-06-20
220
- ==================
221
-
222
- * fix crash when unknown extension given
223
-
224
- 1.0.4 / 2014-06-19
225
- ==================
226
-
227
- * use `mime-types`
228
-
229
- 1.0.3 / 2014-06-11
230
- ==================
231
-
232
- * deps: negotiator@0.4.6
233
- - Order by specificity when quality is the same
234
-
235
- 1.0.2 / 2014-05-29
236
- ==================
237
-
238
- * Fix interpretation when header not in request
239
- * deps: pin negotiator@0.4.5
240
-
241
- 1.0.1 / 2014-01-18
242
- ==================
243
-
244
- * Identity encoding isn't always acceptable
245
- * deps: negotiator@~0.4.0
246
-
247
- 1.0.0 / 2013-12-27
248
- ==================
249
-
250
- * Genesis
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/accepts/LICENSE DELETED
@@ -1,23 +0,0 @@
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 OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/accepts/README.md DELETED
@@ -1,140 +0,0 @@
1
- # accepts
2
-
3
- [![NPM Version][npm-version-image]][npm-url]
4
- [![NPM Downloads][npm-downloads-image]][npm-url]
5
- [![Node.js Version][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 type 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/accepts/index.js DELETED
@@ -1,238 +0,0 @@
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 {Boolean}
233
- * @private
234
- */
235
-
236
- function validMime (type) {
237
- return typeof type === 'string'
238
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/accepts/package.json DELETED
@@ -1,47 +0,0 @@
1
- {
2
- "name": "accepts",
3
- "description": "Higher-level content negotiation",
4
- "version": "2.0.0",
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": "^3.0.0",
13
- "negotiator": "^1.0.0"
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/LICENSE DELETED
@@ -1,23 +0,0 @@
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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/README.md DELETED
@@ -1,494 +0,0 @@
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/learn/http/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.com/package/busboy#readme) and
27
- [connect-busboy](https://www.npmjs.com/package/connect-busboy#readme)
28
- * [multiparty](https://www.npmjs.com/package/multiparty#readme) and
29
- [connect-multiparty](https://www.npmjs.com/package/connect-multiparty#readme)
30
- * [formidable](https://www.npmjs.com/package/formidable#readme)
31
- * [multer](https://www.npmjs.com/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.com/package/body#readme)
43
- - [co-body](https://www.npmjs.com/package/co-body#readme)
44
-
45
- ## Installation
46
-
47
- ```sh
48
- $ npm install body-parser
49
- ```
50
-
51
- ## API
52
-
53
- ```js
54
- const 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.
60
-
61
- The various errors returned by this module are described in the
62
- [errors section](#errors).
63
-
64
- ### bodyParser.json([options])
65
-
66
- Returns middleware that only parses `json` and only looks at requests where
67
- the `Content-Type` header matches the `type` option. This parser accepts any
68
- Unicode encoding of the body and supports automatic inflation of `gzip`,
69
- `br` (brotli) and `deflate` encodings.
70
-
71
- A new `body` object containing the parsed data is populated on the `request`
72
- object after the middleware (i.e. `req.body`).
73
-
74
- #### Options
75
-
76
- The `json` function takes an optional `options` object that may contain any of
77
- the following keys:
78
-
79
- ##### defaultCharset
80
-
81
- Specify the default character set for the json content if the charset is not
82
- specified in the `Content-Type` header of the request. Defaults to `utf-8`.
83
-
84
- ##### inflate
85
-
86
- When set to `true`, then deflated (compressed) bodies will be inflated; when
87
- `false`, deflated bodies are rejected. Defaults to `true`.
88
-
89
- ##### limit
90
-
91
- Controls the maximum request body size. If this is a number, then the value
92
- specifies the number of bytes; if it is a string, the value is passed to the
93
- [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
94
- to `'100kb'`.
95
-
96
- ##### reviver
97
-
98
- The `reviver` option is passed directly to `JSON.parse` as the second
99
- argument. You can find more information on this argument
100
- [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).
101
-
102
- ##### strict
103
-
104
- When set to `true`, will only accept arrays and objects; when `false` will
105
- accept anything `JSON.parse` accepts. Defaults to `true`.
106
-
107
- ##### type
108
-
109
- The `type` option is used to determine what media type the middleware will
110
- parse. This option can be a string, array of strings, or a function. If not a
111
- function, `type` option is passed directly to the
112
- [type-is](https://www.npmjs.com/package/type-is#readme) library and this can
113
- be an extension name (like `json`), a mime type (like `application/json`), or
114
- a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
115
- option is called as `fn(req)` and the request is parsed if it returns a truthy
116
- value. Defaults to `application/json`.
117
-
118
- ##### verify
119
-
120
- The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
121
- where `buf` is a `Buffer` of the raw request body and `encoding` is the
122
- encoding of the request. The parsing can be aborted by throwing an error.
123
-
124
- ### bodyParser.raw([options])
125
-
126
- Returns middleware that parses all bodies as a `Buffer` and only looks at
127
- requests where the `Content-Type` header matches the `type` option. This
128
- parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
129
- encodings.
130
-
131
- A new `body` object containing the parsed data is populated on the `request`
132
- object after the middleware (i.e. `req.body`). This will be a `Buffer` object
133
- of the body.
134
-
135
- #### Options
136
-
137
- The `raw` function takes an optional `options` object that may contain any of
138
- the following keys:
139
-
140
- ##### inflate
141
-
142
- When set to `true`, then deflated (compressed) bodies will be inflated; when
143
- `false`, deflated bodies are rejected. Defaults to `true`.
144
-
145
- ##### limit
146
-
147
- Controls the maximum request body size. If this is a number, then the value
148
- specifies the number of bytes; if it is a string, the value is passed to the
149
- [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
150
- to `'100kb'`.
151
-
152
- ##### type
153
-
154
- The `type` option is used to determine what media type the middleware will
155
- parse. This option can be a string, array of strings, or a function.
156
- If not a function, `type` option is passed directly to the
157
- [type-is](https://www.npmjs.com/package/type-is#readme) library and this
158
- can be an extension name (like `bin`), a mime type (like
159
- `application/octet-stream`), or a mime type with a wildcard (like `*/*` or
160
- `application/*`). If a function, the `type` option is called as `fn(req)`
161
- and the request is parsed if it returns a truthy value. Defaults to
162
- `application/octet-stream`.
163
-
164
- ##### verify
165
-
166
- The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
167
- where `buf` is a `Buffer` of the raw request body and `encoding` is the
168
- encoding of the request. The parsing can be aborted by throwing an error.
169
-
170
- ### bodyParser.text([options])
171
-
172
- Returns middleware that parses all bodies as a string and only looks at
173
- requests where the `Content-Type` header matches the `type` option. This
174
- parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
175
- encodings.
176
-
177
- A new `body` string containing the parsed data is populated on the `request`
178
- object after the middleware (i.e. `req.body`). This will be a string of the
179
- body.
180
-
181
- #### Options
182
-
183
- The `text` function takes an optional `options` object that may contain any of
184
- the following keys:
185
-
186
- ##### defaultCharset
187
-
188
- Specify the default character set for the text content if the charset is not
189
- specified in the `Content-Type` header of the request. Defaults to `utf-8`.
190
-
191
- ##### inflate
192
-
193
- When set to `true`, then deflated (compressed) bodies will be inflated; when
194
- `false`, deflated bodies are rejected. Defaults to `true`.
195
-
196
- ##### limit
197
-
198
- Controls the maximum request body size. If this is a number, then the value
199
- specifies the number of bytes; if it is a string, the value is passed to the
200
- [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
201
- to `'100kb'`.
202
-
203
- ##### type
204
-
205
- The `type` option is used to determine what media type the middleware will
206
- parse. This option can be a string, array of strings, or a function. If not
207
- a function, `type` option is passed directly to the
208
- [type-is](https://www.npmjs.com/package/type-is#readme) library and this can
209
- be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
210
- type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
211
- option is called as `fn(req)` and the request is parsed if it returns a
212
- truthy value. Defaults to `text/plain`.
213
-
214
- ##### verify
215
-
216
- The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
217
- where `buf` is a `Buffer` of the raw request body and `encoding` is the
218
- encoding of the request. The parsing can be aborted by throwing an error.
219
-
220
- ### bodyParser.urlencoded([options])
221
-
222
- Returns middleware that only parses `urlencoded` bodies and only looks at
223
- requests where the `Content-Type` header matches the `type` option. This
224
- parser accepts only UTF-8 and ISO-8859-1 encodings of the body and supports
225
- automatic inflation of `gzip`, `br` (brotli) and `deflate` encodings.
226
-
227
- A new `body` object containing the parsed data is populated on the `request`
228
- object after the middleware (i.e. `req.body`). This object will contain
229
- key-value pairs, where the value can be a string or array (when `extended` is
230
- `false`), or any type (when `extended` is `true`).
231
-
232
- #### Options
233
-
234
- The `urlencoded` function takes an optional `options` object that may contain
235
- any of the following keys:
236
-
237
- ##### extended
238
-
239
- The "extended" syntax allows for rich objects and arrays to be encoded into the
240
- URL-encoded format, allowing for a JSON-like experience with URL-encoded. For
241
- more information, please [see the qs
242
- library](https://www.npmjs.com/package/qs#readme).
243
-
244
- Defaults to `false`.
245
-
246
- ##### inflate
247
-
248
- When set to `true`, then deflated (compressed) bodies will be inflated; when
249
- `false`, deflated bodies are rejected. Defaults to `true`.
250
-
251
- ##### limit
252
-
253
- Controls the maximum request body size. If this is a number, then the value
254
- specifies the number of bytes; if it is a string, the value is passed to the
255
- [bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
256
- to `'100kb'`.
257
-
258
- ##### parameterLimit
259
-
260
- The `parameterLimit` option controls the maximum number of parameters that
261
- are allowed in the URL-encoded data. If a request contains more parameters
262
- than this value, a 413 will be returned to the client. Defaults to `1000`.
263
-
264
- ##### type
265
-
266
- The `type` option is used to determine what media type the middleware will
267
- parse. This option can be a string, array of strings, or a function. If not
268
- a function, `type` option is passed directly to the
269
- [type-is](https://www.npmjs.com/package/type-is#readme) library and this can
270
- be an extension name (like `urlencoded`), a mime type (like
271
- `application/x-www-form-urlencoded`), or a mime type with a wildcard (like
272
- `*/x-www-form-urlencoded`). If a function, the `type` option is called as
273
- `fn(req)` and the request is parsed if it returns a truthy value. Defaults
274
- to `application/x-www-form-urlencoded`.
275
-
276
- ##### verify
277
-
278
- The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
279
- where `buf` is a `Buffer` of the raw request body and `encoding` is the
280
- encoding of the request. The parsing can be aborted by throwing an error.
281
-
282
- ##### defaultCharset
283
-
284
- The default charset to parse as, if not specified in content-type. Must be
285
- either `utf-8` or `iso-8859-1`. Defaults to `utf-8`.
286
-
287
- ##### charsetSentinel
288
-
289
- Whether to let the value of the `utf8` parameter take precedence as the charset
290
- selector. It requires the form to contain a parameter named `utf8` with a value
291
- of `✓`. Defaults to `false`.
292
-
293
- ##### interpretNumericEntities
294
-
295
- Whether to decode numeric entities such as `&#9786;` when parsing an iso-8859-1
296
- form. Defaults to `false`.
297
-
298
-
299
- ##### depth
300
-
301
- 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.
302
-
303
- ## Errors
304
-
305
- The middlewares provided by this module create errors using the
306
- [`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
307
- will typically have a `status`/`statusCode` property that contains the suggested
308
- HTTP response code, an `expose` property to determine if the `message` property
309
- should be displayed to the client, a `type` property to determine the type of
310
- error without matching against the `message`, and a `body` property containing
311
- the read body, if available.
312
-
313
- The following are the common errors created, though any error can come through
314
- for various reasons.
315
-
316
- ### content encoding unsupported
317
-
318
- This error will occur when the request had a `Content-Encoding` header that
319
- contained an encoding but the "inflation" option was set to `false`. The
320
- `status` property is set to `415`, the `type` property is set to
321
- `'encoding.unsupported'`, and the `charset` property will be set to the
322
- encoding that is unsupported.
323
-
324
- ### entity parse failed
325
-
326
- This error will occur when the request contained an entity that could not be
327
- parsed by the middleware. The `status` property is set to `400`, the `type`
328
- property is set to `'entity.parse.failed'`, and the `body` property is set to
329
- the entity value that failed parsing.
330
-
331
- ### entity verify failed
332
-
333
- This error will occur when the request contained an entity that could not be
334
- failed verification by the defined `verify` option. The `status` property is
335
- set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
336
- `body` property is set to the entity value that failed verification.
337
-
338
- ### request aborted
339
-
340
- This error will occur when the request is aborted by the client before reading
341
- the body has finished. The `received` property will be set to the number of
342
- bytes received before the request was aborted and the `expected` property is
343
- set to the number of expected bytes. The `status` property is set to `400`
344
- and `type` property is set to `'request.aborted'`.
345
-
346
- ### request entity too large
347
-
348
- This error will occur when the request body's size is larger than the "limit"
349
- option. The `limit` property will be set to the byte limit and the `length`
350
- property will be set to the request body's length. The `status` property is
351
- set to `413` and the `type` property is set to `'entity.too.large'`.
352
-
353
- ### request size did not match content length
354
-
355
- This error will occur when the request's length did not match the length from
356
- the `Content-Length` header. This typically occurs when the request is malformed,
357
- typically when the `Content-Length` header was calculated based on characters
358
- instead of bytes. The `status` property is set to `400` and the `type` property
359
- is set to `'request.size.invalid'`.
360
-
361
- ### stream encoding should not be set
362
-
363
- This error will occur when something called the `req.setEncoding` method prior
364
- to this middleware. This module operates directly on bytes only and you cannot
365
- call `req.setEncoding` when using this module. The `status` property is set to
366
- `500` and the `type` property is set to `'stream.encoding.set'`.
367
-
368
- ### stream is not readable
369
-
370
- This error will occur when the request is no longer readable when this middleware
371
- attempts to read it. This typically means something other than a middleware from
372
- this module read the request body already and the middleware was also configured to
373
- read the same request. The `status` property is set to `500` and the `type`
374
- property is set to `'stream.not.readable'`.
375
-
376
- ### too many parameters
377
-
378
- This error will occur when the content of the request exceeds the configured
379
- `parameterLimit` for the `urlencoded` parser. The `status` property is set to
380
- `413` and the `type` property is set to `'parameters.too.many'`.
381
-
382
- ### unsupported charset "BOGUS"
383
-
384
- This error will occur when the request had a charset parameter in the
385
- `Content-Type` header, but the `iconv-lite` module does not support it OR the
386
- parser does not support it. The charset is contained in the message as well
387
- as in the `charset` property. The `status` property is set to `415`, the
388
- `type` property is set to `'charset.unsupported'`, and the `charset` property
389
- is set to the charset that is unsupported.
390
-
391
- ### unsupported content encoding "bogus"
392
-
393
- This error will occur when the request had a `Content-Encoding` header that
394
- contained an unsupported encoding. The encoding is contained in the message
395
- as well as in the `encoding` property. The `status` property is set to `415`,
396
- the `type` property is set to `'encoding.unsupported'`, and the `encoding`
397
- property is set to the encoding that is unsupported.
398
-
399
- ### The input exceeded the depth
400
-
401
- 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.
402
-
403
- ## Examples
404
-
405
- ### Express/Connect top-level generic
406
-
407
- This example demonstrates adding a generic JSON and URL-encoded parser as a
408
- top-level middleware, which will parse the bodies of all incoming requests.
409
- This is the simplest setup.
410
-
411
- ```js
412
- const express = require('express')
413
- const bodyParser = require('body-parser')
414
-
415
- const app = express()
416
-
417
- // parse application/x-www-form-urlencoded
418
- app.use(bodyParser.urlencoded())
419
-
420
- // parse application/json
421
- app.use(bodyParser.json())
422
-
423
- app.use(function (req, res) {
424
- res.setHeader('Content-Type', 'text/plain')
425
- res.write('you posted:\n')
426
- res.end(String(JSON.stringify(req.body, null, 2)))
427
- })
428
- ```
429
-
430
- ### Express route-specific
431
-
432
- This example demonstrates adding body parsers specifically to the routes that
433
- need them. In general, this is the most recommended way to use body-parser with
434
- Express.
435
-
436
- ```js
437
- const express = require('express')
438
- const bodyParser = require('body-parser')
439
-
440
- const app = express()
441
-
442
- // create application/json parser
443
- const jsonParser = bodyParser.json()
444
-
445
- // create application/x-www-form-urlencoded parser
446
- const urlencodedParser = bodyParser.urlencoded()
447
-
448
- // POST /login gets urlencoded bodies
449
- app.post('/login', urlencodedParser, function (req, res) {
450
- if (!req.body || !req.body.username) res.sendStatus(400)
451
- res.send('welcome, ' + req.body.username)
452
- })
453
-
454
- // POST /api/users gets JSON bodies
455
- app.post('/api/users', jsonParser, function (req, res) {
456
- if (!req.body) res.sendStatus(400)
457
- // create user in req.body
458
- })
459
- ```
460
-
461
- ### Change accepted type for parsers
462
-
463
- All the parsers accept a `type` option which allows you to change the
464
- `Content-Type` that the middleware will parse.
465
-
466
- ```js
467
- const express = require('express')
468
- const bodyParser = require('body-parser')
469
-
470
- const app = express()
471
-
472
- // parse various different custom JSON types as JSON
473
- app.use(bodyParser.json({ type: 'application/*+json' }))
474
-
475
- // parse some custom thing into a Buffer
476
- app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
477
-
478
- // parse an HTML body into a string
479
- app.use(bodyParser.text({ type: 'text/html' }))
480
- ```
481
-
482
- ## License
483
-
484
- [MIT](LICENSE)
485
-
486
- [ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci
487
- [ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
488
- [coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master
489
- [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
490
- [npm-downloads-image]: https://img.shields.io/npm/dm/body-parser
491
- [npm-url]: https://npmjs.com/package/body-parser
492
- [npm-version-image]: https://img.shields.io/npm/v/body-parser
493
- [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
494
- [ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/index.js DELETED
@@ -1,71 +0,0 @@
1
- /*!
2
- * body-parser
3
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * @typedef {Object} Parsers
11
- * @property {Function} json JSON parser
12
- * @property {Function} raw Raw parser
13
- * @property {Function} text Text parser
14
- * @property {Function} urlencoded URL-encoded parser
15
- */
16
-
17
- /**
18
- * Module exports.
19
- * @type {Function & Parsers}
20
- */
21
- exports = module.exports = bodyParser
22
-
23
- /**
24
- * JSON parser.
25
- * @public
26
- */
27
- Object.defineProperty(exports, 'json', {
28
- configurable: true,
29
- enumerable: true,
30
- get: () => require('./lib/types/json')
31
- })
32
-
33
- /**
34
- * Raw parser.
35
- * @public
36
- */
37
- Object.defineProperty(exports, 'raw', {
38
- configurable: true,
39
- enumerable: true,
40
- get: () => require('./lib/types/raw')
41
- })
42
-
43
- /**
44
- * Text parser.
45
- * @public
46
- */
47
- Object.defineProperty(exports, 'text', {
48
- configurable: true,
49
- enumerable: true,
50
- get: () => require('./lib/types/text')
51
- })
52
-
53
- /**
54
- * URL-encoded parser.
55
- * @public
56
- */
57
- Object.defineProperty(exports, 'urlencoded', {
58
- configurable: true,
59
- enumerable: true,
60
- get: () => require('./lib/types/urlencoded')
61
- })
62
-
63
- /**
64
- * Create a middleware to parse json and urlencoded bodies.
65
- *
66
- * @deprecated
67
- * @public
68
- */
69
- function bodyParser () {
70
- throw new Error('The bodyParser() generic has been split into individual middleware to use instead.')
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/read.js DELETED
@@ -1,247 +0,0 @@
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 createError = require('http-errors')
15
- var getBody = require('raw-body')
16
- var iconv = require('iconv-lite')
17
- var onFinished = require('on-finished')
18
- var zlib = require('node:zlib')
19
- var hasBody = require('type-is').hasBody
20
- var { getCharset } = require('./utils')
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
- function read (req, res, next, parse, debug, options) {
40
- if (onFinished.isFinished(req)) {
41
- debug('body already parsed')
42
- next()
43
- return
44
- }
45
-
46
- if (!('body' in req)) {
47
- req.body = undefined
48
- }
49
-
50
- // skip requests without bodies
51
- if (!hasBody(req)) {
52
- debug('skip empty body')
53
- next()
54
- return
55
- }
56
-
57
- debug('content-type %j', req.headers['content-type'])
58
-
59
- // determine if request should be parsed
60
- if (!options.shouldParse(req)) {
61
- debug('skip parsing')
62
- next()
63
- return
64
- }
65
-
66
- var encoding = null
67
- if (options?.skipCharset !== true) {
68
- encoding = getCharset(req) || options.defaultCharset
69
-
70
- // validate charset
71
- if (!!options?.isValidCharset && !options.isValidCharset(encoding)) {
72
- debug('invalid charset')
73
- next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
74
- charset: encoding,
75
- type: 'charset.unsupported'
76
- }))
77
- return
78
- }
79
- }
80
-
81
- var length
82
- var opts = options
83
- var stream
84
-
85
- // read options
86
- var verify = opts.verify
87
-
88
- try {
89
- // get the content stream
90
- stream = contentstream(req, debug, opts.inflate)
91
- length = stream.length
92
- stream.length = undefined
93
- } catch (err) {
94
- return next(err)
95
- }
96
-
97
- // set raw-body options
98
- opts.length = length
99
- opts.encoding = verify
100
- ? null
101
- : encoding
102
-
103
- // assert charset is supported
104
- if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
105
- return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
106
- charset: encoding.toLowerCase(),
107
- type: 'charset.unsupported'
108
- }))
109
- }
110
-
111
- // read body
112
- debug('read body')
113
- getBody(stream, opts, function (error, body) {
114
- if (error) {
115
- var _error
116
-
117
- if (error.type === 'encoding.unsupported') {
118
- // echo back charset
119
- _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
120
- charset: encoding.toLowerCase(),
121
- type: 'charset.unsupported'
122
- })
123
- } else {
124
- // set status code on error
125
- _error = createError(400, error)
126
- }
127
-
128
- // unpipe from stream and destroy
129
- if (stream !== req) {
130
- req.unpipe()
131
- stream.destroy()
132
- }
133
-
134
- // read off entire request
135
- dump(req, function onfinished () {
136
- next(createError(400, _error))
137
- })
138
- return
139
- }
140
-
141
- // verify
142
- if (verify) {
143
- try {
144
- debug('verify body')
145
- verify(req, res, body, encoding)
146
- } catch (err) {
147
- next(createError(403, err, {
148
- body: body,
149
- type: err.type || 'entity.verify.failed'
150
- }))
151
- return
152
- }
153
- }
154
-
155
- // parse
156
- var str = body
157
- try {
158
- debug('parse body')
159
- str = typeof body !== 'string' && encoding !== null
160
- ? iconv.decode(body, encoding)
161
- : body
162
- req.body = parse(str, encoding)
163
- } catch (err) {
164
- next(createError(400, err, {
165
- body: str,
166
- type: err.type || 'entity.parse.failed'
167
- }))
168
- return
169
- }
170
-
171
- next()
172
- })
173
- }
174
-
175
- /**
176
- * Get the content stream of the request.
177
- *
178
- * @param {Object} req
179
- * @param {Function} debug
180
- * @param {boolean} inflate
181
- * @returns {Object}
182
- * @private
183
- */
184
- function contentstream (req, debug, inflate) {
185
- var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
186
- var length = req.headers['content-length']
187
-
188
- debug('content-encoding "%s"', encoding)
189
-
190
- if (inflate === false && encoding !== 'identity') {
191
- throw createError(415, 'content encoding unsupported', {
192
- encoding: encoding,
193
- type: 'encoding.unsupported'
194
- })
195
- }
196
-
197
- if (encoding === 'identity') {
198
- req.length = length
199
- return req
200
- }
201
-
202
- var stream = createDecompressionStream(encoding, debug)
203
- req.pipe(stream)
204
- return stream
205
- }
206
-
207
- /**
208
- * Create a decompression stream for the given encoding.
209
- * @param {string} encoding
210
- * @param {Function} debug
211
- * @returns {Object}
212
- * @private
213
- */
214
- function createDecompressionStream (encoding, debug) {
215
- switch (encoding) {
216
- case 'deflate':
217
- debug('inflate body')
218
- return zlib.createInflate()
219
- case 'gzip':
220
- debug('gunzip body')
221
- return zlib.createGunzip()
222
- case 'br':
223
- debug('brotli decompress body')
224
- return zlib.createBrotliDecompress()
225
- default:
226
- throw createError(415, 'unsupported content encoding "' + encoding + '"', {
227
- encoding: encoding,
228
- type: 'encoding.unsupported'
229
- })
230
- }
231
- }
232
-
233
- /**
234
- * Dump the contents of a request.
235
- *
236
- * @param {Object} req
237
- * @param {Function} callback
238
- * @private
239
- */
240
- function dump (req, callback) {
241
- if (onFinished.isFinished(req)) {
242
- callback(null)
243
- } else {
244
- onFinished(req, callback)
245
- req.resume()
246
- }
247
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/types/json.js DELETED
@@ -1,158 +0,0 @@
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 debug = require('debug')('body-parser:json')
16
- var read = require('../read')
17
- var { normalizeOptions } = require('../utils')
18
-
19
- /**
20
- * Module exports.
21
- */
22
-
23
- module.exports = json
24
-
25
- /**
26
- * RegExp to match the first non-space in a string.
27
- *
28
- * Allowed whitespace is defined in RFC 7159:
29
- *
30
- * ws = *(
31
- * %x20 / ; Space
32
- * %x09 / ; Horizontal tab
33
- * %x0A / ; Line feed or New line
34
- * %x0D ) ; Carriage return
35
- */
36
- var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
37
-
38
- var JSON_SYNTAX_CHAR = '#'
39
- var JSON_SYNTAX_REGEXP = /#+/g
40
-
41
- /**
42
- * Create a middleware to parse JSON bodies.
43
- *
44
- * @param {Object} [options]
45
- * @returns {Function}
46
- * @public
47
- */
48
- function json (options) {
49
- const normalizedOptions = normalizeOptions(options, 'application/json')
50
-
51
- var reviver = options?.reviver
52
- var strict = options?.strict !== false
53
-
54
- function parse (body) {
55
- if (body.length === 0) {
56
- // special-case empty json body, as it's a common client-side mistake
57
- // TODO: maybe make this configurable or part of "strict" option
58
- return {}
59
- }
60
-
61
- if (strict) {
62
- var first = firstchar(body)
63
-
64
- if (first !== '{' && first !== '[') {
65
- debug('strict violation')
66
- throw createStrictSyntaxError(body, first)
67
- }
68
- }
69
-
70
- try {
71
- debug('parse json')
72
- return JSON.parse(body, reviver)
73
- } catch (e) {
74
- throw normalizeJsonSyntaxError(e, {
75
- message: e.message,
76
- stack: e.stack
77
- })
78
- }
79
- }
80
-
81
- const readOptions = {
82
- ...normalizedOptions,
83
- // assert charset per RFC 7159 sec 8.1
84
- isValidCharset: (charset) => charset.slice(0, 4) === 'utf-'
85
- }
86
-
87
- return function jsonParser (req, res, next) {
88
- read(req, res, next, parse, debug, readOptions)
89
- }
90
- }
91
-
92
- /**
93
- * Create strict violation syntax error matching native error.
94
- *
95
- * @param {string} str
96
- * @param {string} char
97
- * @returns {Error}
98
- * @private
99
- */
100
- function createStrictSyntaxError (str, char) {
101
- var index = str.indexOf(char)
102
- var partial = ''
103
-
104
- if (index !== -1) {
105
- partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index)
106
- }
107
-
108
- try {
109
- JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
110
- } catch (e) {
111
- return normalizeJsonSyntaxError(e, {
112
- message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) {
113
- return str.substring(index, index + placeholder.length)
114
- }),
115
- stack: e.stack
116
- })
117
- }
118
- }
119
-
120
- /**
121
- * Get the first non-whitespace character in a string.
122
- *
123
- * @param {string} str
124
- * @returns {string|undefined}
125
- * @private
126
- */
127
- function firstchar (str) {
128
- var match = FIRST_CHAR_REGEXP.exec(str)
129
-
130
- return match
131
- ? match[1]
132
- : undefined
133
- }
134
-
135
- /**
136
- * Normalize a SyntaxError for JSON.parse.
137
- *
138
- * @param {SyntaxError} error
139
- * @param {Object} obj
140
- * @returns {SyntaxError}
141
- * @private
142
- */
143
- function normalizeJsonSyntaxError (error, obj) {
144
- var keys = Object.getOwnPropertyNames(error)
145
-
146
- for (var i = 0; i < keys.length; i++) {
147
- var key = keys[i]
148
- if (key !== 'stack' && key !== 'message') {
149
- delete error[key]
150
- }
151
- }
152
-
153
- // replace stack before message for Node.js 0.10 and below
154
- error.stack = obj.stack.replace(error.message, obj.message)
155
- error.message = obj.message
156
-
157
- return error
158
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/types/raw.js DELETED
@@ -1,42 +0,0 @@
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 debug = require('debug')('body-parser:raw')
14
- var read = require('../read')
15
- var { normalizeOptions, passthrough } = require('../utils')
16
-
17
- /**
18
- * Module exports.
19
- */
20
-
21
- module.exports = raw
22
-
23
- /**
24
- * Create a middleware to parse raw bodies.
25
- *
26
- * @param {Object} [options]
27
- * @returns {Function}
28
- * @public
29
- */
30
- function raw (options) {
31
- const normalizedOptions = normalizeOptions(options, 'application/octet-stream')
32
-
33
- const readOptions = {
34
- ...normalizedOptions,
35
- // Skip charset validation and parse the body as is
36
- skipCharset: true
37
- }
38
-
39
- return function rawParser (req, res, next) {
40
- read(req, res, next, passthrough, debug, readOptions)
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/types/text.js DELETED
@@ -1,36 +0,0 @@
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 debug = require('debug')('body-parser:text')
14
- var read = require('../read')
15
- var { normalizeOptions, passthrough } = require('../utils')
16
-
17
- /**
18
- * Module exports.
19
- */
20
-
21
- module.exports = text
22
-
23
- /**
24
- * Create a middleware to parse text bodies.
25
- *
26
- * @param {Object} [options]
27
- * @returns {Function}
28
- * @public
29
- */
30
- function text (options) {
31
- const normalizedOptions = normalizeOptions(options, 'text/plain')
32
-
33
- return function textParser (req, res, next) {
34
- read(req, res, next, passthrough, debug, normalizedOptions)
35
- }
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/types/urlencoded.js DELETED
@@ -1,142 +0,0 @@
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 createError = require('http-errors')
16
- var debug = require('debug')('body-parser:urlencoded')
17
- var read = require('../read')
18
- var qs = require('qs')
19
- var { normalizeOptions } = require('../utils')
20
-
21
- /**
22
- * Module exports.
23
- */
24
-
25
- module.exports = urlencoded
26
-
27
- /**
28
- * Create a middleware to parse urlencoded bodies.
29
- *
30
- * @param {Object} [options]
31
- * @returns {Function}
32
- * @public
33
- */
34
- function urlencoded (options) {
35
- const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded')
36
-
37
- if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') {
38
- throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1')
39
- }
40
-
41
- // create the appropriate query parser
42
- var queryparse = createQueryParser(options)
43
-
44
- function parse (body, encoding) {
45
- return body.length
46
- ? queryparse(body, encoding)
47
- : {}
48
- }
49
-
50
- const readOptions = {
51
- ...normalizedOptions,
52
- // assert charset
53
- isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1'
54
- }
55
-
56
- return function urlencodedParser (req, res, next) {
57
- read(req, res, next, parse, debug, readOptions)
58
- }
59
- }
60
-
61
- /**
62
- * Get the extended query parser.
63
- *
64
- * @param {Object} options
65
- * @returns {Function}
66
- * @private
67
- */
68
- function createQueryParser (options) {
69
- var extended = Boolean(options?.extended)
70
- var parameterLimit = options?.parameterLimit !== undefined
71
- ? options?.parameterLimit
72
- : 1000
73
- var charsetSentinel = options?.charsetSentinel
74
- var interpretNumericEntities = options?.interpretNumericEntities
75
- var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0
76
-
77
- if (isNaN(parameterLimit) || parameterLimit < 1) {
78
- throw new TypeError('option parameterLimit must be a positive number')
79
- }
80
-
81
- if (isNaN(depth) || depth < 0) {
82
- throw new TypeError('option depth must be a zero or a positive number')
83
- }
84
-
85
- if (isFinite(parameterLimit)) {
86
- parameterLimit = parameterLimit | 0
87
- }
88
-
89
- return function queryparse (body, encoding) {
90
- var paramCount = parameterCount(body, parameterLimit)
91
-
92
- if (paramCount === undefined) {
93
- debug('too many parameters')
94
- throw createError(413, 'too many parameters', {
95
- type: 'parameters.too.many'
96
- })
97
- }
98
-
99
- var arrayLimit = extended ? Math.max(100, paramCount) : paramCount
100
-
101
- debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding')
102
- try {
103
- return qs.parse(body, {
104
- allowPrototypes: true,
105
- arrayLimit: arrayLimit,
106
- depth: depth,
107
- charsetSentinel: charsetSentinel,
108
- interpretNumericEntities: interpretNumericEntities,
109
- charset: encoding,
110
- parameterLimit: parameterLimit,
111
- strictDepth: true
112
- })
113
- } catch (err) {
114
- if (err instanceof RangeError) {
115
- throw createError(400, 'The input exceeded the depth', {
116
- type: 'querystring.parse.rangeError'
117
- })
118
- } else {
119
- throw err
120
- }
121
- }
122
- }
123
- }
124
-
125
- /**
126
- * Count the number of parameters, stopping once limit reached
127
- *
128
- * @param {string} body
129
- * @param {number} limit
130
- * @returns {number|undefined} Returns undefined if limit exceeded
131
- * @private
132
- */
133
- function parameterCount (body, limit) {
134
- let count = 0
135
- let index = -1
136
- do {
137
- count++
138
- if (count > limit) return undefined // Early exit if limit exceeded
139
- index = body.indexOf('&', index + 1)
140
- } while (index !== -1)
141
- return count
142
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/lib/utils.js DELETED
@@ -1,98 +0,0 @@
1
- 'use strict'
2
-
3
- /**
4
- * Module dependencies.
5
- */
6
-
7
- var bytes = require('bytes')
8
- var contentType = require('content-type')
9
- var typeis = require('type-is')
10
-
11
- /**
12
- * Module exports.
13
- */
14
- module.exports = {
15
- getCharset,
16
- normalizeOptions,
17
- passthrough
18
- }
19
-
20
- /**
21
- * Get the charset of a request.
22
- *
23
- * @param {Object} req
24
- * @returns {string | undefined}
25
- * @private
26
- */
27
- function getCharset (req) {
28
- try {
29
- return (contentType.parse(req).parameters.charset || '').toLowerCase()
30
- } catch {
31
- return undefined
32
- }
33
- }
34
-
35
- /**
36
- * Get the simple type checker.
37
- *
38
- * @param {string | string[]} type
39
- * @returns {Function}
40
- * @private
41
- */
42
- function typeChecker (type) {
43
- return function checkType (req) {
44
- return Boolean(typeis(req, type))
45
- }
46
- }
47
-
48
- /**
49
- * Normalizes the common options for all parsers.
50
- *
51
- * @param {Object} options options to normalize
52
- * @param {string | string[] | Function} defaultType default content type(s) or a function to determine it
53
- * @returns {Object}
54
- * @private
55
- */
56
- function normalizeOptions (options, defaultType) {
57
- if (!defaultType) {
58
- // Parsers must define a default content type
59
- throw new TypeError('defaultType must be provided')
60
- }
61
-
62
- var inflate = options?.inflate !== false
63
- var limit = typeof options?.limit !== 'number'
64
- ? bytes.parse(options?.limit || '100kb')
65
- : options?.limit
66
- var type = options?.type || defaultType
67
- var verify = options?.verify || false
68
- var defaultCharset = options?.defaultCharset || 'utf-8'
69
-
70
- if (verify !== false && typeof verify !== 'function') {
71
- throw new TypeError('option verify must be function')
72
- }
73
-
74
- // create the appropriate type checking function
75
- var shouldParse = typeof type !== 'function'
76
- ? typeChecker(type)
77
- : type
78
-
79
- return {
80
- inflate,
81
- limit,
82
- verify,
83
- defaultCharset,
84
- shouldParse
85
- }
86
- }
87
-
88
- /**
89
- * Passthrough function that returns input unchanged.
90
- * Used by parsers that don't need to transform the data.
91
- *
92
- * @param {*} value
93
- * @returns {*}
94
- * @private
95
- */
96
- function passthrough (value) {
97
- return value
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/body-parser/package.json DELETED
@@ -1,52 +0,0 @@
1
- {
2
- "name": "body-parser",
3
- "description": "Node.js body parsing middleware",
4
- "version": "2.2.2",
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
- "funding": {
12
- "type": "opencollective",
13
- "url": "https://opencollective.com/express"
14
- },
15
- "dependencies": {
16
- "bytes": "^3.1.2",
17
- "content-type": "^1.0.5",
18
- "debug": "^4.4.3",
19
- "http-errors": "^2.0.0",
20
- "iconv-lite": "^0.7.0",
21
- "on-finished": "^2.4.1",
22
- "qs": "^6.14.1",
23
- "raw-body": "^3.0.1",
24
- "type-is": "^2.0.1"
25
- },
26
- "devDependencies": {
27
- "eslint": "^8.57.1",
28
- "eslint-config-standard": "^14.1.1",
29
- "eslint-plugin-import": "^2.31.0",
30
- "eslint-plugin-markdown": "^3.0.1",
31
- "eslint-plugin-node": "^11.1.0",
32
- "eslint-plugin-promise": "^6.6.0",
33
- "eslint-plugin-standard": "^4.1.0",
34
- "mocha": "^11.1.0",
35
- "nyc": "^17.1.0",
36
- "supertest": "^7.0.0"
37
- },
38
- "files": [
39
- "lib/",
40
- "LICENSE",
41
- "index.js"
42
- ],
43
- "engines": {
44
- "node": ">=18"
45
- },
46
- "scripts": {
47
- "lint": "eslint .",
48
- "test": "mocha --reporter spec --check-leaks test/",
49
- "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
50
- "test-cov": "nyc --reporter=html --reporter=text npm test"
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/bytes/History.md DELETED
@@ -1,97 +0,0 @@
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]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/bytes/LICENSE DELETED
@@ -1,23 +0,0 @@
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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/bytes/Readme.md DELETED
@@ -1,152 +0,0 @@
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/bytes/index.js DELETED
@@ -1,170 +0,0 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/bytes/package.json DELETED
@@ -1,42 +0,0 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/.eslintrc DELETED
@@ -1,17 +0,0 @@
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-extra-parens": 0,
15
- "no-magic-numbers": 0,
16
- },
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/.github/FUNDING.yml DELETED
@@ -1,12 +0,0 @@
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']
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/.nycrc DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "all": true,
3
- "check-coverage": false,
4
- "reporter": ["text-summary", "text", "html", "json"],
5
- "exclude": [
6
- "coverage",
7
- "test"
8
- ]
9
- }
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/CHANGELOG.md DELETED
@@ -1,30 +0,0 @@
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.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12
9
-
10
- ### Commits
11
-
12
- - [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1)
13
- - [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1)
14
-
15
- ## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08
16
-
17
- ### Commits
18
-
19
- - [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8)
20
- - [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75)
21
- - [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940)
22
-
23
- ## v1.0.0 - 2024-12-05
24
-
25
- ### Commits
26
-
27
- - Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04)
28
- - Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f)
29
- - npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603)
30
- - Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/LICENSE DELETED
@@ -1,21 +0,0 @@
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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/README.md DELETED
@@ -1,62 +0,0 @@
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/actualApply.d.ts DELETED
@@ -1 +0,0 @@
1
- export = Reflect.apply;
 
 
test/node_modules/call-bind-apply-helpers/actualApply.js DELETED
@@ -1,10 +0,0 @@
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);
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/applyBind.d.ts DELETED
@@ -1,19 +0,0 @@
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;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/applyBind.js DELETED
@@ -1,10 +0,0 @@
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
- };
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/functionApply.d.ts DELETED
@@ -1 +0,0 @@
1
- export = Function.prototype.apply;
 
 
test/node_modules/call-bind-apply-helpers/functionApply.js DELETED
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- /** @type {import('./functionApply')} */
4
- module.exports = Function.prototype.apply;
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/functionCall.d.ts DELETED
@@ -1 +0,0 @@
1
- export = Function.prototype.call;
 
 
test/node_modules/call-bind-apply-helpers/functionCall.js DELETED
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- /** @type {import('./functionCall')} */
4
- module.exports = Function.prototype.call;
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/index.d.ts DELETED
@@ -1,64 +0,0 @@
1
- type RemoveFromTuple<
2
- Tuple extends readonly unknown[],
3
- RemoveCount extends number,
4
- Index extends 1[] = []
5
- > = Index["length"] extends RemoveCount
6
- ? Tuple
7
- : Tuple extends [infer First, ...infer Rest]
8
- ? RemoveFromTuple<Rest, RemoveCount, [...Index, 1]>
9
- : Tuple;
10
-
11
- type ConcatTuples<
12
- Prefix extends readonly unknown[],
13
- Suffix extends readonly unknown[]
14
- > = [...Prefix, ...Suffix];
15
-
16
- type ExtractFunctionParams<T> = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R
17
- ? { thisArg: TThis; params: P; returnType: R }
18
- : never;
19
-
20
- type BindFunction<
21
- T extends (this: any, ...args: any[]) => any,
22
- TThis,
23
- TBoundArgs extends readonly unknown[],
24
- ReceiverBound extends boolean
25
- > = ExtractFunctionParams<T> extends {
26
- thisArg: infer OrigThis;
27
- params: infer P extends readonly unknown[];
28
- returnType: infer R;
29
- }
30
- ? ReceiverBound extends true
31
- ? (...args: RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>) => R extends [OrigThis, ...infer Rest]
32
- ? [TThis, ...Rest] // Replace `this` with `thisArg`
33
- : R
34
- : <U, RemainingArgs extends RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>>(
35
- thisArg: U,
36
- ...args: RemainingArgs
37
- ) => R extends [OrigThis, ...infer Rest]
38
- ? [U, ...ConcatTuples<TBoundArgs, Rest>] // Preserve bound args in return type
39
- : R
40
- : never;
41
-
42
- declare function callBind<
43
- const T extends (this: any, ...args: any[]) => any,
44
- Extracted extends ExtractFunctionParams<T>,
45
- const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[],
46
- const TThis extends Extracted["thisArg"]
47
- >(
48
- args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
49
- ): BindFunction<T, TThis, TBoundArgs, true>;
50
-
51
- declare function callBind<
52
- const T extends (this: any, ...args: any[]) => any,
53
- Extracted extends ExtractFunctionParams<T>,
54
- const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[]
55
- >(
56
- args: [fn: T, ...boundArgs: TBoundArgs]
57
- ): BindFunction<T, Extracted["thisArg"], TBoundArgs, false>;
58
-
59
- declare function callBind<const TArgs extends readonly unknown[]>(
60
- args: [fn: Exclude<TArgs[0], Function>, ...rest: TArgs]
61
- ): never;
62
-
63
- // export as namespace callBind;
64
- export = callBind;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/index.js DELETED
@@ -1,15 +0,0 @@
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 {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use 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
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/package.json DELETED
@@ -1,85 +0,0 @@
1
- {
2
- "name": "call-bind-apply-helpers",
3
- "version": "1.0.2",
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.3",
45
- "@ljharb/eslint-config": "^21.1.1",
46
- "@ljharb/tsconfig": "^0.2.3",
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.8.1",
51
- "auto-changelog": "^2.5.0",
52
- "encoding": "^0.1.13",
53
- "es-value-fixtures": "^1.7.1",
54
- "eslint": "=8.8.0",
55
- "evalmd": "^0.0.19",
56
- "for-each": "^0.3.5",
57
- "has-strict-mode": "^1.1.0",
58
- "in-publish": "^2.0.1",
59
- "npmignore": "^0.3.1",
60
- "nyc": "^10.3.2",
61
- "object-inspect": "^1.13.4",
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/reflectApply.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare const reflectApply: false | typeof Reflect.apply;
2
-
3
- export = reflectApply;
 
 
 
 
test/node_modules/call-bind-apply-helpers/reflectApply.js DELETED
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- /** @type {import('./reflectApply')} */
4
- module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/test/index.js DELETED
@@ -1,63 +0,0 @@
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, A extends number, B extends number>(this: T, a: A, b: B) => [T | undefined, A, B]} */
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) => [typeof sentinel, typeof a, typeof b])} */
32
- var boundR = callBind([func, sentinel]);
33
- /** type {((b: number) => [typeof sentinel, number, typeof b])} */
34
- var boundArg = callBind([func, sentinel, /** @type {const} */ (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
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bind-apply-helpers/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@ljharb/tsconfig",
3
- "compilerOptions": {
4
- "target": "es2021",
5
- },
6
- "exclude": [
7
- "coverage",
8
- ],
9
- }
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/.eslintrc DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "root": true,
3
-
4
- "extends": "@ljharb",
5
-
6
- "rules": {
7
- "new-cap": [2, {
8
- "capIsNewExceptions": [
9
- "GetIntrinsic",
10
- ],
11
- }],
12
- },
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/.github/FUNDING.yml DELETED
@@ -1,12 +0,0 @@
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-bound
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']
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/.nycrc DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "all": true,
3
- "check-coverage": false,
4
- "reporter": ["text-summary", "text", "html", "json"],
5
- "exclude": [
6
- "coverage",
7
- "test"
8
- ]
9
- }
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/CHANGELOG.md DELETED
@@ -1,42 +0,0 @@
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.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03
9
-
10
- ### Commits
11
-
12
- - [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff)
13
- - [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719)
14
- - [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8)
15
-
16
- ## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15
17
-
18
- ### Commits
19
-
20
- - [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be)
21
- - [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e)
22
- - [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49)
23
- - [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7)
24
-
25
- ## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10
26
-
27
- ### Commits
28
-
29
- - [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5)
30
- - [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14)
31
- - [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871)
32
-
33
- ## v1.0.1 - 2024-12-05
34
-
35
- ### Commits
36
-
37
- - Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d)
38
- - Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9)
39
- - npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275)
40
- - Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb)
41
- - [actions] skip `npm ls` in node &lt; 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8)
42
- - [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/LICENSE DELETED
@@ -1,21 +0,0 @@
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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/README.md DELETED
@@ -1,53 +0,0 @@
1
- # call-bound <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
- Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
13
-
14
- ## Getting started
15
-
16
- ```sh
17
- npm install --save call-bound
18
- ```
19
-
20
- ## Usage/Examples
21
-
22
- ```js
23
- const assert = require('assert');
24
- const callBound = require('call-bound');
25
-
26
- const slice = callBound('Array.prototype.slice');
27
-
28
- delete Function.prototype.call;
29
- delete Function.prototype.bind;
30
- delete Array.prototype.slice;
31
-
32
- assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
33
- ```
34
-
35
- ## Tests
36
-
37
- Clone the repo, `npm install`, and run `npm test`
38
-
39
- [package-url]: https://npmjs.org/package/call-bound
40
- [npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg
41
- [deps-svg]: https://david-dm.org/ljharb/call-bound.svg
42
- [deps-url]: https://david-dm.org/ljharb/call-bound
43
- [dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg
44
- [dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies
45
- [npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true
46
- [license-image]: https://img.shields.io/npm/l/call-bound.svg
47
- [license-url]: LICENSE
48
- [downloads-image]: https://img.shields.io/npm/dm/call-bound.svg
49
- [downloads-url]: https://npm-stat.com/charts.html?package=call-bound
50
- [codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg
51
- [codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/
52
- [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound
53
- [actions-url]: https://github.com/ljharb/call-bound/actions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test/node_modules/call-bound/index.d.ts DELETED
@@ -1,94 +0,0 @@
1
- type Intrinsic = typeof globalThis;
2
-
3
- type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`;
4
-
5
- type IntrinsicPath = IntrinsicName | `${StripPercents<IntrinsicName>}.${string}` | `%${StripPercents<IntrinsicName>}.${string}%`;
6
-
7
- type AllowMissing = boolean;
8
-
9
- type StripPercents<T extends string> = T extends `%${infer U}%` ? U : T;
10
-
11
- type BindMethodPrecise<F> =
12
- F extends (this: infer This, ...args: infer Args) => infer R
13
- ? (obj: This, ...args: Args) => R
14
- : F extends {
15
- (this: infer This1, ...args: infer Args1): infer R1;
16
- (this: infer This2, ...args: infer Args2): infer R2
17
- }
18
- ? {
19
- (obj: This1, ...args: Args1): R1;
20
- (obj: This2, ...args: Args2): R2
21
- }
22
- : never
23
-
24
- // Extract method type from a prototype
25
- type GetPrototypeMethod<T extends keyof typeof globalThis, M extends string> =
26
- (typeof globalThis)[T] extends { prototype: any }
27
- ? M extends keyof (typeof globalThis)[T]['prototype']
28
- ? (typeof globalThis)[T]['prototype'][M]
29
- : never
30
- : never
31
-
32
- // Get static property/method
33
- type GetStaticMember<T extends keyof typeof globalThis, P extends string> =
34
- P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never
35
-
36
- // Type that maps string path to actual bound function or value with better precision
37
- type BoundIntrinsic<S extends string> =
38
- S extends `${infer Obj}.prototype.${infer Method}`
39
- ? Obj extends keyof typeof globalThis
40
- ? BindMethodPrecise<GetPrototypeMethod<Obj, Method & string>>
41
- : unknown
42
- : S extends `${infer Obj}.${infer Prop}`
43
- ? Obj extends keyof typeof globalThis
44
- ? GetStaticMember<Obj, Prop & string>
45
- : unknown
46
- : unknown
47
-
48
- declare function arraySlice<T>(array: readonly T[], start?: number, end?: number): T[];
49
- declare function arraySlice<T>(array: ArrayLike<T>, start?: number, end?: number): T[];
50
- declare function arraySlice<T>(array: IArguments, start?: number, end?: number): T[];
51
-
52
- // Special cases for methods that need explicit typing
53
- interface SpecialCases {
54
- '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean;
55
- '%String.prototype.replace%': {
56
- (str: string, searchValue: string | RegExp, replaceValue: string): string;
57
- (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string
58
- };
59
- '%Object.prototype.toString%': (obj: {}) => string;
60
- '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean;
61
- '%Array.prototype.slice%': typeof arraySlice;
62
- '%Array.prototype.map%': <T, U>(array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[];
63
- '%Array.prototype.filter%': <T>(array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[];
64
- '%Array.prototype.indexOf%': <T>(array: readonly T[], searchElement: T, fromIndex?: number) => number;
65
- '%Function.prototype.apply%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, args: A) => R;
66
- '%Function.prototype.call%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, ...args: A) => R;
67
- '%Function.prototype.bind%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R;
68
- '%Promise.prototype.then%': {
69
- <T, R>(promise: Promise<T>, onfulfilled: (value: T) => R | PromiseLike<R>): Promise<R>;
70
- <T, R>(promise: Promise<T>, onfulfilled: ((value: T) => R | PromiseLike<R>) | undefined | null, onrejected: (reason: any) => R | PromiseLike<R>): Promise<R>;
71
- };
72
- '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean;
73
- '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null;
74
- '%Error.prototype.toString%': (error: Error) => string;
75
- '%TypeError.prototype.toString%': (error: TypeError) => string;
76
- '%String.prototype.split%': (
77
- obj: unknown,
78
- splitter: string | RegExp | {
79
- [Symbol.split](string: string, limit?: number): string[];
80
- },
81
- limit?: number | undefined
82
- ) => string[];
83
- }
84
-
85
- /**
86
- * Returns a bound function for a prototype method, or a value for a static property.
87
- *
88
- * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice')
89
- * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false)
90
- */
91
- declare function callBound<K extends keyof SpecialCases | StripPercents<keyof SpecialCases>, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents<K>}%`];
92
- declare function callBound<K extends keyof SpecialCases | StripPercents<keyof SpecialCases>, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic<S>;
93
-
94
- export = callBound;