@unbrained/pm-cli 2026.12.1 → 2026.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-CWPR234D.js → chunk-7NAO7I75.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YQMQOUO.js → chunk-7V65VACG.js} +52 -52
- package/dist/cli-bundle/chunks/{chunk-NA6D75V5.js → chunk-G6TARHFK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YSVOXCYH.js → chunk-GOEQXVOI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OKEJ4U2I.js → chunk-ROTEELDL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-U7RBJGLF.js → chunk-SDXCJZKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XME6GIFQ.js → chunk-TKUG2X24.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6GLSAJY.js → chunk-UNBW2LF3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +2 -0
- package/dist/cli-bundle/chunks/{item-transaction-66RDV7PH.js → item-transaction-56J5OCHA.js} +2 -2
- package/dist/cli-bundle/chunks/{linked-resource-value-list-E2DX52LY.js → linked-resource-value-list-ZBIY4H23.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-2F6JUBST.js → register-mutation-EK6DVIQK.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-ET3UKPYK.js → register-operations-6MURXE4V.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-I63QTFCU.js → register-setup-RW26X3GJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SQ72CVUH.js → chunk-3COWDIPX.js} +54 -54
- package/dist/cli-bundle/focused-chunks/{chunk-PT7RT3T6.js → chunk-J72TRWR5.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{item-transaction-2K4SFLJ7.js → item-transaction-LQLQLZE7.js} +2 -2
- package/dist/cli-bundle/main.js +3 -3
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/sdk/extension/install-sources.d.ts +2 -2
- package/dist/sdk/extension/install-sources.js +5 -5
- package/marketplace.json +1 -1
- package/node_modules/tar/README.md +1792 -1147
- package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
- package/node_modules/tar/dist/commonjs/bytes.js +83 -0
- package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/codec.js +35 -0
- package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/concat.js +20 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
- package/node_modules/tar/dist/commonjs/create.js +150 -64
- package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
- package/node_modules/tar/dist/commonjs/dealias.js +50 -0
- package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/delete.js +121 -0
- package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
- package/node_modules/tar/dist/commonjs/entries.js +398 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
- package/node_modules/tar/dist/commonjs/extract.js +40 -81
- package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
- package/node_modules/tar/dist/commonjs/fs.js +5 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
- package/node_modules/tar/dist/commonjs/header.js +71 -53
- package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
- package/node_modules/tar/dist/commonjs/index.js +46 -18
- package/node_modules/tar/dist/commonjs/index.min.js +2 -3
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
- package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
- package/node_modules/tar/dist/commonjs/list.js +99 -138
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
- package/node_modules/tar/dist/commonjs/options.js +20 -61
- package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
- package/node_modules/tar/dist/commonjs/pack.js +752 -445
- package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
- package/node_modules/tar/dist/commonjs/parser.js +452 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
- package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/path.js +90 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
- package/node_modules/tar/dist/commonjs/pax.js +67 -36
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
- package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
- package/node_modules/tar/dist/commonjs/read-file.js +104 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
- package/node_modules/tar/dist/commonjs/replace.js +164 -211
- package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
- package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
- package/node_modules/tar/dist/commonjs/server/index.js +166 -0
- package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
- package/node_modules/tar/dist/commonjs/types.js +4 -3
- package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
- package/node_modules/tar/dist/commonjs/unpack.js +780 -725
- package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
- package/node_modules/tar/dist/commonjs/update.js +37 -28
- package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
- package/node_modules/tar/dist/commonjs/warn.js +36 -0
- package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
- package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
- package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
- package/node_modules/tar/dist/esm/bytes.js +72 -0
- package/node_modules/tar/dist/esm/codec.d.ts +53 -0
- package/node_modules/tar/dist/esm/codec.js +32 -0
- package/node_modules/tar/dist/esm/concat.d.ts +3 -0
- package/node_modules/tar/dist/esm/concat.js +16 -0
- package/node_modules/tar/dist/esm/create.d.ts +39 -2
- package/node_modules/tar/dist/esm/create.js +144 -61
- package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
- package/node_modules/tar/dist/esm/dealias.js +46 -0
- package/node_modules/tar/dist/esm/delete.d.ts +19 -0
- package/node_modules/tar/dist/esm/delete.js +117 -0
- package/node_modules/tar/dist/esm/entries.d.ts +82 -0
- package/node_modules/tar/dist/esm/entries.js +388 -0
- package/node_modules/tar/dist/esm/extract.d.ts +14 -2
- package/node_modules/tar/dist/esm/extract.js +37 -44
- package/node_modules/tar/dist/esm/fs.d.ts +201 -0
- package/node_modules/tar/dist/esm/fs.js +4 -0
- package/node_modules/tar/dist/esm/header.d.ts +4 -4
- package/node_modules/tar/dist/esm/header.js +71 -53
- package/node_modules/tar/dist/esm/index.d.ts +25 -18
- package/node_modules/tar/dist/esm/index.js +23 -18
- package/node_modules/tar/dist/esm/index.min.js +2 -3
- package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/esm/large-numbers.js +4 -4
- package/node_modules/tar/dist/esm/list.d.ts +23 -6
- package/node_modules/tar/dist/esm/list.js +96 -101
- package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/esm/mkdir.js +119 -154
- package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/esm/options.d.ts +284 -513
- package/node_modules/tar/dist/esm/options.js +17 -51
- package/node_modules/tar/dist/esm/pack.d.ts +150 -96
- package/node_modules/tar/dist/esm/pack.js +750 -441
- package/node_modules/tar/dist/esm/parser.d.ts +98 -0
- package/node_modules/tar/dist/esm/parser.js +448 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/esm/path-reservations.js +110 -140
- package/node_modules/tar/dist/esm/path.d.ts +19 -0
- package/node_modules/tar/dist/esm/path.js +80 -0
- package/node_modules/tar/dist/esm/pax.d.ts +3 -1
- package/node_modules/tar/dist/esm/pax.js +66 -35
- package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/esm/read-entry.js +248 -96
- package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
- package/node_modules/tar/dist/esm/read-file.js +99 -0
- package/node_modules/tar/dist/esm/replace.d.ts +45 -1
- package/node_modules/tar/dist/esm/replace.js +160 -207
- package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/esm/server/codecs.js +214 -0
- package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
- package/node_modules/tar/dist/esm/server/index.js +102 -0
- package/node_modules/tar/dist/esm/server/index.min.js +3 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/esm/to-stream.js +18 -0
- package/node_modules/tar/dist/esm/types.d.ts +4 -3
- package/node_modules/tar/dist/esm/types.js +4 -3
- package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
- package/node_modules/tar/dist/esm/unpack.js +776 -719
- package/node_modules/tar/dist/esm/update.d.ts +11 -1
- package/node_modules/tar/dist/esm/update.js +35 -28
- package/node_modules/tar/dist/esm/warn.d.ts +27 -0
- package/node_modules/tar/dist/esm/warn.js +31 -0
- package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/esm/win32-path.js +60 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/esm/write-entry.js +107 -633
- package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/esm/write-flag.js +25 -0
- package/node_modules/tar/package.json +68 -224
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-AJLU6KLW.js +0 -2
- package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
- package/node_modules/@isaacs/fs-minipass/README.md +0 -71
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/package.json +0 -72
- package/node_modules/chownr/LICENSE.md +0 -63
- package/node_modules/chownr/README.md +0 -3
- package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
- package/node_modules/chownr/dist/commonjs/index.js +0 -93
- package/node_modules/chownr/dist/commonjs/package.json +0 -3
- package/node_modules/chownr/dist/esm/index.d.ts +0 -3
- package/node_modules/chownr/dist/esm/index.js +0 -85
- package/node_modules/chownr/dist/esm/package.json +0 -3
- package/node_modules/chownr/package.json +0 -69
- package/node_modules/minipass/LICENSE.md +0 -55
- package/node_modules/minipass/README.md +0 -825
- package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
- package/node_modules/minipass/dist/commonjs/index.js +0 -1038
- package/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/node_modules/minipass/dist/esm/index.d.ts +0 -545
- package/node_modules/minipass/dist/esm/index.js +0 -1020
- package/node_modules/minipass/dist/esm/package.json +0 -3
- package/node_modules/minipass/package.json +0 -77
- package/node_modules/minizlib/LICENSE +0 -26
- package/node_modules/minizlib/README.md +0 -64
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
- package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
- package/node_modules/minizlib/dist/commonjs/index.js +0 -416
- package/node_modules/minizlib/dist/commonjs/package.json +0 -3
- package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/esm/constants.js +0 -117
- package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
- package/node_modules/minizlib/dist/esm/index.js +0 -363
- package/node_modules/minizlib/dist/esm/package.json +0 -3
- package/node_modules/minizlib/package.json +0 -80
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
- package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
- package/node_modules/tar/dist/commonjs/make-command.js +0 -52
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
- package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
- package/node_modules/tar/dist/commonjs/parse.js +0 -655
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
- package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
- package/node_modules/tar/dist/esm/make-command.js +0 -48
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
- package/node_modules/tar/dist/esm/parse.d.ts +0 -92
- package/node_modules/tar/dist/esm/parse.js +0 -651
- package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/esm/process-umask.js +0 -3
- package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/esm/warn-method.js +0 -27
- package/node_modules/yallist/LICENSE.md +0 -63
- package/node_modules/yallist/README.md +0 -205
- package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
- package/node_modules/yallist/dist/commonjs/index.js +0 -384
- package/node_modules/yallist/dist/commonjs/package.json +0 -3
- package/node_modules/yallist/dist/esm/index.d.ts +0 -39
- package/node_modules/yallist/dist/esm/index.js +0 -379
- package/node_modules/yallist/dist/esm/package.json +0 -3
- package/node_modules/yallist/package.json +0 -68
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { BrotliOptions, ZlibOptions, ZstdOptions } from 'node:zlib';
|
|
2
|
+
import * as core from '../index.js';
|
|
3
|
+
import { type FileOption, type NoFileOption, type WithAliases } from '../dealias.js';
|
|
4
|
+
import type { PackInput, PackInputSync } from '../pack.js';
|
|
5
|
+
import type { ReadEntry, ReadEntrySync } from '../read-entry.js';
|
|
6
|
+
export * from '../index.js';
|
|
7
|
+
export { TarReaderSync } from '../entries.js';
|
|
8
|
+
export { PackSync } from '../pack.js';
|
|
9
|
+
export { ReadEntrySync } from '../read-entry.js';
|
|
10
|
+
export { UnpackSync } from '../unpack.js';
|
|
11
|
+
export { zlibCodecs, codecStream, type ZlibModule } from './codecs.js';
|
|
12
|
+
/** Each member of the option type `T`, with `fs` and `cwd` optional. */
|
|
13
|
+
export type Loose<T> = T extends unknown ? Omit<T, 'fs' | 'cwd'> & Partial<Pick<T, Extract<keyof T, 'fs' | 'cwd'>>> : never;
|
|
14
|
+
/** The compression options, with the option types of `node:zlib`. */
|
|
15
|
+
export type Zip = {
|
|
16
|
+
/** Compress with gzip. An object is the options of `zlib.createGzip`. */
|
|
17
|
+
gzip?: boolean | ZlibOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Compress with brotli. An object is the options of
|
|
20
|
+
* `zlib.createBrotliCompress`.
|
|
21
|
+
*/
|
|
22
|
+
brotli?: boolean | BrotliOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Compress with zstd. An object is the options of
|
|
25
|
+
* `zlib.createZstdCompress`.
|
|
26
|
+
*/
|
|
27
|
+
zstd?: boolean | ZstdOptions;
|
|
28
|
+
};
|
|
29
|
+
/** `Loose<T>`, with the compression options of `Zip`. */
|
|
30
|
+
export type Packing<T> = Omit<Loose<T>, keyof Zip> & Zip;
|
|
31
|
+
/** The options of `entries`. */
|
|
32
|
+
export type ReadOptions = core.ReadOptions;
|
|
33
|
+
/** The options of `entriesSync`. */
|
|
34
|
+
export type ReadOptionsSync = core.ReadOptionsSync;
|
|
35
|
+
/** The options of `list`. Set `input` or `file`. */
|
|
36
|
+
export type ListOptions = Loose<core.ListOptions>;
|
|
37
|
+
/** The options of `listSync`. Set `input` or `file`. */
|
|
38
|
+
export type ListOptionsSync = Loose<core.ListOptionsSync>;
|
|
39
|
+
/** The options of `extract`. The default of `cwd` is `process.cwd()`. */
|
|
40
|
+
export type ExtractOptions = Loose<core.ExtractOptions>;
|
|
41
|
+
/** The options of `extractSync`. */
|
|
42
|
+
export type ExtractOptionsSync = Loose<core.ExtractOptionsSync>;
|
|
43
|
+
/** The options of `create`. The default of `cwd` is `process.cwd()`. */
|
|
44
|
+
export type CreateOptions = Packing<core.CreateOptions>;
|
|
45
|
+
/** The options of `createSync`. */
|
|
46
|
+
export type CreateOptionsSync = Packing<core.CreateOptionsSync>;
|
|
47
|
+
/** The options of `replace` and `update`. */
|
|
48
|
+
export type ReplaceOptions = Packing<core.ReplaceOptions>;
|
|
49
|
+
/** The options of `replaceSync` and `updateSync`. */
|
|
50
|
+
export type ReplaceOptionsSync = Packing<core.ReplaceOptionsSync>;
|
|
51
|
+
/** The options of `delete`. */
|
|
52
|
+
export type DeleteOptions = Loose<core.DeleteOptions>;
|
|
53
|
+
/** The options of `deleteSync`. */
|
|
54
|
+
export type DeleteOptionsSync = Loose<core.DeleteOptionsSync>;
|
|
55
|
+
/**
|
|
56
|
+
* Read the entries of an archive. Gzip, brotli, and zstd input is
|
|
57
|
+
* decompressed, if the runtime has the format.
|
|
58
|
+
*/
|
|
59
|
+
export declare const entries: (input: core.TarInput, opt?: ReadOptions) => AsyncIterableIterator<ReadEntry, undefined>;
|
|
60
|
+
/** The sync form of `entries`. */
|
|
61
|
+
export declare const entriesSync: (input: core.TarInputSync, opt?: ReadOptionsSync) => IterableIterator<ReadEntrySync, undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* Call `opt.onEntry` with each entry of an archive. If `files` is
|
|
64
|
+
* set, only with the entries that it lists, and the entries in the
|
|
65
|
+
* directories that it lists.
|
|
66
|
+
*/
|
|
67
|
+
export declare const list: (opt: WithAliases<ListOptions>, files?: string[]) => Promise<void>;
|
|
68
|
+
/** The sync form of `list`. */
|
|
69
|
+
export declare const listSync: (opt: WithAliases<ListOptionsSync>, files?: string[]) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Extract the entries of an archive into the directory `opt.cwd`.
|
|
72
|
+
* If `files` is set, only the entries that it lists, and the entries
|
|
73
|
+
* in the directories that it lists.
|
|
74
|
+
*/
|
|
75
|
+
export declare const extract: (opt: WithAliases<ExtractOptions>, files?: string[]) => Promise<void>;
|
|
76
|
+
/** The sync form of `extract`. */
|
|
77
|
+
export declare const extractSync: (opt: WithAliases<ExtractOptionsSync>, files?: string[]) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Make an archive of the files. With `opt.file`, the archive is
|
|
80
|
+
* written to that path. With no `opt.file`, the result is a stream
|
|
81
|
+
* of the bytes of the archive.
|
|
82
|
+
*/
|
|
83
|
+
export declare function create(opt: WithAliases<CreateOptions> & FileOption, files: PackInput[]): Promise<void>;
|
|
84
|
+
export declare function create(opt: WithAliases<CreateOptions> & NoFileOption, files: PackInput[]): ReadableStream<Uint8Array>;
|
|
85
|
+
export declare function create(opt: WithAliases<CreateOptions>, files: PackInput[]): Promise<void> | ReadableStream<Uint8Array>;
|
|
86
|
+
/**
|
|
87
|
+
* The sync form of `create`. With no `opt.file`, the result is an
|
|
88
|
+
* iterator of the bytes of the archive.
|
|
89
|
+
*/
|
|
90
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync> & FileOption, files: PackInputSync[]): void;
|
|
91
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync> & NoFileOption, files: PackInputSync[]): IterableIterator<Uint8Array, undefined>;
|
|
92
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync>, files: PackInputSync[]): void | IterableIterator<Uint8Array, undefined>;
|
|
93
|
+
/** Add the files to the end of an archive file that is not compressed. */
|
|
94
|
+
export declare const replace: (opt: WithAliases<ReplaceOptions>, files: PackInput[]) => Promise<void>;
|
|
95
|
+
/** The sync form of `replace`. */
|
|
96
|
+
export declare const replaceSync: (opt: WithAliases<ReplaceOptionsSync>, files: PackInputSync[]) => void;
|
|
97
|
+
/**
|
|
98
|
+
* The same as `replace`, but a file is added only if it is newer than
|
|
99
|
+
* the last entry of the archive that has its path. A directory is
|
|
100
|
+
* always added, and each path in it is checked.
|
|
101
|
+
*/
|
|
102
|
+
export declare const update: (opt: WithAliases<ReplaceOptions>, files: PackInput[]) => Promise<void>;
|
|
103
|
+
/** The sync form of `update`. */
|
|
104
|
+
export declare const updateSync: (opt: WithAliases<ReplaceOptionsSync>, files: PackInputSync[]) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Remove entries from an archive file: each entry that `files` lists,
|
|
107
|
+
* and each entry in a directory that it lists. With `opt.filter`,
|
|
108
|
+
* only if the filter also returns true.
|
|
109
|
+
*/
|
|
110
|
+
declare const del: (opt: WithAliases<DeleteOptions>, files?: string[]) => Promise<void>;
|
|
111
|
+
/** The sync form of `delete`. */
|
|
112
|
+
export declare const deleteSync: (opt: WithAliases<DeleteOptionsSync>, files?: string[]) => void;
|
|
113
|
+
export { del as delete };
|
|
114
|
+
export { create as c, extract as x, list as t, replace as r, update as u };
|
|
115
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// The entry point for Node.js, and for each runtime that has the
|
|
2
|
+
// `node:` modules. It has all that the core entry point has. Each
|
|
3
|
+
// command gets defaults for the options that the core cannot know:
|
|
4
|
+
// the file system, the working directory, the platform, the user of
|
|
5
|
+
// the process, and the codecs of `node:zlib`. It adds the sync
|
|
6
|
+
// commands.
|
|
7
|
+
import * as nodeFs from 'node:fs';
|
|
8
|
+
import * as nodeFsPromises from 'node:fs/promises';
|
|
9
|
+
import { resolve } from 'node:path';
|
|
10
|
+
import * as core from '../index.js';
|
|
11
|
+
import { createSync as coreCreateSync } from '../create.js';
|
|
12
|
+
import { deleteSync as coreDeleteSync } from '../delete.js';
|
|
13
|
+
import { dealias, } from '../dealias.js';
|
|
14
|
+
import { entriesSync as coreEntriesSync } from '../entries.js';
|
|
15
|
+
import { extractSync as coreExtractSync } from '../extract.js';
|
|
16
|
+
import { listSync as coreListSync } from '../list.js';
|
|
17
|
+
import { replaceSync as coreReplaceSync } from '../replace.js';
|
|
18
|
+
import { updateSync as coreUpdateSync } from '../update.js';
|
|
19
|
+
import { zlibCodecs } from './codecs.js';
|
|
20
|
+
export * from '../index.js';
|
|
21
|
+
export { TarReaderSync } from '../entries.js';
|
|
22
|
+
export { PackSync } from '../pack.js';
|
|
23
|
+
export { ReadEntrySync } from '../read-entry.js';
|
|
24
|
+
export { UnpackSync } from '../unpack.js';
|
|
25
|
+
export { zlibCodecs, codecStream } from './codecs.js';
|
|
26
|
+
const fs = nodeFsPromises;
|
|
27
|
+
const fsSync = nodeFs;
|
|
28
|
+
const platform = process.platform === 'win32' ? 'win32' : 'posix';
|
|
29
|
+
const codecs = zlibCodecs();
|
|
30
|
+
// A copy of the options, with the name of the option in place of
|
|
31
|
+
// each alias, and a default for each option that is not set. `T` is
|
|
32
|
+
// the option type of the core command.
|
|
33
|
+
const fill = (options, fs, paths) => {
|
|
34
|
+
const opt = dealias(options);
|
|
35
|
+
opt.fs ??= fs;
|
|
36
|
+
opt.platform ??= platform;
|
|
37
|
+
opt.codecs = [...(opt.codecs ?? []), ...codecs];
|
|
38
|
+
// A command that reads an archive, and writes no file, does not
|
|
39
|
+
// need the working directory or the user.
|
|
40
|
+
if (paths) {
|
|
41
|
+
// `resolve` adds `process.cwd()` to a relative path.
|
|
42
|
+
opt.cwd = resolve(opt.cwd ?? '');
|
|
43
|
+
opt.processUid ??= process.getuid?.();
|
|
44
|
+
opt.processGid ??= process.getgid?.();
|
|
45
|
+
opt.processUname ??= process.env.USER;
|
|
46
|
+
if (opt.chmod)
|
|
47
|
+
opt.processUmask ??= process.umask();
|
|
48
|
+
}
|
|
49
|
+
return opt;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Read the entries of an archive. Gzip, brotli, and zstd input is
|
|
53
|
+
* decompressed, if the runtime has the format.
|
|
54
|
+
*/
|
|
55
|
+
export const entries = (input, opt = {}) => core.entries(input, fill(opt, fs, false));
|
|
56
|
+
/** The sync form of `entries`. */
|
|
57
|
+
export const entriesSync = (input, opt = {}) => coreEntriesSync(input, fill(opt, fsSync, false));
|
|
58
|
+
/**
|
|
59
|
+
* Call `opt.onEntry` with each entry of an archive. If `files` is
|
|
60
|
+
* set, only with the entries that it lists, and the entries in the
|
|
61
|
+
* directories that it lists.
|
|
62
|
+
*/
|
|
63
|
+
export const list = (opt, files) => core.list(fill(opt, fs, false), files);
|
|
64
|
+
/** The sync form of `list`. */
|
|
65
|
+
export const listSync = (opt, files) => coreListSync(fill(opt, fsSync, false), files);
|
|
66
|
+
/**
|
|
67
|
+
* Extract the entries of an archive into the directory `opt.cwd`.
|
|
68
|
+
* If `files` is set, only the entries that it lists, and the entries
|
|
69
|
+
* in the directories that it lists.
|
|
70
|
+
*/
|
|
71
|
+
export const extract = (opt, files) => core.extract(fill(opt, fs, true), files);
|
|
72
|
+
/** The sync form of `extract`. */
|
|
73
|
+
export const extractSync = (opt, files) => coreExtractSync(fill(opt, fsSync, true), files);
|
|
74
|
+
export function create(opt, files) {
|
|
75
|
+
return core.create(fill(opt, fs, true), files);
|
|
76
|
+
}
|
|
77
|
+
export function createSync(opt, files) {
|
|
78
|
+
return coreCreateSync(fill(opt, fsSync, true), files);
|
|
79
|
+
}
|
|
80
|
+
/** Add the files to the end of an archive file that is not compressed. */
|
|
81
|
+
export const replace = (opt, files) => core.replace(fill(opt, fs, true), files);
|
|
82
|
+
/** The sync form of `replace`. */
|
|
83
|
+
export const replaceSync = (opt, files) => coreReplaceSync(fill(opt, fsSync, true), files);
|
|
84
|
+
/**
|
|
85
|
+
* The same as `replace`, but a file is added only if it is newer than
|
|
86
|
+
* the last entry of the archive that has its path. A directory is
|
|
87
|
+
* always added, and each path in it is checked.
|
|
88
|
+
*/
|
|
89
|
+
export const update = (opt, files) => core.update(fill(opt, fs, true), files);
|
|
90
|
+
/** The sync form of `update`. */
|
|
91
|
+
export const updateSync = (opt, files) => coreUpdateSync(fill(opt, fsSync, true), files);
|
|
92
|
+
/**
|
|
93
|
+
* Remove entries from an archive file: each entry that `files` lists,
|
|
94
|
+
* and each entry in a directory that it lists. With `opt.filter`,
|
|
95
|
+
* only if the filter also returns true.
|
|
96
|
+
*/
|
|
97
|
+
const del = (opt, files) => core.delete(fill(opt, fs, false), files);
|
|
98
|
+
/** The sync form of `delete`. */
|
|
99
|
+
export const deleteSync = (opt, files) => coreDeleteSync(fill(opt, fsSync, false), files);
|
|
100
|
+
export { del as delete };
|
|
101
|
+
export { create as c, extract as x, list as t, replace as r, update as u };
|
|
102
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Ti=Object.defineProperty;var zi=(i,e)=>{for(var t in e)Ti(i,t,{get:e[t],enumerable:!0})};import*as Ns from"node:fs";import*as Ls from"node:fs/promises";import{resolve as Us}from"node:path";var E=i=>ArrayBuffer.isView(i)&&i[Symbol.toStringTag]==="Uint8Array",it=i=>Object.prototype.toString.call(i)==="[object ArrayBuffer]",L=i=>typeof i?.size=="number"&&typeof i.stream=="function",Pe=i=>typeof i?.getReader=="function",Oi=new TextDecoder("utf-8",{ignoreBOM:!0}),Pi=new TextEncoder,A=i=>{let e=i.length;for(let t=0;t<i.length;t++){let s=i.charCodeAt(t);s<128||(s<2048?e+=1:s>=55296&&s<=56319&&(i.charCodeAt(t+1)&64512)===56320?(e+=2,t++):e+=2)}return e},U=(i,e=0,t=i.length)=>{let s="";for(let n=e;n<t;n++){let r=i[n];if(r>=128)return Oi.decode(i.subarray(e,t));s+=String.fromCharCode(r)}return s},Fe=(i,e,t,s)=>{let{written:n}=Pi.encodeInto(i,e.subarray(t,t+s));e.fill(0,t+n,t+s)},st=(i,e,t)=>{for(let s=0;s<i.length;s++)e[t+s]=i.charCodeAt(s)};var vt=(i,e)=>{if(Number.isSafeInteger(i))i<0?Ni(i,e):Fi(i,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Fi=(i,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=i&255,i=Math.floor(i/256)},Ni=(i,e)=>{e[0]=255;var t=!1;i=i*-1;for(var s=e.length;s>1;s--){var n=i&255;i=Math.floor(i/256),t?e[s-1]=Rt(n):n===0?e[s-1]=0:(t=!0,e[s-1]=At(n))}},Et=i=>{let e=i[0],t=e===128?Ui(i.subarray(1,i.length)):e===255?Li(i):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},Li=i=>{for(var e=i.length,t=0,s=!1,n=e-1;n>-1;n--){var r=Number(i[n]),o;s?o=Rt(r):r===0?o=r:(s=!0,o=At(r)),o!==0&&(t-=o*Math.pow(256,e-n-1))}return t},Ui=i=>{for(var e=i.length,t=0,s=e-1;s>-1;s--){var n=Number(i[s]);n!==0&&(t+=n*Math.pow(256,e-s-1))}return t},Rt=i=>(255^i)&255,At=i=>(255^i)+1&255;var he=i=>{let e=i.charCodeAt(0)===47,t=[];for(let r of i.split("/"))r===""||r==="."||(r!==".."?t.push(r):t.length&&t[t.length-1]!==".."?t.pop():e||t.push(r));let s=t.length&&i.charCodeAt(i.length-1)===47,n=t.join("/")+(s?"/":"");return e?"/"+n:n||(i.endsWith("/")?"./":".")},W=(...i)=>he(i.filter(e=>e).join("/")),O=i=>{let e=i.length;for(;e>1&&i.charCodeAt(e-1)===47;)e--;let t=i.lastIndexOf("/",e-1);return t===-1?".":t===0?"/":t===1&&i.charCodeAt(0)===47?"//":i.slice(0,t)},le=i=>{let e=i.length;for(;e>0&&i.charCodeAt(e-1)===47;)e--;return i.slice(i.lastIndexOf("/",e-1)+1,e)},ie=i=>i.charCodeAt(0)===47,C=(...i)=>{let e="";for(let s=i.length-1;s>=0&&!ie(e);s--){let n=i[s];n&&(e=e?n+"/"+e:n)}let t=he(e);return t.length>1&&t.endsWith("/")?t.slice(0,-1):t},D=(i,e)=>{let t=C(i).split("/"),s=C(e).split("/");t[t.length-1]||t.pop(),s[s.length-1]||s.pop();let n=0;for(;n<t.length&&n<s.length&&t[n]===s[n];)n++;return[...Array.from({length:t.length-n},()=>".."),...s.slice(n)].join("/")};var nt={};zi(nt,{code:()=>Ne,isCode:()=>de,isName:()=>Di,name:()=>pe,normalFsTypes:()=>Mi});var de=i=>pe.has(i),Di=i=>Ne.has(i),Mi=new Set(["0","","1","2","3","4","5","6","7","D"]),pe=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),Ne=new Map(Array.from(pe).map(i=>[i[1],i[0]]));var _i=i=>i===void 0||i<0?void 0:i,R=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,s,n){E(e)?this.decode(e,t||0,s,n):e&&this.#t(e)}decode(e,t,s,n){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");let r=P(e,t+156,1),o=/^[xgXLK]$/.test(r),a=o?void 0:s,c=o?void 0:n;if(this.path=a?.path??P(e,t,100),this.mode=a?.mode??c?.mode??_(e,t+100,8),this.uid=a?.uid??c?.uid??_(e,t+108,8),this.gid=a?.gid??c?.gid??_(e,t+116,8),this.size=_i(a?.size??$i(e,t+124)),this.mtime=a?.mtime??c?.mtime??rt(e,t+136,12),this.cksum=_(e,t+148,12),c&&this.#t(c,!0),a&&this.#t(a),de(r)&&(this.#e=r||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=P(e,t+157,100),U(e,t+257,t+265)==="ustar\x0000")if(this.uname=a?.uname??c?.uname??P(e,t+265,32),this.gname=a?.gname??c?.gname??P(e,t+297,32),this.devmaj=a?.devmaj??c?.devmaj??_(e,t+329,8)??0,this.devmin=a?.devmin??c?.devmin??_(e,t+337,8)??0,e[t+475]!==0){let l=P(e,t+345,155);this.path=l+"/"+this.path}else{let l=P(e,t+345,130);l&&(this.path=l+"/"+this.path),this.atime=s?.atime??n?.atime??rt(e,t+476,12),this.ctime=s?.ctime??n?.ctime??rt(e,t+488,12)}let h=256;for(let l=t;l<t+148;l++)h+=e[l];for(let l=t+156;l<t+512;l++)h+=e[l];this.cksumValid=h===this.cksum,this.cksum===void 0&&h===256&&(this.nullBlock=!0)}#t(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([s,n])=>!(n==null||s==="size"&&(t||Number(n)<0)||s==="path"&&t||s==="linkpath"&&t||s==="global"))))}encode(e,t=0){if(e||(e=this.block=new Uint8Array(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,n=Ii(this.path||"",s),r=n[0],o=n[1];this.needPax=!!n[2],this.needPax=G(e,t,100,r)||this.needPax,this.needPax=M(e,t+100,8,this.mode)||this.needPax,this.needPax=M(e,t+108,8,this.uid)||this.needPax,this.needPax=M(e,t+116,8,this.gid)||this.needPax,this.needPax=M(e,t+124,12,this.size)||this.needPax,this.needPax=ot(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=G(e,t+157,100,this.linkpath)||this.needPax,st("ustar\x0000",e,t+257),this.needPax=G(e,t+265,32,this.uname)||this.needPax,this.needPax=G(e,t+297,32,this.gname)||this.needPax,this.needPax=M(e,t+329,8,this.devmaj)||this.needPax,this.needPax=M(e,t+337,8,this.devmin)||this.needPax,this.needPax=G(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=G(e,t+345,155,o)||this.needPax:(this.needPax=G(e,t+345,130,o)||this.needPax,this.needPax=ot(e,t+476,12,this.atime)||this.needPax,this.needPax=ot(e,t+488,12,this.ctime)||this.needPax);let a=256;for(let c=t;c<t+148;c++)a+=e[c];for(let c=t+156;c<t+512;c++)a+=e[c];return this.cksum=a,M(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:pe.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Ne.get(e));if(de(t)||t==="Unsupported")this.#e=t;else if(de(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}},Ii=(i,e)=>{let s=i,n="",r,o=i.charAt(0)==="/"?"/":".";if(A(s)<100)r=[s,n,!1];else{n=O(s),s=le(s);do A(s)<=100&&A(n)<=e?r=[s,n,!1]:A(s)>100&&A(n)<=e?r=[s.slice(0,99),n,!0]:(s=W(le(n),s),n=O(n));while(n!==o&&r===void 0);r||(r=[i.slice(0,99),"",!0])}return r},P=(i,e,t)=>{let s=e,n=Math.min(e+t,i.length);for(;s<n&&i[s]!==0;)s++;return U(i,e,s)},rt=(i,e,t)=>Bi(_(i,e,t)),Bi=i=>i===void 0?void 0:new Date(i*1e3),_=(i,e,t)=>Number(i[e])&128?Hi(i.subarray(e,e+t)):Wi(i,e,t),Hi=i=>{try{return Et(i)}catch{return}},$i=(i,e)=>{if(Number(i[e])&128)return _(i,e,12);let t=P(i,e,12);return/^ *[0-7]* *$/.test(t)&&i.subarray(e+t.length,e+12).every(s=>s===0)?parseInt(t,8)||0:void 0},ji=i=>isNaN(i)?void 0:i,Wi=(i,e,t)=>ji(parseInt(P(i,e,t).trim(),8)),Gi={12:8589934591,8:2097151},M=(i,e,t,s)=>s===void 0?!1:s>Gi[t]||s<0?(vt(s,i.subarray(e,e+t)),!0):(Yi(i,e,t,s),!1),Yi=(i,e,t,s)=>st(qi(s,t),i,e),qi=(i,e)=>Vi(Math.floor(i).toString(8),e),Vi=(i,e)=>(i.length===e-1?i:"0".repeat(e-i.length-2)+i+" ")+"\0",ot=(i,e,t,s)=>s===void 0?!1:M(i,e,t,s.getTime()/1e3),G=(i,e,t,s)=>s===void 0?!1:(Fe(s,i,e,t),s.length!==A(s)||s.length>t);var Tt=/^\d+$/,Y=class i{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return new Uint8Array(0);let t=A(e),s=512*Math.ceil(1+t/512),n=new Uint8Array(s);return new R({path:("PaxHeader/"+le(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(n),Fe(e,n,512,t),n}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],s=typeof t=="object"?t.getTime()/1e3:t,n=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+s+`
|
|
2
|
+
`,r=A(n),o=Math.floor(Math.log(r)/Math.log(10))+1;return r+o>=Math.pow(10,o)&&(o+=1),o+r+n}static parse(e,t,s=!1){return i.parseBytes(new TextEncoder().encode(e),t,s)}static parseBytes(e,t,s=!1){return new i(Xi(Ki(e),t),s)}},Xi=(i,e)=>e?Object.assign({},e,i):i,Ki=i=>{let e=Object.create(null),t=0;for(;t<i.length&&i[t]!==0;){let s=t;for(;s<i.length&&i[s]>=48&&i[s]<=57;)s++;let n=t+Number(U(i,t,s));if(s===t||i[s]!==32||n<=s+1||n>i.length||i[n-1]!==10)throw new Error("invalid PAX record");Zi(e,U(i,s+1,n-1)),t=n}return e},Zi=(i,e)=>{let t=e.split("=");if(t.length===1)throw new Error("invalid PAX record");let s=t.shift();if(!s)return i;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),r=t.join("="),o=r.indexOf("\0"),a=o===-1?r:r.slice(0,o);switch(n){case"path":case"linkpath":case"type":case"charset":case"comment":case"gname":case"uname":i[n]=a;break;case"ctime":case"atime":case"mtime":let c=new Date(Number(a)*1e3);isNaN(c.getTime())||(i[n]=c);break;case"size":if(!Tt.test(r)||!Number.isSafeInteger(+r))throw new Error("invalid PAX size");i[n]=+r;break;case"gid":case"uid":case"dev":case"ino":case"nlink":case"mode":if(!Tt.test(a.trim()))break;let h=+a;if(!Number.isSafeInteger(h))break;i[n]=h;break}return i};var T={name:"gzip",headLength:2,detect:i=>i[0]===31&&i[1]===139,decompress:()=>new DecompressionStream("gzip"),compress:i=>{let e=new CompressionStream("gzip");if(!i?.portable)return e;let t=0;return{writable:e.writable,readable:e.readable.pipeThrough(new TransformStream({transform:(s,n)=>{t<=9&&t+s.length>9&&(s[9-t]=255),t+=s.length,n.enqueue(s)}}))}}};var zt={C:"cwd",f:"file",z:"gzip",P:"preservePaths",U:"unlink","strip-components":"strip",stripComponents:"strip","keep-newer":"newer",keepNewer:"newer","keep-newer-files":"newer",keepNewerFiles:"newer",k:"keep","keep-existing":"keep",keepExisting:"keep",m:"noMtime","no-mtime":"noMtime",p:"preserveOwner",L:"follow",h:"follow",onentry:"onEntry",onReadEntry:"onEntry"},y=i=>{let e=Object.assign(Object.create(null),i);for(let[t,s]of Object.entries(zt))e[t]!==void 0&&(e[s]??=e[t]),delete e[t];return e.noChmod===!1&&(e.chmod??=!0),delete e.noChmod,e};var F=i=>{if(i.length===1)return i[0].slice();let e=0;for(let n of i)e+=n.length;let t=new Uint8Array(e),s=0;for(let n of i)t.set(n,s),s+=n.length;return t};var k=(i,e)=>Object.assign(Object.create(null),i,e),q=(i,e,t)=>{if(e==null||e===0)return t;if(e===1/0||Number.isInteger(e)&&Number(e)>0)return e;throw new TypeError(`${i} must be a positive integer`)};var Ji=new Set(["File","OldFile","Link","SymbolicLink","CharacterDevice","BlockDevice","Directory","FIFO","ContiguousFile","GNUDumpDir"]),Le=i=>i.replaceAll("\\","/"),V=class{header;extended;globalExtended;type;path;mode;uid;gid;uname;gname;size;mtime;atime;ctime;linkpath;devmaj;devmin;dev;ino;nlink;absolute;ignore;invalid=!1;unsupported=!1;constructor(e,t,s,n=!1){if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.header=e,this.extended=t,this.globalExtended=s,this.type=e.type,this.ignore=!Ji.has(this.type),this.path=n?Le(e.path):e.path,this.mode=e.mode&&e.mode&4095,this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size??0,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime;let r=this.type==="Link"||this.type==="SymbolicLink";this.linkpath=r&&e.linkpath?n?Le(e.linkpath):e.linkpath:void 0,this.devmaj=e.devmaj,this.devmin=e.devmin,s&&this.#e(s),t&&(this.#e(t),t.path!=null&&(this.path=n?Le(t.path):t.path),r&&t.linkpath!=null&&(this.linkpath=n?Le(t.linkpath):t.linkpath))}#e(e){e.uid!=null&&(this.uid=e.uid),e.gid!=null&&(this.gid=e.gid),e.uname!=null&&(this.uname=e.uname),e.gname!=null&&(this.gname=e.gname),e.mtime!=null&&(this.mtime=e.mtime),e.atime!=null&&(this.atime=e.atime),e.ctime!=null&&(this.ctime=e.ctime),e.dev!=null&&(this.dev=e.dev),e.ino!=null&&(this.ino=e.ino),e.nlink!=null&&(this.nlink=e.nlink)}},Ot=new TextDecoder,Pt=i=>{let e="";for(let t of i)e+=Ot.decode(t,{stream:!0});return e+Ot.decode()},Ft=()=>new TypeError("Body has already been consumed"),fe=class extends V{#e;#t=!1;#i;constructor(e,t,s,n,r){super(e,t,s,n),this.#e=r}get bodyUsed(){return this.#t}get body(){if(this.#i)return this.#i;let e=!1;return this.#i=new ReadableStream({pull:async t=>{e||(this.#s(),e=!0);let[s]=await this.#n(1);s?t.enqueue(s):t.close()}},{highWaterMark:0})}#s(){if(this.#t)throw Ft();this.#t=!0}#r(e,t=1/0){let s=this.#e;for(;s&&e.length<t;){let n=s.readBody(this);if(n===null)break;if(n===void 0)return!1;e.push(n)}return!0}async#n(e){let t=[];for(;!this.#r(t,e);)await this.#e?.fill();return t}async bytes(){this.#s();let e=[];for(;!this.#r(e);)await this.#e?.fill();return F(e)}async arrayBuffer(){return(await this.bytes()).buffer}async text(){return this.#s(),Pt(await this.#n())}async blob(){return this.#s(),new Blob(await this.#n())}},ue=class extends V{#e;#t=!1;#i;constructor(e,t,s,n,r){super(e,t,s,n),this.#e=r}get bodyUsed(){return this.#t}get body(){return this.#i??=this.#s()}*#s(){this.#r();for(let e;e=this.#e?.readBody(this);)yield e}#r(){if(this.#t)throw Ft();this.#t=!0}#n(){this.#r();let e=[];for(let t;t=this.#e?.readBody(this);)e.push(t);return e}bytes(){return F(this.#n())}arrayBuffer(){return this.bytes().buffer}text(){return Pt(this.#n())}};var Nt=(i,e,t,s)=>(i.file&&(s.file=i.file),s.code=typeof t=="object"&&t.code||e,s.tarCode=e,s),me=(i,e,t,s={})=>Object.assign(typeof t=="object"?t:new Error(`${e}: ${t}`),Nt(i,e,t,s)),S=(i,e,t,s={})=>{let n=Object.hasOwn(s,"recoverable")&&s.recoverable===!1;if(i.strict||n)throw me(i,e,t,s);Nt(i,e,t,s),typeof t=="object"&&(s=Object.assign(t,s),t=t.message),i.onwarn?.(e,t,s)};var Lt=0,X=1,Ue=2,Ce=3,Ut=4,at={type:"entryEnd"},Qi={type:"end"},es=new Set(["ExtendedHeader","OldExtendedHeader","GlobalExtendedHeader","NextFileHasLongPath","NextFileHasLongLinkpath"]),ts=new Set(["Link","SymbolicLink","CharacterDevice","BlockDevice","FIFO","TapeVolumeHeader"]),Ct=i=>{let e=i.indexOf(0);return U(i,0,e===-1?i.length:e)},I=class{maxMetaEntrySize;position=0;offset=0;#e;#t;#i;#s=[];#r;#n=0;#a;#o=0;#c=Lt;#h;#d;#w;#x=0;#p=0;#l=0;#f;#y;#v;#E;#k=!1;#g;#S=!1;#u=!1;#b=0;constructor(e={},t){e=this.#e=k(e),this.maxMetaEntrySize=e.maxMetaEntrySize||1024*1024,this.#t=e.filter;let s=e.platform==="win32";this.#i=t??((n,r,o)=>new V(n,r,o,s))}warn(e,t,s){S(this.#e,e,t,s)}push(e){this.#k||this.#s.push(e)}end(){this.#k=!0}get bodyRemain(){let e=this.#r,t=this.#c;return t!==Ue&&t!==Ce||this.#s.length||e&&this.#n<e.length?0:this.#l}skipBody(){this.#u=this.#c===Ue,this.offset+=this.#l,this.#p=this.#l=0,this.#R()}next(){if(this.#u)return this.#u=!1,at;for(;;){let e=this.#r,t=this.#n;if(!e||t===e.length){if(e=this.#r=this.#s.shift(),t=this.#n=0,!e){if(!this.#k||this.#b===2)return;let l=this.#z();if(l)return l}continue}let s=e.length-t,n=this.#c;if(n<=X){let l;if(this.#o===0&&s>=512)this.#n=t+512,l=this.#T(e,t);else{let d=this.#a??=new Uint8Array(512),p=Math.min(512-this.#o,s);if(d.set(e.subarray(t,t+p),this.#o),this.#n=t+p,this.#o+=p,this.#o<512)continue;this.#o=0,l=this.#T(d,0)}if(l)return l;continue}let r=this.#l,o=s<r?s:r,a=this.#p,c=o<a?o:a;this.#n=t+o,this.offset+=o,this.#l=r-o,this.#p=a-c;let h=o===r;if(n===Ut){let l=this.#w;l.set(e.subarray(t,t+c),this.#x),this.#x+=c,h&&(this.#R(),this.#O(l));continue}if(h&&this.#R(),n!==Ce){if(c===0){if(h)return at;continue}return this.#u=h,{type:"body",data:c===e.length?e:e.subarray(t,t+c)}}}}#R(){let e=this.#h;e&&(this.position=this.offset,this.#h=void 0),!e?.invalid&&!this.#S&&(this.#g=!0),this.#S=!1,this.#c=X}#z(){let e=this.#c;if(e>X){let t=this.#h,s=(512-this.#l%512)%512,n=this.#l+s;this.#h=void 0,this.#w=void 0,this.#c=X,!t?.invalid&&!this.#S&&(this.#g=!0),this.#S=!1,this.#u=e===Ue,this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${n} more bytes, only ${s} available)`,{entry:t,header:this.#d});return}return this.#u?(this.#u=!1,at):(this.#b===0&&(this.#b=1,(e===Lt||this.#g===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")),this.#b=2,Qi)}#T(e,t){this.offset+=512,this.#g===void 0&&(this.#g=!1);let s=this.#f,n=this.#y,r=this.#v;(n!==void 0||r!==void 0)&&(s=Object.assign(Object.create(null),s),s.path??=n,s.linkpath??=r);let o=new R(e,t,s,this.#E);if(o.nullBlock){this.#k=!0,this.#r=void 0,this.#s.length=0,this.#o=0,this.#c=X;return}let a=o.type,c=es.has(a);if(!o.cksumValid){this.#A(o,"checksum failure",!1);return}let h=o.size;if(h===void 0&&this.#m("invalid size",o),(h&&ts.has(a)||a==="Directory"&&s?.size)&&this.#m(`${a} entry with a body`,o),!o.path&&!c){this.#A(o,"path is required",!0);return}if((a==="Link"||a==="SymbolicLink")&&!(s?.linkpath??o.linkpath)){this.#A(o,"linkpath required",!0);return}if(this.#d=o,this.#p=h,this.#l=512*Math.ceil(h/512),h||(this.#g=!0),c){h>this.maxMetaEntrySize&&this.#m(`${a} entry larger than maxMetaEntrySize`,o),(a==="NextFileHasLongPath"?n!==void 0:a==="NextFileHasLongLinkpath"?r!==void 0:a!=="GlobalExtendedHeader"&&this.#f)&&this.#m(`two ${a} entries for one entry`,o),this.#f&&a.startsWith("NextFile")&&this.#m(`${a} entry after a PAX header`,o),h>0&&(this.#w=new Uint8Array(h),this.#x=0,this.#c=Ut);return}this.#f=this.#y=this.#v=void 0;let l=this.#i(o,s,this.#E);return!l.ignore&&this.#t&&!this.#t(l.path,l)&&(l.ignore=!0),h?(this.#h=l,this.#c=l.ignore?Ce:Ue):(this.#c=X,this.position=this.offset,this.#u=!l.ignore),{type:"entry",entry:l}}#A(e,t,s){this.#f=this.#y=this.#v=void 0;let n=s?e.size:0;n&&(this.#d=e,this.#p=n,this.#l=512*Math.ceil(n/512),this.#c=Ce,this.#S=!0),this.warn("TAR_ENTRY_INVALID",t,{header:e})}#m(e,t){throw this.#k=!0,this.#r=this.#w=void 0,this.#s.length=0,this.#o=0,this.#c=X,this.#b=2,me(this.#e,"TAR_BAD_ARCHIVE",e,{header:t,recoverable:!1})}#O(e){let t=this.#d,s=t.type;if(s==="NextFileHasLongPath"){this.#y=Ct(e);return}if(s==="NextFileHasLongLinkpath"){this.#v=Ct(e);return}let n=s==="GlobalExtendedHeader",r;try{r=Y.parseBytes(e,n?this.#E:void 0,n)}catch(o){this.#m(o.message,t)}if(!n){this.#f=r;return}(r.size!==void 0||r.path!==void 0||r.linkpath!==void 0)&&this.#m("size or path in a global PAX header",t),this.#E=r}};var is=16*1024*1024,Dt=64*1024,ss=1024*1024,Me=Symbol.for("tar.readFile.skip"),De=class{pos=0;size=0;#e;#t=Dt;constructor(e){this.#e=q("maxReadSize",e,is)}next(){let e=Math.min(this.#t,this.#e,this.size-this.pos);return this.#t*=2,e}skip(e){return e<ss||this.pos+e>this.size?!1:(this.pos+=e,this.#t=Dt,!0)}};async function*ns(i,e,t){let s=await i.open(e,"r");try{t.size=(await s.stat()).size;for(let n;n=t.next();){let r=new Uint8Array(n),{bytesRead:o}=await s.read(r,0,n,t.pos);if(!o)break;t.pos+=o,yield o<n?r.subarray(0,o):r}}finally{await s.close().catch(()=>{})}}function*rs(i,e,t){let s=i.openSync(e,"r");try{t.size=i.fstatSync(s).size;for(let n;n=t.next();){let r=new Uint8Array(n),o=i.readSync(s,r,0,n,t.pos);if(!o)break;t.pos+=o,yield o<n?r.subarray(0,o):r}}finally{try{i.closeSync(s)}catch{}}}var B=(i,e,t)=>{let s=new De(t);return Object.assign(ns(i,e,s),{[Me]:n=>s.skip(n)})},H=(i,e,t)=>{let s=new De(t);return Object.assign(rs(i,e,s),{[Me]:n=>s.skip(n)})};var ct=()=>{},ye=i=>Math.max(512,...i.map(e=>e.headLength)),os=i=>{try{let e=new R(i);return e.cksumValid||e.nullBlock}catch{return!1}},ge=(i,e,t="")=>i.find(s=>s.detect(e))??(os(e)?void 0:i.find(s=>s.extensions?.some(n=>t.endsWith(n)))),Mt=i=>typeof i.maxDecompressionRatio=="number"?i.maxDecompressionRatio:1e3,_e=(i,e)=>me(i,"TAR_ABORT",e,{recoverable:!1}),_t=(i,e,t)=>_e(i,new Error(`max decompression ratio exceeded: ${e.toFixed(2)} > ${t}`)),as=()=>new TypeError("The body of an entry cannot be read after a later entry"),we=class{parser;current;ended=!1;constructor(e){this.parser=e}entry(){if(this.current=void 0,this.ended)return null;for(let e;e=this.parser.next();){if(e.type==="end")return this.ended=!0,null;if(e.type==="entry"&&!e.entry.ignore)return this.current=e.entry}}body(e){if(e!==this.current)throw as();let t=this.parser.next();if(t)return t.type==="body"?t.data:(this.current=void 0,null)}},It=(i,e)=>{if(i.current)return;let t=i.parser.bodyRemain;t&&e[Me]?.(t)&&i.parser.skipBody()},cs=i=>{if(E(i))return[i].values();if(it(i))return[new Uint8Array(i)].values();if(L(i)&&(i=i.stream()),Pe(i)){let e=i.getReader();return{next:()=>e.read(),return:()=>e.cancel()}}return Symbol.asyncIterator in i?i[Symbol.asyncIterator]():i[Symbol.iterator]()},b=class{parser;#e;#t;#i;#s;#r;#n;#a=!1;constructor(e,t={}){t=k(t);let s=t.platform==="win32";this.parser=new I(t,(n,r,o)=>new fe(n,r,o,s,this)),this.#e=new we(this.parser),this.#t=t,this.#i=cs(e)}poll(){return this.#a?null:this.#e.entry()}readBody(e){return this.#e.body(e)}fill(){return this.#n??=this.#o()}async#o(){try{let e=this.#s??=await this.#c(this.#i),t=this.#r;this.#r=void 0,e===this.#i&&It(this.#e,e);let s=t?{value:t,done:!1}:await e.next();s.done?this.parser.end():this.parser.push(s.value)}finally{this.#n=void 0}}async#c(e){let t=this.#t,s=[...t.codecs??[],T],n=ye(s),r;for(;!r||r.length<n;){let m=await e.next();if(m.done)break;r=r?F([r,m.value]):m.value}let o=r&&ge(s,r,t.file);if(!o)return this.#r=r,e;let a=0,c=0,{readable:h,writable:l}=o.decompress(),d=l.getWriter(),p=h.getReader(),f=!1;(async()=>{try{for(;;){if(await d.ready,f)return;let m=r?{value:r,done:!1}:await e.next();if(r=void 0,f)return;if(m.done)return await d.close();a+=m.value.length,await d.write(m.value)}}catch(m){f||await d.abort(m).catch(ct)}})();let u=Mt(t);return{next:async()=>{let m=await p.read().catch(g=>{throw _e(t,g)});if(!m.done){c+=m.value.length;let g=c/a;if(g>u)throw _t(t,g,u)}return m},return:async()=>(f=!0,await p.cancel().catch(ct),await d.abort().catch(ct),await e.return?.(),{value:void 0,done:!0})}}async next(){try{for(;;){let e=this.poll();if(e)return{value:e,done:!1};if(e===null)break;await this.fill()}}catch(e){throw await this.return(),e}return this.return()}async return(){return this.#a||(this.#a=!0,this.#e.current=void 0,await(this.#s??this.#i).return?.()),{value:void 0,done:!0}}[Symbol.asyncIterator](){return this}},v=class{parser;#e;#t;#i;#s;#r;#n=!1;constructor(e,t={}){t=k(t);let s=t.platform==="win32";this.parser=new I(t,(n,r,o)=>new ue(n,r,o,s,this)),this.#e=new we(this.parser),this.#t=t,this.#i=E(e)?[e].values():it(e)?[new Uint8Array(e)].values():e[Symbol.iterator]()}readBody(e){for(;;){let t=this.#e.body(e);if(t!==void 0)return t;this.#a()}}#a(){let e=this.#s??=this.#o(this.#i),t=this.#r;this.#r=void 0,e===this.#i&&It(this.#e,e);let s=t?{value:t,done:!1}:e.next();s.done?this.parser.end():this.parser.push(s.value)}#o(e){let t=this.#t,s=[...t.codecs??[],T],n=ye(s),r,o;for(;(!r||r.length<n)&&!(o=e.next()).done;)r=r?F([r,o.value]):o.value;let a=r&&ge(s,r,t.file);if(!r||!a)return this.#r=r,e;let{decompressSync:c}=a;if(!c)throw _e(t,new Error(`the ${a.name} codec has no decompressSync function`));let h=[r];for(;!(o=e.next()).done;)h.push(o.value);let l=F(h),d=Mt(t),p;try{p=c(l,{maxOutputLength:l.length*d})}catch(w){throw _e(t,w)}let f=p.length/l.length;if(f>d)throw _t(t,f,d);return[p].values()}next(){try{for(;;){let e=this.#n?null:this.#e.entry();if(e)return{value:e,done:!1};if(e===null)break;this.#a()}}catch(e){throw this.return(),e}return this.return()}return(){return this.#n||(this.#n=!0,this.#e.current=void 0,(this.#s??this.#i).return?.()),{value:void 0,done:!0}}[Symbol.iterator](){return this}},ht=(i,e)=>new b(i,e),Bt=(i,e)=>new v(i,e);var Ht=(i,e,t)=>(i&=4095,t&&(i=(i|384)&-19),e&&(i&256&&(i|=64),i&32&&(i|=8),i&4&&(i|=1)),i);var Ie=["|","<",">","?",":"],lt=Ie.map(i=>String.fromCodePoint(61440+Number(i.codePointAt(0)))),hs=new Map(Ie.map((i,e)=>[i,lt[e]])),ls=new Map(lt.map((i,e)=>[i,Ie[e]])),dt=i=>Ie.reduce((e,t)=>e.split(t).join(hs.get(t)),i),$t=i=>lt.reduce((e,t)=>e.split(t).join(ls.get(t)),i);var K=i=>i===47||i===92,ds=i=>i>=65&&i<=90||i>=97&&i<=122,$=i=>{let e=i.length,t=0;if(K(i.charCodeAt(0))){if(t=1,K(i.charCodeAt(1))){let s=2,n=s;for(;s<e&&!K(i.charCodeAt(s));)s++;if(s<e&&s!==n){for(n=s;s<e&&K(i.charCodeAt(s));)s++;if(s<e&&s!==n){for(n=s;s<e&&!K(i.charCodeAt(s));)s++;s===e?t=s:s!==n&&(t=s+1)}}}}else ds(i.charCodeAt(0))&&i.charCodeAt(1)===58&&(t=K(i.charCodeAt(2))?3:2);return i.slice(0,t)},xe=i=>K(i.charCodeAt(0))||$(i).length===3,Be=(i,e)=>{let t=xe(e)?e:i+"/"+e,s=$(t);return s+C("/",t.slice(s.length)).slice(1)},Wt=i=>{let e=$(i),t=O(i.slice(e.length));return t==="."?e:e+t};var He=i=>{let e="";for(let t;t=$(i);)i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"&&(t="/"),i=i.slice(t.length),e+=t;return[e,i]};var $e=i=>new ReadableStream({pull:async e=>{let t=await i.next();t.done?e.close():e.enqueue(t.value)},cancel:async()=>{await i.return?.()}},{highWaterMark:0});var Z=i=>{let e=i.length-1,t=-1;for(;e>-1&&i.charAt(e)==="/";)t=e,e--;return t===-1?i:i.slice(0,t)};var ps=new TextEncoder,Gt=(i,e)=>e?Z(e)+"/"+i.replace(/^\.(\/|$)/,""):i,se=class{path;type;mode;uid;gid;uname;gname;size;mtime;atime;ctime;linkpath;dev;ino;nlink;body;absolute;header;constructor(e,t){if(e.type==="Unsupported")throw new Error("writing entry that should be ignored");if(typeof t=="string"&&(t=ps.encode(t)),this.path=e.path,this.type=e.type??"File",this.mode=e.mode,this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,e.size===void 0&&t!==void 0&&!E(t)&&!L(t))throw new TypeError("a stream body needs the size option");this.size=e.size??(E(t)?t.length:L(t)?t.size:0),this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.dev=e.dev,this.ino=e.ino,this.nlink=e.nlink,this.body=t}encode(e={},t=new Uint8Array(512)){e=k(e);let s=Gt(this.path,e.prefix),n=this.type==="Link"&&this.linkpath!==void 0?Gt(this.linkpath,e.prefix):this.linkpath,{uid:r,gid:o,uname:a,gname:c,size:h,mtime:l,atime:d,ctime:p}=this;if(this.header=new R({path:s,linkpath:n,mode:this.mode,uid:r,gid:o,size:h,mtime:l,type:this.type,uname:a,gname:c,atime:d,ctime:p}),!this.header.encode(t)||e.noPax)return[t];let{dev:f,ino:w,nlink:u}=this;return[new Y({atime:d,ctime:p,gid:o,gname:c,mtime:l,path:s,linkpath:n,size:h,uid:r,uname:a,dev:f,ino:w,nlink:u}).encode(),t]}};var fs=16*1024*1024,z=()=>{},ke=i=>512*Math.ceil(i/512),J=i=>i.replaceAll("\\","/"),pt=i=>`${i.dev}:${i.ino}`,je={bigint:!0},us=({dev:i,ino:e})=>!Number.isSafeInteger(i)||!Number.isSafeInteger(e),We=(i,e)=>i.dev===e.dev&&i.ino===e.ino,ft=(i,e)=>Object.assign(new Error(i),{path:e,syscall:"read",code:"EOF"}),Kt=(i,e)=>ft(`encountered unexpected EOF: ${i} has fewer than the ${e} bytes of its stat`,i),Zt=(i,e)=>ft(`did not encounter expected EOF: ${i} has more than the ${e} bytes of its stat`,i),Jt=i=>i.absolute??i.path,ms=i=>Object.assign(new Error("writing more data than expected"),{path:Jt(i)}),Qt=i=>Symbol.asyncIterator in i||Symbol.iterator in i,ws=i=>typeof i.encode=="function",N=class{path;absolute;up;linkpath;ready;constructor(e,t){this.path=e,this.absolute=t}},Se=class{opt;fs;cwd;win32;maxReadSize;header;codec;codecOptions;ended=!1;head;tail;wake;#e=new Map;constructor(e,t){e=this.opt=k(e),this.fs=e.fs,this.win32=e.platform==="win32",this.maxReadSize=q("maxReadSize",e.maxReadSize,fs);let{prefix:s,noPax:n}=e;this.header={prefix:s&&this.win32?J(s):s,noPax:n};let r=e.cwd&&(this.win32?J(e.cwd):e.cwd);if(r&&!(this.win32?xe:ie)(r))throw new TypeError("cwd must be an absolute path");this.cwd=r&&this.#t(r,"");let o=e,a=["gzip","brotli","zstd","compress"].filter(h=>o[h]);if(a.length>1)throw new TypeError(`${a.join(", ")} are mutually exclusive`);let[c]=a;if(c){let h=e.compress,[l,d]=h?Array.isArray(h)?h:[h]:[[...e.codecs??[],T].find(p=>p.name===c),o[c]];if(!l?.[t])throw new TypeError(`no codec named ${l?.name??c} has a ${t} function`);this.codec=l,this.codecOptions={...typeof d=="object"?d:void 0,...l.name==="gzip"&&e.portable?{portable:!0}:void 0}}}#t(e,t){return this.win32?Be(e,t):C(e,t)}resolve(e){if(!this.cwd||!this.fs)throw new TypeError("a path needs the cwd and fs options");return this.#t(this.cwd,this.win32?J(e):e)}add(e){if(this.ended)throw new Error("write after end");if(typeof e!="string")this.push(e);else{let t=this.win32?J(e):e;this.push(new N(t||"./",this.resolve(t)))}return this}end(){return this.ended=!0,this.wake?.(),this}push(e){let t={item:e};this.tail?this.tail.next=t:this.head=t,this.tail=t,this.wake?.()}shift(){this.head=this.head?.next,this.head||(this.tail=void 0)}needsExact(e){return us(e)&&(e.isDirectory()?!!this.opt.follow:e.isFile()&&e.nlink>1)}plan(e,t,s){let{filter:n}=this.opt;if(!(n&&!n(e.path,t))){if(t.isDirectory()){for(let r=e.up;r;r=r.up)if(r.key===pt(s)){S(this.opt,"TAR_ENTRY_ERROR","directory is its own ancestor",{path:e.path,absolute:e.absolute});return}return"Directory"}if(t.isSymbolicLink())return"SymbolicLink";if(!t.isFile()){S(this.opt,"TAR_ENTRY_UNSUPPORTED","unsupported file type",{path:e.path,absolute:e.absolute});return}if(t.nlink>1){let r=pt(s),o=this.#e.get(r),a=this.cwd;if(o!==e.absolute&&o?.startsWith(a.endsWith("/")?a:a+"/"))return e.linkpath=D(a,o),"Link";this.#e.set(r,e.absolute)}return"File"}}children(e,t,s){let n=e.path==="./"?"":e.path.replace(/\/*$/,"/"),r=e.absolute.endsWith("/")?e.absolute:e.absolute+"/",o=this.opt.follow?{key:pt(s),up:e.up}:void 0;return[...t].sort().map(a=>{let c=new N(n+a,r+a);return c.up=o,c})}missing(e,t){if(t?.code!=="ENOENT")throw t;S(this.opt,"TAR_ENTRY_ERROR",t,{path:e.path,absolute:e.absolute})}changed(e,t){S(this.opt,"TAR_ENTRY_ERROR",t==="Directory"?"directory changed between lstat and readdir":"file changed between lstat and open",{path:e.path,absolute:e.absolute})}pathEntry(e,t,s,n,r){let{processUid:o,processUname:a=""}=this.opt,c=new se({path:e.path,type:s,mode:t.mode,uid:t.uid,gid:t.gid,uname:t.uid===o?a:"",size:s==="File"?t.size:0,mtime:t.mtime,atime:t.atime,ctime:t.ctime,linkpath:n&&this.win32?J(n):n,dev:t.dev,ino:t.ino,nlink:t.nlink},r);return c.absolute=e.absolute,this.#i(c,!0)}addedEntry(e){if(ws(e))return this.#i(e,!1);let{filter:t}=this.opt;if(!(t&&!t(e.path,e)))return this.#i(new se(e,e.body),!1)}#i(e,t){let{opt:s,win32:n}=this,r=e.type==="Directory";n&&!t&&(e.path=J(e.path),e.linkpath&&(e.linkpath=J(e.linkpath)));let[o,a]=s.preservePaths?["",e.path]:He(e.path);return e.path=a,t&&(n&&(e.path=$t(e.path)),e.path===""&&(e.path="./")),o&&S(s,"TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:e,path:o+e.path}),t&&r&&!e.path.endsWith("/")&&(e.path+="/"),s.portable&&(e.uid=e.gid=e.dev=e.ino=e.nlink=void 0,e.uname=e.gname=void 0,e.atime=e.ctime=void 0),e.mode!==void 0&&(e.mode=Ht(e.mode,r,!!s.portable)),e.mtime=s.noMtime||s.portable&&r?void 0:s.mtime||e.mtime,e}},Yt=async(i,e,t,s,n,r)=>{for(;t<e.length&&s<n;){let{bytesRead:o}=await i.read(e,t,e.length-t,s);if(o<=0)throw Kt(r,n);if(o>n-s)throw Zt(r,n);t+=o,s+=o}return s},qt=(i,e,t,s,n,r,o)=>{for(;s<t.length&&n<r;){let a=i.readSync(e,t,s,t.length-s,n);if(a<=0)throw Kt(o,r);if(a>r-n)throw Zt(o,r);s+=a,n+=a}return n};async function*ys(i){if(E(i))yield i;else if(L(i)||Pe(i)){let e=(L(i)?i.stream():i).getReader();try{for(;;){let t=await e.read();if(t.done)break;yield t.value}}finally{await e.cancel().catch(z)}}else i&&(yield*i)}function*gs(i){if(E(i))yield i;else if(i&&Symbol.iterator in i)yield*i;else if(i)throw new TypeError("PackSync needs a body that is a string, a Uint8Array, or an iterable")}var ei=(i,e,t)=>{if(t.length>e)throw ms(i);return e-t.length},ti=(i,e)=>{if(e)throw ft("encountered unexpected EOF",Jt(i));return new Uint8Array(ke(i.size)-i.size)};async function*Vt(i){if(!i.size)return;let e=i.size;for await(let s of ys(i.body))e=ei(i,e,s),yield s;let t=ti(i,e);t.length&&(yield t)}function*Xt(i){if(!i.size)return;let e=i.size;for(let s of gs(i.body))e=ei(i,e,s),yield s;let t=ti(i,e);t.length&&(yield t)}var be=class extends Se{jobs;#e;#t=Promise.resolve();constructor(e={}){super(e,"compress"),this.jobs=q("jobs",this.opt.jobs,4)}async next(){let e=await(this.#e??=this.#i()).next();return e.done?{value:void 0,done:!0}:e}async return(){return this.end(),await this.#e?.return(),{value:void 0,done:!0}}[Symbol.asyncIterator](){return this}#i(){let{codec:e}=this;return e?.compress?this.#s(e.compress(this.codecOptions)):this.#r()}async*#s(e){let t=this.#r(),s,n=$e({next:()=>t.next().catch(r=>{throw s={er:r},n.cancel().catch(z),r})}).pipeThrough(e).getReader();try{for(;;){let r=await n.read();if(s)throw s.er;if(r.done)break;yield r.value}}finally{await n.cancel().catch(z),await t.return()}}async*#r(){try{for(;;){let e=this.head;if(!e){if(this.ended)break;await new Promise(s=>this.wake=s);continue}this.#n();let{item:t}=e;if(t instanceof N)yield*this.#c(t);else if(!Qt(t))yield*this.#d(t);else for await(let s of t)yield*this.#d(s);this.shift()}yield new Uint8Array(1024)}finally{for(let e=this.head;e;e=e.next){let{item:t}=e;if(!(t instanceof N)||!t.ready)break;await(await t.ready.catch(z))?.handle?.close().catch(z)}}}#n(){let e=this.fs,t=this.head;for(let s=0;t&&s<this.jobs;s++,t=t.next){let n=t.item;if(!(n instanceof N))break;if(n.ready)continue;let r=this.#a(e,n.absolute);r.catch(z);let o=this.#t.then(()=>r).then(([a,c])=>{let h=this.plan(n,a,c);return h&&{load:this.#o(e,n,a,c,h)}},a=>this.missing(n,a));this.#t=o.catch(z),n.ready=o.then(a=>a?.load),n.ready.catch(z)}}async#a(e,t){let{follow:s}=this.opt,n=await(s?e.stat(t):e.lstat(t)),r=this.needsExact(n)?await(s?e.stat(t,je):e.lstat(t,je)):n;return[n,r]}async#o(e,t,s,n,r){let{absolute:o}=t,{follow:a,noDirRecurse:c}=this.opt,h={stat:s,id:n,type:r};if(r==="SymbolicLink")h.linkpath=await e.readlink(o);else if(r==="Directory"&&!c)h.names=await e.readdir(o),h.changed=!a&&!We(s,await e.lstat(o));else if(r==="File"&&s.size){let l=await e.open(o,"r");try{let{size:d}=s,p=ke(d);!a&&!We(s,await l.stat())?h.changed=!0:p>this.maxReadSize?h.handle=l:(h.buf=new Uint8Array(512+p),await Yt(l,h.buf,512,0,d,o))}catch(d){throw await l.close().catch(z),d}h.handle||await l.close()}return h}async*#c(e){let t=await e.ready;if(!t)return;let{stat:s,id:n,type:r,names:o,buf:a,handle:c}=t;if(t.changed)return this.changed(e,r);let h=!1;try{let l=a?a.subarray(512,512+s.size):c&&this.#h(c,s.size,e.absolute),d=this.pathEntry(e,s,r,t.linkpath??e.linkpath,l);if(o)for(let f of this.children(e,o,n))this.push(f);await this.opt.onWriteEntry?.(d);let p=a&&d.body===l&&d.size===s.size;yield*d.encode(this.header,p?a:void 0),p||(yield*Vt(d)),h=!0}finally{if(c){t.handle=void 0;let l=c.close();await(h?l:l.catch(z))}}}async*#h(e,t,s){let n=ke(t);for(let r=0;r<t;){let o=new Uint8Array(Math.min(n-r,this.maxReadSize)),a=await Yt(e,o,0,r,t,s);yield o.subarray(0,a-r),r=a}}async*#d(e){let t=this.addedEntry(e);t&&(await this.opt.onWriteEntry?.(t),yield*t.encode(this.header),yield*Vt(t))}},ve=class extends Se{#e;constructor(e={}){super(e,"compressSync")}next(){let e=(this.#e??=this.#t()).next();return e.done?{value:void 0,done:!0}:e}return(){return this.ended=!0,this.#e?.return(),{value:void 0,done:!0}}[Symbol.iterator](){return this}*#t(){let{codec:e}=this;if(!e?.compressSync)return yield*this.#i();yield e.compressSync(F([...this.#i()]),this.codecOptions)}*#i(){for(let e;e=this.head;this.shift()){let{item:t}=e;if(t instanceof N){let s=[t];for(let n of s)yield*this.#s(n,s)}else if(!Qt(t))yield*this.#n(t);else for(let s of t)yield*this.#n(s)}this.ended=!0,yield new Uint8Array(1024)}*#s(e,t){let s=this.fs,{absolute:n}=e,{follow:r,noDirRecurse:o}=this.opt,a;try{a=r?s.statSync(n):s.lstatSync(n)}catch(u){return this.missing(e,u)}let c=this.needsExact(a)?r?s.statSync(n,je):s.lstatSync(n,je):a,h=this.plan(e,a,c);if(!h)return;let{linkpath:l}=e,d,p,f,w=!1;try{if(h==="SymbolicLink")l=s.readlinkSync(n);else if(h==="Directory"&&!o){let g=s.readdirSync(n);if(!r&&!We(a,s.lstatSync(n)))return this.changed(e,h);t.push(...this.children(e,g,c))}else if(h==="File"&&a.size){let{size:g}=a,bt=ke(g);if(f=s.openSync(n,"r"),!r&&!We(a,s.fstatSync(f)))return this.changed(e,h);bt>this.maxReadSize?p=this.#r(s,f,g,n):(d=new Uint8Array(512+bt),qt(s,f,d,512,0,g,n),p=d.subarray(512,512+g))}let u=this.pathEntry(e,a,h,l,p);this.opt.onWriteEntry?.(u);let m=d&&u.body===p&&u.size===a.size;yield*u.encode(this.header,m?d:void 0),m||(yield*Xt(u)),w=!0}finally{if(f!==void 0&&!w)try{s.closeSync(f)}catch{}}f!==void 0&&s.closeSync(f)}*#r(e,t,s,n){let r=ke(s);for(let o=0;o<s;){let a=new Uint8Array(Math.min(r-o,this.maxReadSize)),c=qt(e,t,a,0,o,s,n);yield a.subarray(0,c-o),o=c}}*#n(e){let t=this.addedEntry(e);t&&(this.opt.onWriteEntry?.(t),yield*t.encode(this.header),yield*Xt(t))}};var Ee=64*1024,Ge=4*Ee,xs=()=>{},ut=(i,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive");if(i.file&&!i.fs)throw new TypeError("the file option needs the fs option")},ii=async(i,e,t,s)=>{for(let n=0;n<t;)n+=(await i.write(e,n,t-n,s+n)).bytesWritten},mt=async(i,e,t)=>{let s=new Uint8Array(Ge),n=0,r=async()=>{await ii(i,s,n,t),t+=n,n=0};for await(let o of e)(n+o.length>Ge||o.length>=Ee)&&await r(),o.length>=Ee?(await ii(i,o,o.length,t),t+=o.length):(s.set(o,n),n+=o.length);await r()},wt=(i,e,t,s)=>{let n=new Uint8Array(Ge),r=0,o=(a,c)=>{for(let h=0;h<c;)h+=i.writeSync(e,a,h,c-h,s+h);s+=c};for(let a of t)(r+a.length>Ge||a.length>=Ee)&&(o(n,r),r=0),a.length>=Ee?o(a,a.length):(n.set(a,r),r+=a.length);o(n,r)},ks=async(i,e,t,s)=>{let n=await e.open(t,"w",s),r=!1;try{await mt(n,i,0),r=!0}finally{let o=n.close();await(r?o:o.catch(xs))}},Ye=(i,e)=>{let{fs:t,strict:s,onwarn:n,codecs:r,platform:o}=i,a=new be(i);for(let c of e)if(typeof c!="string"||c.charAt(0)!=="@")a.add(c);else{let h=a.resolve(c.slice(1));a.add(new b(B(t,h,i.maxReadSize),{strict:s,onwarn:n,codecs:r,platform:o,file:h}))}return a.end()},yt=(i,e)=>{let{strict:t,onwarn:s,codecs:n,platform:r}=i,o=new ve(i);for(let a of e)if(typeof a!="string"||a.charAt(0)!=="@")o.add(a);else{let c=o.resolve(a.slice(1));o.add(new v(H(i.fs,c,i.maxReadSize),{strict:t,onwarn:s,codecs:n,platform:r,file:c}))}return o};function ne(i,e){let t=y(i);if(!t.file)return ut(t,e),$e(Ye(t,e));try{return ut(t,e),ks(Ye(t,e),t.fs,t.file,t.mode||438)}catch(s){return Promise.reject(s)}}function qe(i,e){let t=y(i);ut(t,e);let{file:s}=t,n=t.fs,r=yt(t,e);if(!s)return r;let o=n.openSync(s,"w",t.mode||438);try{wt(n,o,r,0)}catch(a){try{n.closeSync(o)}catch{}throw a}n.closeSync(o)}var Q=(i,e)=>{let t=new Set(i.map(o=>Z(o))),s=new Set(t),n=0;for(let o of t)n=Math.max(n,o.length);let r=o=>{let a=Z(o),c=a.charAt(0)==="/"?"/":".",h=!1;for(let l=a.length;l>0;l=a.lastIndexOf("/",l-1)){if(l>n)continue;let d=a.slice(0,l);if(!(d===c||!t.has(d))&&(h=!0,s.delete(d),!s.size))break}return h};return[(o,a)=>{let c=!e||e(o,a);return r(o)&&c},o=>{for(let a of s)S(o,"TAR_ENTRY_ERROR",`${a}: not found in archive`,{path:a})}]},si=()=>new TypeError("list needs input, or file and fs"),Ve=async(i,e)=>{let t=y(i),{input:s,file:n,fs:r,onEntry:o}=t,a=s??(n&&r?B(r,n,t.maxReadSize):void 0);if(!a)throw si();let[c,h]=e?.length?Q(e,t.filter):[];c&&(t.filter=c);let l=new b(a,t);try{for(;;){let d=l.poll();if(d===null)break;d===void 0?await l.fill():o&&await o(d)}}finally{await l.return()}h?.(t)},ni=(i,e)=>{let t=y(i),{input:s,file:n,fs:r,onEntry:o}=t,a=s??(n&&r?H(r,n,t.maxReadSize):void 0);if(!a)throw si();let[c,h]=e?.length?Q(e,t.filter):[];c&&(t.filter=c);let l=new v(a,t);for(let d of l)o?.(d);h?.(t)};var Ss=()=>{},ri=(i,e)=>{if(!i.file)throw new TypeError("file is required");if(!i.fs)throw new TypeError("the file option needs the fs option");let t=[...i.codecs??[],T];if(e?.length)return[t,...Q(e,i.filter)];if(i.filter)return[t,i.filter];throw new TypeError("no paths specified to delete")},oi=i=>`${i}.${Math.random().toString(36).slice(2)}.tmp`,gt=async(i,e)=>{let t=y(i),[s,n,r]=ri(t,e),{fs:o,file:a,filter:c,maxReadSize:h,...l}=t,d=new Uint8Array(ye(s)),p=0,f=await o.open(a,"r");try{for(let m=1;m>0&&p<d.length;p+=m)m=(await f.read(d,p,d.length-p,p)).bytesRead}finally{await f.close()}let{mode:w}=await o.stat(a),u=oi(a);try{await ne({...l,fs:o,file:u,mode:w&511,compress:ge(s,d.subarray(0,p),a),preservePaths:!0,filter:(m,g)=>!n(m,g)},[new b(B(o,a,h),{...l,file:a})]),r?.(t),await o.rename(u,a)}catch(m){throw await o.unlink(u).catch(Ss),m}},ai=(i,e)=>{let t=y(i),[s,n,r]=ri(t,e),{fs:o,file:a,filter:c,maxReadSize:h,...l}=t,d=new Uint8Array(ye(s)),p=0,f=o.openSync(a,"r");try{for(let m=1;m>0&&p<d.length;p+=m)m=o.readSync(f,d,p,d.length-p,p)}finally{o.closeSync(f)}let{mode:w}=o.statSync(a),u=oi(a);try{qe({...l,fs:o,file:u,mode:w&511,compress:ge(s,d.subarray(0,p),a),preservePaths:!0,filter:(m,g)=>!n(m,g)},[new v(H(o,a,h),{...l,file:a})]),r?.(t),o.renameSync(u,a)}catch(m){try{o.unlinkSync(u)}catch{}throw m}};var re=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};var j=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};var ci=i=>{let e=i.mode|448,{uid:t,gid:s}=i;return{mode:e,needChmod:(e&i.umask)!==0,owner:typeof t=="number"&&typeof s=="number"&&(t!==i.processUid||s!==i.processGid)?{uid:t,gid:s}:void 0}},hi=(i,e)=>i.endsWith("/")?i+e:i+"/"+e,li=(i,e)=>{let t=i.replaceAll("\\","/"),s=[e];for(let n=e.length;!t.endsWith(e.slice(0,n));){if(n=e.lastIndexOf("/",n-1),n<=0)return[e];s.push(e.slice(0,n))}return s},di=async(i,e,t)=>{let{mode:s,needChmod:n,owner:r}=ci(t),{cwd:o}=t,a=[];if(e===o){let c="ENOTDIR";if(!await i.stat(e).then(l=>l.isDirectory(),l=>(c=l?.code||c,!1)))throw new re(e,c)}else if(t.preserve){let c=await i.mkdir(e,{mode:s,recursive:!0});c&&(a=li(c,e))}else{let c=D(o,e).split("/"),h=o;for(let l=0;l<c.length;l++){h=hi(h,c[l]);try{await i.mkdir(h,{mode:s})}catch(d){let p=await i.lstat(h);if(p.isDirectory())continue;if(!t.unlink)throw p.isSymbolicLink()?new j(h,h+"/"+c.slice(l+1).join("/")):d;await i.unlink(h),await i.mkdir(h,{mode:s})}a.push(h)}}if(r)for(let c of a)await i.lchown(c,r.uid,r.gid);n&&await i.chmod(e,s)},pi=(i,e,t)=>{let{mode:s,needChmod:n,owner:r}=ci(t),{cwd:o}=t,a=[];if(e===o){let c="ENOTDIR",h=!1;try{h=i.statSync(e).isDirectory()}catch(l){c=l?.code||c}if(!h)throw new re(e,c)}else if(t.preserve){let c=i.mkdirSync(e,{mode:s,recursive:!0});c&&(a=li(c,e))}else{let c=D(o,e).split("/"),h=o;for(let l=0;l<c.length;l++){h=hi(h,c[l]);try{i.mkdirSync(h,{mode:s})}catch(d){let p=i.lstatSync(h);if(p.isDirectory())continue;if(!t.unlink)throw p.isSymbolicLink()?new j(h,h+"/"+c.slice(l+1).join("/")):d;i.unlinkSync(h),i.mkdirSync(h,{mode:s})}a.push(h)}}if(r)for(let c of a)i.lchownSync(c,r.uid,r.gid);n&&i.chmodSync(e,s)};var xt=Object.create(null),fi=1e4,oe=new Set,bs=256,ui=i=>{if(i.length>bs)return i.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en");oe.has(i)?oe.delete(i):xt[i]=i.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),oe.add(i);let e=xt[i],t=oe.size-fi;if(t>fi/10){for(let s of oe)if(oe.delete(s),delete xt[s],--t<=0)break}return e};var Re=class{#e={queue:[],name:""};#t=new Map;#i=new Set;#s;constructor(e=!1){this.#s=e}reserve(e,t){return new Promise((s,n)=>{let r=()=>{t().then(()=>{this.#a(r),s()},o=>{this.#a(r),n(o)})};this.#r(e,r)})}#r(e,t){let s=this.#e,n=new Set,r=new Set;for(let o of this.#s?["win32 parallelization disabled"]:e){let a=this.#s?o:Z(W(ui(o))),c=s;for(let h of a.split("/")){c!==s&&r.add(c);let l=c.kids??=new Map,d=l.get(h);d||l.set(h,d={queue:[],name:h,up:c}),c=d}n.add(c)}for(let o of n)r.delete(o);this.#t.set(t,{dirs:r,paths:n});for(let o of n)o.queue.push(t);for(let{queue:o}of r){let a=o[o.length-1];a instanceof Set?a.add(t):o.push(new Set([t]))}this.#n(t)}#n(e){let{paths:t,dirs:s}=this.#t.get(e);for(let n of t)if(n.queue[0]!==e)return;for(let{queue:n}of s){let r=n[0];if(!(r instanceof Set)||!r.has(e))return}this.#i.add(e),e()}#a(e){let{paths:t,dirs:s}=this.#t.get(e),n=new Set;for(let{queue:r}of t){r.shift();let o=r[0];if(typeof o=="function")n.add(o);else if(o)for(let a of o)n.add(a)}for(let{queue:r}of s){let o=r[0];o.size>1?o.delete(e):(r.shift(),r.length&&n.add(r[0]))}for(let r of t)for(;r.up&&!r.queue.length&&!r.kids?.size;)r.up.kids?.delete(r.name),r=r.up;this.#i.delete(e),this.#t.delete(e);for(let r of n)this.#n(r)}};var mi=(i,e)=>{if(!i)return()=>"w";let{O_CREAT:t,O_TRUNC:s,O_WRONLY:n,O_NOFOLLOW:r,UV_FS_O_FILEMAP:o}=i,a=s|t|n;if(!e){let h=typeof r=="number"?r|a:"w";return()=>h}if(!o)return()=>"w";let c=o|a;return h=>h<524288?c:"w"};var vs=1024,wi=32768,Es=16,Xe=new Set(["File","OldFile","ContiguousFile"]),ae=new Set(["Directory","GNUDumpDir"]),Rs=new Set(["Link","SymbolicLink"]),yi=(i,e,t)=>i!==void 0?i:e!==void 0&&e===e>>>0?e:t,Ae=class{opt;cwd;win32;strip;maxDepth;preservePaths;unlink;keep;newer;noMtime;chmod;uid;gid;preserveOwner;forceChown;processUid;processGid;processUmask;umask;dmode;fmode;writeFlag;resolve;dirname;fatal;constructor(e){let t=this.opt=k(e),s=this.win32=t.platform==="win32";if(this.resolve=s?Be:C,this.dirname=s?Wt:O,typeof t.cwd!="string")throw new TypeError("cwd is required");let n=s?t.cwd.replaceAll("\\","/"):t.cwd;if(!(s?xe:ie)(n))throw new TypeError("cwd must be an absolute path");if(this.cwd=this.resolve(n,""),typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.uid!==t.uid>>>0||t.gid!==t.gid>>>0)throw new TypeError("uid and gid must be unsigned 32-bit integers");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid}this.processUid=t.processUid,this.processGid=t.processGid,this.preserveOwner=t.preserveOwner===void 0&&typeof t.uid!="number"?t.processUid===0:!!t.preserveOwner,this.forceChown=t.forceChown===!0,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:vs,this.strip=Number(t.strip)||0,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.keep=!!t.keep,this.newer=!!t.newer,this.noMtime=!!t.noMtime,this.chmod=!!t.chmod,this.processUmask=this.chmod?typeof t.processUmask=="number"?t.processUmask:18:0,this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.writeFlag=mi(t.fs.constants,s)}warn(e,t,s={}){(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),s.cwd=this.cwd,S(this.opt,e,t,s)}readerOptions(){return k(this.opt,{strict:!1,onwarn:(e,t,s)=>this.warn(e,t,s)})}entryError(e,t){if(this.fatal?.error===e||e?.name==="CwdError")throw e;this.warn("TAR_ENTRY_ERROR",e,{entry:t})}fail(e){return this.fatal??={error:e},e}#e(e,t){let s=e[t];if(!s||this.preservePaths)return!0;let[n,r]=He(s),o=r.replaceAll("\\","/").split("/");if(o.includes("..")){if(t==="path"||e.type==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:s}),!1;let a=o.findIndex(l=>l!==".."&&l!=="."&&l!=="");if(a!==-1&&o.includes("..",a))return this.warn("TAR_ENTRY_ERROR",`${t} contains '..' after a path portion`,{entry:e,[t]:s}),!1;let c=O(he(e.path)),h=he(W(c,o.join("/")));if(h.startsWith("../")||h==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:s}),!1}return n&&(e[t]=r,this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:s})),!0}check(e){let t=e.path,s=t.split("/");if(this.strip){if(s.length<this.strip)return!1;if(e.type==="Link"){let c=String(e.linkpath).split("/");if(c.length<this.strip)return!1;e.linkpath=c.slice(this.strip).join("/")}if(s.splice(0,this.strip),s.every(c=>c===""))return!1;e.path=s.join("/")}let{maxDepth:n}=this;if(isFinite(n)&&s.length>n)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:s.length,maxDepth:n}),!1;let{linkpath:r}=e;if(r&&isFinite(n)&&r.split("/").length>n)return this.warn("TAR_ENTRY_ERROR","linkpath excessively deep",{entry:e,path:t,linkpath:r,maxDepth:n}),!1;for(let c of["path","linkpath"]){let{length:h}=e[c]??"";if(h>wi)return this.warn("TAR_ENTRY_ERROR",`${c} excessively long`,{entry:e,path:t,length:h,maxLength:wi}),!1}if(!this.#e(e,"path")||!this.#e(e,"linkpath"))return!1;let{cwd:o}=this,a=this.resolve(o,e.path);if(!this.preservePaths&&a!==o&&!a.startsWith(o.endsWith("/")?o:o+"/"))return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:e.path,resolvedPath:a,cwd:o}),!1;if(a===o&&!ae.has(e.type))return!1;if(this.win32){let c=$(a);a=c+dt(a.slice(c.length));let h=$(e.path);e.path=h+dt(e.path.slice(h.length))}if(e.absolute=a,typeof e.mode=="number"&&(e.mode&=511),ae.has(e.type))e.mode&&(e.mode|=448);else if(!Xe.has(e.type)&&!Rs.has(e.type))return e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),!1;return!0}reservedPaths(e){let{path:t,linkpath:s}=e;return s?[t,e.type==="SymbolicLink"&&!ie(s)?W(O(t),s):s]:[t]}mkdirOptions(e){return{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:e}}owner(e){let t=this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid,s=yi(this.uid,e.uid,this.processUid),n=yi(this.gid,e.gid,this.processGid);return t&&typeof s=="number"&&typeof n=="number"?{uid:s,gid:n}:void 0}times(e){return e.mtime&&!this.noMtime?{atime:e.atime||new Date,mtime:e.mtime}:void 0}skip(e,t){return this.keep||this.newer&&t.mtime>(e.mtime??t.mtime)}isReusable(e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!this.win32}linkParts(e,t){let s=String(e.linkpath);return e.type==="Link"?s.split("/"):D(this.cwd,this.resolve(this.dirname(t),s)).split("/")}parentParts(e){let{cwd:t}=this,s=e===t?t:this.dirname(e);return s===t?[]:D(t,s).split("/")}symlinkError(e,t){return new j(e,this.resolve(this.cwd,t.join("/")))}},gi=i=>i+".DELETE."+Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join(""),Te=class extends Ae{#e;#t;#i;#s=0;#r;#n=!1;#a;constructor(e){super(e),this.#e=this.opt.fs,this.#t=new Re(this.win32),this.#i=q("jobs",this.opt.jobs,Es)}async extract(e){let t=new b(e,this.readerOptions()),{onEntry:s}=this.opt,n=!!this.opt.transform;try{for(;!this.fatal;){let r=t.poll();if(r===null)break;if(r===void 0){await t.fill();continue}if(s&&await s(r),r.bodyUsed||!this.check(r))continue;let o=[],a=!n;if(a&&Xe.has(r.type))for(;;){let h=t.readBody(r);if(h===null)break;if(h===void 0){a=!1;break}o.push(h)}let c=this.#c(r,o,a?void 0:t);for(a||await c;this.#s>=this.#i;)await this.#o()}}catch(r){this.fail(r)}for(await t.return().catch(r=>this.fail(r));this.#s>0;)await this.#o();if(this.fatal){let{error:r}=this.fatal;throw r&&typeof r=="object"&&"tarCode"in r&&Object.assign(r,{cwd:this.cwd}),r}}#o(){return new Promise(e=>{this.#r=e})}#c(e,t,s){return this.#s++,this.#t.reserve(this.reservedPaths(e),async()=>{try{this.fatal||await this.#w(e,t,s)}catch(n){try{this.entryError(n,e)}catch(r){this.fail(r)}}this.#s--,this.#r?.()})}#h(e,t){return di(this.#e,e,this.mkdirOptions(t))}#d(){return this.#a??=this.#h(this.cwd,this.dmode).then(()=>{this.#n=!0},e=>{throw this.#a=void 0,e})}async#w(e,t,s){let n=this.#e,r=e.absolute,{cwd:o}=this;if(this.#n||await this.#d(),r!==o){let c=this.dirname(r);c!==o&&await this.#h(c,this.dmode)}let a=await n.lstat(r).catch(()=>{});if(!(a&&this.skip(e,a))){if(a&&!this.isReusable(e,a)&&(a.isDirectory()&&ae.has(e.type)?this.chmod&&e.mode&&(a.mode&4095)!==e.mode&&await n.chmod(r,e.mode):r!==o&&(a.isDirectory()?await n.rmdir(r):await this.#x(r))),Xe.has(e.type))return this.#f(e,r,t,s);if(ae.has(e.type))await this.#l(e,r);else{await this.#p(this.linkParts(e,r));let c=String(e.linkpath);e.type==="Link"?await n.link(this.resolve(o,c),r):await n.symlink(c,r)}await this.#p(this.parentParts(r))}}async#x(e){let t=this.#e;if(!this.win32)return t.unlink(e);let s=gi(e);await t.rename(e,s),await t.unlink(s)}async#p(e){if(this.preservePaths)return;let t=this.cwd;for(let s of e){t=this.resolve(t,s);let n=await this.#e.lstat(t).catch(()=>{});if(!n)return;if(n.isSymbolicLink())throw this.symlinkError(t,e)}}async#l(e,t){let s=this.#e;await this.#h(t,e.mode??this.dmode);let n=this.times(e);n&&await s.lutimes(t,n.atime,n.mtime).catch(()=>{});let r=this.owner(e);r&&await s.lchown(t,r.uid,r.gid).catch(()=>{})}async#f(e,t,s,n){let r=this.#e,o=await r.open(t,this.writeFlag(e.size),e.mode??this.fmode);try{if(await this.#p(this.parentParts(t)),n)await this.#y(e,s,n,o);else for(let h of s)await o.write(h);let a=this.times(e);if(a){let{atime:h,mtime:l}=a;await o.utimes(h,l).catch(async d=>{await r.utimes(t,h,l).catch(()=>{throw d})})}let c=this.owner(e);if(c){let{uid:h,gid:l}=c;await o.chown(h,l).catch(async d=>{await r.chown(t,h,l).catch(()=>{throw d})})}}catch(a){throw await o.close().catch(()=>{}),a}await o.close()}async#y(e,t,s,n){let r=0,o=async()=>{if(r<t.length)return t[r++];try{for(;;){let f=s.readBody(e);if(f!==void 0)return f;await s.fill()}}catch(f){throw this.fail(f)}},a=this.opt.transform?.(e);if(!a){let f,w;try{for(let u;(u=await o())&&(await f,!w);)f=n.write(u).then(()=>{},m=>{w={error:m}})}finally{await f}if(w)throw w.error;return}let c=a.writable.getWriter(),h=a.readable.getReader(),l,d=async f=>{l??={error:f},await h.cancel(f).catch(()=>{}),await c.abort(f).catch(()=>{})},p=(async()=>{try{for(let f;f=await o();)await c.write(f);await c.close()}catch(f){await d(f)}})();try{for(;;){let{done:f,value:w}=await h.read();if(f)break;await n.write(w)}}catch(f){await d(f)}if(await p,l)throw l.error}},ze=class extends Ae{#e;#t=!1;constructor(e){super(e),this.#e=this.opt.fs}extract(e){let t=new v(e,this.readerOptions()),{onEntry:s}=this.opt;try{for(let n of t)if(s?.(n),!n.bodyUsed&&this.check(n))try{this.#s(n,t)}catch(r){this.entryError(r,n)}}catch(n){throw n&&typeof n=="object"&&"tarCode"in n&&Object.assign(n,{cwd:this.cwd}),n}}#i(e,t){pi(this.#e,e,this.mkdirOptions(t))}#s(e,t){let s=this.#e,n=e.absolute,{cwd:r}=this;if(this.#t||(this.#i(r,this.dmode),this.#t=!0),n!==r){let a=this.dirname(n);a!==r&&this.#i(a,this.dmode)}let o;try{o=s.lstatSync(n)}catch{}if(!(o&&this.skip(e,o))){if(o&&!this.isReusable(e,o)&&(o.isDirectory()&&ae.has(e.type)?this.chmod&&e.mode&&(o.mode&4095)!==e.mode&&s.chmodSync(n,e.mode):n!==r&&(o.isDirectory()?s.rmdirSync(n):this.#r(n))),Xe.has(e.type))return this.#o(e,n,t);if(ae.has(e.type))this.#a(e,n);else{this.#n(this.linkParts(e,n));let a=String(e.linkpath);e.type==="Link"?s.linkSync(this.resolve(r,a),n):s.symlinkSync(a,n)}this.#n(this.parentParts(n))}}#r(e){let t=this.#e;if(!this.win32)return t.unlinkSync(e);let s=gi(e);t.renameSync(e,s),t.unlinkSync(s)}#n(e){if(this.preservePaths)return;let t=this.cwd;for(let s of e){t=this.resolve(t,s);let n;try{n=this.#e.lstatSync(t)}catch{return}if(n.isSymbolicLink())throw this.symlinkError(t,e)}}#a(e,t){let s=this.#e;this.#i(t,e.mode??this.dmode);let n=this.times(e);if(n)try{s.lutimesSync(t,n.atime,n.mtime)}catch{}let r=this.owner(e);if(r)try{s.lchownSync(t,r.uid,r.gid)}catch{}}#o(e,t,s){let n=this.#e,r=n.openSync(t,this.writeFlag(e.size),e.mode??this.fmode);try{this.#n(this.parentParts(t));let o=this.opt.transform?.(e);for(;;){let h;try{h=s.readBody(e)}catch(l){throw this.fail(l)}if(!h)break;n.writeSync(r,o?o(h):h)}let a=this.times(e);if(a){let{atime:h,mtime:l}=a;try{n.futimesSync(r,h,l)}catch(d){try{n.utimesSync(t,h,l)}catch{throw d}}}let c=this.owner(e);if(c){let{uid:h,gid:l}=c;try{n.fchownSync(r,h,l)}catch(d){try{n.chownSync(t,h,l)}catch{throw d}}}}catch(o){try{n.closeSync(r)}catch{}throw o}n.closeSync(r)}};var xi=()=>new TypeError("extract needs input or file"),Ke=async(i,e)=>{let t=y(i),s=t.input??(t.file?B(t.fs,t.file,t.maxReadSize):void 0);if(!s)throw xi();let[n,r]=e?.length?Q(e,t.filter):[];n&&(t.filter=n),await new Te(t).extract(s),r?.(t)},ki=(i,e)=>{let t=y(i),s=t.input??(t.file?H(t.fs,t.file,t.maxReadSize):void 0);if(!s)throw xi();let[n,r]=e?.length?Q(e,t.filter):[];n&&(t.filter=n),new ze(t).extract(s),r?.(t)};var Si=64*1024,bi={},As=()=>{},Ze=()=>new Error("cannot append to compressed archives"),vi=(i,e)=>{let{file:t}=i;if(!t)throw new TypeError("file is required");if(i.gzip||i.brotli||i.zstd||t.endsWith(".br")||t.endsWith(".tbr"))throw new TypeError(Ze().message);if(!e?.length)throw new TypeError("no paths specified to add/replace")},Oe=class{buf=new Uint8Array(Si);pos=0;#e;#t;#i;#s;constructor(e,t=[],s){this.#e=e,this.#i=[...t,T],this.#s=s,this.#t=new I({filter:()=>!1,onwarn:()=>{throw bi}})}get position(){return this.#t.position}get want(){return Math.min(Si,this.#e-this.pos)}push(e){let t=this.buf.subarray(0,e);if(this.pos===0&&this.#i.some(r=>r.detect(t)))throw Ze();let s=this.#t;this.pos+=e;let n=0;s.push(t);try{for(let r;r=s.next();){if(r.type!=="entry")return!1;let{entry:o}=r;if(n=s.offset+512*Math.ceil(o.size/512),n>this.#e)return!1;o.mtime&&this.#s?.set(o.path,o.mtime)}this.pos<n&&(s.skipBody(),this.pos=n)}catch(r){if(r!==bi)throw r;return!1}return e>0&&this.pos<this.#e}},ce=async(i,e)=>{let t=y(i);vi(t,e);let{fs:s,file:n}=t,r=Ye(t,e);if(r.codec)throw new TypeError(Ze().message);let o=await s.open(n,"r+").catch(c=>{if(c?.code!=="ENOENT")throw c;return s.open(n,"w+",t.mode||438)}),a=!1;try{let{size:c}=await o.stat(),h=new Oe(c,t.codecs,t.mtimeCache);for(;h.push((await o.read(h.buf,0,h.want,h.pos)).bytesRead););await mt(o,r,h.position),a=!0}finally{let c=o.close();await(a?c:c.catch(As))}},Je=(i,e)=>{let t=y(i);vi(t,e);let{fs:s,file:n}=t,r=yt(t,e);if(r.codec)throw new TypeError(Ze().message);let o;try{o=s.openSync(n,"r+")}catch(a){if(a?.code!=="ENOENT")throw a;o=s.openSync(n,"w+",t.mode||438)}try{let{size:a}=s.fstatSync(o),c=new Oe(a,t.codecs,t.mtimeCache);for(;c.push(s.readSync(o,c.buf,0,c.want,c.pos)););wt(s,o,r,c.position)}catch(a){try{s.closeSync(o)}catch{}throw a}s.closeSync(o)};var Ts=(i,e)=>{let t=e.getTime(),s=i.getTime();return(t%1e3===0?s-s%1e3:s)>t},Ei=i=>{let{filter:e}=i,t=i.mtimeCache??new Map;return{...i,mtimeCache:t,filter:(s,n)=>{if(e&&!e(s,n))return!1;if("isDirectory"in n&&n.isDirectory())return!0;let r=t.get(s);return!r||!n.mtime||Ts(n.mtime,r)}}},Qe=(i,e)=>ce(Ei(i),e),Ri=(i,e)=>Je(Ei(i),e);import{constants as Os}from"node:buffer";import*as Ps from"node:zlib";var et=64*1024,tt=(i,e=!1,t)=>{let s,n,r=!1,o=!1,a,c,h=e?new Uint8Array(et):void 0,l=0,d=u=>new Promise(m=>{a=m,i.write(u,()=>m())}),p=async u=>{l&&await d(u.subarray(0,l)),l=0},f=()=>{o=!0,a?.(),c?.()},w=()=>{f(),i.destroy()};return i.pause(),i.on("data",u=>{t?.(u),t=void 0,r=!1,i.pause(),s.enqueue(u)}),i.on("end",()=>{o||s.close()}),i.on("error",u=>{s.error(u),n.error(u),f()}),i.on("close",f),{readable:new ReadableStream({start:u=>{s=u},pull:()=>{r=!0,c?.(),i.resume()},cancel:u=>{n.error(u),w()}},{highWaterMark:0}),writable:new WritableStream({start:u=>{n=u;let{signal:m}=u;m.addEventListener("abort",()=>{s.error(m.reason),w()})},write:async u=>{h?(l+u.length>et&&await p(h),u.length>et?await d(u):(h.set(u,l),l+=u.length)):await d(u),!r&&!o&&await new Promise(m=>c=m)},close:async()=>{h&&await p(h),await new Promise(u=>{a=u,i.end()})}})}},Fs=i=>i>=Os.MAX_LENGTH?{}:{maxOutputLength:Math.max(1,Math.floor(i))},kt=(i,e,t,s,n)=>({...i,decompress:()=>tt(t({chunkSize:et})),compress:r=>tt(e(r),!0),decompressSync:(r,{maxOutputLength:o})=>{try{return n(r,Fs(o))}catch(a){throw a?.code!=="ERR_BUFFER_TOO_LARGE"?a:new Error(`max decompression ratio exceeded: the output is larger than ${o} bytes`)}},compressSync:s}),Ai=i=>{i[9]=255},St=(i=Ps)=>{let{createBrotliCompress:e,createBrotliDecompress:t,brotliCompressSync:s,brotliDecompressSync:n,createZstdCompress:r,createZstdDecompress:o,zstdCompressSync:a,zstdDecompressSync:c}=i,l=[{...kt({name:"gzip",headLength:2,detect:d=>d[0]===31&&d[1]===139},i.createGzip,i.createGunzip,i.gzipSync,i.gunzipSync),compress:({portable:d,...p}={})=>tt(i.createGzip(p),!0,d?Ai:void 0),compressSync:(d,{portable:p,...f}={})=>{let w=i.gzipSync(d,f);return p&&Ai(w),w}}];return e&&t&&s&&n&&l.push(kt({name:"brotli",headLength:0,detect:()=>!1,extensions:[".tar.br",".tbr"]},e,t,s,n)),r&&o&&a&&c&&l.push(kt({name:"zstd",headLength:4,detect:d=>d[0]===40&&d[1]===181&&d[2]===47&&d[3]===253},r,o,a,c)),l};var ee=Ls,te=Ns,Cs=process.platform==="win32"?"win32":"posix",Ds=St(),x=(i,e,t)=>{let s=y(i);return s.fs??=e,s.platform??=Cs,s.codecs=[...s.codecs??[],...Ds],t&&(s.cwd=Us(s.cwd??""),s.processUid??=process.getuid?.(),s.processGid??=process.getgid?.(),s.processUname??=process.env.USER,s.chmod&&(s.processUmask??=process.umask())),s},vo=(i,e={})=>ht(i,x(e,ee,!1)),Eo=(i,e={})=>Bt(i,x(e,te,!1)),Ro=(i,e)=>Ve(x(i,ee,!1),e),Ao=(i,e)=>ni(x(i,te,!1),e),To=(i,e)=>Ke(x(i,ee,!0),e),zo=(i,e)=>ki(x(i,te,!0),e);function Oo(i,e){return ne(x(i,ee,!0),e)}function Po(i,e){return qe(x(i,te,!0),e)}var Fo=(i,e)=>ce(x(i,ee,!0),e),No=(i,e)=>Je(x(i,te,!0),e),Lo=(i,e)=>Qe(x(i,ee,!0),e),Uo=(i,e)=>Ri(x(i,te,!0),e),Co=(i,e)=>gt(x(i,ee,!1),e),Do=(i,e)=>ai(x(i,te,!1),e);export{Oe as AppendScan,re as CwdError,we as EntryCursor,V as EntryData,R as Header,be as Pack,Se as PackBase,N as PackJob,ve as PackSync,I as Parser,Re as PathReservations,Y as Pax,fe as ReadEntry,ue as ReadEntrySync,j as SymlinkError,b as TarReader,v as TarReaderSync,Te as Unpack,Ae as UnpackBase,ze as UnpackSync,se as WriteEntry,zt as aliases,Oo as c,tt as codecStream,Oo as create,Po as createSync,Co as delete,Do as deleteSync,vo as entries,Eo as entriesSync,To as extract,zo as extractSync,T as gzip,Ro as list,Ao as listSync,Fo as r,Fo as replace,No as replaceSync,Ro as t,nt as types,Lo as u,Lo as update,Uo as updateSync,To as x,St as zlibCodecs};
|
|
3
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -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,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { win32Root } from './win32-path.js';
|
|
2
|
+
/**
|
|
3
|
+
* Remove each root from the start of a path. Returns the roots and
|
|
4
|
+
* the rest of the path.
|
|
5
|
+
*
|
|
6
|
+
* A POSIX absolute path is also absolute on Windows, so the rules of
|
|
7
|
+
* Windows are used on each platform. A path that is relative to a
|
|
8
|
+
* drive loses the drive: `c:../foo` gives `['c:', '../foo']`.
|
|
9
|
+
*/
|
|
10
10
|
export const stripAbsolutePath = (path) => {
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'/'
|
|
18
|
-
: parsed.root;
|
|
11
|
+
let roots = '';
|
|
12
|
+
for (let root; (root = win32Root(path));) {
|
|
13
|
+
// Windows reads `//x/y/` as the root of `//x/y/z`. Remove only the
|
|
14
|
+
// first slash, but remove all of `//?/c:/`.
|
|
15
|
+
if (path.charAt(0) === '/' && path.slice(0, 4) !== '//?/')
|
|
16
|
+
root = '/';
|
|
19
17
|
path = path.slice(root.length);
|
|
20
|
-
|
|
21
|
-
parsed = parse(path);
|
|
18
|
+
roots += root;
|
|
22
19
|
}
|
|
23
|
-
return [
|
|
20
|
+
return [roots, path];
|
|
24
21
|
};
|
|
25
22
|
//# sourceMappingURL=strip-absolute-path.js.map
|
|
@@ -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,18 @@
|
|
|
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 const toStream = (chunks) => new ReadableStream({
|
|
7
|
+
pull: async (controller) => {
|
|
8
|
+
const res = await chunks.next();
|
|
9
|
+
if (res.done)
|
|
10
|
+
controller.close();
|
|
11
|
+
else
|
|
12
|
+
controller.enqueue(res.value);
|
|
13
|
+
},
|
|
14
|
+
cancel: async () => {
|
|
15
|
+
await chunks.return?.();
|
|
16
|
+
},
|
|
17
|
+
}, { highWaterMark: 0 });
|
|
18
|
+
//# sourceMappingURL=to-stream.js.map
|
|
@@ -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>;
|
|
@@ -3,10 +3,11 @@ export const isName = (c) => code.has(c);
|
|
|
3
3
|
/**
|
|
4
4
|
* types that are a normal file system entry, not metadata.
|
|
5
5
|
*
|
|
6
|
-
* These can be the subject of extended/globalExtended headers, long
|
|
7
|
-
* names, long linkpath names, etc.
|
|
6
|
+
* These can be the subject of extended/globalExtended headers, long
|
|
7
|
+
* path names, long linkpath names, etc.
|
|
8
8
|
*
|
|
9
|
-
* Any other types are meta, and cannot be
|
|
9
|
+
* Any other types are meta, and cannot be targeted by extended PAX
|
|
10
|
+
* headers.
|
|
10
11
|
*/
|
|
11
12
|
export const normalFsTypes = new Set([
|
|
12
13
|
'0',
|