@7nsane/zift 1.0.9 → 1.2.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 (590) hide show
  1. package/bin/zift.js +62 -69
  2. package/package.json +1 -1
  3. package/src/collector.js +34 -5
  4. package/audit-axios/axios-1.13.6.tgz +0 -0
  5. package/zift-user-test/node_modules/.package-lock.json +0 -819
  6. package/zift-user-test/node_modules/accepts/HISTORY.md +0 -250
  7. package/zift-user-test/node_modules/accepts/LICENSE +0 -23
  8. package/zift-user-test/node_modules/accepts/README.md +0 -140
  9. package/zift-user-test/node_modules/accepts/index.js +0 -238
  10. package/zift-user-test/node_modules/accepts/package.json +0 -47
  11. package/zift-user-test/node_modules/body-parser/LICENSE +0 -23
  12. package/zift-user-test/node_modules/body-parser/README.md +0 -494
  13. package/zift-user-test/node_modules/body-parser/index.js +0 -71
  14. package/zift-user-test/node_modules/body-parser/lib/read.js +0 -247
  15. package/zift-user-test/node_modules/body-parser/lib/types/json.js +0 -158
  16. package/zift-user-test/node_modules/body-parser/lib/types/raw.js +0 -42
  17. package/zift-user-test/node_modules/body-parser/lib/types/text.js +0 -36
  18. package/zift-user-test/node_modules/body-parser/lib/types/urlencoded.js +0 -142
  19. package/zift-user-test/node_modules/body-parser/lib/utils.js +0 -98
  20. package/zift-user-test/node_modules/body-parser/package.json +0 -52
  21. package/zift-user-test/node_modules/bytes/History.md +0 -97
  22. package/zift-user-test/node_modules/bytes/LICENSE +0 -23
  23. package/zift-user-test/node_modules/bytes/Readme.md +0 -152
  24. package/zift-user-test/node_modules/bytes/index.js +0 -170
  25. package/zift-user-test/node_modules/bytes/package.json +0 -42
  26. package/zift-user-test/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  27. package/zift-user-test/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  28. package/zift-user-test/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  29. package/zift-user-test/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  30. package/zift-user-test/node_modules/call-bind-apply-helpers/LICENSE +0 -21
  31. package/zift-user-test/node_modules/call-bind-apply-helpers/README.md +0 -62
  32. package/zift-user-test/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  33. package/zift-user-test/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  34. package/zift-user-test/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  35. package/zift-user-test/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  36. package/zift-user-test/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  37. package/zift-user-test/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  38. package/zift-user-test/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  39. package/zift-user-test/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  40. package/zift-user-test/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  41. package/zift-user-test/node_modules/call-bind-apply-helpers/index.js +0 -15
  42. package/zift-user-test/node_modules/call-bind-apply-helpers/package.json +0 -85
  43. package/zift-user-test/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  44. package/zift-user-test/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  45. package/zift-user-test/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  46. package/zift-user-test/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  47. package/zift-user-test/node_modules/call-bound/.eslintrc +0 -13
  48. package/zift-user-test/node_modules/call-bound/.github/FUNDING.yml +0 -12
  49. package/zift-user-test/node_modules/call-bound/.nycrc +0 -9
  50. package/zift-user-test/node_modules/call-bound/CHANGELOG.md +0 -42
  51. package/zift-user-test/node_modules/call-bound/LICENSE +0 -21
  52. package/zift-user-test/node_modules/call-bound/README.md +0 -53
  53. package/zift-user-test/node_modules/call-bound/index.d.ts +0 -94
  54. package/zift-user-test/node_modules/call-bound/index.js +0 -19
  55. package/zift-user-test/node_modules/call-bound/package.json +0 -99
  56. package/zift-user-test/node_modules/call-bound/test/index.js +0 -61
  57. package/zift-user-test/node_modules/call-bound/tsconfig.json +0 -10
  58. package/zift-user-test/node_modules/content-disposition/HISTORY.md +0 -72
  59. package/zift-user-test/node_modules/content-disposition/LICENSE +0 -22
  60. package/zift-user-test/node_modules/content-disposition/README.md +0 -142
  61. package/zift-user-test/node_modules/content-disposition/index.js +0 -458
  62. package/zift-user-test/node_modules/content-disposition/package.json +0 -43
  63. package/zift-user-test/node_modules/content-type/HISTORY.md +0 -29
  64. package/zift-user-test/node_modules/content-type/LICENSE +0 -22
  65. package/zift-user-test/node_modules/content-type/README.md +0 -94
  66. package/zift-user-test/node_modules/content-type/index.js +0 -225
  67. package/zift-user-test/node_modules/content-type/package.json +0 -42
  68. package/zift-user-test/node_modules/cookie/LICENSE +0 -24
  69. package/zift-user-test/node_modules/cookie/README.md +0 -317
  70. package/zift-user-test/node_modules/cookie/SECURITY.md +0 -25
  71. package/zift-user-test/node_modules/cookie/index.js +0 -335
  72. package/zift-user-test/node_modules/cookie/package.json +0 -44
  73. package/zift-user-test/node_modules/cookie-signature/History.md +0 -70
  74. package/zift-user-test/node_modules/cookie-signature/LICENSE +0 -22
  75. package/zift-user-test/node_modules/cookie-signature/Readme.md +0 -23
  76. package/zift-user-test/node_modules/cookie-signature/index.js +0 -47
  77. package/zift-user-test/node_modules/cookie-signature/package.json +0 -24
  78. package/zift-user-test/node_modules/debug/LICENSE +0 -20
  79. package/zift-user-test/node_modules/debug/README.md +0 -481
  80. package/zift-user-test/node_modules/debug/package.json +0 -64
  81. package/zift-user-test/node_modules/debug/src/browser.js +0 -272
  82. package/zift-user-test/node_modules/debug/src/common.js +0 -292
  83. package/zift-user-test/node_modules/debug/src/index.js +0 -10
  84. package/zift-user-test/node_modules/debug/src/node.js +0 -263
  85. package/zift-user-test/node_modules/depd/History.md +0 -103
  86. package/zift-user-test/node_modules/depd/LICENSE +0 -22
  87. package/zift-user-test/node_modules/depd/Readme.md +0 -280
  88. package/zift-user-test/node_modules/depd/index.js +0 -538
  89. package/zift-user-test/node_modules/depd/lib/browser/index.js +0 -77
  90. package/zift-user-test/node_modules/depd/package.json +0 -45
  91. package/zift-user-test/node_modules/dunder-proto/.eslintrc +0 -5
  92. package/zift-user-test/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
  93. package/zift-user-test/node_modules/dunder-proto/.nycrc +0 -13
  94. package/zift-user-test/node_modules/dunder-proto/CHANGELOG.md +0 -24
  95. package/zift-user-test/node_modules/dunder-proto/LICENSE +0 -21
  96. package/zift-user-test/node_modules/dunder-proto/README.md +0 -54
  97. package/zift-user-test/node_modules/dunder-proto/get.d.ts +0 -5
  98. package/zift-user-test/node_modules/dunder-proto/get.js +0 -30
  99. package/zift-user-test/node_modules/dunder-proto/package.json +0 -76
  100. package/zift-user-test/node_modules/dunder-proto/set.d.ts +0 -5
  101. package/zift-user-test/node_modules/dunder-proto/set.js +0 -35
  102. package/zift-user-test/node_modules/dunder-proto/test/get.js +0 -34
  103. package/zift-user-test/node_modules/dunder-proto/test/index.js +0 -4
  104. package/zift-user-test/node_modules/dunder-proto/test/set.js +0 -50
  105. package/zift-user-test/node_modules/dunder-proto/tsconfig.json +0 -9
  106. package/zift-user-test/node_modules/ee-first/LICENSE +0 -22
  107. package/zift-user-test/node_modules/ee-first/README.md +0 -80
  108. package/zift-user-test/node_modules/ee-first/index.js +0 -95
  109. package/zift-user-test/node_modules/ee-first/package.json +0 -29
  110. package/zift-user-test/node_modules/encodeurl/LICENSE +0 -22
  111. package/zift-user-test/node_modules/encodeurl/README.md +0 -109
  112. package/zift-user-test/node_modules/encodeurl/index.js +0 -60
  113. package/zift-user-test/node_modules/encodeurl/package.json +0 -40
  114. package/zift-user-test/node_modules/es-define-property/.eslintrc +0 -13
  115. package/zift-user-test/node_modules/es-define-property/.github/FUNDING.yml +0 -12
  116. package/zift-user-test/node_modules/es-define-property/.nycrc +0 -9
  117. package/zift-user-test/node_modules/es-define-property/CHANGELOG.md +0 -29
  118. package/zift-user-test/node_modules/es-define-property/LICENSE +0 -21
  119. package/zift-user-test/node_modules/es-define-property/README.md +0 -49
  120. package/zift-user-test/node_modules/es-define-property/index.d.ts +0 -3
  121. package/zift-user-test/node_modules/es-define-property/index.js +0 -14
  122. package/zift-user-test/node_modules/es-define-property/package.json +0 -81
  123. package/zift-user-test/node_modules/es-define-property/test/index.js +0 -56
  124. package/zift-user-test/node_modules/es-define-property/tsconfig.json +0 -10
  125. package/zift-user-test/node_modules/es-errors/.eslintrc +0 -5
  126. package/zift-user-test/node_modules/es-errors/.github/FUNDING.yml +0 -12
  127. package/zift-user-test/node_modules/es-errors/CHANGELOG.md +0 -40
  128. package/zift-user-test/node_modules/es-errors/LICENSE +0 -21
  129. package/zift-user-test/node_modules/es-errors/README.md +0 -55
  130. package/zift-user-test/node_modules/es-errors/eval.d.ts +0 -3
  131. package/zift-user-test/node_modules/es-errors/eval.js +0 -4
  132. package/zift-user-test/node_modules/es-errors/index.d.ts +0 -3
  133. package/zift-user-test/node_modules/es-errors/index.js +0 -4
  134. package/zift-user-test/node_modules/es-errors/package.json +0 -80
  135. package/zift-user-test/node_modules/es-errors/range.d.ts +0 -3
  136. package/zift-user-test/node_modules/es-errors/range.js +0 -4
  137. package/zift-user-test/node_modules/es-errors/ref.d.ts +0 -3
  138. package/zift-user-test/node_modules/es-errors/ref.js +0 -4
  139. package/zift-user-test/node_modules/es-errors/syntax.d.ts +0 -3
  140. package/zift-user-test/node_modules/es-errors/syntax.js +0 -4
  141. package/zift-user-test/node_modules/es-errors/test/index.js +0 -19
  142. package/zift-user-test/node_modules/es-errors/tsconfig.json +0 -49
  143. package/zift-user-test/node_modules/es-errors/type.d.ts +0 -3
  144. package/zift-user-test/node_modules/es-errors/type.js +0 -4
  145. package/zift-user-test/node_modules/es-errors/uri.d.ts +0 -3
  146. package/zift-user-test/node_modules/es-errors/uri.js +0 -4
  147. package/zift-user-test/node_modules/es-object-atoms/.eslintrc +0 -16
  148. package/zift-user-test/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
  149. package/zift-user-test/node_modules/es-object-atoms/CHANGELOG.md +0 -37
  150. package/zift-user-test/node_modules/es-object-atoms/LICENSE +0 -21
  151. package/zift-user-test/node_modules/es-object-atoms/README.md +0 -63
  152. package/zift-user-test/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
  153. package/zift-user-test/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
  154. package/zift-user-test/node_modules/es-object-atoms/ToObject.d.ts +0 -7
  155. package/zift-user-test/node_modules/es-object-atoms/ToObject.js +0 -10
  156. package/zift-user-test/node_modules/es-object-atoms/index.d.ts +0 -3
  157. package/zift-user-test/node_modules/es-object-atoms/index.js +0 -4
  158. package/zift-user-test/node_modules/es-object-atoms/isObject.d.ts +0 -3
  159. package/zift-user-test/node_modules/es-object-atoms/isObject.js +0 -6
  160. package/zift-user-test/node_modules/es-object-atoms/package.json +0 -80
  161. package/zift-user-test/node_modules/es-object-atoms/test/index.js +0 -38
  162. package/zift-user-test/node_modules/es-object-atoms/tsconfig.json +0 -6
  163. package/zift-user-test/node_modules/escape-html/LICENSE +0 -24
  164. package/zift-user-test/node_modules/escape-html/Readme.md +0 -43
  165. package/zift-user-test/node_modules/escape-html/index.js +0 -78
  166. package/zift-user-test/node_modules/escape-html/package.json +0 -24
  167. package/zift-user-test/node_modules/etag/HISTORY.md +0 -83
  168. package/zift-user-test/node_modules/etag/LICENSE +0 -22
  169. package/zift-user-test/node_modules/etag/README.md +0 -159
  170. package/zift-user-test/node_modules/etag/index.js +0 -131
  171. package/zift-user-test/node_modules/etag/package.json +0 -47
  172. package/zift-user-test/node_modules/express/LICENSE +0 -24
  173. package/zift-user-test/node_modules/express/Readme.md +0 -276
  174. package/zift-user-test/node_modules/express/index.js +0 -11
  175. package/zift-user-test/node_modules/express/lib/application.js +0 -631
  176. package/zift-user-test/node_modules/express/lib/express.js +0 -81
  177. package/zift-user-test/node_modules/express/lib/request.js +0 -514
  178. package/zift-user-test/node_modules/express/lib/response.js +0 -1053
  179. package/zift-user-test/node_modules/express/lib/utils.js +0 -271
  180. package/zift-user-test/node_modules/express/lib/view.js +0 -205
  181. package/zift-user-test/node_modules/express/package.json +0 -99
  182. package/zift-user-test/node_modules/finalhandler/HISTORY.md +0 -239
  183. package/zift-user-test/node_modules/finalhandler/LICENSE +0 -22
  184. package/zift-user-test/node_modules/finalhandler/README.md +0 -150
  185. package/zift-user-test/node_modules/finalhandler/index.js +0 -293
  186. package/zift-user-test/node_modules/finalhandler/package.json +0 -47
  187. package/zift-user-test/node_modules/forwarded/HISTORY.md +0 -21
  188. package/zift-user-test/node_modules/forwarded/LICENSE +0 -22
  189. package/zift-user-test/node_modules/forwarded/README.md +0 -57
  190. package/zift-user-test/node_modules/forwarded/index.js +0 -90
  191. package/zift-user-test/node_modules/forwarded/package.json +0 -45
  192. package/zift-user-test/node_modules/fresh/HISTORY.md +0 -80
  193. package/zift-user-test/node_modules/fresh/LICENSE +0 -23
  194. package/zift-user-test/node_modules/fresh/README.md +0 -117
  195. package/zift-user-test/node_modules/fresh/index.js +0 -136
  196. package/zift-user-test/node_modules/fresh/package.json +0 -46
  197. package/zift-user-test/node_modules/function-bind/.eslintrc +0 -21
  198. package/zift-user-test/node_modules/function-bind/.github/FUNDING.yml +0 -12
  199. package/zift-user-test/node_modules/function-bind/.github/SECURITY.md +0 -3
  200. package/zift-user-test/node_modules/function-bind/.nycrc +0 -13
  201. package/zift-user-test/node_modules/function-bind/CHANGELOG.md +0 -136
  202. package/zift-user-test/node_modules/function-bind/LICENSE +0 -20
  203. package/zift-user-test/node_modules/function-bind/README.md +0 -46
  204. package/zift-user-test/node_modules/function-bind/implementation.js +0 -84
  205. package/zift-user-test/node_modules/function-bind/index.js +0 -5
  206. package/zift-user-test/node_modules/function-bind/package.json +0 -87
  207. package/zift-user-test/node_modules/function-bind/test/.eslintrc +0 -9
  208. package/zift-user-test/node_modules/function-bind/test/index.js +0 -252
  209. package/zift-user-test/node_modules/get-intrinsic/.eslintrc +0 -42
  210. package/zift-user-test/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  211. package/zift-user-test/node_modules/get-intrinsic/.nycrc +0 -9
  212. package/zift-user-test/node_modules/get-intrinsic/CHANGELOG.md +0 -186
  213. package/zift-user-test/node_modules/get-intrinsic/LICENSE +0 -21
  214. package/zift-user-test/node_modules/get-intrinsic/README.md +0 -71
  215. package/zift-user-test/node_modules/get-intrinsic/index.js +0 -378
  216. package/zift-user-test/node_modules/get-intrinsic/package.json +0 -97
  217. package/zift-user-test/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  218. package/zift-user-test/node_modules/get-proto/.eslintrc +0 -10
  219. package/zift-user-test/node_modules/get-proto/.github/FUNDING.yml +0 -12
  220. package/zift-user-test/node_modules/get-proto/.nycrc +0 -9
  221. package/zift-user-test/node_modules/get-proto/CHANGELOG.md +0 -21
  222. package/zift-user-test/node_modules/get-proto/LICENSE +0 -21
  223. package/zift-user-test/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
  224. package/zift-user-test/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
  225. package/zift-user-test/node_modules/get-proto/README.md +0 -50
  226. package/zift-user-test/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
  227. package/zift-user-test/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
  228. package/zift-user-test/node_modules/get-proto/index.d.ts +0 -5
  229. package/zift-user-test/node_modules/get-proto/index.js +0 -27
  230. package/zift-user-test/node_modules/get-proto/package.json +0 -81
  231. package/zift-user-test/node_modules/get-proto/test/index.js +0 -68
  232. package/zift-user-test/node_modules/get-proto/tsconfig.json +0 -9
  233. package/zift-user-test/node_modules/gopd/.eslintrc +0 -16
  234. package/zift-user-test/node_modules/gopd/.github/FUNDING.yml +0 -12
  235. package/zift-user-test/node_modules/gopd/CHANGELOG.md +0 -45
  236. package/zift-user-test/node_modules/gopd/LICENSE +0 -21
  237. package/zift-user-test/node_modules/gopd/README.md +0 -40
  238. package/zift-user-test/node_modules/gopd/gOPD.d.ts +0 -1
  239. package/zift-user-test/node_modules/gopd/gOPD.js +0 -4
  240. package/zift-user-test/node_modules/gopd/index.d.ts +0 -5
  241. package/zift-user-test/node_modules/gopd/index.js +0 -15
  242. package/zift-user-test/node_modules/gopd/package.json +0 -77
  243. package/zift-user-test/node_modules/gopd/test/index.js +0 -36
  244. package/zift-user-test/node_modules/gopd/tsconfig.json +0 -9
  245. package/zift-user-test/node_modules/has-symbols/.eslintrc +0 -11
  246. package/zift-user-test/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  247. package/zift-user-test/node_modules/has-symbols/.nycrc +0 -9
  248. package/zift-user-test/node_modules/has-symbols/CHANGELOG.md +0 -91
  249. package/zift-user-test/node_modules/has-symbols/LICENSE +0 -21
  250. package/zift-user-test/node_modules/has-symbols/README.md +0 -46
  251. package/zift-user-test/node_modules/has-symbols/index.d.ts +0 -3
  252. package/zift-user-test/node_modules/has-symbols/index.js +0 -14
  253. package/zift-user-test/node_modules/has-symbols/package.json +0 -111
  254. package/zift-user-test/node_modules/has-symbols/shams.d.ts +0 -3
  255. package/zift-user-test/node_modules/has-symbols/shams.js +0 -45
  256. package/zift-user-test/node_modules/has-symbols/test/index.js +0 -22
  257. package/zift-user-test/node_modules/has-symbols/test/shams/core-js.js +0 -29
  258. package/zift-user-test/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
  259. package/zift-user-test/node_modules/has-symbols/test/tests.js +0 -58
  260. package/zift-user-test/node_modules/has-symbols/tsconfig.json +0 -10
  261. package/zift-user-test/node_modules/hasown/.eslintrc +0 -5
  262. package/zift-user-test/node_modules/hasown/.github/FUNDING.yml +0 -12
  263. package/zift-user-test/node_modules/hasown/.nycrc +0 -13
  264. package/zift-user-test/node_modules/hasown/CHANGELOG.md +0 -40
  265. package/zift-user-test/node_modules/hasown/LICENSE +0 -21
  266. package/zift-user-test/node_modules/hasown/README.md +0 -40
  267. package/zift-user-test/node_modules/hasown/index.d.ts +0 -3
  268. package/zift-user-test/node_modules/hasown/index.js +0 -8
  269. package/zift-user-test/node_modules/hasown/package.json +0 -92
  270. package/zift-user-test/node_modules/hasown/tsconfig.json +0 -6
  271. package/zift-user-test/node_modules/http-errors/HISTORY.md +0 -186
  272. package/zift-user-test/node_modules/http-errors/LICENSE +0 -23
  273. package/zift-user-test/node_modules/http-errors/README.md +0 -169
  274. package/zift-user-test/node_modules/http-errors/index.js +0 -290
  275. package/zift-user-test/node_modules/http-errors/package.json +0 -54
  276. package/zift-user-test/node_modules/iconv-lite/LICENSE +0 -21
  277. package/zift-user-test/node_modules/iconv-lite/README.md +0 -138
  278. package/zift-user-test/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -532
  279. package/zift-user-test/node_modules/iconv-lite/encodings/dbcs-data.js +0 -185
  280. package/zift-user-test/node_modules/iconv-lite/encodings/index.js +0 -23
  281. package/zift-user-test/node_modules/iconv-lite/encodings/internal.js +0 -218
  282. package/zift-user-test/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -75
  283. package/zift-user-test/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  284. package/zift-user-test/node_modules/iconv-lite/encodings/sbcs-data.js +0 -178
  285. package/zift-user-test/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  286. package/zift-user-test/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  287. package/zift-user-test/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  288. package/zift-user-test/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  289. package/zift-user-test/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  290. package/zift-user-test/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  291. package/zift-user-test/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  292. package/zift-user-test/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  293. package/zift-user-test/node_modules/iconv-lite/encodings/utf16.js +0 -187
  294. package/zift-user-test/node_modules/iconv-lite/encodings/utf32.js +0 -307
  295. package/zift-user-test/node_modules/iconv-lite/encodings/utf7.js +0 -283
  296. package/zift-user-test/node_modules/iconv-lite/lib/bom-handling.js +0 -48
  297. package/zift-user-test/node_modules/iconv-lite/lib/helpers/merge-exports.js +0 -13
  298. package/zift-user-test/node_modules/iconv-lite/lib/index.d.ts +0 -129
  299. package/zift-user-test/node_modules/iconv-lite/lib/index.js +0 -182
  300. package/zift-user-test/node_modules/iconv-lite/lib/streams.js +0 -105
  301. package/zift-user-test/node_modules/iconv-lite/package.json +0 -70
  302. package/zift-user-test/node_modules/iconv-lite/types/encodings.d.ts +0 -423
  303. package/zift-user-test/node_modules/inherits/LICENSE +0 -16
  304. package/zift-user-test/node_modules/inherits/README.md +0 -42
  305. package/zift-user-test/node_modules/inherits/inherits.js +0 -9
  306. package/zift-user-test/node_modules/inherits/inherits_browser.js +0 -27
  307. package/zift-user-test/node_modules/inherits/package.json +0 -29
  308. package/zift-user-test/node_modules/ipaddr.js/LICENSE +0 -19
  309. package/zift-user-test/node_modules/ipaddr.js/README.md +0 -233
  310. package/zift-user-test/node_modules/ipaddr.js/ipaddr.min.js +0 -1
  311. package/zift-user-test/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
  312. package/zift-user-test/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
  313. package/zift-user-test/node_modules/ipaddr.js/package.json +0 -35
  314. package/zift-user-test/node_modules/is-promise/LICENSE +0 -19
  315. package/zift-user-test/node_modules/is-promise/index.d.ts +0 -2
  316. package/zift-user-test/node_modules/is-promise/index.js +0 -6
  317. package/zift-user-test/node_modules/is-promise/index.mjs +0 -3
  318. package/zift-user-test/node_modules/is-promise/package.json +0 -30
  319. package/zift-user-test/node_modules/is-promise/readme.md +0 -33
  320. package/zift-user-test/node_modules/math-intrinsics/.eslintrc +0 -16
  321. package/zift-user-test/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
  322. package/zift-user-test/node_modules/math-intrinsics/CHANGELOG.md +0 -24
  323. package/zift-user-test/node_modules/math-intrinsics/LICENSE +0 -21
  324. package/zift-user-test/node_modules/math-intrinsics/README.md +0 -50
  325. package/zift-user-test/node_modules/math-intrinsics/abs.d.ts +0 -1
  326. package/zift-user-test/node_modules/math-intrinsics/abs.js +0 -4
  327. package/zift-user-test/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
  328. package/zift-user-test/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
  329. package/zift-user-test/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
  330. package/zift-user-test/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
  331. package/zift-user-test/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
  332. package/zift-user-test/node_modules/math-intrinsics/constants/maxValue.js +0 -5
  333. package/zift-user-test/node_modules/math-intrinsics/floor.d.ts +0 -1
  334. package/zift-user-test/node_modules/math-intrinsics/floor.js +0 -4
  335. package/zift-user-test/node_modules/math-intrinsics/isFinite.d.ts +0 -3
  336. package/zift-user-test/node_modules/math-intrinsics/isFinite.js +0 -12
  337. package/zift-user-test/node_modules/math-intrinsics/isInteger.d.ts +0 -3
  338. package/zift-user-test/node_modules/math-intrinsics/isInteger.js +0 -16
  339. package/zift-user-test/node_modules/math-intrinsics/isNaN.d.ts +0 -1
  340. package/zift-user-test/node_modules/math-intrinsics/isNaN.js +0 -6
  341. package/zift-user-test/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
  342. package/zift-user-test/node_modules/math-intrinsics/isNegativeZero.js +0 -6
  343. package/zift-user-test/node_modules/math-intrinsics/max.d.ts +0 -1
  344. package/zift-user-test/node_modules/math-intrinsics/max.js +0 -4
  345. package/zift-user-test/node_modules/math-intrinsics/min.d.ts +0 -1
  346. package/zift-user-test/node_modules/math-intrinsics/min.js +0 -4
  347. package/zift-user-test/node_modules/math-intrinsics/mod.d.ts +0 -3
  348. package/zift-user-test/node_modules/math-intrinsics/mod.js +0 -9
  349. package/zift-user-test/node_modules/math-intrinsics/package.json +0 -86
  350. package/zift-user-test/node_modules/math-intrinsics/pow.d.ts +0 -1
  351. package/zift-user-test/node_modules/math-intrinsics/pow.js +0 -4
  352. package/zift-user-test/node_modules/math-intrinsics/round.d.ts +0 -1
  353. package/zift-user-test/node_modules/math-intrinsics/round.js +0 -4
  354. package/zift-user-test/node_modules/math-intrinsics/sign.d.ts +0 -3
  355. package/zift-user-test/node_modules/math-intrinsics/sign.js +0 -11
  356. package/zift-user-test/node_modules/math-intrinsics/test/index.js +0 -192
  357. package/zift-user-test/node_modules/math-intrinsics/tsconfig.json +0 -3
  358. package/zift-user-test/node_modules/media-typer/HISTORY.md +0 -50
  359. package/zift-user-test/node_modules/media-typer/LICENSE +0 -22
  360. package/zift-user-test/node_modules/media-typer/README.md +0 -93
  361. package/zift-user-test/node_modules/media-typer/index.js +0 -143
  362. package/zift-user-test/node_modules/media-typer/package.json +0 -33
  363. package/zift-user-test/node_modules/merge-descriptors/index.d.ts +0 -11
  364. package/zift-user-test/node_modules/merge-descriptors/index.js +0 -26
  365. package/zift-user-test/node_modules/merge-descriptors/license +0 -11
  366. package/zift-user-test/node_modules/merge-descriptors/package.json +0 -50
  367. package/zift-user-test/node_modules/merge-descriptors/readme.md +0 -55
  368. package/zift-user-test/node_modules/mime-db/HISTORY.md +0 -541
  369. package/zift-user-test/node_modules/mime-db/LICENSE +0 -23
  370. package/zift-user-test/node_modules/mime-db/README.md +0 -109
  371. package/zift-user-test/node_modules/mime-db/db.json +0 -9342
  372. package/zift-user-test/node_modules/mime-db/index.js +0 -12
  373. package/zift-user-test/node_modules/mime-db/package.json +0 -56
  374. package/zift-user-test/node_modules/mime-types/HISTORY.md +0 -428
  375. package/zift-user-test/node_modules/mime-types/LICENSE +0 -23
  376. package/zift-user-test/node_modules/mime-types/README.md +0 -126
  377. package/zift-user-test/node_modules/mime-types/index.js +0 -211
  378. package/zift-user-test/node_modules/mime-types/mimeScore.js +0 -57
  379. package/zift-user-test/node_modules/mime-types/package.json +0 -49
  380. package/zift-user-test/node_modules/ms/index.js +0 -162
  381. package/zift-user-test/node_modules/ms/license.md +0 -21
  382. package/zift-user-test/node_modules/ms/package.json +0 -38
  383. package/zift-user-test/node_modules/ms/readme.md +0 -59
  384. package/zift-user-test/node_modules/negotiator/HISTORY.md +0 -114
  385. package/zift-user-test/node_modules/negotiator/LICENSE +0 -24
  386. package/zift-user-test/node_modules/negotiator/README.md +0 -212
  387. package/zift-user-test/node_modules/negotiator/index.js +0 -83
  388. package/zift-user-test/node_modules/negotiator/lib/charset.js +0 -169
  389. package/zift-user-test/node_modules/negotiator/lib/encoding.js +0 -205
  390. package/zift-user-test/node_modules/negotiator/lib/language.js +0 -179
  391. package/zift-user-test/node_modules/negotiator/lib/mediaType.js +0 -294
  392. package/zift-user-test/node_modules/negotiator/package.json +0 -43
  393. package/zift-user-test/node_modules/object-inspect/.eslintrc +0 -53
  394. package/zift-user-test/node_modules/object-inspect/.github/FUNDING.yml +0 -12
  395. package/zift-user-test/node_modules/object-inspect/.nycrc +0 -13
  396. package/zift-user-test/node_modules/object-inspect/CHANGELOG.md +0 -424
  397. package/zift-user-test/node_modules/object-inspect/LICENSE +0 -21
  398. package/zift-user-test/node_modules/object-inspect/example/all.js +0 -23
  399. package/zift-user-test/node_modules/object-inspect/example/circular.js +0 -6
  400. package/zift-user-test/node_modules/object-inspect/example/fn.js +0 -5
  401. package/zift-user-test/node_modules/object-inspect/example/inspect.js +0 -10
  402. package/zift-user-test/node_modules/object-inspect/index.js +0 -544
  403. package/zift-user-test/node_modules/object-inspect/package-support.json +0 -20
  404. package/zift-user-test/node_modules/object-inspect/package.json +0 -105
  405. package/zift-user-test/node_modules/object-inspect/readme.markdown +0 -84
  406. package/zift-user-test/node_modules/object-inspect/test/bigint.js +0 -58
  407. package/zift-user-test/node_modules/object-inspect/test/browser/dom.js +0 -15
  408. package/zift-user-test/node_modules/object-inspect/test/circular.js +0 -16
  409. package/zift-user-test/node_modules/object-inspect/test/deep.js +0 -12
  410. package/zift-user-test/node_modules/object-inspect/test/element.js +0 -53
  411. package/zift-user-test/node_modules/object-inspect/test/err.js +0 -48
  412. package/zift-user-test/node_modules/object-inspect/test/fakes.js +0 -29
  413. package/zift-user-test/node_modules/object-inspect/test/fn.js +0 -76
  414. package/zift-user-test/node_modules/object-inspect/test/global.js +0 -17
  415. package/zift-user-test/node_modules/object-inspect/test/has.js +0 -15
  416. package/zift-user-test/node_modules/object-inspect/test/holes.js +0 -15
  417. package/zift-user-test/node_modules/object-inspect/test/indent-option.js +0 -271
  418. package/zift-user-test/node_modules/object-inspect/test/inspect.js +0 -139
  419. package/zift-user-test/node_modules/object-inspect/test/lowbyte.js +0 -12
  420. package/zift-user-test/node_modules/object-inspect/test/number.js +0 -58
  421. package/zift-user-test/node_modules/object-inspect/test/quoteStyle.js +0 -26
  422. package/zift-user-test/node_modules/object-inspect/test/toStringTag.js +0 -40
  423. package/zift-user-test/node_modules/object-inspect/test/undef.js +0 -12
  424. package/zift-user-test/node_modules/object-inspect/test/values.js +0 -261
  425. package/zift-user-test/node_modules/object-inspect/test-core-js.js +0 -26
  426. package/zift-user-test/node_modules/object-inspect/util.inspect.js +0 -1
  427. package/zift-user-test/node_modules/on-finished/HISTORY.md +0 -98
  428. package/zift-user-test/node_modules/on-finished/LICENSE +0 -23
  429. package/zift-user-test/node_modules/on-finished/README.md +0 -162
  430. package/zift-user-test/node_modules/on-finished/index.js +0 -234
  431. package/zift-user-test/node_modules/on-finished/package.json +0 -39
  432. package/zift-user-test/node_modules/once/LICENSE +0 -15
  433. package/zift-user-test/node_modules/once/README.md +0 -79
  434. package/zift-user-test/node_modules/once/once.js +0 -42
  435. package/zift-user-test/node_modules/once/package.json +0 -33
  436. package/zift-user-test/node_modules/parseurl/HISTORY.md +0 -58
  437. package/zift-user-test/node_modules/parseurl/LICENSE +0 -24
  438. package/zift-user-test/node_modules/parseurl/README.md +0 -133
  439. package/zift-user-test/node_modules/parseurl/index.js +0 -158
  440. package/zift-user-test/node_modules/parseurl/package.json +0 -40
  441. package/zift-user-test/node_modules/path-to-regexp/LICENSE +0 -21
  442. package/zift-user-test/node_modules/path-to-regexp/Readme.md +0 -224
  443. package/zift-user-test/node_modules/path-to-regexp/dist/index.d.ts +0 -144
  444. package/zift-user-test/node_modules/path-to-regexp/dist/index.js +0 -409
  445. package/zift-user-test/node_modules/path-to-regexp/dist/index.js.map +0 -1
  446. package/zift-user-test/node_modules/path-to-regexp/package.json +0 -64
  447. package/zift-user-test/node_modules/proxy-addr/HISTORY.md +0 -161
  448. package/zift-user-test/node_modules/proxy-addr/LICENSE +0 -22
  449. package/zift-user-test/node_modules/proxy-addr/README.md +0 -139
  450. package/zift-user-test/node_modules/proxy-addr/index.js +0 -327
  451. package/zift-user-test/node_modules/proxy-addr/package.json +0 -47
  452. package/zift-user-test/node_modules/qs/.editorconfig +0 -46
  453. package/zift-user-test/node_modules/qs/.github/FUNDING.yml +0 -12
  454. package/zift-user-test/node_modules/qs/.github/SECURITY.md +0 -11
  455. package/zift-user-test/node_modules/qs/.github/THREAT_MODEL.md +0 -78
  456. package/zift-user-test/node_modules/qs/.nycrc +0 -13
  457. package/zift-user-test/node_modules/qs/CHANGELOG.md +0 -806
  458. package/zift-user-test/node_modules/qs/LICENSE.md +0 -29
  459. package/zift-user-test/node_modules/qs/README.md +0 -758
  460. package/zift-user-test/node_modules/qs/dist/qs.js +0 -141
  461. package/zift-user-test/node_modules/qs/eslint.config.mjs +0 -56
  462. package/zift-user-test/node_modules/qs/lib/formats.js +0 -23
  463. package/zift-user-test/node_modules/qs/lib/index.js +0 -11
  464. package/zift-user-test/node_modules/qs/lib/parse.js +0 -373
  465. package/zift-user-test/node_modules/qs/lib/stringify.js +0 -356
  466. package/zift-user-test/node_modules/qs/lib/utils.js +0 -342
  467. package/zift-user-test/node_modules/qs/package.json +0 -94
  468. package/zift-user-test/node_modules/qs/test/empty-keys-cases.js +0 -267
  469. package/zift-user-test/node_modules/qs/test/parse.js +0 -1568
  470. package/zift-user-test/node_modules/qs/test/stringify.js +0 -1310
  471. package/zift-user-test/node_modules/qs/test/utils.js +0 -404
  472. package/zift-user-test/node_modules/range-parser/HISTORY.md +0 -56
  473. package/zift-user-test/node_modules/range-parser/LICENSE +0 -23
  474. package/zift-user-test/node_modules/range-parser/README.md +0 -84
  475. package/zift-user-test/node_modules/range-parser/index.js +0 -162
  476. package/zift-user-test/node_modules/range-parser/package.json +0 -44
  477. package/zift-user-test/node_modules/raw-body/LICENSE +0 -22
  478. package/zift-user-test/node_modules/raw-body/README.md +0 -223
  479. package/zift-user-test/node_modules/raw-body/index.d.ts +0 -85
  480. package/zift-user-test/node_modules/raw-body/index.js +0 -336
  481. package/zift-user-test/node_modules/raw-body/package.json +0 -46
  482. package/zift-user-test/node_modules/router/HISTORY.md +0 -228
  483. package/zift-user-test/node_modules/router/LICENSE +0 -23
  484. package/zift-user-test/node_modules/router/README.md +0 -416
  485. package/zift-user-test/node_modules/router/index.js +0 -748
  486. package/zift-user-test/node_modules/router/lib/layer.js +0 -247
  487. package/zift-user-test/node_modules/router/lib/route.js +0 -242
  488. package/zift-user-test/node_modules/router/package.json +0 -44
  489. package/zift-user-test/node_modules/safer-buffer/LICENSE +0 -21
  490. package/zift-user-test/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  491. package/zift-user-test/node_modules/safer-buffer/Readme.md +0 -156
  492. package/zift-user-test/node_modules/safer-buffer/dangerous.js +0 -58
  493. package/zift-user-test/node_modules/safer-buffer/package.json +0 -34
  494. package/zift-user-test/node_modules/safer-buffer/safer.js +0 -77
  495. package/zift-user-test/node_modules/safer-buffer/tests.js +0 -406
  496. package/zift-user-test/node_modules/send/LICENSE +0 -23
  497. package/zift-user-test/node_modules/send/README.md +0 -317
  498. package/zift-user-test/node_modules/send/index.js +0 -997
  499. package/zift-user-test/node_modules/send/package.json +0 -63
  500. package/zift-user-test/node_modules/serve-static/LICENSE +0 -25
  501. package/zift-user-test/node_modules/serve-static/README.md +0 -253
  502. package/zift-user-test/node_modules/serve-static/index.js +0 -208
  503. package/zift-user-test/node_modules/serve-static/package.json +0 -44
  504. package/zift-user-test/node_modules/setprototypeof/LICENSE +0 -13
  505. package/zift-user-test/node_modules/setprototypeof/README.md +0 -31
  506. package/zift-user-test/node_modules/setprototypeof/index.d.ts +0 -2
  507. package/zift-user-test/node_modules/setprototypeof/index.js +0 -17
  508. package/zift-user-test/node_modules/setprototypeof/package.json +0 -38
  509. package/zift-user-test/node_modules/setprototypeof/test/index.js +0 -24
  510. package/zift-user-test/node_modules/side-channel/.editorconfig +0 -9
  511. package/zift-user-test/node_modules/side-channel/.eslintrc +0 -12
  512. package/zift-user-test/node_modules/side-channel/.github/FUNDING.yml +0 -12
  513. package/zift-user-test/node_modules/side-channel/.nycrc +0 -13
  514. package/zift-user-test/node_modules/side-channel/CHANGELOG.md +0 -110
  515. package/zift-user-test/node_modules/side-channel/LICENSE +0 -21
  516. package/zift-user-test/node_modules/side-channel/README.md +0 -61
  517. package/zift-user-test/node_modules/side-channel/index.d.ts +0 -14
  518. package/zift-user-test/node_modules/side-channel/index.js +0 -43
  519. package/zift-user-test/node_modules/side-channel/package.json +0 -85
  520. package/zift-user-test/node_modules/side-channel/test/index.js +0 -104
  521. package/zift-user-test/node_modules/side-channel/tsconfig.json +0 -9
  522. package/zift-user-test/node_modules/side-channel-list/.editorconfig +0 -9
  523. package/zift-user-test/node_modules/side-channel-list/.eslintrc +0 -11
  524. package/zift-user-test/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
  525. package/zift-user-test/node_modules/side-channel-list/.nycrc +0 -13
  526. package/zift-user-test/node_modules/side-channel-list/CHANGELOG.md +0 -15
  527. package/zift-user-test/node_modules/side-channel-list/LICENSE +0 -21
  528. package/zift-user-test/node_modules/side-channel-list/README.md +0 -62
  529. package/zift-user-test/node_modules/side-channel-list/index.d.ts +0 -13
  530. package/zift-user-test/node_modules/side-channel-list/index.js +0 -113
  531. package/zift-user-test/node_modules/side-channel-list/list.d.ts +0 -14
  532. package/zift-user-test/node_modules/side-channel-list/package.json +0 -77
  533. package/zift-user-test/node_modules/side-channel-list/test/index.js +0 -104
  534. package/zift-user-test/node_modules/side-channel-list/tsconfig.json +0 -9
  535. package/zift-user-test/node_modules/side-channel-map/.editorconfig +0 -9
  536. package/zift-user-test/node_modules/side-channel-map/.eslintrc +0 -11
  537. package/zift-user-test/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
  538. package/zift-user-test/node_modules/side-channel-map/.nycrc +0 -13
  539. package/zift-user-test/node_modules/side-channel-map/CHANGELOG.md +0 -22
  540. package/zift-user-test/node_modules/side-channel-map/LICENSE +0 -21
  541. package/zift-user-test/node_modules/side-channel-map/README.md +0 -62
  542. package/zift-user-test/node_modules/side-channel-map/index.d.ts +0 -15
  543. package/zift-user-test/node_modules/side-channel-map/index.js +0 -68
  544. package/zift-user-test/node_modules/side-channel-map/package.json +0 -80
  545. package/zift-user-test/node_modules/side-channel-map/test/index.js +0 -114
  546. package/zift-user-test/node_modules/side-channel-map/tsconfig.json +0 -9
  547. package/zift-user-test/node_modules/side-channel-weakmap/.editorconfig +0 -9
  548. package/zift-user-test/node_modules/side-channel-weakmap/.eslintrc +0 -12
  549. package/zift-user-test/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
  550. package/zift-user-test/node_modules/side-channel-weakmap/.nycrc +0 -13
  551. package/zift-user-test/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
  552. package/zift-user-test/node_modules/side-channel-weakmap/LICENSE +0 -21
  553. package/zift-user-test/node_modules/side-channel-weakmap/README.md +0 -62
  554. package/zift-user-test/node_modules/side-channel-weakmap/index.d.ts +0 -15
  555. package/zift-user-test/node_modules/side-channel-weakmap/index.js +0 -84
  556. package/zift-user-test/node_modules/side-channel-weakmap/package.json +0 -87
  557. package/zift-user-test/node_modules/side-channel-weakmap/test/index.js +0 -114
  558. package/zift-user-test/node_modules/side-channel-weakmap/tsconfig.json +0 -9
  559. package/zift-user-test/node_modules/statuses/HISTORY.md +0 -87
  560. package/zift-user-test/node_modules/statuses/LICENSE +0 -23
  561. package/zift-user-test/node_modules/statuses/README.md +0 -139
  562. package/zift-user-test/node_modules/statuses/codes.json +0 -65
  563. package/zift-user-test/node_modules/statuses/index.js +0 -146
  564. package/zift-user-test/node_modules/statuses/package.json +0 -49
  565. package/zift-user-test/node_modules/toidentifier/HISTORY.md +0 -9
  566. package/zift-user-test/node_modules/toidentifier/LICENSE +0 -21
  567. package/zift-user-test/node_modules/toidentifier/README.md +0 -61
  568. package/zift-user-test/node_modules/toidentifier/index.js +0 -32
  569. package/zift-user-test/node_modules/toidentifier/package.json +0 -38
  570. package/zift-user-test/node_modules/type-is/HISTORY.md +0 -292
  571. package/zift-user-test/node_modules/type-is/LICENSE +0 -23
  572. package/zift-user-test/node_modules/type-is/README.md +0 -198
  573. package/zift-user-test/node_modules/type-is/index.js +0 -250
  574. package/zift-user-test/node_modules/type-is/package.json +0 -47
  575. package/zift-user-test/node_modules/unpipe/HISTORY.md +0 -4
  576. package/zift-user-test/node_modules/unpipe/LICENSE +0 -22
  577. package/zift-user-test/node_modules/unpipe/README.md +0 -43
  578. package/zift-user-test/node_modules/unpipe/index.js +0 -69
  579. package/zift-user-test/node_modules/unpipe/package.json +0 -27
  580. package/zift-user-test/node_modules/vary/HISTORY.md +0 -39
  581. package/zift-user-test/node_modules/vary/LICENSE +0 -22
  582. package/zift-user-test/node_modules/vary/README.md +0 -101
  583. package/zift-user-test/node_modules/vary/index.js +0 -149
  584. package/zift-user-test/node_modules/vary/package.json +0 -43
  585. package/zift-user-test/node_modules/wrappy/LICENSE +0 -15
  586. package/zift-user-test/node_modules/wrappy/README.md +0 -36
  587. package/zift-user-test/node_modules/wrappy/package.json +0 -29
  588. package/zift-user-test/node_modules/wrappy/wrappy.js +0 -33
  589. package/zift-user-test/package-lock.json +0 -827
  590. package/zift-user-test/package.json +0 -16
@@ -1,997 +0,0 @@
1
- /*!
2
- * send
3
- * Copyright(c) 2012 TJ Holowaychuk
4
- * Copyright(c) 2014-2022 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- 'use strict'
9
-
10
- /**
11
- * Module dependencies.
12
- * @private
13
- */
14
-
15
- var createError = require('http-errors')
16
- var debug = require('debug')('send')
17
- var encodeUrl = require('encodeurl')
18
- var escapeHtml = require('escape-html')
19
- var etag = require('etag')
20
- var fresh = require('fresh')
21
- var fs = require('fs')
22
- var mime = require('mime-types')
23
- var ms = require('ms')
24
- var onFinished = require('on-finished')
25
- var parseRange = require('range-parser')
26
- var path = require('path')
27
- var statuses = require('statuses')
28
- var Stream = require('stream')
29
- var util = require('util')
30
-
31
- /**
32
- * Path function references.
33
- * @private
34
- */
35
-
36
- var extname = path.extname
37
- var join = path.join
38
- var normalize = path.normalize
39
- var resolve = path.resolve
40
- var sep = path.sep
41
-
42
- /**
43
- * Regular expression for identifying a bytes Range header.
44
- * @private
45
- */
46
-
47
- var BYTES_RANGE_REGEXP = /^ *bytes=/
48
-
49
- /**
50
- * Maximum value allowed for the max age.
51
- * @private
52
- */
53
-
54
- var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year
55
-
56
- /**
57
- * Regular expression to match a path with a directory up component.
58
- * @private
59
- */
60
-
61
- var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/
62
-
63
- /**
64
- * Module exports.
65
- * @public
66
- */
67
-
68
- module.exports = send
69
-
70
- /**
71
- * Return a `SendStream` for `req` and `path`.
72
- *
73
- * @param {object} req
74
- * @param {string} path
75
- * @param {object} [options]
76
- * @return {SendStream}
77
- * @public
78
- */
79
-
80
- function send (req, path, options) {
81
- return new SendStream(req, path, options)
82
- }
83
-
84
- /**
85
- * Initialize a `SendStream` with the given `path`.
86
- *
87
- * @param {Request} req
88
- * @param {String} path
89
- * @param {object} [options]
90
- * @private
91
- */
92
-
93
- function SendStream (req, path, options) {
94
- Stream.call(this)
95
-
96
- var opts = options || {}
97
-
98
- this.options = opts
99
- this.path = path
100
- this.req = req
101
-
102
- this._acceptRanges = opts.acceptRanges !== undefined
103
- ? Boolean(opts.acceptRanges)
104
- : true
105
-
106
- this._cacheControl = opts.cacheControl !== undefined
107
- ? Boolean(opts.cacheControl)
108
- : true
109
-
110
- this._etag = opts.etag !== undefined
111
- ? Boolean(opts.etag)
112
- : true
113
-
114
- this._dotfiles = opts.dotfiles !== undefined
115
- ? opts.dotfiles
116
- : 'ignore'
117
-
118
- if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') {
119
- throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"')
120
- }
121
-
122
- this._extensions = opts.extensions !== undefined
123
- ? normalizeList(opts.extensions, 'extensions option')
124
- : []
125
-
126
- this._immutable = opts.immutable !== undefined
127
- ? Boolean(opts.immutable)
128
- : false
129
-
130
- this._index = opts.index !== undefined
131
- ? normalizeList(opts.index, 'index option')
132
- : ['index.html']
133
-
134
- this._lastModified = opts.lastModified !== undefined
135
- ? Boolean(opts.lastModified)
136
- : true
137
-
138
- this._maxage = opts.maxAge || opts.maxage
139
- this._maxage = typeof this._maxage === 'string'
140
- ? ms(this._maxage)
141
- : Number(this._maxage)
142
- this._maxage = !isNaN(this._maxage)
143
- ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)
144
- : 0
145
-
146
- this._root = opts.root
147
- ? resolve(opts.root)
148
- : null
149
- }
150
-
151
- /**
152
- * Inherits from `Stream`.
153
- */
154
-
155
- util.inherits(SendStream, Stream)
156
-
157
- /**
158
- * Emit error with `status`.
159
- *
160
- * @param {number} status
161
- * @param {Error} [err]
162
- * @private
163
- */
164
-
165
- SendStream.prototype.error = function error (status, err) {
166
- // emit if listeners instead of responding
167
- if (hasListeners(this, 'error')) {
168
- return this.emit('error', createHttpError(status, err))
169
- }
170
-
171
- var res = this.res
172
- var msg = statuses.message[status] || String(status)
173
- var doc = createHtmlDocument('Error', escapeHtml(msg))
174
-
175
- // clear existing headers
176
- clearHeaders(res)
177
-
178
- // add error headers
179
- if (err && err.headers) {
180
- setHeaders(res, err.headers)
181
- }
182
-
183
- // send basic response
184
- res.statusCode = status
185
- res.setHeader('Content-Type', 'text/html; charset=UTF-8')
186
- res.setHeader('Content-Length', Buffer.byteLength(doc))
187
- res.setHeader('Content-Security-Policy', "default-src 'none'")
188
- res.setHeader('X-Content-Type-Options', 'nosniff')
189
- res.end(doc)
190
- }
191
-
192
- /**
193
- * Check if the pathname ends with "/".
194
- *
195
- * @return {boolean}
196
- * @private
197
- */
198
-
199
- SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () {
200
- return this.path[this.path.length - 1] === '/'
201
- }
202
-
203
- /**
204
- * Check if this is a conditional GET request.
205
- *
206
- * @return {Boolean}
207
- * @api private
208
- */
209
-
210
- SendStream.prototype.isConditionalGET = function isConditionalGET () {
211
- return this.req.headers['if-match'] ||
212
- this.req.headers['if-unmodified-since'] ||
213
- this.req.headers['if-none-match'] ||
214
- this.req.headers['if-modified-since']
215
- }
216
-
217
- /**
218
- * Check if the request preconditions failed.
219
- *
220
- * @return {boolean}
221
- * @private
222
- */
223
-
224
- SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {
225
- var req = this.req
226
- var res = this.res
227
-
228
- // if-match
229
- var match = req.headers['if-match']
230
- if (match) {
231
- var etag = res.getHeader('ETag')
232
- return !etag || (match !== '*' && parseTokenList(match).every(function (match) {
233
- return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag
234
- }))
235
- }
236
-
237
- // if-unmodified-since
238
- var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since'])
239
- if (!isNaN(unmodifiedSince)) {
240
- var lastModified = parseHttpDate(res.getHeader('Last-Modified'))
241
- return isNaN(lastModified) || lastModified > unmodifiedSince
242
- }
243
-
244
- return false
245
- }
246
-
247
- /**
248
- * Strip various content header fields for a change in entity.
249
- *
250
- * @private
251
- */
252
-
253
- SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {
254
- var res = this.res
255
-
256
- res.removeHeader('Content-Encoding')
257
- res.removeHeader('Content-Language')
258
- res.removeHeader('Content-Length')
259
- res.removeHeader('Content-Range')
260
- res.removeHeader('Content-Type')
261
- }
262
-
263
- /**
264
- * Respond with 304 not modified.
265
- *
266
- * @api private
267
- */
268
-
269
- SendStream.prototype.notModified = function notModified () {
270
- var res = this.res
271
- debug('not modified')
272
- this.removeContentHeaderFields()
273
- res.statusCode = 304
274
- res.end()
275
- }
276
-
277
- /**
278
- * Raise error that headers already sent.
279
- *
280
- * @api private
281
- */
282
-
283
- SendStream.prototype.headersAlreadySent = function headersAlreadySent () {
284
- var err = new Error('Can\'t set headers after they are sent.')
285
- debug('headers already sent')
286
- this.error(500, err)
287
- }
288
-
289
- /**
290
- * Check if the request is cacheable, aka
291
- * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
292
- *
293
- * @return {Boolean}
294
- * @api private
295
- */
296
-
297
- SendStream.prototype.isCachable = function isCachable () {
298
- var statusCode = this.res.statusCode
299
- return (statusCode >= 200 && statusCode < 300) ||
300
- statusCode === 304
301
- }
302
-
303
- /**
304
- * Handle stat() error.
305
- *
306
- * @param {Error} error
307
- * @private
308
- */
309
-
310
- SendStream.prototype.onStatError = function onStatError (error) {
311
- switch (error.code) {
312
- case 'ENAMETOOLONG':
313
- case 'ENOENT':
314
- case 'ENOTDIR':
315
- this.error(404, error)
316
- break
317
- default:
318
- this.error(500, error)
319
- break
320
- }
321
- }
322
-
323
- /**
324
- * Check if the cache is fresh.
325
- *
326
- * @return {Boolean}
327
- * @api private
328
- */
329
-
330
- SendStream.prototype.isFresh = function isFresh () {
331
- return fresh(this.req.headers, {
332
- etag: this.res.getHeader('ETag'),
333
- 'last-modified': this.res.getHeader('Last-Modified')
334
- })
335
- }
336
-
337
- /**
338
- * Check if the range is fresh.
339
- *
340
- * @return {Boolean}
341
- * @api private
342
- */
343
-
344
- SendStream.prototype.isRangeFresh = function isRangeFresh () {
345
- var ifRange = this.req.headers['if-range']
346
-
347
- if (!ifRange) {
348
- return true
349
- }
350
-
351
- // if-range as etag
352
- if (ifRange.indexOf('"') !== -1) {
353
- var etag = this.res.getHeader('ETag')
354
- return Boolean(etag && ifRange.indexOf(etag) !== -1)
355
- }
356
-
357
- // if-range as modified date
358
- var lastModified = this.res.getHeader('Last-Modified')
359
- return parseHttpDate(lastModified) <= parseHttpDate(ifRange)
360
- }
361
-
362
- /**
363
- * Redirect to path.
364
- *
365
- * @param {string} path
366
- * @private
367
- */
368
-
369
- SendStream.prototype.redirect = function redirect (path) {
370
- var res = this.res
371
-
372
- if (hasListeners(this, 'directory')) {
373
- this.emit('directory', res, path)
374
- return
375
- }
376
-
377
- if (this.hasTrailingSlash()) {
378
- this.error(403)
379
- return
380
- }
381
-
382
- var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'))
383
- var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc))
384
-
385
- // redirect
386
- res.statusCode = 301
387
- res.setHeader('Content-Type', 'text/html; charset=UTF-8')
388
- res.setHeader('Content-Length', Buffer.byteLength(doc))
389
- res.setHeader('Content-Security-Policy', "default-src 'none'")
390
- res.setHeader('X-Content-Type-Options', 'nosniff')
391
- res.setHeader('Location', loc)
392
- res.end(doc)
393
- }
394
-
395
- /**
396
- * Pipe to `res.
397
- *
398
- * @param {Stream} res
399
- * @return {Stream} res
400
- * @api public
401
- */
402
-
403
- SendStream.prototype.pipe = function pipe (res) {
404
- // root path
405
- var root = this._root
406
-
407
- // references
408
- this.res = res
409
-
410
- // decode the path
411
- var path = decode(this.path)
412
- if (path === -1) {
413
- this.error(400)
414
- return res
415
- }
416
-
417
- // null byte(s)
418
- if (~path.indexOf('\0')) {
419
- this.error(400)
420
- return res
421
- }
422
-
423
- var parts
424
- if (root !== null) {
425
- // normalize
426
- if (path) {
427
- path = normalize('.' + sep + path)
428
- }
429
-
430
- // malicious path
431
- if (UP_PATH_REGEXP.test(path)) {
432
- debug('malicious path "%s"', path)
433
- this.error(403)
434
- return res
435
- }
436
-
437
- // explode path parts
438
- parts = path.split(sep)
439
-
440
- // join / normalize from optional root dir
441
- path = normalize(join(root, path))
442
- } else {
443
- // ".." is malicious without "root"
444
- if (UP_PATH_REGEXP.test(path)) {
445
- debug('malicious path "%s"', path)
446
- this.error(403)
447
- return res
448
- }
449
-
450
- // explode path parts
451
- parts = normalize(path).split(sep)
452
-
453
- // resolve the path
454
- path = resolve(path)
455
- }
456
-
457
- // dotfile handling
458
- if (containsDotFile(parts)) {
459
- debug('%s dotfile "%s"', this._dotfiles, path)
460
- switch (this._dotfiles) {
461
- case 'allow':
462
- break
463
- case 'deny':
464
- this.error(403)
465
- return res
466
- case 'ignore':
467
- default:
468
- this.error(404)
469
- return res
470
- }
471
- }
472
-
473
- // index file support
474
- if (this._index.length && this.hasTrailingSlash()) {
475
- this.sendIndex(path)
476
- return res
477
- }
478
-
479
- this.sendFile(path)
480
- return res
481
- }
482
-
483
- /**
484
- * Transfer `path`.
485
- *
486
- * @param {String} path
487
- * @api public
488
- */
489
-
490
- SendStream.prototype.send = function send (path, stat) {
491
- var len = stat.size
492
- var options = this.options
493
- var opts = {}
494
- var res = this.res
495
- var req = this.req
496
- var ranges = req.headers.range
497
- var offset = options.start || 0
498
-
499
- if (res.headersSent) {
500
- // impossible to send now
501
- this.headersAlreadySent()
502
- return
503
- }
504
-
505
- debug('pipe "%s"', path)
506
-
507
- // set header fields
508
- this.setHeader(path, stat)
509
-
510
- // set content-type
511
- this.type(path)
512
-
513
- // conditional GET support
514
- if (this.isConditionalGET()) {
515
- if (this.isPreconditionFailure()) {
516
- this.error(412)
517
- return
518
- }
519
-
520
- if (this.isCachable() && this.isFresh()) {
521
- this.notModified()
522
- return
523
- }
524
- }
525
-
526
- // adjust len to start/end options
527
- len = Math.max(0, len - offset)
528
- if (options.end !== undefined) {
529
- var bytes = options.end - offset + 1
530
- if (len > bytes) len = bytes
531
- }
532
-
533
- // Range support
534
- if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) {
535
- // parse
536
- ranges = parseRange(len, ranges, {
537
- combine: true
538
- })
539
-
540
- // If-Range support
541
- if (!this.isRangeFresh()) {
542
- debug('range stale')
543
- ranges = -2
544
- }
545
-
546
- // unsatisfiable
547
- if (ranges === -1) {
548
- debug('range unsatisfiable')
549
-
550
- // Content-Range
551
- res.setHeader('Content-Range', contentRange('bytes', len))
552
-
553
- // 416 Requested Range Not Satisfiable
554
- return this.error(416, {
555
- headers: { 'Content-Range': res.getHeader('Content-Range') }
556
- })
557
- }
558
-
559
- // valid (syntactically invalid/multiple ranges are treated as a regular response)
560
- if (ranges !== -2 && ranges.length === 1) {
561
- debug('range %j', ranges)
562
-
563
- // Content-Range
564
- res.statusCode = 206
565
- res.setHeader('Content-Range', contentRange('bytes', len, ranges[0]))
566
-
567
- // adjust for requested range
568
- offset += ranges[0].start
569
- len = ranges[0].end - ranges[0].start + 1
570
- }
571
- }
572
-
573
- // clone options
574
- for (var prop in options) {
575
- opts[prop] = options[prop]
576
- }
577
-
578
- // set read options
579
- opts.start = offset
580
- opts.end = Math.max(offset, offset + len - 1)
581
-
582
- // content-length
583
- res.setHeader('Content-Length', len)
584
-
585
- // HEAD support
586
- if (req.method === 'HEAD') {
587
- res.end()
588
- return
589
- }
590
-
591
- this.stream(path, opts)
592
- }
593
-
594
- /**
595
- * Transfer file for `path`.
596
- *
597
- * @param {String} path
598
- * @api private
599
- */
600
- SendStream.prototype.sendFile = function sendFile (path) {
601
- var i = 0
602
- var self = this
603
-
604
- debug('stat "%s"', path)
605
- fs.stat(path, function onstat (err, stat) {
606
- var pathEndsWithSep = path[path.length - 1] === sep
607
- if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) {
608
- // not found, check extensions
609
- return next(err)
610
- }
611
- if (err) return self.onStatError(err)
612
- if (stat.isDirectory()) return self.redirect(path)
613
- if (pathEndsWithSep) return self.error(404)
614
- self.emit('file', path, stat)
615
- self.send(path, stat)
616
- })
617
-
618
- function next (err) {
619
- if (self._extensions.length <= i) {
620
- return err
621
- ? self.onStatError(err)
622
- : self.error(404)
623
- }
624
-
625
- var p = path + '.' + self._extensions[i++]
626
-
627
- debug('stat "%s"', p)
628
- fs.stat(p, function (err, stat) {
629
- if (err) return next(err)
630
- if (stat.isDirectory()) return next()
631
- self.emit('file', p, stat)
632
- self.send(p, stat)
633
- })
634
- }
635
- }
636
-
637
- /**
638
- * Transfer index for `path`.
639
- *
640
- * @param {String} path
641
- * @api private
642
- */
643
- SendStream.prototype.sendIndex = function sendIndex (path) {
644
- var i = -1
645
- var self = this
646
-
647
- function next (err) {
648
- if (++i >= self._index.length) {
649
- if (err) return self.onStatError(err)
650
- return self.error(404)
651
- }
652
-
653
- var p = join(path, self._index[i])
654
-
655
- debug('stat "%s"', p)
656
- fs.stat(p, function (err, stat) {
657
- if (err) return next(err)
658
- if (stat.isDirectory()) return next()
659
- self.emit('file', p, stat)
660
- self.send(p, stat)
661
- })
662
- }
663
-
664
- next()
665
- }
666
-
667
- /**
668
- * Stream `path` to the response.
669
- *
670
- * @param {String} path
671
- * @param {Object} options
672
- * @api private
673
- */
674
-
675
- SendStream.prototype.stream = function stream (path, options) {
676
- var self = this
677
- var res = this.res
678
-
679
- // pipe
680
- var stream = fs.createReadStream(path, options)
681
- this.emit('stream', stream)
682
- stream.pipe(res)
683
-
684
- // cleanup
685
- function cleanup () {
686
- stream.destroy()
687
- }
688
-
689
- // response finished, cleanup
690
- onFinished(res, cleanup)
691
-
692
- // error handling
693
- stream.on('error', function onerror (err) {
694
- // clean up stream early
695
- cleanup()
696
-
697
- // error
698
- self.onStatError(err)
699
- })
700
-
701
- // end
702
- stream.on('end', function onend () {
703
- self.emit('end')
704
- })
705
- }
706
-
707
- /**
708
- * Set content-type based on `path`
709
- * if it hasn't been explicitly set.
710
- *
711
- * @param {String} path
712
- * @api private
713
- */
714
-
715
- SendStream.prototype.type = function type (path) {
716
- var res = this.res
717
-
718
- if (res.getHeader('Content-Type')) return
719
-
720
- var ext = extname(path)
721
- var type = mime.contentType(ext) || 'application/octet-stream'
722
-
723
- debug('content-type %s', type)
724
- res.setHeader('Content-Type', type)
725
- }
726
-
727
- /**
728
- * Set response header fields, most
729
- * fields may be pre-defined.
730
- *
731
- * @param {String} path
732
- * @param {Object} stat
733
- * @api private
734
- */
735
-
736
- SendStream.prototype.setHeader = function setHeader (path, stat) {
737
- var res = this.res
738
-
739
- this.emit('headers', res, path, stat)
740
-
741
- if (this._acceptRanges && !res.getHeader('Accept-Ranges')) {
742
- debug('accept ranges')
743
- res.setHeader('Accept-Ranges', 'bytes')
744
- }
745
-
746
- if (this._cacheControl && !res.getHeader('Cache-Control')) {
747
- var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000)
748
-
749
- if (this._immutable) {
750
- cacheControl += ', immutable'
751
- }
752
-
753
- debug('cache-control %s', cacheControl)
754
- res.setHeader('Cache-Control', cacheControl)
755
- }
756
-
757
- if (this._lastModified && !res.getHeader('Last-Modified')) {
758
- var modified = stat.mtime.toUTCString()
759
- debug('modified %s', modified)
760
- res.setHeader('Last-Modified', modified)
761
- }
762
-
763
- if (this._etag && !res.getHeader('ETag')) {
764
- var val = etag(stat)
765
- debug('etag %s', val)
766
- res.setHeader('ETag', val)
767
- }
768
- }
769
-
770
- /**
771
- * Clear all headers from a response.
772
- *
773
- * @param {object} res
774
- * @private
775
- */
776
-
777
- function clearHeaders (res) {
778
- for (const header of res.getHeaderNames()) {
779
- res.removeHeader(header)
780
- }
781
- }
782
-
783
- /**
784
- * Collapse all leading slashes into a single slash
785
- *
786
- * @param {string} str
787
- * @private
788
- */
789
- function collapseLeadingSlashes (str) {
790
- for (var i = 0; i < str.length; i++) {
791
- if (str[i] !== '/') {
792
- break
793
- }
794
- }
795
-
796
- return i > 1
797
- ? '/' + str.substr(i)
798
- : str
799
- }
800
-
801
- /**
802
- * Determine if path parts contain a dotfile.
803
- *
804
- * @api private
805
- */
806
-
807
- function containsDotFile (parts) {
808
- for (var i = 0; i < parts.length; i++) {
809
- var part = parts[i]
810
- if (part.length > 1 && part[0] === '.') {
811
- return true
812
- }
813
- }
814
-
815
- return false
816
- }
817
-
818
- /**
819
- * Create a Content-Range header.
820
- *
821
- * @param {string} type
822
- * @param {number} size
823
- * @param {array} [range]
824
- */
825
-
826
- function contentRange (type, size, range) {
827
- return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size
828
- }
829
-
830
- /**
831
- * Create a minimal HTML document.
832
- *
833
- * @param {string} title
834
- * @param {string} body
835
- * @private
836
- */
837
-
838
- function createHtmlDocument (title, body) {
839
- return '<!DOCTYPE html>\n' +
840
- '<html lang="en">\n' +
841
- '<head>\n' +
842
- '<meta charset="utf-8">\n' +
843
- '<title>' + title + '</title>\n' +
844
- '</head>\n' +
845
- '<body>\n' +
846
- '<pre>' + body + '</pre>\n' +
847
- '</body>\n' +
848
- '</html>\n'
849
- }
850
-
851
- /**
852
- * Create a HttpError object from simple arguments.
853
- *
854
- * @param {number} status
855
- * @param {Error|object} err
856
- * @private
857
- */
858
-
859
- function createHttpError (status, err) {
860
- if (!err) {
861
- return createError(status)
862
- }
863
-
864
- return err instanceof Error
865
- ? createError(status, err, { expose: false })
866
- : createError(status, err)
867
- }
868
-
869
- /**
870
- * decodeURIComponent.
871
- *
872
- * Allows V8 to only deoptimize this fn instead of all
873
- * of send().
874
- *
875
- * @param {String} path
876
- * @api private
877
- */
878
-
879
- function decode (path) {
880
- try {
881
- return decodeURIComponent(path)
882
- } catch (err) {
883
- return -1
884
- }
885
- }
886
-
887
- /**
888
- * Determine if emitter has listeners of a given type.
889
- *
890
- * The way to do this check is done three different ways in Node.js >= 0.10
891
- * so this consolidates them into a minimal set using instance methods.
892
- *
893
- * @param {EventEmitter} emitter
894
- * @param {string} type
895
- * @returns {boolean}
896
- * @private
897
- */
898
-
899
- function hasListeners (emitter, type) {
900
- var count = typeof emitter.listenerCount !== 'function'
901
- ? emitter.listeners(type).length
902
- : emitter.listenerCount(type)
903
-
904
- return count > 0
905
- }
906
-
907
- /**
908
- * Normalize the index option into an array.
909
- *
910
- * @param {boolean|string|array} val
911
- * @param {string} name
912
- * @private
913
- */
914
-
915
- function normalizeList (val, name) {
916
- var list = [].concat(val || [])
917
-
918
- for (var i = 0; i < list.length; i++) {
919
- if (typeof list[i] !== 'string') {
920
- throw new TypeError(name + ' must be array of strings or false')
921
- }
922
- }
923
-
924
- return list
925
- }
926
-
927
- /**
928
- * Parse an HTTP Date into a number.
929
- *
930
- * @param {string} date
931
- * @private
932
- */
933
-
934
- function parseHttpDate (date) {
935
- var timestamp = date && Date.parse(date)
936
-
937
- return typeof timestamp === 'number'
938
- ? timestamp
939
- : NaN
940
- }
941
-
942
- /**
943
- * Parse a HTTP token list.
944
- *
945
- * @param {string} str
946
- * @private
947
- */
948
-
949
- function parseTokenList (str) {
950
- var end = 0
951
- var list = []
952
- var start = 0
953
-
954
- // gather tokens
955
- for (var i = 0, len = str.length; i < len; i++) {
956
- switch (str.charCodeAt(i)) {
957
- case 0x20: /* */
958
- if (start === end) {
959
- start = end = i + 1
960
- }
961
- break
962
- case 0x2c: /* , */
963
- if (start !== end) {
964
- list.push(str.substring(start, end))
965
- }
966
- start = end = i + 1
967
- break
968
- default:
969
- end = i + 1
970
- break
971
- }
972
- }
973
-
974
- // final token
975
- if (start !== end) {
976
- list.push(str.substring(start, end))
977
- }
978
-
979
- return list
980
- }
981
-
982
- /**
983
- * Set an object of headers on a response.
984
- *
985
- * @param {object} res
986
- * @param {object} headers
987
- * @private
988
- */
989
-
990
- function setHeaders (res, headers) {
991
- var keys = Object.keys(headers)
992
-
993
- for (var i = 0; i < keys.length; i++) {
994
- var key = keys[i]
995
- res.setHeader(key, headers[key])
996
- }
997
- }