cdk-ecr-deployment 0.0.76 → 0.0.79

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 (356) hide show
  1. package/.jsii +28 -25
  2. package/lambda/Dockerfile +25 -0
  3. package/lambda/install.js +64 -0
  4. package/lib/index.js +40 -23
  5. package/node_modules/@sindresorhus/is/dist/index.d.ts +225 -0
  6. package/node_modules/@sindresorhus/is/dist/index.js +427 -0
  7. package/node_modules/@sindresorhus/is/dist/types.d.ts +24 -0
  8. package/node_modules/@sindresorhus/is/dist/types.js +3 -0
  9. package/node_modules/@sindresorhus/is/license +9 -0
  10. package/node_modules/@sindresorhus/is/package.json +96 -0
  11. package/node_modules/@sindresorhus/is/readme.md +628 -0
  12. package/node_modules/@szmarczak/http-timer/LICENSE +21 -0
  13. package/node_modules/@szmarczak/http-timer/README.md +93 -0
  14. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  15. package/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
  16. package/node_modules/@szmarczak/http-timer/package.json +72 -0
  17. package/node_modules/@types/cacheable-request/LICENSE +21 -0
  18. package/node_modules/@types/cacheable-request/README.md +16 -0
  19. package/node_modules/@types/cacheable-request/index.d.ts +137 -0
  20. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +21 -0
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +16 -0
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +8 -0
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +912 -0
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +497 -0
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +2142 -0
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1365 -0
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +414 -0
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +412 -0
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +18 -0
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3307 -0
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +545 -0
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +357 -0
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +643 -0
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +169 -0
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +623 -0
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +1004 -0
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +3748 -0
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +284 -0
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +1 -0
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1368 -0
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +2100 -0
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +391 -0
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +131 -0
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +2738 -0
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +114 -0
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +783 -0
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +455 -0
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +230 -0
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +172 -0
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +555 -0
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1477 -0
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +117 -0
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +131 -0
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +542 -0
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +424 -0
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +42 -0
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +1249 -0
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +67 -0
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +68 -0
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +94 -0
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1019 -0
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +161 -0
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +204 -0
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +798 -0
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1563 -0
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +378 -0
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +507 -0
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +158 -0
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +649 -0
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +517 -0
  74. package/node_modules/@types/cacheable-request/package.json +35 -0
  75. package/node_modules/@types/http-cache-semantics/LICENSE +21 -0
  76. package/node_modules/@types/http-cache-semantics/README.md +16 -0
  77. package/node_modules/@types/http-cache-semantics/index.d.ts +170 -0
  78. package/node_modules/@types/http-cache-semantics/package.json +25 -0
  79. package/node_modules/@types/keyv/LICENSE +21 -0
  80. package/node_modules/@types/keyv/README.md +16 -0
  81. package/node_modules/@types/keyv/index.d.ts +77 -0
  82. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
  83. package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
  84. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
  85. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +912 -0
  86. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +497 -0
  87. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2142 -0
  88. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1365 -0
  89. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +414 -0
  90. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
  91. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
  92. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3307 -0
  93. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
  94. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  95. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +357 -0
  96. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +643 -0
  97. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +169 -0
  98. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +623 -0
  99. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1004 -0
  100. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3748 -0
  101. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +284 -0
  102. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
  103. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1368 -0
  104. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2100 -0
  105. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +391 -0
  106. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +131 -0
  107. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2738 -0
  108. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +783 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +455 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/package.json +230 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +172 -0
  113. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +555 -0
  114. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1477 -0
  115. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
  116. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
  117. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +542 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
  119. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
  121. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1249 -0
  123. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
  124. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
  125. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
  126. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1019 -0
  127. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +161 -0
  128. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +204 -0
  129. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +798 -0
  130. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1563 -0
  131. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +378 -0
  132. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +507 -0
  133. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
  134. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +649 -0
  135. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
  136. package/node_modules/@types/keyv/package.json +32 -0
  137. package/node_modules/@types/responselike/LICENSE +21 -0
  138. package/node_modules/@types/responselike/README.md +16 -0
  139. package/node_modules/@types/responselike/index.d.ts +34 -0
  140. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +21 -0
  141. package/node_modules/@types/responselike/node_modules/@types/node/README.md +16 -0
  142. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +8 -0
  143. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +912 -0
  144. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +497 -0
  145. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +2142 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1365 -0
  147. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +414 -0
  148. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +412 -0
  149. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +18 -0
  150. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3307 -0
  151. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +545 -0
  152. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  153. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +357 -0
  154. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +643 -0
  155. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +169 -0
  156. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +623 -0
  157. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +1004 -0
  158. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +3748 -0
  159. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +284 -0
  160. package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +1 -0
  161. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1368 -0
  162. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +2100 -0
  163. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +391 -0
  164. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +131 -0
  165. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +2738 -0
  166. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +114 -0
  167. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +783 -0
  168. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +455 -0
  169. package/node_modules/@types/responselike/node_modules/@types/node/package.json +230 -0
  170. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +172 -0
  171. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +555 -0
  172. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1477 -0
  173. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +117 -0
  174. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +131 -0
  175. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +542 -0
  176. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +424 -0
  177. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  178. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +42 -0
  179. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
  180. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +1249 -0
  181. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +67 -0
  182. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +68 -0
  183. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +94 -0
  184. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1019 -0
  185. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +161 -0
  186. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +204 -0
  187. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +798 -0
  188. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1563 -0
  189. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +378 -0
  190. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +507 -0
  191. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +158 -0
  192. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +649 -0
  193. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +517 -0
  194. package/node_modules/@types/responselike/package.json +25 -0
  195. package/node_modules/cacheable-lookup/LICENSE +21 -0
  196. package/node_modules/cacheable-lookup/README.md +240 -0
  197. package/node_modules/cacheable-lookup/index.d.ts +139 -0
  198. package/node_modules/cacheable-lookup/package.json +45 -0
  199. package/node_modules/cacheable-lookup/source/index.js +436 -0
  200. package/node_modules/cacheable-request/LICENSE +21 -0
  201. package/node_modules/cacheable-request/README.md +206 -0
  202. package/node_modules/cacheable-request/package.json +56 -0
  203. package/node_modules/cacheable-request/src/index.js +251 -0
  204. package/node_modules/clone-response/LICENSE +21 -0
  205. package/node_modules/clone-response/README.md +62 -0
  206. package/node_modules/clone-response/package.json +44 -0
  207. package/node_modules/clone-response/src/index.js +17 -0
  208. package/node_modules/decompress-response/index.d.ts +22 -0
  209. package/node_modules/decompress-response/index.js +58 -0
  210. package/node_modules/decompress-response/license +9 -0
  211. package/node_modules/decompress-response/node_modules/mimic-response/index.d.ts +17 -0
  212. package/node_modules/decompress-response/node_modules/mimic-response/index.js +77 -0
  213. package/node_modules/decompress-response/node_modules/mimic-response/license +9 -0
  214. package/node_modules/decompress-response/node_modules/mimic-response/package.json +42 -0
  215. package/node_modules/decompress-response/node_modules/mimic-response/readme.md +78 -0
  216. package/node_modules/decompress-response/package.json +56 -0
  217. package/node_modules/decompress-response/readme.md +48 -0
  218. package/node_modules/defer-to-connect/LICENSE +21 -0
  219. package/node_modules/defer-to-connect/README.md +38 -0
  220. package/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
  221. package/node_modules/defer-to-connect/dist/source/index.js +47 -0
  222. package/node_modules/defer-to-connect/package.json +71 -0
  223. package/node_modules/end-of-stream/LICENSE +21 -0
  224. package/node_modules/end-of-stream/README.md +54 -0
  225. package/node_modules/end-of-stream/index.js +94 -0
  226. package/node_modules/end-of-stream/package.json +37 -0
  227. package/node_modules/get-stream/buffer-stream.js +52 -0
  228. package/node_modules/get-stream/index.d.ts +108 -0
  229. package/node_modules/get-stream/index.js +60 -0
  230. package/node_modules/get-stream/license +9 -0
  231. package/node_modules/get-stream/package.json +50 -0
  232. package/node_modules/get-stream/readme.md +124 -0
  233. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +2 -0
  234. package/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
  235. package/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
  236. package/node_modules/got/dist/source/as-promise/index.js +175 -0
  237. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +3 -0
  238. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
  239. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +3 -0
  240. package/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
  241. package/node_modules/got/dist/source/as-promise/types.d.ts +256 -0
  242. package/node_modules/got/dist/source/as-promise/types.js +40 -0
  243. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +5 -0
  244. package/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
  245. package/node_modules/got/dist/source/core/index.d.ts +1124 -0
  246. package/node_modules/got/dist/source/core/index.js +1491 -0
  247. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  248. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
  249. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
  250. package/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
  251. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +4 -0
  252. package/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
  253. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
  254. package/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
  255. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +2 -0
  256. package/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
  257. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  258. package/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
  259. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
  260. package/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
  261. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +29 -0
  262. package/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
  263. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
  264. package/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
  265. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
  266. package/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
  267. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
  268. package/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
  269. package/node_modules/got/dist/source/create.d.ts +5 -0
  270. package/node_modules/got/dist/source/create.js +240 -0
  271. package/node_modules/got/dist/source/index.d.ts +4 -0
  272. package/node_modules/got/dist/source/index.js +132 -0
  273. package/node_modules/got/dist/source/types.d.ts +342 -0
  274. package/node_modules/got/dist/source/types.js +2 -0
  275. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +1 -0
  276. package/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
  277. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +2 -0
  278. package/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
  279. package/node_modules/got/license +9 -0
  280. package/node_modules/got/package.json +130 -0
  281. package/node_modules/got/readme.md +2476 -0
  282. package/node_modules/http-cache-semantics/LICENSE +9 -0
  283. package/node_modules/http-cache-semantics/README.md +203 -0
  284. package/node_modules/http-cache-semantics/index.js +673 -0
  285. package/node_modules/http-cache-semantics/package.json +24 -0
  286. package/node_modules/http2-wrapper/LICENSE +21 -0
  287. package/node_modules/http2-wrapper/README.md +470 -0
  288. package/node_modules/http2-wrapper/package.json +54 -0
  289. package/node_modules/http2-wrapper/source/agent.js +670 -0
  290. package/node_modules/http2-wrapper/source/auto.js +149 -0
  291. package/node_modules/http2-wrapper/source/client-request.js +445 -0
  292. package/node_modules/http2-wrapper/source/incoming-message.js +58 -0
  293. package/node_modules/http2-wrapper/source/index.js +28 -0
  294. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
  295. package/node_modules/http2-wrapper/source/utils/errors.js +45 -0
  296. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
  297. package/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
  298. package/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
  299. package/node_modules/json-buffer/.travis.yml +3 -0
  300. package/node_modules/json-buffer/LICENSE +22 -0
  301. package/node_modules/json-buffer/README.md +24 -0
  302. package/node_modules/json-buffer/index.js +58 -0
  303. package/node_modules/json-buffer/package.json +34 -0
  304. package/node_modules/json-buffer/test/index.js +63 -0
  305. package/node_modules/keyv/LICENSE +21 -0
  306. package/node_modules/keyv/README.md +288 -0
  307. package/node_modules/keyv/package.json +49 -0
  308. package/node_modules/keyv/src/index.js +111 -0
  309. package/node_modules/lowercase-keys/index.d.ts +16 -0
  310. package/node_modules/lowercase-keys/index.js +10 -0
  311. package/node_modules/lowercase-keys/license +9 -0
  312. package/node_modules/lowercase-keys/package.json +38 -0
  313. package/node_modules/lowercase-keys/readme.md +32 -0
  314. package/node_modules/mimic-response/index.js +32 -0
  315. package/node_modules/mimic-response/license +9 -0
  316. package/node_modules/mimic-response/package.json +37 -0
  317. package/node_modules/mimic-response/readme.md +54 -0
  318. package/node_modules/normalize-url/index.d.ts +267 -0
  319. package/node_modules/normalize-url/index.js +216 -0
  320. package/node_modules/normalize-url/license +9 -0
  321. package/node_modules/normalize-url/package.json +50 -0
  322. package/node_modules/normalize-url/readme.md +286 -0
  323. package/node_modules/once/LICENSE +15 -0
  324. package/node_modules/once/README.md +79 -0
  325. package/node_modules/once/once.js +42 -0
  326. package/node_modules/once/package.json +33 -0
  327. package/node_modules/p-cancelable/index.d.ts +176 -0
  328. package/node_modules/p-cancelable/index.js +111 -0
  329. package/node_modules/p-cancelable/license +9 -0
  330. package/node_modules/p-cancelable/package.json +49 -0
  331. package/node_modules/p-cancelable/readme.md +153 -0
  332. package/node_modules/pump/.travis.yml +5 -0
  333. package/node_modules/pump/LICENSE +21 -0
  334. package/node_modules/pump/README.md +65 -0
  335. package/node_modules/pump/index.js +82 -0
  336. package/node_modules/pump/package.json +24 -0
  337. package/node_modules/pump/test-browser.js +66 -0
  338. package/node_modules/pump/test-node.js +53 -0
  339. package/node_modules/quick-lru/index.d.ts +97 -0
  340. package/node_modules/quick-lru/index.js +123 -0
  341. package/node_modules/quick-lru/license +9 -0
  342. package/node_modules/quick-lru/package.json +43 -0
  343. package/node_modules/quick-lru/readme.md +111 -0
  344. package/node_modules/resolve-alpn/LICENSE +22 -0
  345. package/node_modules/resolve-alpn/README.md +60 -0
  346. package/node_modules/resolve-alpn/index.js +43 -0
  347. package/node_modules/resolve-alpn/package.json +34 -0
  348. package/node_modules/responselike/LICENSE +19 -0
  349. package/node_modules/responselike/README.md +77 -0
  350. package/node_modules/responselike/package.json +38 -0
  351. package/node_modules/responselike/src/index.js +34 -0
  352. package/node_modules/wrappy/LICENSE +15 -0
  353. package/node_modules/wrappy/README.md +36 -0
  354. package/node_modules/wrappy/package.json +29 -0
  355. package/node_modules/wrappy/wrappy.js +33 -0
  356. package/package.json +7 -4
@@ -0,0 +1,216 @@
1
+ 'use strict';
2
+
3
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
4
+ const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
5
+ const DATA_URL_DEFAULT_CHARSET = 'us-ascii';
6
+
7
+ const testParameter = (name, filters) => {
8
+ return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
9
+ };
10
+
11
+ const normalizeDataURL = (urlString, {stripHash}) => {
12
+ const match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);
13
+
14
+ if (!match) {
15
+ throw new Error(`Invalid URL: ${urlString}`);
16
+ }
17
+
18
+ let {type, data, hash} = match.groups;
19
+ const mediaType = type.split(';');
20
+ hash = stripHash ? '' : hash;
21
+
22
+ let isBase64 = false;
23
+ if (mediaType[mediaType.length - 1] === 'base64') {
24
+ mediaType.pop();
25
+ isBase64 = true;
26
+ }
27
+
28
+ // Lowercase MIME type
29
+ const mimeType = (mediaType.shift() || '').toLowerCase();
30
+ const attributes = mediaType
31
+ .map(attribute => {
32
+ let [key, value = ''] = attribute.split('=').map(string => string.trim());
33
+
34
+ // Lowercase `charset`
35
+ if (key === 'charset') {
36
+ value = value.toLowerCase();
37
+
38
+ if (value === DATA_URL_DEFAULT_CHARSET) {
39
+ return '';
40
+ }
41
+ }
42
+
43
+ return `${key}${value ? `=${value}` : ''}`;
44
+ })
45
+ .filter(Boolean);
46
+
47
+ const normalizedMediaType = [
48
+ ...attributes
49
+ ];
50
+
51
+ if (isBase64) {
52
+ normalizedMediaType.push('base64');
53
+ }
54
+
55
+ if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {
56
+ normalizedMediaType.unshift(mimeType);
57
+ }
58
+
59
+ return `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`;
60
+ };
61
+
62
+ const normalizeUrl = (urlString, options) => {
63
+ options = {
64
+ defaultProtocol: 'http:',
65
+ normalizeProtocol: true,
66
+ forceHttp: false,
67
+ forceHttps: false,
68
+ stripAuthentication: true,
69
+ stripHash: false,
70
+ stripTextFragment: true,
71
+ stripWWW: true,
72
+ removeQueryParameters: [/^utm_\w+/i],
73
+ removeTrailingSlash: true,
74
+ removeSingleSlash: true,
75
+ removeDirectoryIndex: false,
76
+ sortQueryParameters: true,
77
+ ...options
78
+ };
79
+
80
+ urlString = urlString.trim();
81
+
82
+ // Data URL
83
+ if (/^data:/i.test(urlString)) {
84
+ return normalizeDataURL(urlString, options);
85
+ }
86
+
87
+ if (/^view-source:/i.test(urlString)) {
88
+ throw new Error('`view-source:` is not supported as it is a non-standard protocol');
89
+ }
90
+
91
+ const hasRelativeProtocol = urlString.startsWith('//');
92
+ const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
93
+
94
+ // Prepend protocol
95
+ if (!isRelativeUrl) {
96
+ urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol);
97
+ }
98
+
99
+ const urlObj = new URL(urlString);
100
+
101
+ if (options.forceHttp && options.forceHttps) {
102
+ throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
103
+ }
104
+
105
+ if (options.forceHttp && urlObj.protocol === 'https:') {
106
+ urlObj.protocol = 'http:';
107
+ }
108
+
109
+ if (options.forceHttps && urlObj.protocol === 'http:') {
110
+ urlObj.protocol = 'https:';
111
+ }
112
+
113
+ // Remove auth
114
+ if (options.stripAuthentication) {
115
+ urlObj.username = '';
116
+ urlObj.password = '';
117
+ }
118
+
119
+ // Remove hash
120
+ if (options.stripHash) {
121
+ urlObj.hash = '';
122
+ } else if (options.stripTextFragment) {
123
+ urlObj.hash = urlObj.hash.replace(/#?:~:text.*?$/i, '');
124
+ }
125
+
126
+ // Remove duplicate slashes if not preceded by a protocol
127
+ if (urlObj.pathname) {
128
+ urlObj.pathname = urlObj.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g, '/');
129
+ }
130
+
131
+ // Decode URI octets
132
+ if (urlObj.pathname) {
133
+ try {
134
+ urlObj.pathname = decodeURI(urlObj.pathname);
135
+ } catch (_) {}
136
+ }
137
+
138
+ // Remove directory index
139
+ if (options.removeDirectoryIndex === true) {
140
+ options.removeDirectoryIndex = [/^index\.[a-z]+$/];
141
+ }
142
+
143
+ if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {
144
+ let pathComponents = urlObj.pathname.split('/');
145
+ const lastComponent = pathComponents[pathComponents.length - 1];
146
+
147
+ if (testParameter(lastComponent, options.removeDirectoryIndex)) {
148
+ pathComponents = pathComponents.slice(0, pathComponents.length - 1);
149
+ urlObj.pathname = pathComponents.slice(1).join('/') + '/';
150
+ }
151
+ }
152
+
153
+ if (urlObj.hostname) {
154
+ // Remove trailing dot
155
+ urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
156
+
157
+ // Remove `www.`
158
+ if (options.stripWWW && /^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(urlObj.hostname)) {
159
+ // Each label should be max 63 at length (min: 1).
160
+ // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
161
+ // Each TLD should be up to 63 characters long (min: 2).
162
+ // It is technically possible to have a single character TLD, but none currently exist.
163
+ urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
164
+ }
165
+ }
166
+
167
+ // Remove query unwanted parameters
168
+ if (Array.isArray(options.removeQueryParameters)) {
169
+ for (const key of [...urlObj.searchParams.keys()]) {
170
+ if (testParameter(key, options.removeQueryParameters)) {
171
+ urlObj.searchParams.delete(key);
172
+ }
173
+ }
174
+ }
175
+
176
+ if (options.removeQueryParameters === true) {
177
+ urlObj.search = '';
178
+ }
179
+
180
+ // Sort query parameters
181
+ if (options.sortQueryParameters) {
182
+ urlObj.searchParams.sort();
183
+ }
184
+
185
+ if (options.removeTrailingSlash) {
186
+ urlObj.pathname = urlObj.pathname.replace(/\/$/, '');
187
+ }
188
+
189
+ const oldUrlString = urlString;
190
+
191
+ // Take advantage of many of the Node `url` normalizations
192
+ urlString = urlObj.toString();
193
+
194
+ if (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') {
195
+ urlString = urlString.replace(/\/$/, '');
196
+ }
197
+
198
+ // Remove ending `/` unless removeSingleSlash is false
199
+ if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) {
200
+ urlString = urlString.replace(/\/$/, '');
201
+ }
202
+
203
+ // Restore relative protocol, if applicable
204
+ if (hasRelativeProtocol && !options.normalizeProtocol) {
205
+ urlString = urlString.replace(/^http:\/\//, '//');
206
+ }
207
+
208
+ // Remove http/https
209
+ if (options.stripProtocol) {
210
+ urlString = urlString.replace(/^(?:https?:)?\/\//, '');
211
+ }
212
+
213
+ return urlString;
214
+ };
215
+
216
+ module.exports = normalizeUrl;
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "normalize-url",
3
+ "version": "6.1.0",
4
+ "description": "Normalize a URL",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/normalize-url",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "engines": {
14
+ "node": ">=10"
15
+ },
16
+ "scripts": {
17
+ "test": "xo && nyc ava && tsd"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts"
22
+ ],
23
+ "keywords": [
24
+ "normalize",
25
+ "url",
26
+ "uri",
27
+ "address",
28
+ "string",
29
+ "normalization",
30
+ "normalisation",
31
+ "query",
32
+ "querystring",
33
+ "simplify",
34
+ "strip",
35
+ "trim",
36
+ "canonical"
37
+ ],
38
+ "devDependencies": {
39
+ "ava": "^2.4.0",
40
+ "nyc": "^15.0.0",
41
+ "tsd": "^0.11.0",
42
+ "xo": "^0.25.3"
43
+ },
44
+ "nyc": {
45
+ "reporter": [
46
+ "text",
47
+ "lcov"
48
+ ]
49
+ }
50
+ }
@@ -0,0 +1,286 @@
1
+ # normalize-url [![Coverage Status](https://codecov.io/gh/sindresorhus/normalize-url/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/normalize-url)
2
+
3
+ > [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL
4
+
5
+ Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.
6
+
7
+ ## Install
8
+
9
+ ```
10
+ $ npm install normalize-url
11
+ ```
12
+
13
+ *If you need to use this in the browser, use version 4: `npm i normalize-url@4`*
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ const normalizeUrl = require('normalize-url');
19
+
20
+ normalizeUrl('sindresorhus.com');
21
+ //=> 'http://sindresorhus.com'
22
+
23
+ normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');
24
+ //=> 'http://sindresorhus.com/baz?a=foo&b=bar'
25
+ ```
26
+
27
+ ## API
28
+
29
+ ### normalizeUrl(url, options?)
30
+
31
+ #### url
32
+
33
+ Type: `string`
34
+
35
+ URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
36
+
37
+ #### options
38
+
39
+ Type: `object`
40
+
41
+ ##### defaultProtocol
42
+
43
+ Type: `string`\
44
+ Default: `http:`
45
+
46
+ ##### normalizeProtocol
47
+
48
+ Type: `boolean`\
49
+ Default: `true`
50
+
51
+ Prepend `defaultProtocol` to the URL if it's protocol-relative.
52
+
53
+ ```js
54
+ normalizeUrl('//sindresorhus.com:80/');
55
+ //=> 'http://sindresorhus.com'
56
+
57
+ normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
58
+ //=> '//sindresorhus.com'
59
+ ```
60
+
61
+ ##### forceHttp
62
+
63
+ Type: `boolean`\
64
+ Default: `false`
65
+
66
+ Normalize `https:` to `http:`.
67
+
68
+ ```js
69
+ normalizeUrl('https://sindresorhus.com:80/');
70
+ //=> 'https://sindresorhus.com'
71
+
72
+ normalizeUrl('https://sindresorhus.com:80/', {forceHttp: true});
73
+ //=> 'http://sindresorhus.com'
74
+ ```
75
+
76
+ ##### forceHttps
77
+
78
+ Type: `boolean`\
79
+ Default: `false`
80
+
81
+ Normalize `http:` to `https:`.
82
+
83
+ ```js
84
+ normalizeUrl('https://sindresorhus.com:80/');
85
+ //=> 'https://sindresorhus.com'
86
+
87
+ normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
88
+ //=> 'https://sindresorhus.com'
89
+ ```
90
+
91
+ This option can't be used with the `forceHttp` option at the same time.
92
+
93
+ ##### stripAuthentication
94
+
95
+ Type: `boolean`\
96
+ Default: `true`
97
+
98
+ Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of the URL.
99
+
100
+ ```js
101
+ normalizeUrl('user:password@sindresorhus.com');
102
+ //=> 'https://sindresorhus.com'
103
+
104
+ normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
105
+ //=> 'https://user:password@sindresorhus.com'
106
+ ```
107
+
108
+ ##### stripHash
109
+
110
+ Type: `boolean`\
111
+ Default: `false`
112
+
113
+ Strip the hash part of the URL.
114
+
115
+ ```js
116
+ normalizeUrl('sindresorhus.com/about.html#contact');
117
+ //=> 'http://sindresorhus.com/about.html#contact'
118
+
119
+ normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
120
+ //=> 'http://sindresorhus.com/about.html'
121
+ ```
122
+
123
+ ##### stripProtocol
124
+
125
+ Type: `boolean`\
126
+ Default: `false`
127
+
128
+ Remove HTTP(S) protocol from the URL: `http://sindresorhus.com` → `sindresorhus.com`.
129
+
130
+ ```js
131
+ normalizeUrl('https://sindresorhus.com');
132
+ //=> 'https://sindresorhus.com'
133
+
134
+ normalizeUrl('https://sindresorhus.com', {stripProtocol: true});
135
+ //=> 'sindresorhus.com'
136
+ ```
137
+
138
+ ##### stripTextFragment
139
+
140
+ Type: `boolean`\
141
+ Default: `true`
142
+
143
+ Strip the [text fragment](https://web.dev/text-fragments/) part of the URL.
144
+
145
+ **Note:** The text fragment will always be removed if the `stripHash` option is set to `true`, as the hash contains the text fragment.
146
+
147
+ ```js
148
+ normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello');
149
+ //=> 'http://sindresorhus.com/about.html#'
150
+
151
+ normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello');
152
+ //=> 'http://sindresorhus.com/about.html#section'
153
+
154
+ normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello', {stripTextFragment: false});
155
+ //=> 'http://sindresorhus.com/about.html#:~:text=hello'
156
+
157
+ normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello', {stripTextFragment: false});
158
+ //=> 'http://sindresorhus.com/about.html#section:~:text=hello'
159
+ ```
160
+
161
+ ##### stripWWW
162
+
163
+ Type: `boolean`\
164
+ Default: `true`
165
+
166
+ Remove `www.` from the URL.
167
+
168
+ ```js
169
+ normalizeUrl('http://www.sindresorhus.com');
170
+ //=> 'http://sindresorhus.com'
171
+
172
+ normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
173
+ //=> 'http://www.sindresorhus.com'
174
+ ```
175
+
176
+ ##### removeQueryParameters
177
+
178
+ Type: `Array<RegExp | string> | boolean`\
179
+ Default: `[/^utm_\w+/i]`
180
+
181
+ Remove query parameters that matches any of the provided strings or regexes.
182
+
183
+ ```js
184
+ normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
185
+ removeQueryParameters: ['ref']
186
+ });
187
+ //=> 'http://sindresorhus.com/?foo=bar'
188
+ ```
189
+
190
+ If a boolean is provided, `true` will remove all the query parameters.
191
+
192
+ ```js
193
+ normalizeUrl('www.sindresorhus.com?foo=bar', {
194
+ removeQueryParameters: true
195
+ });
196
+ //=> 'http://sindresorhus.com'
197
+ ```
198
+
199
+ `false` will not remove any query parameter.
200
+
201
+ ```js
202
+ normalizeUrl('www.sindresorhus.com?foo=bar&utm_medium=test&ref=test_ref', {
203
+ removeQueryParameters: false
204
+ });
205
+ //=> 'http://www.sindresorhus.com/?foo=bar&ref=test_ref&utm_medium=test'
206
+ ```
207
+
208
+ ##### removeTrailingSlash
209
+
210
+ Type: `boolean`\
211
+ Default: `true`
212
+
213
+ Remove trailing slash.
214
+
215
+ **Note:** Trailing slash is always removed if the URL doesn't have a pathname unless the `removeSingleSlash` option is set to `false`.
216
+
217
+ ```js
218
+ normalizeUrl('http://sindresorhus.com/redirect/');
219
+ //=> 'http://sindresorhus.com/redirect'
220
+
221
+ normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
222
+ //=> 'http://sindresorhus.com/redirect/'
223
+
224
+ normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
225
+ //=> 'http://sindresorhus.com'
226
+ ```
227
+
228
+ ##### removeSingleSlash
229
+
230
+ Type: `boolean`\
231
+ Default: `true`
232
+
233
+ Remove a sole `/` pathname in the output. This option is independant of `removeTrailingSlash`.
234
+
235
+ ```js
236
+ normalizeUrl('https://sindresorhus.com/');
237
+ //=> 'https://sindresorhus.com'
238
+
239
+ normalizeUrl('https://sindresorhus.com/', {removeSingleSlash: false});
240
+ //=> 'https://sindresorhus.com/'
241
+ ```
242
+
243
+
244
+ ##### removeDirectoryIndex
245
+
246
+ Type: `boolean | Array<RegExp | string>`\
247
+ Default: `false`
248
+
249
+ Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used.
250
+
251
+ ```js
252
+ normalizeUrl('www.sindresorhus.com/foo/default.php', {
253
+ removeDirectoryIndex: [/^default\.[a-z]+$/]
254
+ });
255
+ //=> 'http://sindresorhus.com/foo'
256
+ ```
257
+
258
+ ##### sortQueryParameters
259
+
260
+ Type: `boolean`\
261
+ Default: `true`
262
+
263
+ Sorts the query parameters alphabetically by key.
264
+
265
+ ```js
266
+ normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
267
+ sortQueryParameters: false
268
+ });
269
+ //=> 'http://sindresorhus.com/?b=two&a=one&c=three'
270
+ ```
271
+
272
+ ## Related
273
+
274
+ - [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them
275
+
276
+ ---
277
+
278
+ <div align="center">
279
+ <b>
280
+ <a href="https://tidelift.com/subscription/pkg/npm-normalize-url?utm_source=npm-normalize-url&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
281
+ </b>
282
+ <br>
283
+ <sub>
284
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
285
+ </sub>
286
+ </div>
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,79 @@
1
+ # once
2
+
3
+ Only call a function once.
4
+
5
+ ## usage
6
+
7
+ ```javascript
8
+ var once = require('once')
9
+
10
+ function load (file, cb) {
11
+ cb = once(cb)
12
+ loader.load('file')
13
+ loader.once('load', cb)
14
+ loader.once('error', cb)
15
+ }
16
+ ```
17
+
18
+ Or add to the Function.prototype in a responsible way:
19
+
20
+ ```javascript
21
+ // only has to be done once
22
+ require('once').proto()
23
+
24
+ function load (file, cb) {
25
+ cb = cb.once()
26
+ loader.load('file')
27
+ loader.once('load', cb)
28
+ loader.once('error', cb)
29
+ }
30
+ ```
31
+
32
+ Ironically, the prototype feature makes this module twice as
33
+ complicated as necessary.
34
+
35
+ To check whether you function has been called, use `fn.called`. Once the
36
+ function is called for the first time the return value of the original
37
+ function is saved in `fn.value` and subsequent calls will continue to
38
+ return this value.
39
+
40
+ ```javascript
41
+ var once = require('once')
42
+
43
+ function load (cb) {
44
+ cb = once(cb)
45
+ var stream = createStream()
46
+ stream.once('data', cb)
47
+ stream.once('end', function () {
48
+ if (!cb.called) cb(new Error('not found'))
49
+ })
50
+ }
51
+ ```
52
+
53
+ ## `once.strict(func)`
54
+
55
+ Throw an error if the function is called twice.
56
+
57
+ Some functions are expected to be called only once. Using `once` for them would
58
+ potentially hide logical errors.
59
+
60
+ In the example below, the `greet` function has to call the callback only once:
61
+
62
+ ```javascript
63
+ function greet (name, cb) {
64
+ // return is missing from the if statement
65
+ // when no name is passed, the callback is called twice
66
+ if (!name) cb('Hello anonymous')
67
+ cb('Hello ' + name)
68
+ }
69
+
70
+ function log (msg) {
71
+ console.log(msg)
72
+ }
73
+
74
+ // this will print 'Hello anonymous' but the logical error will be missed
75
+ greet(null, once(msg))
76
+
77
+ // once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
78
+ greet(null, once.strict(msg))
79
+ ```
@@ -0,0 +1,42 @@
1
+ var wrappy = require('wrappy')
2
+ module.exports = wrappy(once)
3
+ module.exports.strict = wrappy(onceStrict)
4
+
5
+ once.proto = once(function () {
6
+ Object.defineProperty(Function.prototype, 'once', {
7
+ value: function () {
8
+ return once(this)
9
+ },
10
+ configurable: true
11
+ })
12
+
13
+ Object.defineProperty(Function.prototype, 'onceStrict', {
14
+ value: function () {
15
+ return onceStrict(this)
16
+ },
17
+ configurable: true
18
+ })
19
+ })
20
+
21
+ function once (fn) {
22
+ var f = function () {
23
+ if (f.called) return f.value
24
+ f.called = true
25
+ return f.value = fn.apply(this, arguments)
26
+ }
27
+ f.called = false
28
+ return f
29
+ }
30
+
31
+ function onceStrict (fn) {
32
+ var f = function () {
33
+ if (f.called)
34
+ throw new Error(f.onceError)
35
+ f.called = true
36
+ return f.value = fn.apply(this, arguments)
37
+ }
38
+ var name = fn.name || 'Function wrapped with `once`'
39
+ f.onceError = name + " shouldn't be called more than once"
40
+ f.called = false
41
+ return f
42
+ }