@fntio/infra-client 0.0.0-stage → 0.5.0

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 (940) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/LICENSE +93 -0
  3. package/README.md +875 -2
  4. package/assets/acl-reconciler/index.js +1604 -0
  5. package/assets/api/index.js +9857 -0
  6. package/assets/api/package.json +9 -0
  7. package/assets/api/vendor_modules/.package-lock.json +857 -0
  8. package/assets/api/vendor_modules/accepts/HISTORY.md +243 -0
  9. package/assets/api/vendor_modules/accepts/LICENSE +23 -0
  10. package/assets/api/vendor_modules/accepts/README.md +140 -0
  11. package/assets/api/vendor_modules/accepts/index.js +238 -0
  12. package/assets/api/vendor_modules/accepts/package.json +47 -0
  13. package/assets/api/vendor_modules/array-flatten/LICENSE +21 -0
  14. package/assets/api/vendor_modules/array-flatten/README.md +43 -0
  15. package/assets/api/vendor_modules/array-flatten/array-flatten.js +64 -0
  16. package/assets/api/vendor_modules/array-flatten/package.json +39 -0
  17. package/assets/api/vendor_modules/aws-jwt-verify/LICENSE +175 -0
  18. package/assets/api/vendor_modules/aws-jwt-verify/README.md +1033 -0
  19. package/assets/api/vendor_modules/aws-jwt-verify/asn1.d.ts +20 -0
  20. package/assets/api/vendor_modules/aws-jwt-verify/assert.d.ts +41 -0
  21. package/assets/api/vendor_modules/aws-jwt-verify/cognito-verifier.d.ts +183 -0
  22. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/asn1.js +301 -0
  23. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/assert.js +108 -0
  24. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/cognito-verifier.js +158 -0
  25. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/error.js +131 -0
  26. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-common.js +29 -0
  27. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-node.js +89 -0
  28. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https.js +52 -0
  29. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/index.js +9 -0
  30. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwk.js +221 -0
  31. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-model.js +10 -0
  32. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-rsa.js +397 -0
  33. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt.js +161 -0
  34. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-node.js +48 -0
  35. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-web.js +78 -0
  36. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat.js +11 -0
  37. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/package.json +1 -0
  38. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/safe-json-parse.js +34 -0
  39. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/typing-util.js +6 -0
  40. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/asn1.js +296 -0
  41. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/assert.js +101 -0
  42. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/cognito-verifier.js +153 -0
  43. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/error.js +101 -0
  44. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-common.js +25 -0
  45. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-node.js +85 -0
  46. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https.js +48 -0
  47. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/index.js +4 -0
  48. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwk.js +208 -0
  49. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-model.js +7 -0
  50. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-rsa.js +389 -0
  51. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt.js +156 -0
  52. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-node.js +45 -0
  53. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-web.js +75 -0
  54. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat.js +10 -0
  55. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/package.json +1 -0
  56. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/safe-json-parse.js +29 -0
  57. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/typing-util.js +5 -0
  58. package/assets/api/vendor_modules/aws-jwt-verify/error.d.ts +108 -0
  59. package/assets/api/vendor_modules/aws-jwt-verify/https-common.d.ts +9 -0
  60. package/assets/api/vendor_modules/aws-jwt-verify/https-node.d.ts +20 -0
  61. package/assets/api/vendor_modules/aws-jwt-verify/https.d.ts +35 -0
  62. package/assets/api/vendor_modules/aws-jwt-verify/index.d.ts +2 -0
  63. package/assets/api/vendor_modules/aws-jwt-verify/jwk.d.ts +76 -0
  64. package/assets/api/vendor_modules/aws-jwt-verify/jwt-model.d.ts +78 -0
  65. package/assets/api/vendor_modules/aws-jwt-verify/jwt-rsa.d.ts +348 -0
  66. package/assets/api/vendor_modules/aws-jwt-verify/jwt.d.ts +51 -0
  67. package/assets/api/vendor_modules/aws-jwt-verify/package.json +136 -0
  68. package/assets/api/vendor_modules/aws-jwt-verify/safe-json-parse.d.ts +18 -0
  69. package/assets/api/vendor_modules/aws-jwt-verify/typing-util.d.ts +38 -0
  70. package/assets/api/vendor_modules/body-parser/HISTORY.md +703 -0
  71. package/assets/api/vendor_modules/body-parser/LICENSE +23 -0
  72. package/assets/api/vendor_modules/body-parser/README.md +476 -0
  73. package/assets/api/vendor_modules/body-parser/index.js +156 -0
  74. package/assets/api/vendor_modules/body-parser/lib/read.js +205 -0
  75. package/assets/api/vendor_modules/body-parser/lib/types/json.js +247 -0
  76. package/assets/api/vendor_modules/body-parser/lib/types/raw.js +105 -0
  77. package/assets/api/vendor_modules/body-parser/lib/types/text.js +125 -0
  78. package/assets/api/vendor_modules/body-parser/lib/types/urlencoded.js +303 -0
  79. package/assets/api/vendor_modules/body-parser/node_modules/qs/.editorconfig +46 -0
  80. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/FUNDING.yml +12 -0
  81. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/SECURITY.md +11 -0
  82. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/THREAT_MODEL.md +80 -0
  83. package/assets/api/vendor_modules/body-parser/node_modules/qs/.nycrc +13 -0
  84. package/assets/api/vendor_modules/body-parser/node_modules/qs/CHANGELOG.md +872 -0
  85. package/assets/api/vendor_modules/body-parser/node_modules/qs/LICENSE.md +29 -0
  86. package/assets/api/vendor_modules/body-parser/node_modules/qs/README.md +804 -0
  87. package/assets/api/vendor_modules/body-parser/node_modules/qs/dist/qs.js +141 -0
  88. package/assets/api/vendor_modules/body-parser/node_modules/qs/eslint.config.mjs +57 -0
  89. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/formats.js +23 -0
  90. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/index.js +11 -0
  91. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/parse.js +503 -0
  92. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/stringify.js +378 -0
  93. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/utils.js +512 -0
  94. package/assets/api/vendor_modules/body-parser/node_modules/qs/package.json +95 -0
  95. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +267 -0
  96. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/parse.js +2296 -0
  97. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/stringify.js +1995 -0
  98. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/utils.js +822 -0
  99. package/assets/api/vendor_modules/body-parser/package.json +55 -0
  100. package/assets/api/vendor_modules/bytes/History.md +97 -0
  101. package/assets/api/vendor_modules/bytes/LICENSE +23 -0
  102. package/assets/api/vendor_modules/bytes/Readme.md +152 -0
  103. package/assets/api/vendor_modules/bytes/index.js +170 -0
  104. package/assets/api/vendor_modules/bytes/package.json +42 -0
  105. package/assets/api/vendor_modules/call-bind-apply-helpers/.eslintrc +17 -0
  106. package/assets/api/vendor_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  107. package/assets/api/vendor_modules/call-bind-apply-helpers/.nycrc +9 -0
  108. package/assets/api/vendor_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  109. package/assets/api/vendor_modules/call-bind-apply-helpers/LICENSE +21 -0
  110. package/assets/api/vendor_modules/call-bind-apply-helpers/README.md +62 -0
  111. package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  112. package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.js +10 -0
  113. package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  114. package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.js +10 -0
  115. package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  116. package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.js +4 -0
  117. package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  118. package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.js +4 -0
  119. package/assets/api/vendor_modules/call-bind-apply-helpers/index.d.ts +64 -0
  120. package/assets/api/vendor_modules/call-bind-apply-helpers/index.js +15 -0
  121. package/assets/api/vendor_modules/call-bind-apply-helpers/package.json +85 -0
  122. package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  123. package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  124. package/assets/api/vendor_modules/call-bind-apply-helpers/test/index.js +63 -0
  125. package/assets/api/vendor_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  126. package/assets/api/vendor_modules/call-bound/.eslintrc +13 -0
  127. package/assets/api/vendor_modules/call-bound/.github/FUNDING.yml +12 -0
  128. package/assets/api/vendor_modules/call-bound/.nycrc +9 -0
  129. package/assets/api/vendor_modules/call-bound/CHANGELOG.md +42 -0
  130. package/assets/api/vendor_modules/call-bound/LICENSE +21 -0
  131. package/assets/api/vendor_modules/call-bound/README.md +53 -0
  132. package/assets/api/vendor_modules/call-bound/index.d.ts +94 -0
  133. package/assets/api/vendor_modules/call-bound/index.js +19 -0
  134. package/assets/api/vendor_modules/call-bound/package.json +99 -0
  135. package/assets/api/vendor_modules/call-bound/test/index.js +61 -0
  136. package/assets/api/vendor_modules/call-bound/tsconfig.json +10 -0
  137. package/assets/api/vendor_modules/content-disposition/HISTORY.md +60 -0
  138. package/assets/api/vendor_modules/content-disposition/LICENSE +22 -0
  139. package/assets/api/vendor_modules/content-disposition/README.md +142 -0
  140. package/assets/api/vendor_modules/content-disposition/index.js +458 -0
  141. package/assets/api/vendor_modules/content-disposition/package.json +44 -0
  142. package/assets/api/vendor_modules/content-type/HISTORY.md +29 -0
  143. package/assets/api/vendor_modules/content-type/LICENSE +22 -0
  144. package/assets/api/vendor_modules/content-type/README.md +94 -0
  145. package/assets/api/vendor_modules/content-type/index.js +225 -0
  146. package/assets/api/vendor_modules/content-type/package.json +42 -0
  147. package/assets/api/vendor_modules/cookie/LICENSE +24 -0
  148. package/assets/api/vendor_modules/cookie/README.md +317 -0
  149. package/assets/api/vendor_modules/cookie/SECURITY.md +25 -0
  150. package/assets/api/vendor_modules/cookie/index.js +335 -0
  151. package/assets/api/vendor_modules/cookie/package.json +44 -0
  152. package/assets/api/vendor_modules/cookie-signature/History.md +42 -0
  153. package/assets/api/vendor_modules/cookie-signature/Readme.md +42 -0
  154. package/assets/api/vendor_modules/cookie-signature/index.js +51 -0
  155. package/assets/api/vendor_modules/cookie-signature/package.json +18 -0
  156. package/assets/api/vendor_modules/debug/.coveralls.yml +1 -0
  157. package/assets/api/vendor_modules/debug/.eslintrc +11 -0
  158. package/assets/api/vendor_modules/debug/.travis.yml +14 -0
  159. package/assets/api/vendor_modules/debug/CHANGELOG.md +362 -0
  160. package/assets/api/vendor_modules/debug/LICENSE +19 -0
  161. package/assets/api/vendor_modules/debug/Makefile +50 -0
  162. package/assets/api/vendor_modules/debug/README.md +312 -0
  163. package/assets/api/vendor_modules/debug/component.json +19 -0
  164. package/assets/api/vendor_modules/debug/karma.conf.js +70 -0
  165. package/assets/api/vendor_modules/debug/node.js +1 -0
  166. package/assets/api/vendor_modules/debug/package.json +49 -0
  167. package/assets/api/vendor_modules/debug/src/browser.js +185 -0
  168. package/assets/api/vendor_modules/debug/src/debug.js +202 -0
  169. package/assets/api/vendor_modules/debug/src/index.js +10 -0
  170. package/assets/api/vendor_modules/debug/src/inspector-log.js +15 -0
  171. package/assets/api/vendor_modules/debug/src/node.js +248 -0
  172. package/assets/api/vendor_modules/depd/History.md +103 -0
  173. package/assets/api/vendor_modules/depd/LICENSE +22 -0
  174. package/assets/api/vendor_modules/depd/Readme.md +280 -0
  175. package/assets/api/vendor_modules/depd/index.js +538 -0
  176. package/assets/api/vendor_modules/depd/lib/browser/index.js +77 -0
  177. package/assets/api/vendor_modules/depd/package.json +45 -0
  178. package/assets/api/vendor_modules/destroy/LICENSE +23 -0
  179. package/assets/api/vendor_modules/destroy/README.md +63 -0
  180. package/assets/api/vendor_modules/destroy/index.js +209 -0
  181. package/assets/api/vendor_modules/destroy/package.json +48 -0
  182. package/assets/api/vendor_modules/dunder-proto/.eslintrc +5 -0
  183. package/assets/api/vendor_modules/dunder-proto/.github/FUNDING.yml +12 -0
  184. package/assets/api/vendor_modules/dunder-proto/.nycrc +13 -0
  185. package/assets/api/vendor_modules/dunder-proto/CHANGELOG.md +24 -0
  186. package/assets/api/vendor_modules/dunder-proto/LICENSE +21 -0
  187. package/assets/api/vendor_modules/dunder-proto/README.md +54 -0
  188. package/assets/api/vendor_modules/dunder-proto/get.d.ts +5 -0
  189. package/assets/api/vendor_modules/dunder-proto/get.js +30 -0
  190. package/assets/api/vendor_modules/dunder-proto/package.json +76 -0
  191. package/assets/api/vendor_modules/dunder-proto/set.d.ts +5 -0
  192. package/assets/api/vendor_modules/dunder-proto/set.js +35 -0
  193. package/assets/api/vendor_modules/dunder-proto/test/get.js +34 -0
  194. package/assets/api/vendor_modules/dunder-proto/test/index.js +4 -0
  195. package/assets/api/vendor_modules/dunder-proto/test/set.js +50 -0
  196. package/assets/api/vendor_modules/dunder-proto/tsconfig.json +9 -0
  197. package/assets/api/vendor_modules/ee-first/LICENSE +22 -0
  198. package/assets/api/vendor_modules/ee-first/README.md +80 -0
  199. package/assets/api/vendor_modules/ee-first/index.js +95 -0
  200. package/assets/api/vendor_modules/ee-first/package.json +29 -0
  201. package/assets/api/vendor_modules/encodeurl/LICENSE +22 -0
  202. package/assets/api/vendor_modules/encodeurl/README.md +109 -0
  203. package/assets/api/vendor_modules/encodeurl/index.js +60 -0
  204. package/assets/api/vendor_modules/encodeurl/package.json +40 -0
  205. package/assets/api/vendor_modules/es-define-property/.eslintrc +13 -0
  206. package/assets/api/vendor_modules/es-define-property/.github/FUNDING.yml +12 -0
  207. package/assets/api/vendor_modules/es-define-property/.nycrc +9 -0
  208. package/assets/api/vendor_modules/es-define-property/CHANGELOG.md +29 -0
  209. package/assets/api/vendor_modules/es-define-property/LICENSE +21 -0
  210. package/assets/api/vendor_modules/es-define-property/README.md +49 -0
  211. package/assets/api/vendor_modules/es-define-property/index.d.ts +3 -0
  212. package/assets/api/vendor_modules/es-define-property/index.js +14 -0
  213. package/assets/api/vendor_modules/es-define-property/package.json +81 -0
  214. package/assets/api/vendor_modules/es-define-property/test/index.js +56 -0
  215. package/assets/api/vendor_modules/es-define-property/tsconfig.json +10 -0
  216. package/assets/api/vendor_modules/es-errors/.eslintrc +5 -0
  217. package/assets/api/vendor_modules/es-errors/.github/FUNDING.yml +12 -0
  218. package/assets/api/vendor_modules/es-errors/CHANGELOG.md +40 -0
  219. package/assets/api/vendor_modules/es-errors/LICENSE +21 -0
  220. package/assets/api/vendor_modules/es-errors/README.md +55 -0
  221. package/assets/api/vendor_modules/es-errors/eval.d.ts +3 -0
  222. package/assets/api/vendor_modules/es-errors/eval.js +4 -0
  223. package/assets/api/vendor_modules/es-errors/index.d.ts +3 -0
  224. package/assets/api/vendor_modules/es-errors/index.js +4 -0
  225. package/assets/api/vendor_modules/es-errors/package.json +80 -0
  226. package/assets/api/vendor_modules/es-errors/range.d.ts +3 -0
  227. package/assets/api/vendor_modules/es-errors/range.js +4 -0
  228. package/assets/api/vendor_modules/es-errors/ref.d.ts +3 -0
  229. package/assets/api/vendor_modules/es-errors/ref.js +4 -0
  230. package/assets/api/vendor_modules/es-errors/syntax.d.ts +3 -0
  231. package/assets/api/vendor_modules/es-errors/syntax.js +4 -0
  232. package/assets/api/vendor_modules/es-errors/test/index.js +19 -0
  233. package/assets/api/vendor_modules/es-errors/tsconfig.json +49 -0
  234. package/assets/api/vendor_modules/es-errors/type.d.ts +3 -0
  235. package/assets/api/vendor_modules/es-errors/type.js +4 -0
  236. package/assets/api/vendor_modules/es-errors/uri.d.ts +3 -0
  237. package/assets/api/vendor_modules/es-errors/uri.js +4 -0
  238. package/assets/api/vendor_modules/es-object-atoms/.eslintrc +16 -0
  239. package/assets/api/vendor_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  240. package/assets/api/vendor_modules/es-object-atoms/CHANGELOG.md +44 -0
  241. package/assets/api/vendor_modules/es-object-atoms/LICENSE +21 -0
  242. package/assets/api/vendor_modules/es-object-atoms/README.md +63 -0
  243. package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  244. package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  245. package/assets/api/vendor_modules/es-object-atoms/ToObject.d.ts +7 -0
  246. package/assets/api/vendor_modules/es-object-atoms/ToObject.js +10 -0
  247. package/assets/api/vendor_modules/es-object-atoms/index.d.ts +3 -0
  248. package/assets/api/vendor_modules/es-object-atoms/index.js +4 -0
  249. package/assets/api/vendor_modules/es-object-atoms/isObject.d.ts +3 -0
  250. package/assets/api/vendor_modules/es-object-atoms/isObject.js +6 -0
  251. package/assets/api/vendor_modules/es-object-atoms/package.json +79 -0
  252. package/assets/api/vendor_modules/es-object-atoms/test/index.js +38 -0
  253. package/assets/api/vendor_modules/es-object-atoms/tsconfig.json +7 -0
  254. package/assets/api/vendor_modules/escape-html/LICENSE +24 -0
  255. package/assets/api/vendor_modules/escape-html/Readme.md +43 -0
  256. package/assets/api/vendor_modules/escape-html/index.js +78 -0
  257. package/assets/api/vendor_modules/escape-html/package.json +24 -0
  258. package/assets/api/vendor_modules/etag/HISTORY.md +83 -0
  259. package/assets/api/vendor_modules/etag/LICENSE +22 -0
  260. package/assets/api/vendor_modules/etag/README.md +159 -0
  261. package/assets/api/vendor_modules/etag/index.js +131 -0
  262. package/assets/api/vendor_modules/etag/package.json +47 -0
  263. package/assets/api/vendor_modules/express/History.md +3676 -0
  264. package/assets/api/vendor_modules/express/LICENSE +24 -0
  265. package/assets/api/vendor_modules/express/Readme.md +260 -0
  266. package/assets/api/vendor_modules/express/index.js +11 -0
  267. package/assets/api/vendor_modules/express/lib/application.js +661 -0
  268. package/assets/api/vendor_modules/express/lib/express.js +116 -0
  269. package/assets/api/vendor_modules/express/lib/middleware/init.js +43 -0
  270. package/assets/api/vendor_modules/express/lib/middleware/query.js +47 -0
  271. package/assets/api/vendor_modules/express/lib/request.js +525 -0
  272. package/assets/api/vendor_modules/express/lib/response.js +1179 -0
  273. package/assets/api/vendor_modules/express/lib/router/index.js +673 -0
  274. package/assets/api/vendor_modules/express/lib/router/layer.js +181 -0
  275. package/assets/api/vendor_modules/express/lib/router/route.js +230 -0
  276. package/assets/api/vendor_modules/express/lib/utils.js +304 -0
  277. package/assets/api/vendor_modules/express/lib/view.js +182 -0
  278. package/assets/api/vendor_modules/express/package.json +102 -0
  279. package/assets/api/vendor_modules/finalhandler/HISTORY.md +216 -0
  280. package/assets/api/vendor_modules/finalhandler/LICENSE +22 -0
  281. package/assets/api/vendor_modules/finalhandler/README.md +147 -0
  282. package/assets/api/vendor_modules/finalhandler/SECURITY.md +25 -0
  283. package/assets/api/vendor_modules/finalhandler/index.js +341 -0
  284. package/assets/api/vendor_modules/finalhandler/package.json +47 -0
  285. package/assets/api/vendor_modules/forwarded/HISTORY.md +21 -0
  286. package/assets/api/vendor_modules/forwarded/LICENSE +22 -0
  287. package/assets/api/vendor_modules/forwarded/README.md +57 -0
  288. package/assets/api/vendor_modules/forwarded/index.js +90 -0
  289. package/assets/api/vendor_modules/forwarded/package.json +45 -0
  290. package/assets/api/vendor_modules/fresh/HISTORY.md +70 -0
  291. package/assets/api/vendor_modules/fresh/LICENSE +23 -0
  292. package/assets/api/vendor_modules/fresh/README.md +119 -0
  293. package/assets/api/vendor_modules/fresh/index.js +137 -0
  294. package/assets/api/vendor_modules/fresh/package.json +46 -0
  295. package/assets/api/vendor_modules/function-bind/.eslintrc +21 -0
  296. package/assets/api/vendor_modules/function-bind/.github/FUNDING.yml +12 -0
  297. package/assets/api/vendor_modules/function-bind/.github/SECURITY.md +3 -0
  298. package/assets/api/vendor_modules/function-bind/.nycrc +13 -0
  299. package/assets/api/vendor_modules/function-bind/CHANGELOG.md +136 -0
  300. package/assets/api/vendor_modules/function-bind/LICENSE +20 -0
  301. package/assets/api/vendor_modules/function-bind/README.md +46 -0
  302. package/assets/api/vendor_modules/function-bind/implementation.js +84 -0
  303. package/assets/api/vendor_modules/function-bind/index.js +5 -0
  304. package/assets/api/vendor_modules/function-bind/package.json +87 -0
  305. package/assets/api/vendor_modules/function-bind/test/.eslintrc +9 -0
  306. package/assets/api/vendor_modules/function-bind/test/index.js +252 -0
  307. package/assets/api/vendor_modules/get-intrinsic/.eslintrc +42 -0
  308. package/assets/api/vendor_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  309. package/assets/api/vendor_modules/get-intrinsic/.nycrc +9 -0
  310. package/assets/api/vendor_modules/get-intrinsic/CHANGELOG.md +186 -0
  311. package/assets/api/vendor_modules/get-intrinsic/LICENSE +21 -0
  312. package/assets/api/vendor_modules/get-intrinsic/README.md +71 -0
  313. package/assets/api/vendor_modules/get-intrinsic/index.js +378 -0
  314. package/assets/api/vendor_modules/get-intrinsic/package.json +97 -0
  315. package/assets/api/vendor_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  316. package/assets/api/vendor_modules/get-proto/.eslintrc +10 -0
  317. package/assets/api/vendor_modules/get-proto/.github/FUNDING.yml +12 -0
  318. package/assets/api/vendor_modules/get-proto/.nycrc +9 -0
  319. package/assets/api/vendor_modules/get-proto/CHANGELOG.md +21 -0
  320. package/assets/api/vendor_modules/get-proto/LICENSE +21 -0
  321. package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  322. package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.js +6 -0
  323. package/assets/api/vendor_modules/get-proto/README.md +50 -0
  324. package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  325. package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  326. package/assets/api/vendor_modules/get-proto/index.d.ts +5 -0
  327. package/assets/api/vendor_modules/get-proto/index.js +27 -0
  328. package/assets/api/vendor_modules/get-proto/package.json +81 -0
  329. package/assets/api/vendor_modules/get-proto/test/index.js +68 -0
  330. package/assets/api/vendor_modules/get-proto/tsconfig.json +9 -0
  331. package/assets/api/vendor_modules/gopd/.eslintrc +16 -0
  332. package/assets/api/vendor_modules/gopd/.github/FUNDING.yml +12 -0
  333. package/assets/api/vendor_modules/gopd/CHANGELOG.md +45 -0
  334. package/assets/api/vendor_modules/gopd/LICENSE +21 -0
  335. package/assets/api/vendor_modules/gopd/README.md +40 -0
  336. package/assets/api/vendor_modules/gopd/gOPD.d.ts +1 -0
  337. package/assets/api/vendor_modules/gopd/gOPD.js +4 -0
  338. package/assets/api/vendor_modules/gopd/index.d.ts +5 -0
  339. package/assets/api/vendor_modules/gopd/index.js +15 -0
  340. package/assets/api/vendor_modules/gopd/package.json +77 -0
  341. package/assets/api/vendor_modules/gopd/test/index.js +36 -0
  342. package/assets/api/vendor_modules/gopd/tsconfig.json +9 -0
  343. package/assets/api/vendor_modules/has-symbols/.eslintrc +11 -0
  344. package/assets/api/vendor_modules/has-symbols/.github/FUNDING.yml +12 -0
  345. package/assets/api/vendor_modules/has-symbols/.nycrc +9 -0
  346. package/assets/api/vendor_modules/has-symbols/CHANGELOG.md +91 -0
  347. package/assets/api/vendor_modules/has-symbols/LICENSE +21 -0
  348. package/assets/api/vendor_modules/has-symbols/README.md +46 -0
  349. package/assets/api/vendor_modules/has-symbols/index.d.ts +3 -0
  350. package/assets/api/vendor_modules/has-symbols/index.js +14 -0
  351. package/assets/api/vendor_modules/has-symbols/package.json +111 -0
  352. package/assets/api/vendor_modules/has-symbols/shams.d.ts +3 -0
  353. package/assets/api/vendor_modules/has-symbols/shams.js +45 -0
  354. package/assets/api/vendor_modules/has-symbols/test/index.js +22 -0
  355. package/assets/api/vendor_modules/has-symbols/test/shams/core-js.js +29 -0
  356. package/assets/api/vendor_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  357. package/assets/api/vendor_modules/has-symbols/test/tests.js +58 -0
  358. package/assets/api/vendor_modules/has-symbols/tsconfig.json +10 -0
  359. package/assets/api/vendor_modules/hasown/.github/FUNDING.yml +12 -0
  360. package/assets/api/vendor_modules/hasown/.nycrc +13 -0
  361. package/assets/api/vendor_modules/hasown/CHANGELOG.md +58 -0
  362. package/assets/api/vendor_modules/hasown/LICENSE +21 -0
  363. package/assets/api/vendor_modules/hasown/README.md +40 -0
  364. package/assets/api/vendor_modules/hasown/eslint.config.mjs +6 -0
  365. package/assets/api/vendor_modules/hasown/index.d.ts +3 -0
  366. package/assets/api/vendor_modules/hasown/index.js +8 -0
  367. package/assets/api/vendor_modules/hasown/package.json +91 -0
  368. package/assets/api/vendor_modules/hasown/tsconfig.json +6 -0
  369. package/assets/api/vendor_modules/http-errors/HISTORY.md +186 -0
  370. package/assets/api/vendor_modules/http-errors/LICENSE +23 -0
  371. package/assets/api/vendor_modules/http-errors/README.md +169 -0
  372. package/assets/api/vendor_modules/http-errors/index.js +290 -0
  373. package/assets/api/vendor_modules/http-errors/package.json +54 -0
  374. package/assets/api/vendor_modules/iconv-lite/Changelog.md +162 -0
  375. package/assets/api/vendor_modules/iconv-lite/LICENSE +21 -0
  376. package/assets/api/vendor_modules/iconv-lite/README.md +156 -0
  377. package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  378. package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  379. package/assets/api/vendor_modules/iconv-lite/encodings/index.js +22 -0
  380. package/assets/api/vendor_modules/iconv-lite/encodings/internal.js +188 -0
  381. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  382. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  383. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  384. package/assets/api/vendor_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  385. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  386. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  387. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  388. package/assets/api/vendor_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  389. package/assets/api/vendor_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  390. package/assets/api/vendor_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  391. package/assets/api/vendor_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  392. package/assets/api/vendor_modules/iconv-lite/encodings/utf16.js +177 -0
  393. package/assets/api/vendor_modules/iconv-lite/encodings/utf7.js +290 -0
  394. package/assets/api/vendor_modules/iconv-lite/lib/bom-handling.js +52 -0
  395. package/assets/api/vendor_modules/iconv-lite/lib/extend-node.js +217 -0
  396. package/assets/api/vendor_modules/iconv-lite/lib/index.d.ts +24 -0
  397. package/assets/api/vendor_modules/iconv-lite/lib/index.js +153 -0
  398. package/assets/api/vendor_modules/iconv-lite/lib/streams.js +121 -0
  399. package/assets/api/vendor_modules/iconv-lite/package.json +46 -0
  400. package/assets/api/vendor_modules/inherits/LICENSE +16 -0
  401. package/assets/api/vendor_modules/inherits/README.md +42 -0
  402. package/assets/api/vendor_modules/inherits/inherits.js +9 -0
  403. package/assets/api/vendor_modules/inherits/inherits_browser.js +27 -0
  404. package/assets/api/vendor_modules/inherits/package.json +29 -0
  405. package/assets/api/vendor_modules/ipaddr.js/LICENSE +19 -0
  406. package/assets/api/vendor_modules/ipaddr.js/README.md +233 -0
  407. package/assets/api/vendor_modules/ipaddr.js/ipaddr.min.js +1 -0
  408. package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js +673 -0
  409. package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  410. package/assets/api/vendor_modules/ipaddr.js/package.json +35 -0
  411. package/assets/api/vendor_modules/math-intrinsics/.eslintrc +16 -0
  412. package/assets/api/vendor_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  413. package/assets/api/vendor_modules/math-intrinsics/CHANGELOG.md +24 -0
  414. package/assets/api/vendor_modules/math-intrinsics/LICENSE +21 -0
  415. package/assets/api/vendor_modules/math-intrinsics/README.md +50 -0
  416. package/assets/api/vendor_modules/math-intrinsics/abs.d.ts +1 -0
  417. package/assets/api/vendor_modules/math-intrinsics/abs.js +4 -0
  418. package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  419. package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  420. package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  421. package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  422. package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  423. package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.js +5 -0
  424. package/assets/api/vendor_modules/math-intrinsics/floor.d.ts +1 -0
  425. package/assets/api/vendor_modules/math-intrinsics/floor.js +4 -0
  426. package/assets/api/vendor_modules/math-intrinsics/isFinite.d.ts +3 -0
  427. package/assets/api/vendor_modules/math-intrinsics/isFinite.js +12 -0
  428. package/assets/api/vendor_modules/math-intrinsics/isInteger.d.ts +3 -0
  429. package/assets/api/vendor_modules/math-intrinsics/isInteger.js +16 -0
  430. package/assets/api/vendor_modules/math-intrinsics/isNaN.d.ts +1 -0
  431. package/assets/api/vendor_modules/math-intrinsics/isNaN.js +6 -0
  432. package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  433. package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.js +6 -0
  434. package/assets/api/vendor_modules/math-intrinsics/max.d.ts +1 -0
  435. package/assets/api/vendor_modules/math-intrinsics/max.js +4 -0
  436. package/assets/api/vendor_modules/math-intrinsics/min.d.ts +1 -0
  437. package/assets/api/vendor_modules/math-intrinsics/min.js +4 -0
  438. package/assets/api/vendor_modules/math-intrinsics/mod.d.ts +3 -0
  439. package/assets/api/vendor_modules/math-intrinsics/mod.js +9 -0
  440. package/assets/api/vendor_modules/math-intrinsics/package.json +86 -0
  441. package/assets/api/vendor_modules/math-intrinsics/pow.d.ts +1 -0
  442. package/assets/api/vendor_modules/math-intrinsics/pow.js +4 -0
  443. package/assets/api/vendor_modules/math-intrinsics/round.d.ts +1 -0
  444. package/assets/api/vendor_modules/math-intrinsics/round.js +4 -0
  445. package/assets/api/vendor_modules/math-intrinsics/sign.d.ts +3 -0
  446. package/assets/api/vendor_modules/math-intrinsics/sign.js +11 -0
  447. package/assets/api/vendor_modules/math-intrinsics/test/index.js +192 -0
  448. package/assets/api/vendor_modules/math-intrinsics/tsconfig.json +3 -0
  449. package/assets/api/vendor_modules/media-typer/HISTORY.md +22 -0
  450. package/assets/api/vendor_modules/media-typer/LICENSE +22 -0
  451. package/assets/api/vendor_modules/media-typer/README.md +81 -0
  452. package/assets/api/vendor_modules/media-typer/index.js +270 -0
  453. package/assets/api/vendor_modules/media-typer/package.json +26 -0
  454. package/assets/api/vendor_modules/merge-descriptors/HISTORY.md +21 -0
  455. package/assets/api/vendor_modules/merge-descriptors/LICENSE +23 -0
  456. package/assets/api/vendor_modules/merge-descriptors/README.md +49 -0
  457. package/assets/api/vendor_modules/merge-descriptors/index.js +60 -0
  458. package/assets/api/vendor_modules/merge-descriptors/package.json +39 -0
  459. package/assets/api/vendor_modules/methods/HISTORY.md +29 -0
  460. package/assets/api/vendor_modules/methods/LICENSE +24 -0
  461. package/assets/api/vendor_modules/methods/README.md +51 -0
  462. package/assets/api/vendor_modules/methods/index.js +69 -0
  463. package/assets/api/vendor_modules/methods/package.json +36 -0
  464. package/assets/api/vendor_modules/mime/CHANGELOG.md +164 -0
  465. package/assets/api/vendor_modules/mime/LICENSE +21 -0
  466. package/assets/api/vendor_modules/mime/README.md +90 -0
  467. package/assets/api/vendor_modules/mime/cli.js +8 -0
  468. package/assets/api/vendor_modules/mime/mime.js +108 -0
  469. package/assets/api/vendor_modules/mime/package.json +44 -0
  470. package/assets/api/vendor_modules/mime/src/build.js +53 -0
  471. package/assets/api/vendor_modules/mime/src/test.js +60 -0
  472. package/assets/api/vendor_modules/mime/types.json +1 -0
  473. package/assets/api/vendor_modules/mime-db/HISTORY.md +507 -0
  474. package/assets/api/vendor_modules/mime-db/LICENSE +23 -0
  475. package/assets/api/vendor_modules/mime-db/README.md +100 -0
  476. package/assets/api/vendor_modules/mime-db/db.json +8519 -0
  477. package/assets/api/vendor_modules/mime-db/index.js +12 -0
  478. package/assets/api/vendor_modules/mime-db/package.json +60 -0
  479. package/assets/api/vendor_modules/mime-types/HISTORY.md +397 -0
  480. package/assets/api/vendor_modules/mime-types/LICENSE +23 -0
  481. package/assets/api/vendor_modules/mime-types/README.md +113 -0
  482. package/assets/api/vendor_modules/mime-types/index.js +188 -0
  483. package/assets/api/vendor_modules/mime-types/package.json +44 -0
  484. package/assets/api/vendor_modules/ms/index.js +152 -0
  485. package/assets/api/vendor_modules/ms/license.md +21 -0
  486. package/assets/api/vendor_modules/ms/package.json +37 -0
  487. package/assets/api/vendor_modules/ms/readme.md +51 -0
  488. package/assets/api/vendor_modules/negotiator/HISTORY.md +108 -0
  489. package/assets/api/vendor_modules/negotiator/LICENSE +24 -0
  490. package/assets/api/vendor_modules/negotiator/README.md +203 -0
  491. package/assets/api/vendor_modules/negotiator/index.js +82 -0
  492. package/assets/api/vendor_modules/negotiator/lib/charset.js +169 -0
  493. package/assets/api/vendor_modules/negotiator/lib/encoding.js +184 -0
  494. package/assets/api/vendor_modules/negotiator/lib/language.js +179 -0
  495. package/assets/api/vendor_modules/negotiator/lib/mediaType.js +294 -0
  496. package/assets/api/vendor_modules/negotiator/package.json +42 -0
  497. package/assets/api/vendor_modules/object-inspect/.eslintrc +53 -0
  498. package/assets/api/vendor_modules/object-inspect/.github/FUNDING.yml +12 -0
  499. package/assets/api/vendor_modules/object-inspect/.nycrc +13 -0
  500. package/assets/api/vendor_modules/object-inspect/CHANGELOG.md +424 -0
  501. package/assets/api/vendor_modules/object-inspect/LICENSE +21 -0
  502. package/assets/api/vendor_modules/object-inspect/example/all.js +23 -0
  503. package/assets/api/vendor_modules/object-inspect/example/circular.js +6 -0
  504. package/assets/api/vendor_modules/object-inspect/example/fn.js +5 -0
  505. package/assets/api/vendor_modules/object-inspect/example/inspect.js +10 -0
  506. package/assets/api/vendor_modules/object-inspect/index.js +544 -0
  507. package/assets/api/vendor_modules/object-inspect/package-support.json +20 -0
  508. package/assets/api/vendor_modules/object-inspect/package.json +105 -0
  509. package/assets/api/vendor_modules/object-inspect/readme.markdown +84 -0
  510. package/assets/api/vendor_modules/object-inspect/test/bigint.js +58 -0
  511. package/assets/api/vendor_modules/object-inspect/test/browser/dom.js +15 -0
  512. package/assets/api/vendor_modules/object-inspect/test/circular.js +16 -0
  513. package/assets/api/vendor_modules/object-inspect/test/deep.js +12 -0
  514. package/assets/api/vendor_modules/object-inspect/test/element.js +53 -0
  515. package/assets/api/vendor_modules/object-inspect/test/err.js +48 -0
  516. package/assets/api/vendor_modules/object-inspect/test/fakes.js +29 -0
  517. package/assets/api/vendor_modules/object-inspect/test/fn.js +76 -0
  518. package/assets/api/vendor_modules/object-inspect/test/global.js +17 -0
  519. package/assets/api/vendor_modules/object-inspect/test/has.js +15 -0
  520. package/assets/api/vendor_modules/object-inspect/test/holes.js +15 -0
  521. package/assets/api/vendor_modules/object-inspect/test/indent-option.js +271 -0
  522. package/assets/api/vendor_modules/object-inspect/test/inspect.js +139 -0
  523. package/assets/api/vendor_modules/object-inspect/test/lowbyte.js +12 -0
  524. package/assets/api/vendor_modules/object-inspect/test/number.js +58 -0
  525. package/assets/api/vendor_modules/object-inspect/test/quoteStyle.js +26 -0
  526. package/assets/api/vendor_modules/object-inspect/test/toStringTag.js +40 -0
  527. package/assets/api/vendor_modules/object-inspect/test/undef.js +12 -0
  528. package/assets/api/vendor_modules/object-inspect/test/values.js +261 -0
  529. package/assets/api/vendor_modules/object-inspect/test-core-js.js +26 -0
  530. package/assets/api/vendor_modules/object-inspect/util.inspect.js +1 -0
  531. package/assets/api/vendor_modules/on-finished/HISTORY.md +98 -0
  532. package/assets/api/vendor_modules/on-finished/LICENSE +23 -0
  533. package/assets/api/vendor_modules/on-finished/README.md +162 -0
  534. package/assets/api/vendor_modules/on-finished/index.js +234 -0
  535. package/assets/api/vendor_modules/on-finished/package.json +39 -0
  536. package/assets/api/vendor_modules/parseurl/HISTORY.md +58 -0
  537. package/assets/api/vendor_modules/parseurl/LICENSE +24 -0
  538. package/assets/api/vendor_modules/parseurl/README.md +133 -0
  539. package/assets/api/vendor_modules/parseurl/index.js +158 -0
  540. package/assets/api/vendor_modules/parseurl/package.json +40 -0
  541. package/assets/api/vendor_modules/path-to-regexp/LICENSE +21 -0
  542. package/assets/api/vendor_modules/path-to-regexp/Readme.md +35 -0
  543. package/assets/api/vendor_modules/path-to-regexp/index.js +158 -0
  544. package/assets/api/vendor_modules/path-to-regexp/package.json +30 -0
  545. package/assets/api/vendor_modules/proxy-addr/HISTORY.md +167 -0
  546. package/assets/api/vendor_modules/proxy-addr/LICENSE +22 -0
  547. package/assets/api/vendor_modules/proxy-addr/README.md +139 -0
  548. package/assets/api/vendor_modules/proxy-addr/index.js +359 -0
  549. package/assets/api/vendor_modules/proxy-addr/package.json +51 -0
  550. package/assets/api/vendor_modules/qs/.editorconfig +46 -0
  551. package/assets/api/vendor_modules/qs/.github/FUNDING.yml +12 -0
  552. package/assets/api/vendor_modules/qs/.github/SECURITY.md +11 -0
  553. package/assets/api/vendor_modules/qs/.github/THREAT_MODEL.md +78 -0
  554. package/assets/api/vendor_modules/qs/.nycrc +13 -0
  555. package/assets/api/vendor_modules/qs/CHANGELOG.md +833 -0
  556. package/assets/api/vendor_modules/qs/LICENSE.md +29 -0
  557. package/assets/api/vendor_modules/qs/README.md +758 -0
  558. package/assets/api/vendor_modules/qs/dist/qs.js +141 -0
  559. package/assets/api/vendor_modules/qs/eslint.config.mjs +57 -0
  560. package/assets/api/vendor_modules/qs/lib/formats.js +23 -0
  561. package/assets/api/vendor_modules/qs/lib/index.js +11 -0
  562. package/assets/api/vendor_modules/qs/lib/parse.js +414 -0
  563. package/assets/api/vendor_modules/qs/lib/stringify.js +363 -0
  564. package/assets/api/vendor_modules/qs/lib/utils.js +381 -0
  565. package/assets/api/vendor_modules/qs/package.json +95 -0
  566. package/assets/api/vendor_modules/qs/test/empty-keys-cases.js +267 -0
  567. package/assets/api/vendor_modules/qs/test/parse.js +1933 -0
  568. package/assets/api/vendor_modules/qs/test/stringify.js +1448 -0
  569. package/assets/api/vendor_modules/qs/test/utils.js +626 -0
  570. package/assets/api/vendor_modules/range-parser/HISTORY.md +56 -0
  571. package/assets/api/vendor_modules/range-parser/LICENSE +23 -0
  572. package/assets/api/vendor_modules/range-parser/README.md +84 -0
  573. package/assets/api/vendor_modules/range-parser/index.js +162 -0
  574. package/assets/api/vendor_modules/range-parser/package.json +44 -0
  575. package/assets/api/vendor_modules/raw-body/LICENSE +22 -0
  576. package/assets/api/vendor_modules/raw-body/README.md +223 -0
  577. package/assets/api/vendor_modules/raw-body/index.d.ts +87 -0
  578. package/assets/api/vendor_modules/raw-body/index.js +336 -0
  579. package/assets/api/vendor_modules/raw-body/package.json +47 -0
  580. package/assets/api/vendor_modules/safe-buffer/LICENSE +21 -0
  581. package/assets/api/vendor_modules/safe-buffer/README.md +584 -0
  582. package/assets/api/vendor_modules/safe-buffer/index.d.ts +187 -0
  583. package/assets/api/vendor_modules/safe-buffer/index.js +65 -0
  584. package/assets/api/vendor_modules/safe-buffer/package.json +51 -0
  585. package/assets/api/vendor_modules/safer-buffer/LICENSE +21 -0
  586. package/assets/api/vendor_modules/safer-buffer/Porting-Buffer.md +268 -0
  587. package/assets/api/vendor_modules/safer-buffer/Readme.md +156 -0
  588. package/assets/api/vendor_modules/safer-buffer/dangerous.js +58 -0
  589. package/assets/api/vendor_modules/safer-buffer/package.json +34 -0
  590. package/assets/api/vendor_modules/safer-buffer/safer.js +77 -0
  591. package/assets/api/vendor_modules/safer-buffer/tests.js +406 -0
  592. package/assets/api/vendor_modules/send/HISTORY.md +538 -0
  593. package/assets/api/vendor_modules/send/LICENSE +23 -0
  594. package/assets/api/vendor_modules/send/README.md +327 -0
  595. package/assets/api/vendor_modules/send/SECURITY.md +24 -0
  596. package/assets/api/vendor_modules/send/index.js +1142 -0
  597. package/assets/api/vendor_modules/send/node_modules/ms/index.js +162 -0
  598. package/assets/api/vendor_modules/send/node_modules/ms/license.md +21 -0
  599. package/assets/api/vendor_modules/send/node_modules/ms/package.json +38 -0
  600. package/assets/api/vendor_modules/send/node_modules/ms/readme.md +59 -0
  601. package/assets/api/vendor_modules/send/package.json +62 -0
  602. package/assets/api/vendor_modules/serve-static/HISTORY.md +493 -0
  603. package/assets/api/vendor_modules/serve-static/LICENSE +25 -0
  604. package/assets/api/vendor_modules/serve-static/README.md +257 -0
  605. package/assets/api/vendor_modules/serve-static/index.js +209 -0
  606. package/assets/api/vendor_modules/serve-static/package.json +42 -0
  607. package/assets/api/vendor_modules/serverless-http/LICENSE.txt +33 -0
  608. package/assets/api/vendor_modules/serverless-http/README.md +117 -0
  609. package/assets/api/vendor_modules/serverless-http/lib/finish.js +42 -0
  610. package/assets/api/vendor_modules/serverless-http/lib/framework/get-framework.js +79 -0
  611. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/clean-up-event.js +98 -0
  612. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/create-request.js +110 -0
  613. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/format-response.js +45 -0
  614. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/index.js +15 -0
  615. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/is-binary.js +42 -0
  616. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/sanitize-headers.js +21 -0
  617. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/clean-up-request.js +41 -0
  618. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/create-request.js +45 -0
  619. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/format-response.js +18 -0
  620. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/index.js +13 -0
  621. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/is-binary.js +42 -0
  622. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/sanitize-headers.js +23 -0
  623. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/set-cookie.json +1 -0
  624. package/assets/api/vendor_modules/serverless-http/lib/provider/get-provider.js +17 -0
  625. package/assets/api/vendor_modules/serverless-http/lib/request.js +38 -0
  626. package/assets/api/vendor_modules/serverless-http/lib/response.js +135 -0
  627. package/assets/api/vendor_modules/serverless-http/package.json +93 -0
  628. package/assets/api/vendor_modules/serverless-http/serverless-http.d.ts +41 -0
  629. package/assets/api/vendor_modules/serverless-http/serverless-http.js +23 -0
  630. package/assets/api/vendor_modules/setprototypeof/LICENSE +13 -0
  631. package/assets/api/vendor_modules/setprototypeof/README.md +31 -0
  632. package/assets/api/vendor_modules/setprototypeof/index.d.ts +2 -0
  633. package/assets/api/vendor_modules/setprototypeof/index.js +17 -0
  634. package/assets/api/vendor_modules/setprototypeof/package.json +38 -0
  635. package/assets/api/vendor_modules/setprototypeof/test/index.js +24 -0
  636. package/assets/api/vendor_modules/side-channel/.editorconfig +9 -0
  637. package/assets/api/vendor_modules/side-channel/.eslintrc +12 -0
  638. package/assets/api/vendor_modules/side-channel/.github/FUNDING.yml +12 -0
  639. package/assets/api/vendor_modules/side-channel/.nycrc +13 -0
  640. package/assets/api/vendor_modules/side-channel/CHANGELOG.md +120 -0
  641. package/assets/api/vendor_modules/side-channel/LICENSE +21 -0
  642. package/assets/api/vendor_modules/side-channel/README.md +61 -0
  643. package/assets/api/vendor_modules/side-channel/index.d.ts +14 -0
  644. package/assets/api/vendor_modules/side-channel/index.js +46 -0
  645. package/assets/api/vendor_modules/side-channel/package.json +85 -0
  646. package/assets/api/vendor_modules/side-channel/test/index.js +120 -0
  647. package/assets/api/vendor_modules/side-channel/tsconfig.json +9 -0
  648. package/assets/api/vendor_modules/side-channel-list/.editorconfig +9 -0
  649. package/assets/api/vendor_modules/side-channel-list/.eslintrc +11 -0
  650. package/assets/api/vendor_modules/side-channel-list/.github/FUNDING.yml +12 -0
  651. package/assets/api/vendor_modules/side-channel-list/.nycrc +13 -0
  652. package/assets/api/vendor_modules/side-channel-list/CHANGELOG.md +36 -0
  653. package/assets/api/vendor_modules/side-channel-list/LICENSE +21 -0
  654. package/assets/api/vendor_modules/side-channel-list/README.md +62 -0
  655. package/assets/api/vendor_modules/side-channel-list/index.d.ts +13 -0
  656. package/assets/api/vendor_modules/side-channel-list/index.js +111 -0
  657. package/assets/api/vendor_modules/side-channel-list/list.d.ts +14 -0
  658. package/assets/api/vendor_modules/side-channel-list/package.json +77 -0
  659. package/assets/api/vendor_modules/side-channel-list/test/index.js +154 -0
  660. package/assets/api/vendor_modules/side-channel-list/tsconfig.json +9 -0
  661. package/assets/api/vendor_modules/side-channel-map/.editorconfig +9 -0
  662. package/assets/api/vendor_modules/side-channel-map/.eslintrc +11 -0
  663. package/assets/api/vendor_modules/side-channel-map/.github/FUNDING.yml +12 -0
  664. package/assets/api/vendor_modules/side-channel-map/.nycrc +13 -0
  665. package/assets/api/vendor_modules/side-channel-map/CHANGELOG.md +22 -0
  666. package/assets/api/vendor_modules/side-channel-map/LICENSE +21 -0
  667. package/assets/api/vendor_modules/side-channel-map/README.md +62 -0
  668. package/assets/api/vendor_modules/side-channel-map/index.d.ts +15 -0
  669. package/assets/api/vendor_modules/side-channel-map/index.js +68 -0
  670. package/assets/api/vendor_modules/side-channel-map/package.json +80 -0
  671. package/assets/api/vendor_modules/side-channel-map/test/index.js +114 -0
  672. package/assets/api/vendor_modules/side-channel-map/tsconfig.json +9 -0
  673. package/assets/api/vendor_modules/side-channel-weakmap/.editorconfig +9 -0
  674. package/assets/api/vendor_modules/side-channel-weakmap/.eslintrc +12 -0
  675. package/assets/api/vendor_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  676. package/assets/api/vendor_modules/side-channel-weakmap/.nycrc +13 -0
  677. package/assets/api/vendor_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  678. package/assets/api/vendor_modules/side-channel-weakmap/LICENSE +21 -0
  679. package/assets/api/vendor_modules/side-channel-weakmap/README.md +62 -0
  680. package/assets/api/vendor_modules/side-channel-weakmap/index.d.ts +15 -0
  681. package/assets/api/vendor_modules/side-channel-weakmap/index.js +84 -0
  682. package/assets/api/vendor_modules/side-channel-weakmap/package.json +87 -0
  683. package/assets/api/vendor_modules/side-channel-weakmap/test/index.js +114 -0
  684. package/assets/api/vendor_modules/side-channel-weakmap/tsconfig.json +9 -0
  685. package/assets/api/vendor_modules/statuses/HISTORY.md +87 -0
  686. package/assets/api/vendor_modules/statuses/LICENSE +23 -0
  687. package/assets/api/vendor_modules/statuses/README.md +139 -0
  688. package/assets/api/vendor_modules/statuses/codes.json +65 -0
  689. package/assets/api/vendor_modules/statuses/index.js +146 -0
  690. package/assets/api/vendor_modules/statuses/package.json +49 -0
  691. package/assets/api/vendor_modules/toidentifier/HISTORY.md +9 -0
  692. package/assets/api/vendor_modules/toidentifier/LICENSE +21 -0
  693. package/assets/api/vendor_modules/toidentifier/README.md +61 -0
  694. package/assets/api/vendor_modules/toidentifier/index.js +32 -0
  695. package/assets/api/vendor_modules/toidentifier/package.json +38 -0
  696. package/assets/api/vendor_modules/type-is/HISTORY.md +259 -0
  697. package/assets/api/vendor_modules/type-is/LICENSE +23 -0
  698. package/assets/api/vendor_modules/type-is/README.md +170 -0
  699. package/assets/api/vendor_modules/type-is/index.js +266 -0
  700. package/assets/api/vendor_modules/type-is/package.json +45 -0
  701. package/assets/api/vendor_modules/unpipe/HISTORY.md +4 -0
  702. package/assets/api/vendor_modules/unpipe/LICENSE +22 -0
  703. package/assets/api/vendor_modules/unpipe/README.md +43 -0
  704. package/assets/api/vendor_modules/unpipe/index.js +69 -0
  705. package/assets/api/vendor_modules/unpipe/package.json +27 -0
  706. package/assets/api/vendor_modules/utils-merge/LICENSE +20 -0
  707. package/assets/api/vendor_modules/utils-merge/README.md +34 -0
  708. package/assets/api/vendor_modules/utils-merge/index.js +23 -0
  709. package/assets/api/vendor_modules/utils-merge/package.json +40 -0
  710. package/assets/api/vendor_modules/vary/HISTORY.md +39 -0
  711. package/assets/api/vendor_modules/vary/LICENSE +22 -0
  712. package/assets/api/vendor_modules/vary/README.md +101 -0
  713. package/assets/api/vendor_modules/vary/index.js +149 -0
  714. package/assets/api/vendor_modules/vary/package.json +43 -0
  715. package/assets/federation-presignup/index.js +108 -0
  716. package/assets/firstadmin/index.js +361 -0
  717. package/assets/headscale-apikey/index.js +140 -0
  718. package/assets/invoke-relay/index.js +96 -0
  719. package/assets/issuer-canary/index.js +71 -0
  720. package/assets/issuer-publish/index.js +87 -0
  721. package/assets/keyminter/index.js +209 -0
  722. package/assets/plugin-authorizer/index.js +1740 -0
  723. package/assets/plugin-catalog/index.js +881 -0
  724. package/assets/reapproval/index.js +3761 -0
  725. package/assets/sg-manager/index.js +176 -0
  726. package/assets/tailnet-resolver/index.js +55 -0
  727. package/assets/web/chunk-2MOGDYK4.js +1 -0
  728. package/assets/web/chunk-2SO4BVIT.js +1 -0
  729. package/assets/web/chunk-2V6RSAAC.js +1 -0
  730. package/assets/web/chunk-32GNBTAL.js +1 -0
  731. package/assets/web/chunk-33SYY2JB.js +1 -0
  732. package/assets/web/chunk-3VWYT7AX.js +1 -0
  733. package/assets/web/chunk-4FG4DAWU.js +4 -0
  734. package/assets/web/chunk-4N2IUS6T.js +1 -0
  735. package/assets/web/chunk-4SK6XQ6C.js +1 -0
  736. package/assets/web/chunk-65WE5MXA.js +8 -0
  737. package/assets/web/chunk-6D7SSSJF.js +1 -0
  738. package/assets/web/chunk-6KFR7DYY.js +1 -0
  739. package/assets/web/chunk-A4WHI3ZG.js +8 -0
  740. package/assets/web/chunk-BNFKRZTP.js +1 -0
  741. package/assets/web/chunk-CG56PH3M.js +1 -0
  742. package/assets/web/chunk-CGO25AIM.js +1 -0
  743. package/assets/web/chunk-CP4XZPOA.js +1 -0
  744. package/assets/web/chunk-CV7EODPO.js +1 -0
  745. package/assets/web/chunk-D7TR2ORJ.js +1 -0
  746. package/assets/web/chunk-DCOFBAKJ.js +1 -0
  747. package/assets/web/chunk-DOLRLYW7.js +1 -0
  748. package/assets/web/chunk-EEJ3X466.js +1 -0
  749. package/assets/web/chunk-EQ4PF25J.js +1 -0
  750. package/assets/web/chunk-EVP5UVDQ.js +1 -0
  751. package/assets/web/chunk-EW2VMNHE.js +1 -0
  752. package/assets/web/chunk-FIUVIKAN.js +1 -0
  753. package/assets/web/chunk-GHEU25TG.js +1 -0
  754. package/assets/web/chunk-GK2T2SMO.js +1 -0
  755. package/assets/web/chunk-GKI3R2JB.js +1 -0
  756. package/assets/web/chunk-GPKKIOHD.js +2 -0
  757. package/assets/web/chunk-H4AVFUDM.js +1 -0
  758. package/assets/web/chunk-H5H727H6.js +1 -0
  759. package/assets/web/chunk-HGVFH6YM.js +1 -0
  760. package/assets/web/chunk-HHPIANBK.js +1 -0
  761. package/assets/web/chunk-HK56COCB.js +1 -0
  762. package/assets/web/chunk-HZUB7LFV.js +1 -0
  763. package/assets/web/chunk-I7NTNTBA.js +1 -0
  764. package/assets/web/chunk-IKK5DQ3Z.js +1 -0
  765. package/assets/web/chunk-IMH56UBX.js +1 -0
  766. package/assets/web/chunk-J3SSPCFV.js +1 -0
  767. package/assets/web/chunk-J4C7C5KO.js +1 -0
  768. package/assets/web/chunk-J57JB4MU.js +1 -0
  769. package/assets/web/chunk-JMBXRK3I.js +4 -0
  770. package/assets/web/chunk-KCCEQIXX.js +1 -0
  771. package/assets/web/chunk-KEBESIXR.js +1 -0
  772. package/assets/web/chunk-KPNHT4MK.js +1 -0
  773. package/assets/web/chunk-LMLXTVZG.js +1 -0
  774. package/assets/web/chunk-M6OAYNRE.js +1 -0
  775. package/assets/web/chunk-M7MGX5I4.js +1 -0
  776. package/assets/web/chunk-MU2VNTNY.js +1 -0
  777. package/assets/web/chunk-NABAVDRL.js +1 -0
  778. package/assets/web/chunk-NO5D6WDF.js +1 -0
  779. package/assets/web/chunk-O4QSFUXB.js +1 -0
  780. package/assets/web/chunk-OATVFQXO.js +1 -0
  781. package/assets/web/chunk-P5WRM37W.js +5 -0
  782. package/assets/web/chunk-PCP6D2SM.js +1 -0
  783. package/assets/web/chunk-PMMBJK7Q.js +1 -0
  784. package/assets/web/chunk-PSMER3HX.js +1 -0
  785. package/assets/web/chunk-QPBWZLCT.js +1 -0
  786. package/assets/web/chunk-QVABVDO5.js +1 -0
  787. package/assets/web/chunk-RI77LE5V.js +1 -0
  788. package/assets/web/chunk-RKGUEXZ2.js +1 -0
  789. package/assets/web/chunk-RMFH2YTZ.js +1 -0
  790. package/assets/web/chunk-RROPCBUH.js +1 -0
  791. package/assets/web/chunk-SJMLX5AT.js +1 -0
  792. package/assets/web/chunk-TKVALOE4.js +2 -0
  793. package/assets/web/chunk-TM43WUKM.js +1 -0
  794. package/assets/web/chunk-VKWV3ANT.js +1 -0
  795. package/assets/web/chunk-VTMYG6YW.js +1 -0
  796. package/assets/web/chunk-VWW4SA5R.js +1 -0
  797. package/assets/web/chunk-WEDAFMID.js +1 -0
  798. package/assets/web/chunk-WFIHWVQO.js +1 -0
  799. package/assets/web/chunk-XJM3HDJQ.js +1 -0
  800. package/assets/web/chunk-YVJV2RUY.js +1 -0
  801. package/assets/web/chunk-Z3KONI7L.js +1 -0
  802. package/assets/web/chunk-ZDCURXPS.js +1 -0
  803. package/assets/web/favicon.ico +0 -0
  804. package/assets/web/index.html +63 -0
  805. package/assets/web/main-S6E3BC5O.js +2 -0
  806. package/assets/web/polyfills-7RSNIJ6J.js +2 -0
  807. package/assets/web/styles-R6ZUWC6K.css +1 -0
  808. package/dist/index.d.ts +27 -0
  809. package/dist/index.js +66 -0
  810. package/dist/lambdacode/api/services/brandingShapes.d.ts +5 -0
  811. package/dist/lambdacode/api/services/brandingShapes.js +15 -0
  812. package/dist/lambdacode/issuer/objects.d.ts +8 -0
  813. package/dist/lambdacode/issuer/objects.js +11 -0
  814. package/dist/lambdacode/network/naming.d.ts +52 -0
  815. package/dist/lambdacode/network/naming.js +67 -0
  816. package/dist/lib/access-portal-hub.d.ts +53 -0
  817. package/dist/lib/access-portal-hub.js +87 -0
  818. package/dist/lib/access-portal.d.ts +32 -0
  819. package/dist/lib/access-portal.js +174 -0
  820. package/dist/lib/audit-log.d.ts +18 -0
  821. package/dist/lib/audit-log.js +25 -0
  822. package/dist/lib/connector-stack.d.ts +28 -0
  823. package/dist/lib/connector-stack.js +81 -0
  824. package/dist/lib/constructs/app-function.d.ts +14 -0
  825. package/dist/lib/constructs/app-function.js +84 -0
  826. package/dist/lib/constructs/app-table.d.ts +12 -0
  827. package/dist/lib/constructs/app-table.js +58 -0
  828. package/dist/lib/constructs/mirrored-image.d.ts +12 -0
  829. package/dist/lib/constructs/mirrored-image.js +80 -0
  830. package/dist/lib/constructs/monitoring.d.ts +21 -0
  831. package/dist/lib/constructs/monitoring.js +133 -0
  832. package/dist/lib/constructs/oidc-issuer.d.ts +44 -0
  833. package/dist/lib/constructs/oidc-issuer.js +234 -0
  834. package/dist/lib/constructs/scratch-tmpfs.d.ts +5 -0
  835. package/dist/lib/constructs/scratch-tmpfs.js +48 -0
  836. package/dist/lib/constructs/sg-manager.d.ts +27 -0
  837. package/dist/lib/constructs/sg-manager.js +88 -0
  838. package/dist/lib/constructs/tailnet-connector.d.ts +29 -0
  839. package/dist/lib/constructs/tailnet-connector.js +177 -0
  840. package/dist/lib/constructs/tailnet-resolver.d.ts +30 -0
  841. package/dist/lib/constructs/tailnet-resolver.js +71 -0
  842. package/dist/lib/constructs/target-account-trust.d.ts +32 -0
  843. package/dist/lib/constructs/target-account-trust.js +81 -0
  844. package/dist/lib/constructs/vending-api.d.ts +103 -0
  845. package/dist/lib/constructs/vending-api.js +203 -0
  846. package/dist/lib/constructs/web-acl.d.ts +61 -0
  847. package/dist/lib/constructs/web-acl.js +213 -0
  848. package/dist/lib/constructs/web-identity.d.ts +49 -0
  849. package/dist/lib/constructs/web-identity.js +116 -0
  850. package/dist/lib/creds-stack.d.ts +151 -0
  851. package/dist/lib/creds-stack.js +592 -0
  852. package/dist/lib/data-stack.d.ts +53 -0
  853. package/dist/lib/data-stack.js +282 -0
  854. package/dist/lib/dimensions-validation.d.ts +20 -0
  855. package/dist/lib/dimensions-validation.js +51 -0
  856. package/dist/lib/federation.d.ts +113 -0
  857. package/dist/lib/federation.js +254 -0
  858. package/dist/lib/managed-login-branding.json +450 -0
  859. package/dist/lib/network-stack.d.ts +58 -0
  860. package/dist/lib/network-stack.js +776 -0
  861. package/dist/lib/network-validation.d.ts +54 -0
  862. package/dist/lib/network-validation.js +220 -0
  863. package/dist/lib/pkg-paths.d.ts +3 -0
  864. package/dist/lib/pkg-paths.js +51 -0
  865. package/dist/lib/plugins/plugin-api.d.ts +40 -0
  866. package/dist/lib/plugins/plugin-api.js +125 -0
  867. package/dist/lib/plugins/plugin-catalog-activation.d.ts +31 -0
  868. package/dist/lib/plugins/plugin-catalog-activation.js +109 -0
  869. package/dist/lib/plugins/registration.d.ts +41 -0
  870. package/dist/lib/plugins/registration.js +121 -0
  871. package/dist/lib/plugins/runtime.d.ts +10 -0
  872. package/dist/lib/plugins/runtime.js +17 -0
  873. package/dist/lib/project-config.d.ts +164 -0
  874. package/dist/lib/project-config.js +2 -0
  875. package/dist/lib/target-account-stack.d.ts +15 -0
  876. package/dist/lib/target-account-stack.js +59 -0
  877. package/dist/lib/target-account-template.d.ts +13 -0
  878. package/dist/lib/target-account-template.js +64 -0
  879. package/dist/lib/web-cert-stack.d.ts +30 -0
  880. package/dist/lib/web-cert-stack.js +90 -0
  881. package/dist/lib/web-stack.d.ts +103 -0
  882. package/dist/lib/web-stack.js +540 -0
  883. package/node_modules/@fntio/infra-client-plugin-sdk/README.md +303 -0
  884. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.d.ts +31 -0
  885. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.js +58 -0
  886. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.d.ts +9 -0
  887. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.js +26 -0
  888. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.d.ts +59 -0
  889. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.js +290 -0
  890. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.d.ts +14 -0
  891. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.js +32 -0
  892. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.d.ts +72 -0
  893. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.js +170 -0
  894. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.d.ts +11 -0
  895. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.js +28 -0
  896. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.d.ts +22 -0
  897. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.js +22 -0
  898. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.d.ts +14 -0
  899. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.js +41 -0
  900. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.d.ts +17 -0
  901. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.js +44 -0
  902. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.d.ts +2 -0
  903. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.js +21 -0
  904. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.d.ts +39 -0
  905. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.js +18 -0
  906. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.d.ts +78 -0
  907. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.js +48 -0
  908. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.d.ts +7 -0
  909. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.js +2 -0
  910. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.d.ts +59 -0
  911. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.js +19 -0
  912. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.d.ts +111 -0
  913. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.js +109 -0
  914. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.d.ts +20 -0
  915. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.js +49 -0
  916. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.d.ts +21 -0
  917. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.js +60 -0
  918. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.d.ts +14 -0
  919. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.js +10 -0
  920. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.d.ts +27 -0
  921. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.js +321 -0
  922. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.d.ts +61 -0
  923. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.js +99 -0
  924. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.d.ts +12 -0
  925. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.js +22 -0
  926. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.d.ts +22 -0
  927. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.js +46 -0
  928. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.d.ts +4 -0
  929. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.js +20 -0
  930. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.d.ts +37 -0
  931. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.js +228 -0
  932. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.d.ts +47 -0
  933. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.js +121 -0
  934. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.d.ts +5 -0
  935. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.js +22 -0
  936. package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.d.ts +10 -0
  937. package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.js +28 -0
  938. package/node_modules/@fntio/infra-client-plugin-sdk/package.json +99 -0
  939. package/openapi.yaml +4284 -0
  940. package/package.json +124 -4
@@ -0,0 +1,1995 @@
1
+ 'use strict';
2
+
3
+ var test = require('tape');
4
+ var qs = require('../');
5
+ var utils = require('../lib/utils');
6
+ var iconv = require('iconv-lite');
7
+ var SaferBuffer = require('safer-buffer').Buffer;
8
+ var hasSymbols = require('has-symbols');
9
+ var mockProperty = require('mock-property');
10
+ var emptyTestCases = require('./empty-keys-cases').emptyTestCases;
11
+ var hasProto = require('has-proto')();
12
+ var hasBigInt = require('has-bigints')();
13
+
14
+ test('stringify()', function (t) {
15
+ t.test('stringifies a querystring object', function (st) {
16
+ st.equal(qs.stringify({ a: 'b' }), 'a=b');
17
+ st.equal(qs.stringify({ a: 1 }), 'a=1');
18
+ st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');
19
+ st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');
20
+ st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');
21
+ st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');
22
+ st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');
23
+ st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');
24
+ st.end();
25
+ });
26
+
27
+ t.test('stringifies falsy values', function (st) {
28
+ st.equal(qs.stringify(undefined), '');
29
+ st.equal(qs.stringify(null), '');
30
+ st.equal(qs.stringify(null, { strictNullHandling: true }), '');
31
+ st.equal(qs.stringify(false), '');
32
+ st.equal(qs.stringify(0), '');
33
+ st.end();
34
+ });
35
+
36
+ t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) {
37
+ st.equal(qs.stringify(Symbol.iterator), '');
38
+ st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29');
39
+ st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29');
40
+ st.equal(
41
+ qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
42
+ 'a[]=Symbol%28Symbol.iterator%29'
43
+ );
44
+ st.end();
45
+ });
46
+
47
+ t.test('stringifies bigints', { skip: !hasBigInt }, function (st) {
48
+ var three = BigInt(3);
49
+ var encodeWithN = function (value, defaultEncoder, charset) {
50
+ var result = defaultEncoder(value, defaultEncoder, charset);
51
+ return typeof value === 'bigint' ? result + 'n' : result;
52
+ };
53
+ st.equal(qs.stringify(three), '');
54
+ st.equal(qs.stringify([three]), '0=3');
55
+ st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n');
56
+ st.equal(qs.stringify({ a: three }), 'a=3');
57
+ st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n');
58
+ st.equal(
59
+ qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
60
+ 'a[]=3'
61
+ );
62
+ st.equal(
63
+ qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }),
64
+ 'a[]=3n'
65
+ );
66
+ st.end();
67
+ });
68
+
69
+ t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) {
70
+ st.equal(
71
+ qs.stringify(
72
+ { 'name.obj': { first: 'John', last: 'Doe' } },
73
+ { allowDots: false, encodeDotInKeys: false }
74
+ ),
75
+ 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe',
76
+ 'with allowDots false and encodeDotInKeys false'
77
+ );
78
+ st.equal(
79
+ qs.stringify(
80
+ { 'name.obj': { first: 'John', last: 'Doe' } },
81
+ { allowDots: true, encodeDotInKeys: false }
82
+ ),
83
+ 'name.obj.first=John&name.obj.last=Doe',
84
+ 'with allowDots true and encodeDotInKeys false'
85
+ );
86
+ st.equal(
87
+ qs.stringify(
88
+ { 'name.obj': { first: 'John', last: 'Doe' } },
89
+ { allowDots: false, encodeDotInKeys: true }
90
+ ),
91
+ 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe',
92
+ 'with allowDots false and encodeDotInKeys true'
93
+ );
94
+ st.equal(
95
+ qs.stringify(
96
+ { 'name.obj': { first: 'John', last: 'Doe' } },
97
+ { allowDots: true, encodeDotInKeys: true }
98
+ ),
99
+ 'name%252Eobj.first=John&name%252Eobj.last=Doe',
100
+ 'with allowDots true and encodeDotInKeys true'
101
+ );
102
+
103
+ st.equal(
104
+ qs.stringify(
105
+ { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
106
+ { allowDots: false, encodeDotInKeys: false }
107
+ ),
108
+ 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe',
109
+ 'with allowDots false and encodeDotInKeys false'
110
+ );
111
+ st.equal(
112
+ qs.stringify(
113
+ { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
114
+ { allowDots: true, encodeDotInKeys: false }
115
+ ),
116
+ 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe',
117
+ 'with allowDots false and encodeDotInKeys false'
118
+ );
119
+ st.equal(
120
+ qs.stringify(
121
+ { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
122
+ { allowDots: false, encodeDotInKeys: true }
123
+ ),
124
+ 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe',
125
+ 'with allowDots false and encodeDotInKeys true'
126
+ );
127
+ st.equal(
128
+ qs.stringify(
129
+ { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
130
+ { allowDots: true, encodeDotInKeys: true }
131
+ ),
132
+ 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe',
133
+ 'with allowDots true and encodeDotInKeys true'
134
+ );
135
+
136
+ st.end();
137
+ });
138
+
139
+ t.test('encodes dot in key of object with a primitive value when encodeDotInKeys and allowDots is provided', function (st) {
140
+ st.equal(
141
+ qs.stringify(
142
+ { 'name.obj': 'John' },
143
+ { allowDots: true, encodeDotInKeys: true }
144
+ ),
145
+ 'name%252Eobj=John',
146
+ 'with allowDots true and encodeDotInKeys true'
147
+ );
148
+ st.equal(
149
+ qs.stringify(
150
+ { 'name.obj': 'John' },
151
+ { allowDots: false, encodeDotInKeys: true }
152
+ ),
153
+ 'name%252Eobj=John',
154
+ 'with allowDots false and encodeDotInKeys true'
155
+ );
156
+ st.equal(
157
+ qs.stringify(
158
+ { 'name.obj': 'John' },
159
+ { encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true }
160
+ ),
161
+ 'name%2Eobj=John',
162
+ 'with encodeValuesOnly true'
163
+ );
164
+
165
+ // With `encodeValuesOnly` the key encoder is skipped, so the dot is encoded once
166
+ // (`%2E`) rather than twice. That single `%2E` decodes back to a structural dot, so
167
+ // unlike the default output below this does not round-trip to the original dotted key
168
+ // (a pre-existing `encodeValuesOnly` + `encodeDotInKeys` limitation, not new here).
169
+ st.deepEqual(
170
+ qs.parse(
171
+ qs.stringify(
172
+ { 'name.obj': 'John' },
173
+ { encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true }
174
+ ),
175
+ { allowDots: true, decodeDotInKeys: true }
176
+ ),
177
+ { name: { obj: 'John' } },
178
+ 'with encodeValuesOnly the single-encoded dot decodes structurally (does not round-trip)'
179
+ );
180
+
181
+ st.deepEqual(
182
+ qs.parse(
183
+ qs.stringify({ 'name.obj': 'John' }, { allowDots: true, encodeDotInKeys: true }),
184
+ { allowDots: true, decodeDotInKeys: true }
185
+ ),
186
+ { 'name.obj': 'John' },
187
+ 'round-trips a dotted key with a primitive value'
188
+ );
189
+
190
+ st.equal(
191
+ qs.stringify({ 'a.b': null }, { allowDots: true, encodeDotInKeys: true, strictNullHandling: true }),
192
+ 'a%252Eb',
193
+ 'encodes a dotted key with a null value'
194
+ );
195
+ st.equal(
196
+ qs.stringify({ 'a.b': '1', 'c.d': '2' }, { allowDots: true, encodeDotInKeys: true }),
197
+ 'a%252Eb=1&c%252Ed=2',
198
+ 'encodes dots in every top-level key, not just the first'
199
+ );
200
+ st.equal(
201
+ qs.stringify({ 'a.b.c': 'x' }, { allowDots: true, encodeDotInKeys: true }),
202
+ 'a%252Eb%252Ec=x',
203
+ 'encodes every dot in a key'
204
+ );
205
+ var primitiveKey = qs.stringify({ 'a.b': 'c' }, { allowDots: true, encodeDotInKeys: true }).split('=')[0];
206
+ st.equal(
207
+ qs.stringify({ 'a.b': { x: 'c' } }, { allowDots: true, encodeDotInKeys: true }).indexOf(primitiveKey + '.'),
208
+ 0,
209
+ 'a top-level dotted key encodes identically for primitive and object values'
210
+ );
211
+
212
+ st.end();
213
+ });
214
+
215
+ t.test('does not encode the structural separator dots between nested keys when encodeDotInKeys and allowDots are provided', function (st) {
216
+ st.equal(
217
+ qs.stringify(
218
+ { a: { b: { c: 'd' } } },
219
+ { allowDots: true, encodeDotInKeys: true }
220
+ ),
221
+ 'a.b.c=d',
222
+ 'no key contains a literal dot, so encodeDotInKeys is a no-op on the separators'
223
+ );
224
+ st.equal(
225
+ qs.stringify(
226
+ { a: { b: { c: { d: 'e' } } } },
227
+ { allowDots: true, encodeDotInKeys: true }
228
+ ),
229
+ 'a.b.c.d=e',
230
+ 'every nesting separator is preserved, not just the last one'
231
+ );
232
+
233
+ st.deepEqual(
234
+ qs.parse(
235
+ qs.stringify({ a: { b: { c: 'd' } } }, { allowDots: true, encodeDotInKeys: true }),
236
+ { allowDots: true, decodeDotInKeys: true }
237
+ ),
238
+ { a: { b: { c: 'd' } } },
239
+ 'stringify -> parse round-trips a deeply nested object'
240
+ );
241
+
242
+ st.end();
243
+ });
244
+
245
+ t.test('encodeDotInKeys encodes only literal dots inside nested keys, never the structural separators, at any depth', function (st) {
246
+ st.equal(
247
+ qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
248
+ 'a.b%252Ec.d=e',
249
+ 'a nested key with a literal dot and an object value encodes only its own dot'
250
+ );
251
+ st.equal(
252
+ qs.stringify({ 'a.b': { c: { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
253
+ 'a%252Eb.c.d=e',
254
+ 'a top-level dotted key stays encoded while deeper separators stay literal'
255
+ );
256
+ st.equal(
257
+ qs.stringify({ a: { b: { 'c.d': { e: 'f' } } } }, { allowDots: true, encodeDotInKeys: true }),
258
+ 'a.b.c%252Ed.e=f',
259
+ 'a literal dot in a deeply nested key is encoded without touching the separators around it'
260
+ );
261
+
262
+ st.equal(
263
+ qs.stringify({ a: { b: [1, 2] } }, { allowDots: true, encodeDotInKeys: true }),
264
+ 'a.b%5B0%5D=1&a.b%5B1%5D=2',
265
+ 'separator dots are preserved for an array value nested under keys'
266
+ );
267
+ st.equal(
268
+ qs.stringify({ a: { 'b.c': [1, 2] } }, { allowDots: true, encodeDotInKeys: true }),
269
+ 'a.b%252Ec%5B0%5D=1&a.b%252Ec%5B1%5D=2',
270
+ 'a nested dotted key with an array value encodes only its own dot'
271
+ );
272
+
273
+ st.deepEqual(
274
+ qs.parse(
275
+ qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
276
+ { allowDots: true, decodeDotInKeys: true }
277
+ ),
278
+ { a: { 'b.c': { d: 'e' } } },
279
+ 'stringify -> parse round-trips a nested dotted key with an object value'
280
+ );
281
+ st.deepEqual(
282
+ qs.parse(
283
+ qs.stringify({ 'a.b': { c: { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
284
+ { allowDots: true, decodeDotInKeys: true }
285
+ ),
286
+ { 'a.b': { c: { d: 'e' } } },
287
+ 'stringify -> parse round-trips a top-level dotted key with deep nesting'
288
+ );
289
+
290
+ st.end();
291
+ });
292
+
293
+ t.test('with allowDots false, encodeDotInKeys leaves nested-key dots literal, consistently for object and primitive values', function (st) {
294
+ st.equal(
295
+ qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: false, encodeDotInKeys: true }),
296
+ 'a%5Bb.c%5D%5Bd%5D=e',
297
+ 'nested dotted key with an object value'
298
+ );
299
+ st.equal(
300
+ qs.stringify({ a: { 'b.c': 'e' } }, { allowDots: false, encodeDotInKeys: true }),
301
+ 'a%5Bb.c%5D=e',
302
+ 'nested dotted key with a primitive value matches the object-value case'
303
+ );
304
+
305
+ st.end();
306
+ });
307
+
308
+ t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) {
309
+ st.equal(
310
+ qs.stringify(
311
+ { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
312
+ { encodeDotInKeys: true }
313
+ ),
314
+ 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe',
315
+ 'with allowDots undefined and encodeDotInKeys true'
316
+ );
317
+ st.end();
318
+ });
319
+
320
+ t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) {
321
+ st.equal(
322
+ qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, {
323
+ encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true
324
+ }),
325
+ 'name%2Eobj.first=John&name%2Eobj.last=Doe'
326
+ );
327
+
328
+ st.equal(
329
+ qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }),
330
+ 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe'
331
+ );
332
+
333
+ st.end();
334
+ });
335
+
336
+ t.test('throws when `commaRoundTrip` is not a boolean', function (st) {
337
+ st['throws'](
338
+ function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); },
339
+ TypeError,
340
+ 'throws when `commaRoundTrip` is not a boolean'
341
+ );
342
+
343
+ st.end();
344
+ });
345
+
346
+ t.test('throws when `encodeDotInKeys` is not a boolean', function (st) {
347
+ st['throws'](
348
+ function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); },
349
+ TypeError
350
+ );
351
+
352
+ st['throws'](
353
+ function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); },
354
+ TypeError
355
+ );
356
+
357
+ st['throws'](
358
+ function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); },
359
+ TypeError
360
+ );
361
+
362
+ st['throws'](
363
+ function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); },
364
+ TypeError
365
+ );
366
+
367
+ st.end();
368
+ });
369
+
370
+ t.test('adds query prefix', function (st) {
371
+ st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
372
+ st.end();
373
+ });
374
+
375
+ t.test('with query prefix, outputs blank string given an empty object', function (st) {
376
+ st.equal(qs.stringify({}, { addQueryPrefix: true }), '');
377
+ st.end();
378
+ });
379
+
380
+ t.test('stringifies nested falsy values', function (st) {
381
+ st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D=');
382
+ st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D');
383
+ st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false');
384
+ st.end();
385
+ });
386
+
387
+ t.test('stringifies a nested object', function (st) {
388
+ st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
389
+ st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
390
+ st.end();
391
+ });
392
+
393
+ t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) {
394
+ st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
395
+ st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
396
+ st.end();
397
+ });
398
+
399
+ t.test('stringifies an array value', function (st) {
400
+ st.equal(
401
+ qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }),
402
+ 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
403
+ 'indices => indices'
404
+ );
405
+ st.equal(
406
+ qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }),
407
+ 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d',
408
+ 'brackets => brackets'
409
+ );
410
+ st.equal(
411
+ qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }),
412
+ 'a=b%2Cc%2Cd',
413
+ 'comma => comma'
414
+ );
415
+ st.equal(
416
+ qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }),
417
+ 'a=b%2Cc%2Cd',
418
+ 'comma round trip => comma'
419
+ );
420
+ st.equal(
421
+ qs.stringify({ a: ['b', 'c', 'd'] }),
422
+ 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
423
+ 'default => indices'
424
+ );
425
+ st.end();
426
+ });
427
+
428
+ t.test('ignores inherited array format names', function (st) {
429
+ var array = { a: ['b', 'c'] };
430
+ var indices = 'a%5B0%5D=b&a%5B1%5D=c';
431
+ var repeat = 'a=b&a=c';
432
+
433
+ st.equal(qs.stringify(array, { arrayFormat: 'unsupported' }), indices, 'unknown format falls back to `indices`');
434
+
435
+ var names = [
436
+ 'constructor',
437
+ 'toString',
438
+ '__proto__',
439
+ 'valueOf',
440
+ 'hasOwnProperty',
441
+ 'isPrototypeOf',
442
+ 'propertyIsEnumerable',
443
+ 'toLocaleString'
444
+ ];
445
+ for (var i = 0; i < names.length; i++) {
446
+ var name = names[i];
447
+ st.equal(qs.stringify(array, { arrayFormat: name }), indices, '`' + name + '` falls back to `indices`');
448
+ st.equal(
449
+ qs.stringify(array, { arrayFormat: name, indices: true }),
450
+ indices,
451
+ '`' + name + '` with `indices: true` falls back to `indices`'
452
+ );
453
+ st.equal(
454
+ qs.stringify(array, { arrayFormat: name, indices: false }),
455
+ repeat,
456
+ '`' + name + '` with `indices: false` falls back to `repeat`'
457
+ );
458
+ }
459
+
460
+ st.end();
461
+ });
462
+
463
+ t.test('`skipNulls` option', function (st) {
464
+ st.equal(
465
+ qs.stringify({ a: 'b', c: null }, { skipNulls: true }),
466
+ 'a=b',
467
+ 'omits nulls when asked'
468
+ );
469
+
470
+ st.equal(
471
+ qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }),
472
+ 'a%5Bb%5D=c',
473
+ 'omits nested nulls when asked'
474
+ );
475
+
476
+ st.end();
477
+ });
478
+
479
+ t.test('omits array indices when asked', function (st) {
480
+ st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');
481
+
482
+ st.end();
483
+ });
484
+
485
+ t.test('omits object key/value pair when value is empty array', function (st) {
486
+ st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz');
487
+
488
+ st.end();
489
+ });
490
+
491
+ t.test('should not omit object key/value pair when value is empty array and when asked', function (st) {
492
+ st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz');
493
+ st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz');
494
+ st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz');
495
+
496
+ st.end();
497
+ });
498
+
499
+ t.test('should throw when allowEmptyArrays is not of type boolean', function (st) {
500
+ st['throws'](
501
+ function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); },
502
+ TypeError
503
+ );
504
+
505
+ st['throws'](
506
+ function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); },
507
+ TypeError
508
+ );
509
+
510
+ st['throws'](
511
+ function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); },
512
+ TypeError
513
+ );
514
+
515
+ st['throws'](
516
+ function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); },
517
+ TypeError
518
+ );
519
+
520
+ st.end();
521
+ });
522
+
523
+ t.test('allowEmptyArrays + strictNullHandling', function (st) {
524
+ st.equal(
525
+ qs.stringify(
526
+ { testEmptyArray: [] },
527
+ { strictNullHandling: true, allowEmptyArrays: true }
528
+ ),
529
+ 'testEmptyArray[]'
530
+ );
531
+
532
+ st.end();
533
+ });
534
+
535
+ t.test('allowEmptyArrays only short-circuits arrays with no own keys', function (st) {
536
+ st.equal(
537
+ qs.stringify({ a: [] }, { allowEmptyArrays: true }),
538
+ 'a[]',
539
+ 'a genuinely empty array is still emitted as `[]`'
540
+ );
541
+
542
+ var withKey = [];
543
+ withKey.extra = 'x';
544
+ st.equal(
545
+ qs.stringify({ a: withKey }, { allowEmptyArrays: true }),
546
+ 'a%5Bextra%5D=x',
547
+ 'an own key on an empty array is serialized rather than dropped'
548
+ );
549
+ st.equal(
550
+ qs.stringify({ a: withKey }, { allowEmptyArrays: true }),
551
+ qs.stringify({ a: withKey }),
552
+ 'the allowEmptyArrays fast path matches the default path when the array has own keys'
553
+ );
554
+
555
+ var container = {};
556
+ var cyclic = [];
557
+ cyclic.back = container;
558
+ container.a = cyclic;
559
+ st['throws'](
560
+ function () { qs.stringify(container, { allowEmptyArrays: true }); },
561
+ RangeError,
562
+ 'a cycle through an empty array with an own key is still detected'
563
+ );
564
+
565
+ st.end();
566
+ });
567
+
568
+ t.test('stringifies an array value with one item vs multiple items', function (st) {
569
+ st.test('non-array item', function (s2t) {
570
+ s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c');
571
+ s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c');
572
+ s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
573
+ s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c');
574
+
575
+ s2t.end();
576
+ });
577
+
578
+ st.test('array with a single item', function (s2t) {
579
+ s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c');
580
+ s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c');
581
+ s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
582
+ s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array
583
+ s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c');
584
+
585
+ s2t.end();
586
+ });
587
+
588
+ st.test('array with multiple items', function (s2t) {
589
+ s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d');
590
+ s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d');
591
+ s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d');
592
+ s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d');
593
+ s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d');
594
+
595
+ s2t.end();
596
+ });
597
+
598
+ st.test('array with multiple items with a comma inside', function (s2t) {
599
+ s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e');
600
+ s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce');
601
+
602
+ s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e');
603
+ s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce');
604
+
605
+ s2t.end();
606
+ });
607
+
608
+ st.end();
609
+ });
610
+
611
+ t.test('stringifies a nested array value', function (st) {
612
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
613
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
614
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d');
615
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d');
616
+ st.end();
617
+ });
618
+
619
+ t.test('stringifies comma and empty array values', function (st) {
620
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%');
621
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%');
622
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%');
623
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%');
624
+
625
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25');
626
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25');
627
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25');
628
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25');
629
+
630
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25');
631
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25');
632
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25');
633
+ st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25');
634
+
635
+ st.end();
636
+ });
637
+
638
+ t.test('encodes comma array values with the same encoder arguments as other values, with encodeValuesOnly', function (st) {
639
+ var commaValuesOnly = { arrayFormat: 'comma', encodeValuesOnly: true };
640
+
641
+ st.equal(
642
+ qs.stringify({ a: ['é', 'x'], b: 'é' }, utils.assign({ charset: 'iso-8859-1' }, commaValuesOnly)),
643
+ 'a=%E9,x&b=%E9',
644
+ 'respects charset iso-8859-1'
645
+ );
646
+ st.deepEqual(
647
+ qs.parse(qs.stringify({ a: ['é', 'x'] }, utils.assign({ charset: 'iso-8859-1' }, commaValuesOnly)), { charset: 'iso-8859-1', comma: true }),
648
+ { a: ['é', 'x'] },
649
+ 'round-trips in iso-8859-1'
650
+ );
651
+ st.equal(
652
+ qs.stringify({ a: ['☺'] }, utils.assign({ charset: 'iso-8859-1' }, commaValuesOnly)),
653
+ 'a=%26%239786%3B',
654
+ 'encodes unrepresentable chars as numeric entities in iso-8859-1'
655
+ );
656
+ st.equal(
657
+ qs.stringify({ a: ['(x)', 'y z'], b: '(x)' }, utils.assign({ format: qs.formats.RFC1738 }, commaValuesOnly)),
658
+ 'a=(x),y+z&b=(x)',
659
+ 'respects format RFC1738'
660
+ );
661
+
662
+ var calls = [];
663
+ st.equal(
664
+ qs.stringify({ a: ['b', 'c'] }, utils.assign({
665
+ encoder: function (str, defaultEncoder, charset, kind, format) {
666
+ calls[calls.length] = [str, typeof defaultEncoder, charset, kind, format];
667
+ return defaultEncoder(str, defaultEncoder, charset, kind, format).toUpperCase();
668
+ }
669
+ }, commaValuesOnly)),
670
+ 'a=B,C',
671
+ 'a custom encoder can call defaultEncoder'
672
+ );
673
+ st.deepEqual(
674
+ calls,
675
+ [
676
+ ['b', 'function', 'utf-8', 'value', qs.formats.RFC3986],
677
+ ['c', 'function', 'utf-8', 'value', qs.formats.RFC3986]
678
+ ],
679
+ 'a custom encoder receives defaultEncoder, charset, kind, and format'
680
+ );
681
+
682
+ st.end();
683
+ });
684
+
685
+ t.test('stringifies comma and empty non-array values', function (st) {
686
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%');
687
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%');
688
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%');
689
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%');
690
+
691
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25');
692
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25');
693
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25');
694
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25');
695
+
696
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25');
697
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25');
698
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25');
699
+ st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25');
700
+
701
+ st.end();
702
+ });
703
+
704
+ t.test('stringifies a nested array value with dots notation', function (st) {
705
+ st.equal(
706
+ qs.stringify(
707
+ { a: { b: ['c', 'd'] } },
708
+ { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }
709
+ ),
710
+ 'a.b[0]=c&a.b[1]=d',
711
+ 'indices: stringifies with dots + indices'
712
+ );
713
+ st.equal(
714
+ qs.stringify(
715
+ { a: { b: ['c', 'd'] } },
716
+ { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }
717
+ ),
718
+ 'a.b[]=c&a.b[]=d',
719
+ 'brackets: stringifies with dots + brackets'
720
+ );
721
+ st.equal(
722
+ qs.stringify(
723
+ { a: { b: ['c', 'd'] } },
724
+ { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }
725
+ ),
726
+ 'a.b=c,d',
727
+ 'comma: stringifies with dots + comma'
728
+ );
729
+ st.equal(
730
+ qs.stringify(
731
+ { a: { b: ['c', 'd'] } },
732
+ { allowDots: true, encodeValuesOnly: true }
733
+ ),
734
+ 'a.b[0]=c&a.b[1]=d',
735
+ 'default: stringifies with dots + indices'
736
+ );
737
+ st.end();
738
+ });
739
+
740
+ t.test('stringifies an object inside an array', function (st) {
741
+ st.equal(
742
+ qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }),
743
+ 'a[0][b]=c',
744
+ 'indices => indices'
745
+ );
746
+ st.equal(
747
+ qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }),
748
+ 'a[b]=c',
749
+ 'repeat => repeat'
750
+ );
751
+ st.equal(
752
+ qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }),
753
+ 'a[][b]=c',
754
+ 'brackets => brackets'
755
+ );
756
+ st.equal(
757
+ qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }),
758
+ 'a[0][b]=c',
759
+ 'default => indices'
760
+ );
761
+
762
+ st.equal(
763
+ qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }),
764
+ 'a[0][b][c][0]=1',
765
+ 'indices => indices'
766
+ );
767
+ st.equal(
768
+ qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }),
769
+ 'a[b][c]=1',
770
+ 'repeat => repeat'
771
+ );
772
+ st.equal(
773
+ qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }),
774
+ 'a[][b][c][]=1',
775
+ 'brackets => brackets'
776
+ );
777
+ st.equal(
778
+ qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }),
779
+ 'a[0][b][c][0]=1',
780
+ 'default => indices'
781
+ );
782
+
783
+ st.end();
784
+ });
785
+
786
+ t.test('stringifies an array with mixed objects and primitives', function (st) {
787
+ st.equal(
788
+ qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
789
+ 'a[0][b]=1&a[1]=2&a[2]=3',
790
+ 'indices => indices'
791
+ );
792
+ st.equal(
793
+ qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
794
+ 'a[][b]=1&a[]=2&a[]=3',
795
+ 'brackets => brackets'
796
+ );
797
+ st.equal(
798
+ qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }),
799
+ '???',
800
+ 'brackets => brackets',
801
+ { skip: 'TODO: figure out what this should do' }
802
+ );
803
+ st.equal(
804
+ qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }),
805
+ 'a[0][b]=1&a[1]=2&a[2]=3',
806
+ 'default => indices'
807
+ );
808
+
809
+ st.end();
810
+ });
811
+
812
+ t.test('stringifies an object inside an array with dots notation', function (st) {
813
+ st.equal(
814
+ qs.stringify(
815
+ { a: [{ b: 'c' }] },
816
+ { allowDots: true, encode: false, arrayFormat: 'indices' }
817
+ ),
818
+ 'a[0].b=c',
819
+ 'indices => indices'
820
+ );
821
+ st.equal(
822
+ qs.stringify(
823
+ { a: [{ b: 'c' }] },
824
+ { allowDots: true, encode: false, arrayFormat: 'brackets' }
825
+ ),
826
+ 'a[].b=c',
827
+ 'brackets => brackets'
828
+ );
829
+ st.equal(
830
+ qs.stringify(
831
+ { a: [{ b: 'c' }] },
832
+ { allowDots: true, encode: false }
833
+ ),
834
+ 'a[0].b=c',
835
+ 'default => indices'
836
+ );
837
+
838
+ st.equal(
839
+ qs.stringify(
840
+ { a: [{ b: { c: [1] } }] },
841
+ { allowDots: true, encode: false, arrayFormat: 'indices' }
842
+ ),
843
+ 'a[0].b.c[0]=1',
844
+ 'indices => indices'
845
+ );
846
+ st.equal(
847
+ qs.stringify(
848
+ { a: [{ b: { c: [1] } }] },
849
+ { allowDots: true, encode: false, arrayFormat: 'brackets' }
850
+ ),
851
+ 'a[].b.c[]=1',
852
+ 'brackets => brackets'
853
+ );
854
+ st.equal(
855
+ qs.stringify(
856
+ { a: [{ b: { c: [1] } }] },
857
+ { allowDots: true, encode: false }
858
+ ),
859
+ 'a[0].b.c[0]=1',
860
+ 'default => indices'
861
+ );
862
+
863
+ st.end();
864
+ });
865
+
866
+ t.test('does not omit object keys when indices = false', function (st) {
867
+ st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
868
+ st.end();
869
+ });
870
+
871
+ t.test('uses indices notation for arrays when indices=true', function (st) {
872
+ st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');
873
+ st.end();
874
+ });
875
+
876
+ t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {
877
+ st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');
878
+ st.end();
879
+ });
880
+
881
+ t.test('uses indices notation for arrays when arrayFormat=indices', function (st) {
882
+ st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');
883
+ st.end();
884
+ });
885
+
886
+ t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) {
887
+ st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');
888
+ st.end();
889
+ });
890
+
891
+ t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) {
892
+ st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');
893
+ st.end();
894
+ });
895
+
896
+ t.test('stringifies a complicated object', function (st) {
897
+ st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');
898
+ st.end();
899
+ });
900
+
901
+ t.test('stringifies an empty value', function (st) {
902
+ st.equal(qs.stringify({ a: '' }), 'a=');
903
+ st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');
904
+
905
+ st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');
906
+ st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');
907
+
908
+ st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');
909
+ st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');
910
+ st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');
911
+
912
+ st.end();
913
+ });
914
+
915
+ t.test('stringifies an empty array in different arrayFormat', function (st) {
916
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c');
917
+ // arrayFormat default
918
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c');
919
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c');
920
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c');
921
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c');
922
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c');
923
+ // with strictNullHandling
924
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c');
925
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c');
926
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c');
927
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c');
928
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c');
929
+ // with skipNulls
930
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c');
931
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c');
932
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c');
933
+ st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c');
934
+
935
+ st.end();
936
+ });
937
+
938
+ t.test('does not crash on null/undefined entries in arrayFormat=comma with encodeValuesOnly', function (st) {
939
+ st.doesNotThrow(
940
+ function () { qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
941
+ 'does not pass a raw null array entry to the encoder'
942
+ );
943
+ st.doesNotThrow(
944
+ function () { qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
945
+ 'does not pass a raw undefined array entry to the encoder'
946
+ );
947
+ st.doesNotThrow(
948
+ function () { qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
949
+ 'does not crash on a single-null array'
950
+ );
951
+
952
+ st.equal(
953
+ qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
954
+ 'a=,b',
955
+ 'null entry joins as empty, comma stays unencoded under encodeValuesOnly'
956
+ );
957
+ st.equal(
958
+ qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
959
+ 'a=,b',
960
+ 'undefined entry joins as empty, comma stays unencoded under encodeValuesOnly'
961
+ );
962
+ st.equal(
963
+ qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
964
+ 'a=',
965
+ 'single-null array stringifies as empty value'
966
+ );
967
+ st.equal(
968
+ qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, strictNullHandling: true }),
969
+ 'a',
970
+ 'strictNullHandling drops the equals sign for a single-null array'
971
+ );
972
+ st.equal(
973
+ qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, skipNulls: true }),
974
+ '',
975
+ 'skipNulls drops a single-null array entirely'
976
+ );
977
+
978
+ st.end();
979
+ });
980
+
981
+ t.test('arrayFormat=comma: does not crash on entries with no callable `toString`', function (st) {
982
+ var json = JSON.parse('{ "a": ["b", { "toString": "x" }, "c"] }');
983
+ st.equal(qs.stringify(json, { arrayFormat: 'comma' }), 'a=b%2C%5Bobject%20Object%5D%2Cc', 'JSON own `toString`');
984
+ st.equal(qs.stringify(json, { arrayFormat: 'comma', encode: false }), 'a=b,[object Object],c', 'with encode: false');
985
+ st.equal(
986
+ qs.stringify(json, { arrayFormat: 'comma', encodeValuesOnly: true }),
987
+ 'a=b,%5Bobject%20Object%5D,c',
988
+ 'with encodeValuesOnly'
989
+ );
990
+ st.equal(
991
+ qs.stringify(JSON.parse('{ "a": [{ "toString": "x" }] }'), { arrayFormat: 'comma', commaRoundTrip: true }),
992
+ 'a%5B%5D=%5Bobject%20Object%5D',
993
+ 'with commaRoundTrip'
994
+ );
995
+ st.equal(
996
+ qs.stringify(JSON.parse('{ "a": [{ "toString": "x" }] }'), { arrayFormat: 'comma' }),
997
+ qs.stringify({ a: [{ b: 1 }] }, { arrayFormat: 'comma' }),
998
+ 'renders the same as a plain object entry'
999
+ );
1000
+
1001
+ st.equal(
1002
+ qs.stringify(qs.parse('a[][b]=c', { plainObjects: true }), { arrayFormat: 'comma' }),
1003
+ 'a=%5Bobject%20Object%5D',
1004
+ 'null-prototype entry from `parse` with plainObjects'
1005
+ );
1006
+ st.equal(
1007
+ qs.stringify(qs.parse('a[][b]=c', { plainObjects: true }), { arrayFormat: 'comma', encodeValuesOnly: true }),
1008
+ 'a=%5Bobject%20Object%5D',
1009
+ 'null-prototype entry from `parse` with plainObjects, with encodeValuesOnly'
1010
+ );
1011
+ st.equal(
1012
+ qs.stringify(qs.parse('a[0][toString]=x', { allowPrototypes: true }), { arrayFormat: 'comma' }),
1013
+ 'a=%5Bobject%20Object%5D',
1014
+ 'own `toString` entry from `parse` with allowPrototypes'
1015
+ );
1016
+
1017
+ var nested = JSON.parse('{ "a": [[1, [{ "toString": "x" }]], "y"] }');
1018
+ st.equal(qs.stringify(nested, { arrayFormat: 'comma', encode: false }), 'a=1,[object Object],y', 'nested array');
1019
+ st.equal(
1020
+ qs.stringify(nested, { arrayFormat: 'comma', encodeValuesOnly: true }),
1021
+ 'a=1%2C%5Bobject%20Object%5D,y',
1022
+ 'nested array, with encodeValuesOnly'
1023
+ );
1024
+ st.equal(qs.stringify({ a: [[1, 2], 3] }, { arrayFormat: 'comma', encode: false }), 'a=1,2,3', 'nested array is still flattened');
1025
+
1026
+ var cyclic = [{ toString: 'x' }];
1027
+ cyclic[cyclic.length] = cyclic;
1028
+ st.equal(
1029
+ qs.stringify({ a: cyclic }, { arrayFormat: 'comma', encode: false }),
1030
+ 'a=[object Object],[object Object],',
1031
+ 'cyclic nested array joins its cycle as empty'
1032
+ );
1033
+
1034
+ var customJoin = [{ toString: 'x' }];
1035
+ customJoin.join = function () { return 'j'; };
1036
+ st.equal(qs.stringify({ a: [customJoin, 'y'] }, { arrayFormat: 'comma', encode: false }), 'a=j,y', 'own `join` is still used');
1037
+
1038
+ st.equal(
1039
+ qs.stringify({ a: [{ toString: 'x', valueOf: function () { return 7; } }] }, { arrayFormat: 'comma' }),
1040
+ 'a=7',
1041
+ 'primitive `valueOf` is still used'
1042
+ );
1043
+ st.equal(
1044
+ qs.stringify({ a: [{ toString: 'x', valueOf: function () { return null; } }] }, { arrayFormat: 'comma' }),
1045
+ 'a=null',
1046
+ 'null `valueOf` is still used'
1047
+ );
1048
+ st.equal(
1049
+ qs.stringify({ a: [{ toString: 'x', valueOf: function () { return {}; } }] }, { arrayFormat: 'comma' }),
1050
+ 'a=%5Bobject%20Object%5D',
1051
+ 'non-primitive `valueOf` falls back'
1052
+ );
1053
+
1054
+ st.equal(
1055
+ qs.stringify({ a: [{ toString: function () { return 't'; } }, new Date(0)] }, { arrayFormat: 'comma', encode: false }),
1056
+ 'a=t,1970-01-01T00:00:00.000Z',
1057
+ 'callable `toString` and dates are unaffected'
1058
+ );
1059
+
1060
+ st['throws'](
1061
+ function () {
1062
+ qs.stringify({ a: [{ toString: function () { throw new SyntaxError('mine'); } }] }, { arrayFormat: 'comma' });
1063
+ },
1064
+ SyntaxError,
1065
+ 'a throwing `toString` still throws'
1066
+ );
1067
+ st['throws'](
1068
+ function () {
1069
+ qs.stringify({ a: [{ toString: 'x', valueOf: function () { throw new EvalError('mine'); } }] }, { arrayFormat: 'comma' });
1070
+ },
1071
+ EvalError,
1072
+ 'a throwing `valueOf` still throws'
1073
+ );
1074
+
1075
+ st.end();
1076
+ });
1077
+
1078
+ t.test('arrayFormat=comma: entries with `Symbol.toPrimitive` are unaffected', { skip: !hasSymbols() || typeof Symbol.toPrimitive !== 'symbol' }, function (st) {
1079
+ var entry = { toString: 'x' };
1080
+ entry[Symbol.toPrimitive] = function () { return 'p'; };
1081
+ st.equal(qs.stringify({ a: [entry] }, { arrayFormat: 'comma' }), 'a=p');
1082
+ st.equal(qs.stringify({ a: [entry] }, { arrayFormat: 'comma', encodeValuesOnly: true }), 'a=p');
1083
+
1084
+ st.end();
1085
+ });
1086
+
1087
+ t.test('stringifies a null object', { skip: !hasProto }, function (st) {
1088
+ st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b');
1089
+ st.end();
1090
+ });
1091
+
1092
+ t.test('returns an empty string for invalid input', function (st) {
1093
+ st.equal(qs.stringify(undefined), '');
1094
+ st.equal(qs.stringify(false), '');
1095
+ st.equal(qs.stringify(null), '');
1096
+ st.equal(qs.stringify(''), '');
1097
+ st.end();
1098
+ });
1099
+
1100
+ t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) {
1101
+ st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c');
1102
+ st.end();
1103
+ });
1104
+
1105
+ t.test('drops keys with a value of undefined', function (st) {
1106
+ st.equal(qs.stringify({ a: undefined }), '');
1107
+
1108
+ st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');
1109
+ st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');
1110
+ st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');
1111
+ st.end();
1112
+ });
1113
+
1114
+ t.test('url encodes values', function (st) {
1115
+ st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
1116
+ st.end();
1117
+ });
1118
+
1119
+ t.test('stringifies a date', function (st) {
1120
+ var now = new Date();
1121
+ var str = 'a=' + encodeURIComponent(now.toISOString());
1122
+ st.equal(qs.stringify({ a: now }), str);
1123
+ st.end();
1124
+ });
1125
+
1126
+ t.test('stringifies the weird object from qs', function (st) {
1127
+ st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
1128
+ st.end();
1129
+ });
1130
+
1131
+ t.test('skips properties that are part of the object prototype', function (st) {
1132
+ st.intercept(Object.prototype, 'crash', { value: 'test' });
1133
+
1134
+ st.equal(qs.stringify({ a: 'b' }), 'a=b');
1135
+ st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
1136
+
1137
+ st.end();
1138
+ });
1139
+
1140
+ t.test('stringifies boolean values', function (st) {
1141
+ st.equal(qs.stringify({ a: true }), 'a=true');
1142
+ st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');
1143
+ st.equal(qs.stringify({ b: false }), 'b=false');
1144
+ st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');
1145
+ st.end();
1146
+ });
1147
+
1148
+ t.test('stringifies buffer values', function (st) {
1149
+ st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test');
1150
+ st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test');
1151
+ st.end();
1152
+ });
1153
+
1154
+ t.test('does not throw on a non-callable `constructor.isBuffer` key', function (st) {
1155
+ var input = { a: { constructor: { isBuffer: 'x' } } };
1156
+ st.doesNotThrow(function () { qs.stringify(input); });
1157
+ st.equal(qs.stringify(input), 'a%5Bconstructor%5D%5BisBuffer%5D=x');
1158
+ st.equal(qs.stringify({ a: { constructor: { isBuffer: { b: 'c' } } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5Bb%5D=c');
1159
+ st.equal(qs.stringify({ a: { constructor: { isBuffer: ['b'] } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5B0%5D=b');
1160
+ st.equal(qs.stringify({ a: { constructor: { isBuffer: true } } }), 'a%5Bconstructor%5D%5BisBuffer%5D=true');
1161
+ st.end();
1162
+ });
1163
+
1164
+ t.test('round-trips a parsed `constructor[isBuffer]` key', function (st) {
1165
+ var str = 'x%5Bconstructor%5D%5BisBuffer%5D=y';
1166
+
1167
+ var plain = qs.parse(str, { plainObjects: true });
1168
+ st.deepEqual(plain, { __proto__: null, x: { __proto__: null, constructor: { __proto__: null, isBuffer: 'y' } } }, 'plainObjects keeps the key');
1169
+ st.doesNotThrow(function () { qs.stringify(plain); });
1170
+ st.equal(qs.stringify(plain), str, 'plainObjects round-trips');
1171
+
1172
+ var proto = qs.parse(str, { allowPrototypes: true });
1173
+ st.deepEqual(proto, { x: { constructor: { isBuffer: 'y' } } }, 'allowPrototypes keeps the key');
1174
+ st.doesNotThrow(function () { qs.stringify(proto); });
1175
+ st.equal(qs.stringify(proto), str, 'allowPrototypes round-trips');
1176
+
1177
+ st.equal(qs.stringify(qs.parse(str)), '', 'default options drop the key');
1178
+ st.end();
1179
+ });
1180
+
1181
+ t.test('stringifies an object using an alternative delimiter', function (st) {
1182
+ st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
1183
+ st.end();
1184
+ });
1185
+
1186
+ t.test('does not blow up when Buffer global is missing', function (st) {
1187
+ var restore = mockProperty(global, 'Buffer', { 'delete': true });
1188
+
1189
+ var result = qs.stringify({ a: 'b', c: 'd' });
1190
+
1191
+ restore();
1192
+
1193
+ st.equal(result, 'a=b&c=d');
1194
+ st.end();
1195
+ });
1196
+
1197
+ t.test('does not crash when parsing circular references', function (st) {
1198
+ var a = {};
1199
+ a.b = a;
1200
+
1201
+ st['throws'](
1202
+ function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); },
1203
+ /RangeError: Cyclic object value/,
1204
+ 'cyclic values throw'
1205
+ );
1206
+
1207
+ var circular = {
1208
+ a: 'value'
1209
+ };
1210
+ circular.a = circular;
1211
+ st['throws'](
1212
+ function () { qs.stringify(circular); },
1213
+ /RangeError: Cyclic object value/,
1214
+ 'cyclic values throw'
1215
+ );
1216
+
1217
+ var arr = ['a'];
1218
+ st.doesNotThrow(
1219
+ function () { qs.stringify({ x: arr, y: arr }); },
1220
+ 'non-cyclic values do not throw'
1221
+ );
1222
+
1223
+ st.end();
1224
+ });
1225
+
1226
+ t.test('non-circular duplicated references can still work', function (st) {
1227
+ var hourOfDay = {
1228
+ 'function': 'hour_of_day'
1229
+ };
1230
+
1231
+ var p1 = {
1232
+ 'function': 'gte',
1233
+ arguments: [hourOfDay, 0]
1234
+ };
1235
+ var p2 = {
1236
+ 'function': 'lte',
1237
+ arguments: [hourOfDay, 23]
1238
+ };
1239
+
1240
+ st.equal(
1241
+ qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
1242
+ 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23'
1243
+ );
1244
+ st.equal(
1245
+ qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
1246
+ 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23'
1247
+ );
1248
+ st.equal(
1249
+ qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }),
1250
+ 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23'
1251
+ );
1252
+
1253
+ st.end();
1254
+ });
1255
+
1256
+ t.test('selects properties when filter=array', function (st) {
1257
+ st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
1258
+ st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
1259
+
1260
+ st.equal(
1261
+ qs.stringify(
1262
+ { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
1263
+ { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }
1264
+ ),
1265
+ 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
1266
+ 'indices => indices'
1267
+ );
1268
+ st.equal(
1269
+ qs.stringify(
1270
+ { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
1271
+ { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }
1272
+ ),
1273
+ 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3',
1274
+ 'brackets => brackets'
1275
+ );
1276
+ st.equal(
1277
+ qs.stringify(
1278
+ { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
1279
+ { filter: ['a', 'b', 0, 2] }
1280
+ ),
1281
+ 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
1282
+ 'default => indices'
1283
+ );
1284
+
1285
+ st.end();
1286
+ });
1287
+
1288
+ t.test('skips null/undefined entries in filter=array', function (st) {
1289
+ st.doesNotThrow(
1290
+ function () { qs.stringify({ a: 'b', undefined: 'x' }, { filter: ['a', undefined] }); },
1291
+ 'does not pass a raw undefined filter entry to the encoder'
1292
+ );
1293
+ st.doesNotThrow(
1294
+ function () { qs.stringify({ a: 'b', 'null': 'x' }, { filter: ['a', null] }); },
1295
+ 'does not pass a raw null filter entry to the encoder'
1296
+ );
1297
+
1298
+ st.equal(
1299
+ qs.stringify({ a: 'b', undefined: 'x', c: 'd' }, { filter: ['a', undefined, 'c'] }),
1300
+ 'a=b&c=d',
1301
+ 'undefined filter entry is skipped, remaining keys are kept'
1302
+ );
1303
+ st.equal(
1304
+ qs.stringify({ a: 'b', 'null': 'x', c: 'd' }, { filter: ['a', null, 'c'] }),
1305
+ 'a=b&c=d',
1306
+ 'null filter entry is skipped, remaining keys are kept'
1307
+ );
1308
+ st.equal(
1309
+ qs.stringify({ a: 'b', 'null': 'x' }, { filter: [null] }),
1310
+ '',
1311
+ 'filter array containing only null yields empty string'
1312
+ );
1313
+
1314
+ st.end();
1315
+ });
1316
+
1317
+ t.test('supports custom representations when filter=function', function (st) {
1318
+ var calls = 0;
1319
+ var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
1320
+ var filterFunc = function (prefix, value) {
1321
+ calls += 1;
1322
+ if (calls === 1) {
1323
+ st.equal(prefix, '', 'prefix is empty');
1324
+ st.equal(value, obj);
1325
+ } else if (prefix === 'c') {
1326
+ return void 0;
1327
+ } else if (value instanceof Date) {
1328
+ st.equal(prefix, 'e[f]');
1329
+ return value.getTime();
1330
+ }
1331
+ return value;
1332
+ };
1333
+
1334
+ st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');
1335
+ st.equal(calls, 5);
1336
+ st.end();
1337
+ });
1338
+
1339
+ t.test('serializes Date values unless filter transforms them', function (st) {
1340
+ var obj = {
1341
+ a: new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260)),
1342
+ b: [new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260))]
1343
+ };
1344
+ var iso = '2023-03-07T09%3A02%3A41.260Z';
1345
+ st.equal(
1346
+ qs.stringify(obj, { filter: function (prefix, value) { return value; } }),
1347
+ 'a=' + iso + '&b%5B0%5D=' + iso,
1348
+ 'Dates returned unchanged by a filter are serialized'
1349
+ );
1350
+ st.equal(
1351
+ qs.stringify({ a: new Date(0) }, { filter: function (prefix, value) { return value instanceof Date ? 'kept' : value; } }),
1352
+ 'a=kept',
1353
+ 'a filter that transforms a Date wins over default serialization'
1354
+ );
1355
+ st.end();
1356
+ });
1357
+
1358
+ t.test('applies default Date handling to whatever a filter function returns', function (st) {
1359
+ var date = new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260));
1360
+ var iso = '2023-03-07T09%3A02%3A41.260Z';
1361
+ var identity = function (prefix, value) { return value; };
1362
+
1363
+ st.equal(
1364
+ qs.stringify({ a: { b: date } }, { filter: identity }),
1365
+ 'a%5Bb%5D=' + iso,
1366
+ 'a nested Date is serialized through a filter'
1367
+ );
1368
+ st.equal(
1369
+ qs.stringify(
1370
+ { a: date },
1371
+ { filter: identity, serializeDate: function (d) { return String(d.getTime()); } }
1372
+ ),
1373
+ 'a=1678179761260',
1374
+ '`serializeDate` is honored after a filter'
1375
+ );
1376
+ st.equal(
1377
+ qs.stringify({ a: [date, 'x'] }, { filter: identity, arrayFormat: 'comma' }),
1378
+ 'a=' + iso + '%2Cx',
1379
+ 'Dates inside a comma array are serialized through a filter, not stringified as locale text'
1380
+ );
1381
+ st.equal(
1382
+ qs.stringify({ a: 'x' }, { filter: function (prefix, value) { return prefix === 'a' ? date : value; } }),
1383
+ 'a=' + iso,
1384
+ 'a Date produced by the filter is serialized'
1385
+ );
1386
+ st.equal(
1387
+ qs.stringify({ a: date, b: 1 }, { filter: ['a'] }),
1388
+ 'a=' + iso,
1389
+ 'an array filter still serializes Dates'
1390
+ );
1391
+ st['throws'](
1392
+ function () { qs.stringify({ a: new Date(NaN) }, { filter: identity }); },
1393
+ RangeError,
1394
+ 'an invalid Date through a filter throws like the no-filter path'
1395
+ );
1396
+ st.end();
1397
+ });
1398
+
1399
+ t.test('can disable uri encoding', function (st) {
1400
+ st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
1401
+ st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
1402
+ st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');
1403
+ st.end();
1404
+ });
1405
+
1406
+ t.test('can sort the keys', function (st) {
1407
+ var sort = function (a, b) {
1408
+ return a.localeCompare(b);
1409
+ };
1410
+ st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');
1411
+ st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
1412
+ st.end();
1413
+ });
1414
+
1415
+ t.test('can sort the keys at depth 3 or more too', function (st) {
1416
+ var sort = function (a, b) {
1417
+ return a.localeCompare(b);
1418
+ };
1419
+ st.equal(
1420
+ qs.stringify(
1421
+ { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
1422
+ { sort: sort, encode: false }
1423
+ ),
1424
+ 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'
1425
+ );
1426
+ st.equal(
1427
+ qs.stringify(
1428
+ { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
1429
+ { sort: null, encode: false }
1430
+ ),
1431
+ 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'
1432
+ );
1433
+ st.end();
1434
+ });
1435
+
1436
+ t.test('can stringify with custom encoding', function (st) {
1437
+ st.equal(qs.stringify({ 県: '大阪府', '': '' }, {
1438
+ encoder: function (str) {
1439
+ if (str.length === 0) {
1440
+ return '';
1441
+ }
1442
+ var buf = iconv.encode(str, 'shiftjis');
1443
+ var result = [];
1444
+ for (var i = 0; i < buf.length; ++i) {
1445
+ result.push(buf.readUInt8(i).toString(16));
1446
+ }
1447
+ return '%' + result.join('%');
1448
+ }
1449
+ }), '%8c%a7=%91%e5%8d%e3%95%7b&=');
1450
+ st.end();
1451
+ });
1452
+
1453
+ t.test('receives the default encoder as a second argument', function (st) {
1454
+ st.plan(8);
1455
+
1456
+ qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, {
1457
+ encoder: function (str) {
1458
+ st.match(typeof str, /^(?:string|number|boolean)$/);
1459
+ return '';
1460
+ }
1461
+ });
1462
+
1463
+ st.end();
1464
+ });
1465
+
1466
+ t.test('receives the default encoder as a second argument', function (st) {
1467
+ st.plan(2);
1468
+
1469
+ qs.stringify({ a: 1 }, {
1470
+ encoder: function (str, defaultEncoder) {
1471
+ st.equal(defaultEncoder, utils.encode);
1472
+ }
1473
+ });
1474
+
1475
+ st.end();
1476
+ });
1477
+
1478
+ t.test('throws error with wrong encoder', function (st) {
1479
+ st['throws'](function () {
1480
+ qs.stringify({}, { encoder: 'string' });
1481
+ }, new TypeError('Encoder has to be a function.'));
1482
+ st.end();
1483
+ });
1484
+
1485
+ t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) {
1486
+ st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, {
1487
+ encoder: function (buffer) {
1488
+ if (typeof buffer === 'string') {
1489
+ return buffer;
1490
+ }
1491
+ return String.fromCharCode(buffer.readUInt8(0) + 97);
1492
+ }
1493
+ }), 'a=b');
1494
+
1495
+ st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, {
1496
+ encoder: function (buffer) {
1497
+ return buffer;
1498
+ }
1499
+ }), 'a=a b');
1500
+ st.end();
1501
+ });
1502
+
1503
+ t.test('serializeDate option', function (st) {
1504
+ var date = new Date();
1505
+ st.equal(
1506
+ qs.stringify({ a: date }),
1507
+ 'a=' + date.toISOString().replace(/:/g, '%3A'),
1508
+ 'default is toISOString'
1509
+ );
1510
+
1511
+ var mutatedDate = new Date();
1512
+ mutatedDate.toISOString = function () {
1513
+ throw new SyntaxError();
1514
+ };
1515
+ st['throws'](function () {
1516
+ mutatedDate.toISOString();
1517
+ }, SyntaxError);
1518
+ st.equal(
1519
+ qs.stringify({ a: mutatedDate }),
1520
+ 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'),
1521
+ 'toISOString works even when method is not locally present'
1522
+ );
1523
+
1524
+ var specificDate = new Date(6);
1525
+ st.equal(
1526
+ qs.stringify(
1527
+ { a: specificDate },
1528
+ { serializeDate: function (d) { return d.getTime() * 7; } }
1529
+ ),
1530
+ 'a=42',
1531
+ 'custom serializeDate function called'
1532
+ );
1533
+
1534
+ st.equal(
1535
+ qs.stringify(
1536
+ { a: [date] },
1537
+ {
1538
+ serializeDate: function (d) { return d.getTime(); },
1539
+ arrayFormat: 'comma'
1540
+ }
1541
+ ),
1542
+ 'a=' + date.getTime(),
1543
+ 'works with arrayFormat comma'
1544
+ );
1545
+ st.equal(
1546
+ qs.stringify(
1547
+ { a: [date] },
1548
+ {
1549
+ serializeDate: function (d) { return d.getTime(); },
1550
+ arrayFormat: 'comma',
1551
+ commaRoundTrip: true
1552
+ }
1553
+ ),
1554
+ 'a%5B%5D=' + date.getTime(),
1555
+ 'works with arrayFormat comma'
1556
+ );
1557
+
1558
+ st.end();
1559
+ });
1560
+
1561
+ t.test('RFC 1738 serialization', function (st) {
1562
+ st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
1563
+ st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
1564
+ st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');
1565
+
1566
+ st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar');
1567
+
1568
+ st.end();
1569
+ });
1570
+
1571
+ t.test('RFC 3986 spaces serialization', function (st) {
1572
+ st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
1573
+ st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
1574
+ st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b');
1575
+
1576
+ st.end();
1577
+ });
1578
+
1579
+ t.test('Backward compatibility to RFC 3986', function (st) {
1580
+ st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
1581
+ st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b');
1582
+
1583
+ st.end();
1584
+ });
1585
+
1586
+ t.test('Edge cases and unknown formats', function (st) {
1587
+ ['UFO1234', false, 1234, null, {}, []].forEach(function (format) {
1588
+ st['throws'](
1589
+ function () {
1590
+ qs.stringify({ a: 'b c' }, { format: format });
1591
+ },
1592
+ new TypeError('Unknown format option provided.')
1593
+ );
1594
+ });
1595
+ st.end();
1596
+ });
1597
+
1598
+ t.test('encodeValuesOnly', function (st) {
1599
+ st.equal(
1600
+ qs.stringify(
1601
+ { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
1602
+ { encodeValuesOnly: true, arrayFormat: 'indices' }
1603
+ ),
1604
+ 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h',
1605
+ 'encodeValuesOnly + indices'
1606
+ );
1607
+ st.equal(
1608
+ qs.stringify(
1609
+ { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
1610
+ { encodeValuesOnly: true, arrayFormat: 'brackets' }
1611
+ ),
1612
+ 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h',
1613
+ 'encodeValuesOnly + brackets'
1614
+ );
1615
+ st.equal(
1616
+ qs.stringify(
1617
+ { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
1618
+ { encodeValuesOnly: true, arrayFormat: 'repeat' }
1619
+ ),
1620
+ 'a=b&c=d&c=e%3Df&f=g&f=h',
1621
+ 'encodeValuesOnly + repeat'
1622
+ );
1623
+
1624
+ st.equal(
1625
+ qs.stringify(
1626
+ { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] },
1627
+ { arrayFormat: 'indices' }
1628
+ ),
1629
+ 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h',
1630
+ 'no encodeValuesOnly + indices'
1631
+ );
1632
+ st.equal(
1633
+ qs.stringify(
1634
+ { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] },
1635
+ { arrayFormat: 'brackets' }
1636
+ ),
1637
+ 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h',
1638
+ 'no encodeValuesOnly + brackets'
1639
+ );
1640
+ st.equal(
1641
+ qs.stringify(
1642
+ { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] },
1643
+ { arrayFormat: 'repeat' }
1644
+ ),
1645
+ 'a=b&c=d&c=e&f=g&f=h',
1646
+ 'no encodeValuesOnly + repeat'
1647
+ );
1648
+
1649
+ st.end();
1650
+ });
1651
+
1652
+ t.test('encodeValuesOnly - strictNullHandling', function (st) {
1653
+ st.equal(
1654
+ qs.stringify(
1655
+ { a: { b: null } },
1656
+ { encodeValuesOnly: true, strictNullHandling: true }
1657
+ ),
1658
+ 'a[b]'
1659
+ );
1660
+ st.end();
1661
+ });
1662
+
1663
+ t.test('strictNullHandling: applies the formatter to the encoded key (RFC1738)', function (st) {
1664
+ st.equal(
1665
+ qs.stringify(
1666
+ { 'a b': null, 'c d': 'e f' },
1667
+ { strictNullHandling: false, format: 'RFC1738' }
1668
+ ),
1669
+ 'a+b=&c+d=e+f',
1670
+ 'without: as expected'
1671
+ );
1672
+
1673
+ st.equal(
1674
+ qs.stringify(
1675
+ { 'a b': null, 'c d': 'e f' },
1676
+ { strictNullHandling: true, format: 'RFC1738' }
1677
+ ),
1678
+ 'a+b&c+d=e+f',
1679
+ 'with: as expected'
1680
+ );
1681
+
1682
+ st.end();
1683
+ });
1684
+
1685
+ t.test('throws if an invalid charset is specified', function (st) {
1686
+ st['throws'](function () {
1687
+ qs.stringify({ a: 'b' }, { charset: 'foobar' });
1688
+ }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));
1689
+ st.end();
1690
+ });
1691
+
1692
+ t.test('respects a charset of iso-8859-1', function (st) {
1693
+ st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6');
1694
+ st.end();
1695
+ });
1696
+
1697
+ t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) {
1698
+ st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B');
1699
+ st.end();
1700
+ });
1701
+
1702
+ t.test('encodes a literal `+` as `%2B` in iso-8859-1 mode so it round-trips', function (st) {
1703
+ st.equal(qs.stringify({ a: 'b+c' }, { charset: 'iso-8859-1' }), 'a=b%2Bc', 'a `+` in a value is percent-encoded');
1704
+ st.equal(qs.stringify({ 'a+b': 'c' }, { charset: 'iso-8859-1' }), 'a%2Bb=c', 'a `+` in a key is percent-encoded');
1705
+ st.deepEqual(
1706
+ qs.parse(qs.stringify({ a: 'b+c' }, { charset: 'iso-8859-1' }), { charset: 'iso-8859-1' }),
1707
+ { a: 'b+c' },
1708
+ 'the `+` survives a round-trip instead of decoding to a space'
1709
+ );
1710
+ st.end();
1711
+ });
1712
+
1713
+ t.test('respects an explicit charset of utf-8 (the default)', function (st) {
1714
+ st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6');
1715
+ st.end();
1716
+ });
1717
+
1718
+ t.test('`charsetSentinel` option', function (st) {
1719
+ st.equal(
1720
+ qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }),
1721
+ 'utf8=%E2%9C%93&a=%C3%A6',
1722
+ 'adds the right sentinel when instructed to and the charset is utf-8'
1723
+ );
1724
+
1725
+ st.equal(
1726
+ qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }),
1727
+ 'utf8=%26%2310003%3B&a=%E6',
1728
+ 'adds the right sentinel when instructed to and the charset is iso-8859-1'
1729
+ );
1730
+
1731
+ st.equal(
1732
+ qs.stringify({ a: 1, b: 2 }, { charsetSentinel: true, delimiter: ';' }),
1733
+ 'utf8=%E2%9C%93;a=1;b=2',
1734
+ 'uses the configured delimiter after the sentinel'
1735
+ );
1736
+
1737
+ st.end();
1738
+ });
1739
+
1740
+ t.test('does not mutate the options argument', function (st) {
1741
+ var options = {};
1742
+ qs.stringify({}, options);
1743
+ st.deepEqual(options, {});
1744
+ st.end();
1745
+ });
1746
+
1747
+ t.test('strictNullHandling works with custom filter', function (st) {
1748
+ var filter = function (prefix, value) {
1749
+ return value;
1750
+ };
1751
+
1752
+ var options = { strictNullHandling: true, filter: filter };
1753
+ st.equal(qs.stringify({ key: null }, options), 'key');
1754
+ st.end();
1755
+ });
1756
+
1757
+ t.test('strictNullHandling works with null serializeDate', function (st) {
1758
+ var serializeDate = function () {
1759
+ return null;
1760
+ };
1761
+ var options = { strictNullHandling: true, serializeDate: serializeDate };
1762
+ var date = new Date();
1763
+ st.equal(qs.stringify({ key: date }, options), 'key');
1764
+ st.end();
1765
+ });
1766
+
1767
+ t.test('allows for encoding keys and values differently', function (st) {
1768
+ var encoder = function (str, defaultEncoder, charset, type) {
1769
+ if (type === 'key') {
1770
+ return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();
1771
+ }
1772
+ if (type === 'value') {
1773
+ return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();
1774
+ }
1775
+ throw 'this should never happen! type: ' + type;
1776
+ };
1777
+
1778
+ st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
1779
+
1780
+ var noopEncoder = function () { return 'x'; };
1781
+ noopEncoder();
1782
+ st['throws'](
1783
+ function () { encoder('x', noopEncoder, 'utf-8', 'unknown'); },
1784
+ 'this should never happen! type: unknown',
1785
+ 'encoder throws for unexpected type'
1786
+ );
1787
+
1788
+ st.end();
1789
+ });
1790
+
1791
+ t.test('objects inside arrays', function (st) {
1792
+ var obj = { a: { b: { c: 'd', e: 'f' } } };
1793
+ var withArray = { a: { b: [{ c: 'd', e: 'f' }] } };
1794
+
1795
+ st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat');
1796
+ st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket');
1797
+ st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices');
1798
+ st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat');
1799
+ st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma');
1800
+
1801
+ st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
1802
+ st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket');
1803
+ st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
1804
+ st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat');
1805
+ st.equal(
1806
+ qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }),
1807
+ '???',
1808
+ 'array, comma',
1809
+ { skip: 'TODO: figure out what this should do' }
1810
+ );
1811
+
1812
+ st.end();
1813
+ });
1814
+
1815
+ t.test('stringifies sparse arrays', function (st) {
1816
+ /* eslint no-sparse-arrays: 0 */
1817
+ st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1');
1818
+ st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1');
1819
+ st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1');
1820
+
1821
+ st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1');
1822
+ st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1');
1823
+ st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1');
1824
+
1825
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1');
1826
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1');
1827
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1');
1828
+
1829
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1');
1830
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1');
1831
+ st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1');
1832
+
1833
+ st.end();
1834
+ });
1835
+
1836
+ t.test('encodes a very long string', function (st) {
1837
+ var chars = [];
1838
+ var expected = [];
1839
+ for (var i = 0; i < 5e3; i++) {
1840
+ chars.push(' ' + i);
1841
+
1842
+ expected.push('%20' + i);
1843
+ }
1844
+
1845
+ var obj = {
1846
+ foo: chars.join('')
1847
+ };
1848
+
1849
+ st.equal(
1850
+ qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }),
1851
+ 'foo=' + expected.join('')
1852
+ );
1853
+
1854
+ st.end();
1855
+ });
1856
+
1857
+ t.end();
1858
+ });
1859
+
1860
+ test('stringifies empty keys', function (t) {
1861
+ emptyTestCases.forEach(function (testCase) {
1862
+ t.test('stringifies an object with empty string key with ' + testCase.input, function (st) {
1863
+ st.deepEqual(
1864
+ qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }),
1865
+ testCase.stringifyOutput.indices,
1866
+ 'test case: ' + testCase.input + ', indices'
1867
+ );
1868
+ st.deepEqual(
1869
+ qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }),
1870
+ testCase.stringifyOutput.brackets,
1871
+ 'test case: ' + testCase.input + ', brackets'
1872
+ );
1873
+ st.deepEqual(
1874
+ qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }),
1875
+ testCase.stringifyOutput.repeat,
1876
+ 'test case: ' + testCase.input + ', repeat'
1877
+ );
1878
+
1879
+ st.end();
1880
+ });
1881
+ });
1882
+
1883
+ t.test('edge case with object/arrays', function (st) {
1884
+ st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3');
1885
+ st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2');
1886
+ st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3');
1887
+ st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2');
1888
+
1889
+ st.end();
1890
+ });
1891
+
1892
+ t.test('stringifies non-string keys', function (st) {
1893
+ var S = Object('abc');
1894
+ S.toString = function () {
1895
+ return 'd';
1896
+ };
1897
+ var actual = qs.stringify({ a: 'b', 'false': {}, 1e+22: 'c', d: 'e' }, {
1898
+ filter: ['a', false, null, 10000000000000000000000, S],
1899
+ allowDots: true,
1900
+ encodeDotInKeys: true
1901
+ });
1902
+
1903
+ st.equal(actual, 'a=b&1e%2B22=c&d=e', 'stringifies correctly');
1904
+
1905
+ st.end();
1906
+ });
1907
+
1908
+ t.test('round-trips keys containing percent-encoded bracket text', function (st) {
1909
+ var cases = [
1910
+ { 'a%5Bb': 'c' },
1911
+ { 'a%5Db': 'c' },
1912
+ { 'a%255Bb': 'c' },
1913
+ { 'a%255Db': 'c' },
1914
+ { a: { 'b%5Bc': 'd' } },
1915
+ { a: { 'b%255Bc': 'd' } },
1916
+ { 'a%5B%255Bb': 'c' }
1917
+ ];
1918
+ for (var i = 0; i < cases.length; i++) {
1919
+ st.deepEqual(
1920
+ qs.parse(qs.stringify(cases[i])),
1921
+ cases[i],
1922
+ 'round-trips ' + JSON.stringify(cases[i])
1923
+ );
1924
+ }
1925
+
1926
+ st.end();
1927
+ });
1928
+
1929
+ t.test('parses input containing percent-encoded bracket text without mangling', function (st) {
1930
+ st.deepEqual(qs.parse('a%25255Bb=c'), { 'a%255Bb': 'c' }, 'a%25255Bb decodes to a%255Bb, not a%5Bb');
1931
+ st.deepEqual(qs.parse('a%25255Db=c'), { 'a%255Db': 'c' }, 'a%25255Db decodes to a%255Db, not a%5Db');
1932
+ st.deepEqual(qs.parse('a%5Bb%25255Bc%5D=d'), { a: { 'b%255Bc': 'd' } }, 'nested %25255B decodes to %255B inside segment, not %5B');
1933
+
1934
+ st.end();
1935
+ });
1936
+
1937
+ t.test('limits nesting depth with the `depth` option', function (st) {
1938
+ st.equal(
1939
+ qs.stringify({ a: { b: { c: 'd' } } }),
1940
+ 'a%5Bb%5D%5Bc%5D=d',
1941
+ 'the default depth is unlimited and does not alter output'
1942
+ );
1943
+ st.equal(
1944
+ qs.stringify({ a: { b: { c: 'd' } } }, { depth: 2 }),
1945
+ 'a%5Bb%5D%5Bc%5D=d',
1946
+ 'does not throw when nesting is within the depth limit'
1947
+ );
1948
+ st.equal(
1949
+ qs.stringify({ a: { b: 'c' } }, { depth: Infinity }),
1950
+ 'a%5Bb%5D=c',
1951
+ 'an explicit Infinity depth is unlimited'
1952
+ );
1953
+ st.equal(
1954
+ qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: null }),
1955
+ qs.stringify({ a: { b: { c: { d: 'e' } } } }),
1956
+ 'a non-number depth is ignored and treated as unlimited'
1957
+ );
1958
+ st.equal(
1959
+ qs.stringify({ a: 'b' }, { depth: 0 }),
1960
+ 'a=b',
1961
+ 'a flat object serializes with a depth of 0'
1962
+ );
1963
+
1964
+ var deep = {};
1965
+ var cursor = deep;
1966
+ for (var i = 0; i < 250; i++) {
1967
+ cursor.a = {};
1968
+ cursor = cursor.a;
1969
+ }
1970
+ cursor.b = 'c';
1971
+ st.equal(typeof qs.stringify(deep), 'string', 'the default depth serializes deeply nested objects without throwing');
1972
+
1973
+ st['throws'](
1974
+ function () { qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 }); },
1975
+ RangeError,
1976
+ 'throws a RangeError when nesting exceeds the depth limit'
1977
+ );
1978
+ st['throws'](
1979
+ function () { qs.stringify({ a: { b: 'c' } }, { depth: 0 }); },
1980
+ RangeError,
1981
+ 'a depth of 0 throws for any nested object'
1982
+ );
1983
+
1984
+ var caught;
1985
+ try {
1986
+ qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 });
1987
+ } catch (e) {
1988
+ caught = e;
1989
+ }
1990
+ st.ok(caught instanceof RangeError, 'the thrown value is a RangeError');
1991
+ st.equal(caught.message, 'Input depth exceeded depth option of 2', 'the RangeError names the exceeded depth');
1992
+
1993
+ st.end();
1994
+ });
1995
+ });