trimprompt 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1020) hide show
  1. package/cli.js +2 -0
  2. package/dashboard.js +1 -0
  3. package/executor.js +1 -0
  4. package/filters/generic.js +1 -0
  5. package/filters/git.js +1 -0
  6. package/filters/index.js +1 -0
  7. package/filters/js.js +1 -0
  8. package/filters/python.js +1 -0
  9. package/mcp.js +1 -0
  10. package/package.json +21 -29
  11. package/redactor.js +1 -0
  12. package/seed.js +1 -0
  13. package/shims.js +1 -0
  14. package/simulate.js +1 -0
  15. package/sync.js +1 -0
  16. package/tracker.js +1 -0
  17. package/.claude/settings.local.json +0 -7
  18. package/aicg-spec/README.md +0 -55
  19. package/aicg-spec/architecture.md +0 -263
  20. package/aicg-spec/dsl-spec.md +0 -109
  21. package/aicg-spec/insights/cargo.md +0 -46
  22. package/aicg-spec/insights/cloud_cli.md +0 -38
  23. package/aicg-spec/insights/docker_k8s.md +0 -45
  24. package/aicg-spec/insights/generic.md +0 -62
  25. package/aicg-spec/insights/git.md +0 -85
  26. package/aicg-spec/insights/js.md +0 -74
  27. package/aicg-spec/insights/python.md +0 -86
  28. package/aicg-spec/integrations/claude.md +0 -57
  29. package/aicg-spec/integrations/copilot.md +0 -69
  30. package/aicg-spec/integrations/cursor.md +0 -59
  31. package/aicg-spec/rules.yaml +0 -555
  32. package/aicg-spec/schema.md +0 -93
  33. package/aicg-spec/ui-spec.md +0 -135
  34. package/client/dist/cli.js +0 -256
  35. package/client/dist/dashboard.js +0 -102
  36. package/client/dist/executor.js +0 -80
  37. package/client/dist/filters/generic.js +0 -58
  38. package/client/dist/filters/git.js +0 -157
  39. package/client/dist/filters/index.js +0 -83
  40. package/client/dist/filters/js.js +0 -78
  41. package/client/dist/filters/python.js +0 -130
  42. package/client/dist/mcp.js +0 -90
  43. package/client/dist/redactor.js +0 -42
  44. package/client/dist/seed.js +0 -11
  45. package/client/dist/shims.js +0 -169
  46. package/client/dist/simulate.js +0 -76
  47. package/client/dist/sync.js +0 -237
  48. package/client/dist/tracker.js +0 -247
  49. package/client/node_modules/.bin/is-docker +0 -16
  50. package/client/node_modules/.bin/is-docker.cmd +0 -17
  51. package/client/node_modules/.bin/is-docker.ps1 +0 -28
  52. package/client/node_modules/.bin/mime +0 -16
  53. package/client/node_modules/.bin/mime.cmd +0 -17
  54. package/client/node_modules/.bin/mime.ps1 +0 -28
  55. package/client/node_modules/.bin/tsc +0 -16
  56. package/client/node_modules/.bin/tsc.cmd +0 -17
  57. package/client/node_modules/.bin/tsc.ps1 +0 -28
  58. package/client/node_modules/.bin/tsserver +0 -16
  59. package/client/node_modules/.bin/tsserver.cmd +0 -17
  60. package/client/node_modules/.bin/tsserver.ps1 +0 -28
  61. package/client/node_modules/.package-lock.json +0 -934
  62. package/client/node_modules/@types/body-parser/LICENSE +0 -21
  63. package/client/node_modules/@types/body-parser/README.md +0 -15
  64. package/client/node_modules/@types/body-parser/index.d.ts +0 -95
  65. package/client/node_modules/@types/body-parser/package.json +0 -64
  66. package/client/node_modules/@types/connect/LICENSE +0 -21
  67. package/client/node_modules/@types/connect/README.md +0 -15
  68. package/client/node_modules/@types/connect/index.d.ts +0 -91
  69. package/client/node_modules/@types/connect/package.json +0 -32
  70. package/client/node_modules/@types/express/LICENSE +0 -21
  71. package/client/node_modules/@types/express/README.md +0 -15
  72. package/client/node_modules/@types/express/index.d.ts +0 -128
  73. package/client/node_modules/@types/express/package.json +0 -46
  74. package/client/node_modules/@types/express-serve-static-core/LICENSE +0 -21
  75. package/client/node_modules/@types/express-serve-static-core/README.md +0 -15
  76. package/client/node_modules/@types/express-serve-static-core/index.d.ts +0 -1281
  77. package/client/node_modules/@types/express-serve-static-core/package.json +0 -51
  78. package/client/node_modules/@types/http-errors/LICENSE +0 -21
  79. package/client/node_modules/@types/http-errors/README.md +0 -15
  80. package/client/node_modules/@types/http-errors/index.d.ts +0 -77
  81. package/client/node_modules/@types/http-errors/package.json +0 -36
  82. package/client/node_modules/@types/mime/LICENSE +0 -21
  83. package/client/node_modules/@types/mime/Mime.d.ts +0 -10
  84. package/client/node_modules/@types/mime/README.md +0 -15
  85. package/client/node_modules/@types/mime/index.d.ts +0 -31
  86. package/client/node_modules/@types/mime/lite.d.ts +0 -7
  87. package/client/node_modules/@types/mime/package.json +0 -30
  88. package/client/node_modules/@types/node/LICENSE +0 -21
  89. package/client/node_modules/@types/node/README.md +0 -15
  90. package/client/node_modules/@types/node/assert/strict.d.ts +0 -8
  91. package/client/node_modules/@types/node/assert.d.ts +0 -1062
  92. package/client/node_modules/@types/node/async_hooks.d.ts +0 -605
  93. package/client/node_modules/@types/node/buffer.buffer.d.ts +0 -471
  94. package/client/node_modules/@types/node/buffer.d.ts +0 -1936
  95. package/client/node_modules/@types/node/child_process.d.ts +0 -1475
  96. package/client/node_modules/@types/node/cluster.d.ts +0 -577
  97. package/client/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  98. package/client/node_modules/@types/node/compatibility/index.d.ts +0 -9
  99. package/client/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  100. package/client/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  101. package/client/node_modules/@types/node/console.d.ts +0 -452
  102. package/client/node_modules/@types/node/constants.d.ts +0 -21
  103. package/client/node_modules/@types/node/crypto.d.ts +0 -4590
  104. package/client/node_modules/@types/node/dgram.d.ts +0 -597
  105. package/client/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  106. package/client/node_modules/@types/node/dns/promises.d.ts +0 -479
  107. package/client/node_modules/@types/node/dns.d.ts +0 -871
  108. package/client/node_modules/@types/node/domain.d.ts +0 -170
  109. package/client/node_modules/@types/node/events.d.ts +0 -977
  110. package/client/node_modules/@types/node/fs/promises.d.ts +0 -1270
  111. package/client/node_modules/@types/node/fs.d.ts +0 -4375
  112. package/client/node_modules/@types/node/globals.d.ts +0 -172
  113. package/client/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  114. package/client/node_modules/@types/node/http.d.ts +0 -2049
  115. package/client/node_modules/@types/node/http2.d.ts +0 -2712
  116. package/client/node_modules/@types/node/https.d.ts +0 -578
  117. package/client/node_modules/@types/node/index.d.ts +0 -93
  118. package/client/node_modules/@types/node/inspector.generated.d.ts +0 -3966
  119. package/client/node_modules/@types/node/module.d.ts +0 -539
  120. package/client/node_modules/@types/node/net.d.ts +0 -1031
  121. package/client/node_modules/@types/node/os.d.ts +0 -506
  122. package/client/node_modules/@types/node/package.json +0 -140
  123. package/client/node_modules/@types/node/path.d.ts +0 -200
  124. package/client/node_modules/@types/node/perf_hooks.d.ts +0 -961
  125. package/client/node_modules/@types/node/process.d.ts +0 -1961
  126. package/client/node_modules/@types/node/punycode.d.ts +0 -117
  127. package/client/node_modules/@types/node/querystring.d.ts +0 -152
  128. package/client/node_modules/@types/node/readline/promises.d.ts +0 -162
  129. package/client/node_modules/@types/node/readline.d.ts +0 -589
  130. package/client/node_modules/@types/node/repl.d.ts +0 -430
  131. package/client/node_modules/@types/node/sea.d.ts +0 -153
  132. package/client/node_modules/@types/node/stream/consumers.d.ts +0 -38
  133. package/client/node_modules/@types/node/stream/promises.d.ts +0 -90
  134. package/client/node_modules/@types/node/stream/web.d.ts +0 -533
  135. package/client/node_modules/@types/node/stream.d.ts +0 -1698
  136. package/client/node_modules/@types/node/string_decoder.d.ts +0 -67
  137. package/client/node_modules/@types/node/test.d.ts +0 -1787
  138. package/client/node_modules/@types/node/timers/promises.d.ts +0 -108
  139. package/client/node_modules/@types/node/timers.d.ts +0 -286
  140. package/client/node_modules/@types/node/tls.d.ts +0 -1259
  141. package/client/node_modules/@types/node/trace_events.d.ts +0 -197
  142. package/client/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  143. package/client/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  144. package/client/node_modules/@types/node/ts5.6/index.d.ts +0 -93
  145. package/client/node_modules/@types/node/tty.d.ts +0 -208
  146. package/client/node_modules/@types/node/url.d.ts +0 -964
  147. package/client/node_modules/@types/node/util.d.ts +0 -2331
  148. package/client/node_modules/@types/node/v8.d.ts +0 -809
  149. package/client/node_modules/@types/node/vm.d.ts +0 -1001
  150. package/client/node_modules/@types/node/wasi.d.ts +0 -181
  151. package/client/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  152. package/client/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  153. package/client/node_modules/@types/node/web-globals/events.d.ts +0 -97
  154. package/client/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  155. package/client/node_modules/@types/node/worker_threads.d.ts +0 -715
  156. package/client/node_modules/@types/node/zlib.d.ts +0 -598
  157. package/client/node_modules/@types/qs/LICENSE +0 -21
  158. package/client/node_modules/@types/qs/README.md +0 -15
  159. package/client/node_modules/@types/qs/index.d.ts +0 -83
  160. package/client/node_modules/@types/qs/package.json +0 -66
  161. package/client/node_modules/@types/range-parser/LICENSE +0 -21
  162. package/client/node_modules/@types/range-parser/README.md +0 -53
  163. package/client/node_modules/@types/range-parser/index.d.ts +0 -34
  164. package/client/node_modules/@types/range-parser/package.json +0 -25
  165. package/client/node_modules/@types/send/LICENSE +0 -21
  166. package/client/node_modules/@types/send/README.md +0 -15
  167. package/client/node_modules/@types/send/index.d.ts +0 -187
  168. package/client/node_modules/@types/send/package.json +0 -38
  169. package/client/node_modules/@types/serve-static/LICENSE +0 -21
  170. package/client/node_modules/@types/serve-static/README.md +0 -15
  171. package/client/node_modules/@types/serve-static/index.d.ts +0 -107
  172. package/client/node_modules/@types/serve-static/node_modules/@types/send/LICENSE +0 -21
  173. package/client/node_modules/@types/serve-static/node_modules/@types/send/README.md +0 -15
  174. package/client/node_modules/@types/serve-static/node_modules/@types/send/index.d.ts +0 -225
  175. package/client/node_modules/@types/serve-static/node_modules/@types/send/package.json +0 -39
  176. package/client/node_modules/@types/serve-static/package.json +0 -45
  177. package/client/node_modules/accepts/HISTORY.md +0 -243
  178. package/client/node_modules/accepts/LICENSE +0 -23
  179. package/client/node_modules/accepts/README.md +0 -140
  180. package/client/node_modules/accepts/index.js +0 -238
  181. package/client/node_modules/accepts/package.json +0 -47
  182. package/client/node_modules/array-flatten/LICENSE +0 -21
  183. package/client/node_modules/array-flatten/README.md +0 -43
  184. package/client/node_modules/array-flatten/array-flatten.js +0 -64
  185. package/client/node_modules/array-flatten/package.json +0 -39
  186. package/client/node_modules/body-parser/HISTORY.md +0 -686
  187. package/client/node_modules/body-parser/LICENSE +0 -23
  188. package/client/node_modules/body-parser/README.md +0 -476
  189. package/client/node_modules/body-parser/index.js +0 -156
  190. package/client/node_modules/body-parser/lib/read.js +0 -205
  191. package/client/node_modules/body-parser/lib/types/json.js +0 -243
  192. package/client/node_modules/body-parser/lib/types/raw.js +0 -101
  193. package/client/node_modules/body-parser/lib/types/text.js +0 -121
  194. package/client/node_modules/body-parser/lib/types/urlencoded.js +0 -299
  195. package/client/node_modules/body-parser/package.json +0 -55
  196. package/client/node_modules/bytes/History.md +0 -97
  197. package/client/node_modules/bytes/LICENSE +0 -23
  198. package/client/node_modules/bytes/Readme.md +0 -152
  199. package/client/node_modules/bytes/index.js +0 -170
  200. package/client/node_modules/bytes/package.json +0 -42
  201. package/client/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  202. package/client/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  203. package/client/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  204. package/client/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  205. package/client/node_modules/call-bind-apply-helpers/LICENSE +0 -21
  206. package/client/node_modules/call-bind-apply-helpers/README.md +0 -62
  207. package/client/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  208. package/client/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  209. package/client/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  210. package/client/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  211. package/client/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  212. package/client/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  213. package/client/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  214. package/client/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  215. package/client/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  216. package/client/node_modules/call-bind-apply-helpers/index.js +0 -15
  217. package/client/node_modules/call-bind-apply-helpers/package.json +0 -85
  218. package/client/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  219. package/client/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  220. package/client/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  221. package/client/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  222. package/client/node_modules/call-bound/.eslintrc +0 -13
  223. package/client/node_modules/call-bound/.github/FUNDING.yml +0 -12
  224. package/client/node_modules/call-bound/.nycrc +0 -9
  225. package/client/node_modules/call-bound/CHANGELOG.md +0 -42
  226. package/client/node_modules/call-bound/LICENSE +0 -21
  227. package/client/node_modules/call-bound/README.md +0 -53
  228. package/client/node_modules/call-bound/index.d.ts +0 -94
  229. package/client/node_modules/call-bound/index.js +0 -19
  230. package/client/node_modules/call-bound/package.json +0 -99
  231. package/client/node_modules/call-bound/test/index.js +0 -61
  232. package/client/node_modules/call-bound/tsconfig.json +0 -10
  233. package/client/node_modules/commander/LICENSE +0 -22
  234. package/client/node_modules/commander/Readme.md +0 -1148
  235. package/client/node_modules/commander/esm.mjs +0 -16
  236. package/client/node_modules/commander/index.js +0 -26
  237. package/client/node_modules/commander/lib/argument.js +0 -145
  238. package/client/node_modules/commander/lib/command.js +0 -2179
  239. package/client/node_modules/commander/lib/error.js +0 -43
  240. package/client/node_modules/commander/lib/help.js +0 -462
  241. package/client/node_modules/commander/lib/option.js +0 -329
  242. package/client/node_modules/commander/lib/suggestSimilar.js +0 -100
  243. package/client/node_modules/commander/package-support.json +0 -16
  244. package/client/node_modules/commander/package.json +0 -80
  245. package/client/node_modules/commander/typings/esm.d.mts +0 -3
  246. package/client/node_modules/commander/typings/index.d.ts +0 -884
  247. package/client/node_modules/content-disposition/HISTORY.md +0 -60
  248. package/client/node_modules/content-disposition/LICENSE +0 -22
  249. package/client/node_modules/content-disposition/README.md +0 -142
  250. package/client/node_modules/content-disposition/index.js +0 -458
  251. package/client/node_modules/content-disposition/package.json +0 -44
  252. package/client/node_modules/content-type/HISTORY.md +0 -29
  253. package/client/node_modules/content-type/LICENSE +0 -22
  254. package/client/node_modules/content-type/README.md +0 -94
  255. package/client/node_modules/content-type/index.js +0 -225
  256. package/client/node_modules/content-type/package.json +0 -42
  257. package/client/node_modules/cookie/LICENSE +0 -24
  258. package/client/node_modules/cookie/README.md +0 -317
  259. package/client/node_modules/cookie/SECURITY.md +0 -25
  260. package/client/node_modules/cookie/index.js +0 -335
  261. package/client/node_modules/cookie/package.json +0 -44
  262. package/client/node_modules/cookie-signature/History.md +0 -42
  263. package/client/node_modules/cookie-signature/Readme.md +0 -42
  264. package/client/node_modules/cookie-signature/index.js +0 -51
  265. package/client/node_modules/cookie-signature/package.json +0 -18
  266. package/client/node_modules/debug/.coveralls.yml +0 -1
  267. package/client/node_modules/debug/.eslintrc +0 -11
  268. package/client/node_modules/debug/.travis.yml +0 -14
  269. package/client/node_modules/debug/CHANGELOG.md +0 -362
  270. package/client/node_modules/debug/LICENSE +0 -19
  271. package/client/node_modules/debug/Makefile +0 -50
  272. package/client/node_modules/debug/README.md +0 -312
  273. package/client/node_modules/debug/component.json +0 -19
  274. package/client/node_modules/debug/karma.conf.js +0 -70
  275. package/client/node_modules/debug/node.js +0 -1
  276. package/client/node_modules/debug/package.json +0 -49
  277. package/client/node_modules/debug/src/browser.js +0 -185
  278. package/client/node_modules/debug/src/debug.js +0 -202
  279. package/client/node_modules/debug/src/index.js +0 -10
  280. package/client/node_modules/debug/src/inspector-log.js +0 -15
  281. package/client/node_modules/debug/src/node.js +0 -248
  282. package/client/node_modules/define-lazy-prop/index.d.ts +0 -33
  283. package/client/node_modules/define-lazy-prop/index.js +0 -19
  284. package/client/node_modules/define-lazy-prop/license +0 -9
  285. package/client/node_modules/define-lazy-prop/package.json +0 -48
  286. package/client/node_modules/define-lazy-prop/readme.md +0 -64
  287. package/client/node_modules/depd/History.md +0 -103
  288. package/client/node_modules/depd/LICENSE +0 -22
  289. package/client/node_modules/depd/Readme.md +0 -280
  290. package/client/node_modules/depd/index.js +0 -538
  291. package/client/node_modules/depd/lib/browser/index.js +0 -77
  292. package/client/node_modules/depd/package.json +0 -45
  293. package/client/node_modules/destroy/LICENSE +0 -23
  294. package/client/node_modules/destroy/README.md +0 -63
  295. package/client/node_modules/destroy/index.js +0 -209
  296. package/client/node_modules/destroy/package.json +0 -48
  297. package/client/node_modules/dunder-proto/.eslintrc +0 -5
  298. package/client/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
  299. package/client/node_modules/dunder-proto/.nycrc +0 -13
  300. package/client/node_modules/dunder-proto/CHANGELOG.md +0 -24
  301. package/client/node_modules/dunder-proto/LICENSE +0 -21
  302. package/client/node_modules/dunder-proto/README.md +0 -54
  303. package/client/node_modules/dunder-proto/get.d.ts +0 -5
  304. package/client/node_modules/dunder-proto/get.js +0 -30
  305. package/client/node_modules/dunder-proto/package.json +0 -76
  306. package/client/node_modules/dunder-proto/set.d.ts +0 -5
  307. package/client/node_modules/dunder-proto/set.js +0 -35
  308. package/client/node_modules/dunder-proto/test/get.js +0 -34
  309. package/client/node_modules/dunder-proto/test/index.js +0 -4
  310. package/client/node_modules/dunder-proto/test/set.js +0 -50
  311. package/client/node_modules/dunder-proto/tsconfig.json +0 -9
  312. package/client/node_modules/ee-first/LICENSE +0 -22
  313. package/client/node_modules/ee-first/README.md +0 -80
  314. package/client/node_modules/ee-first/index.js +0 -95
  315. package/client/node_modules/ee-first/package.json +0 -29
  316. package/client/node_modules/encodeurl/LICENSE +0 -22
  317. package/client/node_modules/encodeurl/README.md +0 -109
  318. package/client/node_modules/encodeurl/index.js +0 -60
  319. package/client/node_modules/encodeurl/package.json +0 -40
  320. package/client/node_modules/es-define-property/.eslintrc +0 -13
  321. package/client/node_modules/es-define-property/.github/FUNDING.yml +0 -12
  322. package/client/node_modules/es-define-property/.nycrc +0 -9
  323. package/client/node_modules/es-define-property/CHANGELOG.md +0 -29
  324. package/client/node_modules/es-define-property/LICENSE +0 -21
  325. package/client/node_modules/es-define-property/README.md +0 -49
  326. package/client/node_modules/es-define-property/index.d.ts +0 -3
  327. package/client/node_modules/es-define-property/index.js +0 -14
  328. package/client/node_modules/es-define-property/package.json +0 -81
  329. package/client/node_modules/es-define-property/test/index.js +0 -56
  330. package/client/node_modules/es-define-property/tsconfig.json +0 -10
  331. package/client/node_modules/es-errors/.eslintrc +0 -5
  332. package/client/node_modules/es-errors/.github/FUNDING.yml +0 -12
  333. package/client/node_modules/es-errors/CHANGELOG.md +0 -40
  334. package/client/node_modules/es-errors/LICENSE +0 -21
  335. package/client/node_modules/es-errors/README.md +0 -55
  336. package/client/node_modules/es-errors/eval.d.ts +0 -3
  337. package/client/node_modules/es-errors/eval.js +0 -4
  338. package/client/node_modules/es-errors/index.d.ts +0 -3
  339. package/client/node_modules/es-errors/index.js +0 -4
  340. package/client/node_modules/es-errors/package.json +0 -80
  341. package/client/node_modules/es-errors/range.d.ts +0 -3
  342. package/client/node_modules/es-errors/range.js +0 -4
  343. package/client/node_modules/es-errors/ref.d.ts +0 -3
  344. package/client/node_modules/es-errors/ref.js +0 -4
  345. package/client/node_modules/es-errors/syntax.d.ts +0 -3
  346. package/client/node_modules/es-errors/syntax.js +0 -4
  347. package/client/node_modules/es-errors/test/index.js +0 -19
  348. package/client/node_modules/es-errors/tsconfig.json +0 -49
  349. package/client/node_modules/es-errors/type.d.ts +0 -3
  350. package/client/node_modules/es-errors/type.js +0 -4
  351. package/client/node_modules/es-errors/uri.d.ts +0 -3
  352. package/client/node_modules/es-errors/uri.js +0 -4
  353. package/client/node_modules/es-object-atoms/.eslintrc +0 -16
  354. package/client/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
  355. package/client/node_modules/es-object-atoms/CHANGELOG.md +0 -44
  356. package/client/node_modules/es-object-atoms/LICENSE +0 -21
  357. package/client/node_modules/es-object-atoms/README.md +0 -63
  358. package/client/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
  359. package/client/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
  360. package/client/node_modules/es-object-atoms/ToObject.d.ts +0 -7
  361. package/client/node_modules/es-object-atoms/ToObject.js +0 -10
  362. package/client/node_modules/es-object-atoms/index.d.ts +0 -3
  363. package/client/node_modules/es-object-atoms/index.js +0 -4
  364. package/client/node_modules/es-object-atoms/isObject.d.ts +0 -3
  365. package/client/node_modules/es-object-atoms/isObject.js +0 -6
  366. package/client/node_modules/es-object-atoms/package.json +0 -79
  367. package/client/node_modules/es-object-atoms/test/index.js +0 -38
  368. package/client/node_modules/es-object-atoms/tsconfig.json +0 -7
  369. package/client/node_modules/escape-html/LICENSE +0 -24
  370. package/client/node_modules/escape-html/Readme.md +0 -43
  371. package/client/node_modules/escape-html/index.js +0 -78
  372. package/client/node_modules/escape-html/package.json +0 -24
  373. package/client/node_modules/etag/HISTORY.md +0 -83
  374. package/client/node_modules/etag/LICENSE +0 -22
  375. package/client/node_modules/etag/README.md +0 -159
  376. package/client/node_modules/etag/index.js +0 -131
  377. package/client/node_modules/etag/package.json +0 -47
  378. package/client/node_modules/express/History.md +0 -3676
  379. package/client/node_modules/express/LICENSE +0 -24
  380. package/client/node_modules/express/Readme.md +0 -260
  381. package/client/node_modules/express/index.js +0 -11
  382. package/client/node_modules/express/lib/application.js +0 -661
  383. package/client/node_modules/express/lib/express.js +0 -116
  384. package/client/node_modules/express/lib/middleware/init.js +0 -43
  385. package/client/node_modules/express/lib/middleware/query.js +0 -47
  386. package/client/node_modules/express/lib/request.js +0 -525
  387. package/client/node_modules/express/lib/response.js +0 -1179
  388. package/client/node_modules/express/lib/router/index.js +0 -673
  389. package/client/node_modules/express/lib/router/layer.js +0 -181
  390. package/client/node_modules/express/lib/router/route.js +0 -230
  391. package/client/node_modules/express/lib/utils.js +0 -304
  392. package/client/node_modules/express/lib/view.js +0 -182
  393. package/client/node_modules/express/package.json +0 -102
  394. package/client/node_modules/finalhandler/HISTORY.md +0 -216
  395. package/client/node_modules/finalhandler/LICENSE +0 -22
  396. package/client/node_modules/finalhandler/README.md +0 -147
  397. package/client/node_modules/finalhandler/SECURITY.md +0 -25
  398. package/client/node_modules/finalhandler/index.js +0 -341
  399. package/client/node_modules/finalhandler/package.json +0 -47
  400. package/client/node_modules/forwarded/HISTORY.md +0 -21
  401. package/client/node_modules/forwarded/LICENSE +0 -22
  402. package/client/node_modules/forwarded/README.md +0 -57
  403. package/client/node_modules/forwarded/index.js +0 -90
  404. package/client/node_modules/forwarded/package.json +0 -45
  405. package/client/node_modules/fresh/HISTORY.md +0 -70
  406. package/client/node_modules/fresh/LICENSE +0 -23
  407. package/client/node_modules/fresh/README.md +0 -119
  408. package/client/node_modules/fresh/index.js +0 -137
  409. package/client/node_modules/fresh/package.json +0 -46
  410. package/client/node_modules/function-bind/.eslintrc +0 -21
  411. package/client/node_modules/function-bind/.github/FUNDING.yml +0 -12
  412. package/client/node_modules/function-bind/.github/SECURITY.md +0 -3
  413. package/client/node_modules/function-bind/.nycrc +0 -13
  414. package/client/node_modules/function-bind/CHANGELOG.md +0 -136
  415. package/client/node_modules/function-bind/LICENSE +0 -20
  416. package/client/node_modules/function-bind/README.md +0 -46
  417. package/client/node_modules/function-bind/implementation.js +0 -84
  418. package/client/node_modules/function-bind/index.js +0 -5
  419. package/client/node_modules/function-bind/package.json +0 -87
  420. package/client/node_modules/function-bind/test/.eslintrc +0 -9
  421. package/client/node_modules/function-bind/test/index.js +0 -252
  422. package/client/node_modules/get-intrinsic/.eslintrc +0 -42
  423. package/client/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  424. package/client/node_modules/get-intrinsic/.nycrc +0 -9
  425. package/client/node_modules/get-intrinsic/CHANGELOG.md +0 -186
  426. package/client/node_modules/get-intrinsic/LICENSE +0 -21
  427. package/client/node_modules/get-intrinsic/README.md +0 -71
  428. package/client/node_modules/get-intrinsic/index.js +0 -378
  429. package/client/node_modules/get-intrinsic/package.json +0 -97
  430. package/client/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  431. package/client/node_modules/get-proto/.eslintrc +0 -10
  432. package/client/node_modules/get-proto/.github/FUNDING.yml +0 -12
  433. package/client/node_modules/get-proto/.nycrc +0 -9
  434. package/client/node_modules/get-proto/CHANGELOG.md +0 -21
  435. package/client/node_modules/get-proto/LICENSE +0 -21
  436. package/client/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
  437. package/client/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
  438. package/client/node_modules/get-proto/README.md +0 -50
  439. package/client/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
  440. package/client/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
  441. package/client/node_modules/get-proto/index.d.ts +0 -5
  442. package/client/node_modules/get-proto/index.js +0 -27
  443. package/client/node_modules/get-proto/package.json +0 -81
  444. package/client/node_modules/get-proto/test/index.js +0 -68
  445. package/client/node_modules/get-proto/tsconfig.json +0 -9
  446. package/client/node_modules/gopd/.eslintrc +0 -16
  447. package/client/node_modules/gopd/.github/FUNDING.yml +0 -12
  448. package/client/node_modules/gopd/CHANGELOG.md +0 -45
  449. package/client/node_modules/gopd/LICENSE +0 -21
  450. package/client/node_modules/gopd/README.md +0 -40
  451. package/client/node_modules/gopd/gOPD.d.ts +0 -1
  452. package/client/node_modules/gopd/gOPD.js +0 -4
  453. package/client/node_modules/gopd/index.d.ts +0 -5
  454. package/client/node_modules/gopd/index.js +0 -15
  455. package/client/node_modules/gopd/package.json +0 -77
  456. package/client/node_modules/gopd/test/index.js +0 -36
  457. package/client/node_modules/gopd/tsconfig.json +0 -9
  458. package/client/node_modules/has-symbols/.eslintrc +0 -11
  459. package/client/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  460. package/client/node_modules/has-symbols/.nycrc +0 -9
  461. package/client/node_modules/has-symbols/CHANGELOG.md +0 -91
  462. package/client/node_modules/has-symbols/LICENSE +0 -21
  463. package/client/node_modules/has-symbols/README.md +0 -46
  464. package/client/node_modules/has-symbols/index.d.ts +0 -3
  465. package/client/node_modules/has-symbols/index.js +0 -14
  466. package/client/node_modules/has-symbols/package.json +0 -111
  467. package/client/node_modules/has-symbols/shams.d.ts +0 -3
  468. package/client/node_modules/has-symbols/shams.js +0 -45
  469. package/client/node_modules/has-symbols/test/index.js +0 -22
  470. package/client/node_modules/has-symbols/test/shams/core-js.js +0 -29
  471. package/client/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
  472. package/client/node_modules/has-symbols/test/tests.js +0 -58
  473. package/client/node_modules/has-symbols/tsconfig.json +0 -10
  474. package/client/node_modules/hasown/.github/FUNDING.yml +0 -12
  475. package/client/node_modules/hasown/.nycrc +0 -13
  476. package/client/node_modules/hasown/CHANGELOG.md +0 -58
  477. package/client/node_modules/hasown/LICENSE +0 -21
  478. package/client/node_modules/hasown/README.md +0 -40
  479. package/client/node_modules/hasown/eslint.config.mjs +0 -6
  480. package/client/node_modules/hasown/index.d.ts +0 -3
  481. package/client/node_modules/hasown/index.js +0 -8
  482. package/client/node_modules/hasown/package.json +0 -91
  483. package/client/node_modules/hasown/tsconfig.json +0 -6
  484. package/client/node_modules/http-errors/HISTORY.md +0 -186
  485. package/client/node_modules/http-errors/LICENSE +0 -23
  486. package/client/node_modules/http-errors/README.md +0 -169
  487. package/client/node_modules/http-errors/index.js +0 -290
  488. package/client/node_modules/http-errors/package.json +0 -54
  489. package/client/node_modules/iconv-lite/Changelog.md +0 -162
  490. package/client/node_modules/iconv-lite/LICENSE +0 -21
  491. package/client/node_modules/iconv-lite/README.md +0 -156
  492. package/client/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  493. package/client/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  494. package/client/node_modules/iconv-lite/encodings/index.js +0 -22
  495. package/client/node_modules/iconv-lite/encodings/internal.js +0 -188
  496. package/client/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  497. package/client/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  498. package/client/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  499. package/client/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  500. package/client/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  501. package/client/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  502. package/client/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  503. package/client/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  504. package/client/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  505. package/client/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  506. package/client/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  507. package/client/node_modules/iconv-lite/encodings/utf16.js +0 -177
  508. package/client/node_modules/iconv-lite/encodings/utf7.js +0 -290
  509. package/client/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  510. package/client/node_modules/iconv-lite/lib/extend-node.js +0 -217
  511. package/client/node_modules/iconv-lite/lib/index.d.ts +0 -24
  512. package/client/node_modules/iconv-lite/lib/index.js +0 -153
  513. package/client/node_modules/iconv-lite/lib/streams.js +0 -121
  514. package/client/node_modules/iconv-lite/package.json +0 -46
  515. package/client/node_modules/inherits/LICENSE +0 -16
  516. package/client/node_modules/inherits/README.md +0 -42
  517. package/client/node_modules/inherits/inherits.js +0 -9
  518. package/client/node_modules/inherits/inherits_browser.js +0 -27
  519. package/client/node_modules/inherits/package.json +0 -29
  520. package/client/node_modules/ipaddr.js/LICENSE +0 -19
  521. package/client/node_modules/ipaddr.js/README.md +0 -233
  522. package/client/node_modules/ipaddr.js/ipaddr.min.js +0 -1
  523. package/client/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
  524. package/client/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
  525. package/client/node_modules/ipaddr.js/package.json +0 -35
  526. package/client/node_modules/is-docker/cli.js +0 -5
  527. package/client/node_modules/is-docker/index.d.ts +0 -15
  528. package/client/node_modules/is-docker/index.js +0 -29
  529. package/client/node_modules/is-docker/license +0 -9
  530. package/client/node_modules/is-docker/package.json +0 -42
  531. package/client/node_modules/is-docker/readme.md +0 -27
  532. package/client/node_modules/is-wsl/index.d.ts +0 -15
  533. package/client/node_modules/is-wsl/index.js +0 -31
  534. package/client/node_modules/is-wsl/license +0 -9
  535. package/client/node_modules/is-wsl/package.json +0 -45
  536. package/client/node_modules/is-wsl/readme.md +0 -36
  537. package/client/node_modules/math-intrinsics/.eslintrc +0 -16
  538. package/client/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
  539. package/client/node_modules/math-intrinsics/CHANGELOG.md +0 -24
  540. package/client/node_modules/math-intrinsics/LICENSE +0 -21
  541. package/client/node_modules/math-intrinsics/README.md +0 -50
  542. package/client/node_modules/math-intrinsics/abs.d.ts +0 -1
  543. package/client/node_modules/math-intrinsics/abs.js +0 -4
  544. package/client/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
  545. package/client/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
  546. package/client/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
  547. package/client/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
  548. package/client/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
  549. package/client/node_modules/math-intrinsics/constants/maxValue.js +0 -5
  550. package/client/node_modules/math-intrinsics/floor.d.ts +0 -1
  551. package/client/node_modules/math-intrinsics/floor.js +0 -4
  552. package/client/node_modules/math-intrinsics/isFinite.d.ts +0 -3
  553. package/client/node_modules/math-intrinsics/isFinite.js +0 -12
  554. package/client/node_modules/math-intrinsics/isInteger.d.ts +0 -3
  555. package/client/node_modules/math-intrinsics/isInteger.js +0 -16
  556. package/client/node_modules/math-intrinsics/isNaN.d.ts +0 -1
  557. package/client/node_modules/math-intrinsics/isNaN.js +0 -6
  558. package/client/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
  559. package/client/node_modules/math-intrinsics/isNegativeZero.js +0 -6
  560. package/client/node_modules/math-intrinsics/max.d.ts +0 -1
  561. package/client/node_modules/math-intrinsics/max.js +0 -4
  562. package/client/node_modules/math-intrinsics/min.d.ts +0 -1
  563. package/client/node_modules/math-intrinsics/min.js +0 -4
  564. package/client/node_modules/math-intrinsics/mod.d.ts +0 -3
  565. package/client/node_modules/math-intrinsics/mod.js +0 -9
  566. package/client/node_modules/math-intrinsics/package.json +0 -86
  567. package/client/node_modules/math-intrinsics/pow.d.ts +0 -1
  568. package/client/node_modules/math-intrinsics/pow.js +0 -4
  569. package/client/node_modules/math-intrinsics/round.d.ts +0 -1
  570. package/client/node_modules/math-intrinsics/round.js +0 -4
  571. package/client/node_modules/math-intrinsics/sign.d.ts +0 -3
  572. package/client/node_modules/math-intrinsics/sign.js +0 -11
  573. package/client/node_modules/math-intrinsics/test/index.js +0 -192
  574. package/client/node_modules/math-intrinsics/tsconfig.json +0 -3
  575. package/client/node_modules/media-typer/HISTORY.md +0 -22
  576. package/client/node_modules/media-typer/LICENSE +0 -22
  577. package/client/node_modules/media-typer/README.md +0 -81
  578. package/client/node_modules/media-typer/index.js +0 -270
  579. package/client/node_modules/media-typer/package.json +0 -26
  580. package/client/node_modules/merge-descriptors/HISTORY.md +0 -21
  581. package/client/node_modules/merge-descriptors/LICENSE +0 -23
  582. package/client/node_modules/merge-descriptors/README.md +0 -49
  583. package/client/node_modules/merge-descriptors/index.js +0 -60
  584. package/client/node_modules/merge-descriptors/package.json +0 -39
  585. package/client/node_modules/methods/HISTORY.md +0 -29
  586. package/client/node_modules/methods/LICENSE +0 -24
  587. package/client/node_modules/methods/README.md +0 -51
  588. package/client/node_modules/methods/index.js +0 -69
  589. package/client/node_modules/methods/package.json +0 -36
  590. package/client/node_modules/mime/CHANGELOG.md +0 -164
  591. package/client/node_modules/mime/LICENSE +0 -21
  592. package/client/node_modules/mime/README.md +0 -90
  593. package/client/node_modules/mime/cli.js +0 -8
  594. package/client/node_modules/mime/mime.js +0 -108
  595. package/client/node_modules/mime/package.json +0 -44
  596. package/client/node_modules/mime/src/build.js +0 -53
  597. package/client/node_modules/mime/src/test.js +0 -60
  598. package/client/node_modules/mime/types.json +0 -1
  599. package/client/node_modules/mime-db/HISTORY.md +0 -507
  600. package/client/node_modules/mime-db/LICENSE +0 -23
  601. package/client/node_modules/mime-db/README.md +0 -100
  602. package/client/node_modules/mime-db/db.json +0 -8519
  603. package/client/node_modules/mime-db/index.js +0 -12
  604. package/client/node_modules/mime-db/package.json +0 -60
  605. package/client/node_modules/mime-types/HISTORY.md +0 -397
  606. package/client/node_modules/mime-types/LICENSE +0 -23
  607. package/client/node_modules/mime-types/README.md +0 -113
  608. package/client/node_modules/mime-types/index.js +0 -188
  609. package/client/node_modules/mime-types/package.json +0 -44
  610. package/client/node_modules/ms/index.js +0 -152
  611. package/client/node_modules/ms/license.md +0 -21
  612. package/client/node_modules/ms/package.json +0 -37
  613. package/client/node_modules/ms/readme.md +0 -51
  614. package/client/node_modules/negotiator/HISTORY.md +0 -108
  615. package/client/node_modules/negotiator/LICENSE +0 -24
  616. package/client/node_modules/negotiator/README.md +0 -203
  617. package/client/node_modules/negotiator/index.js +0 -82
  618. package/client/node_modules/negotiator/lib/charset.js +0 -169
  619. package/client/node_modules/negotiator/lib/encoding.js +0 -184
  620. package/client/node_modules/negotiator/lib/language.js +0 -179
  621. package/client/node_modules/negotiator/lib/mediaType.js +0 -294
  622. package/client/node_modules/negotiator/package.json +0 -42
  623. package/client/node_modules/object-inspect/.eslintrc +0 -53
  624. package/client/node_modules/object-inspect/.github/FUNDING.yml +0 -12
  625. package/client/node_modules/object-inspect/.nycrc +0 -13
  626. package/client/node_modules/object-inspect/CHANGELOG.md +0 -424
  627. package/client/node_modules/object-inspect/LICENSE +0 -21
  628. package/client/node_modules/object-inspect/example/all.js +0 -23
  629. package/client/node_modules/object-inspect/example/circular.js +0 -6
  630. package/client/node_modules/object-inspect/example/fn.js +0 -5
  631. package/client/node_modules/object-inspect/example/inspect.js +0 -10
  632. package/client/node_modules/object-inspect/index.js +0 -544
  633. package/client/node_modules/object-inspect/package-support.json +0 -20
  634. package/client/node_modules/object-inspect/package.json +0 -105
  635. package/client/node_modules/object-inspect/readme.markdown +0 -84
  636. package/client/node_modules/object-inspect/test/bigint.js +0 -58
  637. package/client/node_modules/object-inspect/test/browser/dom.js +0 -15
  638. package/client/node_modules/object-inspect/test/circular.js +0 -16
  639. package/client/node_modules/object-inspect/test/deep.js +0 -12
  640. package/client/node_modules/object-inspect/test/element.js +0 -53
  641. package/client/node_modules/object-inspect/test/err.js +0 -48
  642. package/client/node_modules/object-inspect/test/fakes.js +0 -29
  643. package/client/node_modules/object-inspect/test/fn.js +0 -76
  644. package/client/node_modules/object-inspect/test/global.js +0 -17
  645. package/client/node_modules/object-inspect/test/has.js +0 -15
  646. package/client/node_modules/object-inspect/test/holes.js +0 -15
  647. package/client/node_modules/object-inspect/test/indent-option.js +0 -271
  648. package/client/node_modules/object-inspect/test/inspect.js +0 -139
  649. package/client/node_modules/object-inspect/test/lowbyte.js +0 -12
  650. package/client/node_modules/object-inspect/test/number.js +0 -58
  651. package/client/node_modules/object-inspect/test/quoteStyle.js +0 -26
  652. package/client/node_modules/object-inspect/test/toStringTag.js +0 -40
  653. package/client/node_modules/object-inspect/test/undef.js +0 -12
  654. package/client/node_modules/object-inspect/test/values.js +0 -261
  655. package/client/node_modules/object-inspect/test-core-js.js +0 -26
  656. package/client/node_modules/object-inspect/util.inspect.js +0 -1
  657. package/client/node_modules/on-finished/HISTORY.md +0 -98
  658. package/client/node_modules/on-finished/LICENSE +0 -23
  659. package/client/node_modules/on-finished/README.md +0 -162
  660. package/client/node_modules/on-finished/index.js +0 -234
  661. package/client/node_modules/on-finished/package.json +0 -39
  662. package/client/node_modules/open/index.d.ts +0 -153
  663. package/client/node_modules/open/index.js +0 -334
  664. package/client/node_modules/open/license +0 -9
  665. package/client/node_modules/open/package.json +0 -61
  666. package/client/node_modules/open/readme.md +0 -171
  667. package/client/node_modules/open/xdg-open +0 -1066
  668. package/client/node_modules/parseurl/HISTORY.md +0 -58
  669. package/client/node_modules/parseurl/LICENSE +0 -24
  670. package/client/node_modules/parseurl/README.md +0 -133
  671. package/client/node_modules/parseurl/index.js +0 -158
  672. package/client/node_modules/parseurl/package.json +0 -40
  673. package/client/node_modules/path-to-regexp/LICENSE +0 -21
  674. package/client/node_modules/path-to-regexp/Readme.md +0 -35
  675. package/client/node_modules/path-to-regexp/index.js +0 -158
  676. package/client/node_modules/path-to-regexp/package.json +0 -30
  677. package/client/node_modules/proxy-addr/HISTORY.md +0 -161
  678. package/client/node_modules/proxy-addr/LICENSE +0 -22
  679. package/client/node_modules/proxy-addr/README.md +0 -139
  680. package/client/node_modules/proxy-addr/index.js +0 -327
  681. package/client/node_modules/proxy-addr/package.json +0 -47
  682. package/client/node_modules/qs/.editorconfig +0 -46
  683. package/client/node_modules/qs/.github/FUNDING.yml +0 -12
  684. package/client/node_modules/qs/.github/SECURITY.md +0 -11
  685. package/client/node_modules/qs/.github/THREAT_MODEL.md +0 -78
  686. package/client/node_modules/qs/.nycrc +0 -13
  687. package/client/node_modules/qs/CHANGELOG.md +0 -822
  688. package/client/node_modules/qs/LICENSE.md +0 -29
  689. package/client/node_modules/qs/README.md +0 -758
  690. package/client/node_modules/qs/dist/qs.js +0 -141
  691. package/client/node_modules/qs/eslint.config.mjs +0 -57
  692. package/client/node_modules/qs/lib/formats.js +0 -23
  693. package/client/node_modules/qs/lib/index.js +0 -11
  694. package/client/node_modules/qs/lib/parse.js +0 -403
  695. package/client/node_modules/qs/lib/stringify.js +0 -363
  696. package/client/node_modules/qs/lib/utils.js +0 -342
  697. package/client/node_modules/qs/package.json +0 -94
  698. package/client/node_modules/qs/test/empty-keys-cases.js +0 -267
  699. package/client/node_modules/qs/test/parse.js +0 -1703
  700. package/client/node_modules/qs/test/stringify.js +0 -1448
  701. package/client/node_modules/qs/test/utils.js +0 -432
  702. package/client/node_modules/range-parser/HISTORY.md +0 -56
  703. package/client/node_modules/range-parser/LICENSE +0 -23
  704. package/client/node_modules/range-parser/README.md +0 -84
  705. package/client/node_modules/range-parser/index.js +0 -162
  706. package/client/node_modules/range-parser/package.json +0 -44
  707. package/client/node_modules/raw-body/LICENSE +0 -22
  708. package/client/node_modules/raw-body/README.md +0 -223
  709. package/client/node_modules/raw-body/index.d.ts +0 -87
  710. package/client/node_modules/raw-body/index.js +0 -336
  711. package/client/node_modules/raw-body/package.json +0 -47
  712. package/client/node_modules/safe-buffer/LICENSE +0 -21
  713. package/client/node_modules/safe-buffer/README.md +0 -584
  714. package/client/node_modules/safe-buffer/index.d.ts +0 -187
  715. package/client/node_modules/safe-buffer/index.js +0 -65
  716. package/client/node_modules/safe-buffer/package.json +0 -51
  717. package/client/node_modules/safer-buffer/LICENSE +0 -21
  718. package/client/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  719. package/client/node_modules/safer-buffer/Readme.md +0 -156
  720. package/client/node_modules/safer-buffer/dangerous.js +0 -58
  721. package/client/node_modules/safer-buffer/package.json +0 -34
  722. package/client/node_modules/safer-buffer/safer.js +0 -77
  723. package/client/node_modules/safer-buffer/tests.js +0 -406
  724. package/client/node_modules/send/HISTORY.md +0 -538
  725. package/client/node_modules/send/LICENSE +0 -23
  726. package/client/node_modules/send/README.md +0 -327
  727. package/client/node_modules/send/SECURITY.md +0 -24
  728. package/client/node_modules/send/index.js +0 -1142
  729. package/client/node_modules/send/node_modules/ms/index.js +0 -162
  730. package/client/node_modules/send/node_modules/ms/license.md +0 -21
  731. package/client/node_modules/send/node_modules/ms/package.json +0 -38
  732. package/client/node_modules/send/node_modules/ms/readme.md +0 -59
  733. package/client/node_modules/send/package.json +0 -62
  734. package/client/node_modules/serve-static/HISTORY.md +0 -493
  735. package/client/node_modules/serve-static/LICENSE +0 -25
  736. package/client/node_modules/serve-static/README.md +0 -257
  737. package/client/node_modules/serve-static/index.js +0 -209
  738. package/client/node_modules/serve-static/package.json +0 -42
  739. package/client/node_modules/setprototypeof/LICENSE +0 -13
  740. package/client/node_modules/setprototypeof/README.md +0 -31
  741. package/client/node_modules/setprototypeof/index.d.ts +0 -2
  742. package/client/node_modules/setprototypeof/index.js +0 -17
  743. package/client/node_modules/setprototypeof/package.json +0 -38
  744. package/client/node_modules/setprototypeof/test/index.js +0 -24
  745. package/client/node_modules/side-channel/.editorconfig +0 -9
  746. package/client/node_modules/side-channel/.eslintrc +0 -12
  747. package/client/node_modules/side-channel/.github/FUNDING.yml +0 -12
  748. package/client/node_modules/side-channel/.nycrc +0 -13
  749. package/client/node_modules/side-channel/CHANGELOG.md +0 -120
  750. package/client/node_modules/side-channel/LICENSE +0 -21
  751. package/client/node_modules/side-channel/README.md +0 -61
  752. package/client/node_modules/side-channel/index.d.ts +0 -14
  753. package/client/node_modules/side-channel/index.js +0 -46
  754. package/client/node_modules/side-channel/package.json +0 -85
  755. package/client/node_modules/side-channel/test/index.js +0 -120
  756. package/client/node_modules/side-channel/tsconfig.json +0 -9
  757. package/client/node_modules/side-channel-list/.editorconfig +0 -9
  758. package/client/node_modules/side-channel-list/.eslintrc +0 -11
  759. package/client/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
  760. package/client/node_modules/side-channel-list/.nycrc +0 -13
  761. package/client/node_modules/side-channel-list/CHANGELOG.md +0 -36
  762. package/client/node_modules/side-channel-list/LICENSE +0 -21
  763. package/client/node_modules/side-channel-list/README.md +0 -62
  764. package/client/node_modules/side-channel-list/index.d.ts +0 -13
  765. package/client/node_modules/side-channel-list/index.js +0 -111
  766. package/client/node_modules/side-channel-list/list.d.ts +0 -14
  767. package/client/node_modules/side-channel-list/package.json +0 -77
  768. package/client/node_modules/side-channel-list/test/index.js +0 -154
  769. package/client/node_modules/side-channel-list/tsconfig.json +0 -9
  770. package/client/node_modules/side-channel-map/.editorconfig +0 -9
  771. package/client/node_modules/side-channel-map/.eslintrc +0 -11
  772. package/client/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
  773. package/client/node_modules/side-channel-map/.nycrc +0 -13
  774. package/client/node_modules/side-channel-map/CHANGELOG.md +0 -22
  775. package/client/node_modules/side-channel-map/LICENSE +0 -21
  776. package/client/node_modules/side-channel-map/README.md +0 -62
  777. package/client/node_modules/side-channel-map/index.d.ts +0 -15
  778. package/client/node_modules/side-channel-map/index.js +0 -68
  779. package/client/node_modules/side-channel-map/package.json +0 -80
  780. package/client/node_modules/side-channel-map/test/index.js +0 -114
  781. package/client/node_modules/side-channel-map/tsconfig.json +0 -9
  782. package/client/node_modules/side-channel-weakmap/.editorconfig +0 -9
  783. package/client/node_modules/side-channel-weakmap/.eslintrc +0 -12
  784. package/client/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
  785. package/client/node_modules/side-channel-weakmap/.nycrc +0 -13
  786. package/client/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
  787. package/client/node_modules/side-channel-weakmap/LICENSE +0 -21
  788. package/client/node_modules/side-channel-weakmap/README.md +0 -62
  789. package/client/node_modules/side-channel-weakmap/index.d.ts +0 -15
  790. package/client/node_modules/side-channel-weakmap/index.js +0 -84
  791. package/client/node_modules/side-channel-weakmap/package.json +0 -87
  792. package/client/node_modules/side-channel-weakmap/test/index.js +0 -114
  793. package/client/node_modules/side-channel-weakmap/tsconfig.json +0 -9
  794. package/client/node_modules/statuses/HISTORY.md +0 -87
  795. package/client/node_modules/statuses/LICENSE +0 -23
  796. package/client/node_modules/statuses/README.md +0 -139
  797. package/client/node_modules/statuses/codes.json +0 -65
  798. package/client/node_modules/statuses/index.js +0 -146
  799. package/client/node_modules/statuses/package.json +0 -49
  800. package/client/node_modules/toidentifier/HISTORY.md +0 -9
  801. package/client/node_modules/toidentifier/LICENSE +0 -21
  802. package/client/node_modules/toidentifier/README.md +0 -61
  803. package/client/node_modules/toidentifier/index.js +0 -32
  804. package/client/node_modules/toidentifier/package.json +0 -38
  805. package/client/node_modules/type-is/HISTORY.md +0 -259
  806. package/client/node_modules/type-is/LICENSE +0 -23
  807. package/client/node_modules/type-is/README.md +0 -170
  808. package/client/node_modules/type-is/index.js +0 -266
  809. package/client/node_modules/type-is/package.json +0 -45
  810. package/client/node_modules/typescript/LICENSE.txt +0 -55
  811. package/client/node_modules/typescript/README.md +0 -50
  812. package/client/node_modules/typescript/SECURITY.md +0 -41
  813. package/client/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  814. package/client/node_modules/typescript/bin/tsc +0 -2
  815. package/client/node_modules/typescript/bin/tsserver +0 -2
  816. package/client/node_modules/typescript/lib/_tsc.js +0 -133818
  817. package/client/node_modules/typescript/lib/_tsserver.js +0 -659
  818. package/client/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  819. package/client/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  820. package/client/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  821. package/client/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  822. package/client/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  823. package/client/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  824. package/client/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  825. package/client/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  826. package/client/node_modules/typescript/lib/lib.d.ts +0 -22
  827. package/client/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  828. package/client/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  829. package/client/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  830. package/client/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  831. package/client/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  832. package/client/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  833. package/client/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  834. package/client/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  835. package/client/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  836. package/client/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  837. package/client/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  838. package/client/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  839. package/client/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  840. package/client/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  841. package/client/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  842. package/client/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  843. package/client/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  844. package/client/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  845. package/client/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  846. package/client/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  847. package/client/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  848. package/client/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  849. package/client/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  850. package/client/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  851. package/client/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  852. package/client/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  853. package/client/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  854. package/client/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  855. package/client/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  856. package/client/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  857. package/client/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  858. package/client/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  859. package/client/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  860. package/client/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  861. package/client/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  862. package/client/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  863. package/client/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  864. package/client/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  865. package/client/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  866. package/client/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  867. package/client/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  868. package/client/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  869. package/client/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  870. package/client/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  871. package/client/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  872. package/client/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  873. package/client/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  874. package/client/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  875. package/client/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  876. package/client/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  877. package/client/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  878. package/client/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  879. package/client/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  880. package/client/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  881. package/client/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  882. package/client/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  883. package/client/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  884. package/client/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  885. package/client/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  886. package/client/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  887. package/client/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  888. package/client/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  889. package/client/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  890. package/client/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  891. package/client/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  892. package/client/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  893. package/client/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  894. package/client/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  895. package/client/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  896. package/client/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  897. package/client/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  898. package/client/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  899. package/client/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  900. package/client/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  901. package/client/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  902. package/client/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  903. package/client/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  904. package/client/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  905. package/client/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  906. package/client/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  907. package/client/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  908. package/client/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  909. package/client/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  910. package/client/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  911. package/client/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  912. package/client/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  913. package/client/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  914. package/client/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  915. package/client/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  916. package/client/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  917. package/client/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  918. package/client/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  919. package/client/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  920. package/client/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  921. package/client/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  922. package/client/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  923. package/client/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  924. package/client/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  925. package/client/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  926. package/client/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  927. package/client/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  928. package/client/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  929. package/client/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  930. package/client/node_modules/typescript/lib/tsc.js +0 -8
  931. package/client/node_modules/typescript/lib/tsserver.js +0 -8
  932. package/client/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  933. package/client/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  934. package/client/node_modules/typescript/lib/typesMap.json +0 -497
  935. package/client/node_modules/typescript/lib/typescript.d.ts +0 -11437
  936. package/client/node_modules/typescript/lib/typescript.js +0 -200276
  937. package/client/node_modules/typescript/lib/typingsInstaller.js +0 -8
  938. package/client/node_modules/typescript/lib/watchGuard.js +0 -53
  939. package/client/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  940. package/client/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  941. package/client/node_modules/typescript/package.json +0 -120
  942. package/client/node_modules/undici-types/LICENSE +0 -21
  943. package/client/node_modules/undici-types/README.md +0 -6
  944. package/client/node_modules/undici-types/agent.d.ts +0 -31
  945. package/client/node_modules/undici-types/api.d.ts +0 -43
  946. package/client/node_modules/undici-types/balanced-pool.d.ts +0 -29
  947. package/client/node_modules/undici-types/cache.d.ts +0 -36
  948. package/client/node_modules/undici-types/client.d.ts +0 -108
  949. package/client/node_modules/undici-types/connector.d.ts +0 -34
  950. package/client/node_modules/undici-types/content-type.d.ts +0 -21
  951. package/client/node_modules/undici-types/cookies.d.ts +0 -28
  952. package/client/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  953. package/client/node_modules/undici-types/dispatcher.d.ts +0 -256
  954. package/client/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  955. package/client/node_modules/undici-types/errors.d.ts +0 -149
  956. package/client/node_modules/undici-types/eventsource.d.ts +0 -61
  957. package/client/node_modules/undici-types/fetch.d.ts +0 -209
  958. package/client/node_modules/undici-types/file.d.ts +0 -39
  959. package/client/node_modules/undici-types/filereader.d.ts +0 -54
  960. package/client/node_modules/undici-types/formdata.d.ts +0 -108
  961. package/client/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  962. package/client/node_modules/undici-types/global-origin.d.ts +0 -7
  963. package/client/node_modules/undici-types/handlers.d.ts +0 -15
  964. package/client/node_modules/undici-types/header.d.ts +0 -4
  965. package/client/node_modules/undici-types/index.d.ts +0 -71
  966. package/client/node_modules/undici-types/interceptors.d.ts +0 -17
  967. package/client/node_modules/undici-types/mock-agent.d.ts +0 -50
  968. package/client/node_modules/undici-types/mock-client.d.ts +0 -25
  969. package/client/node_modules/undici-types/mock-errors.d.ts +0 -12
  970. package/client/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  971. package/client/node_modules/undici-types/mock-pool.d.ts +0 -25
  972. package/client/node_modules/undici-types/package.json +0 -55
  973. package/client/node_modules/undici-types/patch.d.ts +0 -33
  974. package/client/node_modules/undici-types/pool-stats.d.ts +0 -19
  975. package/client/node_modules/undici-types/pool.d.ts +0 -39
  976. package/client/node_modules/undici-types/proxy-agent.d.ts +0 -28
  977. package/client/node_modules/undici-types/readable.d.ts +0 -65
  978. package/client/node_modules/undici-types/retry-agent.d.ts +0 -8
  979. package/client/node_modules/undici-types/retry-handler.d.ts +0 -116
  980. package/client/node_modules/undici-types/util.d.ts +0 -18
  981. package/client/node_modules/undici-types/webidl.d.ts +0 -228
  982. package/client/node_modules/undici-types/websocket.d.ts +0 -150
  983. package/client/node_modules/unpipe/HISTORY.md +0 -4
  984. package/client/node_modules/unpipe/LICENSE +0 -22
  985. package/client/node_modules/unpipe/README.md +0 -43
  986. package/client/node_modules/unpipe/index.js +0 -69
  987. package/client/node_modules/unpipe/package.json +0 -27
  988. package/client/node_modules/utils-merge/LICENSE +0 -20
  989. package/client/node_modules/utils-merge/README.md +0 -34
  990. package/client/node_modules/utils-merge/index.js +0 -23
  991. package/client/node_modules/utils-merge/package.json +0 -40
  992. package/client/node_modules/vary/HISTORY.md +0 -39
  993. package/client/node_modules/vary/LICENSE +0 -22
  994. package/client/node_modules/vary/README.md +0 -101
  995. package/client/node_modules/vary/index.js +0 -149
  996. package/client/node_modules/vary/package.json +0 -43
  997. package/client/obfuscate.js +0 -132
  998. package/client/package-lock.json +0 -956
  999. package/client/package.json +0 -32
  1000. package/client/src/cli.ts +0 -273
  1001. package/client/src/dashboard.ts +0 -85
  1002. package/client/src/executor.ts +0 -65
  1003. package/client/src/filters/generic.ts +0 -60
  1004. package/client/src/filters/git.ts +0 -150
  1005. package/client/src/filters/index.ts +0 -113
  1006. package/client/src/filters/js.ts +0 -102
  1007. package/client/src/filters/python.ts +0 -152
  1008. package/client/src/index.html +0 -779
  1009. package/client/src/mcp.ts +0 -88
  1010. package/client/src/redactor.ts +0 -54
  1011. package/client/src/seed.ts +0 -35
  1012. package/client/src/shims.ts +0 -142
  1013. package/client/src/simulate.ts +0 -98
  1014. package/client/src/sync.ts +0 -252
  1015. package/client/src/tracker.ts +0 -269
  1016. package/client/tsconfig.json +0 -14
  1017. package/install.bat +0 -48
  1018. package/test_e2e.js +0 -156
  1019. package/tsconfig.json +0 -15
  1020. /package/{client/dist/index.html → index.html} +0 -0
@@ -1,1703 +0,0 @@
1
- 'use strict';
2
-
3
- var test = require('tape');
4
- var hasPropertyDescriptors = require('has-property-descriptors')();
5
- var iconv = require('iconv-lite');
6
- var mockProperty = require('mock-property');
7
- var hasOverrideMistake = require('has-override-mistake')();
8
- var SaferBuffer = require('safer-buffer').Buffer;
9
- var v = require('es-value-fixtures');
10
- var inspect = require('object-inspect');
11
- var emptyTestCases = require('./empty-keys-cases').emptyTestCases;
12
- var hasProto = require('has-proto')();
13
-
14
- var qs = require('../');
15
- var utils = require('../lib/utils');
16
-
17
- test('parse()', function (t) {
18
- t.test('parses a simple string', function (st) {
19
- st.deepEqual(qs.parse('0=foo'), { 0: 'foo' });
20
- st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' });
21
- st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });
22
- st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });
23
- st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });
24
- st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });
25
- st.deepEqual(qs.parse('foo'), { foo: '' });
26
- st.deepEqual(qs.parse('foo='), { foo: '' });
27
- st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });
28
- st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });
29
- st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });
30
- st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });
31
- st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });
32
- st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });
33
- st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });
34
- st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {
35
- cht: 'p3',
36
- chd: 't:60,40',
37
- chs: '250x100',
38
- chl: 'Hello|World'
39
- });
40
- st.end();
41
- });
42
-
43
- t.test('comma: false', function (st) {
44
- st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
45
- st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] });
46
- st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' });
47
- st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] });
48
- st.end();
49
- });
50
-
51
- t.test('comma: true', function (st) {
52
- st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] });
53
- st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] });
54
- st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] });
55
- st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] });
56
- st.end();
57
- });
58
-
59
- t.test('allows enabling dot notation', function (st) {
60
- st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
61
- st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
62
-
63
- st.end();
64
- });
65
-
66
- t.test('decode dot keys correctly', function (st) {
67
- st.deepEqual(
68
- qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }),
69
- { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' },
70
- 'with allowDots false and decodeDotInKeys false'
71
- );
72
- st.deepEqual(
73
- qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }),
74
- { name: { obj: { first: 'John', last: 'Doe' } } },
75
- 'with allowDots false and decodeDotInKeys false'
76
- );
77
- st.deepEqual(
78
- qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }),
79
- { 'name%2Eobj': { first: 'John', last: 'Doe' } },
80
- 'with allowDots true and decodeDotInKeys false'
81
- );
82
- st.deepEqual(
83
- qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }),
84
- { 'name.obj': { first: 'John', last: 'Doe' } },
85
- 'with allowDots true and decodeDotInKeys true'
86
- );
87
-
88
- st.deepEqual(
89
- qs.parse(
90
- 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe',
91
- { allowDots: false, decodeDotInKeys: false }
92
- ),
93
- { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' },
94
- 'with allowDots false and decodeDotInKeys false'
95
- );
96
- st.deepEqual(
97
- qs.parse(
98
- 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe',
99
- { allowDots: true, decodeDotInKeys: false }
100
- ),
101
- { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } },
102
- 'with allowDots true and decodeDotInKeys false'
103
- );
104
- st.deepEqual(
105
- qs.parse(
106
- 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe',
107
- { allowDots: true, decodeDotInKeys: true }
108
- ),
109
- { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
110
- 'with allowDots true and decodeDotInKeys true'
111
- );
112
- st.deepEqual(
113
- qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'),
114
- { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' },
115
- 'with allowDots and decodeDotInKeys undefined'
116
- );
117
-
118
- st.end();
119
- });
120
-
121
- t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) {
122
- st.deepEqual(
123
- qs.parse(
124
- 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe',
125
- { decodeDotInKeys: true }
126
- ),
127
- { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
128
- 'with allowDots undefined and decodeDotInKeys true'
129
- );
130
-
131
- st.end();
132
- });
133
-
134
- t.test('throws when decodeDotInKeys is not of type boolean', function (st) {
135
- st['throws'](
136
- function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); },
137
- TypeError
138
- );
139
-
140
- st['throws'](
141
- function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); },
142
- TypeError
143
- );
144
- st['throws'](
145
- function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); },
146
- TypeError
147
- );
148
-
149
- st['throws'](
150
- function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); },
151
- TypeError
152
- );
153
-
154
- st.end();
155
- });
156
-
157
- t.test('allows empty arrays in obj values', function (st) {
158
- st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' });
159
- st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' });
160
-
161
- st.end();
162
- });
163
-
164
- t.test('throws when allowEmptyArrays is not of type boolean', function (st) {
165
- st['throws'](
166
- function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); },
167
- TypeError
168
- );
169
-
170
- st['throws'](
171
- function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); },
172
- TypeError
173
- );
174
- st['throws'](
175
- function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); },
176
- TypeError
177
- );
178
-
179
- st['throws'](
180
- function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); },
181
- TypeError
182
- );
183
-
184
- st.end();
185
- });
186
-
187
- t.test('allowEmptyArrays + strictNullHandling', function (st) {
188
- st.deepEqual(
189
- qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }),
190
- { testEmptyArray: [] }
191
- );
192
-
193
- st.end();
194
- });
195
-
196
- t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');
197
- t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');
198
- t.deepEqual(
199
- qs.parse('a[b][c][d][e][f][g][h]=i'),
200
- { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },
201
- 'defaults to a depth of 5'
202
- );
203
-
204
- t.test('only parses one level when depth = 1', function (st) {
205
- st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });
206
- st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });
207
- st.end();
208
- });
209
-
210
- t.test('uses original key when depth = 0', function (st) {
211
- st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' });
212
- st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });
213
- st.deepEqual(qs.parse('a.b=c', { depth: 0, allowDots: true }), { 'a[b]': 'c' }, 'normalizes dots before applying depth-0 behavior');
214
- st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {}, 'respects prototype guard at depth 0');
215
- st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' }, 'allows prototypes at depth 0 when enabled');
216
- st.end();
217
- });
218
-
219
- t.test('ignores prototype keys when depth = 0 and allowPrototypes is false', function (st) {
220
- st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {});
221
- st.deepEqual(qs.parse('hasOwnProperty=bar', { depth: 0 }), {});
222
- st.deepEqual(qs.parse('toString=foo&a=b', { depth: 0 }), { a: 'b' });
223
- st.end();
224
- });
225
-
226
- t.test('allows prototype keys when depth = 0 and allowPrototypes is true', function (st) {
227
- st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' });
228
- st.end();
229
- });
230
-
231
- t.test('uses original key when depth = false', function (st) {
232
- st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' });
233
- st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });
234
- st.end();
235
- });
236
-
237
- t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
238
-
239
- t.test('parses an explicit array', function (st) {
240
- st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });
241
- st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
242
- st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });
243
- st.end();
244
- });
245
-
246
- t.test('parses a mix of simple and explicit arrays', function (st) {
247
- st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
248
- st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
249
- st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });
250
- st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });
251
-
252
- st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
253
- st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });
254
- st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
255
-
256
- st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
257
- st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });
258
- st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
259
-
260
- st.end();
261
- });
262
-
263
- t.test('parses a nested array', function (st) {
264
- st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });
265
- st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });
266
- st.end();
267
- });
268
-
269
- t.test('parses keys with literal [] inside a bracket group (#493)', function (st) {
270
- // A bracket pair inside a bracket group should be treated literally as part of the key
271
- st.deepEqual(
272
- qs.parse('search[withbracket[]]=foobar'),
273
- { search: { 'withbracket[]': 'foobar' } },
274
- 'treats inner [] literally when inside a bracket group'
275
- );
276
-
277
- // Single-level variant
278
- st.deepEqual(
279
- qs.parse('a[b[]]=c'),
280
- { a: { 'b[]': 'c' } },
281
- 'keeps "b[]" as a literal key'
282
- );
283
-
284
- // Nested with an array push on the outer level
285
- st.deepEqual(
286
- qs.parse('list[][x[]]=y'),
287
- { list: [{ 'x[]': 'y' }] },
288
- 'preserves inner [] while still treating outer [] as array push'
289
- );
290
-
291
- // Multiple nested bracket pairs: inner [] remains literal as part of the key
292
- st.deepEqual(
293
- qs.parse('a[b[c[]]]=d'),
294
- { a: { 'b[c[]]': 'd' } },
295
- 'treats "b[c[]]" as a literal key inside the bracket group'
296
- );
297
-
298
- // Depth limits with literal brackets: preserve inner [] while limiting bracket-group parsing
299
- st.deepEqual(
300
- qs.parse('a[b[c[]]][d]=e', { depth: 1 }),
301
- { a: { 'b[c[]]': { '[d]': 'e' } } },
302
- 'respects depth: 1 and preserves literal inner [] in the parsed key'
303
- );
304
-
305
- // Unterminated inner bracket group is wrapped as a literal remainder segment
306
- st.deepEqual(
307
- qs.parse('a[[]b=c'),
308
- { a: { '[[]b': 'c' } },
309
- 'handles unterminated inner bracket groups without throwing'
310
- );
311
-
312
- st.end();
313
- });
314
-
315
- t.test('allows to specify array indices', function (st) {
316
- st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
317
- st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
318
- st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] });
319
- st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } });
320
- st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });
321
- st.end();
322
- });
323
-
324
- t.test('limits specific array indices to arrayLimit', function (st) {
325
- st.deepEqual(qs.parse('a[19]=a', { arrayLimit: 20 }), { a: ['a'] });
326
- st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: { 20: 'a' } });
327
-
328
- st.deepEqual(qs.parse('a[19]=a'), { a: ['a'] });
329
- st.deepEqual(qs.parse('a[20]=a'), { a: { 20: 'a' } });
330
- st.end();
331
- });
332
-
333
- t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');
334
-
335
- t.test('supports encoded = signs', function (st) {
336
- st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });
337
- st.end();
338
- });
339
-
340
- t.test('is ok with url encoded strings', function (st) {
341
- st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });
342
- st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });
343
- st.end();
344
- });
345
-
346
- t.test('allows brackets in the value', function (st) {
347
- st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });
348
- st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });
349
- st.end();
350
- });
351
-
352
- t.test('allows empty values', function (st) {
353
- st.deepEqual(qs.parse(''), {});
354
- st.deepEqual(qs.parse(null), {});
355
- st.deepEqual(qs.parse(undefined), {});
356
- st.end();
357
- });
358
-
359
- t.test('transforms arrays to objects', function (st) {
360
- st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
361
- st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
362
- st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
363
- st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
364
- st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
365
- st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
366
-
367
- st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } });
368
- st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } });
369
- st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } });
370
- st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } });
371
- st.end();
372
- });
373
-
374
- t.test('transforms arrays to objects (dot notation)', function (st) {
375
- st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
376
- st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
377
- st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
378
- st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });
379
- st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });
380
- st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
381
- st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
382
- st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } });
383
- st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
384
- st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
385
- st.end();
386
- });
387
-
388
- t.test('correctly prunes undefined values when converting an array to an object', function (st) {
389
- st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } });
390
- st.end();
391
- });
392
-
393
- t.test('supports malformed uri characters', function (st) {
394
- st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });
395
- st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });
396
- st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });
397
- st.end();
398
- });
399
-
400
- t.test('doesn\'t produce empty keys', function (st) {
401
- st.deepEqual(qs.parse('_r=1&'), { _r: '1' });
402
- st.end();
403
- });
404
-
405
- t.test('cannot access Object prototype', function (st) {
406
- qs.parse('constructor[prototype][bad]=bad');
407
- qs.parse('bad[constructor][prototype][bad]=bad');
408
- st.equal(typeof Object.prototype.bad, 'undefined');
409
- st.end();
410
- });
411
-
412
- t.test('parses arrays of objects', function (st) {
413
- st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
414
- st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });
415
- st.end();
416
- });
417
-
418
- t.test('allows for empty strings in arrays', function (st) {
419
- st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });
420
-
421
- st.deepEqual(
422
- qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }),
423
- { a: ['b', null, 'c', ''] },
424
- 'with arrayLimit 20 + array indices: null then empty string works'
425
- );
426
- st.deepEqual(
427
- qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }),
428
- { a: { 0: 'b', 1: null, 2: 'c', 3: '' } },
429
- 'with arrayLimit 0 + array brackets: null then empty string works'
430
- );
431
-
432
- st.deepEqual(
433
- qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }),
434
- { a: ['b', '', 'c', null] },
435
- 'with arrayLimit 20 + array indices: empty string then null works'
436
- );
437
- st.deepEqual(
438
- qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }),
439
- { a: { 0: 'b', 1: '', 2: 'c', 3: null } },
440
- 'with arrayLimit 0 + array brackets: empty string then null works'
441
- );
442
-
443
- st.deepEqual(
444
- qs.parse('a[]=&a[]=b&a[]=c'),
445
- { a: ['', 'b', 'c'] },
446
- 'array brackets: empty strings work'
447
- );
448
- st.end();
449
- });
450
-
451
- t.test('compacts sparse arrays', function (st) {
452
- st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] });
453
- st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] });
454
- st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] });
455
- st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] });
456
- st.end();
457
- });
458
-
459
- t.test('parses sparse arrays', function (st) {
460
- /* eslint no-sparse-arrays: 0 */
461
- st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] });
462
- st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] });
463
- st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] });
464
- st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] });
465
- st.end();
466
- });
467
-
468
- t.test('parses semi-parsed strings', function (st) {
469
- st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
470
- st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
471
- st.end();
472
- });
473
-
474
- t.test('parses buffers correctly', function (st) {
475
- var b = SaferBuffer.from('test');
476
- st.deepEqual(qs.parse({ a: b }), { a: b });
477
- st.end();
478
- });
479
-
480
- t.test('parses jquery-param strings', function (st) {
481
- // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8'
482
- var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8';
483
- var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] };
484
- st.deepEqual(qs.parse(encoded), expected);
485
- st.end();
486
- });
487
-
488
- t.test('continues parsing when no parent is found', function (st) {
489
- st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' });
490
- st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' });
491
- st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });
492
- st.end();
493
- });
494
-
495
- t.test('does not error when parsing a very long array', function (st) {
496
- var str = 'a[]=a';
497
- while (Buffer.byteLength(str) < 128 * 1024) {
498
- str = str + '&' + str;
499
- }
500
-
501
- st.doesNotThrow(function () {
502
- qs.parse(str);
503
- });
504
-
505
- st.end();
506
- });
507
-
508
- t.test('does not throw when a native prototype has an enumerable property', function (st) {
509
- st.intercept(Object.prototype, 'crash', { value: '' });
510
- st.intercept(Array.prototype, 'crash', { value: '' });
511
-
512
- st.doesNotThrow(qs.parse.bind(null, 'a=b'));
513
- st.deepEqual(qs.parse('a=b'), { a: 'b' });
514
- st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));
515
- st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
516
-
517
- st.end();
518
- });
519
-
520
- t.test('parses a string with an alternative string delimiter', function (st) {
521
- st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });
522
- st.end();
523
- });
524
-
525
- t.test('parses a string with an alternative RegExp delimiter', function (st) {
526
- st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });
527
- st.end();
528
- });
529
-
530
- t.test('does not use non-splittable objects as delimiters', function (st) {
531
- st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });
532
- st.end();
533
- });
534
-
535
- t.test('allows overriding parameter limit', function (st) {
536
- st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });
537
- st.end();
538
- });
539
-
540
- t.test('allows setting the parameter limit to Infinity', function (st) {
541
- st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });
542
- st.end();
543
- });
544
-
545
- t.test('allows overriding array limit', function (st) {
546
- st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } });
547
- st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: { 0: 'b' } });
548
-
549
- st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });
550
- st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } });
551
-
552
- st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } });
553
- st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });
554
-
555
- st.end();
556
- });
557
-
558
- t.test('allows disabling array parsing', function (st) {
559
- var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false });
560
- st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } });
561
- st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array');
562
-
563
- var emptyBrackets = qs.parse('a[]=b', { parseArrays: false });
564
- st.deepEqual(emptyBrackets, { a: { 0: 'b' } });
565
- st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array');
566
-
567
- st.end();
568
- });
569
-
570
- t.test('allows for query string prefix', function (st) {
571
- st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
572
- st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
573
- st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });
574
-
575
- st.end();
576
- });
577
-
578
- t.test('parses an object', function (st) {
579
- var input = {
580
- 'user[name]': { 'pop[bob]': 3 },
581
- 'user[email]': null
582
- };
583
-
584
- var expected = {
585
- user: {
586
- name: { 'pop[bob]': 3 },
587
- email: null
588
- }
589
- };
590
-
591
- var result = qs.parse(input);
592
-
593
- st.deepEqual(result, expected);
594
- st.end();
595
- });
596
-
597
- t.test('parses string with comma as array divider', function (st) {
598
- st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] });
599
- st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } });
600
- st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' });
601
- st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' });
602
- st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null });
603
-
604
- // test cases inversed from from stringify tests
605
- st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] });
606
- st.deepEqual(qs.parse('a[]=c'), { a: ['c'] });
607
- st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] });
608
-
609
- st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] });
610
- st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] });
611
- st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] });
612
-
613
- st.end();
614
- });
615
-
616
- t.test('parses values with comma as array divider', function (st) {
617
- st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' });
618
- st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] });
619
- st.end();
620
- });
621
-
622
- t.test('use number decoder, parses string that has one number with comma option enabled', function (st) {
623
- var decoder = function (str, defaultDecoder, charset, type) {
624
- if (!isNaN(Number(str))) {
625
- return parseFloat(str);
626
- }
627
- return defaultDecoder(str, defaultDecoder, charset, type);
628
- };
629
-
630
- st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 });
631
- st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 });
632
-
633
- st.end();
634
- });
635
-
636
- t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) {
637
- st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] });
638
- st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] });
639
- st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] });
640
- st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] });
641
-
642
- st.end();
643
- });
644
-
645
- t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) {
646
- st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] });
647
- st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] });
648
- st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] });
649
- st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] });
650
-
651
- st.end();
652
- });
653
-
654
- t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) {
655
- st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' });
656
- st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] });
657
- st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] });
658
-
659
- st.end();
660
- });
661
-
662
- t.test('parses an object in dot notation', function (st) {
663
- var input = {
664
- 'user.name': { 'pop[bob]': 3 },
665
- 'user.email.': null
666
- };
667
-
668
- var expected = {
669
- user: {
670
- name: { 'pop[bob]': 3 },
671
- email: null
672
- }
673
- };
674
-
675
- var result = qs.parse(input, { allowDots: true });
676
-
677
- st.deepEqual(result, expected);
678
- st.end();
679
- });
680
-
681
- t.test('parses an object and not child values', function (st) {
682
- var input = {
683
- 'user[name]': { 'pop[bob]': { test: 3 } },
684
- 'user[email]': null
685
- };
686
-
687
- var expected = {
688
- user: {
689
- name: { 'pop[bob]': { test: 3 } },
690
- email: null
691
- }
692
- };
693
-
694
- var result = qs.parse(input);
695
-
696
- st.deepEqual(result, expected);
697
- st.end();
698
- });
699
-
700
- t.test('does not blow up when Buffer global is missing', function (st) {
701
- var restore = mockProperty(global, 'Buffer', { 'delete': true });
702
-
703
- var result = qs.parse('a=b&c=d');
704
-
705
- restore();
706
-
707
- st.deepEqual(result, { a: 'b', c: 'd' });
708
- st.end();
709
- });
710
-
711
- t.test('does not crash when parsing circular references', function (st) {
712
- var a = {};
713
- a.b = a;
714
-
715
- var parsed;
716
-
717
- st.doesNotThrow(function () {
718
- parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
719
- });
720
-
721
- st.equal('foo' in parsed, true, 'parsed has "foo" property');
722
- st.equal('bar' in parsed.foo, true);
723
- st.equal('baz' in parsed.foo, true);
724
- st.equal(parsed.foo.bar, 'baz');
725
- st.deepEqual(parsed.foo.baz, a);
726
- st.end();
727
- });
728
-
729
- t.test('does not crash when parsing deep objects', function (st) {
730
- var parsed;
731
- var str = 'foo';
732
-
733
- for (var i = 0; i < 5000; i++) {
734
- str += '[p]';
735
- }
736
-
737
- str += '=bar';
738
-
739
- st.doesNotThrow(function () {
740
- parsed = qs.parse(str, { depth: 5000 });
741
- });
742
-
743
- st.equal('foo' in parsed, true, 'parsed has "foo" property');
744
-
745
- var depth = 0;
746
- var ref = parsed.foo;
747
- while ((ref = ref.p)) {
748
- depth += 1;
749
- }
750
-
751
- st.equal(depth, 5000, 'parsed is 5000 properties deep');
752
-
753
- st.end();
754
- });
755
-
756
- t.test('parses null objects correctly', { skip: !hasProto }, function (st) {
757
- var a = { __proto__: null, b: 'c' };
758
-
759
- st.deepEqual(qs.parse(a), { b: 'c' });
760
- var result = qs.parse({ a: a });
761
- st.equal('a' in result, true, 'result has "a" property');
762
- st.deepEqual(result.a, a);
763
- st.end();
764
- });
765
-
766
- t.test('parses dates correctly', function (st) {
767
- var now = new Date();
768
- st.deepEqual(qs.parse({ a: now }), { a: now });
769
- st.end();
770
- });
771
-
772
- t.test('parses regular expressions correctly', function (st) {
773
- var re = /^test$/;
774
- st.deepEqual(qs.parse({ a: re }), { a: re });
775
- st.end();
776
- });
777
-
778
- t.test('does not allow overwriting prototype properties', function (st) {
779
- st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {});
780
- st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {});
781
-
782
- st.deepEqual(
783
- qs.parse('toString', { allowPrototypes: false }),
784
- {},
785
- 'bare "toString" results in {}'
786
- );
787
-
788
- st.end();
789
- });
790
-
791
- t.test('can allow overwriting prototype properties', function (st) {
792
- st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } });
793
- st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' });
794
-
795
- st.deepEqual(
796
- qs.parse('toString', { allowPrototypes: true }),
797
- { toString: '' },
798
- 'bare "toString" results in { toString: "" }'
799
- );
800
-
801
- st.end();
802
- });
803
-
804
- t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) {
805
- // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it
806
- // can't be unfrozen. Instead, we add a new non-writable property to simulate this.
807
- st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true }));
808
-
809
- st['throws'](
810
- function () {
811
- var obj = {};
812
- obj.frozenProp = 'bar';
813
- },
814
- // node < 6 has a different error message
815
- /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#<Object>'|#<Object>)/,
816
- 'regular assignment of an inherited non-writable property throws'
817
- );
818
-
819
- var parsed;
820
- st.doesNotThrow(
821
- function () {
822
- parsed = qs.parse('frozenProp', { allowPrototypes: false });
823
- },
824
- 'parsing a nonwritable Object.prototype property does not throw'
825
- );
826
-
827
- st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}');
828
-
829
- st.end();
830
- });
831
-
832
- t.test('params starting with a closing bracket', function (st) {
833
- st.deepEqual(qs.parse(']=toString'), { ']': 'toString' });
834
- st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' });
835
- st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' });
836
- st.end();
837
- });
838
-
839
- t.test('params starting with a starting bracket', function (st) {
840
- st.deepEqual(qs.parse('[=toString'), { '[': 'toString' });
841
- st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' });
842
- st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' });
843
- st.end();
844
- });
845
-
846
- t.test('add keys to objects', function (st) {
847
- st.deepEqual(
848
- qs.parse('a[b]=c&a=d', { strictMerge: false }),
849
- { a: { b: 'c', d: true } },
850
- 'can add keys to objects'
851
- );
852
-
853
- st.deepEqual(
854
- qs.parse('a[b]=c&a=toString', { strictMerge: false }),
855
- { a: { b: 'c' } },
856
- 'can not overwrite prototype'
857
- );
858
-
859
- st.deepEqual(
860
- qs.parse('a[b]=c&a=toString', { strictMerge: false, allowPrototypes: true }),
861
- { a: { b: 'c', toString: true } },
862
- 'can overwrite prototype with allowPrototypes true'
863
- );
864
-
865
- st.deepEqual(
866
- qs.parse('a[b]=c&a=toString', { strictMerge: false, plainObjects: true }),
867
- { __proto__: null, a: { __proto__: null, b: 'c', toString: true } },
868
- 'can overwrite prototype with plainObjects true'
869
- );
870
-
871
- st.end();
872
- });
873
-
874
- t.test('strictMerge wraps object and primitive into an array', function (st) {
875
- st.deepEqual(
876
- qs.parse('a[b]=c&a=d'),
877
- { a: [{ b: 'c' }, 'd'] },
878
- 'object then primitive produces array'
879
- );
880
-
881
- st.deepEqual(
882
- qs.parse('a=d&a[b]=c'),
883
- { a: ['d', { b: 'c' }] },
884
- 'primitive then object produces array'
885
- );
886
-
887
- st.deepEqual(
888
- qs.parse('a[b]=c&a=toString'),
889
- { a: [{ b: 'c' }, 'toString'] },
890
- 'prototype-colliding value is preserved in array'
891
- );
892
-
893
- st.deepEqual(
894
- qs.parse('a[b]=c&a=toString', { plainObjects: true }),
895
- { __proto__: null, a: [{ __proto__: null, b: 'c' }, 'toString'] },
896
- 'plainObjects preserved in array wrapping'
897
- );
898
-
899
- st.end();
900
- });
901
-
902
- t.test('dunder proto is ignored', function (st) {
903
- var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
904
- var result = qs.parse(payload, { allowPrototypes: true });
905
-
906
- st.deepEqual(
907
- result,
908
- {
909
- categories: {
910
- length: '42'
911
- }
912
- },
913
- 'silent [[Prototype]] payload'
914
- );
915
-
916
- var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true });
917
-
918
- st.deepEqual(
919
- plainResult,
920
- {
921
- __proto__: null,
922
- categories: {
923
- __proto__: null,
924
- length: '42'
925
- }
926
- },
927
- 'silent [[Prototype]] payload: plain objects'
928
- );
929
-
930
- var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true });
931
-
932
- st.notOk(Array.isArray(query.categories), 'is not an array');
933
- st.notOk(query.categories instanceof Array, 'is not instanceof an array');
934
- st.deepEqual(query.categories, { some: { json: 'toInject' } });
935
- st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array');
936
-
937
- st.deepEqual(
938
- qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }),
939
- {
940
- foo: {
941
- bar: 'stuffs'
942
- }
943
- },
944
- 'hidden values'
945
- );
946
-
947
- st.deepEqual(
948
- qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }),
949
- {
950
- __proto__: null,
951
- foo: {
952
- __proto__: null,
953
- bar: 'stuffs'
954
- }
955
- },
956
- 'hidden values: plain objects'
957
- );
958
-
959
- st.end();
960
- });
961
-
962
- t.test('can return null objects', { skip: !hasProto }, function (st) {
963
- var expected = {
964
- __proto__: null,
965
- a: {
966
- __proto__: null,
967
- b: 'c',
968
- hasOwnProperty: 'd'
969
- }
970
- };
971
- st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);
972
- st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null });
973
- var expectedArray = {
974
- __proto__: null,
975
- a: {
976
- __proto__: null,
977
- 0: 'b',
978
- c: 'd'
979
- }
980
- };
981
- st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);
982
- st.end();
983
- });
984
-
985
- t.test('can parse with custom encoding', function (st) {
986
- st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', {
987
- decoder: function (str) {
988
- var reg = /%([0-9A-F]{2})/ig;
989
- var result = [];
990
- var parts = reg.exec(str);
991
- while (parts) {
992
- result.push(parseInt(parts[1], 16));
993
- parts = reg.exec(str);
994
- }
995
- return String(iconv.decode(SaferBuffer.from(result), 'shift_jis'));
996
- }
997
- }), { 県: '大阪府' });
998
- st.end();
999
- });
1000
-
1001
- t.test('receives the default decoder as a second argument', function (st) {
1002
- st.plan(1);
1003
- qs.parse('a', {
1004
- decoder: function (str, defaultDecoder) {
1005
- st.equal(defaultDecoder, utils.decode);
1006
- }
1007
- });
1008
- st.end();
1009
- });
1010
-
1011
- t.test('throws error with wrong decoder', function (st) {
1012
- st['throws'](function () {
1013
- qs.parse({}, { decoder: 'string' });
1014
- }, new TypeError('Decoder has to be a function.'));
1015
- st.end();
1016
- });
1017
-
1018
- t.test('does not mutate the options argument', function (st) {
1019
- var options = {};
1020
- qs.parse('a[b]=true', options);
1021
- st.deepEqual(options, {});
1022
- st.end();
1023
- });
1024
-
1025
- t.test('throws if an invalid charset is specified', function (st) {
1026
- st['throws'](function () {
1027
- qs.parse('a=b', { charset: 'foobar' });
1028
- }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));
1029
- st.end();
1030
- });
1031
-
1032
- t.test('parses an iso-8859-1 string if asked to', function (st) {
1033
- st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' });
1034
- st.end();
1035
- });
1036
-
1037
- var urlEncodedCheckmarkInUtf8 = '%E2%9C%93';
1038
- var urlEncodedOSlashInUtf8 = '%C3%B8';
1039
- var urlEncodedNumCheckmark = '%26%2310003%3B';
1040
- var urlEncodedNumSmiley = '%26%239786%3B';
1041
-
1042
- t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) {
1043
- st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' });
1044
- st.end();
1045
- });
1046
-
1047
- t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) {
1048
- st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' });
1049
- st.end();
1050
- });
1051
-
1052
- t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) {
1053
- st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' });
1054
- st.end();
1055
- });
1056
-
1057
- t.test('ignores an utf8 sentinel with an unknown value', function (st) {
1058
- st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' });
1059
- st.end();
1060
- });
1061
-
1062
- t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) {
1063
- st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' });
1064
- st.end();
1065
- });
1066
-
1067
- t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) {
1068
- st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' });
1069
- st.end();
1070
- });
1071
-
1072
- t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) {
1073
- st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' });
1074
- st.end();
1075
- });
1076
-
1077
- t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) {
1078
- st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, {
1079
- charset: 'iso-8859-1',
1080
- decoder: function (str, defaultDecoder, charset) {
1081
- return str ? defaultDecoder(str, defaultDecoder, charset) : null;
1082
- },
1083
- interpretNumericEntities: true
1084
- }), { foo: null, bar: '☺' });
1085
- st.end();
1086
- });
1087
-
1088
- t.test('handles a custom decoder returning `null`, with a string key of `null`', function (st) {
1089
- st.deepEqual(
1090
- qs.parse('null=1&ToNull=2', {
1091
- decoder: function (str, defaultDecoder, charset) {
1092
- return str === 'ToNull' ? null : defaultDecoder(str, defaultDecoder, charset);
1093
- }
1094
- }),
1095
- { 'null': '1' },
1096
- '"null" key is not overridden by `null` decoder result'
1097
- );
1098
-
1099
- st.end();
1100
- });
1101
-
1102
- t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) {
1103
- st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '&#9786;' });
1104
- st.end();
1105
- });
1106
-
1107
- t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) {
1108
- st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '&#9786;' });
1109
- st.end();
1110
- });
1111
-
1112
- t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) {
1113
- st.deepEqual(
1114
- qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }),
1115
- { b: '', a: ['1,☺'] }
1116
- );
1117
-
1118
- st.end();
1119
- });
1120
-
1121
- t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) {
1122
- st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' });
1123
- st.end();
1124
- });
1125
-
1126
- t.test('allows for decoding keys and values differently', function (st) {
1127
- var decoder = function (str, defaultDecoder, charset, type) {
1128
- if (type === 'key') {
1129
- return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase();
1130
- }
1131
- if (type === 'value') {
1132
- return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase();
1133
- }
1134
- throw 'this should never happen! type: ' + type;
1135
- };
1136
-
1137
- st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' });
1138
-
1139
- var noopDecoder = function () { return 'x'; };
1140
- noopDecoder();
1141
- st['throws'](
1142
- function () { decoder('x', noopDecoder, 'utf-8', 'unknown'); },
1143
- 'this should never happen! type: unknown',
1144
- 'decoder throws for unexpected type'
1145
- );
1146
-
1147
- st.end();
1148
- });
1149
-
1150
- t.test('parameter limit tests', function (st) {
1151
- st.test('does not throw error when within parameter limit', function (sst) {
1152
- var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true });
1153
- sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors');
1154
- sst.end();
1155
- });
1156
-
1157
- st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) {
1158
- sst['throws'](
1159
- function () {
1160
- qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' });
1161
- },
1162
- new TypeError('`throwOnLimitExceeded` option must be a boolean'),
1163
- 'throws error when throwOnLimitExceeded is present and not boolean'
1164
- );
1165
- sst.end();
1166
- });
1167
-
1168
- st.test('throws error when parameter limit exceeded', function (sst) {
1169
- sst['throws'](
1170
- function () {
1171
- qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true });
1172
- },
1173
- new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'),
1174
- 'throws error when parameter limit is exceeded'
1175
- );
1176
-
1177
- sst['throws'](
1178
- function () {
1179
- qs.parse('a=1&b=2', { parameterLimit: 1, throwOnLimitExceeded: true });
1180
- },
1181
- new RangeError('Parameter limit exceeded. Only 1 parameter allowed.'),
1182
- 'throws error with singular "parameter" when parameterLimit is 1'
1183
- );
1184
- sst.end();
1185
- });
1186
-
1187
- st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) {
1188
- var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 });
1189
- sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently');
1190
- sst.end();
1191
- });
1192
-
1193
- st.test('silently truncates when parameter limit exceeded without error', function (sst) {
1194
- var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false });
1195
- sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently');
1196
- sst.end();
1197
- });
1198
-
1199
- st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) {
1200
- var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity });
1201
- sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation');
1202
- sst.end();
1203
- });
1204
-
1205
- st.test('allows unlimited parameters when parameterLimit is Infinity and throwOnLimitExceeded is true', function (sst) {
1206
- var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity, throwOnLimitExceeded: true });
1207
- sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation or throwing');
1208
- sst.end();
1209
- });
1210
-
1211
- st.end();
1212
- });
1213
-
1214
- t.test('array limit tests', function (st) {
1215
- st.test('does not throw error when array is within limit', function (sst) {
1216
- var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true });
1217
- sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors');
1218
- sst.end();
1219
- });
1220
-
1221
- st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) {
1222
- sst['throws'](
1223
- function () {
1224
- qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' });
1225
- },
1226
- new TypeError('`throwOnLimitExceeded` option must be a boolean'),
1227
- 'throws error when throwOnLimitExceeded is present and not boolean for array limit'
1228
- );
1229
- sst.end();
1230
- });
1231
-
1232
- st.test('throws error when array limit exceeded', function (sst) {
1233
- // 4 elements exceeds limit of 3
1234
- sst['throws'](
1235
- function () {
1236
- qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true });
1237
- },
1238
- new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'),
1239
- 'throws error when array limit is exceeded'
1240
- );
1241
- sst.end();
1242
- });
1243
-
1244
- st.test('does not throw when at limit', function (sst) {
1245
- // 3 elements = limit of 3, should not throw
1246
- var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3, throwOnLimitExceeded: true });
1247
- sst.ok(Array.isArray(result.a), 'result is an array');
1248
- sst.deepEqual(result.a, ['1', '2', '3'], 'all values present');
1249
- sst.end();
1250
- });
1251
-
1252
- st.test('converts array to object if length is greater than limit', function (sst) {
1253
- var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 });
1254
-
1255
- sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit');
1256
- sst.end();
1257
- });
1258
-
1259
- st.test('throws error when indexed notation exceeds arrayLimit with throwOnLimitExceeded', function (sst) {
1260
- sst['throws'](
1261
- function () {
1262
- qs.parse('a[1001]=b', { arrayLimit: 1000, throwOnLimitExceeded: true });
1263
- },
1264
- new RangeError('Array limit exceeded. Only 1000 elements allowed in an array.'),
1265
- 'throws error for a single index exceeding arrayLimit'
1266
- );
1267
-
1268
- sst['throws'](
1269
- function () {
1270
- qs.parse('a[0]=1&a[1]=2&a[2]=3&a[10]=4', { arrayLimit: 6, throwOnLimitExceeded: true, allowSparse: true });
1271
- },
1272
- new RangeError('Array limit exceeded. Only 6 elements allowed in an array.'),
1273
- 'throws error when a sparse index exceeds arrayLimit'
1274
- );
1275
-
1276
- sst['throws'](
1277
- function () {
1278
- qs.parse('a[2]=b', { arrayLimit: 1, throwOnLimitExceeded: true });
1279
- },
1280
- new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
1281
- 'throws error with singular "element" when arrayLimit is 1'
1282
- );
1283
-
1284
- sst.end();
1285
- });
1286
-
1287
- st.test('does not throw for indexed notation within arrayLimit with throwOnLimitExceeded', function (sst) {
1288
- var result = qs.parse('a[4]=b', { arrayLimit: 5, throwOnLimitExceeded: true, allowSparse: true });
1289
- sst.ok(Array.isArray(result.a), 'result is an array');
1290
- sst.equal(result.a.length, 5, 'array has correct length');
1291
- sst.equal(result.a[4], 'b', 'value at index 4 is correct');
1292
- sst.end();
1293
- });
1294
-
1295
- st.test('silently converts to object for indexed notation exceeding arrayLimit without throwOnLimitExceeded', function (sst) {
1296
- var result = qs.parse('a[1001]=b', { arrayLimit: 1000 });
1297
- sst.deepEqual(result, { a: { 1001: 'b' } }, 'converts to object without throwing');
1298
- sst.end();
1299
- });
1300
-
1301
- st.test('throws when duplicate bracket keys exceed arrayLimit with throwOnLimitExceeded', function (sst) {
1302
- sst['throws'](
1303
- function () {
1304
- qs.parse('a[]=1&a[]=2&a[]=3&a[]=4&a[]=5&a[]=6', { arrayLimit: 5, throwOnLimitExceeded: true });
1305
- },
1306
- new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
1307
- 'throws error when duplicate bracket notation exceeds array limit'
1308
- );
1309
- sst.end();
1310
- });
1311
-
1312
- st.end();
1313
- });
1314
-
1315
- t.end();
1316
- });
1317
-
1318
- test('parses empty keys', function (t) {
1319
- emptyTestCases.forEach(function (testCase) {
1320
- t.test('skips empty string key with ' + testCase.input, function (st) {
1321
- st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys);
1322
-
1323
- st.end();
1324
- });
1325
- });
1326
- });
1327
-
1328
- test('`duplicates` option', function (t) {
1329
- v.nonStrings.concat('not a valid option').forEach(function (invalidOption) {
1330
- if (typeof invalidOption !== 'undefined') {
1331
- t['throws'](
1332
- function () { qs.parse('', { duplicates: invalidOption }); },
1333
- TypeError,
1334
- 'throws on invalid option: ' + inspect(invalidOption)
1335
- );
1336
- }
1337
- });
1338
-
1339
- t.deepEqual(
1340
- qs.parse('foo=bar&foo=baz'),
1341
- { foo: ['bar', 'baz'] },
1342
- 'duplicates: default, combine'
1343
- );
1344
-
1345
- t.deepEqual(
1346
- qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }),
1347
- { foo: ['bar', 'baz'] },
1348
- 'duplicates: combine'
1349
- );
1350
-
1351
- t.deepEqual(
1352
- qs.parse('foo=bar&foo=baz', { duplicates: 'first' }),
1353
- { foo: 'bar' },
1354
- 'duplicates: first'
1355
- );
1356
-
1357
- t.deepEqual(
1358
- qs.parse('foo=bar&foo=baz', { duplicates: 'last' }),
1359
- { foo: 'baz' },
1360
- 'duplicates: last'
1361
- );
1362
-
1363
- t.test('bracket notation always combines regardless of duplicates', function (st) {
1364
- st.deepEqual(
1365
- qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }),
1366
- { a: '2', b: ['1', '2'] },
1367
- 'duplicates last: unbracketed takes last, bracketed combines'
1368
- );
1369
-
1370
- st.deepEqual(
1371
- qs.parse('b[]=1&b[]=2', { duplicates: 'last' }),
1372
- { b: ['1', '2'] },
1373
- 'duplicates last: bracketed always combines'
1374
- );
1375
-
1376
- st.deepEqual(
1377
- qs.parse('b[]=1&b[]=2', { duplicates: 'first' }),
1378
- { b: ['1', '2'] },
1379
- 'duplicates first: bracketed always combines'
1380
- );
1381
-
1382
- st.deepEqual(
1383
- qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'first' }),
1384
- { a: '1', b: ['1', '2'] },
1385
- 'duplicates first: unbracketed takes first, bracketed combines'
1386
- );
1387
-
1388
- st.end();
1389
- });
1390
-
1391
- t.end();
1392
- });
1393
-
1394
- test('qs strictDepth option - throw cases', function (t) {
1395
- t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) {
1396
- st['throws'](
1397
- function () {
1398
- qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true });
1399
- },
1400
- RangeError,
1401
- 'throws RangeError'
1402
- );
1403
- st.end();
1404
- });
1405
-
1406
- t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) {
1407
- st['throws'](
1408
- function () {
1409
- qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true });
1410
- },
1411
- RangeError,
1412
- 'throws RangeError'
1413
- );
1414
- st.end();
1415
- });
1416
-
1417
- t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) {
1418
- st['throws'](
1419
- function () {
1420
- qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true });
1421
- },
1422
- RangeError,
1423
- 'throws RangeError'
1424
- );
1425
- st.end();
1426
- });
1427
-
1428
- t.test('throws an exception for different types of values with strictDepth: true', function (st) {
1429
- st['throws'](
1430
- function () {
1431
- qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true });
1432
- },
1433
- RangeError,
1434
- 'throws RangeError'
1435
- );
1436
- st.end();
1437
- });
1438
-
1439
- });
1440
-
1441
- test('qs strictDepth option - non-throw cases', function (t) {
1442
- t.test('when depth is 0 and strictDepth true, do not throw', function (st) {
1443
- st.doesNotThrow(
1444
- function () {
1445
- qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true });
1446
- },
1447
- RangeError,
1448
- 'does not throw RangeError'
1449
- );
1450
- st.end();
1451
- });
1452
-
1453
- t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) {
1454
- st.doesNotThrow(
1455
- function () {
1456
- var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true });
1457
- st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly');
1458
- }
1459
- );
1460
- st.end();
1461
- });
1462
-
1463
- t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) {
1464
- st.doesNotThrow(
1465
- function () {
1466
- var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
1467
- st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit');
1468
- }
1469
- );
1470
- st.end();
1471
- });
1472
-
1473
- t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) {
1474
- st.doesNotThrow(
1475
- function () {
1476
- var result = qs.parse('a[b]=c', { depth: 1 });
1477
- st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly');
1478
- }
1479
- );
1480
- st.end();
1481
- });
1482
-
1483
- t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) {
1484
- st.doesNotThrow(
1485
- function () {
1486
- var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true });
1487
- st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly');
1488
- }
1489
- );
1490
- st.end();
1491
- });
1492
- });
1493
-
1494
- test('DOS', function (t) {
1495
- var arr = [];
1496
- for (var i = 0; i < 105; i++) {
1497
- arr[arr.length] = 'x';
1498
- }
1499
- var attack = 'a[]=' + arr.join('&a[]=');
1500
- var result = qs.parse(attack, { arrayLimit: 100 });
1501
-
1502
- t.notOk(Array.isArray(result.a), 'arrayLimit is respected: result is an object, not an array');
1503
- t.equal(Object.keys(result.a).length, 105, 'all values are preserved');
1504
-
1505
- t.end();
1506
- });
1507
-
1508
- test('arrayLimit boundary conditions', function (t) {
1509
- // arrayLimit is the max number of elements allowed in an array
1510
- t.test('exactly at the limit stays as array', function (st) {
1511
- // 3 elements = limit of 3
1512
- var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3 });
1513
- st.ok(Array.isArray(result.a), 'result is an array when count equals limit');
1514
- st.deepEqual(result.a, ['1', '2', '3'], 'all values present');
1515
- st.end();
1516
- });
1517
-
1518
- t.test('one over the limit converts to object', function (st) {
1519
- // 4 elements exceeds limit of 3
1520
- var result = qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3 });
1521
- st.notOk(Array.isArray(result.a), 'result is not an array when over limit');
1522
- st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object');
1523
- st.end();
1524
- });
1525
-
1526
- t.test('arrayLimit 1 with one value', function (st) {
1527
- // 1 element = limit of 1
1528
- var result = qs.parse('a[]=1', { arrayLimit: 1 });
1529
- st.ok(Array.isArray(result.a), 'result is an array when count equals limit');
1530
- st.deepEqual(result.a, ['1'], 'value preserved as array');
1531
- st.end();
1532
- });
1533
-
1534
- t.test('arrayLimit 1 with two values converts to object', function (st) {
1535
- // 2 elements exceeds limit of 1
1536
- var result = qs.parse('a[]=1&a[]=2', { arrayLimit: 1 });
1537
- st.notOk(Array.isArray(result.a), 'result is not an array');
1538
- st.deepEqual(result.a, { 0: '1', 1: '2' }, 'all values preserved as object');
1539
- st.end();
1540
- });
1541
-
1542
- t.end();
1543
- });
1544
-
1545
- test('comma + arrayLimit', function (t) {
1546
- t.test('comma-separated values within arrayLimit stay as array', function (st) {
1547
- var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 5 });
1548
- st.ok(Array.isArray(result.a), 'result is an array');
1549
- st.deepEqual(result.a, ['1', '2', '3'], 'all values present');
1550
- st.end();
1551
- });
1552
-
1553
- t.test('comma-separated values exceeding arrayLimit convert to object', function (st) {
1554
- var result = qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3 });
1555
- st.notOk(Array.isArray(result.a), 'result is not an array when over limit');
1556
- st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object');
1557
- st.end();
1558
- });
1559
-
1560
- t.test('comma-separated values exceeding arrayLimit with throwOnLimitExceeded throws', function (st) {
1561
- st['throws'](
1562
- function () {
1563
- qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true });
1564
- },
1565
- new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'),
1566
- 'throws error when comma-split exceeds array limit'
1567
- );
1568
-
1569
- st['throws'](
1570
- function () {
1571
- qs.parse('a=1,2,3', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true });
1572
- },
1573
- new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
1574
- 'throws error with singular "element" when arrayLimit is 1'
1575
- );
1576
- st.end();
1577
- });
1578
-
1579
- t.test('comma-separated values at exactly arrayLimit stay as array', function (st) {
1580
- var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 3 });
1581
- st.ok(Array.isArray(result.a), 'result is an array when exactly at limit');
1582
- st.deepEqual(result.a, ['1', '2', '3'], 'all values present');
1583
- st.end();
1584
- });
1585
-
1586
- t.end();
1587
- });
1588
-
1589
- test('mixed array and object notation', function (t) {
1590
- t.test('array brackets with object key - under limit', function (st) {
1591
- st.deepEqual(
1592
- qs.parse('a[]=b&a[c]=d'),
1593
- { a: { 0: 'b', c: 'd' } },
1594
- 'mixing [] and [key] converts to object'
1595
- );
1596
- st.end();
1597
- });
1598
-
1599
- t.test('array index with object key - under limit', function (st) {
1600
- st.deepEqual(
1601
- qs.parse('a[0]=b&a[c]=d'),
1602
- { a: { 0: 'b', c: 'd' } },
1603
- 'mixing [0] and [key] produces object'
1604
- );
1605
- st.end();
1606
- });
1607
-
1608
- t.test('plain value with array brackets - under limit', function (st) {
1609
- st.deepEqual(
1610
- qs.parse('a=b&a[]=c', { arrayLimit: 20 }),
1611
- { a: ['b', 'c'] },
1612
- 'plain value combined with [] stays as array under limit'
1613
- );
1614
- st.end();
1615
- });
1616
-
1617
- t.test('array brackets with plain value - under limit', function (st) {
1618
- st.deepEqual(
1619
- qs.parse('a[]=b&a=c', { arrayLimit: 20 }),
1620
- { a: ['b', 'c'] },
1621
- '[] combined with plain value stays as array under limit'
1622
- );
1623
- st.end();
1624
- });
1625
-
1626
- t.test('plain value with array index - under limit', function (st) {
1627
- st.deepEqual(
1628
- qs.parse('a=b&a[0]=c', { arrayLimit: 20 }),
1629
- { a: ['b', 'c'] },
1630
- 'plain value combined with [0] stays as array under limit'
1631
- );
1632
- st.end();
1633
- });
1634
-
1635
- t.test('multiple plain values with duplicates combine', function (st) {
1636
- st.deepEqual(
1637
- qs.parse('a=b&a=c&a=d', { arrayLimit: 20 }),
1638
- { a: ['b', 'c', 'd'] },
1639
- 'duplicate plain keys combine into array'
1640
- );
1641
- st.end();
1642
- });
1643
-
1644
- t.test('multiple plain values exceeding limit', function (st) {
1645
- // 3 elements (indices 0-2), max index 2 > limit 1
1646
- st.deepEqual(
1647
- qs.parse('a=b&a=c&a=d', { arrayLimit: 1 }),
1648
- { a: { 0: 'b', 1: 'c', 2: 'd' } },
1649
- 'duplicate plain keys convert to object when exceeding limit'
1650
- );
1651
- st.end();
1652
- });
1653
-
1654
- t.test('mixed notation produces consistent results when arrayLimit is exceeded', function (st) {
1655
- var expected = { a: { 0: 'b', 1: 'c', 2: 'd' } };
1656
-
1657
- st.deepEqual(
1658
- qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: -1 }),
1659
- expected,
1660
- 'arrayLimit -1'
1661
- );
1662
-
1663
- st.deepEqual(
1664
- qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 0 }),
1665
- expected,
1666
- 'arrayLimit 0'
1667
- );
1668
-
1669
- st.deepEqual(
1670
- qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 1 }),
1671
- expected,
1672
- 'arrayLimit 1'
1673
- );
1674
-
1675
- st.end();
1676
- });
1677
-
1678
- t.test('uses existing array length for currentArrayLength when parsing object input with bracket keys', function (st) {
1679
- var input = {};
1680
- var arr = ['x', 'y'];
1681
- arr.a = ['z', 'w'];
1682
- input['a[]'] = arr;
1683
- st.deepEqual(qs.parse(input), { a: ['x', 'y'] }, 'parses object input with bracket keys using existing array values');
1684
- st.end();
1685
- });
1686
-
1687
- t.test('throws with singular message when object input bracket key exceeds arrayLimit of 1', function (st) {
1688
- var input = {};
1689
- var arr = ['x'];
1690
- arr.a = ['z', 'w'];
1691
- input['a[]'] = arr;
1692
- st['throws'](
1693
- function () {
1694
- qs.parse(input, { throwOnLimitExceeded: true, arrayLimit: 1 });
1695
- },
1696
- new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
1697
- 'throws singular error for object input exceeding arrayLimit 1'
1698
- );
1699
- st.end();
1700
- });
1701
-
1702
- t.end();
1703
- });