@microwiseai/snapshot 0.9.1 → 0.9.3

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 +22 -15
  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/skit-adapter.d.ts +14 -5
  16. package/dist/lib/skit-adapter.d.ts.map +1 -1
  17. package/dist/lib/skit-adapter.js +118 -177
  18. package/dist/lib/skit-adapter.js.map +1 -1
  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,136 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReadEntry = void 0;
4
- const minipass_1 = require("minipass");
5
- const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
6
- class ReadEntry extends minipass_1.Minipass {
7
- extended;
8
- globalExtended;
9
- header;
10
- startBlockSize;
11
- blockRemain;
12
- remain;
13
- type;
14
- meta = false;
15
- ignore = false;
16
- path;
17
- mode;
18
- uid;
19
- gid;
20
- uname;
21
- gname;
22
- size = 0;
23
- mtime;
24
- atime;
25
- ctime;
26
- linkpath;
27
- dev;
28
- ino;
29
- nlink;
30
- invalid = false;
31
- absolute;
32
- unsupported = false;
33
- constructor(header, ex, gex) {
34
- super({});
35
- // read entries always start life paused. this is to avoid the
36
- // situation where Minipass's auto-ending empty streams results
37
- // in an entry ending before we're ready for it.
38
- this.pause();
39
- this.extended = ex;
40
- this.globalExtended = gex;
41
- this.header = header;
42
- /* c8 ignore start */
43
- this.remain = header.size ?? 0;
44
- /* c8 ignore stop */
45
- this.startBlockSize = 512 * Math.ceil(this.remain / 512);
46
- this.blockRemain = this.startBlockSize;
47
- this.type = header.type;
48
- switch (this.type) {
49
- case 'File':
50
- case 'OldFile':
51
- case 'Link':
52
- case 'SymbolicLink':
53
- case 'CharacterDevice':
54
- case 'BlockDevice':
55
- case 'Directory':
56
- case 'FIFO':
57
- case 'ContiguousFile':
58
- case 'GNUDumpDir':
59
- break;
60
- case 'NextFileHasLongLinkpath':
61
- case 'NextFileHasLongPath':
62
- case 'OldGnuLongPath':
63
- case 'GlobalExtendedHeader':
64
- case 'ExtendedHeader':
65
- case 'OldExtendedHeader':
66
- this.meta = true;
67
- break;
68
- // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
69
- // it may be worth doing the same, but with a warning.
70
- default:
71
- this.ignore = true;
72
- }
73
- /* c8 ignore start */
74
- if (!header.path) {
75
- throw new Error('no path provided for tar.ReadEntry');
76
- }
77
- /* c8 ignore stop */
78
- this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.path);
79
- this.mode = header.mode;
80
- if (this.mode) {
81
- this.mode = this.mode & 0o7777;
82
- }
83
- this.uid = header.uid;
84
- this.gid = header.gid;
85
- this.uname = header.uname;
86
- this.gname = header.gname;
87
- this.size = this.remain;
88
- this.mtime = header.mtime;
89
- this.atime = header.atime;
90
- this.ctime = header.ctime;
91
- /* c8 ignore start */
92
- this.linkpath =
93
- header.linkpath ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.linkpath) : undefined;
94
- /* c8 ignore stop */
95
- this.uname = header.uname;
96
- this.gname = header.gname;
97
- if (ex) {
98
- this.#slurp(ex);
99
- }
100
- if (gex) {
101
- this.#slurp(gex, true);
102
- }
103
- }
104
- write(data) {
105
- const writeLen = data.length;
106
- if (writeLen > this.blockRemain) {
107
- throw new Error('writing more to entry than is appropriate');
108
- }
109
- const r = this.remain;
110
- const br = this.blockRemain;
111
- this.remain = Math.max(0, r - writeLen);
112
- this.blockRemain = Math.max(0, br - writeLen);
113
- if (this.ignore) {
114
- return true;
115
- }
116
- if (r >= writeLen) {
117
- return super.write(data);
118
- }
119
- // r < writeLen
120
- return super.write(data.subarray(0, r));
121
- }
122
- #slurp(ex, gex = false) {
123
- if (ex.path)
124
- ex.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.path);
125
- if (ex.linkpath)
126
- ex.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.linkpath);
127
- Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
128
- // we slurp in everything except for the path attribute in
129
- // a global extended header, because that's weird. Also, any
130
- // null/undefined values are ignored.
131
- return !(v === null || v === undefined || (k === 'path' && gex));
132
- })));
133
- }
134
- }
135
- exports.ReadEntry = ReadEntry;
136
- //# sourceMappingURL=read-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-entry.js","sourceRoot":"","sources":["../../src/read-entry.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAEnC,2EAAkE;AAIlE,MAAa,SAAU,SAAQ,mBAAwB;IACrD,QAAQ,CAAM;IACd,cAAc,CAAM;IACpB,MAAM,CAAQ;IACd,cAAc,CAAQ;IACtB,WAAW,CAAQ;IACnB,MAAM,CAAQ;IACd,IAAI,CAAe;IACnB,IAAI,GAAY,KAAK,CAAA;IACrB,MAAM,GAAY,KAAK,CAAA;IACvB,IAAI,CAAQ;IACZ,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,KAAK,CAAS;IACd,IAAI,GAAW,CAAC,CAAA;IAChB,KAAK,CAAO;IACZ,KAAK,CAAO;IACZ,KAAK,CAAO;IACZ,QAAQ,CAAS;IAEjB,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,OAAO,GAAY,KAAK,CAAA;IACxB,QAAQ,CAAS;IACjB,WAAW,GAAY,KAAK,CAAA;IAE5B,YAAY,MAAc,EAAE,EAAQ,EAAE,GAAS;QAC7C,KAAK,CAAC,EAAE,CAAC,CAAA;QACT,+DAA+D;QAC/D,+DAA+D;QAC/D,gDAAgD;QAChD,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,cAAc,GAAG,GAAG,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,qBAAqB;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,CAAA;QAC9B,oBAAoB;QACpB,IAAI,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAA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,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAA;QAC7C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC1B,CAAC;QAED,eAAe;QACf,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,MAAM,CAAC,EAAO,EAAE,MAAe,KAAK;QAClC,IAAI,EAAE,CAAC,IAAI;YAAE,EAAE,CAAC,IAAI,GAAG,IAAA,gDAAoB,EAAC,EAAE,CAAC,IAAI,CAAC,CAAA;QACpD,IAAI,EAAE,CAAC,QAAQ;YAAE,EAAE,CAAC,QAAQ,GAAG,IAAA,gDAAoB,EAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;QAChE,MAAM,CAAC,MAAM,CACX,IAAI,EACJ,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;YACnC,0DAA0D;YAC1D,4DAA4D;YAC5D,qCAAqC;YACrC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,MAAM,IAAI,GAAG,CAAC,CAAC,CAAA;QAClE,CAAC,CAAC,CACH,CACF,CAAA;IACH,CAAC;CACF;AA/ID,8BA+IC","sourcesContent":["import { Minipass } from 'minipass'\nimport type { Header } from './header.js'\nimport { normalizeWindowsPath } from './normalize-windows-path.js'\nimport type { Pax } from './pax.js'\nimport type { EntryTypeName } from './types.js'\n\nexport class ReadEntry extends Minipass<Buffer, Buffer> {\n extended?: Pax\n globalExtended?: Pax\n header: Header\n startBlockSize: number\n blockRemain: number\n remain: number\n type: EntryTypeName\n meta: boolean = false\n ignore: boolean = false\n path: string\n mode?: number\n uid?: number\n gid?: number\n uname?: string\n gname?: string\n size: number = 0\n mtime?: Date\n atime?: Date\n ctime?: Date\n linkpath?: string\n\n dev?: number\n ino?: number\n nlink?: number\n invalid: boolean = false\n absolute?: string\n unsupported: boolean = false\n\n constructor(header: Header, ex?: Pax, gex?: Pax) {\n super({})\n // read entries always start life paused. this is to avoid the\n // situation where Minipass's auto-ending empty streams results\n // in an entry ending before we're ready for it.\n this.pause()\n this.extended = ex\n this.globalExtended = gex\n this.header = header\n /* c8 ignore start */\n this.remain = header.size ?? 0\n /* c8 ignore stop */\n this.startBlockSize = 512 * Math.ceil(this.remain / 512)\n this.blockRemain = this.startBlockSize\n this.type = header.type\n switch (this.type) {\n case 'File':\n case 'OldFile':\n case 'Link':\n case 'SymbolicLink':\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'Directory':\n case 'FIFO':\n case 'ContiguousFile':\n case 'GNUDumpDir':\n break\n\n case 'NextFileHasLongLinkpath':\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n case 'GlobalExtendedHeader':\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this.meta = true\n break\n\n // NOTE: gnutar and bsdtar treat unrecognized types as 'File'\n // it may be worth doing the same, but with a warning.\n default:\n this.ignore = true\n }\n\n /* c8 ignore start */\n if (!header.path) {\n throw new Error('no path provided for tar.ReadEntry')\n }\n /* c8 ignore stop */\n\n this.path = normalizeWindowsPath(header.path) as string\n this.mode = header.mode\n if (this.mode) {\n this.mode = this.mode & 0o7777\n }\n this.uid = header.uid\n this.gid = header.gid\n this.uname = header.uname\n this.gname = header.gname\n this.size = this.remain\n this.mtime = header.mtime\n this.atime = header.atime\n this.ctime = header.ctime\n /* c8 ignore start */\n this.linkpath =\n header.linkpath ? normalizeWindowsPath(header.linkpath) : undefined\n /* c8 ignore stop */\n this.uname = header.uname\n this.gname = header.gname\n\n if (ex) {\n this.#slurp(ex)\n }\n if (gex) {\n this.#slurp(gex, true)\n }\n }\n\n write(data: Buffer) {\n const writeLen = data.length\n if (writeLen > this.blockRemain) {\n throw new Error('writing more to entry than is appropriate')\n }\n\n const r = this.remain\n const br = this.blockRemain\n this.remain = Math.max(0, r - writeLen)\n this.blockRemain = Math.max(0, br - writeLen)\n if (this.ignore) {\n return true\n }\n\n if (r >= writeLen) {\n return super.write(data)\n }\n\n // r < writeLen\n return super.write(data.subarray(0, r))\n }\n\n #slurp(ex: Pax, gex: boolean = false) {\n if (ex.path) ex.path = normalizeWindowsPath(ex.path)\n if (ex.linkpath) ex.linkpath = normalizeWindowsPath(ex.linkpath)\n Object.assign(\n this,\n Object.fromEntries(\n Object.entries(ex).filter(([k, v]) => {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird. Also, any\n // null/undefined values are ignored.\n return !(v === null || v === undefined || (k === 'path' && gex))\n }),\n ),\n )\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare const replace: import("./make-command.js").TarCommand<never, never>;
2
- //# sourceMappingURL=replace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/replace.ts"],"names":[],"mappings":"AAuPA,eAAO,MAAM,OAAO,sDA8BnB,CAAA"}
@@ -1,227 +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.replace = void 0;
7
- // tar -r
8
- const fs_minipass_1 = require("@isaacs/fs-minipass");
9
- const node_fs_1 = __importDefault(require("node:fs"));
10
- const node_path_1 = __importDefault(require("node:path"));
11
- const header_js_1 = require("./header.js");
12
- const list_js_1 = require("./list.js");
13
- const make_command_js_1 = require("./make-command.js");
14
- const options_js_1 = require("./options.js");
15
- const pack_js_1 = require("./pack.js");
16
- // starting at the head of the file, read a Header
17
- // If the checksum is invalid, that's our position to start writing
18
- // If it is, jump forward by the specified size (round up to 512)
19
- // and try again.
20
- // Write the new Pack stream starting there.
21
- const replaceSync = (opt, files) => {
22
- const p = new pack_js_1.PackSync(opt);
23
- let threw = true;
24
- let fd;
25
- let position;
26
- try {
27
- try {
28
- fd = node_fs_1.default.openSync(opt.file, 'r+');
29
- }
30
- catch (er) {
31
- if (er?.code === 'ENOENT') {
32
- fd = node_fs_1.default.openSync(opt.file, 'w+');
33
- }
34
- else {
35
- throw er;
36
- }
37
- }
38
- const st = node_fs_1.default.fstatSync(fd);
39
- const headBuf = Buffer.alloc(512);
40
- POSITION: for (position = 0; position < st.size; position += 512) {
41
- for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
42
- bytes = node_fs_1.default.readSync(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos);
43
- if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {
44
- throw new Error('cannot append to compressed archives');
45
- }
46
- if (!bytes) {
47
- break POSITION;
48
- }
49
- }
50
- const h = new header_js_1.Header(headBuf);
51
- if (!h.cksumValid) {
52
- break;
53
- }
54
- const entryBlockSize = 512 * Math.ceil((h.size || 0) / 512);
55
- if (position + entryBlockSize + 512 > st.size) {
56
- break;
57
- }
58
- // the 512 for the header we just parsed will be added as well
59
- // also jump ahead all the blocks for the body
60
- position += entryBlockSize;
61
- if (opt.mtimeCache && h.mtime) {
62
- opt.mtimeCache.set(String(h.path), h.mtime);
63
- }
64
- }
65
- threw = false;
66
- streamSync(opt, p, position, fd, files);
67
- }
68
- finally {
69
- if (threw) {
70
- try {
71
- node_fs_1.default.closeSync(fd);
72
- }
73
- catch { }
74
- }
75
- }
76
- };
77
- const streamSync = (opt, p, position, fd, files) => {
78
- const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
79
- fd: fd,
80
- start: position,
81
- });
82
- p.pipe(stream);
83
- addFilesSync(p, files);
84
- };
85
- const replaceAsync = (opt, files) => {
86
- files = Array.from(files);
87
- const p = new pack_js_1.Pack(opt);
88
- const getPos = (fd, size, cb_) => {
89
- const cb = (er, pos) => {
90
- if (er) {
91
- node_fs_1.default.close(fd, _ => cb_(er));
92
- }
93
- else {
94
- cb_(null, pos);
95
- }
96
- };
97
- let position = 0;
98
- if (size === 0) {
99
- return cb(null, 0);
100
- }
101
- let bufPos = 0;
102
- const headBuf = Buffer.alloc(512);
103
- const onread = (er, bytes) => {
104
- if (er || bytes === undefined) {
105
- return cb(er);
106
- }
107
- bufPos += bytes;
108
- if (bufPos < 512 && bytes) {
109
- return node_fs_1.default.read(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread);
110
- }
111
- if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {
112
- return cb(new Error('cannot append to compressed archives'));
113
- }
114
- // truncated header
115
- if (bufPos < 512) {
116
- return cb(null, position);
117
- }
118
- const h = new header_js_1.Header(headBuf);
119
- if (!h.cksumValid) {
120
- return cb(null, position);
121
- }
122
- /* c8 ignore next */
123
- const entryBlockSize = 512 * Math.ceil((h.size ?? 0) / 512);
124
- if (position + entryBlockSize + 512 > size) {
125
- return cb(null, position);
126
- }
127
- position += entryBlockSize + 512;
128
- if (position >= size) {
129
- return cb(null, position);
130
- }
131
- if (opt.mtimeCache && h.mtime) {
132
- opt.mtimeCache.set(String(h.path), h.mtime);
133
- }
134
- bufPos = 0;
135
- node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
136
- };
137
- node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
138
- };
139
- const promise = new Promise((resolve, reject) => {
140
- p.on('error', reject);
141
- let flag = 'r+';
142
- const onopen = (er, fd) => {
143
- if (er && er.code === 'ENOENT' && flag === 'r+') {
144
- flag = 'w+';
145
- return node_fs_1.default.open(opt.file, flag, onopen);
146
- }
147
- if (er || !fd) {
148
- return reject(er);
149
- }
150
- node_fs_1.default.fstat(fd, (er, st) => {
151
- if (er) {
152
- return node_fs_1.default.close(fd, () => reject(er));
153
- }
154
- getPos(fd, st.size, (er, position) => {
155
- if (er) {
156
- return reject(er);
157
- }
158
- const stream = new fs_minipass_1.WriteStream(opt.file, {
159
- fd: fd,
160
- start: position,
161
- });
162
- p.pipe(stream);
163
- stream.on('error', reject);
164
- stream.on('close', resolve);
165
- addFilesAsync(p, files);
166
- });
167
- });
168
- };
169
- node_fs_1.default.open(opt.file, flag, onopen);
170
- });
171
- return promise;
172
- };
173
- const addFilesSync = (p, files) => {
174
- files.forEach(file => {
175
- if (file.charAt(0) === '@') {
176
- (0, list_js_1.list)({
177
- file: node_path_1.default.resolve(p.cwd, file.slice(1)),
178
- sync: true,
179
- noResume: true,
180
- onReadEntry: entry => p.add(entry),
181
- });
182
- }
183
- else {
184
- p.add(file);
185
- }
186
- });
187
- p.end();
188
- };
189
- const addFilesAsync = async (p, files) => {
190
- for (const file of files) {
191
- if (file.charAt(0) === '@') {
192
- await (0, list_js_1.list)({
193
- file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
194
- noResume: true,
195
- onReadEntry: entry => p.add(entry),
196
- });
197
- }
198
- else {
199
- p.add(file);
200
- }
201
- }
202
- p.end();
203
- };
204
- exports.replace = (0, make_command_js_1.makeCommand)(replaceSync, replaceAsync,
205
- /* c8 ignore start */
206
- () => {
207
- throw new TypeError('file is required');
208
- }, () => {
209
- throw new TypeError('file is required');
210
- },
211
- /* c8 ignore stop */
212
- (opt, entries) => {
213
- if (!(0, options_js_1.isFile)(opt)) {
214
- throw new TypeError('file is required');
215
- }
216
- if (opt.gzip ||
217
- opt.brotli ||
218
- opt.zstd ||
219
- opt.file.endsWith('.br') ||
220
- opt.file.endsWith('.tbr')) {
221
- throw new TypeError('cannot append to compressed archives');
222
- }
223
- if (!entries?.length) {
224
- throw new TypeError('no paths specified to add/replace');
225
- }
226
- });
227
- //# sourceMappingURL=replace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replace.js","sourceRoot":"","sources":["../../src/replace.ts"],"names":[],"mapp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AAC,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,SAAS,CAAC,kBAAkB,CAAC,CAAA;IACzC,CAAC;IAED,IACE,GAAG,CAAC,IAAI;QACR,GAAG,CAAC,MAAM;QACV,GAAG,CAAC,IAAI;QACR,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EACzB,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAA;IAC7D,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAA;IAC1D,CAAC;AACH,CAAC,CACF,CAAA","sourcesContent":["// tar -r\nimport { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass'\nimport type { Minipass } from 'minipass'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { Header } from './header.js'\nimport { list } from './list.js'\nimport { makeCommand } from './make-command.js'\nimport type { TarOptionsFile, TarOptionsSyncFile } from './options.js'\nimport { isFile } from './options.js'\nimport { Pack, PackSync } from './pack.js'\n\n// starting at the head of the file, read a Header\n// If the checksum is invalid, that's our position to start writing\n// If it is, jump forward by the specified size (round up to 512)\n// and try again.\n// Write the new Pack stream starting there.\n\nconst replaceSync = (opt: TarOptionsSyncFile, files: string[]) => {\n const p = new PackSync(opt)\n\n let threw = true\n let fd\n let position\n\n try {\n try {\n fd = fs.openSync(opt.file, 'r+')\n } catch (er) {\n if ((er as NodeJS.ErrnoException)?.code === 'ENOENT') {\n fd = fs.openSync(opt.file, 'w+')\n } else {\n throw er\n }\n }\n\n const st = fs.fstatSync(fd)\n const headBuf = Buffer.alloc(512)\n\n POSITION: for (position = 0; position < st.size; position += 512) {\n for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {\n bytes = fs.readSync(\n fd,\n headBuf,\n bufPos,\n headBuf.length - bufPos,\n position + bufPos,\n )\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {\n throw new Error('cannot append to compressed archives')\n }\n\n if (!bytes) {\n break POSITION\n }\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid) {\n break\n }\n const entryBlockSize = 512 * Math.ceil((h.size || 0) / 512)\n if (position + entryBlockSize + 512 > st.size) {\n break\n }\n // the 512 for the header we just parsed will be added as well\n // also jump ahead all the blocks for the body\n position += entryBlockSize\n if (opt.mtimeCache && h.mtime) {\n opt.mtimeCache.set(String(h.path), h.mtime)\n }\n }\n threw = false\n\n streamSync(opt, p, position, fd, files)\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd as number)\n } catch {}\n }\n }\n}\n\nconst streamSync = (\n opt: TarOptionsSyncFile,\n p: Pack,\n position: number,\n fd: number,\n files: string[],\n) => {\n const stream = new WriteStreamSync(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n addFilesSync(p, files)\n}\n\nconst replaceAsync = (\n opt: TarOptionsFile,\n files: string[],\n): Promise<void> => {\n files = Array.from(files)\n const p = new Pack(opt)\n\n const getPos = (\n fd: number,\n size: number,\n cb_: (er?: null | Error, pos?: number) => void,\n ) => {\n const cb = (er?: Error | null, pos?: number) => {\n if (er) {\n fs.close(fd, _ => cb_(er))\n } else {\n cb_(null, pos)\n }\n }\n\n let position = 0\n if (size === 0) {\n return cb(null, 0)\n }\n\n let bufPos = 0\n const headBuf = Buffer.alloc(512)\n const onread = (er?: null | Error, bytes?: number): void => {\n if (er || bytes === undefined) {\n return cb(er)\n }\n bufPos += bytes\n if (bufPos < 512 && bytes) {\n return fs.read(\n fd,\n headBuf,\n bufPos,\n headBuf.length - bufPos,\n position + bufPos,\n onread,\n )\n }\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {\n return cb(new Error('cannot append to compressed archives'))\n }\n\n // truncated header\n if (bufPos < 512) {\n return cb(null, position)\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid) {\n return cb(null, position)\n }\n\n /* c8 ignore next */\n const entryBlockSize = 512 * Math.ceil((h.size ?? 0) / 512)\n if (position + entryBlockSize + 512 > size) {\n return cb(null, position)\n }\n\n position += entryBlockSize + 512\n if (position >= size) {\n return cb(null, position)\n }\n\n if (opt.mtimeCache && h.mtime) {\n opt.mtimeCache.set(String(h.path), h.mtime)\n }\n bufPos = 0\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n\n const promise = new Promise<void>((resolve, reject) => {\n p.on('error', reject)\n let flag = 'r+'\n const onopen = (er?: NodeJS.ErrnoException | null, fd?: number) => {\n if (er && er.code === 'ENOENT' && flag === 'r+') {\n flag = 'w+'\n return fs.open(opt.file, flag, onopen)\n }\n\n if (er || !fd) {\n return reject(er)\n }\n\n fs.fstat(fd, (er, st) => {\n if (er) {\n return fs.close(fd, () => reject(er))\n }\n\n getPos(fd, st.size, (er, position) => {\n if (er) {\n return reject(er)\n }\n const stream = new WriteStream(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n stream.on('error', reject)\n stream.on('close', resolve)\n addFilesAsync(p, files)\n })\n })\n }\n fs.open(opt.file, flag, onopen)\n })\n\n return promise\n}\n\nconst addFilesSync = (p: Pack, files: string[]) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n list({\n file: path.resolve(p.cwd, file.slice(1)),\n sync: true,\n noResume: true,\n onReadEntry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = async (p: Pack, files: string[]): Promise<void> => {\n for (const file of files) {\n if (file.charAt(0) === '@') {\n await list({\n file: path.resolve(String(p.cwd), file.slice(1)),\n noResume: true,\n onReadEntry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n\nexport const replace = makeCommand(\n replaceSync,\n replaceAsync,\n /* c8 ignore start */\n (): never => {\n throw new TypeError('file is required')\n },\n (): never => {\n throw new TypeError('file is required')\n },\n /* c8 ignore stop */\n (opt, entries) => {\n if (!isFile(opt)) {\n throw new TypeError('file is required')\n }\n\n if (\n opt.gzip ||\n opt.brotli ||\n opt.zstd ||\n opt.file.endsWith('.br') ||\n opt.file.endsWith('.tbr')\n ) {\n throw new TypeError('cannot append to compressed archives')\n }\n\n if (!entries?.length) {\n throw new TypeError('no paths specified to add/replace')\n }\n },\n)\n"]}
@@ -1,2 +0,0 @@
1
- export declare const stripAbsolutePath: (path: string) => [string, string];
2
- //# sourceMappingURL=strip-absolute-path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strip-absolute-path.d.ts","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAgB/D,CAAA"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripAbsolutePath = void 0;
4
- // unix absolute paths are also absolute on win32, so we use this for both
5
- const node_path_1 = require("node:path");
6
- const { isAbsolute, parse } = node_path_1.win32;
7
- // returns [root, stripped]
8
- // Note that windows will think that //x/y/z/a has a "root" of //x/y, and in
9
- // those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip /
10
- // explicitly if it's the first character.
11
- // drive-specific relative paths on Windows get their root stripped off even
12
- // though they are not absolute, so `c:../foo` becomes ['c:', '../foo']
13
- const stripAbsolutePath = (path) => {
14
- let r = '';
15
- let parsed = parse(path);
16
- while (isAbsolute(path) || parsed.root) {
17
- // windows will think that //x/y/z has a "root" of //x/y/
18
- // but strip the //?/C:/ off of //?/C:/path
19
- const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ?
20
- '/'
21
- : parsed.root;
22
- path = path.slice(root.length);
23
- r += root;
24
- parsed = parse(path);
25
- }
26
- return [r, path];
27
- };
28
- exports.stripAbsolutePath = stripAbsolutePath;
29
- //# sourceMappingURL=strip-absolute-path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strip-absolute-path.js","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC1E,yCAAiC;AACjC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,iBAAK,CAAA;AAEnC,2BAA2B;AAC3B,4EAA4E;AAC5E,yEAAyE;AACzE,0CAA0C;AAC1C,4EAA4E;AAC5E,uEAAuE;AAChE,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAoB,EAAE;IAClE,IAAI,CAAC,GAAG,EAAE,CAAA;IAEV,IAAI,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QACvC,yDAAyD;QACzD,2CAA2C;QAC3C,MAAM,IAAI,GACR,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;YACrD,GAAG;YACL,CAAC,CAAC,MAAM,CAAC,IAAI,CAAA;QACf,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,CAAC,IAAI,IAAI,CAAA;QACT,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IACD,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAClB,CAAC,CAAA;AAhBY,QAAA,iBAAiB,qBAgB7B","sourcesContent":["// unix absolute paths are also absolute on win32, so we use this for both\nimport { win32 } from 'node:path'\nconst { isAbsolute, parse } = win32\n\n// returns [root, stripped]\n// Note that windows will think that //x/y/z/a has a \"root\" of //x/y, and in\n// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip /\n// explicitly if it's the first character.\n// drive-specific relative paths on Windows get their root stripped off even\n// though they are not absolute, so `c:../foo` becomes ['c:', '../foo']\nexport const stripAbsolutePath = (path: string): [string, string] => {\n let r = ''\n\n let parsed = parse(path)\n while (isAbsolute(path) || parsed.root) {\n // windows will think that //x/y/z has a \"root\" of //x/y/\n // but strip the //?/C:/ off of //?/C:/path\n const root =\n path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ?\n '/'\n : parsed.root\n path = path.slice(root.length)\n r += root\n parsed = parse(path)\n }\n return [r, path]\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare const stripTrailingSlashes: (str: string) => string;
2
- //# sourceMappingURL=strip-trailing-slashes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strip-trailing-slashes.d.ts","sourceRoot":"","sources":["../../src/strip-trailing-slashes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,WAQ/C,CAAA"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripTrailingSlashes = void 0;
4
- // warning: extremely hot code path.
5
- // This has been meticulously optimized for use
6
- // within npm install on large package trees.
7
- // Do not edit without careful benchmarking.
8
- const stripTrailingSlashes = (str) => {
9
- let i = str.length - 1;
10
- let slashesStart = -1;
11
- while (i > -1 && str.charAt(i) === '/') {
12
- slashesStart = i;
13
- i--;
14
- }
15
- return slashesStart === -1 ? str : str.slice(0, slashesStart);
16
- };
17
- exports.stripTrailingSlashes = stripTrailingSlashes;
18
- //# sourceMappingURL=strip-trailing-slashes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strip-trailing-slashes.js","sourceRoot":"","sources":["../../src/strip-trailing-slashes.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,+CAA+C;AAC/C,6CAA6C;AAC7C,4CAA4C;AACrC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAClD,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAA;IACtB,IAAI,YAAY,GAAG,CAAC,CAAC,CAAA;IACrB,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACvC,YAAY,GAAG,CAAC,CAAA;QAChB,CAAC,EAAE,CAAA;IACL,CAAC;IACD,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;AAC/D,CAAC,CAAA;AARY,QAAA,oBAAoB,wBAQhC","sourcesContent":["// warning: extremely hot code path.\n// This has been meticulously optimized for use\n// within npm install on large package trees.\n// Do not edit without careful benchmarking.\nexport const stripTrailingSlashes = (str: string) => {\n let i = str.length - 1\n let slashesStart = -1\n while (i > -1 && str.charAt(i) === '/') {\n slashesStart = i\n i--\n }\n return slashesStart === -1 ? str : str.slice(0, slashesStart)\n}\n"]}
@@ -1,9 +0,0 @@
1
- export declare class SymlinkError extends Error {
2
- path: string;
3
- symlink: string;
4
- syscall: "symlink";
5
- code: "TAR_SYMLINK_ERROR";
6
- constructor(symlink: string, path: string);
7
- get name(): string;
8
- }
9
- //# sourceMappingURL=symlink-error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"symlink-error.d.ts","sourceRoot":"","sources":["../../src/symlink-error.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAG,SAAS,CAAS;IAC5B,IAAI,EAAG,mBAAmB,CAAS;gBACvB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAKzC,IAAI,IAAI,WAEP;CACF"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SymlinkError = void 0;
4
- class SymlinkError extends Error {
5
- path;
6
- symlink;
7
- syscall = 'symlink';
8
- code = 'TAR_SYMLINK_ERROR';
9
- constructor(symlink, path) {
10
- super('TAR_SYMLINK_ERROR: Cannot extract through symbolic link');
11
- this.symlink = symlink;
12
- this.path = path;
13
- }
14
- get name() {
15
- return 'SymlinkError';
16
- }
17
- }
18
- exports.SymlinkError = SymlinkError;
19
- //# sourceMappingURL=symlink-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"symlink-error.js","sourceRoot":"","sources":["../../src/symlink-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,CAAQ;IACZ,OAAO,CAAQ;IACf,OAAO,GAAG,SAAkB,CAAA;IAC5B,IAAI,GAAG,mBAA4B,CAAA;IACnC,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,yDAAyD,CAAC,CAAA;QAChE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IACD,IAAI,IAAI;QACN,OAAO,cAAc,CAAA;IACvB,CAAC;CACF;AAbD,oCAaC","sourcesContent":["export class SymlinkError extends Error {\n path: string\n symlink: string\n syscall = 'symlink' as const\n code = 'TAR_SYMLINK_ERROR' as const\n constructor(symlink: string, path: string) {\n super('TAR_SYMLINK_ERROR: Cannot extract through symbolic link')\n this.symlink = symlink\n this.path = path\n }\n get name() {\n return 'SymlinkError'\n }\n}\n"]}
@@ -1,7 +0,0 @@
1
- export declare const isCode: (c: string) => c is EntryTypeCode;
2
- export declare const isName: (c: string) => c is EntryTypeName;
3
- export type EntryTypeCode = '0' | '' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | 'g' | 'x' | 'A' | 'D' | 'I' | 'K' | 'L' | 'M' | 'N' | 'S' | 'V' | 'X';
4
- export type EntryTypeName = 'File' | 'OldFile' | 'Link' | 'SymbolicLink' | 'CharacterDevice' | 'BlockDevice' | 'Directory' | 'FIFO' | 'ContiguousFile' | 'GlobalExtendedHeader' | 'ExtendedHeader' | 'SolarisACL' | 'GNUDumpDir' | 'Inode' | 'NextFileHasLongLinkpath' | 'NextFileHasLongPath' | 'ContinuationFile' | 'OldGnuLongPath' | 'SparseFile' | 'TapeVolumeHeader' | 'OldExtendedHeader' | 'Unsupported';
5
- export declare const name: Map<EntryTypeCode, EntryTypeName>;
6
- export declare const code: Map<EntryTypeName, EntryTypeCode>;
7
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,aACV,CAAA;AAE9B,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,aACV,CAAA;AAE9B,MAAM,MAAM,aAAa,GACrB,GAAG,GACH,EAAE,GACF,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;AAEP,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,SAAS,GACT,MAAM,GACN,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,WAAW,GACX,MAAM,GACN,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,GAClB,gBAAgB,GAChB,YAAY,GACZ,kBAAkB,GAClB,mBAAmB,GACnB,aAAa,CAAA;AAGjB,eAAO,MAAM,IAAI,mCAsCf,CAAA;AAGF,eAAO,MAAM,IAAI,mCAEhB,CAAA"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.code = exports.name = exports.isName = exports.isCode = void 0;
4
- const isCode = (c) => exports.name.has(c);
5
- exports.isCode = isCode;
6
- const isName = (c) => exports.code.has(c);
7
- exports.isName = isName;
8
- // map types from key to human-friendly name
9
- exports.name = new Map([
10
- ['0', 'File'],
11
- // same as File
12
- ['', 'OldFile'],
13
- ['1', 'Link'],
14
- ['2', 'SymbolicLink'],
15
- // Devices and FIFOs aren't fully supported
16
- // they are parsed, but skipped when unpacking
17
- ['3', 'CharacterDevice'],
18
- ['4', 'BlockDevice'],
19
- ['5', 'Directory'],
20
- ['6', 'FIFO'],
21
- // same as File
22
- ['7', 'ContiguousFile'],
23
- // pax headers
24
- ['g', 'GlobalExtendedHeader'],
25
- ['x', 'ExtendedHeader'],
26
- // vendor-specific stuff
27
- // skip
28
- ['A', 'SolarisACL'],
29
- // like 5, but with data, which should be skipped
30
- ['D', 'GNUDumpDir'],
31
- // metadata only, skip
32
- ['I', 'Inode'],
33
- // data = link path of next file
34
- ['K', 'NextFileHasLongLinkpath'],
35
- // data = path of next file
36
- ['L', 'NextFileHasLongPath'],
37
- // skip
38
- ['M', 'ContinuationFile'],
39
- // like L
40
- ['N', 'OldGnuLongPath'],
41
- // skip
42
- ['S', 'SparseFile'],
43
- // skip
44
- ['V', 'TapeVolumeHeader'],
45
- // like x
46
- ['X', 'OldExtendedHeader'],
47
- ]);
48
- // map the other direction
49
- exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]));
50
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAO,MAAM,MAAM,GAAG,CAAC,CAAS,EAAsB,EAAE,CACtD,YAAI,CAAC,GAAG,CAAC,CAAkB,CAAC,CAAA;AADjB,QAAA,MAAM,UACW;AAEvB,MAAM,MAAM,GAAG,CAAC,CAAS,EAAsB,EAAE,CACtD,YAAI,CAAC,GAAG,C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AE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAA","sourcesContent":["export const isCode = (c: string): c is EntryTypeCode =>\n name.has(c as EntryTypeCode)\n\nexport const isName = (c: string): c is EntryTypeName =>\n code.has(c as EntryTypeName)\n\nexport type EntryTypeCode =\n | '0'\n | ''\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | 'g'\n | 'x'\n | 'A'\n | 'D'\n | 'I'\n | 'K'\n | 'L'\n | 'M'\n | 'N'\n | 'S'\n | 'V'\n | 'X'\n\nexport type EntryTypeName =\n | 'File'\n | 'OldFile'\n | 'Link'\n | 'SymbolicLink'\n | 'CharacterDevice'\n | 'BlockDevice'\n | 'Directory'\n | 'FIFO'\n | 'ContiguousFile'\n | 'GlobalExtendedHeader'\n | 'ExtendedHeader'\n | 'SolarisACL'\n | 'GNUDumpDir'\n | 'Inode'\n | 'NextFileHasLongLinkpath'\n | 'NextFileHasLongPath'\n | 'ContinuationFile'\n | 'OldGnuLongPath'\n | 'SparseFile'\n | 'TapeVolumeHeader'\n | 'OldExtendedHeader'\n | 'Unsupported'\n\n// map types from key to human-friendly name\nexport const name = new Map<EntryTypeCode, EntryTypeName>([\n ['0', 'File'],\n // same as File\n ['', 'OldFile'],\n ['1', 'Link'],\n ['2', 'SymbolicLink'],\n // Devices and FIFOs aren't fully supported\n // they are parsed, but skipped when unpacking\n ['3', 'CharacterDevice'],\n ['4', 'BlockDevice'],\n ['5', 'Directory'],\n ['6', 'FIFO'],\n // same as File\n ['7', 'ContiguousFile'],\n // pax headers\n ['g', 'GlobalExtendedHeader'],\n ['x', 'ExtendedHeader'],\n // vendor-specific stuff\n // skip\n ['A', 'SolarisACL'],\n // like 5, but with data, which should be skipped\n ['D', 'GNUDumpDir'],\n // metadata only, skip\n ['I', 'Inode'],\n // data = link path of next file\n ['K', 'NextFileHasLongLinkpath'],\n // data = path of next file\n ['L', 'NextFileHasLongPath'],\n // skip\n ['M', 'ContinuationFile'],\n // like L\n ['N', 'OldGnuLongPath'],\n // skip\n ['S', 'SparseFile'],\n // skip\n ['V', 'TapeVolumeHeader'],\n // like x\n ['X', 'OldExtendedHeader'],\n])\n\n// map the other direction\nexport const code = new Map<EntryTypeName, EntryTypeCode>(\n Array.from(name).map(kv => [kv[1], kv[0]]),\n)\n"]}