@microwiseai/snapshot 0.9.0 → 0.9.2

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 (477) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/commands/install.d.ts.map +1 -1
  3. package/dist/commands/install.js +20 -81
  4. package/dist/commands/install.js.map +1 -1
  5. package/dist/commands/publish.d.ts.map +1 -1
  6. package/dist/commands/publish.js +7 -0
  7. package/dist/commands/publish.js.map +1 -1
  8. package/dist/lib/prerequisites.d.ts.map +1 -1
  9. package/dist/lib/prerequisites.js +2 -1
  10. package/dist/lib/prerequisites.js.map +1 -1
  11. package/dist/lib/proxy-index-refresh.d.ts +40 -0
  12. package/dist/lib/proxy-index-refresh.d.ts.map +1 -0
  13. package/dist/lib/proxy-index-refresh.js +66 -0
  14. package/dist/lib/proxy-index-refresh.js.map +1 -0
  15. package/dist/lib/proxy-userconfig.d.ts +45 -0
  16. package/dist/lib/proxy-userconfig.d.ts.map +1 -0
  17. package/dist/lib/proxy-userconfig.js +94 -0
  18. package/dist/lib/proxy-userconfig.js.map +1 -0
  19. package/node_modules/@microwiseai/skit/LICENSE +21 -0
  20. package/node_modules/@microwiseai/skit/README.md +137 -93
  21. package/node_modules/@microwiseai/skit/dist/__tests__/setup/hermetic-config.d.ts +2 -0
  22. package/node_modules/@microwiseai/skit/dist/__tests__/setup/hermetic-config.d.ts.map +1 -0
  23. package/node_modules/@microwiseai/skit/dist/commands/browse.d.ts +47 -3
  24. package/node_modules/@microwiseai/skit/dist/commands/browse.d.ts.map +1 -1
  25. package/node_modules/@microwiseai/skit/dist/commands/config.d.ts +5 -0
  26. package/node_modules/@microwiseai/skit/dist/commands/config.d.ts.map +1 -0
  27. package/node_modules/@microwiseai/skit/dist/commands/install.d.ts +14 -2
  28. package/node_modules/@microwiseai/skit/dist/commands/install.d.ts.map +1 -1
  29. package/node_modules/@microwiseai/skit/dist/commands/orphans.d.ts +16 -0
  30. package/node_modules/@microwiseai/skit/dist/commands/orphans.d.ts.map +1 -0
  31. package/node_modules/@microwiseai/skit/dist/commands/pack.d.ts.map +1 -1
  32. package/node_modules/@microwiseai/skit/dist/commands/prompt.d.ts +25 -0
  33. package/node_modules/@microwiseai/skit/dist/commands/prompt.d.ts.map +1 -0
  34. package/node_modules/@microwiseai/skit/dist/commands/publish.d.ts.map +1 -1
  35. package/node_modules/@microwiseai/skit/dist/commands/uninstall.d.ts.map +1 -1
  36. package/node_modules/@microwiseai/skit/dist/distkit/install-directive.d.ts +48 -0
  37. package/node_modules/@microwiseai/skit/dist/distkit/install-directive.d.ts.map +1 -0
  38. package/node_modules/@microwiseai/skit/dist/distkit/kit-executor.d.ts +46 -0
  39. package/node_modules/@microwiseai/skit/dist/distkit/kit-executor.d.ts.map +1 -0
  40. package/node_modules/@microwiseai/skit/dist/distkit/resolve-from.d.ts +37 -0
  41. package/node_modules/@microwiseai/skit/dist/distkit/resolve-from.d.ts.map +1 -0
  42. package/node_modules/@microwiseai/skit/dist/index.d.ts +0 -1
  43. package/node_modules/@microwiseai/skit/dist/index.js +52519 -68
  44. package/node_modules/@microwiseai/skit/dist/lib.d.ts +657 -5
  45. package/node_modules/@microwiseai/skit/dist/lib.d.ts.map +1 -1
  46. package/node_modules/@microwiseai/skit/dist/lib.js +48417 -554
  47. package/node_modules/@microwiseai/skit/dist/types/skit.d.ts +189 -12
  48. package/node_modules/@microwiseai/skit/dist/types/skit.d.ts.map +1 -1
  49. package/node_modules/@microwiseai/skit/dist/utils/dep-plan.d.ts +150 -0
  50. package/node_modules/@microwiseai/skit/dist/utils/dep-plan.d.ts.map +1 -0
  51. package/node_modules/@microwiseai/skit/dist/utils/file-copy.d.ts +10 -5
  52. package/node_modules/@microwiseai/skit/dist/utils/file-copy.d.ts.map +1 -1
  53. package/node_modules/@microwiseai/skit/dist/utils/gitlab-registry.d.ts +91 -0
  54. package/node_modules/@microwiseai/skit/dist/utils/gitlab-registry.d.ts.map +1 -0
  55. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.d.ts +59 -3
  56. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.d.ts.map +1 -1
  57. package/node_modules/@microwiseai/skit/dist/utils/npm-auth.d.ts +99 -0
  58. package/node_modules/@microwiseai/skit/dist/utils/npm-auth.d.ts.map +1 -0
  59. package/node_modules/@microwiseai/skit/dist/utils/profile-permissions.d.ts +54 -0
  60. package/node_modules/@microwiseai/skit/dist/utils/profile-permissions.d.ts.map +1 -0
  61. package/node_modules/@microwiseai/skit/dist/utils/skit-config.d.ts +41 -0
  62. package/node_modules/@microwiseai/skit/dist/utils/skit-config.d.ts.map +1 -0
  63. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.d.ts +5 -0
  64. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.d.ts.map +1 -1
  65. package/node_modules/@microwiseai/skit/dist/utils/temp-npmrc.d.ts +70 -0
  66. package/node_modules/@microwiseai/skit/dist/utils/temp-npmrc.d.ts.map +1 -0
  67. package/node_modules/@microwiseai/skit/package.json +40 -10
  68. package/package.json +2 -2
  69. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  70. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  71. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  72. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +0 -1
  73. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  74. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +0 -1
  75. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  76. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  77. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +0 -1
  78. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  79. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +0 -1
  80. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  81. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  82. package/node_modules/@ist/registry-config/dist/index.d.ts +0 -3
  83. package/node_modules/@ist/registry-config/dist/index.js +0 -3
  84. package/node_modules/@ist/registry-config/dist/registry-url.d.ts +0 -1
  85. package/node_modules/@ist/registry-config/dist/registry-url.js +0 -1
  86. package/node_modules/@ist/registry-config/dist/scope-mapping.d.ts +0 -6
  87. package/node_modules/@ist/registry-config/dist/scope-mapping.js +0 -7
  88. package/node_modules/@ist/registry-config/dist/types.d.ts +0 -4
  89. package/node_modules/@ist/registry-config/dist/types.js +0 -1
  90. package/node_modules/@ist/registry-config/package.json +0 -32
  91. package/node_modules/@microwiseai/skit/dist/commands/browse.js +0 -127
  92. package/node_modules/@microwiseai/skit/dist/commands/browse.js.map +0 -1
  93. package/node_modules/@microwiseai/skit/dist/commands/gitignore.js +0 -59
  94. package/node_modules/@microwiseai/skit/dist/commands/gitignore.js.map +0 -1
  95. package/node_modules/@microwiseai/skit/dist/commands/info.js +0 -80
  96. package/node_modules/@microwiseai/skit/dist/commands/info.js.map +0 -1
  97. package/node_modules/@microwiseai/skit/dist/commands/install.js +0 -150
  98. package/node_modules/@microwiseai/skit/dist/commands/install.js.map +0 -1
  99. package/node_modules/@microwiseai/skit/dist/commands/licenses.d.ts +0 -9
  100. package/node_modules/@microwiseai/skit/dist/commands/licenses.d.ts.map +0 -1
  101. package/node_modules/@microwiseai/skit/dist/commands/licenses.js +0 -125
  102. package/node_modules/@microwiseai/skit/dist/commands/licenses.js.map +0 -1
  103. package/node_modules/@microwiseai/skit/dist/commands/list.js +0 -41
  104. package/node_modules/@microwiseai/skit/dist/commands/list.js.map +0 -1
  105. package/node_modules/@microwiseai/skit/dist/commands/login.d.ts +0 -10
  106. package/node_modules/@microwiseai/skit/dist/commands/login.d.ts.map +0 -1
  107. package/node_modules/@microwiseai/skit/dist/commands/login.js +0 -112
  108. package/node_modules/@microwiseai/skit/dist/commands/login.js.map +0 -1
  109. package/node_modules/@microwiseai/skit/dist/commands/logout.d.ts +0 -5
  110. package/node_modules/@microwiseai/skit/dist/commands/logout.d.ts.map +0 -1
  111. package/node_modules/@microwiseai/skit/dist/commands/logout.js +0 -30
  112. package/node_modules/@microwiseai/skit/dist/commands/logout.js.map +0 -1
  113. package/node_modules/@microwiseai/skit/dist/commands/pack.js +0 -185
  114. package/node_modules/@microwiseai/skit/dist/commands/pack.js.map +0 -1
  115. package/node_modules/@microwiseai/skit/dist/commands/publish.js +0 -108
  116. package/node_modules/@microwiseai/skit/dist/commands/publish.js.map +0 -1
  117. package/node_modules/@microwiseai/skit/dist/commands/purchase.d.ts +0 -9
  118. package/node_modules/@microwiseai/skit/dist/commands/purchase.d.ts.map +0 -1
  119. package/node_modules/@microwiseai/skit/dist/commands/purchase.js +0 -160
  120. package/node_modules/@microwiseai/skit/dist/commands/purchase.js.map +0 -1
  121. package/node_modules/@microwiseai/skit/dist/commands/register.d.ts +0 -10
  122. package/node_modules/@microwiseai/skit/dist/commands/register.d.ts.map +0 -1
  123. package/node_modules/@microwiseai/skit/dist/commands/register.js +0 -121
  124. package/node_modules/@microwiseai/skit/dist/commands/register.js.map +0 -1
  125. package/node_modules/@microwiseai/skit/dist/commands/uninstall.js +0 -138
  126. package/node_modules/@microwiseai/skit/dist/commands/uninstall.js.map +0 -1
  127. package/node_modules/@microwiseai/skit/dist/commands/whoami.d.ts +0 -9
  128. package/node_modules/@microwiseai/skit/dist/commands/whoami.d.ts.map +0 -1
  129. package/node_modules/@microwiseai/skit/dist/commands/whoami.js +0 -79
  130. package/node_modules/@microwiseai/skit/dist/commands/whoami.js.map +0 -1
  131. package/node_modules/@microwiseai/skit/dist/index.js.map +0 -1
  132. package/node_modules/@microwiseai/skit/dist/lib.js.map +0 -1
  133. package/node_modules/@microwiseai/skit/dist/types/skit.js +0 -20
  134. package/node_modules/@microwiseai/skit/dist/types/skit.js.map +0 -1
  135. package/node_modules/@microwiseai/skit/dist/utils/api.d.ts +0 -18
  136. package/node_modules/@microwiseai/skit/dist/utils/api.d.ts.map +0 -1
  137. package/node_modules/@microwiseai/skit/dist/utils/api.js +0 -26
  138. package/node_modules/@microwiseai/skit/dist/utils/api.js.map +0 -1
  139. package/node_modules/@microwiseai/skit/dist/utils/auth.d.ts +0 -62
  140. package/node_modules/@microwiseai/skit/dist/utils/auth.d.ts.map +0 -1
  141. package/node_modules/@microwiseai/skit/dist/utils/auth.js +0 -172
  142. package/node_modules/@microwiseai/skit/dist/utils/auth.js.map +0 -1
  143. package/node_modules/@microwiseai/skit/dist/utils/file-copy.js +0 -219
  144. package/node_modules/@microwiseai/skit/dist/utils/file-copy.js.map +0 -1
  145. package/node_modules/@microwiseai/skit/dist/utils/hook-installer.js +0 -98
  146. package/node_modules/@microwiseai/skit/dist/utils/hook-installer.js.map +0 -1
  147. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.js +0 -108
  148. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.js.map +0 -1
  149. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.js +0 -52
  150. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.js.map +0 -1
  151. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.d.ts +0 -74
  152. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.d.ts.map +0 -1
  153. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.js +0 -280
  154. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.js.map +0 -1
  155. package/node_modules/chownr/LICENSE.md +0 -63
  156. package/node_modules/chownr/README.md +0 -3
  157. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  158. package/node_modules/chownr/dist/commonjs/index.d.ts.map +0 -1
  159. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  160. package/node_modules/chownr/dist/commonjs/index.js.map +0 -1
  161. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  162. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  163. package/node_modules/chownr/dist/esm/index.d.ts.map +0 -1
  164. package/node_modules/chownr/dist/esm/index.js +0 -85
  165. package/node_modules/chownr/dist/esm/index.js.map +0 -1
  166. package/node_modules/chownr/dist/esm/package.json +0 -3
  167. package/node_modules/chownr/package.json +0 -69
  168. package/node_modules/commander/LICENSE +0 -22
  169. package/node_modules/commander/Readme.md +0 -1157
  170. package/node_modules/commander/esm.mjs +0 -16
  171. package/node_modules/commander/index.js +0 -24
  172. package/node_modules/commander/lib/argument.js +0 -149
  173. package/node_modules/commander/lib/command.js +0 -2509
  174. package/node_modules/commander/lib/error.js +0 -39
  175. package/node_modules/commander/lib/help.js +0 -520
  176. package/node_modules/commander/lib/option.js +0 -330
  177. package/node_modules/commander/lib/suggestSimilar.js +0 -101
  178. package/node_modules/commander/package-support.json +0 -16
  179. package/node_modules/commander/package.json +0 -84
  180. package/node_modules/commander/typings/esm.d.mts +0 -3
  181. package/node_modules/commander/typings/index.d.ts +0 -969
  182. package/node_modules/minipass/LICENSE.md +0 -55
  183. package/node_modules/minipass/README.md +0 -825
  184. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  185. package/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
  186. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  187. package/node_modules/minipass/dist/commonjs/index.js.map +0 -1
  188. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  189. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  190. package/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
  191. package/node_modules/minipass/dist/esm/index.js +0 -1020
  192. package/node_modules/minipass/dist/esm/index.js.map +0 -1
  193. package/node_modules/minipass/dist/esm/package.json +0 -3
  194. package/node_modules/minipass/package.json +0 -77
  195. package/node_modules/minizlib/LICENSE +0 -26
  196. package/node_modules/minizlib/README.md +0 -64
  197. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  198. package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +0 -1
  199. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  200. package/node_modules/minizlib/dist/commonjs/constants.js.map +0 -1
  201. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  202. package/node_modules/minizlib/dist/commonjs/index.d.ts.map +0 -1
  203. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  204. package/node_modules/minizlib/dist/commonjs/index.js.map +0 -1
  205. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  206. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  207. package/node_modules/minizlib/dist/esm/constants.d.ts.map +0 -1
  208. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  209. package/node_modules/minizlib/dist/esm/constants.js.map +0 -1
  210. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  211. package/node_modules/minizlib/dist/esm/index.d.ts.map +0 -1
  212. package/node_modules/minizlib/dist/esm/index.js +0 -363
  213. package/node_modules/minizlib/dist/esm/index.js.map +0 -1
  214. package/node_modules/minizlib/dist/esm/package.json +0 -3
  215. package/node_modules/minizlib/package.json +0 -80
  216. package/node_modules/tar/LICENSE.md +0 -55
  217. package/node_modules/tar/README.md +0 -1224
  218. package/node_modules/tar/dist/commonjs/create.d.ts +0 -3
  219. package/node_modules/tar/dist/commonjs/create.d.ts.map +0 -1
  220. package/node_modules/tar/dist/commonjs/create.js +0 -82
  221. package/node_modules/tar/dist/commonjs/create.js.map +0 -1
  222. package/node_modules/tar/dist/commonjs/cwd-error.d.ts +0 -8
  223. package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +0 -1
  224. package/node_modules/tar/dist/commonjs/cwd-error.js +0 -18
  225. package/node_modules/tar/dist/commonjs/cwd-error.js.map +0 -1
  226. package/node_modules/tar/dist/commonjs/extract.d.ts +0 -3
  227. package/node_modules/tar/dist/commonjs/extract.d.ts.map +0 -1
  228. package/node_modules/tar/dist/commonjs/extract.js +0 -88
  229. package/node_modules/tar/dist/commonjs/extract.js.map +0 -1
  230. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  231. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +0 -1
  232. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  233. package/node_modules/tar/dist/commonjs/get-write-flag.js.map +0 -1
  234. package/node_modules/tar/dist/commonjs/header.d.ts +0 -53
  235. package/node_modules/tar/dist/commonjs/header.d.ts.map +0 -1
  236. package/node_modules/tar/dist/commonjs/header.js +0 -312
  237. package/node_modules/tar/dist/commonjs/header.js.map +0 -1
  238. package/node_modules/tar/dist/commonjs/index.d.ts +0 -20
  239. package/node_modules/tar/dist/commonjs/index.d.ts.map +0 -1
  240. package/node_modules/tar/dist/commonjs/index.js +0 -64
  241. package/node_modules/tar/dist/commonjs/index.js.map +0 -1
  242. package/node_modules/tar/dist/commonjs/index.min.js +0 -4
  243. package/node_modules/tar/dist/commonjs/index.min.js.map +0 -7
  244. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +0 -3
  245. package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +0 -1
  246. package/node_modules/tar/dist/commonjs/large-numbers.js +0 -99
  247. package/node_modules/tar/dist/commonjs/large-numbers.js.map +0 -1
  248. package/node_modules/tar/dist/commonjs/list.d.ts +0 -7
  249. package/node_modules/tar/dist/commonjs/list.d.ts.map +0 -1
  250. package/node_modules/tar/dist/commonjs/list.js +0 -145
  251. package/node_modules/tar/dist/commonjs/list.js.map +0 -1
  252. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  253. package/node_modules/tar/dist/commonjs/make-command.d.ts.map +0 -1
  254. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  255. package/node_modules/tar/dist/commonjs/make-command.js.map +0 -1
  256. package/node_modules/tar/dist/commonjs/mkdir.d.ts +0 -25
  257. package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +0 -1
  258. package/node_modules/tar/dist/commonjs/mkdir.js +0 -187
  259. package/node_modules/tar/dist/commonjs/mkdir.js.map +0 -1
  260. package/node_modules/tar/dist/commonjs/mode-fix.d.ts +0 -2
  261. package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +0 -1
  262. package/node_modules/tar/dist/commonjs/mode-fix.js +0 -29
  263. package/node_modules/tar/dist/commonjs/mode-fix.js.map +0 -1
  264. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +0 -2
  265. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +0 -1
  266. package/node_modules/tar/dist/commonjs/normalize-unicode.js +0 -38
  267. package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +0 -1
  268. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  269. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +0 -1
  270. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  271. package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +0 -1
  272. package/node_modules/tar/dist/commonjs/options.d.ts +0 -596
  273. package/node_modules/tar/dist/commonjs/options.d.ts.map +0 -1
  274. package/node_modules/tar/dist/commonjs/options.js +0 -66
  275. package/node_modules/tar/dist/commonjs/options.js.map +0 -1
  276. package/node_modules/tar/dist/commonjs/pack.d.ts +0 -102
  277. package/node_modules/tar/dist/commonjs/pack.d.ts.map +0 -1
  278. package/node_modules/tar/dist/commonjs/pack.js +0 -511
  279. package/node_modules/tar/dist/commonjs/pack.js.map +0 -1
  280. package/node_modules/tar/dist/commonjs/package.json +0 -3
  281. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -85
  282. package/node_modules/tar/dist/commonjs/parse.d.ts.map +0 -1
  283. package/node_modules/tar/dist/commonjs/parse.js +0 -610
  284. package/node_modules/tar/dist/commonjs/parse.js.map +0 -1
  285. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +0 -11
  286. package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +0 -1
  287. package/node_modules/tar/dist/commonjs/path-reservations.js +0 -170
  288. package/node_modules/tar/dist/commonjs/path-reservations.js.map +0 -1
  289. package/node_modules/tar/dist/commonjs/pax.d.ts +0 -26
  290. package/node_modules/tar/dist/commonjs/pax.d.ts.map +0 -1
  291. package/node_modules/tar/dist/commonjs/pax.js +0 -158
  292. package/node_modules/tar/dist/commonjs/pax.js.map +0 -1
  293. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  294. package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +0 -1
  295. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  296. package/node_modules/tar/dist/commonjs/process-umask.js.map +0 -1
  297. package/node_modules/tar/dist/commonjs/read-entry.d.ts +0 -36
  298. package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +0 -1
  299. package/node_modules/tar/dist/commonjs/read-entry.js +0 -136
  300. package/node_modules/tar/dist/commonjs/read-entry.js.map +0 -1
  301. package/node_modules/tar/dist/commonjs/replace.d.ts +0 -2
  302. package/node_modules/tar/dist/commonjs/replace.d.ts.map +0 -1
  303. package/node_modules/tar/dist/commonjs/replace.js +0 -227
  304. package/node_modules/tar/dist/commonjs/replace.js.map +0 -1
  305. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +0 -2
  306. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +0 -1
  307. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +0 -29
  308. package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +0 -1
  309. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +0 -2
  310. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +0 -1
  311. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +0 -18
  312. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +0 -1
  313. package/node_modules/tar/dist/commonjs/symlink-error.d.ts +0 -9
  314. package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +0 -1
  315. package/node_modules/tar/dist/commonjs/symlink-error.js +0 -19
  316. package/node_modules/tar/dist/commonjs/symlink-error.js.map +0 -1
  317. package/node_modules/tar/dist/commonjs/types.d.ts +0 -7
  318. package/node_modules/tar/dist/commonjs/types.d.ts.map +0 -1
  319. package/node_modules/tar/dist/commonjs/types.js +0 -50
  320. package/node_modules/tar/dist/commonjs/types.js.map +0 -1
  321. package/node_modules/tar/dist/commonjs/unpack.d.ts +0 -101
  322. package/node_modules/tar/dist/commonjs/unpack.d.ts.map +0 -1
  323. package/node_modules/tar/dist/commonjs/unpack.js +0 -932
  324. package/node_modules/tar/dist/commonjs/unpack.js.map +0 -1
  325. package/node_modules/tar/dist/commonjs/update.d.ts +0 -2
  326. package/node_modules/tar/dist/commonjs/update.d.ts.map +0 -1
  327. package/node_modules/tar/dist/commonjs/update.js +0 -33
  328. package/node_modules/tar/dist/commonjs/update.js.map +0 -1
  329. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  330. package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +0 -1
  331. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  332. package/node_modules/tar/dist/commonjs/warn-method.js.map +0 -1
  333. package/node_modules/tar/dist/commonjs/winchars.d.ts +0 -3
  334. package/node_modules/tar/dist/commonjs/winchars.d.ts.map +0 -1
  335. package/node_modules/tar/dist/commonjs/winchars.js +0 -14
  336. package/node_modules/tar/dist/commonjs/winchars.js.map +0 -1
  337. package/node_modules/tar/dist/commonjs/write-entry.d.ts +0 -129
  338. package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +0 -1
  339. package/node_modules/tar/dist/commonjs/write-entry.js +0 -698
  340. package/node_modules/tar/dist/commonjs/write-entry.js.map +0 -1
  341. package/node_modules/tar/dist/esm/create.d.ts +0 -3
  342. package/node_modules/tar/dist/esm/create.d.ts.map +0 -1
  343. package/node_modules/tar/dist/esm/create.js +0 -76
  344. package/node_modules/tar/dist/esm/create.js.map +0 -1
  345. package/node_modules/tar/dist/esm/cwd-error.d.ts +0 -8
  346. package/node_modules/tar/dist/esm/cwd-error.d.ts.map +0 -1
  347. package/node_modules/tar/dist/esm/cwd-error.js +0 -14
  348. package/node_modules/tar/dist/esm/cwd-error.js.map +0 -1
  349. package/node_modules/tar/dist/esm/extract.d.ts +0 -3
  350. package/node_modules/tar/dist/esm/extract.d.ts.map +0 -1
  351. package/node_modules/tar/dist/esm/extract.js +0 -49
  352. package/node_modules/tar/dist/esm/extract.js.map +0 -1
  353. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  354. package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +0 -1
  355. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  356. package/node_modules/tar/dist/esm/get-write-flag.js.map +0 -1
  357. package/node_modules/tar/dist/esm/header.d.ts +0 -53
  358. package/node_modules/tar/dist/esm/header.d.ts.map +0 -1
  359. package/node_modules/tar/dist/esm/header.js +0 -275
  360. package/node_modules/tar/dist/esm/header.js.map +0 -1
  361. package/node_modules/tar/dist/esm/index.d.ts +0 -20
  362. package/node_modules/tar/dist/esm/index.d.ts.map +0 -1
  363. package/node_modules/tar/dist/esm/index.js +0 -20
  364. package/node_modules/tar/dist/esm/index.js.map +0 -1
  365. package/node_modules/tar/dist/esm/index.min.js +0 -4
  366. package/node_modules/tar/dist/esm/index.min.js.map +0 -7
  367. package/node_modules/tar/dist/esm/large-numbers.d.ts +0 -3
  368. package/node_modules/tar/dist/esm/large-numbers.d.ts.map +0 -1
  369. package/node_modules/tar/dist/esm/large-numbers.js +0 -94
  370. package/node_modules/tar/dist/esm/large-numbers.js.map +0 -1
  371. package/node_modules/tar/dist/esm/list.d.ts +0 -7
  372. package/node_modules/tar/dist/esm/list.d.ts.map +0 -1
  373. package/node_modules/tar/dist/esm/list.js +0 -105
  374. package/node_modules/tar/dist/esm/list.js.map +0 -1
  375. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  376. package/node_modules/tar/dist/esm/make-command.d.ts.map +0 -1
  377. package/node_modules/tar/dist/esm/make-command.js +0 -48
  378. package/node_modules/tar/dist/esm/make-command.js.map +0 -1
  379. package/node_modules/tar/dist/esm/mkdir.d.ts +0 -25
  380. package/node_modules/tar/dist/esm/mkdir.d.ts.map +0 -1
  381. package/node_modules/tar/dist/esm/mkdir.js +0 -179
  382. package/node_modules/tar/dist/esm/mkdir.js.map +0 -1
  383. package/node_modules/tar/dist/esm/mode-fix.d.ts +0 -2
  384. package/node_modules/tar/dist/esm/mode-fix.d.ts.map +0 -1
  385. package/node_modules/tar/dist/esm/mode-fix.js +0 -25
  386. package/node_modules/tar/dist/esm/mode-fix.js.map +0 -1
  387. package/node_modules/tar/dist/esm/normalize-unicode.d.ts +0 -2
  388. package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +0 -1
  389. package/node_modules/tar/dist/esm/normalize-unicode.js +0 -34
  390. package/node_modules/tar/dist/esm/normalize-unicode.js.map +0 -1
  391. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  392. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +0 -1
  393. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  394. package/node_modules/tar/dist/esm/normalize-windows-path.js.map +0 -1
  395. package/node_modules/tar/dist/esm/options.d.ts +0 -596
  396. package/node_modules/tar/dist/esm/options.d.ts.map +0 -1
  397. package/node_modules/tar/dist/esm/options.js +0 -54
  398. package/node_modules/tar/dist/esm/options.js.map +0 -1
  399. package/node_modules/tar/dist/esm/pack.d.ts +0 -102
  400. package/node_modules/tar/dist/esm/pack.d.ts.map +0 -1
  401. package/node_modules/tar/dist/esm/pack.js +0 -469
  402. package/node_modules/tar/dist/esm/pack.js.map +0 -1
  403. package/node_modules/tar/dist/esm/package.json +0 -3
  404. package/node_modules/tar/dist/esm/parse.d.ts +0 -85
  405. package/node_modules/tar/dist/esm/parse.d.ts.map +0 -1
  406. package/node_modules/tar/dist/esm/parse.js +0 -606
  407. package/node_modules/tar/dist/esm/parse.js.map +0 -1
  408. package/node_modules/tar/dist/esm/path-reservations.d.ts +0 -11
  409. package/node_modules/tar/dist/esm/path-reservations.d.ts.map +0 -1
  410. package/node_modules/tar/dist/esm/path-reservations.js +0 -166
  411. package/node_modules/tar/dist/esm/path-reservations.js.map +0 -1
  412. package/node_modules/tar/dist/esm/pax.d.ts +0 -26
  413. package/node_modules/tar/dist/esm/pax.d.ts.map +0 -1
  414. package/node_modules/tar/dist/esm/pax.js +0 -154
  415. package/node_modules/tar/dist/esm/pax.js.map +0 -1
  416. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  417. package/node_modules/tar/dist/esm/process-umask.d.ts.map +0 -1
  418. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  419. package/node_modules/tar/dist/esm/process-umask.js.map +0 -1
  420. package/node_modules/tar/dist/esm/read-entry.d.ts +0 -36
  421. package/node_modules/tar/dist/esm/read-entry.d.ts.map +0 -1
  422. package/node_modules/tar/dist/esm/read-entry.js +0 -132
  423. package/node_modules/tar/dist/esm/read-entry.js.map +0 -1
  424. package/node_modules/tar/dist/esm/replace.d.ts +0 -2
  425. package/node_modules/tar/dist/esm/replace.d.ts.map +0 -1
  426. package/node_modules/tar/dist/esm/replace.js +0 -221
  427. package/node_modules/tar/dist/esm/replace.js.map +0 -1
  428. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +0 -2
  429. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +0 -1
  430. package/node_modules/tar/dist/esm/strip-absolute-path.js +0 -25
  431. package/node_modules/tar/dist/esm/strip-absolute-path.js.map +0 -1
  432. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +0 -2
  433. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +0 -1
  434. package/node_modules/tar/dist/esm/strip-trailing-slashes.js +0 -14
  435. package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +0 -1
  436. package/node_modules/tar/dist/esm/symlink-error.d.ts +0 -9
  437. package/node_modules/tar/dist/esm/symlink-error.d.ts.map +0 -1
  438. package/node_modules/tar/dist/esm/symlink-error.js +0 -15
  439. package/node_modules/tar/dist/esm/symlink-error.js.map +0 -1
  440. package/node_modules/tar/dist/esm/types.d.ts +0 -7
  441. package/node_modules/tar/dist/esm/types.d.ts.map +0 -1
  442. package/node_modules/tar/dist/esm/types.js +0 -45
  443. package/node_modules/tar/dist/esm/types.js.map +0 -1
  444. package/node_modules/tar/dist/esm/unpack.d.ts +0 -101
  445. package/node_modules/tar/dist/esm/unpack.d.ts.map +0 -1
  446. package/node_modules/tar/dist/esm/unpack.js +0 -891
  447. package/node_modules/tar/dist/esm/unpack.js.map +0 -1
  448. package/node_modules/tar/dist/esm/update.d.ts +0 -2
  449. package/node_modules/tar/dist/esm/update.d.ts.map +0 -1
  450. package/node_modules/tar/dist/esm/update.js +0 -30
  451. package/node_modules/tar/dist/esm/update.js.map +0 -1
  452. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  453. package/node_modules/tar/dist/esm/warn-method.d.ts.map +0 -1
  454. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  455. package/node_modules/tar/dist/esm/warn-method.js.map +0 -1
  456. package/node_modules/tar/dist/esm/winchars.d.ts +0 -3
  457. package/node_modules/tar/dist/esm/winchars.d.ts.map +0 -1
  458. package/node_modules/tar/dist/esm/winchars.js +0 -9
  459. package/node_modules/tar/dist/esm/winchars.js.map +0 -1
  460. package/node_modules/tar/dist/esm/write-entry.d.ts +0 -129
  461. package/node_modules/tar/dist/esm/write-entry.d.ts.map +0 -1
  462. package/node_modules/tar/dist/esm/write-entry.js +0 -656
  463. package/node_modules/tar/dist/esm/write-entry.js.map +0 -1
  464. package/node_modules/tar/package.json +0 -297
  465. package/node_modules/yallist/LICENSE.md +0 -63
  466. package/node_modules/yallist/README.md +0 -205
  467. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  468. package/node_modules/yallist/dist/commonjs/index.d.ts.map +0 -1
  469. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  470. package/node_modules/yallist/dist/commonjs/index.js.map +0 -1
  471. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  472. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  473. package/node_modules/yallist/dist/esm/index.d.ts.map +0 -1
  474. package/node_modules/yallist/dist/esm/index.js +0 -379
  475. package/node_modules/yallist/dist/esm/index.js.map +0 -1
  476. package/node_modules/yallist/dist/esm/package.json +0 -3
  477. package/node_modules/yallist/package.json +0 -68
@@ -1,430 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.WriteStreamSync = exports.WriteStream = exports.ReadStreamSync = exports.ReadStream = void 0;
7
- const events_1 = __importDefault(require("events"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const minipass_1 = require("minipass");
10
- const writev = fs_1.default.writev;
11
- const _autoClose = Symbol('_autoClose');
12
- const _close = Symbol('_close');
13
- const _ended = Symbol('_ended');
14
- const _fd = Symbol('_fd');
15
- const _finished = Symbol('_finished');
16
- const _flags = Symbol('_flags');
17
- const _flush = Symbol('_flush');
18
- const _handleChunk = Symbol('_handleChunk');
19
- const _makeBuf = Symbol('_makeBuf');
20
- const _mode = Symbol('_mode');
21
- const _needDrain = Symbol('_needDrain');
22
- const _onerror = Symbol('_onerror');
23
- const _onopen = Symbol('_onopen');
24
- const _onread = Symbol('_onread');
25
- const _onwrite = Symbol('_onwrite');
26
- const _open = Symbol('_open');
27
- const _path = Symbol('_path');
28
- const _pos = Symbol('_pos');
29
- const _queue = Symbol('_queue');
30
- const _read = Symbol('_read');
31
- const _readSize = Symbol('_readSize');
32
- const _reading = Symbol('_reading');
33
- const _remain = Symbol('_remain');
34
- const _size = Symbol('_size');
35
- const _write = Symbol('_write');
36
- const _writing = Symbol('_writing');
37
- const _defaultFlag = Symbol('_defaultFlag');
38
- const _errored = Symbol('_errored');
39
- class ReadStream extends minipass_1.Minipass {
40
- [_errored] = false;
41
- [_fd];
42
- [_path];
43
- [_readSize];
44
- [_reading] = false;
45
- [_size];
46
- [_remain];
47
- [_autoClose];
48
- constructor(path, opt) {
49
- opt = opt || {};
50
- super(opt);
51
- this.readable = true;
52
- this.writable = false;
53
- if (typeof path !== 'string') {
54
- throw new TypeError('path must be a string');
55
- }
56
- this[_errored] = false;
57
- this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
58
- this[_path] = path;
59
- this[_readSize] = opt.readSize || 16 * 1024 * 1024;
60
- this[_reading] = false;
61
- this[_size] = typeof opt.size === 'number' ? opt.size : Infinity;
62
- this[_remain] = this[_size];
63
- this[_autoClose] =
64
- typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
65
- if (typeof this[_fd] === 'number') {
66
- this[_read]();
67
- }
68
- else {
69
- this[_open]();
70
- }
71
- }
72
- get fd() {
73
- return this[_fd];
74
- }
75
- get path() {
76
- return this[_path];
77
- }
78
- //@ts-ignore
79
- write() {
80
- throw new TypeError('this is a readable stream');
81
- }
82
- //@ts-ignore
83
- end() {
84
- throw new TypeError('this is a readable stream');
85
- }
86
- [_open]() {
87
- fs_1.default.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd));
88
- }
89
- [_onopen](er, fd) {
90
- if (er) {
91
- this[_onerror](er);
92
- }
93
- else {
94
- this[_fd] = fd;
95
- this.emit('open', fd);
96
- this[_read]();
97
- }
98
- }
99
- [_makeBuf]() {
100
- return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]));
101
- }
102
- [_read]() {
103
- if (!this[_reading]) {
104
- this[_reading] = true;
105
- const buf = this[_makeBuf]();
106
- /* c8 ignore start */
107
- if (buf.length === 0) {
108
- return process.nextTick(() => this[_onread](null, 0, buf));
109
- }
110
- /* c8 ignore stop */
111
- fs_1.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b));
112
- }
113
- }
114
- [_onread](er, br, buf) {
115
- this[_reading] = false;
116
- if (er) {
117
- this[_onerror](er);
118
- }
119
- else if (this[_handleChunk](br, buf)) {
120
- this[_read]();
121
- }
122
- }
123
- [_close]() {
124
- if (this[_autoClose] && typeof this[_fd] === 'number') {
125
- const fd = this[_fd];
126
- this[_fd] = undefined;
127
- fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
128
- }
129
- }
130
- [_onerror](er) {
131
- this[_reading] = true;
132
- this[_close]();
133
- this.emit('error', er);
134
- }
135
- [_handleChunk](br, buf) {
136
- let ret = false;
137
- // no effect if infinite
138
- this[_remain] -= br;
139
- if (br > 0) {
140
- ret = super.write(br < buf.length ? buf.subarray(0, br) : buf);
141
- }
142
- if (br === 0 || this[_remain] <= 0) {
143
- ret = false;
144
- this[_close]();
145
- super.end();
146
- }
147
- return ret;
148
- }
149
- emit(ev, ...args) {
150
- switch (ev) {
151
- case 'prefinish':
152
- case 'finish':
153
- return false;
154
- case 'drain':
155
- if (typeof this[_fd] === 'number') {
156
- this[_read]();
157
- }
158
- return false;
159
- case 'error':
160
- if (this[_errored]) {
161
- return false;
162
- }
163
- this[_errored] = true;
164
- return super.emit(ev, ...args);
165
- default:
166
- return super.emit(ev, ...args);
167
- }
168
- }
169
- }
170
- exports.ReadStream = ReadStream;
171
- class ReadStreamSync extends ReadStream {
172
- [_open]() {
173
- let threw = true;
174
- try {
175
- this[_onopen](null, fs_1.default.openSync(this[_path], 'r'));
176
- threw = false;
177
- }
178
- finally {
179
- if (threw) {
180
- this[_close]();
181
- }
182
- }
183
- }
184
- [_read]() {
185
- let threw = true;
186
- try {
187
- if (!this[_reading]) {
188
- this[_reading] = true;
189
- do {
190
- const buf = this[_makeBuf]();
191
- /* c8 ignore start */
192
- const br = buf.length === 0
193
- ? 0
194
- : fs_1.default.readSync(this[_fd], buf, 0, buf.length, null);
195
- /* c8 ignore stop */
196
- if (!this[_handleChunk](br, buf)) {
197
- break;
198
- }
199
- } while (true);
200
- this[_reading] = false;
201
- }
202
- threw = false;
203
- }
204
- finally {
205
- if (threw) {
206
- this[_close]();
207
- }
208
- }
209
- }
210
- [_close]() {
211
- if (this[_autoClose] && typeof this[_fd] === 'number') {
212
- const fd = this[_fd];
213
- this[_fd] = undefined;
214
- fs_1.default.closeSync(fd);
215
- this.emit('close');
216
- }
217
- }
218
- }
219
- exports.ReadStreamSync = ReadStreamSync;
220
- class WriteStream extends events_1.default {
221
- readable = false;
222
- writable = true;
223
- [_errored] = false;
224
- [_writing] = false;
225
- [_ended] = false;
226
- [_queue] = [];
227
- [_needDrain] = false;
228
- [_path];
229
- [_mode];
230
- [_autoClose];
231
- [_fd];
232
- [_defaultFlag];
233
- [_flags];
234
- [_finished] = false;
235
- [_pos];
236
- constructor(path, opt) {
237
- opt = opt || {};
238
- super(opt);
239
- this[_path] = path;
240
- this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
241
- this[_mode] = opt.mode === undefined ? 0o666 : opt.mode;
242
- this[_pos] = typeof opt.start === 'number' ? opt.start : undefined;
243
- this[_autoClose] =
244
- typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
245
- // truncating makes no sense when writing into the middle
246
- const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w';
247
- this[_defaultFlag] = opt.flags === undefined;
248
- this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags;
249
- if (this[_fd] === undefined) {
250
- this[_open]();
251
- }
252
- }
253
- emit(ev, ...args) {
254
- if (ev === 'error') {
255
- if (this[_errored]) {
256
- return false;
257
- }
258
- this[_errored] = true;
259
- }
260
- return super.emit(ev, ...args);
261
- }
262
- get fd() {
263
- return this[_fd];
264
- }
265
- get path() {
266
- return this[_path];
267
- }
268
- [_onerror](er) {
269
- this[_close]();
270
- this[_writing] = true;
271
- this.emit('error', er);
272
- }
273
- [_open]() {
274
- fs_1.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd));
275
- }
276
- [_onopen](er, fd) {
277
- if (this[_defaultFlag] &&
278
- this[_flags] === 'r+' &&
279
- er &&
280
- er.code === 'ENOENT') {
281
- this[_flags] = 'w';
282
- this[_open]();
283
- }
284
- else if (er) {
285
- this[_onerror](er);
286
- }
287
- else {
288
- this[_fd] = fd;
289
- this.emit('open', fd);
290
- if (!this[_writing]) {
291
- this[_flush]();
292
- }
293
- }
294
- }
295
- end(buf, enc) {
296
- if (buf) {
297
- //@ts-ignore
298
- this.write(buf, enc);
299
- }
300
- this[_ended] = true;
301
- // synthetic after-write logic, where drain/finish live
302
- if (!this[_writing] &&
303
- !this[_queue].length &&
304
- typeof this[_fd] === 'number') {
305
- this[_onwrite](null, 0);
306
- }
307
- return this;
308
- }
309
- write(buf, enc) {
310
- if (typeof buf === 'string') {
311
- buf = Buffer.from(buf, enc);
312
- }
313
- if (this[_ended]) {
314
- this.emit('error', new Error('write() after end()'));
315
- return false;
316
- }
317
- if (this[_fd] === undefined || this[_writing] || this[_queue].length) {
318
- this[_queue].push(buf);
319
- this[_needDrain] = true;
320
- return false;
321
- }
322
- this[_writing] = true;
323
- this[_write](buf);
324
- return true;
325
- }
326
- [_write](buf) {
327
- fs_1.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw));
328
- }
329
- [_onwrite](er, bw) {
330
- if (er) {
331
- this[_onerror](er);
332
- }
333
- else {
334
- if (this[_pos] !== undefined && typeof bw === 'number') {
335
- this[_pos] += bw;
336
- }
337
- if (this[_queue].length) {
338
- this[_flush]();
339
- }
340
- else {
341
- this[_writing] = false;
342
- if (this[_ended] && !this[_finished]) {
343
- this[_finished] = true;
344
- this[_close]();
345
- this.emit('finish');
346
- }
347
- else if (this[_needDrain]) {
348
- this[_needDrain] = false;
349
- this.emit('drain');
350
- }
351
- }
352
- }
353
- }
354
- [_flush]() {
355
- if (this[_queue].length === 0) {
356
- if (this[_ended]) {
357
- this[_onwrite](null, 0);
358
- }
359
- }
360
- else if (this[_queue].length === 1) {
361
- this[_write](this[_queue].pop());
362
- }
363
- else {
364
- const iovec = this[_queue];
365
- this[_queue] = [];
366
- writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw));
367
- }
368
- }
369
- [_close]() {
370
- if (this[_autoClose] && typeof this[_fd] === 'number') {
371
- const fd = this[_fd];
372
- this[_fd] = undefined;
373
- fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
374
- }
375
- }
376
- }
377
- exports.WriteStream = WriteStream;
378
- class WriteStreamSync extends WriteStream {
379
- [_open]() {
380
- let fd;
381
- // only wrap in a try{} block if we know we'll retry, to avoid
382
- // the rethrow obscuring the error's source frame in most cases.
383
- if (this[_defaultFlag] && this[_flags] === 'r+') {
384
- try {
385
- fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]);
386
- }
387
- catch (er) {
388
- if (er?.code === 'ENOENT') {
389
- this[_flags] = 'w';
390
- return this[_open]();
391
- }
392
- else {
393
- throw er;
394
- }
395
- }
396
- }
397
- else {
398
- fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]);
399
- }
400
- this[_onopen](null, fd);
401
- }
402
- [_close]() {
403
- if (this[_autoClose] && typeof this[_fd] === 'number') {
404
- const fd = this[_fd];
405
- this[_fd] = undefined;
406
- fs_1.default.closeSync(fd);
407
- this.emit('close');
408
- }
409
- }
410
- [_write](buf) {
411
- // throw the original, but try to close if it fails
412
- let threw = true;
413
- try {
414
- this[_onwrite](null, fs_1.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos]));
415
- threw = false;
416
- }
417
- finally {
418
- if (threw) {
419
- try {
420
- this[_close]();
421
- }
422
- catch {
423
- // ok error
424
- }
425
- }
426
- }
427
- }
428
- }
429
- exports.WriteStreamSync = WriteStreamSync;
430
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,4CAAmB;AACnB,uCAAmC;AAEnC,MAAM,MAAM,GAAG,YAAE,CAAC,MAAM,CAAA;AAExB,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ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CAAC;QACH,CAAC;IACH,CAAC;CACF;AAnDD,0CAmDC","sourcesContent":["import EE from 'events'\nimport fs from 'fs'\nimport { Minipass } from 'minipass'\n\nconst writev = fs.writev\n\nconst _autoClose = Symbol('_autoClose')\nconst _close = Symbol('_close')\nconst _ended = Symbol('_ended')\nconst _fd = Symbol('_fd')\nconst _finished = Symbol('_finished')\nconst _flags = Symbol('_flags')\nconst _flush = Symbol('_flush')\nconst _handleChunk = Symbol('_handleChunk')\nconst _makeBuf = Symbol('_makeBuf')\nconst _mode = Symbol('_mode')\nconst _needDrain = Symbol('_needDrain')\nconst _onerror = Symbol('_onerror')\nconst _onopen = Symbol('_onopen')\nconst _onread = Symbol('_onread')\nconst _onwrite = Symbol('_onwrite')\nconst _open = Symbol('_open')\nconst _path = Symbol('_path')\nconst _pos = Symbol('_pos')\nconst _queue = Symbol('_queue')\nconst _read = Symbol('_read')\nconst _readSize = Symbol('_readSize')\nconst _reading = Symbol('_reading')\nconst _remain = Symbol('_remain')\nconst _size = Symbol('_size')\nconst _write = Symbol('_write')\nconst _writing = Symbol('_writing')\nconst _defaultFlag = Symbol('_defaultFlag')\nconst _errored = Symbol('_errored')\n\nexport type ReadStreamOptions =\n Minipass.Options<Minipass.ContiguousData> & {\n fd?: number\n readSize?: number\n size?: number\n autoClose?: boolean\n }\n\nexport type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & {\n open: [fd: number]\n}\n\nexport class ReadStream extends Minipass<\n Minipass.ContiguousData,\n Buffer,\n ReadStreamEvents\n> {\n [_errored]: boolean = false;\n [_fd]?: number;\n [_path]: string;\n [_readSize]: number;\n [_reading]: boolean = false;\n [_size]: number;\n [_remain]: number;\n [_autoClose]: boolean\n\n constructor(path: string, opt: ReadStreamOptions) {\n opt = opt || {}\n super(opt)\n\n this.readable = true\n this.writable = false\n\n if (typeof path !== 'string') {\n throw new TypeError('path must be a string')\n }\n\n this[_errored] = false\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined\n this[_path] = path\n this[_readSize] = opt.readSize || 16 * 1024 * 1024\n this[_reading] = false\n this[_size] = typeof opt.size === 'number' ? opt.size : Infinity\n this[_remain] = this[_size]\n this[_autoClose] =\n typeof opt.autoClose === 'boolean' ? opt.autoClose : true\n\n if (typeof this[_fd] === 'number') {\n this[_read]()\n } else {\n this[_open]()\n }\n }\n\n get fd() {\n return this[_fd]\n }\n\n get path() {\n return this[_path]\n }\n\n //@ts-ignore\n write() {\n throw new TypeError('this is a readable stream')\n }\n\n //@ts-ignore\n end() {\n throw new TypeError('this is a readable stream')\n }\n\n [_open]() {\n fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen](er?: NodeJS.ErrnoException | null, fd?: number) {\n if (er) {\n this[_onerror](er)\n } else {\n this[_fd] = fd\n this.emit('open', fd as number)\n this[_read]()\n }\n }\n\n [_makeBuf]() {\n return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))\n }\n\n [_read]() {\n if (!this[_reading]) {\n this[_reading] = true\n const buf = this[_makeBuf]()\n /* c8 ignore start */\n if (buf.length === 0) {\n return process.nextTick(() => this[_onread](null, 0, buf))\n }\n /* c8 ignore stop */\n fs.read(this[_fd] as number, buf, 0, buf.length, null, (er, br, b) =>\n this[_onread](er, br, b),\n )\n }\n }\n\n [_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer) {\n this[_reading] = false\n if (er) {\n this[_onerror](er)\n } else if (this[_handleChunk](br as number, buf as Buffer)) {\n this[_read]()\n }\n }\n\n [_close]() {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = undefined\n fs.close(fd, er =>\n er ? this.emit('error', er) : this.emit('close'),\n )\n }\n }\n\n [_onerror](er: NodeJS.ErrnoException) {\n this[_reading] = true\n this[_close]()\n this.emit('error', er)\n }\n\n [_handleChunk](br: number, buf: Buffer) {\n let ret = false\n // no effect if infinite\n this[_remain] -= br\n if (br > 0) {\n ret = super.write(br < buf.length ? buf.subarray(0, br) : buf)\n }\n\n if (br === 0 || this[_remain] <= 0) {\n ret = false\n this[_close]()\n super.end()\n }\n\n return ret\n }\n\n emit<Event extends keyof ReadStreamEvents>(\n ev: Event,\n ...args: ReadStreamEvents[Event]\n ): boolean {\n switch (ev) {\n case 'prefinish':\n case 'finish':\n return false\n\n case 'drain':\n if (typeof this[_fd] === 'number') {\n this[_read]()\n }\n return false\n\n case 'error':\n if (this[_errored]) {\n return false\n }\n this[_errored] = true\n return super.emit(ev, ...args)\n\n default:\n return super.emit(ev, ...args)\n }\n }\n}\n\nexport class ReadStreamSync extends ReadStream {\n [_open]() {\n let threw = true\n try {\n this[_onopen](null, fs.openSync(this[_path], 'r'))\n threw = false\n } finally {\n if (threw) {\n this[_close]()\n }\n }\n }\n\n [_read]() {\n let threw = true\n try {\n if (!this[_reading]) {\n this[_reading] = true\n do {\n const buf = this[_makeBuf]()\n /* c8 ignore start */\n const br =\n buf.length === 0\n ? 0\n : fs.readSync(this[_fd] as number, buf, 0, buf.length, null)\n /* c8 ignore stop */\n if (!this[_handleChunk](br, buf)) {\n break\n }\n } while (true)\n this[_reading] = false\n }\n threw = false\n } finally {\n if (threw) {\n this[_close]()\n }\n }\n }\n\n [_close]() {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = undefined\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n}\n\nexport type WriteStreamOptions = {\n fd?: number\n autoClose?: boolean\n mode?: number\n captureRejections?: boolean\n start?: number\n flags?: string\n}\n\nexport class WriteStream extends EE {\n readable: false = false\n writable: boolean = true;\n [_errored]: boolean = false;\n [_writing]: boolean = false;\n [_ended]: boolean = false;\n [_queue]: Buffer[] = [];\n [_needDrain]: boolean = false;\n [_path]: string;\n [_mode]: number;\n [_autoClose]: boolean;\n [_fd]?: number;\n [_defaultFlag]: boolean;\n [_flags]: string;\n [_finished]: boolean = false;\n [_pos]?: number\n\n constructor(path: string, opt: WriteStreamOptions) {\n opt = opt || {}\n super(opt)\n this[_path] = path\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined\n this[_mode] = opt.mode === undefined ? 0o666 : opt.mode\n this[_pos] = typeof opt.start === 'number' ? opt.start : undefined\n this[_autoClose] =\n typeof opt.autoClose === 'boolean' ? opt.autoClose : true\n\n // truncating makes no sense when writing into the middle\n const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w'\n this[_defaultFlag] = opt.flags === undefined\n this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags\n\n if (this[_fd] === undefined) {\n this[_open]()\n }\n }\n\n emit(ev: string, ...args: any[]) {\n if (ev === 'error') {\n if (this[_errored]) {\n return false\n }\n this[_errored] = true\n }\n return super.emit(ev, ...args)\n }\n\n get fd() {\n return this[_fd]\n }\n\n get path() {\n return this[_path]\n }\n\n [_onerror](er: NodeJS.ErrnoException) {\n this[_close]()\n this[_writing] = true\n this.emit('error', er)\n }\n\n [_open]() {\n fs.open(this[_path], this[_flags], this[_mode], (er, fd) =>\n this[_onopen](er, fd),\n )\n }\n\n [_onopen](er?: null | NodeJS.ErrnoException, fd?: number) {\n if (\n this[_defaultFlag] &&\n this[_flags] === 'r+' &&\n er &&\n er.code === 'ENOENT'\n ) {\n this[_flags] = 'w'\n this[_open]()\n } else if (er) {\n this[_onerror](er)\n } else {\n this[_fd] = fd\n this.emit('open', fd)\n if (!this[_writing]) {\n this[_flush]()\n }\n }\n }\n\n end(buf: string, enc?: BufferEncoding): this\n end(buf?: Buffer, enc?: undefined): this\n end(buf?: Buffer | string, enc?: BufferEncoding): this {\n if (buf) {\n //@ts-ignore\n this.write(buf, enc)\n }\n\n this[_ended] = true\n\n // synthetic after-write logic, where drain/finish live\n if (\n !this[_writing] &&\n !this[_queue].length &&\n typeof this[_fd] === 'number'\n ) {\n this[_onwrite](null, 0)\n }\n return this\n }\n\n write(buf: string, enc?: BufferEncoding): boolean\n write(buf: Buffer, enc?: undefined): boolean\n write(buf: Buffer | string, enc?: BufferEncoding): boolean {\n if (typeof buf === 'string') {\n buf = Buffer.from(buf, enc)\n }\n\n if (this[_ended]) {\n this.emit('error', new Error('write() after end()'))\n return false\n }\n\n if (this[_fd] === undefined || this[_writing] || this[_queue].length) {\n this[_queue].push(buf)\n this[_needDrain] = true\n return false\n }\n\n this[_writing] = true\n this[_write](buf)\n return true\n }\n\n [_write](buf: Buffer) {\n fs.write(\n this[_fd] as number,\n buf,\n 0,\n buf.length,\n this[_pos],\n (er, bw) => this[_onwrite](er, bw),\n )\n }\n\n [_onwrite](er?: null | NodeJS.ErrnoException, bw?: number) {\n if (er) {\n this[_onerror](er)\n } else {\n if (this[_pos] !== undefined && typeof bw === 'number') {\n this[_pos] += bw\n }\n if (this[_queue].length) {\n this[_flush]()\n } else {\n this[_writing] = false\n\n if (this[_ended] && !this[_finished]) {\n this[_finished] = true\n this[_close]()\n this.emit('finish')\n } else if (this[_needDrain]) {\n this[_needDrain] = false\n this.emit('drain')\n }\n }\n }\n }\n\n [_flush]() {\n if (this[_queue].length === 0) {\n if (this[_ended]) {\n this[_onwrite](null, 0)\n }\n } else if (this[_queue].length === 1) {\n this[_write](this[_queue].pop() as Buffer)\n } else {\n const iovec = this[_queue]\n this[_queue] = []\n writev(this[_fd] as number, iovec, this[_pos] as number, (er, bw) =>\n this[_onwrite](er, bw),\n )\n }\n }\n\n [_close]() {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = undefined\n fs.close(fd, er =>\n er ? this.emit('error', er) : this.emit('close'),\n )\n }\n }\n}\n\nexport class WriteStreamSync extends WriteStream {\n [_open](): void {\n let fd\n // only wrap in a try{} block if we know we'll retry, to avoid\n // the rethrow obscuring the error's source frame in most cases.\n if (this[_defaultFlag] && this[_flags] === 'r+') {\n try {\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n } catch (er) {\n if ((er as NodeJS.ErrnoException)?.code === 'ENOENT') {\n this[_flags] = 'w'\n return this[_open]()\n } else {\n throw er\n }\n }\n } else {\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n }\n\n this[_onopen](null, fd)\n }\n\n [_close]() {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = undefined\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n\n [_write](buf: Buffer) {\n // throw the original, but try to close if it fails\n let threw = true\n try {\n this[_onwrite](\n null,\n fs.writeSync(this[_fd] as number, buf, 0, buf.length, this[_pos]),\n )\n threw = false\n } finally {\n if (threw) {\n try {\n this[_close]()\n } catch {\n // ok error\n }\n }\n }\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,118 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- /// <reference types="node" resolution-mode="require"/>
4
- import EE from 'events';
5
- import { Minipass } from 'minipass';
6
- declare const _autoClose: unique symbol;
7
- declare const _close: unique symbol;
8
- declare const _ended: unique symbol;
9
- declare const _fd: unique symbol;
10
- declare const _finished: unique symbol;
11
- declare const _flags: unique symbol;
12
- declare const _flush: unique symbol;
13
- declare const _handleChunk: unique symbol;
14
- declare const _makeBuf: unique symbol;
15
- declare const _mode: unique symbol;
16
- declare const _needDrain: unique symbol;
17
- declare const _onerror: unique symbol;
18
- declare const _onopen: unique symbol;
19
- declare const _onread: unique symbol;
20
- declare const _onwrite: unique symbol;
21
- declare const _open: unique symbol;
22
- declare const _path: unique symbol;
23
- declare const _pos: unique symbol;
24
- declare const _queue: unique symbol;
25
- declare const _read: unique symbol;
26
- declare const _readSize: unique symbol;
27
- declare const _reading: unique symbol;
28
- declare const _remain: unique symbol;
29
- declare const _size: unique symbol;
30
- declare const _write: unique symbol;
31
- declare const _writing: unique symbol;
32
- declare const _defaultFlag: unique symbol;
33
- declare const _errored: unique symbol;
34
- export type ReadStreamOptions = Minipass.Options<Minipass.ContiguousData> & {
35
- fd?: number;
36
- readSize?: number;
37
- size?: number;
38
- autoClose?: boolean;
39
- };
40
- export type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & {
41
- open: [fd: number];
42
- };
43
- export declare class ReadStream extends Minipass<Minipass.ContiguousData, Buffer, ReadStreamEvents> {
44
- [_errored]: boolean;
45
- [_fd]?: number;
46
- [_path]: string;
47
- [_readSize]: number;
48
- [_reading]: boolean;
49
- [_size]: number;
50
- [_remain]: number;
51
- [_autoClose]: boolean;
52
- constructor(path: string, opt: ReadStreamOptions);
53
- get fd(): number | undefined;
54
- get path(): string;
55
- write(): void;
56
- end(): void;
57
- [_open](): void;
58
- [_onopen](er?: NodeJS.ErrnoException | null, fd?: number): void;
59
- [_makeBuf](): Buffer;
60
- [_read](): void;
61
- [_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer): void;
62
- [_close](): void;
63
- [_onerror](er: NodeJS.ErrnoException): void;
64
- [_handleChunk](br: number, buf: Buffer): boolean;
65
- emit<Event extends keyof ReadStreamEvents>(ev: Event, ...args: ReadStreamEvents[Event]): boolean;
66
- }
67
- export declare class ReadStreamSync extends ReadStream {
68
- [_open](): void;
69
- [_read](): void;
70
- [_close](): void;
71
- }
72
- export type WriteStreamOptions = {
73
- fd?: number;
74
- autoClose?: boolean;
75
- mode?: number;
76
- captureRejections?: boolean;
77
- start?: number;
78
- flags?: string;
79
- };
80
- export declare class WriteStream extends EE {
81
- readable: false;
82
- writable: boolean;
83
- [_errored]: boolean;
84
- [_writing]: boolean;
85
- [_ended]: boolean;
86
- [_queue]: Buffer[];
87
- [_needDrain]: boolean;
88
- [_path]: string;
89
- [_mode]: number;
90
- [_autoClose]: boolean;
91
- [_fd]?: number;
92
- [_defaultFlag]: boolean;
93
- [_flags]: string;
94
- [_finished]: boolean;
95
- [_pos]?: number;
96
- constructor(path: string, opt: WriteStreamOptions);
97
- emit(ev: string, ...args: any[]): boolean;
98
- get fd(): number | undefined;
99
- get path(): string;
100
- [_onerror](er: NodeJS.ErrnoException): void;
101
- [_open](): void;
102
- [_onopen](er?: null | NodeJS.ErrnoException, fd?: number): void;
103
- end(buf: string, enc?: BufferEncoding): this;
104
- end(buf?: Buffer, enc?: undefined): this;
105
- write(buf: string, enc?: BufferEncoding): boolean;
106
- write(buf: Buffer, enc?: undefined): boolean;
107
- [_write](buf: Buffer): void;
108
- [_onwrite](er?: null | NodeJS.ErrnoException, bw?: number): void;
109
- [_flush](): void;
110
- [_close](): void;
111
- }
112
- export declare class WriteStreamSync extends WriteStream {
113
- [_open](): void;
114
- [_close](): void;
115
- [_write](buf: Buffer): void;
116
- }
117
- export {};
118
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAInC,QAAA,MAAM,UAAU,eAAuB,CAAA;AACvC,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,GAAG,eAAgB,CAAA;AACzB,QAAA,MAAM,SAAS,eAAsB,CAAA;AACrC,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,YAAY,eAAyB,CAAA;AAC3C,QAAA,MAAM,QAAQ,eAAqB,CAAA;AACnC,QAAA,MAAM,KAAK,eAAkB,CAAA;AAC7B,QAAA,MAAM,UAAU,eAAuB,CAAA;AACvC,QAAA,MAAM,QAAQ,eAAqB,CAAA;AACnC,QAAA,MAAM,OAAO,eAAoB,CAAA;AACjC,QAAA,MAAM,OAAO,eAAoB,CAAA;AACjC,QAAA,MAAM,QAAQ,eAAqB,CAAA;AACnC,QAAA,MAAM,KAAK,eAAkB,CAAA;AAC7B,QAAA,MAAM,KAAK,eAAkB,CAAA;AAC7B,QAAA,MAAM,IAAI,eAAiB,CA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