tar 6.2.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +40 -16
  2. package/dist/commonjs/create.d.ts +8 -0
  3. package/dist/commonjs/create.d.ts.map +1 -0
  4. package/dist/commonjs/create.js +106 -0
  5. package/dist/commonjs/create.js.map +1 -0
  6. package/dist/commonjs/cwd-error.d.ts +8 -0
  7. package/dist/commonjs/cwd-error.d.ts.map +1 -0
  8. package/dist/commonjs/cwd-error.js +18 -0
  9. package/dist/commonjs/cwd-error.js.map +1 -0
  10. package/dist/commonjs/extract.d.ts +8 -0
  11. package/dist/commonjs/extract.d.ts.map +1 -0
  12. package/dist/commonjs/extract.js +141 -0
  13. package/dist/commonjs/extract.js.map +1 -0
  14. package/dist/commonjs/get-write-flag.d.ts +2 -0
  15. package/dist/commonjs/get-write-flag.d.ts.map +1 -0
  16. package/dist/commonjs/get-write-flag.js +29 -0
  17. package/dist/commonjs/get-write-flag.js.map +1 -0
  18. package/dist/commonjs/header.d.ts +54 -0
  19. package/dist/commonjs/header.d.ts.map +1 -0
  20. package/dist/commonjs/header.js +308 -0
  21. package/dist/commonjs/header.js.map +1 -0
  22. package/dist/commonjs/index.d.ts +19 -0
  23. package/dist/commonjs/index.d.ts.map +1 -0
  24. package/dist/commonjs/index.js +54 -0
  25. package/dist/commonjs/index.js.map +1 -0
  26. package/dist/commonjs/large-numbers.d.ts +4 -0
  27. package/dist/commonjs/large-numbers.d.ts.map +1 -0
  28. package/dist/commonjs/large-numbers.js +99 -0
  29. package/dist/commonjs/large-numbers.js.map +1 -0
  30. package/dist/commonjs/list.d.ts +8 -0
  31. package/dist/commonjs/list.d.ts.map +1 -0
  32. package/dist/commonjs/list.js +167 -0
  33. package/dist/commonjs/list.js.map +1 -0
  34. package/dist/commonjs/mkdir.d.ts +27 -0
  35. package/dist/commonjs/mkdir.d.ts.map +1 -0
  36. package/dist/commonjs/mkdir.js +209 -0
  37. package/dist/commonjs/mkdir.js.map +1 -0
  38. package/dist/commonjs/mode-fix.d.ts +2 -0
  39. package/dist/commonjs/mode-fix.d.ts.map +1 -0
  40. package/dist/commonjs/mode-fix.js +29 -0
  41. package/dist/commonjs/mode-fix.js.map +1 -0
  42. package/dist/commonjs/normalize-unicode.d.ts +2 -0
  43. package/dist/commonjs/normalize-unicode.d.ts.map +1 -0
  44. package/dist/commonjs/normalize-unicode.js +17 -0
  45. package/dist/commonjs/normalize-unicode.js.map +1 -0
  46. package/dist/commonjs/normalize-windows-path.d.ts +2 -0
  47. package/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
  48. package/dist/commonjs/normalize-windows-path.js +12 -0
  49. package/dist/commonjs/normalize-windows-path.js.map +1 -0
  50. package/dist/commonjs/options.d.ts +545 -0
  51. package/dist/commonjs/options.d.ts.map +1 -0
  52. package/dist/commonjs/options.js +55 -0
  53. package/dist/commonjs/options.js.map +1 -0
  54. package/dist/commonjs/pack.d.ts +98 -0
  55. package/dist/commonjs/pack.d.ts.map +1 -0
  56. package/dist/commonjs/pack.js +461 -0
  57. package/dist/commonjs/pack.js.map +1 -0
  58. package/dist/commonjs/package.json +3 -0
  59. package/dist/commonjs/parse.d.ts +84 -0
  60. package/dist/commonjs/parse.d.ts.map +1 -0
  61. package/dist/commonjs/parse.js +571 -0
  62. package/dist/commonjs/parse.js.map +1 -0
  63. package/dist/commonjs/path-reservations.d.ts +11 -0
  64. package/dist/commonjs/path-reservations.d.ts.map +1 -0
  65. package/dist/commonjs/path-reservations.js +169 -0
  66. package/dist/commonjs/path-reservations.js.map +1 -0
  67. package/dist/commonjs/pax.d.ts +27 -0
  68. package/dist/commonjs/pax.d.ts.map +1 -0
  69. package/dist/commonjs/pax.js +158 -0
  70. package/dist/commonjs/pax.js.map +1 -0
  71. package/dist/commonjs/read-entry.d.ts +37 -0
  72. package/dist/commonjs/read-entry.d.ts.map +1 -0
  73. package/dist/commonjs/read-entry.js +139 -0
  74. package/dist/commonjs/read-entry.js.map +1 -0
  75. package/dist/commonjs/replace.d.ts +5 -0
  76. package/dist/commonjs/replace.d.ts.map +1 -0
  77. package/dist/commonjs/replace.js +223 -0
  78. package/dist/commonjs/replace.js.map +1 -0
  79. package/dist/commonjs/strip-absolute-path.d.ts +2 -0
  80. package/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
  81. package/dist/commonjs/strip-absolute-path.js +29 -0
  82. package/dist/commonjs/strip-absolute-path.js.map +1 -0
  83. package/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
  84. package/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
  85. package/dist/commonjs/strip-trailing-slashes.js +18 -0
  86. package/dist/commonjs/strip-trailing-slashes.js.map +1 -0
  87. package/dist/commonjs/symlink-error.d.ts +9 -0
  88. package/dist/commonjs/symlink-error.d.ts.map +1 -0
  89. package/dist/commonjs/symlink-error.js +19 -0
  90. package/dist/commonjs/symlink-error.js.map +1 -0
  91. package/dist/commonjs/types.d.ts +7 -0
  92. package/dist/commonjs/types.d.ts.map +1 -0
  93. package/dist/commonjs/types.js +50 -0
  94. package/dist/commonjs/types.js.map +1 -0
  95. package/dist/commonjs/unpack.d.ts +98 -0
  96. package/dist/commonjs/unpack.d.ts.map +1 -0
  97. package/dist/commonjs/unpack.js +921 -0
  98. package/dist/commonjs/unpack.js.map +1 -0
  99. package/dist/commonjs/update.d.ts +3 -0
  100. package/dist/commonjs/update.d.ts.map +1 -0
  101. package/dist/commonjs/update.js +47 -0
  102. package/dist/commonjs/update.js.map +1 -0
  103. package/dist/commonjs/warn-method.d.ts +20 -0
  104. package/dist/commonjs/warn-method.d.ts.map +1 -0
  105. package/dist/commonjs/warn-method.js +31 -0
  106. package/dist/commonjs/warn-method.js.map +1 -0
  107. package/dist/commonjs/winchars.d.ts +3 -0
  108. package/dist/commonjs/winchars.d.ts.map +1 -0
  109. package/dist/commonjs/winchars.js +14 -0
  110. package/dist/commonjs/winchars.js.map +1 -0
  111. package/dist/commonjs/write-entry.d.ts +125 -0
  112. package/dist/commonjs/write-entry.d.ts.map +1 -0
  113. package/dist/commonjs/write-entry.js +657 -0
  114. package/dist/commonjs/write-entry.js.map +1 -0
  115. package/dist/esm/create.d.ts +8 -0
  116. package/dist/esm/create.d.ts.map +1 -0
  117. package/dist/esm/create.js +99 -0
  118. package/dist/esm/create.js.map +1 -0
  119. package/dist/esm/cwd-error.d.ts +8 -0
  120. package/dist/esm/cwd-error.d.ts.map +1 -0
  121. package/dist/esm/cwd-error.js +14 -0
  122. package/dist/esm/cwd-error.js.map +1 -0
  123. package/dist/esm/extract.d.ts +8 -0
  124. package/dist/esm/extract.d.ts.map +1 -0
  125. package/dist/esm/extract.js +111 -0
  126. package/dist/esm/extract.js.map +1 -0
  127. package/dist/esm/get-write-flag.d.ts +2 -0
  128. package/dist/esm/get-write-flag.d.ts.map +1 -0
  129. package/dist/esm/get-write-flag.js +23 -0
  130. package/dist/esm/get-write-flag.js.map +1 -0
  131. package/dist/esm/header.d.ts +54 -0
  132. package/dist/esm/header.d.ts.map +1 -0
  133. package/dist/esm/header.js +281 -0
  134. package/dist/esm/header.js.map +1 -0
  135. package/dist/esm/index.d.ts +19 -0
  136. package/dist/esm/index.d.ts.map +1 -0
  137. package/dist/esm/index.js +20 -0
  138. package/dist/esm/index.js.map +1 -0
  139. package/dist/esm/large-numbers.d.ts +4 -0
  140. package/dist/esm/large-numbers.d.ts.map +1 -0
  141. package/dist/esm/large-numbers.js +94 -0
  142. package/dist/esm/large-numbers.js.map +1 -0
  143. package/dist/esm/list.d.ts +8 -0
  144. package/dist/esm/list.d.ts.map +1 -0
  145. package/dist/esm/list.js +137 -0
  146. package/dist/esm/list.js.map +1 -0
  147. package/dist/esm/mkdir.d.ts +27 -0
  148. package/dist/esm/mkdir.d.ts.map +1 -0
  149. package/dist/esm/mkdir.js +201 -0
  150. package/dist/esm/mkdir.js.map +1 -0
  151. package/dist/esm/mode-fix.d.ts +2 -0
  152. package/dist/esm/mode-fix.d.ts.map +1 -0
  153. package/dist/esm/mode-fix.js +25 -0
  154. package/dist/esm/mode-fix.js.map +1 -0
  155. package/dist/esm/normalize-unicode.d.ts +2 -0
  156. package/dist/esm/normalize-unicode.d.ts.map +1 -0
  157. package/dist/esm/normalize-unicode.js +13 -0
  158. package/dist/esm/normalize-unicode.js.map +1 -0
  159. package/dist/esm/normalize-windows-path.d.ts +2 -0
  160. package/dist/esm/normalize-windows-path.d.ts.map +1 -0
  161. package/{lib → dist/esm}/normalize-windows-path.js +5 -4
  162. package/dist/esm/normalize-windows-path.js.map +1 -0
  163. package/dist/esm/options.d.ts +545 -0
  164. package/dist/esm/options.d.ts.map +1 -0
  165. package/dist/esm/options.js +48 -0
  166. package/dist/esm/options.js.map +1 -0
  167. package/dist/esm/pack.d.ts +98 -0
  168. package/dist/esm/pack.d.ts.map +1 -0
  169. package/dist/esm/pack.js +429 -0
  170. package/dist/esm/pack.js.map +1 -0
  171. package/dist/esm/package.json +3 -0
  172. package/dist/esm/parse.d.ts +84 -0
  173. package/dist/esm/parse.d.ts.map +1 -0
  174. package/dist/esm/parse.js +567 -0
  175. package/dist/esm/parse.js.map +1 -0
  176. package/dist/esm/path-reservations.d.ts +11 -0
  177. package/dist/esm/path-reservations.d.ts.map +1 -0
  178. package/dist/esm/path-reservations.js +165 -0
  179. package/dist/esm/path-reservations.js.map +1 -0
  180. package/dist/esm/pax.d.ts +27 -0
  181. package/dist/esm/pax.d.ts.map +1 -0
  182. package/dist/esm/pax.js +154 -0
  183. package/dist/esm/pax.js.map +1 -0
  184. package/dist/esm/read-entry.d.ts +37 -0
  185. package/dist/esm/read-entry.d.ts.map +1 -0
  186. package/dist/esm/read-entry.js +135 -0
  187. package/dist/esm/read-entry.js.map +1 -0
  188. package/dist/esm/replace.d.ts +5 -0
  189. package/dist/esm/replace.d.ts.map +1 -0
  190. package/dist/esm/replace.js +216 -0
  191. package/dist/esm/replace.js.map +1 -0
  192. package/dist/esm/strip-absolute-path.d.ts +2 -0
  193. package/dist/esm/strip-absolute-path.d.ts.map +1 -0
  194. package/dist/esm/strip-absolute-path.js +25 -0
  195. package/dist/esm/strip-absolute-path.js.map +1 -0
  196. package/dist/esm/strip-trailing-slashes.d.ts +2 -0
  197. package/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
  198. package/dist/esm/strip-trailing-slashes.js +14 -0
  199. package/dist/esm/strip-trailing-slashes.js.map +1 -0
  200. package/dist/esm/symlink-error.d.ts +9 -0
  201. package/dist/esm/symlink-error.d.ts.map +1 -0
  202. package/dist/esm/symlink-error.js +15 -0
  203. package/dist/esm/symlink-error.js.map +1 -0
  204. package/dist/esm/types.d.ts +7 -0
  205. package/dist/esm/types.d.ts.map +1 -0
  206. package/dist/esm/types.js +45 -0
  207. package/dist/esm/types.js.map +1 -0
  208. package/dist/esm/unpack.d.ts +98 -0
  209. package/dist/esm/unpack.d.ts.map +1 -0
  210. package/dist/esm/unpack.js +890 -0
  211. package/dist/esm/unpack.js.map +1 -0
  212. package/dist/esm/update.d.ts +3 -0
  213. package/dist/esm/update.d.ts.map +1 -0
  214. package/dist/esm/update.js +43 -0
  215. package/dist/esm/update.js.map +1 -0
  216. package/dist/esm/warn-method.d.ts +20 -0
  217. package/dist/esm/warn-method.d.ts.map +1 -0
  218. package/dist/esm/warn-method.js +27 -0
  219. package/dist/esm/warn-method.js.map +1 -0
  220. package/dist/esm/winchars.d.ts +3 -0
  221. package/dist/esm/winchars.d.ts.map +1 -0
  222. package/dist/esm/winchars.js +9 -0
  223. package/dist/esm/winchars.js.map +1 -0
  224. package/dist/esm/write-entry.d.ts +125 -0
  225. package/dist/esm/write-entry.d.ts.map +1 -0
  226. package/dist/esm/write-entry.js +625 -0
  227. package/dist/esm/write-entry.js.map +1 -0
  228. package/package.json +255 -40
  229. package/index.js +0 -18
  230. package/lib/create.js +0 -111
  231. package/lib/extract.js +0 -113
  232. package/lib/get-write-flag.js +0 -20
  233. package/lib/header.js +0 -304
  234. package/lib/high-level-opt.js +0 -29
  235. package/lib/large-numbers.js +0 -104
  236. package/lib/list.js +0 -139
  237. package/lib/mkdir.js +0 -229
  238. package/lib/mode-fix.js +0 -27
  239. package/lib/normalize-unicode.js +0 -12
  240. package/lib/pack.js +0 -432
  241. package/lib/parse.js +0 -552
  242. package/lib/path-reservations.js +0 -156
  243. package/lib/pax.js +0 -150
  244. package/lib/read-entry.js +0 -107
  245. package/lib/replace.js +0 -246
  246. package/lib/strip-absolute-path.js +0 -24
  247. package/lib/strip-trailing-slashes.js +0 -13
  248. package/lib/types.js +0 -44
  249. package/lib/unpack.js +0 -906
  250. package/lib/update.js +0 -40
  251. package/lib/warn-mixin.js +0 -24
  252. package/lib/winchars.js +0 -23
  253. package/lib/write-entry.js +0 -546
package/README.md CHANGED
@@ -115,6 +115,8 @@ Handlers receive 3 arguments:
115
115
  encountered an error which prevented it from being unpacked. This occurs
116
116
  when:
117
117
  - an unrecoverable fs error happens during unpacking,
118
+ - an entry is trying to extract into an excessively deep
119
+ location (by default, limited to 1024 subfolders),
118
120
  - an entry has `..` in the path and `preservePaths` is not set, or
119
121
  - an entry is extracting through a symbolic link, when `preservePaths` is
120
122
  not set.
@@ -154,12 +156,13 @@ to see how tar is handling the issue.
154
156
  The API mimics the `tar(1)` command line functionality, with aliases
155
157
  for more human-readable option and function names. The goal is that
156
158
  if you know how to use `tar(1)` in Unix, then you know how to use
157
- `require('tar')` in JavaScript.
159
+ `import('tar')` in JavaScript.
158
160
 
159
161
  To replicate `tar czf my-tarball.tgz files and folders`, you'd do:
160
162
 
161
163
  ```js
162
- tar.c(
164
+ import { create } from 'tar'
165
+ create(
163
166
  {
164
167
  gzip: <true|gzip options>,
165
168
  file: 'my-tarball.tgz'
@@ -171,9 +174,12 @@ tar.c(
171
174
  To replicate `tar cz files and folders > my-tarball.tgz`, you'd do:
172
175
 
173
176
  ```js
174
- tar.c( // or tar.create
177
+ // if you're familiar with the tar(1) cli flags, this can be nice
178
+ import * as tar from 'tar'
179
+ tar.c(
175
180
  {
176
- gzip: <true|gzip options>
181
+ // 'z' is alias for 'gzip' option
182
+ z: <true|gzip options>
177
183
  },
178
184
  ['some', 'files', 'and', 'folders']
179
185
  ).pipe(fs.createWriteStream('my-tarball.tgz'))
@@ -182,9 +188,10 @@ tar.c( // or tar.create
182
188
  To replicate `tar xf my-tarball.tgz` you'd do:
183
189
 
184
190
  ```js
185
- tar.x( // or tar.extract(
191
+ tar.x( // or `tar.extract`
186
192
  {
187
- file: 'my-tarball.tgz'
193
+ // or `file:`
194
+ f: 'my-tarball.tgz'
188
195
  }
189
196
  ).then(_=> { .. tarball has been dumped in cwd .. })
190
197
  ```
@@ -422,11 +429,19 @@ The following options are supported:
422
429
  that passes the filter.
423
430
  - `onwarn` A function that will get called with `(code, message, data)` for
424
431
  any warnings encountered. (See "Warnings and Errors")
425
- - `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the
426
- extracted file matches the entry mode. This also suppresses the call to
427
- `process.umask()` to determine the default umask value, since tar will
428
- extract with whatever mode is provided, and let the process `umask` apply
429
- normally.
432
+ - `chmod` Set to true to call `fs.chmod()` to ensure that the
433
+ extracted file matches the entry mode. This may necessitate a
434
+ call to the deprecated and thread-unsafe `process.umask()`
435
+ method to determine the default umask value, unless a
436
+ `processUmask` options is also provided. Otherwise tar will
437
+ extract with whatever mode is provided, and let the process
438
+ `umask` apply normally.
439
+ - `processUmask` Set to an explicit numeric value to avoid
440
+ calling `process.umask()` when `chmod: true` is set.
441
+ - `maxDepth` The maximum depth of subfolders to extract into. This
442
+ defaults to 1024. Anything deeper than the limit will raise a
443
+ warning and skip the entry. Set to `Infinity` to remove the
444
+ limitation.
430
445
 
431
446
  The following options are mostly internal, but can be modified in some
432
447
  advanced use cases, such as re-using caches between runs.
@@ -624,6 +639,7 @@ The following options are supported:
624
639
  default" for most unix systems, based on a `umask` value of `0o22`.
625
640
  - `preservePaths` Allow absolute paths. By default, `/` is stripped
626
641
  from absolute paths.
642
+
627
643
  - `linkCache` A Map object containing the device and inode value for
628
644
  any file whose nlink is > 1, to identify hard links.
629
645
  - `statCache` A Map object that caches calls `lstat`.
@@ -744,11 +760,19 @@ Most unpack errors will cause a `warn` event to be emitted. If the
744
760
  that passes the filter.
745
761
  - `onwarn` A function that will get called with `(code, message, data)` for
746
762
  any warnings encountered. (See "Warnings and Errors")
747
- - `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the
748
- extracted file matches the entry mode. This also suppresses the call to
749
- `process.umask()` to determine the default umask value, since tar will
750
- extract with whatever mode is provided, and let the process `umask` apply
751
- normally.
763
+ - `chmod` Set to true to call `fs.chmod()` to ensure that the
764
+ extracted file matches the entry mode. This may necessitate a
765
+ call to the deprecated and thread-unsafe `process.umask()`
766
+ method to determine the default umask value, unless a
767
+ `processUmask` options is also provided. Otherwise tar will
768
+ extract with whatever mode is provided, and let the process
769
+ `umask` apply normally.
770
+ - `processUmask` Set to an explicit numeric value to avoid
771
+ calling `process.umask()` when `chmod: true` is set.
772
+ - `maxDepth` The maximum depth of subfolders to extract into. This
773
+ defaults to 1024. Anything deeper than the limit will raise a
774
+ warning and skip the entry. Set to `Infinity` to remove the
775
+ limitation.
752
776
 
753
777
  ### class tar.Unpack.Sync
754
778
 
@@ -0,0 +1,8 @@
1
+ import { TarOptionsWithAliases, TarOptionsWithAliasesFile, TarOptionsWithAliasesSync, TarOptionsWithAliasesSyncFile } from './options.js';
2
+ import { Pack } from './pack.js';
3
+ export declare function create(opt: TarOptionsWithAliasesSyncFile, files?: string[]): void;
4
+ export declare function create(opt: TarOptionsWithAliasesSync, files?: string[]): void;
5
+ export declare function create(opt: TarOptionsWithAliasesFile, files?: string[], cb?: () => any): Promise<void>;
6
+ export declare function create(opt: TarOptionsWithAliasesFile, cb: () => any): Promise<void>;
7
+ export declare function create(opt: TarOptionsWithAliases, files?: string[]): Pack;
8
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,IAAI,EAAY,MAAM,WAAW,CAAA;AAE1C,wBAAgB,MAAM,CACpB,GAAG,EAAE,6BAA6B,EAClC,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,IAAI,CAAA;AACP,wBAAgB,MAAM,CACpB,GAAG,EAAE,yBAAyB,EAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,IAAI,CAAA;AACP,wBAAgB,MAAM,CACpB,GAAG,EAAE,yBAAyB,EAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,EAAE,CAAC,EAAE,MAAM,GAAG,GACb,OAAO,CAAC,IAAI,CAAC,CAAA;AAChB,wBAAgB,MAAM,CACpB,GAAG,EAAE,yBAAyB,EAC9B,EAAE,EAAE,MAAM,GAAG,GACZ,OAAO,CAAC,IAAI,CAAC,CAAA;AAChB,wBAAgB,MAAM,CACpB,GAAG,EAAE,qBAAqB,EAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,IAAI,CAAA"}
@@ -0,0 +1,106 @@
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.create = void 0;
7
+ const options_js_1 = require("./options.js");
8
+ const fs_minipass_1 = require("@isaacs/fs-minipass");
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const list_js_1 = require("./list.js");
11
+ const pack_js_1 = require("./pack.js");
12
+ function create(opt_, files, cb) {
13
+ if (typeof files === 'function') {
14
+ cb = files;
15
+ }
16
+ if (Array.isArray(opt_)) {
17
+ ;
18
+ (files = opt_), (opt_ = {});
19
+ }
20
+ if (!files || !Array.isArray(files) || !files.length) {
21
+ throw new TypeError('no files or directories specified');
22
+ }
23
+ files = Array.from(files);
24
+ const opt = (0, options_js_1.dealias)(opt_);
25
+ if (opt.sync && typeof cb === 'function') {
26
+ throw new TypeError('callback not supported for sync tar functions');
27
+ }
28
+ if (!opt.file && typeof cb === 'function') {
29
+ throw new TypeError('callback only supported with file option');
30
+ }
31
+ return (0, options_js_1.isSyncFile)(opt)
32
+ ? createFileSync(opt, files)
33
+ : (0, options_js_1.isFile)(opt)
34
+ ? createFile(opt, files, cb)
35
+ : (0, options_js_1.isSync)(opt)
36
+ ? createSync(opt, files)
37
+ : create_(opt, files);
38
+ }
39
+ exports.create = create;
40
+ const createFileSync = (opt, files) => {
41
+ const p = new pack_js_1.PackSync(opt);
42
+ const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
43
+ mode: opt.mode || 0o666,
44
+ });
45
+ p.pipe(stream);
46
+ addFilesSync(p, files);
47
+ };
48
+ const createFile = (opt, files, cb) => {
49
+ const p = new pack_js_1.Pack(opt);
50
+ const stream = new fs_minipass_1.WriteStream(opt.file, {
51
+ mode: opt.mode || 0o666,
52
+ });
53
+ p.pipe(stream);
54
+ const promise = new Promise((res, rej) => {
55
+ stream.on('error', rej);
56
+ stream.on('close', res);
57
+ p.on('error', rej);
58
+ });
59
+ addFilesAsync(p, files);
60
+ return cb ? promise.then(cb, cb) : promise;
61
+ };
62
+ const addFilesSync = (p, files) => {
63
+ files.forEach(file => {
64
+ if (file.charAt(0) === '@') {
65
+ (0, list_js_1.list)({
66
+ file: node_path_1.default.resolve(p.cwd, file.slice(1)),
67
+ sync: true,
68
+ noResume: true,
69
+ onentry: entry => p.add(entry),
70
+ });
71
+ }
72
+ else {
73
+ p.add(file);
74
+ }
75
+ });
76
+ p.end();
77
+ };
78
+ const addFilesAsync = async (p, files) => {
79
+ for (let i = 0; i < files.length; i++) {
80
+ const file = String(files[i]);
81
+ if (file.charAt(0) === '@') {
82
+ await (0, list_js_1.list)({
83
+ file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
84
+ noResume: true,
85
+ onentry: entry => {
86
+ p.add(entry);
87
+ },
88
+ });
89
+ }
90
+ else {
91
+ p.add(file);
92
+ }
93
+ }
94
+ p.end();
95
+ };
96
+ const createSync = (opt, files) => {
97
+ const p = new pack_js_1.PackSync(opt);
98
+ addFilesSync(p, files);
99
+ return p;
100
+ };
101
+ const create_ = (opt, files) => {
102
+ const p = new pack_js_1.Pack(opt);
103
+ addFilesAsync(p, files);
104
+ return p;
105
+ };
106
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":";;;;;;AAAA,6CAaqB;AAErB,qDAAkE;AAElE,0DAA4B;AAC5B,uCAAgC;AAChC,uCAA0C;AAuB1C,SAAgB,MAAM,CACpB,IAA2B,EAC3B,KAA8B,EAC9B,EAAc;IAEd,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,EAAE,GAAG,KAAK,CAAA;IACZ,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,CAAC;QAAA,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACrD,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAA;IAC1D,CAAC;IAED,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAEzB,MAAM,GAAG,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAA;IAEzB,IAAI,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;QACzC,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;IACH,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI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AG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,MAAM,IAAA,cAAI,EAAC;gBACT,IAAI,EAAE,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAChD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,KAAK,CAAC,EAAE;oBACf,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBACd,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,CAAC;IACH,CAAC;IACD,CAAC,CAAC,GAAG,EAAE,CAAA;AACT,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAmB,EAAE,KAAe,EAAE,EAAE;IAC1D,MAAM,CAAC,GAAG,IAAI,kBAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACtB,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,GAAe,EAAE,KAAe,EAAE,EAAE;IACnD,MAAM,CAAC,GAAG,IAAI,cAAI,CAAC,GAAG,CAAC,CAAA;IACvB,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACvB,OAAO,CAAC,CAAA;AACV,CAAC,CAAA","sourcesContent":["import {\n dealias,\n isFile,\n isSync,\n isSyncFile,\n TarOptions,\n TarOptionsFile,\n TarOptionsSync,\n TarOptionsSyncFile,\n TarOptionsWithAliases,\n TarOptionsWithAliasesFile,\n TarOptionsWithAliasesSync,\n TarOptionsWithAliasesSyncFile,\n} from './options.js'\n\nimport { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass'\nimport { Minipass } from 'minipass'\nimport path from 'node:path'\nimport { list } from './list.js'\nimport { Pack, PackSync } from './pack.js'\n\nexport function create(\n opt: TarOptionsWithAliasesSyncFile,\n files?: string[],\n): void\nexport function create(\n opt: TarOptionsWithAliasesSync,\n files?: string[],\n): void\nexport function create(\n opt: TarOptionsWithAliasesFile,\n files?: string[],\n cb?: () => any,\n): Promise<void>\nexport function create(\n opt: TarOptionsWithAliasesFile,\n cb: () => any,\n): Promise<void>\nexport function create(\n opt: TarOptionsWithAliases,\n files?: string[],\n): Pack\nexport function create(\n opt_: TarOptionsWithAliases,\n files?: string[] | (() => any),\n cb?: () => any,\n): void | Promise<void> | Pack {\n if (typeof files === 'function') {\n cb = files\n }\n\n if (Array.isArray(opt_)) {\n ;(files = opt_), (opt_ = {})\n }\n\n if (!files || !Array.isArray(files) || !files.length) {\n throw new TypeError('no files or directories specified')\n }\n\n files = Array.from(files)\n\n const opt = dealias(opt_)\n\n if (opt.sync && typeof cb === 'function') {\n throw new TypeError(\n 'callback not supported for sync tar functions',\n )\n }\n\n if (!opt.file && typeof cb === 'function') {\n throw new TypeError('callback only supported with file option')\n }\n\n return isSyncFile(opt)\n ? createFileSync(opt, files)\n : isFile(opt)\n ? createFile(opt, files, cb)\n : isSync(opt)\n ? createSync(opt, files)\n : create_(opt, files)\n}\n\nconst createFileSync = (opt: TarOptionsSyncFile, files: string[]) => {\n const p = new PackSync(opt)\n const stream = new WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n addFilesSync(p, files)\n}\n\nconst createFile = (\n opt: TarOptionsFile,\n files: string[],\n cb?: () => any,\n) => {\n const p = new Pack(opt)\n const stream = new WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n\n const promise = new Promise<void>((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files)\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p: PackSync, 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 onentry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = async (\n p: Pack,\n files: string[],\n): Promise<void> => {\n for (let i = 0; i < files.length; i++) {\n const file = String(files[i])\n if (file.charAt(0) === '@') {\n await list({\n file: path.resolve(String(p.cwd), file.slice(1)),\n noResume: true,\n onentry: entry => {\n p.add(entry)\n },\n })\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n\nconst createSync = (opt: TarOptionsSync, files: string[]) => {\n const p = new PackSync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst create_ = (opt: TarOptions, files: string[]) => {\n const p = new Pack(opt)\n addFilesAsync(p, files)\n return p\n}\n"]}
@@ -0,0 +1,8 @@
1
+ export declare class CwdError extends Error {
2
+ path: string;
3
+ code: string;
4
+ syscall: 'chdir';
5
+ constructor(path: string, code: string);
6
+ get name(): string;
7
+ }
8
+ //# sourceMappingURL=cwd-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwd-error.d.ts","sourceRoot":"","sources":["../../src/cwd-error.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAU;gBAEd,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMtC,IAAI,IAAI,WAEP;CACF"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CwdError = void 0;
4
+ class CwdError extends Error {
5
+ path;
6
+ code;
7
+ syscall = 'chdir';
8
+ constructor(path, code) {
9
+ super(`${code}: Cannot cd into '${path}'`);
10
+ this.path = path;
11
+ this.code = code;
12
+ }
13
+ get name() {
14
+ return 'CwdError';
15
+ }
16
+ }
17
+ exports.CwdError = CwdError;
18
+ //# sourceMappingURL=cwd-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwd-error.js","sourceRoot":"","sources":["../../src/cwd-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,CAAQ;IACZ,IAAI,CAAQ;IACZ,OAAO,GAAY,OAAO,CAAA;IAE1B,YAAY,IAAY,EAAE,IAAY;QACpC,KAAK,CAAC,GAAG,IAAI,qBAAqB,IAAI,GAAG,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAdD,4BAcC","sourcesContent":["export class CwdError extends Error {\n path: string\n code: string\n syscall: 'chdir' = 'chdir'\n\n constructor(path: string, code: string) {\n super(`${code}: Cannot cd into '${path}'`)\n this.path = path\n this.code = code\n }\n\n get name() {\n return 'CwdError'\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { TarOptionsWithAliases, TarOptionsWithAliasesFile, TarOptionsWithAliasesSync, TarOptionsWithAliasesSyncFile } from './options.js';
2
+ import { Unpack } from './unpack.js';
3
+ export declare function extract(opt: TarOptionsWithAliasesSyncFile, files?: string[]): void;
4
+ export declare function extract(opt: TarOptionsWithAliasesSync, files?: string[]): void;
5
+ export declare function extract(opt: TarOptionsWithAliasesFile, files?: string[], cb?: () => any): Promise<void>;
6
+ export declare function extract(opt: TarOptionsWithAliasesFile, cb: () => any): Promise<void>;
7
+ export declare function extract(opt: TarOptionsWithAliases, files?: string[]): Unpack;
8
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAA;AAEhD,wBAAgB,OAAO,CACrB,GAAG,EAAE,6BAA6B,EAClC,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,IAAI,CAAA;AACP,wBAAgB,OAAO,CACrB,GAAG,EAAE,yBAAyB,EAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,IAAI,CAAA;AACP,wBAAgB,OAAO,CACrB,GAAG,EAAE,yBAAyB,EAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,EAAE,CAAC,EAAE,MAAM,GAAG,GACb,OAAO,CAAC,IAAI,CAAC,CAAA;AAChB,wBAAgB,OAAO,CACrB,GAAG,EAAE,yBAAyB,EAC9B,EAAE,EAAE,MAAM,GAAG,GACZ,OAAO,CAAC,IAAI,CAAC,CAAA;AAChB,wBAAgB,OAAO,CACrB,GAAG,EAAE,qBAAqB,EAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,MAAM,CAAA"}
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.extract = void 0;
30
+ // tar -x
31
+ const fsm = __importStar(require("@isaacs/fs-minipass"));
32
+ const node_fs_1 = __importDefault(require("node:fs"));
33
+ const node_path_1 = require("node:path");
34
+ const options_js_1 = require("./options.js");
35
+ const strip_trailing_slashes_js_1 = require("./strip-trailing-slashes.js");
36
+ const unpack_js_1 = require("./unpack.js");
37
+ function extract(opt_, files, cb) {
38
+ if (typeof opt_ === 'function') {
39
+ ;
40
+ (cb = opt_), (files = undefined), (opt_ = {});
41
+ }
42
+ else if (Array.isArray(opt_)) {
43
+ ;
44
+ (files = opt_), (opt_ = {});
45
+ }
46
+ if (typeof files === 'function') {
47
+ ;
48
+ (cb = files), (files = undefined);
49
+ }
50
+ if (!files) {
51
+ files = [];
52
+ }
53
+ else {
54
+ files = Array.from(files);
55
+ }
56
+ const opt = (0, options_js_1.dealias)(opt_);
57
+ if (opt.sync && typeof cb === 'function') {
58
+ throw new TypeError('callback not supported for sync tar functions');
59
+ }
60
+ if (!opt.file && typeof cb === 'function') {
61
+ throw new TypeError('callback only supported with file option');
62
+ }
63
+ if (files.length) {
64
+ filesFilter(opt, files);
65
+ }
66
+ return (0, options_js_1.isSyncFile)(opt)
67
+ ? extractFileSync(opt)
68
+ : (0, options_js_1.isFile)(opt)
69
+ ? extractFile(opt, cb)
70
+ : (0, options_js_1.isSync)(opt)
71
+ ? extractSync(opt)
72
+ : extract_(opt);
73
+ }
74
+ exports.extract = extract;
75
+ // construct a filter that limits the file entries listed
76
+ // include child entries if a dir is included
77
+ const filesFilter = (opt, files) => {
78
+ const map = new Map(files.map(f => [(0, strip_trailing_slashes_js_1.stripTrailingSlashes)(f), true]));
79
+ const filter = opt.filter;
80
+ const mapHas = (file, r = '') => {
81
+ const root = r || (0, node_path_1.parse)(file).root || '.';
82
+ let ret;
83
+ if (file === root)
84
+ ret = false;
85
+ else {
86
+ const m = map.get(file);
87
+ if (m !== undefined) {
88
+ ret = m;
89
+ }
90
+ else {
91
+ ret = mapHas((0, node_path_1.dirname)(file), root);
92
+ }
93
+ }
94
+ map.set(file, ret);
95
+ return ret;
96
+ };
97
+ opt.filter = filter
98
+ ? (file, entry) => filter(file, entry) && mapHas((0, strip_trailing_slashes_js_1.stripTrailingSlashes)(file))
99
+ : file => mapHas((0, strip_trailing_slashes_js_1.stripTrailingSlashes)(file));
100
+ };
101
+ const extractFileSync = (opt) => {
102
+ const u = new unpack_js_1.UnpackSync(opt);
103
+ const file = opt.file;
104
+ const stat = node_fs_1.default.statSync(file);
105
+ // This trades a zero-byte read() syscall for a stat
106
+ // However, it will usually result in less memory allocation
107
+ const readSize = opt.maxReadSize || 16 * 1024 * 1024;
108
+ const stream = new fsm.ReadStreamSync(file, {
109
+ readSize: readSize,
110
+ size: stat.size,
111
+ });
112
+ stream.pipe(u);
113
+ };
114
+ const extractFile = (opt, cb) => {
115
+ const u = new unpack_js_1.Unpack(opt);
116
+ const readSize = opt.maxReadSize || 16 * 1024 * 1024;
117
+ const file = opt.file;
118
+ const p = new Promise((resolve, reject) => {
119
+ u.on('error', reject);
120
+ u.on('close', resolve);
121
+ // This trades a zero-byte read() syscall for a stat
122
+ // However, it will usually result in less memory allocation
123
+ node_fs_1.default.stat(file, (er, stat) => {
124
+ if (er) {
125
+ reject(er);
126
+ }
127
+ else {
128
+ const stream = new fsm.ReadStream(file, {
129
+ readSize: readSize,
130
+ size: stat.size,
131
+ });
132
+ stream.on('error', reject);
133
+ stream.pipe(u);
134
+ }
135
+ });
136
+ });
137
+ return cb ? p.then(cb, cb) : p;
138
+ };
139
+ const extractSync = (opt) => new unpack_js_1.UnpackSync(opt);
140
+ const extract_ = (opt) => new unpack_js_1.Unpack(opt);
141
+ //# sourceMappingURL=extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS;AACT,yDAA0C;AAC1C,sDAAwB;AACxB,yCAA0C;AAC1C,6CAaqB;AACrB,2EAAkE;AAClE,2CAAgD;AAuBhD,SAAgB,OAAO,CACrB,IAA2B,EAC3B,KAA8B,EAC9B,EAAc;IAEd,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,CAAC;QAAA,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IAChD,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,CAAC;QAAA,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,CAAC;QAAA,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,GAAG,SAAS,CAAC,CAAA;IACpC,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,EAAE,CAAA;IACZ,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,GAAG,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAA;IAEzB,IAAI,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;QACzC,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;IACH,CAAC;IAED,IAAI,CAAC,GAAG,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aacs/fs-minipass'\nimport fs from 'node:fs'\nimport { dirname, parse } from 'node:path'\nimport {\n dealias,\n isFile,\n isSync,\n isSyncFile,\n TarOptions,\n TarOptionsFile,\n TarOptionsSync,\n TarOptionsSyncFile,\n TarOptionsWithAliases,\n TarOptionsWithAliasesFile,\n TarOptionsWithAliasesSync,\n TarOptionsWithAliasesSyncFile,\n} from './options.js'\nimport { stripTrailingSlashes } from './strip-trailing-slashes.js'\nimport { Unpack, UnpackSync } from './unpack.js'\n\nexport function extract(\n opt: TarOptionsWithAliasesSyncFile,\n files?: string[],\n): void\nexport function extract(\n opt: TarOptionsWithAliasesSync,\n files?: string[],\n): void\nexport function extract(\n opt: TarOptionsWithAliasesFile,\n files?: string[],\n cb?: () => any,\n): Promise<void>\nexport function extract(\n opt: TarOptionsWithAliasesFile,\n cb: () => any,\n): Promise<void>\nexport function extract(\n opt: TarOptionsWithAliases,\n files?: string[],\n): Unpack\nexport function extract(\n opt_: TarOptionsWithAliases,\n files?: string[] | (() => any),\n cb?: () => any,\n): void | Promise<void> | Unpack {\n if (typeof opt_ === 'function') {\n ;(cb = opt_), (files = undefined), (opt_ = {})\n } else if (Array.isArray(opt_)) {\n ;(files = opt_), (opt_ = {})\n }\n\n if (typeof files === 'function') {\n ;(cb = files), (files = undefined)\n }\n\n if (!files) {\n files = []\n } else {\n files = Array.from(files)\n }\n\n const opt = dealias(opt_)\n\n if (opt.sync && typeof cb === 'function') {\n throw new TypeError(\n 'callback not supported for sync tar functions',\n )\n }\n\n if (!opt.file && typeof cb === 'function') {\n throw new TypeError('callback only supported with file option')\n }\n\n if (files.length) {\n filesFilter(opt, files)\n }\n\n return isSyncFile(opt)\n ? extractFileSync(opt)\n : isFile(opt)\n ? extractFile(opt, cb)\n : isSync(opt)\n ? extractSync(opt)\n : extract_(opt)\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt: TarOptions, files: string[]) => {\n const map = new Map(files.map(f => [stripTrailingSlashes(f), true]))\n const filter = opt.filter\n\n const mapHas = (file: string, r: string = ''): boolean => {\n const root = r || parse(file).root || '.'\n let ret: boolean\n if (file === root) ret = false\n else {\n const m = map.get(file)\n if (m !== undefined) {\n ret = m\n } else {\n ret = mapHas(dirname(file), root)\n }\n }\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) =>\n filter(file, entry) && mapHas(stripTrailingSlashes(file))\n : file => mapHas(stripTrailingSlashes(file))\n}\n\nconst extractFileSync = (opt: TarOptionsSyncFile) => {\n const u = new UnpackSync(opt)\n\n const file = opt.file\n const stat = fs.statSync(file)\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n const stream = new fsm.ReadStreamSync(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.pipe(u)\n}\n\nconst extractFile = (\n opt: TarOptionsFile,\n cb?: () => void,\n) => {\n const u = new Unpack(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise<void>((resolve, reject) => {\n u.on('error', reject)\n u.on('close', resolve)\n\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n fs.stat(file, (er, stat) => {\n if (er) {\n reject(er)\n } else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(u)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst extractSync = (opt: TarOptionsSync) => new UnpackSync(opt)\n\nconst extract_ = (opt: TarOptions) => new Unpack(opt)\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getWriteFlag: (() => string) | ((size: number) => number | "w");
2
+ //# sourceMappingURL=get-write-flag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-write-flag.d.ts","sourceRoot":"","sources":["../../src/get-write-flag.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,YAAY,2BAEd,MAAM,kBAAwC,CAAA"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // Get the appropriate flag to use for creating files
3
+ // We use fmap on Windows platforms for files less than
4
+ // 512kb. This is a fairly low limit, but avoids making
5
+ // things slower in some cases. Since most of what this
6
+ // library is used for is extracting tarballs of many
7
+ // relatively small files in npm packages and the like,
8
+ // it can be a big boost on Windows platforms.
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.getWriteFlag = void 0;
14
+ const fs_1 = __importDefault(require("fs"));
15
+ const platform = process.env.__FAKE_PLATFORM__ || process.platform;
16
+ const isWindows = platform === 'win32';
17
+ /* c8 ignore start */
18
+ const { O_CREAT, O_TRUNC, O_WRONLY } = fs_1.default.constants;
19
+ const UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) ||
20
+ fs_1.default.constants.UV_FS_O_FILEMAP ||
21
+ 0;
22
+ /* c8 ignore stop */
23
+ const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP;
24
+ const fMapLimit = 512 * 1024;
25
+ const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY;
26
+ exports.getWriteFlag = !fMapEnabled
27
+ ? () => 'w'
28
+ : (size) => (size < fMapLimit ? fMapFlag : 'w');
29
+ //# sourceMappingURL=get-write-flag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-write-flag.js","sourceRoot":"","sources":["../../src/get-write-flag.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,uDAAuD;AACvD,wDAAwD;AACxD,wDAAwD;AACxD,qDAAqD;AACrD,uDAAuD;AACvD,8CAA8C;;;;;;AAE9C,4CAAmB;AAEnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;AAClE,MAAM,SAAS,GAAG,QAAQ,KAAK,OAAO,CAAA;AAEtC,qBAAqB;AACrB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,YAAE,CAAC,SAAS,CAAA;AACnD,MAAM,eAAe,GACnB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAC1C,YAAE,CAAC,SAAS,CAAC,eAAe;IAC5B,CAAC,CAAA;AACH,oBAAoB;AAEpB,MAAM,WAAW,GAAG,SAAS,IAAI,CAAC,CAAC,eAAe,CAAA;AAClD,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,CAAA;AAC5B,MAAM,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAClD,QAAA,YAAY,GAAG,CAAC,WAAW;IACtC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG;IACX,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA","sourcesContent":["// Get the appropriate flag to use for creating files\n// We use fmap on Windows platforms for files less than\n// 512kb. This is a fairly low limit, but avoids making\n// things slower in some cases. Since most of what this\n// library is used for is extracting tarballs of many\n// relatively small files in npm packages and the like,\n// it can be a big boost on Windows platforms.\n\nimport fs from 'fs'\n\nconst platform = process.env.__FAKE_PLATFORM__ || process.platform\nconst isWindows = platform === 'win32'\n\n/* c8 ignore start */\nconst { O_CREAT, O_TRUNC, O_WRONLY } = fs.constants\nconst UV_FS_O_FILEMAP =\n Number(process.env.__FAKE_FS_O_FILENAME__) ||\n fs.constants.UV_FS_O_FILEMAP ||\n 0\n/* c8 ignore stop */\n\nconst fMapEnabled = isWindows && !!UV_FS_O_FILEMAP\nconst fMapLimit = 512 * 1024\nconst fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY\nexport const getWriteFlag = !fMapEnabled\n ? () => 'w'\n : (size: number) => (size < fMapLimit ? fMapFlag : 'w')\n"]}
@@ -0,0 +1,54 @@
1
+ /// <reference types="node" />
2
+ import type { EntryTypeCode, EntryTypeName } from './types.js';
3
+ export type HeaderData = {
4
+ path?: string;
5
+ mode?: number;
6
+ uid?: number;
7
+ gid?: number;
8
+ size?: number;
9
+ cksum?: number;
10
+ type?: EntryTypeName | 'Unsupported';
11
+ linkpath?: string;
12
+ uname?: string;
13
+ gname?: string;
14
+ devmaj?: number;
15
+ devmin?: number;
16
+ atime?: Date;
17
+ ctime?: Date;
18
+ mtime?: Date;
19
+ charset?: string;
20
+ comment?: string;
21
+ dev?: number;
22
+ ino?: number;
23
+ nlink?: number;
24
+ };
25
+ export declare class Header implements HeaderData {
26
+ #private;
27
+ cksumValid: boolean;
28
+ needPax: boolean;
29
+ nullBlock: boolean;
30
+ block?: Buffer;
31
+ path?: string;
32
+ mode?: number;
33
+ uid?: number;
34
+ gid?: number;
35
+ size?: number;
36
+ cksum?: number;
37
+ linkpath?: string;
38
+ uname?: string;
39
+ gname?: string;
40
+ devmaj: number;
41
+ devmin: number;
42
+ atime?: Date;
43
+ ctime?: Date;
44
+ mtime?: Date;
45
+ charset?: string;
46
+ comment?: string;
47
+ constructor(data?: Buffer | HeaderData, off?: number, ex?: HeaderData, gex?: HeaderData);
48
+ decode(buf: Buffer, off: number, ex?: HeaderData, gex?: HeaderData): void;
49
+ encode(buf?: Buffer, off?: number): boolean;
50
+ get type(): EntryTypeName;
51
+ get typeKey(): EntryTypeCode | 'Unsupported';
52
+ set type(type: EntryTypeCode | EntryTypeName | 'Unsupported');
53
+ }
54
+ //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/header.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,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