@pnpm/exe 11.0.0-alpha.5 → 11.0.0-alpha.7

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 (686) hide show
  1. package/dist/node-gyp-bin/node-gyp +6 -0
  2. package/dist/node-gyp-bin/node-gyp.cmd +5 -0
  3. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +16 -0
  4. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +170 -0
  5. package/dist/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +307 -0
  6. package/dist/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +7 -0
  7. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.js +322 -0
  8. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +12 -0
  9. package/dist/node_modules/@isaacs/cliui/dist/commonjs/package.json +3 -0
  10. package/dist/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +49 -0
  11. package/dist/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +8 -0
  12. package/dist/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +176 -0
  13. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +12 -0
  14. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +167 -0
  15. package/dist/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +299 -0
  16. package/dist/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +3 -0
  17. package/dist/node_modules/@isaacs/cliui/dist/esm/index.js +317 -0
  18. package/dist/node_modules/@isaacs/cliui/dist/esm/index.min.js +12 -0
  19. package/dist/node_modules/@isaacs/cliui/dist/esm/package.json +3 -0
  20. package/dist/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +46 -0
  21. package/dist/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +4 -0
  22. package/dist/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +172 -0
  23. package/dist/node_modules/@isaacs/cliui/package.json +163 -0
  24. package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  25. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  26. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  27. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  28. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  29. package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
  30. package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
  31. package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
  32. package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
  33. package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
  34. package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
  35. package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
  36. package/dist/node_modules/@npmcli/agent/package.json +60 -0
  37. package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
  38. package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
  39. package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
  40. package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
  41. package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
  42. package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
  43. package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
  44. package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
  45. package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
  46. package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
  47. package/dist/node_modules/@npmcli/fs/package.json +54 -0
  48. package/dist/node_modules/abbrev/LICENSE +46 -0
  49. package/dist/node_modules/abbrev/lib/index.js +53 -0
  50. package/dist/node_modules/abbrev/package.json +45 -0
  51. package/dist/node_modules/agent-base/LICENSE +22 -0
  52. package/dist/node_modules/agent-base/dist/helpers.js +66 -0
  53. package/dist/node_modules/agent-base/dist/index.js +178 -0
  54. package/dist/node_modules/agent-base/package.json +46 -0
  55. package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  56. package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  57. package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
  58. package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
  59. package/dist/node_modules/balanced-match/package.json +71 -0
  60. package/dist/node_modules/brace-expansion/LICENSE +23 -0
  61. package/dist/node_modules/brace-expansion/dist/commonjs/index.js +199 -0
  62. package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  63. package/dist/node_modules/brace-expansion/dist/esm/index.js +195 -0
  64. package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
  65. package/dist/node_modules/brace-expansion/package.json +64 -0
  66. package/dist/node_modules/cacache/lib/content/path.js +29 -0
  67. package/dist/node_modules/cacache/lib/content/read.js +165 -0
  68. package/dist/node_modules/cacache/lib/content/rm.js +18 -0
  69. package/dist/node_modules/cacache/lib/content/write.js +206 -0
  70. package/dist/node_modules/cacache/lib/entry-index.js +336 -0
  71. package/dist/node_modules/cacache/lib/get.js +170 -0
  72. package/dist/node_modules/cacache/lib/index.js +42 -0
  73. package/dist/node_modules/cacache/lib/memoization.js +72 -0
  74. package/dist/node_modules/cacache/lib/put.js +80 -0
  75. package/dist/node_modules/cacache/lib/rm.js +31 -0
  76. package/dist/node_modules/cacache/lib/util/glob.js +7 -0
  77. package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
  78. package/dist/node_modules/cacache/lib/util/tmp.js +26 -0
  79. package/dist/node_modules/cacache/lib/verify.js +258 -0
  80. package/dist/node_modules/cacache/package.json +83 -0
  81. package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
  82. package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
  83. package/dist/node_modules/chownr/dist/esm/index.js +85 -0
  84. package/dist/node_modules/chownr/dist/esm/package.json +3 -0
  85. package/dist/node_modules/chownr/package.json +69 -0
  86. package/dist/node_modules/cross-spawn/LICENSE +21 -0
  87. package/dist/node_modules/cross-spawn/index.js +39 -0
  88. package/dist/node_modules/cross-spawn/lib/enoent.js +59 -0
  89. package/dist/node_modules/cross-spawn/lib/parse.js +91 -0
  90. package/dist/node_modules/cross-spawn/lib/util/escape.js +47 -0
  91. package/dist/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
  92. package/dist/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
  93. package/dist/node_modules/cross-spawn/package.json +73 -0
  94. package/dist/node_modules/debug/LICENSE +20 -0
  95. package/dist/node_modules/debug/package.json +64 -0
  96. package/dist/node_modules/debug/src/browser.js +272 -0
  97. package/dist/node_modules/debug/src/common.js +292 -0
  98. package/dist/node_modules/debug/src/index.js +10 -0
  99. package/dist/node_modules/debug/src/node.js +263 -0
  100. package/dist/node_modules/encoding/.prettierrc.js +8 -0
  101. package/dist/node_modules/encoding/LICENSE +16 -0
  102. package/dist/node_modules/encoding/lib/encoding.js +83 -0
  103. package/dist/node_modules/encoding/package.json +18 -0
  104. package/dist/node_modules/env-paths/index.js +74 -0
  105. package/dist/node_modules/env-paths/license +9 -0
  106. package/dist/node_modules/env-paths/package.json +45 -0
  107. package/dist/node_modules/err-code/.eslintrc.json +7 -0
  108. package/dist/node_modules/err-code/bower.json +30 -0
  109. package/dist/node_modules/err-code/index.js +47 -0
  110. package/dist/node_modules/err-code/index.umd.js +51 -0
  111. package/dist/node_modules/err-code/package.json +34 -0
  112. package/dist/node_modules/exponential-backoff/LICENSE +202 -0
  113. package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
  114. package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
  115. package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
  116. package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
  117. package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
  118. package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
  119. package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
  120. package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
  121. package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
  122. package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
  123. package/dist/node_modules/exponential-backoff/package.json +62 -0
  124. package/dist/node_modules/fdir/LICENSE +7 -0
  125. package/dist/node_modules/fdir/dist/index.cjs +588 -0
  126. package/dist/node_modules/fdir/dist/index.d.cts +155 -0
  127. package/dist/node_modules/fdir/dist/index.d.mts +155 -0
  128. package/dist/node_modules/fdir/dist/index.mjs +570 -0
  129. package/dist/node_modules/fdir/package.json +103 -0
  130. package/dist/node_modules/foreground-child/LICENSE +15 -0
  131. package/dist/node_modules/foreground-child/dist/commonjs/all-signals.js +58 -0
  132. package/dist/node_modules/foreground-child/dist/commonjs/index.js +123 -0
  133. package/dist/node_modules/foreground-child/dist/commonjs/package.json +3 -0
  134. package/dist/node_modules/foreground-child/dist/commonjs/proxy-signals.js +38 -0
  135. package/dist/node_modules/foreground-child/dist/commonjs/watchdog.js +50 -0
  136. package/dist/node_modules/foreground-child/dist/esm/all-signals.js +52 -0
  137. package/dist/node_modules/foreground-child/dist/esm/index.js +115 -0
  138. package/dist/node_modules/foreground-child/dist/esm/package.json +3 -0
  139. package/dist/node_modules/foreground-child/dist/esm/proxy-signals.js +34 -0
  140. package/dist/node_modules/foreground-child/dist/esm/watchdog.js +46 -0
  141. package/dist/node_modules/foreground-child/package.json +106 -0
  142. package/dist/node_modules/fs-minipass/LICENSE +15 -0
  143. package/dist/node_modules/fs-minipass/lib/index.js +443 -0
  144. package/dist/node_modules/fs-minipass/package.json +54 -0
  145. package/dist/node_modules/glob/dist/commonjs/glob.js +247 -0
  146. package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  147. package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
  148. package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
  149. package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
  150. package/dist/node_modules/glob/dist/commonjs/pattern.js +219 -0
  151. package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
  152. package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
  153. package/dist/node_modules/glob/dist/esm/bin.d.mts +3 -0
  154. package/dist/node_modules/glob/dist/esm/bin.mjs +346 -0
  155. package/dist/node_modules/glob/dist/esm/glob.js +243 -0
  156. package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
  157. package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
  158. package/dist/node_modules/glob/dist/esm/index.js +55 -0
  159. package/dist/node_modules/glob/dist/esm/package.json +3 -0
  160. package/dist/node_modules/glob/dist/esm/pattern.js +215 -0
  161. package/dist/node_modules/glob/dist/esm/processor.js +294 -0
  162. package/dist/node_modules/glob/dist/esm/walker.js +381 -0
  163. package/dist/node_modules/glob/package.json +97 -0
  164. package/dist/node_modules/graceful-fs/LICENSE +15 -0
  165. package/dist/node_modules/graceful-fs/clone.js +23 -0
  166. package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
  167. package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
  168. package/dist/node_modules/graceful-fs/package.json +53 -0
  169. package/dist/node_modules/graceful-fs/polyfills.js +355 -0
  170. package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
  171. package/dist/node_modules/http-cache-semantics/index.js +928 -0
  172. package/dist/node_modules/http-cache-semantics/package.json +22 -0
  173. package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
  174. package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
  175. package/dist/node_modules/http-proxy-agent/package.json +47 -0
  176. package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
  177. package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
  178. package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  179. package/dist/node_modules/https-proxy-agent/package.json +50 -0
  180. package/dist/node_modules/iconv-lite/.github/dependabot.yml +11 -0
  181. package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
  182. package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
  183. package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
  184. package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
  185. package/dist/node_modules/iconv-lite/.idea/modules.xml +8 -0
  186. package/dist/node_modules/iconv-lite/.idea/vcs.xml +6 -0
  187. package/dist/node_modules/iconv-lite/LICENSE +21 -0
  188. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  189. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  190. package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
  191. package/dist/node_modules/iconv-lite/encodings/internal.js +198 -0
  192. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  193. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  194. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  195. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  196. package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  197. package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  198. package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  199. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  200. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  201. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  202. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  203. package/dist/node_modules/iconv-lite/encodings/utf16.js +197 -0
  204. package/dist/node_modules/iconv-lite/encodings/utf32.js +319 -0
  205. package/dist/node_modules/iconv-lite/encodings/utf7.js +290 -0
  206. package/dist/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  207. package/dist/node_modules/iconv-lite/lib/index.js +180 -0
  208. package/dist/node_modules/iconv-lite/lib/streams.js +109 -0
  209. package/dist/node_modules/iconv-lite/package.json +44 -0
  210. package/dist/node_modules/imurmurhash/imurmurhash.js +138 -0
  211. package/dist/node_modules/imurmurhash/imurmurhash.min.js +12 -0
  212. package/dist/node_modules/imurmurhash/package.json +40 -0
  213. package/dist/node_modules/ip-address/LICENSE +19 -0
  214. package/dist/node_modules/ip-address/dist/address-error.js +12 -0
  215. package/dist/node_modules/ip-address/dist/common.js +46 -0
  216. package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
  217. package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
  218. package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
  219. package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
  220. package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
  221. package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
  222. package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
  223. package/dist/node_modules/ip-address/package.json +78 -0
  224. package/dist/node_modules/isexe/LICENSE +15 -0
  225. package/dist/node_modules/isexe/index.js +57 -0
  226. package/dist/node_modules/isexe/mode.js +41 -0
  227. package/dist/node_modules/isexe/package.json +31 -0
  228. package/dist/node_modules/isexe/windows.js +42 -0
  229. package/dist/node_modules/jackspeak/dist/commonjs/index.js +944 -0
  230. package/dist/node_modules/jackspeak/dist/commonjs/index.min.js +33 -0
  231. package/dist/node_modules/jackspeak/dist/commonjs/package.json +3 -0
  232. package/dist/node_modules/jackspeak/dist/esm/index.js +936 -0
  233. package/dist/node_modules/jackspeak/dist/esm/index.min.js +33 -0
  234. package/dist/node_modules/jackspeak/dist/esm/package.json +3 -0
  235. package/dist/node_modules/jackspeak/package.json +115 -0
  236. package/dist/node_modules/lru-cache/LICENSE +15 -0
  237. package/dist/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
  238. package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  239. package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  240. package/dist/node_modules/lru-cache/dist/esm/index.js +1542 -0
  241. package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  242. package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
  243. package/dist/node_modules/lru-cache/package.json +116 -0
  244. package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
  245. package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
  246. package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
  247. package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
  248. package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
  249. package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
  250. package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
  251. package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
  252. package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
  253. package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
  254. package/dist/node_modules/make-fetch-happen/lib/remote.js +132 -0
  255. package/dist/node_modules/make-fetch-happen/package.json +74 -0
  256. package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  257. package/dist/node_modules/minimatch/dist/commonjs/ast.js +601 -0
  258. package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  259. package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  260. package/dist/node_modules/minimatch/dist/commonjs/index.js +1035 -0
  261. package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
  262. package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  263. package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  264. package/dist/node_modules/minimatch/dist/esm/ast.js +597 -0
  265. package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  266. package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
  267. package/dist/node_modules/minimatch/dist/esm/index.js +1022 -0
  268. package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
  269. package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
  270. package/dist/node_modules/minimatch/package.json +67 -0
  271. package/dist/node_modules/minipass/LICENSE +15 -0
  272. package/dist/node_modules/minipass/dist/commonjs/index.js +1028 -0
  273. package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
  274. package/dist/node_modules/minipass/dist/esm/index.js +1018 -0
  275. package/dist/node_modules/minipass/dist/esm/package.json +3 -0
  276. package/dist/node_modules/minipass/package.json +82 -0
  277. package/dist/node_modules/minipass-collect/LICENSE +15 -0
  278. package/dist/node_modules/minipass-collect/index.js +71 -0
  279. package/dist/node_modules/minipass-collect/package.json +30 -0
  280. package/dist/node_modules/minipass-fetch/LICENSE +28 -0
  281. package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
  282. package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
  283. package/dist/node_modules/minipass-fetch/lib/body.js +350 -0
  284. package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
  285. package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
  286. package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
  287. package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
  288. package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
  289. package/dist/node_modules/minipass-fetch/package.json +70 -0
  290. package/dist/node_modules/minipass-flush/LICENSE +15 -0
  291. package/dist/node_modules/minipass-flush/index.js +39 -0
  292. package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
  293. package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
  294. package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
  295. package/dist/node_modules/minipass-flush/package.json +39 -0
  296. package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
  297. package/dist/node_modules/minipass-pipeline/index.js +128 -0
  298. package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
  299. package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
  300. package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
  301. package/dist/node_modules/minipass-pipeline/package.json +29 -0
  302. package/dist/node_modules/minipass-sized/LICENSE +15 -0
  303. package/dist/node_modules/minipass-sized/index.js +67 -0
  304. package/dist/node_modules/minipass-sized/node_modules/minipass/LICENSE +15 -0
  305. package/dist/node_modules/minipass-sized/node_modules/minipass/index.js +649 -0
  306. package/dist/node_modules/minipass-sized/node_modules/minipass/package.json +56 -0
  307. package/dist/node_modules/minipass-sized/package-lock.json +3464 -0
  308. package/dist/node_modules/minipass-sized/package.json +39 -0
  309. package/dist/node_modules/minizlib/LICENSE +26 -0
  310. package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  311. package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
  312. package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
  313. package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
  314. package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
  315. package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
  316. package/dist/node_modules/minizlib/package.json +80 -0
  317. package/dist/node_modules/ms/index.js +162 -0
  318. package/dist/node_modules/ms/package.json +38 -0
  319. package/dist/node_modules/negotiator/LICENSE +24 -0
  320. package/dist/node_modules/negotiator/index.js +83 -0
  321. package/dist/node_modules/negotiator/lib/charset.js +169 -0
  322. package/dist/node_modules/negotiator/lib/encoding.js +205 -0
  323. package/dist/node_modules/negotiator/lib/language.js +179 -0
  324. package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
  325. package/dist/node_modules/negotiator/package.json +43 -0
  326. package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
  327. package/dist/node_modules/node-gyp/LICENSE +24 -0
  328. package/dist/node_modules/node-gyp/addon.gypi +204 -0
  329. package/dist/node_modules/node-gyp/bin/node-gyp.js +138 -0
  330. package/dist/node_modules/node-gyp/eslint.config.js +3 -0
  331. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
  332. package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
  333. package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
  334. package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
  335. package/dist/node_modules/node-gyp/gyp/gyp +8 -0
  336. package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
  337. package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
  338. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
  339. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
  340. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
  341. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
  342. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
  343. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
  344. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
  345. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +574 -0
  346. package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
  347. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
  348. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
  349. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
  350. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
  351. package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
  352. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  353. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
  354. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
  355. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
  356. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
  357. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
  358. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
  359. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
  360. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
  361. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
  362. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
  363. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
  364. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2957 -0
  365. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
  366. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
  367. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
  368. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
  369. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
  370. package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
  371. package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
  372. package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
  373. package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
  374. package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
  375. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
  376. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
  377. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
  378. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
  379. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
  380. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
  381. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
  382. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
  383. package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
  384. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
  385. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
  386. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
  387. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
  388. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
  389. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
  390. package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
  391. package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
  392. package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  393. package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
  394. package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
  395. package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
  396. package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
  397. package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
  398. package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
  399. package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
  400. package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
  401. package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
  402. package/dist/node_modules/node-gyp/lib/build.js +230 -0
  403. package/dist/node_modules/node-gyp/lib/clean.js +15 -0
  404. package/dist/node_modules/node-gyp/lib/configure.js +328 -0
  405. package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
  406. package/dist/node_modules/node-gyp/lib/download.js +39 -0
  407. package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
  408. package/dist/node_modules/node-gyp/lib/find-python.js +310 -0
  409. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +600 -0
  410. package/dist/node_modules/node-gyp/lib/install.js +411 -0
  411. package/dist/node_modules/node-gyp/lib/list.js +26 -0
  412. package/dist/node_modules/node-gyp/lib/log.js +168 -0
  413. package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
  414. package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
  415. package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
  416. package/dist/node_modules/node-gyp/lib/remove.js +43 -0
  417. package/dist/node_modules/node-gyp/lib/util.js +81 -0
  418. package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
  419. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/index.js +56 -0
  420. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/index.min.js +2 -0
  421. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/options.js +3 -0
  422. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/package.json +3 -0
  423. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/posix.js +67 -0
  424. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/win32.js +63 -0
  425. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/index.js +16 -0
  426. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/index.min.js +2 -0
  427. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/options.js +2 -0
  428. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/package.json +3 -0
  429. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/posix.js +62 -0
  430. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/win32.js +58 -0
  431. package/dist/node_modules/node-gyp/node_modules/isexe/package.json +78 -0
  432. package/dist/node_modules/node-gyp/node_modules/which/LICENSE +15 -0
  433. package/dist/node_modules/node-gyp/node_modules/which/bin/which.js +52 -0
  434. package/dist/node_modules/node-gyp/node_modules/which/lib/index.js +111 -0
  435. package/dist/node_modules/node-gyp/node_modules/which/package.json +52 -0
  436. package/dist/node_modules/node-gyp/package.json +52 -0
  437. package/dist/node_modules/node-gyp/release-please-config.json +40 -0
  438. package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
  439. package/dist/node_modules/nopt/LICENSE +15 -0
  440. package/dist/node_modules/nopt/bin/nopt.js +29 -0
  441. package/dist/node_modules/nopt/lib/debug.js +5 -0
  442. package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
  443. package/dist/node_modules/nopt/lib/nopt.js +34 -0
  444. package/dist/node_modules/nopt/lib/type-defs.js +91 -0
  445. package/dist/node_modules/nopt/package.json +52 -0
  446. package/dist/node_modules/p-map/index.js +283 -0
  447. package/dist/node_modules/p-map/license +9 -0
  448. package/dist/node_modules/p-map/package.json +57 -0
  449. package/dist/node_modules/package-json-from-dist/dist/commonjs/index.js +134 -0
  450. package/dist/node_modules/package-json-from-dist/dist/commonjs/package.json +3 -0
  451. package/dist/node_modules/package-json-from-dist/dist/esm/index.js +129 -0
  452. package/dist/node_modules/package-json-from-dist/dist/esm/package.json +3 -0
  453. package/dist/node_modules/package-json-from-dist/package.json +68 -0
  454. package/dist/node_modules/path-key/index.js +16 -0
  455. package/dist/node_modules/path-key/license +9 -0
  456. package/dist/node_modules/path-key/package.json +39 -0
  457. package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  458. package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  459. package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
  460. package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
  461. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1589 -0
  462. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  463. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  464. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1585 -0
  465. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  466. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
  467. package/dist/node_modules/path-scurry/node_modules/lru-cache/package.json +101 -0
  468. package/dist/node_modules/path-scurry/package.json +88 -0
  469. package/dist/node_modules/picomatch/LICENSE +21 -0
  470. package/dist/node_modules/picomatch/index.js +17 -0
  471. package/dist/node_modules/picomatch/lib/constants.js +180 -0
  472. package/dist/node_modules/picomatch/lib/parse.js +1085 -0
  473. package/dist/node_modules/picomatch/lib/picomatch.js +341 -0
  474. package/dist/node_modules/picomatch/lib/scan.js +391 -0
  475. package/dist/node_modules/picomatch/lib/utils.js +72 -0
  476. package/dist/node_modules/picomatch/package.json +83 -0
  477. package/dist/node_modules/picomatch/posix.js +3 -0
  478. package/dist/node_modules/proc-log/LICENSE +15 -0
  479. package/dist/node_modules/proc-log/lib/index.js +153 -0
  480. package/dist/node_modules/proc-log/package.json +46 -0
  481. package/dist/node_modules/promise-retry/LICENSE +19 -0
  482. package/dist/node_modules/promise-retry/index.js +52 -0
  483. package/dist/node_modules/promise-retry/package.json +37 -0
  484. package/dist/node_modules/retry/License +21 -0
  485. package/dist/node_modules/retry/equation.gif +0 -0
  486. package/dist/node_modules/retry/index.js +1 -0
  487. package/dist/node_modules/retry/lib/retry.js +100 -0
  488. package/dist/node_modules/retry/lib/retry_operation.js +158 -0
  489. package/dist/node_modules/retry/package.json +32 -0
  490. package/dist/node_modules/safer-buffer/LICENSE +21 -0
  491. package/dist/node_modules/safer-buffer/dangerous.js +58 -0
  492. package/dist/node_modules/safer-buffer/package.json +34 -0
  493. package/dist/node_modules/safer-buffer/safer.js +77 -0
  494. package/dist/node_modules/safer-buffer/tests.js +406 -0
  495. package/dist/node_modules/semver/LICENSE +15 -0
  496. package/dist/node_modules/semver/bin/semver.js +191 -0
  497. package/dist/node_modules/semver/classes/comparator.js +143 -0
  498. package/dist/node_modules/semver/classes/index.js +7 -0
  499. package/dist/node_modules/semver/classes/range.js +557 -0
  500. package/dist/node_modules/semver/classes/semver.js +333 -0
  501. package/dist/node_modules/semver/functions/clean.js +8 -0
  502. package/dist/node_modules/semver/functions/cmp.js +54 -0
  503. package/dist/node_modules/semver/functions/coerce.js +62 -0
  504. package/dist/node_modules/semver/functions/compare-build.js +9 -0
  505. package/dist/node_modules/semver/functions/compare-loose.js +5 -0
  506. package/dist/node_modules/semver/functions/compare.js +7 -0
  507. package/dist/node_modules/semver/functions/diff.js +60 -0
  508. package/dist/node_modules/semver/functions/eq.js +5 -0
  509. package/dist/node_modules/semver/functions/gt.js +5 -0
  510. package/dist/node_modules/semver/functions/gte.js +5 -0
  511. package/dist/node_modules/semver/functions/inc.js +21 -0
  512. package/dist/node_modules/semver/functions/lt.js +5 -0
  513. package/dist/node_modules/semver/functions/lte.js +5 -0
  514. package/dist/node_modules/semver/functions/major.js +5 -0
  515. package/dist/node_modules/semver/functions/minor.js +5 -0
  516. package/dist/node_modules/semver/functions/neq.js +5 -0
  517. package/dist/node_modules/semver/functions/parse.js +18 -0
  518. package/dist/node_modules/semver/functions/patch.js +5 -0
  519. package/dist/node_modules/semver/functions/prerelease.js +8 -0
  520. package/dist/node_modules/semver/functions/rcompare.js +5 -0
  521. package/dist/node_modules/semver/functions/rsort.js +5 -0
  522. package/dist/node_modules/semver/functions/satisfies.js +12 -0
  523. package/dist/node_modules/semver/functions/sort.js +5 -0
  524. package/dist/node_modules/semver/functions/valid.js +8 -0
  525. package/dist/node_modules/semver/index.js +91 -0
  526. package/dist/node_modules/semver/internal/constants.js +37 -0
  527. package/dist/node_modules/semver/internal/debug.js +11 -0
  528. package/dist/node_modules/semver/internal/identifiers.js +29 -0
  529. package/dist/node_modules/semver/internal/lrucache.js +42 -0
  530. package/dist/node_modules/semver/internal/parse-options.js +17 -0
  531. package/dist/node_modules/semver/internal/re.js +223 -0
  532. package/dist/node_modules/semver/package.json +78 -0
  533. package/dist/node_modules/semver/preload.js +4 -0
  534. package/dist/node_modules/semver/range.bnf +16 -0
  535. package/dist/node_modules/semver/ranges/gtr.js +6 -0
  536. package/dist/node_modules/semver/ranges/intersects.js +9 -0
  537. package/dist/node_modules/semver/ranges/ltr.js +6 -0
  538. package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
  539. package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
  540. package/dist/node_modules/semver/ranges/min-version.js +63 -0
  541. package/dist/node_modules/semver/ranges/outside.js +82 -0
  542. package/dist/node_modules/semver/ranges/simplify.js +49 -0
  543. package/dist/node_modules/semver/ranges/subset.js +249 -0
  544. package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
  545. package/dist/node_modules/semver/ranges/valid.js +13 -0
  546. package/dist/node_modules/shebang-command/index.js +19 -0
  547. package/dist/node_modules/shebang-command/license +9 -0
  548. package/dist/node_modules/shebang-command/package.json +34 -0
  549. package/dist/node_modules/shebang-regex/index.js +2 -0
  550. package/dist/node_modules/shebang-regex/license +9 -0
  551. package/dist/node_modules/shebang-regex/package.json +35 -0
  552. package/dist/node_modules/signal-exit/LICENSE.txt +16 -0
  553. package/dist/node_modules/signal-exit/dist/cjs/browser.js +10 -0
  554. package/dist/node_modules/signal-exit/dist/cjs/index.js +279 -0
  555. package/dist/node_modules/signal-exit/dist/cjs/package.json +3 -0
  556. package/dist/node_modules/signal-exit/dist/cjs/signals.js +42 -0
  557. package/dist/node_modules/signal-exit/dist/mjs/browser.js +4 -0
  558. package/dist/node_modules/signal-exit/dist/mjs/index.js +275 -0
  559. package/dist/node_modules/signal-exit/dist/mjs/package.json +3 -0
  560. package/dist/node_modules/signal-exit/dist/mjs/signals.js +39 -0
  561. package/dist/node_modules/signal-exit/package.json +106 -0
  562. package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
  563. package/dist/node_modules/smart-buffer/LICENSE +20 -0
  564. package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
  565. package/dist/node_modules/smart-buffer/build/utils.js +108 -0
  566. package/dist/node_modules/smart-buffer/package.json +79 -0
  567. package/dist/node_modules/socks/.eslintrc.cjs +11 -0
  568. package/dist/node_modules/socks/.prettierrc.yaml +7 -0
  569. package/dist/node_modules/socks/LICENSE +20 -0
  570. package/dist/node_modules/socks/build/client/socksclient.js +793 -0
  571. package/dist/node_modules/socks/build/common/constants.js +108 -0
  572. package/dist/node_modules/socks/build/common/helpers.js +167 -0
  573. package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
  574. package/dist/node_modules/socks/build/common/util.js +25 -0
  575. package/dist/node_modules/socks/build/index.js +18 -0
  576. package/dist/node_modules/socks/package.json +58 -0
  577. package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
  578. package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
  579. package/dist/node_modules/socks-proxy-agent/package.json +142 -0
  580. package/dist/node_modules/ssri/lib/index.js +580 -0
  581. package/dist/node_modules/ssri/package.json +66 -0
  582. package/dist/node_modules/tar/dist/commonjs/create.js +83 -0
  583. package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  584. package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
  585. package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +29 -0
  586. package/dist/node_modules/tar/dist/commonjs/header.js +325 -0
  587. package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
  588. package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
  589. package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  590. package/dist/node_modules/tar/dist/commonjs/list.js +150 -0
  591. package/dist/node_modules/tar/dist/commonjs/make-command.js +61 -0
  592. package/dist/node_modules/tar/dist/commonjs/mkdir.js +188 -0
  593. package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  594. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  595. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  596. package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
  597. package/dist/node_modules/tar/dist/commonjs/pack.js +516 -0
  598. package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
  599. package/dist/node_modules/tar/dist/commonjs/parse.js +620 -0
  600. package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  601. package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
  602. package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  603. package/dist/node_modules/tar/dist/commonjs/read-entry.js +140 -0
  604. package/dist/node_modules/tar/dist/commonjs/replace.js +232 -0
  605. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  606. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  607. package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  608. package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
  609. package/dist/node_modules/tar/dist/commonjs/unpack.js +957 -0
  610. package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
  611. package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  612. package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
  613. package/dist/node_modules/tar/dist/commonjs/write-entry.js +699 -0
  614. package/dist/node_modules/tar/dist/esm/create.js +77 -0
  615. package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
  616. package/dist/node_modules/tar/dist/esm/extract.js +49 -0
  617. package/dist/node_modules/tar/dist/esm/get-write-flag.js +23 -0
  618. package/dist/node_modules/tar/dist/esm/header.js +288 -0
  619. package/dist/node_modules/tar/dist/esm/index.js +20 -0
  620. package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
  621. package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
  622. package/dist/node_modules/tar/dist/esm/list.js +110 -0
  623. package/dist/node_modules/tar/dist/esm/make-command.js +57 -0
  624. package/dist/node_modules/tar/dist/esm/mkdir.js +180 -0
  625. package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
  626. package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  627. package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  628. package/dist/node_modules/tar/dist/esm/options.js +54 -0
  629. package/dist/node_modules/tar/dist/esm/pack.js +474 -0
  630. package/dist/node_modules/tar/dist/esm/package.json +3 -0
  631. package/dist/node_modules/tar/dist/esm/parse.js +616 -0
  632. package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
  633. package/dist/node_modules/tar/dist/esm/pax.js +154 -0
  634. package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
  635. package/dist/node_modules/tar/dist/esm/read-entry.js +136 -0
  636. package/dist/node_modules/tar/dist/esm/replace.js +226 -0
  637. package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  638. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  639. package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
  640. package/dist/node_modules/tar/dist/esm/types.js +45 -0
  641. package/dist/node_modules/tar/dist/esm/unpack.js +916 -0
  642. package/dist/node_modules/tar/dist/esm/update.js +30 -0
  643. package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
  644. package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
  645. package/dist/node_modules/tar/dist/esm/write-entry.js +657 -0
  646. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
  647. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
  648. package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
  649. package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
  650. package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
  651. package/dist/node_modules/tar/package.json +292 -0
  652. package/dist/node_modules/tinyglobby/LICENSE +21 -0
  653. package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
  654. package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
  655. package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
  656. package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
  657. package/dist/node_modules/tinyglobby/package.json +73 -0
  658. package/dist/node_modules/unique-filename/LICENSE +5 -0
  659. package/dist/node_modules/unique-filename/lib/index.js +7 -0
  660. package/dist/node_modules/unique-filename/package.json +53 -0
  661. package/dist/node_modules/unique-slug/LICENSE +15 -0
  662. package/dist/node_modules/unique-slug/lib/index.js +11 -0
  663. package/dist/node_modules/unique-slug/package.json +49 -0
  664. package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
  665. package/dist/node_modules/v8-compile-cache/package.json +34 -0
  666. package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
  667. package/dist/node_modules/which/LICENSE +15 -0
  668. package/dist/node_modules/which/bin/node-which +52 -0
  669. package/dist/node_modules/which/package.json +43 -0
  670. package/dist/node_modules/which/which.js +125 -0
  671. package/dist/node_modules/yallist/LICENSE +15 -0
  672. package/dist/node_modules/yallist/iterator.js +8 -0
  673. package/dist/node_modules/yallist/package.json +29 -0
  674. package/dist/node_modules/yallist/yallist.js +426 -0
  675. package/dist/pnpm.mjs +231795 -0
  676. package/dist/pnpmrc +2 -0
  677. package/dist/templates/completion.bash +31 -0
  678. package/dist/templates/completion.fish +22 -0
  679. package/dist/templates/completion.ps1 +193 -0
  680. package/dist/templates/completion.zsh +27 -0
  681. package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
  682. package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
  683. package/dist/worker.js +11930 -0
  684. package/package.json +17 -9
  685. package/setup.js +2 -1
  686. package/CHANGELOG.md +0 -15
@@ -0,0 +1,1546 @@
1
+ "use strict";
2
+ /**
3
+ * @module LRUCache
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LRUCache = void 0;
7
+ const perf = typeof performance === 'object' &&
8
+ performance &&
9
+ typeof performance.now === 'function'
10
+ ? performance
11
+ : Date;
12
+ const warned = new Set();
13
+ /* c8 ignore start */
14
+ const PROCESS = (typeof process === 'object' && !!process ? process : {});
15
+ /* c8 ignore start */
16
+ const emitWarning = (msg, type, code, fn) => {
17
+ typeof PROCESS.emitWarning === 'function'
18
+ ? PROCESS.emitWarning(msg, type, code, fn)
19
+ : console.error(`[${code}] ${type}: ${msg}`);
20
+ };
21
+ let AC = globalThis.AbortController;
22
+ let AS = globalThis.AbortSignal;
23
+ /* c8 ignore start */
24
+ if (typeof AC === 'undefined') {
25
+ //@ts-ignore
26
+ AS = class AbortSignal {
27
+ onabort;
28
+ _onabort = [];
29
+ reason;
30
+ aborted = false;
31
+ addEventListener(_, fn) {
32
+ this._onabort.push(fn);
33
+ }
34
+ };
35
+ //@ts-ignore
36
+ AC = class AbortController {
37
+ constructor() {
38
+ warnACPolyfill();
39
+ }
40
+ signal = new AS();
41
+ abort(reason) {
42
+ if (this.signal.aborted)
43
+ return;
44
+ //@ts-ignore
45
+ this.signal.reason = reason;
46
+ //@ts-ignore
47
+ this.signal.aborted = true;
48
+ //@ts-ignore
49
+ for (const fn of this.signal._onabort) {
50
+ fn(reason);
51
+ }
52
+ this.signal.onabort?.(reason);
53
+ }
54
+ };
55
+ let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
56
+ const warnACPolyfill = () => {
57
+ if (!printACPolyfillWarning)
58
+ return;
59
+ printACPolyfillWarning = false;
60
+ emitWarning('AbortController is not defined. If using lru-cache in ' +
61
+ 'node 14, load an AbortController polyfill from the ' +
62
+ '`node-abort-controller` package. A minimal polyfill is ' +
63
+ 'provided for use by LRUCache.fetch(), but it should not be ' +
64
+ 'relied upon in other contexts (eg, passing it to other APIs that ' +
65
+ 'use AbortController/AbortSignal might have undesirable effects). ' +
66
+ 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
67
+ };
68
+ }
69
+ /* c8 ignore stop */
70
+ const shouldWarn = (code) => !warned.has(code);
71
+ const TYPE = Symbol('type');
72
+ const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
73
+ /* c8 ignore start */
74
+ // This is a little bit ridiculous, tbh.
75
+ // The maximum array length is 2^32-1 or thereabouts on most JS impls.
76
+ // And well before that point, you're caching the entire world, I mean,
77
+ // that's ~32GB of just integers for the next/prev links, plus whatever
78
+ // else to hold that many keys and values. Just filling the memory with
79
+ // zeroes at init time is brutal when you get that big.
80
+ // But why not be complete?
81
+ // Maybe in the future, these limits will have expanded.
82
+ const getUintArray = (max) => !isPosInt(max)
83
+ ? null
84
+ : max <= Math.pow(2, 8)
85
+ ? Uint8Array
86
+ : max <= Math.pow(2, 16)
87
+ ? Uint16Array
88
+ : max <= Math.pow(2, 32)
89
+ ? Uint32Array
90
+ : max <= Number.MAX_SAFE_INTEGER
91
+ ? ZeroArray
92
+ : null;
93
+ /* c8 ignore stop */
94
+ class ZeroArray extends Array {
95
+ constructor(size) {
96
+ super(size);
97
+ this.fill(0);
98
+ }
99
+ }
100
+ class Stack {
101
+ heap;
102
+ length;
103
+ // private constructor
104
+ static #constructing = false;
105
+ static create(max) {
106
+ const HeapCls = getUintArray(max);
107
+ if (!HeapCls)
108
+ return [];
109
+ Stack.#constructing = true;
110
+ const s = new Stack(max, HeapCls);
111
+ Stack.#constructing = false;
112
+ return s;
113
+ }
114
+ constructor(max, HeapCls) {
115
+ /* c8 ignore start */
116
+ if (!Stack.#constructing) {
117
+ throw new TypeError('instantiate Stack using Stack.create(n)');
118
+ }
119
+ /* c8 ignore stop */
120
+ this.heap = new HeapCls(max);
121
+ this.length = 0;
122
+ }
123
+ push(n) {
124
+ this.heap[this.length++] = n;
125
+ }
126
+ pop() {
127
+ return this.heap[--this.length];
128
+ }
129
+ }
130
+ /**
131
+ * Default export, the thing you're using this module to get.
132
+ *
133
+ * The `K` and `V` types define the key and value types, respectively. The
134
+ * optional `FC` type defines the type of the `context` object passed to
135
+ * `cache.fetch()` and `cache.memo()`.
136
+ *
137
+ * Keys and values **must not** be `null` or `undefined`.
138
+ *
139
+ * All properties from the options object (with the exception of `max`,
140
+ * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
141
+ * added as normal public members. (The listed options are read-only getters.)
142
+ *
143
+ * Changing any of these will alter the defaults for subsequent method calls.
144
+ */
145
+ class LRUCache {
146
+ // options that cannot be changed without disaster
147
+ #max;
148
+ #maxSize;
149
+ #dispose;
150
+ #disposeAfter;
151
+ #fetchMethod;
152
+ #memoMethod;
153
+ /**
154
+ * {@link LRUCache.OptionsBase.ttl}
155
+ */
156
+ ttl;
157
+ /**
158
+ * {@link LRUCache.OptionsBase.ttlResolution}
159
+ */
160
+ ttlResolution;
161
+ /**
162
+ * {@link LRUCache.OptionsBase.ttlAutopurge}
163
+ */
164
+ ttlAutopurge;
165
+ /**
166
+ * {@link LRUCache.OptionsBase.updateAgeOnGet}
167
+ */
168
+ updateAgeOnGet;
169
+ /**
170
+ * {@link LRUCache.OptionsBase.updateAgeOnHas}
171
+ */
172
+ updateAgeOnHas;
173
+ /**
174
+ * {@link LRUCache.OptionsBase.allowStale}
175
+ */
176
+ allowStale;
177
+ /**
178
+ * {@link LRUCache.OptionsBase.noDisposeOnSet}
179
+ */
180
+ noDisposeOnSet;
181
+ /**
182
+ * {@link LRUCache.OptionsBase.noUpdateTTL}
183
+ */
184
+ noUpdateTTL;
185
+ /**
186
+ * {@link LRUCache.OptionsBase.maxEntrySize}
187
+ */
188
+ maxEntrySize;
189
+ /**
190
+ * {@link LRUCache.OptionsBase.sizeCalculation}
191
+ */
192
+ sizeCalculation;
193
+ /**
194
+ * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
195
+ */
196
+ noDeleteOnFetchRejection;
197
+ /**
198
+ * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
199
+ */
200
+ noDeleteOnStaleGet;
201
+ /**
202
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
203
+ */
204
+ allowStaleOnFetchAbort;
205
+ /**
206
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
207
+ */
208
+ allowStaleOnFetchRejection;
209
+ /**
210
+ * {@link LRUCache.OptionsBase.ignoreFetchAbort}
211
+ */
212
+ ignoreFetchAbort;
213
+ // computed properties
214
+ #size;
215
+ #calculatedSize;
216
+ #keyMap;
217
+ #keyList;
218
+ #valList;
219
+ #next;
220
+ #prev;
221
+ #head;
222
+ #tail;
223
+ #free;
224
+ #disposed;
225
+ #sizes;
226
+ #starts;
227
+ #ttls;
228
+ #hasDispose;
229
+ #hasFetchMethod;
230
+ #hasDisposeAfter;
231
+ /**
232
+ * Do not call this method unless you need to inspect the
233
+ * inner workings of the cache. If anything returned by this
234
+ * object is modified in any way, strange breakage may occur.
235
+ *
236
+ * These fields are private for a reason!
237
+ *
238
+ * @internal
239
+ */
240
+ static unsafeExposeInternals(c) {
241
+ return {
242
+ // properties
243
+ starts: c.#starts,
244
+ ttls: c.#ttls,
245
+ sizes: c.#sizes,
246
+ keyMap: c.#keyMap,
247
+ keyList: c.#keyList,
248
+ valList: c.#valList,
249
+ next: c.#next,
250
+ prev: c.#prev,
251
+ get head() {
252
+ return c.#head;
253
+ },
254
+ get tail() {
255
+ return c.#tail;
256
+ },
257
+ free: c.#free,
258
+ // methods
259
+ isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
260
+ backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
261
+ moveToTail: (index) => c.#moveToTail(index),
262
+ indexes: (options) => c.#indexes(options),
263
+ rindexes: (options) => c.#rindexes(options),
264
+ isStale: (index) => c.#isStale(index),
265
+ };
266
+ }
267
+ // Protected read-only members
268
+ /**
269
+ * {@link LRUCache.OptionsBase.max} (read-only)
270
+ */
271
+ get max() {
272
+ return this.#max;
273
+ }
274
+ /**
275
+ * {@link LRUCache.OptionsBase.maxSize} (read-only)
276
+ */
277
+ get maxSize() {
278
+ return this.#maxSize;
279
+ }
280
+ /**
281
+ * The total computed size of items in the cache (read-only)
282
+ */
283
+ get calculatedSize() {
284
+ return this.#calculatedSize;
285
+ }
286
+ /**
287
+ * The number of items stored in the cache (read-only)
288
+ */
289
+ get size() {
290
+ return this.#size;
291
+ }
292
+ /**
293
+ * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
294
+ */
295
+ get fetchMethod() {
296
+ return this.#fetchMethod;
297
+ }
298
+ get memoMethod() {
299
+ return this.#memoMethod;
300
+ }
301
+ /**
302
+ * {@link LRUCache.OptionsBase.dispose} (read-only)
303
+ */
304
+ get dispose() {
305
+ return this.#dispose;
306
+ }
307
+ /**
308
+ * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
309
+ */
310
+ get disposeAfter() {
311
+ return this.#disposeAfter;
312
+ }
313
+ constructor(options) {
314
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
315
+ if (max !== 0 && !isPosInt(max)) {
316
+ throw new TypeError('max option must be a nonnegative integer');
317
+ }
318
+ const UintArray = max ? getUintArray(max) : Array;
319
+ if (!UintArray) {
320
+ throw new Error('invalid max value: ' + max);
321
+ }
322
+ this.#max = max;
323
+ this.#maxSize = maxSize;
324
+ this.maxEntrySize = maxEntrySize || this.#maxSize;
325
+ this.sizeCalculation = sizeCalculation;
326
+ if (this.sizeCalculation) {
327
+ if (!this.#maxSize && !this.maxEntrySize) {
328
+ throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
329
+ }
330
+ if (typeof this.sizeCalculation !== 'function') {
331
+ throw new TypeError('sizeCalculation set to non-function');
332
+ }
333
+ }
334
+ if (memoMethod !== undefined &&
335
+ typeof memoMethod !== 'function') {
336
+ throw new TypeError('memoMethod must be a function if defined');
337
+ }
338
+ this.#memoMethod = memoMethod;
339
+ if (fetchMethod !== undefined &&
340
+ typeof fetchMethod !== 'function') {
341
+ throw new TypeError('fetchMethod must be a function if specified');
342
+ }
343
+ this.#fetchMethod = fetchMethod;
344
+ this.#hasFetchMethod = !!fetchMethod;
345
+ this.#keyMap = new Map();
346
+ this.#keyList = new Array(max).fill(undefined);
347
+ this.#valList = new Array(max).fill(undefined);
348
+ this.#next = new UintArray(max);
349
+ this.#prev = new UintArray(max);
350
+ this.#head = 0;
351
+ this.#tail = 0;
352
+ this.#free = Stack.create(max);
353
+ this.#size = 0;
354
+ this.#calculatedSize = 0;
355
+ if (typeof dispose === 'function') {
356
+ this.#dispose = dispose;
357
+ }
358
+ if (typeof disposeAfter === 'function') {
359
+ this.#disposeAfter = disposeAfter;
360
+ this.#disposed = [];
361
+ }
362
+ else {
363
+ this.#disposeAfter = undefined;
364
+ this.#disposed = undefined;
365
+ }
366
+ this.#hasDispose = !!this.#dispose;
367
+ this.#hasDisposeAfter = !!this.#disposeAfter;
368
+ this.noDisposeOnSet = !!noDisposeOnSet;
369
+ this.noUpdateTTL = !!noUpdateTTL;
370
+ this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
371
+ this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
372
+ this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
373
+ this.ignoreFetchAbort = !!ignoreFetchAbort;
374
+ // NB: maxEntrySize is set to maxSize if it's set
375
+ if (this.maxEntrySize !== 0) {
376
+ if (this.#maxSize !== 0) {
377
+ if (!isPosInt(this.#maxSize)) {
378
+ throw new TypeError('maxSize must be a positive integer if specified');
379
+ }
380
+ }
381
+ if (!isPosInt(this.maxEntrySize)) {
382
+ throw new TypeError('maxEntrySize must be a positive integer if specified');
383
+ }
384
+ this.#initializeSizeTracking();
385
+ }
386
+ this.allowStale = !!allowStale;
387
+ this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
388
+ this.updateAgeOnGet = !!updateAgeOnGet;
389
+ this.updateAgeOnHas = !!updateAgeOnHas;
390
+ this.ttlResolution =
391
+ isPosInt(ttlResolution) || ttlResolution === 0
392
+ ? ttlResolution
393
+ : 1;
394
+ this.ttlAutopurge = !!ttlAutopurge;
395
+ this.ttl = ttl || 0;
396
+ if (this.ttl) {
397
+ if (!isPosInt(this.ttl)) {
398
+ throw new TypeError('ttl must be a positive integer if specified');
399
+ }
400
+ this.#initializeTTLTracking();
401
+ }
402
+ // do not allow completely unbounded caches
403
+ if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
404
+ throw new TypeError('At least one of max, maxSize, or ttl is required');
405
+ }
406
+ if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
407
+ const code = 'LRU_CACHE_UNBOUNDED';
408
+ if (shouldWarn(code)) {
409
+ warned.add(code);
410
+ const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
411
+ 'result in unbounded memory consumption.';
412
+ emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
413
+ }
414
+ }
415
+ }
416
+ /**
417
+ * Return the number of ms left in the item's TTL. If item is not in cache,
418
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
419
+ */
420
+ getRemainingTTL(key) {
421
+ return this.#keyMap.has(key) ? Infinity : 0;
422
+ }
423
+ #initializeTTLTracking() {
424
+ const ttls = new ZeroArray(this.#max);
425
+ const starts = new ZeroArray(this.#max);
426
+ this.#ttls = ttls;
427
+ this.#starts = starts;
428
+ this.#setItemTTL = (index, ttl, start = perf.now()) => {
429
+ starts[index] = ttl !== 0 ? start : 0;
430
+ ttls[index] = ttl;
431
+ if (ttl !== 0 && this.ttlAutopurge) {
432
+ const t = setTimeout(() => {
433
+ if (this.#isStale(index)) {
434
+ this.#delete(this.#keyList[index], 'expire');
435
+ }
436
+ }, ttl + 1);
437
+ // unref() not supported on all platforms
438
+ /* c8 ignore start */
439
+ if (t.unref) {
440
+ t.unref();
441
+ }
442
+ /* c8 ignore stop */
443
+ }
444
+ };
445
+ this.#updateItemAge = index => {
446
+ starts[index] = ttls[index] !== 0 ? perf.now() : 0;
447
+ };
448
+ this.#statusTTL = (status, index) => {
449
+ if (ttls[index]) {
450
+ const ttl = ttls[index];
451
+ const start = starts[index];
452
+ /* c8 ignore next */
453
+ if (!ttl || !start)
454
+ return;
455
+ status.ttl = ttl;
456
+ status.start = start;
457
+ status.now = cachedNow || getNow();
458
+ const age = status.now - start;
459
+ status.remainingTTL = ttl - age;
460
+ }
461
+ };
462
+ // debounce calls to perf.now() to 1s so we're not hitting
463
+ // that costly call repeatedly.
464
+ let cachedNow = 0;
465
+ const getNow = () => {
466
+ const n = perf.now();
467
+ if (this.ttlResolution > 0) {
468
+ cachedNow = n;
469
+ const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
470
+ // not available on all platforms
471
+ /* c8 ignore start */
472
+ if (t.unref) {
473
+ t.unref();
474
+ }
475
+ /* c8 ignore stop */
476
+ }
477
+ return n;
478
+ };
479
+ this.getRemainingTTL = key => {
480
+ const index = this.#keyMap.get(key);
481
+ if (index === undefined) {
482
+ return 0;
483
+ }
484
+ const ttl = ttls[index];
485
+ const start = starts[index];
486
+ if (!ttl || !start) {
487
+ return Infinity;
488
+ }
489
+ const age = (cachedNow || getNow()) - start;
490
+ return ttl - age;
491
+ };
492
+ this.#isStale = index => {
493
+ const s = starts[index];
494
+ const t = ttls[index];
495
+ return !!t && !!s && (cachedNow || getNow()) - s > t;
496
+ };
497
+ }
498
+ // conditionally set private methods related to TTL
499
+ #updateItemAge = () => { };
500
+ #statusTTL = () => { };
501
+ #setItemTTL = () => { };
502
+ /* c8 ignore stop */
503
+ #isStale = () => false;
504
+ #initializeSizeTracking() {
505
+ const sizes = new ZeroArray(this.#max);
506
+ this.#calculatedSize = 0;
507
+ this.#sizes = sizes;
508
+ this.#removeItemSize = index => {
509
+ this.#calculatedSize -= sizes[index];
510
+ sizes[index] = 0;
511
+ };
512
+ this.#requireSize = (k, v, size, sizeCalculation) => {
513
+ // provisionally accept background fetches.
514
+ // actual value size will be checked when they return.
515
+ if (this.#isBackgroundFetch(v)) {
516
+ return 0;
517
+ }
518
+ if (!isPosInt(size)) {
519
+ if (sizeCalculation) {
520
+ if (typeof sizeCalculation !== 'function') {
521
+ throw new TypeError('sizeCalculation must be a function');
522
+ }
523
+ size = sizeCalculation(v, k);
524
+ if (!isPosInt(size)) {
525
+ throw new TypeError('sizeCalculation return invalid (expect positive integer)');
526
+ }
527
+ }
528
+ else {
529
+ throw new TypeError('invalid size value (must be positive integer). ' +
530
+ 'When maxSize or maxEntrySize is used, sizeCalculation ' +
531
+ 'or size must be set.');
532
+ }
533
+ }
534
+ return size;
535
+ };
536
+ this.#addItemSize = (index, size, status) => {
537
+ sizes[index] = size;
538
+ if (this.#maxSize) {
539
+ const maxSize = this.#maxSize - sizes[index];
540
+ while (this.#calculatedSize > maxSize) {
541
+ this.#evict(true);
542
+ }
543
+ }
544
+ this.#calculatedSize += sizes[index];
545
+ if (status) {
546
+ status.entrySize = size;
547
+ status.totalCalculatedSize = this.#calculatedSize;
548
+ }
549
+ };
550
+ }
551
+ #removeItemSize = _i => { };
552
+ #addItemSize = (_i, _s, _st) => { };
553
+ #requireSize = (_k, _v, size, sizeCalculation) => {
554
+ if (size || sizeCalculation) {
555
+ throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
556
+ }
557
+ return 0;
558
+ };
559
+ *#indexes({ allowStale = this.allowStale } = {}) {
560
+ if (this.#size) {
561
+ for (let i = this.#tail; true;) {
562
+ if (!this.#isValidIndex(i)) {
563
+ break;
564
+ }
565
+ if (allowStale || !this.#isStale(i)) {
566
+ yield i;
567
+ }
568
+ if (i === this.#head) {
569
+ break;
570
+ }
571
+ else {
572
+ i = this.#prev[i];
573
+ }
574
+ }
575
+ }
576
+ }
577
+ *#rindexes({ allowStale = this.allowStale } = {}) {
578
+ if (this.#size) {
579
+ for (let i = this.#head; true;) {
580
+ if (!this.#isValidIndex(i)) {
581
+ break;
582
+ }
583
+ if (allowStale || !this.#isStale(i)) {
584
+ yield i;
585
+ }
586
+ if (i === this.#tail) {
587
+ break;
588
+ }
589
+ else {
590
+ i = this.#next[i];
591
+ }
592
+ }
593
+ }
594
+ }
595
+ #isValidIndex(index) {
596
+ return (index !== undefined &&
597
+ this.#keyMap.get(this.#keyList[index]) === index);
598
+ }
599
+ /**
600
+ * Return a generator yielding `[key, value]` pairs,
601
+ * in order from most recently used to least recently used.
602
+ */
603
+ *entries() {
604
+ for (const i of this.#indexes()) {
605
+ if (this.#valList[i] !== undefined &&
606
+ this.#keyList[i] !== undefined &&
607
+ !this.#isBackgroundFetch(this.#valList[i])) {
608
+ yield [this.#keyList[i], this.#valList[i]];
609
+ }
610
+ }
611
+ }
612
+ /**
613
+ * Inverse order version of {@link LRUCache.entries}
614
+ *
615
+ * Return a generator yielding `[key, value]` pairs,
616
+ * in order from least recently used to most recently used.
617
+ */
618
+ *rentries() {
619
+ for (const i of this.#rindexes()) {
620
+ if (this.#valList[i] !== undefined &&
621
+ this.#keyList[i] !== undefined &&
622
+ !this.#isBackgroundFetch(this.#valList[i])) {
623
+ yield [this.#keyList[i], this.#valList[i]];
624
+ }
625
+ }
626
+ }
627
+ /**
628
+ * Return a generator yielding the keys in the cache,
629
+ * in order from most recently used to least recently used.
630
+ */
631
+ *keys() {
632
+ for (const i of this.#indexes()) {
633
+ const k = this.#keyList[i];
634
+ if (k !== undefined &&
635
+ !this.#isBackgroundFetch(this.#valList[i])) {
636
+ yield k;
637
+ }
638
+ }
639
+ }
640
+ /**
641
+ * Inverse order version of {@link LRUCache.keys}
642
+ *
643
+ * Return a generator yielding the keys in the cache,
644
+ * in order from least recently used to most recently used.
645
+ */
646
+ *rkeys() {
647
+ for (const i of this.#rindexes()) {
648
+ const k = this.#keyList[i];
649
+ if (k !== undefined &&
650
+ !this.#isBackgroundFetch(this.#valList[i])) {
651
+ yield k;
652
+ }
653
+ }
654
+ }
655
+ /**
656
+ * Return a generator yielding the values in the cache,
657
+ * in order from most recently used to least recently used.
658
+ */
659
+ *values() {
660
+ for (const i of this.#indexes()) {
661
+ const v = this.#valList[i];
662
+ if (v !== undefined &&
663
+ !this.#isBackgroundFetch(this.#valList[i])) {
664
+ yield this.#valList[i];
665
+ }
666
+ }
667
+ }
668
+ /**
669
+ * Inverse order version of {@link LRUCache.values}
670
+ *
671
+ * Return a generator yielding the values in the cache,
672
+ * in order from least recently used to most recently used.
673
+ */
674
+ *rvalues() {
675
+ for (const i of this.#rindexes()) {
676
+ const v = this.#valList[i];
677
+ if (v !== undefined &&
678
+ !this.#isBackgroundFetch(this.#valList[i])) {
679
+ yield this.#valList[i];
680
+ }
681
+ }
682
+ }
683
+ /**
684
+ * Iterating over the cache itself yields the same results as
685
+ * {@link LRUCache.entries}
686
+ */
687
+ [Symbol.iterator]() {
688
+ return this.entries();
689
+ }
690
+ /**
691
+ * A String value that is used in the creation of the default string
692
+ * description of an object. Called by the built-in method
693
+ * `Object.prototype.toString`.
694
+ */
695
+ [Symbol.toStringTag] = 'LRUCache';
696
+ /**
697
+ * Find a value for which the supplied fn method returns a truthy value,
698
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
699
+ */
700
+ find(fn, getOptions = {}) {
701
+ for (const i of this.#indexes()) {
702
+ const v = this.#valList[i];
703
+ const value = this.#isBackgroundFetch(v)
704
+ ? v.__staleWhileFetching
705
+ : v;
706
+ if (value === undefined)
707
+ continue;
708
+ if (fn(value, this.#keyList[i], this)) {
709
+ return this.get(this.#keyList[i], getOptions);
710
+ }
711
+ }
712
+ }
713
+ /**
714
+ * Call the supplied function on each item in the cache, in order from most
715
+ * recently used to least recently used.
716
+ *
717
+ * `fn` is called as `fn(value, key, cache)`.
718
+ *
719
+ * If `thisp` is provided, function will be called in the `this`-context of
720
+ * the provided object, or the cache if no `thisp` object is provided.
721
+ *
722
+ * Does not update age or recenty of use, or iterate over stale values.
723
+ */
724
+ forEach(fn, thisp = this) {
725
+ for (const i of this.#indexes()) {
726
+ const v = this.#valList[i];
727
+ const value = this.#isBackgroundFetch(v)
728
+ ? v.__staleWhileFetching
729
+ : v;
730
+ if (value === undefined)
731
+ continue;
732
+ fn.call(thisp, value, this.#keyList[i], this);
733
+ }
734
+ }
735
+ /**
736
+ * The same as {@link LRUCache.forEach} but items are iterated over in
737
+ * reverse order. (ie, less recently used items are iterated over first.)
738
+ */
739
+ rforEach(fn, thisp = this) {
740
+ for (const i of this.#rindexes()) {
741
+ const v = this.#valList[i];
742
+ const value = this.#isBackgroundFetch(v)
743
+ ? v.__staleWhileFetching
744
+ : v;
745
+ if (value === undefined)
746
+ continue;
747
+ fn.call(thisp, value, this.#keyList[i], this);
748
+ }
749
+ }
750
+ /**
751
+ * Delete any stale entries. Returns true if anything was removed,
752
+ * false otherwise.
753
+ */
754
+ purgeStale() {
755
+ let deleted = false;
756
+ for (const i of this.#rindexes({ allowStale: true })) {
757
+ if (this.#isStale(i)) {
758
+ this.#delete(this.#keyList[i], 'expire');
759
+ deleted = true;
760
+ }
761
+ }
762
+ return deleted;
763
+ }
764
+ /**
765
+ * Get the extended info about a given entry, to get its value, size, and
766
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
767
+ *
768
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
769
+ * serialization, the `start` value is always the current timestamp, and the
770
+ * `ttl` is a calculated remaining time to live (negative if expired).
771
+ *
772
+ * Always returns stale values, if their info is found in the cache, so be
773
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
774
+ * if relevant.
775
+ */
776
+ info(key) {
777
+ const i = this.#keyMap.get(key);
778
+ if (i === undefined)
779
+ return undefined;
780
+ const v = this.#valList[i];
781
+ const value = this.#isBackgroundFetch(v)
782
+ ? v.__staleWhileFetching
783
+ : v;
784
+ if (value === undefined)
785
+ return undefined;
786
+ const entry = { value };
787
+ if (this.#ttls && this.#starts) {
788
+ const ttl = this.#ttls[i];
789
+ const start = this.#starts[i];
790
+ if (ttl && start) {
791
+ const remain = ttl - (perf.now() - start);
792
+ entry.ttl = remain;
793
+ entry.start = Date.now();
794
+ }
795
+ }
796
+ if (this.#sizes) {
797
+ entry.size = this.#sizes[i];
798
+ }
799
+ return entry;
800
+ }
801
+ /**
802
+ * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
803
+ * passed to {@link LRLUCache#load}.
804
+ *
805
+ * The `start` fields are calculated relative to a portable `Date.now()`
806
+ * timestamp, even if `performance.now()` is available.
807
+ *
808
+ * Stale entries are always included in the `dump`, even if
809
+ * {@link LRUCache.OptionsBase.allowStale} is false.
810
+ *
811
+ * Note: this returns an actual array, not a generator, so it can be more
812
+ * easily passed around.
813
+ */
814
+ dump() {
815
+ const arr = [];
816
+ for (const i of this.#indexes({ allowStale: true })) {
817
+ const key = this.#keyList[i];
818
+ const v = this.#valList[i];
819
+ const value = this.#isBackgroundFetch(v)
820
+ ? v.__staleWhileFetching
821
+ : v;
822
+ if (value === undefined || key === undefined)
823
+ continue;
824
+ const entry = { value };
825
+ if (this.#ttls && this.#starts) {
826
+ entry.ttl = this.#ttls[i];
827
+ // always dump the start relative to a portable timestamp
828
+ // it's ok for this to be a bit slow, it's a rare operation.
829
+ const age = perf.now() - this.#starts[i];
830
+ entry.start = Math.floor(Date.now() - age);
831
+ }
832
+ if (this.#sizes) {
833
+ entry.size = this.#sizes[i];
834
+ }
835
+ arr.unshift([key, entry]);
836
+ }
837
+ return arr;
838
+ }
839
+ /**
840
+ * Reset the cache and load in the items in entries in the order listed.
841
+ *
842
+ * The shape of the resulting cache may be different if the same options are
843
+ * not used in both caches.
844
+ *
845
+ * The `start` fields are assumed to be calculated relative to a portable
846
+ * `Date.now()` timestamp, even if `performance.now()` is available.
847
+ */
848
+ load(arr) {
849
+ this.clear();
850
+ for (const [key, entry] of arr) {
851
+ if (entry.start) {
852
+ // entry.start is a portable timestamp, but we may be using
853
+ // node's performance.now(), so calculate the offset, so that
854
+ // we get the intended remaining TTL, no matter how long it's
855
+ // been on ice.
856
+ //
857
+ // it's ok for this to be a bit slow, it's a rare operation.
858
+ const age = Date.now() - entry.start;
859
+ entry.start = perf.now() - age;
860
+ }
861
+ this.set(key, entry.value, entry);
862
+ }
863
+ }
864
+ /**
865
+ * Add a value to the cache.
866
+ *
867
+ * Note: if `undefined` is specified as a value, this is an alias for
868
+ * {@link LRUCache#delete}
869
+ *
870
+ * Fields on the {@link LRUCache.SetOptions} options param will override
871
+ * their corresponding values in the constructor options for the scope
872
+ * of this single `set()` operation.
873
+ *
874
+ * If `start` is provided, then that will set the effective start
875
+ * time for the TTL calculation. Note that this must be a previous
876
+ * value of `performance.now()` if supported, or a previous value of
877
+ * `Date.now()` if not.
878
+ *
879
+ * Options object may also include `size`, which will prevent
880
+ * calling the `sizeCalculation` function and just use the specified
881
+ * number if it is a positive integer, and `noDisposeOnSet` which
882
+ * will prevent calling a `dispose` function in the case of
883
+ * overwrites.
884
+ *
885
+ * If the `size` (or return value of `sizeCalculation`) for a given
886
+ * entry is greater than `maxEntrySize`, then the item will not be
887
+ * added to the cache.
888
+ *
889
+ * Will update the recency of the entry.
890
+ *
891
+ * If the value is `undefined`, then this is an alias for
892
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
893
+ */
894
+ set(k, v, setOptions = {}) {
895
+ if (v === undefined) {
896
+ this.delete(k);
897
+ return this;
898
+ }
899
+ const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
900
+ let { noUpdateTTL = this.noUpdateTTL } = setOptions;
901
+ const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
902
+ // if the item doesn't fit, don't do anything
903
+ // NB: maxEntrySize set to maxSize by default
904
+ if (this.maxEntrySize && size > this.maxEntrySize) {
905
+ if (status) {
906
+ status.set = 'miss';
907
+ status.maxEntrySizeExceeded = true;
908
+ }
909
+ // have to delete, in case something is there already.
910
+ this.#delete(k, 'set');
911
+ return this;
912
+ }
913
+ let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
914
+ if (index === undefined) {
915
+ // addition
916
+ index = (this.#size === 0
917
+ ? this.#tail
918
+ : this.#free.length !== 0
919
+ ? this.#free.pop()
920
+ : this.#size === this.#max
921
+ ? this.#evict(false)
922
+ : this.#size);
923
+ this.#keyList[index] = k;
924
+ this.#valList[index] = v;
925
+ this.#keyMap.set(k, index);
926
+ this.#next[this.#tail] = index;
927
+ this.#prev[index] = this.#tail;
928
+ this.#tail = index;
929
+ this.#size++;
930
+ this.#addItemSize(index, size, status);
931
+ if (status)
932
+ status.set = 'add';
933
+ noUpdateTTL = false;
934
+ }
935
+ else {
936
+ // update
937
+ this.#moveToTail(index);
938
+ const oldVal = this.#valList[index];
939
+ if (v !== oldVal) {
940
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
941
+ oldVal.__abortController.abort(new Error('replaced'));
942
+ const { __staleWhileFetching: s } = oldVal;
943
+ if (s !== undefined && !noDisposeOnSet) {
944
+ if (this.#hasDispose) {
945
+ this.#dispose?.(s, k, 'set');
946
+ }
947
+ if (this.#hasDisposeAfter) {
948
+ this.#disposed?.push([s, k, 'set']);
949
+ }
950
+ }
951
+ }
952
+ else if (!noDisposeOnSet) {
953
+ if (this.#hasDispose) {
954
+ this.#dispose?.(oldVal, k, 'set');
955
+ }
956
+ if (this.#hasDisposeAfter) {
957
+ this.#disposed?.push([oldVal, k, 'set']);
958
+ }
959
+ }
960
+ this.#removeItemSize(index);
961
+ this.#addItemSize(index, size, status);
962
+ this.#valList[index] = v;
963
+ if (status) {
964
+ status.set = 'replace';
965
+ const oldValue = oldVal && this.#isBackgroundFetch(oldVal)
966
+ ? oldVal.__staleWhileFetching
967
+ : oldVal;
968
+ if (oldValue !== undefined)
969
+ status.oldValue = oldValue;
970
+ }
971
+ }
972
+ else if (status) {
973
+ status.set = 'update';
974
+ }
975
+ }
976
+ if (ttl !== 0 && !this.#ttls) {
977
+ this.#initializeTTLTracking();
978
+ }
979
+ if (this.#ttls) {
980
+ if (!noUpdateTTL) {
981
+ this.#setItemTTL(index, ttl, start);
982
+ }
983
+ if (status)
984
+ this.#statusTTL(status, index);
985
+ }
986
+ if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
987
+ const dt = this.#disposed;
988
+ let task;
989
+ while ((task = dt?.shift())) {
990
+ this.#disposeAfter?.(...task);
991
+ }
992
+ }
993
+ return this;
994
+ }
995
+ /**
996
+ * Evict the least recently used item, returning its value or
997
+ * `undefined` if cache is empty.
998
+ */
999
+ pop() {
1000
+ try {
1001
+ while (this.#size) {
1002
+ const val = this.#valList[this.#head];
1003
+ this.#evict(true);
1004
+ if (this.#isBackgroundFetch(val)) {
1005
+ if (val.__staleWhileFetching) {
1006
+ return val.__staleWhileFetching;
1007
+ }
1008
+ }
1009
+ else if (val !== undefined) {
1010
+ return val;
1011
+ }
1012
+ }
1013
+ }
1014
+ finally {
1015
+ if (this.#hasDisposeAfter && this.#disposed) {
1016
+ const dt = this.#disposed;
1017
+ let task;
1018
+ while ((task = dt?.shift())) {
1019
+ this.#disposeAfter?.(...task);
1020
+ }
1021
+ }
1022
+ }
1023
+ }
1024
+ #evict(free) {
1025
+ const head = this.#head;
1026
+ const k = this.#keyList[head];
1027
+ const v = this.#valList[head];
1028
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
1029
+ v.__abortController.abort(new Error('evicted'));
1030
+ }
1031
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1032
+ if (this.#hasDispose) {
1033
+ this.#dispose?.(v, k, 'evict');
1034
+ }
1035
+ if (this.#hasDisposeAfter) {
1036
+ this.#disposed?.push([v, k, 'evict']);
1037
+ }
1038
+ }
1039
+ this.#removeItemSize(head);
1040
+ // if we aren't about to use the index, then null these out
1041
+ if (free) {
1042
+ this.#keyList[head] = undefined;
1043
+ this.#valList[head] = undefined;
1044
+ this.#free.push(head);
1045
+ }
1046
+ if (this.#size === 1) {
1047
+ this.#head = this.#tail = 0;
1048
+ this.#free.length = 0;
1049
+ }
1050
+ else {
1051
+ this.#head = this.#next[head];
1052
+ }
1053
+ this.#keyMap.delete(k);
1054
+ this.#size--;
1055
+ return head;
1056
+ }
1057
+ /**
1058
+ * Check if a key is in the cache, without updating the recency of use.
1059
+ * Will return false if the item is stale, even though it is technically
1060
+ * in the cache.
1061
+ *
1062
+ * Check if a key is in the cache, without updating the recency of
1063
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
1064
+ * to `true` in either the options or the constructor.
1065
+ *
1066
+ * Will return `false` if the item is stale, even though it is technically in
1067
+ * the cache. The difference can be determined (if it matters) by using a
1068
+ * `status` argument, and inspecting the `has` field.
1069
+ *
1070
+ * Will not update item age unless
1071
+ * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
1072
+ */
1073
+ has(k, hasOptions = {}) {
1074
+ const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
1075
+ const index = this.#keyMap.get(k);
1076
+ if (index !== undefined) {
1077
+ const v = this.#valList[index];
1078
+ if (this.#isBackgroundFetch(v) &&
1079
+ v.__staleWhileFetching === undefined) {
1080
+ return false;
1081
+ }
1082
+ if (!this.#isStale(index)) {
1083
+ if (updateAgeOnHas) {
1084
+ this.#updateItemAge(index);
1085
+ }
1086
+ if (status) {
1087
+ status.has = 'hit';
1088
+ this.#statusTTL(status, index);
1089
+ }
1090
+ return true;
1091
+ }
1092
+ else if (status) {
1093
+ status.has = 'stale';
1094
+ this.#statusTTL(status, index);
1095
+ }
1096
+ }
1097
+ else if (status) {
1098
+ status.has = 'miss';
1099
+ }
1100
+ return false;
1101
+ }
1102
+ /**
1103
+ * Like {@link LRUCache#get} but doesn't update recency or delete stale
1104
+ * items.
1105
+ *
1106
+ * Returns `undefined` if the item is stale, unless
1107
+ * {@link LRUCache.OptionsBase.allowStale} is set.
1108
+ */
1109
+ peek(k, peekOptions = {}) {
1110
+ const { allowStale = this.allowStale } = peekOptions;
1111
+ const index = this.#keyMap.get(k);
1112
+ if (index === undefined ||
1113
+ (!allowStale && this.#isStale(index))) {
1114
+ return;
1115
+ }
1116
+ const v = this.#valList[index];
1117
+ // either stale and allowed, or forcing a refresh of non-stale value
1118
+ return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
1119
+ }
1120
+ #backgroundFetch(k, index, options, context) {
1121
+ const v = index === undefined ? undefined : this.#valList[index];
1122
+ if (this.#isBackgroundFetch(v)) {
1123
+ return v;
1124
+ }
1125
+ const ac = new AC();
1126
+ const { signal } = options;
1127
+ // when/if our AC signals, then stop listening to theirs.
1128
+ signal?.addEventListener('abort', () => ac.abort(signal.reason), {
1129
+ signal: ac.signal,
1130
+ });
1131
+ const fetchOpts = {
1132
+ signal: ac.signal,
1133
+ options,
1134
+ context,
1135
+ };
1136
+ const cb = (v, updateCache = false) => {
1137
+ const { aborted } = ac.signal;
1138
+ const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
1139
+ if (options.status) {
1140
+ if (aborted && !updateCache) {
1141
+ options.status.fetchAborted = true;
1142
+ options.status.fetchError = ac.signal.reason;
1143
+ if (ignoreAbort)
1144
+ options.status.fetchAbortIgnored = true;
1145
+ }
1146
+ else {
1147
+ options.status.fetchResolved = true;
1148
+ }
1149
+ }
1150
+ if (aborted && !ignoreAbort && !updateCache) {
1151
+ return fetchFail(ac.signal.reason);
1152
+ }
1153
+ // either we didn't abort, and are still here, or we did, and ignored
1154
+ const bf = p;
1155
+ if (this.#valList[index] === p) {
1156
+ if (v === undefined) {
1157
+ if (bf.__staleWhileFetching) {
1158
+ this.#valList[index] = bf.__staleWhileFetching;
1159
+ }
1160
+ else {
1161
+ this.#delete(k, 'fetch');
1162
+ }
1163
+ }
1164
+ else {
1165
+ if (options.status)
1166
+ options.status.fetchUpdated = true;
1167
+ this.set(k, v, fetchOpts.options);
1168
+ }
1169
+ }
1170
+ return v;
1171
+ };
1172
+ const eb = (er) => {
1173
+ if (options.status) {
1174
+ options.status.fetchRejected = true;
1175
+ options.status.fetchError = er;
1176
+ }
1177
+ return fetchFail(er);
1178
+ };
1179
+ const fetchFail = (er) => {
1180
+ const { aborted } = ac.signal;
1181
+ const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
1182
+ const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
1183
+ const noDelete = allowStale || options.noDeleteOnFetchRejection;
1184
+ const bf = p;
1185
+ if (this.#valList[index] === p) {
1186
+ // if we allow stale on fetch rejections, then we need to ensure that
1187
+ // the stale value is not removed from the cache when the fetch fails.
1188
+ const del = !noDelete || bf.__staleWhileFetching === undefined;
1189
+ if (del) {
1190
+ this.#delete(k, 'fetch');
1191
+ }
1192
+ else if (!allowStaleAborted) {
1193
+ // still replace the *promise* with the stale value,
1194
+ // since we are done with the promise at this point.
1195
+ // leave it untouched if we're still waiting for an
1196
+ // aborted background fetch that hasn't yet returned.
1197
+ this.#valList[index] = bf.__staleWhileFetching;
1198
+ }
1199
+ }
1200
+ if (allowStale) {
1201
+ if (options.status && bf.__staleWhileFetching !== undefined) {
1202
+ options.status.returnedStale = true;
1203
+ }
1204
+ return bf.__staleWhileFetching;
1205
+ }
1206
+ else if (bf.__returned === bf) {
1207
+ throw er;
1208
+ }
1209
+ };
1210
+ const pcall = (res, rej) => {
1211
+ const fmp = this.#fetchMethod?.(k, v, fetchOpts);
1212
+ if (fmp && fmp instanceof Promise) {
1213
+ fmp.then(v => res(v === undefined ? undefined : v), rej);
1214
+ }
1215
+ // ignored, we go until we finish, regardless.
1216
+ // defer check until we are actually aborting,
1217
+ // so fetchMethod can override.
1218
+ ac.signal.addEventListener('abort', () => {
1219
+ if (!options.ignoreFetchAbort ||
1220
+ options.allowStaleOnFetchAbort) {
1221
+ res(undefined);
1222
+ // when it eventually resolves, update the cache.
1223
+ if (options.allowStaleOnFetchAbort) {
1224
+ res = v => cb(v, true);
1225
+ }
1226
+ }
1227
+ });
1228
+ };
1229
+ if (options.status)
1230
+ options.status.fetchDispatched = true;
1231
+ const p = new Promise(pcall).then(cb, eb);
1232
+ const bf = Object.assign(p, {
1233
+ __abortController: ac,
1234
+ __staleWhileFetching: v,
1235
+ __returned: undefined,
1236
+ });
1237
+ if (index === undefined) {
1238
+ // internal, don't expose status.
1239
+ this.set(k, bf, { ...fetchOpts.options, status: undefined });
1240
+ index = this.#keyMap.get(k);
1241
+ }
1242
+ else {
1243
+ this.#valList[index] = bf;
1244
+ }
1245
+ return bf;
1246
+ }
1247
+ #isBackgroundFetch(p) {
1248
+ if (!this.#hasFetchMethod)
1249
+ return false;
1250
+ const b = p;
1251
+ return (!!b &&
1252
+ b instanceof Promise &&
1253
+ b.hasOwnProperty('__staleWhileFetching') &&
1254
+ b.__abortController instanceof AC);
1255
+ }
1256
+ async fetch(k, fetchOptions = {}) {
1257
+ const {
1258
+ // get options
1259
+ allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet,
1260
+ // set options
1261
+ ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL,
1262
+ // fetch exclusive options
1263
+ noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
1264
+ if (!this.#hasFetchMethod) {
1265
+ if (status)
1266
+ status.fetch = 'get';
1267
+ return this.get(k, {
1268
+ allowStale,
1269
+ updateAgeOnGet,
1270
+ noDeleteOnStaleGet,
1271
+ status,
1272
+ });
1273
+ }
1274
+ const options = {
1275
+ allowStale,
1276
+ updateAgeOnGet,
1277
+ noDeleteOnStaleGet,
1278
+ ttl,
1279
+ noDisposeOnSet,
1280
+ size,
1281
+ sizeCalculation,
1282
+ noUpdateTTL,
1283
+ noDeleteOnFetchRejection,
1284
+ allowStaleOnFetchRejection,
1285
+ allowStaleOnFetchAbort,
1286
+ ignoreFetchAbort,
1287
+ status,
1288
+ signal,
1289
+ };
1290
+ let index = this.#keyMap.get(k);
1291
+ if (index === undefined) {
1292
+ if (status)
1293
+ status.fetch = 'miss';
1294
+ const p = this.#backgroundFetch(k, index, options, context);
1295
+ return (p.__returned = p);
1296
+ }
1297
+ else {
1298
+ // in cache, maybe already fetching
1299
+ const v = this.#valList[index];
1300
+ if (this.#isBackgroundFetch(v)) {
1301
+ const stale = allowStale && v.__staleWhileFetching !== undefined;
1302
+ if (status) {
1303
+ status.fetch = 'inflight';
1304
+ if (stale)
1305
+ status.returnedStale = true;
1306
+ }
1307
+ return stale ? v.__staleWhileFetching : (v.__returned = v);
1308
+ }
1309
+ // if we force a refresh, that means do NOT serve the cached value,
1310
+ // unless we are already in the process of refreshing the cache.
1311
+ const isStale = this.#isStale(index);
1312
+ if (!forceRefresh && !isStale) {
1313
+ if (status)
1314
+ status.fetch = 'hit';
1315
+ this.#moveToTail(index);
1316
+ if (updateAgeOnGet) {
1317
+ this.#updateItemAge(index);
1318
+ }
1319
+ if (status)
1320
+ this.#statusTTL(status, index);
1321
+ return v;
1322
+ }
1323
+ // ok, it is stale or a forced refresh, and not already fetching.
1324
+ // refresh the cache.
1325
+ const p = this.#backgroundFetch(k, index, options, context);
1326
+ const hasStale = p.__staleWhileFetching !== undefined;
1327
+ const staleVal = hasStale && allowStale;
1328
+ if (status) {
1329
+ status.fetch = isStale ? 'stale' : 'refresh';
1330
+ if (staleVal && isStale)
1331
+ status.returnedStale = true;
1332
+ }
1333
+ return staleVal ? p.__staleWhileFetching : (p.__returned = p);
1334
+ }
1335
+ }
1336
+ async forceFetch(k, fetchOptions = {}) {
1337
+ const v = await this.fetch(k, fetchOptions);
1338
+ if (v === undefined)
1339
+ throw new Error('fetch() returned undefined');
1340
+ return v;
1341
+ }
1342
+ memo(k, memoOptions = {}) {
1343
+ const memoMethod = this.#memoMethod;
1344
+ if (!memoMethod) {
1345
+ throw new Error('no memoMethod provided to constructor');
1346
+ }
1347
+ const { context, forceRefresh, ...options } = memoOptions;
1348
+ const v = this.get(k, options);
1349
+ if (!forceRefresh && v !== undefined)
1350
+ return v;
1351
+ const vv = memoMethod(k, v, {
1352
+ options,
1353
+ context,
1354
+ });
1355
+ this.set(k, vv, options);
1356
+ return vv;
1357
+ }
1358
+ /**
1359
+ * Return a value from the cache. Will update the recency of the cache
1360
+ * entry found.
1361
+ *
1362
+ * If the key is not found, get() will return `undefined`.
1363
+ */
1364
+ get(k, getOptions = {}) {
1365
+ const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
1366
+ const index = this.#keyMap.get(k);
1367
+ if (index !== undefined) {
1368
+ const value = this.#valList[index];
1369
+ const fetching = this.#isBackgroundFetch(value);
1370
+ if (status)
1371
+ this.#statusTTL(status, index);
1372
+ if (this.#isStale(index)) {
1373
+ if (status)
1374
+ status.get = 'stale';
1375
+ // delete only if not an in-flight background fetch
1376
+ if (!fetching) {
1377
+ if (!noDeleteOnStaleGet) {
1378
+ this.#delete(k, 'expire');
1379
+ }
1380
+ if (status && allowStale)
1381
+ status.returnedStale = true;
1382
+ return allowStale ? value : undefined;
1383
+ }
1384
+ else {
1385
+ if (status &&
1386
+ allowStale &&
1387
+ value.__staleWhileFetching !== undefined) {
1388
+ status.returnedStale = true;
1389
+ }
1390
+ return allowStale ? value.__staleWhileFetching : undefined;
1391
+ }
1392
+ }
1393
+ else {
1394
+ if (status)
1395
+ status.get = 'hit';
1396
+ // if we're currently fetching it, we don't actually have it yet
1397
+ // it's not stale, which means this isn't a staleWhileRefetching.
1398
+ // If it's not stale, and fetching, AND has a __staleWhileFetching
1399
+ // value, then that means the user fetched with {forceRefresh:true},
1400
+ // so it's safe to return that value.
1401
+ if (fetching) {
1402
+ return value.__staleWhileFetching;
1403
+ }
1404
+ this.#moveToTail(index);
1405
+ if (updateAgeOnGet) {
1406
+ this.#updateItemAge(index);
1407
+ }
1408
+ return value;
1409
+ }
1410
+ }
1411
+ else if (status) {
1412
+ status.get = 'miss';
1413
+ }
1414
+ }
1415
+ #connect(p, n) {
1416
+ this.#prev[n] = p;
1417
+ this.#next[p] = n;
1418
+ }
1419
+ #moveToTail(index) {
1420
+ // if tail already, nothing to do
1421
+ // if head, move head to next[index]
1422
+ // else
1423
+ // move next[prev[index]] to next[index] (head has no prev)
1424
+ // move prev[next[index]] to prev[index]
1425
+ // prev[index] = tail
1426
+ // next[tail] = index
1427
+ // tail = index
1428
+ if (index !== this.#tail) {
1429
+ if (index === this.#head) {
1430
+ this.#head = this.#next[index];
1431
+ }
1432
+ else {
1433
+ this.#connect(this.#prev[index], this.#next[index]);
1434
+ }
1435
+ this.#connect(this.#tail, index);
1436
+ this.#tail = index;
1437
+ }
1438
+ }
1439
+ /**
1440
+ * Deletes a key out of the cache.
1441
+ *
1442
+ * Returns true if the key was deleted, false otherwise.
1443
+ */
1444
+ delete(k) {
1445
+ return this.#delete(k, 'delete');
1446
+ }
1447
+ #delete(k, reason) {
1448
+ let deleted = false;
1449
+ if (this.#size !== 0) {
1450
+ const index = this.#keyMap.get(k);
1451
+ if (index !== undefined) {
1452
+ deleted = true;
1453
+ if (this.#size === 1) {
1454
+ this.#clear(reason);
1455
+ }
1456
+ else {
1457
+ this.#removeItemSize(index);
1458
+ const v = this.#valList[index];
1459
+ if (this.#isBackgroundFetch(v)) {
1460
+ v.__abortController.abort(new Error('deleted'));
1461
+ }
1462
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1463
+ if (this.#hasDispose) {
1464
+ this.#dispose?.(v, k, reason);
1465
+ }
1466
+ if (this.#hasDisposeAfter) {
1467
+ this.#disposed?.push([v, k, reason]);
1468
+ }
1469
+ }
1470
+ this.#keyMap.delete(k);
1471
+ this.#keyList[index] = undefined;
1472
+ this.#valList[index] = undefined;
1473
+ if (index === this.#tail) {
1474
+ this.#tail = this.#prev[index];
1475
+ }
1476
+ else if (index === this.#head) {
1477
+ this.#head = this.#next[index];
1478
+ }
1479
+ else {
1480
+ const pi = this.#prev[index];
1481
+ this.#next[pi] = this.#next[index];
1482
+ const ni = this.#next[index];
1483
+ this.#prev[ni] = this.#prev[index];
1484
+ }
1485
+ this.#size--;
1486
+ this.#free.push(index);
1487
+ }
1488
+ }
1489
+ }
1490
+ if (this.#hasDisposeAfter && this.#disposed?.length) {
1491
+ const dt = this.#disposed;
1492
+ let task;
1493
+ while ((task = dt?.shift())) {
1494
+ this.#disposeAfter?.(...task);
1495
+ }
1496
+ }
1497
+ return deleted;
1498
+ }
1499
+ /**
1500
+ * Clear the cache entirely, throwing away all values.
1501
+ */
1502
+ clear() {
1503
+ return this.#clear('delete');
1504
+ }
1505
+ #clear(reason) {
1506
+ for (const index of this.#rindexes({ allowStale: true })) {
1507
+ const v = this.#valList[index];
1508
+ if (this.#isBackgroundFetch(v)) {
1509
+ v.__abortController.abort(new Error('deleted'));
1510
+ }
1511
+ else {
1512
+ const k = this.#keyList[index];
1513
+ if (this.#hasDispose) {
1514
+ this.#dispose?.(v, k, reason);
1515
+ }
1516
+ if (this.#hasDisposeAfter) {
1517
+ this.#disposed?.push([v, k, reason]);
1518
+ }
1519
+ }
1520
+ }
1521
+ this.#keyMap.clear();
1522
+ this.#valList.fill(undefined);
1523
+ this.#keyList.fill(undefined);
1524
+ if (this.#ttls && this.#starts) {
1525
+ this.#ttls.fill(0);
1526
+ this.#starts.fill(0);
1527
+ }
1528
+ if (this.#sizes) {
1529
+ this.#sizes.fill(0);
1530
+ }
1531
+ this.#head = 0;
1532
+ this.#tail = 0;
1533
+ this.#free.length = 0;
1534
+ this.#calculatedSize = 0;
1535
+ this.#size = 0;
1536
+ if (this.#hasDisposeAfter && this.#disposed) {
1537
+ const dt = this.#disposed;
1538
+ let task;
1539
+ while ((task = dt?.shift())) {
1540
+ this.#disposeAfter?.(...task);
1541
+ }
1542
+ }
1543
+ }
1544
+ }
1545
+ exports.LRUCache = LRUCache;
1546
+ //# sourceMappingURL=index.js.map