tar 7.5.24 → 8.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.
- package/README.md +1705 -1147
- package/dist/commonjs/bytes.d.ts +21 -0
- package/dist/commonjs/bytes.d.ts.map +1 -0
- package/dist/commonjs/bytes.js +83 -0
- package/dist/commonjs/bytes.js.map +1 -0
- package/dist/commonjs/codec.d.ts +53 -0
- package/dist/commonjs/codec.d.ts.map +1 -0
- package/dist/commonjs/codec.js +35 -0
- package/dist/commonjs/codec.js.map +1 -0
- package/dist/commonjs/concat.d.ts +3 -0
- package/dist/commonjs/concat.d.ts.map +1 -0
- package/dist/commonjs/concat.js +20 -0
- package/dist/commonjs/concat.js.map +1 -0
- package/dist/commonjs/create.d.ts +39 -2
- package/dist/commonjs/create.d.ts.map +1 -1
- package/dist/commonjs/create.js +150 -64
- package/dist/commonjs/create.js.map +1 -1
- package/dist/commonjs/dealias.d.ts +79 -0
- package/dist/commonjs/dealias.d.ts.map +1 -0
- package/dist/commonjs/dealias.js +50 -0
- package/dist/commonjs/dealias.js.map +1 -0
- package/dist/commonjs/delete.d.ts +19 -0
- package/dist/commonjs/delete.d.ts.map +1 -0
- package/dist/commonjs/delete.js +121 -0
- package/dist/commonjs/delete.js.map +1 -0
- package/dist/commonjs/entries.d.ts +82 -0
- package/dist/commonjs/entries.d.ts.map +1 -0
- package/dist/commonjs/entries.js +398 -0
- package/dist/commonjs/entries.js.map +1 -0
- package/dist/commonjs/extract.d.ts +14 -2
- package/dist/commonjs/extract.d.ts.map +1 -1
- package/dist/commonjs/extract.js +40 -81
- package/dist/commonjs/extract.js.map +1 -1
- package/dist/commonjs/fs.d.ts +201 -0
- package/dist/commonjs/fs.d.ts.map +1 -0
- package/dist/commonjs/fs.js +5 -0
- package/dist/commonjs/fs.js.map +1 -0
- package/dist/commonjs/header.d.ts +4 -4
- package/dist/commonjs/header.d.ts.map +1 -1
- package/dist/commonjs/header.js +38 -42
- package/dist/commonjs/header.js.map +1 -1
- package/dist/commonjs/index.d.ts +25 -18
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +46 -18
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/index.min.js +2 -3
- package/dist/commonjs/index.min.js.map +4 -4
- package/dist/commonjs/large-numbers.d.ts +2 -2
- package/dist/commonjs/large-numbers.d.ts.map +1 -1
- package/dist/commonjs/large-numbers.js +4 -4
- package/dist/commonjs/large-numbers.js.map +1 -1
- package/dist/commonjs/list.d.ts +23 -6
- package/dist/commonjs/list.d.ts.map +1 -1
- package/dist/commonjs/list.js +99 -138
- package/dist/commonjs/list.js.map +1 -1
- package/dist/commonjs/mkdir.d.ts +16 -11
- package/dist/commonjs/mkdir.d.ts.map +1 -1
- package/dist/commonjs/mkdir.js +121 -159
- package/dist/commonjs/mkdir.js.map +1 -1
- package/dist/commonjs/options.d.ts +284 -513
- package/dist/commonjs/options.d.ts.map +1 -1
- package/dist/commonjs/options.js +20 -61
- package/dist/commonjs/options.js.map +1 -1
- package/dist/commonjs/pack.d.ts +150 -96
- package/dist/commonjs/pack.d.ts.map +1 -1
- package/dist/commonjs/pack.js +752 -445
- package/dist/commonjs/pack.js.map +1 -1
- package/dist/commonjs/parser.d.ts +94 -0
- package/dist/commonjs/parser.d.ts.map +1 -0
- package/dist/commonjs/parser.js +381 -0
- package/dist/commonjs/parser.js.map +1 -0
- package/dist/commonjs/path-reservations.d.ts +17 -7
- package/dist/commonjs/path-reservations.d.ts.map +1 -1
- package/dist/commonjs/path-reservations.js +96 -119
- package/dist/commonjs/path-reservations.js.map +1 -1
- package/dist/commonjs/path.d.ts +19 -0
- package/dist/commonjs/path.d.ts.map +1 -0
- package/dist/commonjs/path.js +90 -0
- package/dist/commonjs/path.js.map +1 -0
- package/dist/commonjs/pax.d.ts +3 -1
- package/dist/commonjs/pax.d.ts.map +1 -1
- package/dist/commonjs/pax.js +53 -43
- package/dist/commonjs/pax.js.map +1 -1
- package/dist/commonjs/read-entry.d.ts +97 -11
- package/dist/commonjs/read-entry.d.ts.map +1 -1
- package/dist/commonjs/read-entry.js +248 -97
- package/dist/commonjs/read-entry.js.map +1 -1
- package/dist/commonjs/read-file.d.ts +22 -0
- package/dist/commonjs/read-file.d.ts.map +1 -0
- package/dist/commonjs/read-file.js +104 -0
- package/dist/commonjs/read-file.js.map +1 -0
- package/dist/commonjs/replace.d.ts +45 -1
- package/dist/commonjs/replace.d.ts.map +1 -1
- package/dist/commonjs/replace.js +165 -211
- package/dist/commonjs/replace.js.map +1 -1
- package/dist/commonjs/server/codecs.d.ts +38 -0
- package/dist/commonjs/server/codecs.d.ts.map +1 -0
- package/dist/commonjs/server/codecs.js +252 -0
- package/dist/commonjs/server/codecs.js.map +1 -0
- package/dist/commonjs/server/index.d.ts +115 -0
- package/dist/commonjs/server/index.d.ts.map +1 -0
- package/dist/commonjs/server/index.js +166 -0
- package/dist/commonjs/server/index.js.map +1 -0
- package/dist/commonjs/server/index.min.js +3 -0
- package/dist/commonjs/server/index.min.js.map +7 -0
- package/dist/commonjs/strip-absolute-path.d.ts +8 -0
- package/dist/commonjs/strip-absolute-path.d.ts.map +1 -1
- package/dist/commonjs/strip-absolute-path.js +17 -20
- package/dist/commonjs/strip-absolute-path.js.map +1 -1
- package/dist/commonjs/to-stream.d.ts +7 -0
- package/dist/commonjs/to-stream.d.ts.map +1 -0
- package/dist/commonjs/to-stream.js +22 -0
- package/dist/commonjs/to-stream.js.map +1 -0
- package/dist/commonjs/types.d.ts +4 -3
- package/dist/commonjs/types.d.ts.map +1 -1
- package/dist/commonjs/types.js +4 -3
- package/dist/commonjs/types.js.map +1 -1
- package/dist/commonjs/unpack.d.ts +135 -89
- package/dist/commonjs/unpack.d.ts.map +1 -1
- package/dist/commonjs/unpack.js +760 -727
- package/dist/commonjs/unpack.js.map +1 -1
- package/dist/commonjs/update.d.ts +11 -1
- package/dist/commonjs/update.d.ts.map +1 -1
- package/dist/commonjs/update.js +37 -28
- package/dist/commonjs/update.js.map +1 -1
- package/dist/commonjs/warn.d.ts +27 -0
- package/dist/commonjs/warn.d.ts.map +1 -0
- package/dist/commonjs/warn.js +36 -0
- package/dist/commonjs/warn.js.map +1 -0
- package/dist/commonjs/win32-path.d.ts +16 -0
- package/dist/commonjs/win32-path.d.ts.map +1 -0
- package/dist/commonjs/win32-path.js +67 -0
- package/dist/commonjs/win32-path.js.map +1 -0
- package/dist/commonjs/write-entry.d.ts +64 -111
- package/dist/commonjs/write-entry.d.ts.map +1 -1
- package/dist/commonjs/write-entry.js +108 -672
- package/dist/commonjs/write-entry.js.map +1 -1
- package/dist/commonjs/write-flag.d.ts +18 -0
- package/dist/commonjs/write-flag.d.ts.map +1 -0
- package/dist/commonjs/write-flag.js +29 -0
- package/dist/commonjs/write-flag.js.map +1 -0
- package/dist/esm/bytes.d.ts +21 -0
- package/dist/esm/bytes.d.ts.map +1 -0
- package/dist/esm/bytes.js +72 -0
- package/dist/esm/bytes.js.map +1 -0
- package/dist/esm/codec.d.ts +53 -0
- package/dist/esm/codec.d.ts.map +1 -0
- package/dist/esm/codec.js +32 -0
- package/dist/esm/codec.js.map +1 -0
- package/dist/esm/concat.d.ts +3 -0
- package/dist/esm/concat.d.ts.map +1 -0
- package/dist/esm/concat.js +16 -0
- package/dist/esm/concat.js.map +1 -0
- package/dist/esm/create.d.ts +39 -2
- package/dist/esm/create.d.ts.map +1 -1
- package/dist/esm/create.js +144 -61
- package/dist/esm/create.js.map +1 -1
- package/dist/esm/dealias.d.ts +79 -0
- package/dist/esm/dealias.d.ts.map +1 -0
- package/dist/esm/dealias.js +46 -0
- package/dist/esm/dealias.js.map +1 -0
- package/dist/esm/delete.d.ts +19 -0
- package/dist/esm/delete.d.ts.map +1 -0
- package/dist/esm/delete.js +117 -0
- package/dist/esm/delete.js.map +1 -0
- package/dist/esm/entries.d.ts +82 -0
- package/dist/esm/entries.d.ts.map +1 -0
- package/dist/esm/entries.js +388 -0
- package/dist/esm/entries.js.map +1 -0
- package/dist/esm/extract.d.ts +14 -2
- package/dist/esm/extract.d.ts.map +1 -1
- package/dist/esm/extract.js +37 -44
- package/dist/esm/extract.js.map +1 -1
- package/dist/esm/fs.d.ts +201 -0
- package/dist/esm/fs.d.ts.map +1 -0
- package/dist/esm/fs.js +4 -0
- package/dist/esm/fs.js.map +1 -0
- package/dist/esm/header.d.ts +4 -4
- package/dist/esm/header.d.ts.map +1 -1
- package/dist/esm/header.js +38 -42
- package/dist/esm/header.js.map +1 -1
- package/dist/esm/index.d.ts +25 -18
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +23 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +2 -3
- package/dist/esm/index.min.js.map +4 -4
- package/dist/esm/large-numbers.d.ts +2 -2
- package/dist/esm/large-numbers.d.ts.map +1 -1
- package/dist/esm/large-numbers.js +4 -4
- package/dist/esm/large-numbers.js.map +1 -1
- package/dist/esm/list.d.ts +23 -6
- package/dist/esm/list.d.ts.map +1 -1
- package/dist/esm/list.js +96 -101
- package/dist/esm/list.js.map +1 -1
- package/dist/esm/mkdir.d.ts +16 -11
- package/dist/esm/mkdir.d.ts.map +1 -1
- package/dist/esm/mkdir.js +119 -154
- package/dist/esm/mkdir.js.map +1 -1
- package/dist/esm/options.d.ts +284 -513
- package/dist/esm/options.d.ts.map +1 -1
- package/dist/esm/options.js +17 -51
- package/dist/esm/options.js.map +1 -1
- package/dist/esm/pack.d.ts +150 -96
- package/dist/esm/pack.d.ts.map +1 -1
- package/dist/esm/pack.js +750 -441
- package/dist/esm/pack.js.map +1 -1
- package/dist/esm/parser.d.ts +94 -0
- package/dist/esm/parser.d.ts.map +1 -0
- package/dist/esm/parser.js +377 -0
- package/dist/esm/parser.js.map +1 -0
- package/dist/esm/path-reservations.d.ts +17 -7
- package/dist/esm/path-reservations.d.ts.map +1 -1
- package/dist/esm/path-reservations.js +96 -119
- package/dist/esm/path-reservations.js.map +1 -1
- package/dist/esm/path.d.ts +19 -0
- package/dist/esm/path.d.ts.map +1 -0
- package/dist/esm/path.js +80 -0
- package/dist/esm/path.js.map +1 -0
- package/dist/esm/pax.d.ts +3 -1
- package/dist/esm/pax.d.ts.map +1 -1
- package/dist/esm/pax.js +52 -42
- package/dist/esm/pax.js.map +1 -1
- package/dist/esm/read-entry.d.ts +97 -11
- package/dist/esm/read-entry.d.ts.map +1 -1
- package/dist/esm/read-entry.js +245 -96
- package/dist/esm/read-entry.js.map +1 -1
- package/dist/esm/read-file.d.ts +22 -0
- package/dist/esm/read-file.d.ts.map +1 -0
- package/dist/esm/read-file.js +99 -0
- package/dist/esm/read-file.js.map +1 -0
- package/dist/esm/replace.d.ts +45 -1
- package/dist/esm/replace.d.ts.map +1 -1
- package/dist/esm/replace.js +161 -207
- package/dist/esm/replace.js.map +1 -1
- package/dist/esm/server/codecs.d.ts +38 -0
- package/dist/esm/server/codecs.d.ts.map +1 -0
- package/dist/esm/server/codecs.js +214 -0
- package/dist/esm/server/codecs.js.map +1 -0
- package/dist/esm/server/index.d.ts +115 -0
- package/dist/esm/server/index.d.ts.map +1 -0
- package/dist/esm/server/index.js +102 -0
- package/dist/esm/server/index.js.map +1 -0
- package/dist/esm/server/index.min.js +3 -0
- package/dist/esm/server/index.min.js.map +7 -0
- package/dist/esm/strip-absolute-path.d.ts +8 -0
- package/dist/esm/strip-absolute-path.d.ts.map +1 -1
- package/dist/esm/strip-absolute-path.js +17 -20
- package/dist/esm/strip-absolute-path.js.map +1 -1
- package/dist/esm/to-stream.d.ts +7 -0
- package/dist/esm/to-stream.d.ts.map +1 -0
- package/dist/esm/to-stream.js +18 -0
- package/dist/esm/to-stream.js.map +1 -0
- package/dist/esm/types.d.ts +4 -3
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +4 -3
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/unpack.d.ts +135 -89
- package/dist/esm/unpack.d.ts.map +1 -1
- package/dist/esm/unpack.js +756 -721
- package/dist/esm/unpack.js.map +1 -1
- package/dist/esm/update.d.ts +11 -1
- package/dist/esm/update.d.ts.map +1 -1
- package/dist/esm/update.js +35 -28
- package/dist/esm/update.js.map +1 -1
- package/dist/esm/warn.d.ts +27 -0
- package/dist/esm/warn.d.ts.map +1 -0
- package/dist/esm/warn.js +31 -0
- package/dist/esm/warn.js.map +1 -0
- package/dist/esm/win32-path.d.ts +16 -0
- package/dist/esm/win32-path.d.ts.map +1 -0
- package/dist/esm/win32-path.js +60 -0
- package/dist/esm/win32-path.js.map +1 -0
- package/dist/esm/write-entry.d.ts +64 -111
- package/dist/esm/write-entry.d.ts.map +1 -1
- package/dist/esm/write-entry.js +107 -633
- package/dist/esm/write-entry.js.map +1 -1
- package/dist/esm/write-flag.d.ts +18 -0
- package/dist/esm/write-flag.d.ts.map +1 -0
- package/dist/esm/write-flag.js +25 -0
- package/dist/esm/write-flag.js.map +1 -0
- package/package.json +68 -224
- package/dist/commonjs/get-write-flag.d.ts +0 -2
- package/dist/commonjs/get-write-flag.d.ts.map +0 -1
- package/dist/commonjs/get-write-flag.js +0 -32
- package/dist/commonjs/get-write-flag.js.map +0 -1
- package/dist/commonjs/make-command.d.ts +0 -49
- package/dist/commonjs/make-command.d.ts.map +0 -1
- package/dist/commonjs/make-command.js +0 -52
- package/dist/commonjs/make-command.js.map +0 -1
- package/dist/commonjs/normalize-windows-path.d.ts +0 -2
- package/dist/commonjs/normalize-windows-path.d.ts.map +0 -1
- package/dist/commonjs/normalize-windows-path.js +0 -12
- package/dist/commonjs/normalize-windows-path.js.map +0 -1
- package/dist/commonjs/parse.d.ts +0 -92
- package/dist/commonjs/parse.d.ts.map +0 -1
- package/dist/commonjs/parse.js +0 -655
- package/dist/commonjs/parse.js.map +0 -1
- package/dist/commonjs/process-umask.d.ts +0 -2
- package/dist/commonjs/process-umask.d.ts.map +0 -1
- package/dist/commonjs/process-umask.js +0 -7
- package/dist/commonjs/process-umask.js.map +0 -1
- package/dist/commonjs/warn-method.d.ts +0 -24
- package/dist/commonjs/warn-method.d.ts.map +0 -1
- package/dist/commonjs/warn-method.js +0 -31
- package/dist/commonjs/warn-method.js.map +0 -1
- package/dist/esm/get-write-flag.d.ts +0 -2
- package/dist/esm/get-write-flag.d.ts.map +0 -1
- package/dist/esm/get-write-flag.js +0 -26
- package/dist/esm/get-write-flag.js.map +0 -1
- package/dist/esm/make-command.d.ts +0 -49
- package/dist/esm/make-command.d.ts.map +0 -1
- package/dist/esm/make-command.js +0 -48
- package/dist/esm/make-command.js.map +0 -1
- package/dist/esm/normalize-windows-path.d.ts +0 -2
- package/dist/esm/normalize-windows-path.d.ts.map +0 -1
- package/dist/esm/normalize-windows-path.js +0 -9
- package/dist/esm/normalize-windows-path.js.map +0 -1
- package/dist/esm/parse.d.ts +0 -92
- package/dist/esm/parse.d.ts.map +0 -1
- package/dist/esm/parse.js +0 -651
- package/dist/esm/parse.js.map +0 -1
- package/dist/esm/process-umask.d.ts +0 -2
- package/dist/esm/process-umask.d.ts.map +0 -1
- package/dist/esm/process-umask.js +0 -3
- package/dist/esm/process-umask.js.map +0 -1
- package/dist/esm/warn-method.d.ts +0 -24
- package/dist/esm/warn-method.d.ts.map +0 -1
- package/dist/esm/warn-method.js +0 -27
- package/dist/esm/warn-method.js.map +0 -1
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove each root from the start of a path. Returns the roots and
|
|
3
|
+
* the rest of the path.
|
|
4
|
+
*
|
|
5
|
+
* A POSIX absolute path is also absolute on Windows, so the rules of
|
|
6
|
+
* Windows are used on each platform. A path that is relative to a
|
|
7
|
+
* drive loses the drive: `c:../foo` gives `['c:', '../foo']`.
|
|
8
|
+
*/
|
|
1
9
|
export declare const stripAbsolutePath: (path: string) => [string, string];
|
|
2
10
|
//# sourceMappingURL=strip-absolute-path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strip-absolute-path.d.ts","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strip-absolute-path.d.ts","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAU/D,CAAA"}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stripAbsolutePath = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const win32_path_js_1 = require("./win32-path.js");
|
|
5
|
+
/**
|
|
6
|
+
* Remove each root from the start of a path. Returns the roots and
|
|
7
|
+
* the rest of the path.
|
|
8
|
+
*
|
|
9
|
+
* A POSIX absolute path is also absolute on Windows, so the rules of
|
|
10
|
+
* Windows are used on each platform. A path that is relative to a
|
|
11
|
+
* drive loses the drive: `c:../foo` gives `['c:', '../foo']`.
|
|
12
|
+
*/
|
|
13
13
|
const stripAbsolutePath = (path) => {
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'/'
|
|
21
|
-
: parsed.root;
|
|
14
|
+
let roots = '';
|
|
15
|
+
for (let root; (root = (0, win32_path_js_1.win32Root)(path));) {
|
|
16
|
+
// Windows reads `//x/y/` as the root of `//x/y/z`. Remove only the
|
|
17
|
+
// first slash, but remove all of `//?/c:/`.
|
|
18
|
+
if (path.charAt(0) === '/' && path.slice(0, 4) !== '//?/')
|
|
19
|
+
root = '/';
|
|
22
20
|
path = path.slice(root.length);
|
|
23
|
-
|
|
24
|
-
parsed = parse(path);
|
|
21
|
+
roots += root;
|
|
25
22
|
}
|
|
26
|
-
return [
|
|
23
|
+
return [roots, path];
|
|
27
24
|
};
|
|
28
25
|
exports.stripAbsolutePath = stripAbsolutePath;
|
|
29
26
|
//# sourceMappingURL=strip-absolute-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strip-absolute-path.js","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"strip-absolute-path.js","sourceRoot":"","sources":["../../src/strip-absolute-path.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAE3C;;;;;;;GAOG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAoB,EAAE;IAClE,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,KAAK,IAAI,IAAI,EAAE,CAAC,IAAI,GAAG,IAAA,yBAAS,EAAC,IAAI,CAAC,CAAC,GAAI,CAAC;QAC1C,mEAAmE;QACnE,4CAA4C;QAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM;YAAE,IAAI,GAAG,GAAG,CAAA;QACrE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,KAAK,IAAI,IAAI,CAAA;IACf,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC,CAAA;AAVY,QAAA,iBAAiB,qBAU7B","sourcesContent":["import { win32Root } from './win32-path.js'\n\n/**\n * Remove each root from the start of a path. Returns the roots and\n * the rest of the path.\n *\n * A POSIX absolute path is also absolute on Windows, so the rules of\n * Windows are used on each platform. A path that is relative to a\n * drive loses the drive: `c:../foo` gives `['c:', '../foo']`.\n */\nexport const stripAbsolutePath = (path: string): [string, string] => {\n let roots = ''\n for (let root; (root = win32Root(path)); ) {\n // Windows reads `//x/y/` as the root of `//x/y/z`. Remove only the\n // first slash, but remove all of `//?/c:/`.\n if (path.charAt(0) === '/' && path.slice(0, 4) !== '//?/') root = '/'\n path = path.slice(root.length)\n roots += root\n }\n return [roots, path]\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make a stream of the chunks of an iterator. It asks the iterator
|
|
3
|
+
* for a chunk only when a consumer reads the stream. A cancel of the
|
|
4
|
+
* stream calls `return()` of the iterator.
|
|
5
|
+
*/
|
|
6
|
+
export declare const toStream: (chunks: AsyncIterator<Uint8Array, unknown>) => ReadableStream<Uint8Array>;
|
|
7
|
+
//# sourceMappingURL=to-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-stream.d.ts","sourceRoot":"","sources":["../../src/to-stream.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GACnB,QAAQ,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,KACzC,cAAc,CAAC,UAAU,CAazB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toStream = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Make a stream of the chunks of an iterator. It asks the iterator
|
|
6
|
+
* for a chunk only when a consumer reads the stream. A cancel of the
|
|
7
|
+
* stream calls `return()` of the iterator.
|
|
8
|
+
*/
|
|
9
|
+
const toStream = (chunks) => new ReadableStream({
|
|
10
|
+
pull: async (controller) => {
|
|
11
|
+
const res = await chunks.next();
|
|
12
|
+
if (res.done)
|
|
13
|
+
controller.close();
|
|
14
|
+
else
|
|
15
|
+
controller.enqueue(res.value);
|
|
16
|
+
},
|
|
17
|
+
cancel: async () => {
|
|
18
|
+
await chunks.return?.();
|
|
19
|
+
},
|
|
20
|
+
}, { highWaterMark: 0 });
|
|
21
|
+
exports.toStream = toStream;
|
|
22
|
+
//# sourceMappingURL=to-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-stream.js","sourceRoot":"","sources":["../../src/to-stream.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,QAAQ,GAAG,CACtB,MAA0C,EACd,EAAE,CAC9B,IAAI,cAAc,CAChB;IACE,IAAI,EAAE,KAAK,EAAC,UAAU,EAAC,EAAE;QACvB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,GAAG,CAAC,IAAI;YAAE,UAAU,CAAC,KAAK,EAAE,CAAA;;YAC3B,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;IACD,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,CAAC,MAAM,EAAE,EAAE,CAAA;IACzB,CAAC;CACF,EACD,EAAE,aAAa,EAAE,CAAC,EAAE,CACrB,CAAA;AAfU,QAAA,QAAQ,YAelB","sourcesContent":["/**\n * Make a stream of the chunks of an iterator. It asks the iterator\n * for a chunk only when a consumer reads the stream. A cancel of the\n * stream calls `return()` of the iterator.\n */\nexport const toStream = (\n chunks: AsyncIterator<Uint8Array, unknown>,\n): ReadableStream<Uint8Array> =>\n new ReadableStream<Uint8Array>(\n {\n pull: async controller => {\n const res = await chunks.next()\n if (res.done) controller.close()\n else controller.enqueue(res.value)\n },\n cancel: async () => {\n await chunks.return?.()\n },\n },\n { highWaterMark: 0 },\n )\n"]}
|
package/dist/commonjs/types.d.ts
CHANGED
|
@@ -5,10 +5,11 @@ export type EntryTypeName = 'File' | 'OldFile' | 'Link' | 'SymbolicLink' | 'Char
|
|
|
5
5
|
/**
|
|
6
6
|
* types that are a normal file system entry, not metadata.
|
|
7
7
|
*
|
|
8
|
-
* These can be the subject of extended/globalExtended headers, long
|
|
9
|
-
* names, long linkpath names, etc.
|
|
8
|
+
* These can be the subject of extended/globalExtended headers, long
|
|
9
|
+
* path names, long linkpath names, etc.
|
|
10
10
|
*
|
|
11
|
-
* Any other types are meta, and cannot be
|
|
11
|
+
* Any other types are meta, and cannot be targeted by extended PAX
|
|
12
|
+
* headers.
|
|
12
13
|
*/
|
|
13
14
|
export declare const normalFsTypes: Set<EntryTypeCode>;
|
|
14
15
|
export declare const name: Map<EntryTypeCode, EntryTypeName>;
|
|
@@ -1 +1 @@
|
|
|
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;AAEjB
|
|
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;AAEjB;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,oBAWxB,CAAA;AAGF,eAAO,MAAM,IAAI,mCAsCf,CAAA;AAGF,eAAO,MAAM,IAAI,mCAEhB,CAAA"}
|
package/dist/commonjs/types.js
CHANGED
|
@@ -8,10 +8,11 @@ exports.isName = isName;
|
|
|
8
8
|
/**
|
|
9
9
|
* types that are a normal file system entry, not metadata.
|
|
10
10
|
*
|
|
11
|
-
* These can be the subject of extended/globalExtended headers, long
|
|
12
|
-
* names, long linkpath names, etc.
|
|
11
|
+
* These can be the subject of extended/globalExtended headers, long
|
|
12
|
+
* path names, long linkpath names, etc.
|
|
13
13
|
*
|
|
14
|
-
* Any other types are meta, and cannot be
|
|
14
|
+
* Any other types are meta, and cannot be targeted by extended PAX
|
|
15
|
+
* headers.
|
|
15
16
|
*/
|
|
16
17
|
exports.normalFsTypes = new Set([
|
|
17
18
|
'0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAO,MAAM,MAAM,GAAG,CAAC,CAAS,EAAsB,EA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gB,CAAC;IACvB,wBAAwB;IACxB,OAAO;IACP,CAAC,GAAG,EAAE,YAAY,CAAC;IACnB,iDAAiD;IACjD,CAAC,GAAG,EAAE,YAAY,CAAC;IACnB,sBAAsB;IACtB,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,gCAAgC;IAChC,CAAC,GAAG,EAAE,yBAAyB,CAAC;IAChC,2BAA2B;IAC3B,CAAC,GAAG,EAAE,qBAAqB,CAAC;IAC5B,OAAO;IACP,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACzB,SAAS;IACT,CAAC,GAAG,EAAE,gBAAgB,CAAC;IACvB,OAAO;IACP,CAAC,GAAG,EAAE,YAAY,CAAC;IACnB,OAAO;IACP,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACzB,SAAS;IACT,CAAC,GAAG,EAAE,mBAAmB,CAAC;CAC3B,CAAC,CAAA;AAEF,0BAA0B;AACb,QAAA,IAAI,GAAG,IAAI,GAAG,CACzB,KAAK,CAAC,IAAI,CAAC,YAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,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/**\n * types that are a normal file system entry, not metadata.\n *\n * These can be the subject of extended/globalExtended headers, long\n * path names, long linkpath names, etc.\n *\n * Any other types are meta, and cannot be targeted by extended PAX\n * headers.\n */\nexport const normalFsTypes = new Set<EntryTypeCode>([\n '0',\n '',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n 'D',\n])\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"]}
|
|
@@ -1,101 +1,147 @@
|
|
|
1
|
-
import { type Stats } from 'node:fs';
|
|
2
|
-
import type { MkdirError } from './mkdir.js';
|
|
3
|
-
import { Parser } from './parse.js';
|
|
4
|
-
import type { TarOptions } from './options.js';
|
|
5
|
-
import { PathReservations } from './path-reservations.js';
|
|
6
|
-
import type { ReadEntry } from './read-entry.js';
|
|
7
|
-
import type { WarnData } from './warn-method.js';
|
|
8
1
|
import { SymlinkError } from './symlink-error.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
declare
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
writable: true;
|
|
42
|
-
readable: false;
|
|
2
|
+
import type { ExtractStats } from './fs.js';
|
|
3
|
+
import { type MkdirOptions } from './mkdir.js';
|
|
4
|
+
import { type ExtractOptions, type ExtractOptionsSync, type ReadOptions, type TarInput, type TarInputSync, type UnpackOptions } from './options.js';
|
|
5
|
+
import type { EntryData, ReadEntry, ReadEntrySync } from './read-entry.js';
|
|
6
|
+
import { type WarnData } from './warn.js';
|
|
7
|
+
import { type OpenConstants } from './write-flag.js';
|
|
8
|
+
/** The options that `UnpackBase` reads. */
|
|
9
|
+
export type UnpackBaseOptions<E extends EntryData> = ReadOptions<E> & UnpackOptions & {
|
|
10
|
+
fs: {
|
|
11
|
+
constants?: OpenConstants;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The parts of the extraction that do not use the file system: the
|
|
16
|
+
* options, the checks of each entry, and the warnings. `Unpack` and
|
|
17
|
+
* `UnpackSync` add the file system work.
|
|
18
|
+
*/
|
|
19
|
+
export declare class UnpackBase<E extends EntryData, O extends UnpackBaseOptions<E> = UnpackBaseOptions<E>> {
|
|
20
|
+
#private;
|
|
21
|
+
/** The options, with no prototype. */
|
|
22
|
+
opt: O;
|
|
23
|
+
/** The absolute path of the extraction directory. */
|
|
24
|
+
cwd: string;
|
|
25
|
+
win32: boolean;
|
|
26
|
+
strip: number;
|
|
27
|
+
maxDepth: number;
|
|
28
|
+
preservePaths: boolean;
|
|
29
|
+
unlink: boolean;
|
|
30
|
+
keep: boolean;
|
|
31
|
+
newer: boolean;
|
|
32
|
+
noMtime: boolean;
|
|
33
|
+
chmod: boolean;
|
|
43
34
|
uid?: number;
|
|
44
35
|
gid?: number;
|
|
45
|
-
setOwner: boolean;
|
|
46
36
|
preserveOwner: boolean;
|
|
47
|
-
processGid?: number;
|
|
48
|
-
processUid?: number;
|
|
49
|
-
maxDepth: number;
|
|
50
37
|
forceChown: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
keep: boolean;
|
|
54
|
-
noMtime: boolean;
|
|
55
|
-
preservePaths: boolean;
|
|
56
|
-
unlink: boolean;
|
|
57
|
-
cwd: string;
|
|
58
|
-
strip: number;
|
|
38
|
+
processUid?: number;
|
|
39
|
+
processGid?: number;
|
|
59
40
|
processUmask: number;
|
|
60
41
|
umask: number;
|
|
61
42
|
dmode: number;
|
|
62
43
|
fmode: number;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
44
|
+
/** Gives the `open` flag for a new file of a given size. */
|
|
45
|
+
writeFlag: (size: number) => string | number;
|
|
46
|
+
/** Resolve a path from an absolute path. */
|
|
47
|
+
resolve: (base: string, path: string) => string;
|
|
48
|
+
/** The parent directory of an absolute path. */
|
|
49
|
+
dirname: (path: string) => string;
|
|
50
|
+
/** Set when an error stops the extraction. */
|
|
51
|
+
fatal?: {
|
|
52
|
+
error: unknown;
|
|
53
|
+
};
|
|
54
|
+
constructor(options: O);
|
|
55
|
+
/**
|
|
56
|
+
* Report a problem to `onwarn`, or throw it if `strict` is set. A
|
|
57
|
+
* damaged archive is always an error here, because the extraction
|
|
58
|
+
* cannot be complete.
|
|
59
|
+
*/
|
|
60
|
+
warn(code: string, message: string | Error, data?: WarnData): void;
|
|
61
|
+
/** The options for the reader. Its warnings go to `warn()`. */
|
|
62
|
+
readerOptions(): ReadOptions<E>;
|
|
63
|
+
/**
|
|
64
|
+
* Report the failure of one entry as a `TAR_ENTRY_ERROR` warning.
|
|
65
|
+
* Throws the error if it stops the extraction: the extraction
|
|
66
|
+
* directory is not usable, the archive cannot be read, or `strict`
|
|
67
|
+
* is set.
|
|
68
|
+
*/
|
|
69
|
+
entryError(er: unknown, entry: E): void;
|
|
70
|
+
/** Record the error that stops the extraction. Returns it. */
|
|
71
|
+
fail(error: unknown): unknown;
|
|
72
|
+
/**
|
|
73
|
+
* Check the entry, with no use of the file system. Set its
|
|
74
|
+
* `absolute` path, and change its `path`, `linkpath`, and `mode` to
|
|
75
|
+
* the values to extract. False if the entry must not be extracted.
|
|
76
|
+
*/
|
|
77
|
+
check(entry: E): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The paths that the entry must have for itself while it is made.
|
|
80
|
+
* A link also reserves its target, so that an entry that makes the
|
|
81
|
+
* target, and an entry that goes through the link, do not run at
|
|
82
|
+
* the same time as the link.
|
|
83
|
+
*/
|
|
84
|
+
reservedPaths(entry: E): string[];
|
|
85
|
+
/** The options to make a directory with a mode. */
|
|
86
|
+
mkdirOptions(mode: number): MkdirOptions;
|
|
87
|
+
/**
|
|
88
|
+
* The owner to set on the entry, if it needs one: with
|
|
89
|
+
* `preserveOwner`, when the owner in the archive is not the process
|
|
90
|
+
* owner, and with `uid` and `gid`, when they are not the process
|
|
91
|
+
* owner.
|
|
92
|
+
*/
|
|
93
|
+
owner(entry: E): {
|
|
94
|
+
uid: number;
|
|
95
|
+
gid: number;
|
|
96
|
+
} | undefined;
|
|
97
|
+
/** The times to set on the entry, if it needs them. */
|
|
98
|
+
times(entry: E): {
|
|
99
|
+
atime: Date;
|
|
100
|
+
mtime: Date;
|
|
101
|
+
} | undefined;
|
|
102
|
+
/** True if the object on disk at the path of the entry must stay. */
|
|
103
|
+
skip(entry: E, st: ExtractStats): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* True if the entry can be written into the file that is on disk.
|
|
106
|
+
* A file with more than one link is not used, because the write
|
|
107
|
+
* would change the other links. Windows does not report a useful
|
|
108
|
+
* link count.
|
|
109
|
+
*/
|
|
110
|
+
isReusable(entry: E, st: ExtractStats): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The parts of the path from the extraction directory to the
|
|
113
|
+
* target of a link entry. None of them can be a symbolic link.
|
|
114
|
+
*/
|
|
115
|
+
linkParts(entry: E, absolute: string): string[];
|
|
116
|
+
/** The error for a link target that goes through a symbolic link. */
|
|
117
|
+
symlinkError(symlink: string, parts: string[]): SymlinkError;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Extracts the entries of an archive with async file system
|
|
121
|
+
* functions.
|
|
122
|
+
*
|
|
123
|
+
* Several entries are extracted at one time. Entries that use the
|
|
124
|
+
* same path, or a path and a directory above it, are extracted in
|
|
125
|
+
* the order of the archive.
|
|
126
|
+
*/
|
|
127
|
+
export declare class Unpack extends UnpackBase<ReadEntry, ExtractOptions> {
|
|
128
|
+
#private;
|
|
129
|
+
constructor(opt: ExtractOptions);
|
|
130
|
+
/**
|
|
131
|
+
* Extract the archive. The promise settles when all the file
|
|
132
|
+
* system work is done. It rejects with the first error that stops
|
|
133
|
+
* the extraction.
|
|
134
|
+
*/
|
|
135
|
+
extract(input: TarInput): Promise<void>;
|
|
89
136
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Extracts the entries of an archive with sync file system
|
|
139
|
+
* functions, one entry at a time.
|
|
140
|
+
*/
|
|
141
|
+
export declare class UnpackSync extends UnpackBase<ReadEntrySync, ExtractOptionsSync> {
|
|
142
|
+
#private;
|
|
143
|
+
constructor(opt: ExtractOptionsSync);
|
|
144
|
+
/** Extract the archive. Throws the first error that stops it. */
|
|
145
|
+
extract(input: TarInputSync): void;
|
|
99
146
|
}
|
|
100
|
-
export {};
|
|
101
147
|
//# sourceMappingURL=unpack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpack.d.ts","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unpack.d.ts","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIjD,OAAO,KAAK,EAA4B,YAAY,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAA;AAUrB,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE1E,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAO/C,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AA0BhE,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,CAAC,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