aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/tar/dist/commonjs
diff options
context:
space:
mode:
authorpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
committerpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
commitd3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch)
treea2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/tar/dist/commonjs
parent55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff)
downloadcrud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz
stop tracking node_modules/
Diffstat (limited to '')
-rw-r--r--node_modules/tar/dist/commonjs/create.d.ts3
-rw-r--r--node_modules/tar/dist/commonjs/create.js82
-rw-r--r--node_modules/tar/dist/commonjs/cwd-error.d.ts8
-rw-r--r--node_modules/tar/dist/commonjs/cwd-error.js18
-rw-r--r--node_modules/tar/dist/commonjs/extract.d.ts3
-rw-r--r--node_modules/tar/dist/commonjs/extract.js88
-rw-r--r--node_modules/tar/dist/commonjs/get-write-flag.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/get-write-flag.js32
-rw-r--r--node_modules/tar/dist/commonjs/header.d.ts53
-rw-r--r--node_modules/tar/dist/commonjs/header.js348
-rw-r--r--node_modules/tar/dist/commonjs/index.d.ts20
-rw-r--r--node_modules/tar/dist/commonjs/index.js64
-rw-r--r--node_modules/tar/dist/commonjs/index.min.js4
-rw-r--r--node_modules/tar/dist/commonjs/large-numbers.d.ts3
-rw-r--r--node_modules/tar/dist/commonjs/large-numbers.js99
-rw-r--r--node_modules/tar/dist/commonjs/list.d.ts7
-rw-r--r--node_modules/tar/dist/commonjs/list.js153
-rw-r--r--node_modules/tar/dist/commonjs/make-command.d.ts49
-rw-r--r--node_modules/tar/dist/commonjs/make-command.js52
-rw-r--r--node_modules/tar/dist/commonjs/mkdir.d.ts25
-rw-r--r--node_modules/tar/dist/commonjs/mkdir.js187
-rw-r--r--node_modules/tar/dist/commonjs/mode-fix.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/mode-fix.js29
-rw-r--r--node_modules/tar/dist/commonjs/normalize-unicode.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/normalize-unicode.js38
-rw-r--r--node_modules/tar/dist/commonjs/normalize-windows-path.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/normalize-windows-path.js12
-rw-r--r--node_modules/tar/dist/commonjs/options.d.ts604
-rw-r--r--node_modules/tar/dist/commonjs/options.js66
-rw-r--r--node_modules/tar/dist/commonjs/pack.d.ts105
-rw-r--r--node_modules/tar/dist/commonjs/pack.js544
-rw-r--r--node_modules/tar/dist/commonjs/package.json3
-rw-r--r--node_modules/tar/dist/commonjs/parse.d.ts92
-rw-r--r--node_modules/tar/dist/commonjs/parse.js655
-rw-r--r--node_modules/tar/dist/commonjs/path-reservations.d.ts11
-rw-r--r--node_modules/tar/dist/commonjs/path-reservations.js170
-rw-r--r--node_modules/tar/dist/commonjs/pax.d.ts26
-rw-r--r--node_modules/tar/dist/commonjs/pax.js182
-rw-r--r--node_modules/tar/dist/commonjs/process-umask.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/process-umask.js7
-rw-r--r--node_modules/tar/dist/commonjs/read-entry.d.ts36
-rw-r--r--node_modules/tar/dist/commonjs/read-entry.js136
-rw-r--r--node_modules/tar/dist/commonjs/replace.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/replace.js227
-rw-r--r--node_modules/tar/dist/commonjs/strip-absolute-path.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/strip-absolute-path.js29
-rw-r--r--node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/strip-trailing-slashes.js18
-rw-r--r--node_modules/tar/dist/commonjs/symlink-error.d.ts9
-rw-r--r--node_modules/tar/dist/commonjs/symlink-error.js19
-rw-r--r--node_modules/tar/dist/commonjs/types.d.ts16
-rw-r--r--node_modules/tar/dist/commonjs/types.js70
-rw-r--r--node_modules/tar/dist/commonjs/unpack.d.ts101
-rw-r--r--node_modules/tar/dist/commonjs/unpack.js932
-rw-r--r--node_modules/tar/dist/commonjs/update.d.ts2
-rw-r--r--node_modules/tar/dist/commonjs/update.js33
-rw-r--r--node_modules/tar/dist/commonjs/warn-method.d.ts24
-rw-r--r--node_modules/tar/dist/commonjs/warn-method.js31
-rw-r--r--node_modules/tar/dist/commonjs/winchars.d.ts3
-rw-r--r--node_modules/tar/dist/commonjs/winchars.js14
-rw-r--r--node_modules/tar/dist/commonjs/write-entry.d.ts129
-rw-r--r--node_modules/tar/dist/commonjs/write-entry.js698
62 files changed, 0 insertions, 6385 deletions
diff --git a/node_modules/tar/dist/commonjs/create.d.ts b/node_modules/tar/dist/commonjs/create.d.ts
deleted file mode 100644
index 867c5e9..0000000
--- a/node_modules/tar/dist/commonjs/create.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Pack, PackSync } from './pack.js';
-export declare const create: import("./make-command.js").TarCommand<Pack, PackSync>;
-//# sourceMappingURL=create.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/create.js b/node_modules/tar/dist/commonjs/create.js
deleted file mode 100644
index 5339c93..0000000
--- a/node_modules/tar/dist/commonjs/create.js
+++ /dev/null
@@ -1,82 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.create = void 0;
-const fs_minipass_1 = require("@isaacs/fs-minipass");
-const node_path_1 = __importDefault(require("node:path"));
-const list_js_1 = require("./list.js");
-const make_command_js_1 = require("./make-command.js");
-const pack_js_1 = require("./pack.js");
-const createFileSync = (opt, files) => {
- const p = new pack_js_1.PackSync(opt);
- const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
- mode: opt.mode || 0o666,
- });
- p.pipe(stream);
- addFilesSync(p, files);
-};
-const createFile = (opt, files) => {
- const p = new pack_js_1.Pack(opt);
- const stream = new fs_minipass_1.WriteStream(opt.file, {
- mode: opt.mode || 0o666,
- });
- p.pipe(stream);
- const promise = new Promise((res, rej) => {
- stream.on('error', rej);
- stream.on('close', res);
- p.on('error', rej);
- });
- addFilesAsync(p, files).catch(er => p.emit('error', er));
- return promise;
-};
-const addFilesSync = (p, files) => {
- files.forEach(file => {
- if (file.charAt(0) === '@') {
- (0, list_js_1.list)({
- file: node_path_1.default.resolve(p.cwd, file.slice(1)),
- sync: true,
- noResume: true,
- onReadEntry: entry => p.add(entry),
- });
- }
- else {
- p.add(file);
- }
- });
- p.end();
-};
-const addFilesAsync = async (p, files) => {
- for (const file of files) {
- if (file.charAt(0) === '@') {
- await (0, list_js_1.list)({
- file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
- noResume: true,
- onReadEntry: entry => {
- p.add(entry);
- },
- });
- }
- else {
- p.add(file);
- }
- }
- p.end();
-};
-const createSync = (opt, files) => {
- const p = new pack_js_1.PackSync(opt);
- addFilesSync(p, files);
- return p;
-};
-const createAsync = (opt, files) => {
- const p = new pack_js_1.Pack(opt);
- addFilesAsync(p, files).catch(er => p.emit('error', er));
- return p;
-};
-exports.create = (0, make_command_js_1.makeCommand)(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
- if (!files?.length) {
- throw new TypeError('no paths specified to add to archive');
- }
-});
-//# sourceMappingURL=create.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/cwd-error.d.ts b/node_modules/tar/dist/commonjs/cwd-error.d.ts
deleted file mode 100644
index 394da16..0000000
--- a/node_modules/tar/dist/commonjs/cwd-error.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export declare class CwdError extends Error {
- path: string;
- code: string;
- syscall: "chdir";
- constructor(path: string, code: string);
- get name(): string;
-}
-//# sourceMappingURL=cwd-error.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/cwd-error.js b/node_modules/tar/dist/commonjs/cwd-error.js
deleted file mode 100644
index d703a77..0000000
--- a/node_modules/tar/dist/commonjs/cwd-error.js
+++ /dev/null
@@ -1,18 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CwdError = void 0;
-class CwdError extends Error {
- path;
- code;
- syscall = 'chdir';
- constructor(path, code) {
- super(`${code}: Cannot cd into '${path}'`);
- this.path = path;
- this.code = code;
- }
- get name() {
- return 'CwdError';
- }
-}
-exports.CwdError = CwdError;
-//# sourceMappingURL=cwd-error.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/extract.d.ts b/node_modules/tar/dist/commonjs/extract.d.ts
deleted file mode 100644
index 9cbb18c..0000000
--- a/node_modules/tar/dist/commonjs/extract.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Unpack, UnpackSync } from './unpack.js';
-export declare const extract: import("./make-command.js").TarCommand<Unpack, UnpackSync>;
-//# sourceMappingURL=extract.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/extract.js b/node_modules/tar/dist/commonjs/extract.js
deleted file mode 100644
index 86deb30..0000000
--- a/node_modules/tar/dist/commonjs/extract.js
+++ /dev/null
@@ -1,88 +0,0 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.extract = void 0;
-// tar -x
-const fsm = __importStar(require("@isaacs/fs-minipass"));
-const node_fs_1 = __importDefault(require("node:fs"));
-const list_js_1 = require("./list.js");
-const make_command_js_1 = require("./make-command.js");
-const unpack_js_1 = require("./unpack.js");
-const extractFileSync = (opt) => {
- const u = new unpack_js_1.UnpackSync(opt);
- const file = opt.file;
- const stat = node_fs_1.default.statSync(file);
- // This trades a zero-byte read() syscall for a stat
- // However, it will usually result in less memory allocation
- const readSize = opt.maxReadSize || 16 * 1024 * 1024;
- const stream = new fsm.ReadStreamSync(file, {
- readSize: readSize,
- size: stat.size,
- });
- stream.pipe(u);
-};
-const extractFile = (opt, _) => {
- const u = new unpack_js_1.Unpack(opt);
- const readSize = opt.maxReadSize || 16 * 1024 * 1024;
- const file = opt.file;
- const p = new Promise((resolve, reject) => {
- u.on('error', reject);
- u.on('close', resolve);
- // This trades a zero-byte read() syscall for a stat
- // However, it will usually result in less memory allocation
- node_fs_1.default.stat(file, (er, stat) => {
- if (er) {
- reject(er);
- }
- else {
- const stream = new fsm.ReadStream(file, {
- readSize: readSize,
- size: stat.size,
- });
- stream.on('error', reject);
- stream.pipe(u);
- }
- });
- });
- return p;
-};
-exports.extract = (0, make_command_js_1.makeCommand)(extractFileSync, extractFile, opt => new unpack_js_1.UnpackSync(opt), opt => new unpack_js_1.Unpack(opt), (opt, files) => {
- if (files?.length)
- (0, list_js_1.filesFilter)(opt, files);
-});
-//# sourceMappingURL=extract.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/get-write-flag.d.ts b/node_modules/tar/dist/commonjs/get-write-flag.d.ts
deleted file mode 100644
index d35ec71..0000000
--- a/node_modules/tar/dist/commonjs/get-write-flag.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const getWriteFlag: (() => string) | ((size: number) => number | "w");
-//# sourceMappingURL=get-write-flag.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/get-write-flag.js b/node_modules/tar/dist/commonjs/get-write-flag.js
deleted file mode 100644
index 82d7d50..0000000
--- a/node_modules/tar/dist/commonjs/get-write-flag.js
+++ /dev/null
@@ -1,32 +0,0 @@
-"use strict";
-// Get the appropriate flag to use for creating files
-// We use fmap on Windows platforms for files less than
-// 512kb. This is a fairly low limit, but avoids making
-// things slower in some cases. Since most of what this
-// library is used for is extracting tarballs of many
-// relatively small files in npm packages and the like,
-// it can be a big boost on Windows platforms.
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.getWriteFlag = void 0;
-const fs_1 = __importDefault(require("fs"));
-const platform = process.env.__FAKE_PLATFORM__ || process.platform;
-const isWindows = platform === 'win32';
-/* c8 ignore start */
-const { O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = fs_1.default.constants;
-const UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) ||
- fs_1.default.constants.UV_FS_O_FILEMAP ||
- 0;
-/* c8 ignore stop */
-const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP;
-const fMapLimit = 512 * 1024;
-const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY;
-const noFollowFlag = !isWindows && typeof O_NOFOLLOW === 'number' ?
- O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY
- : null;
-exports.getWriteFlag = noFollowFlag !== null ? () => noFollowFlag
- : !fMapEnabled ? () => 'w'
- : (size) => (size < fMapLimit ? fMapFlag : 'w');
-//# sourceMappingURL=get-write-flag.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/header.d.ts b/node_modules/tar/dist/commonjs/header.d.ts
deleted file mode 100644
index 58f1b43..0000000
--- a/node_modules/tar/dist/commonjs/header.d.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { EntryTypeCode, EntryTypeName } from './types.js';
-export type HeaderData = {
- path?: string;
- mode?: number;
- uid?: number;
- gid?: number;
- size?: number;
- cksum?: number;
- type?: EntryTypeName | 'Unsupported';
- linkpath?: string;
- uname?: string;
- gname?: string;
- devmaj?: number;
- devmin?: number;
- atime?: Date;
- ctime?: Date;
- mtime?: Date;
- charset?: string;
- comment?: string;
- dev?: number;
- ino?: number;
- nlink?: number;
-};
-export declare class Header implements HeaderData {
- #private;
- cksumValid: boolean;
- needPax: boolean;
- nullBlock: boolean;
- block?: Buffer;
- path?: string;
- mode?: number;
- uid?: number;
- gid?: number;
- size?: number;
- cksum?: number;
- linkpath?: string;
- uname?: string;
- gname?: string;
- devmaj: number;
- devmin: number;
- atime?: Date;
- ctime?: Date;
- mtime?: Date;
- charset?: string;
- comment?: string;
- constructor(data?: Buffer | HeaderData, off?: number, ex?: HeaderData, gex?: HeaderData);
- decode(buf: Buffer, off: number, ex?: HeaderData, gex?: HeaderData): void;
- encode(buf?: Buffer, off?: number): boolean;
- get type(): EntryTypeName;
- get typeKey(): EntryTypeCode | 'Unsupported';
- set type(type: EntryTypeCode | EntryTypeName | 'Unsupported');
-}
-//# sourceMappingURL=header.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/header.js b/node_modules/tar/dist/commonjs/header.js
deleted file mode 100644
index f4a84fb..0000000
--- a/node_modules/tar/dist/commonjs/header.js
+++ /dev/null
@@ -1,348 +0,0 @@
-"use strict";
-// parse a 512-byte header block to a data object, or vice-versa
-// encode returns `true` if a pax extended header is needed, because
-// the data could not be faithfully encoded in a simple header.
-// (Also, check header.needPax to see if it needs a pax header.)
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.Header = void 0;
-const node_path_1 = require("node:path");
-const large = __importStar(require("./large-numbers.js"));
-const types = __importStar(require("./types.js"));
-const notNegative = (n) => n === undefined || n < 0 ? undefined : n;
-class Header {
- cksumValid = false;
- needPax = false;
- nullBlock = false;
- block;
- path;
- mode;
- uid;
- gid;
- size;
- cksum;
- #type = 'Unsupported';
- linkpath;
- uname;
- gname;
- devmaj = 0;
- devmin = 0;
- atime;
- ctime;
- mtime;
- charset;
- comment;
- constructor(data, off = 0, ex, gex) {
- if (Buffer.isBuffer(data)) {
- this.decode(data, off || 0, ex, gex);
- }
- else if (data) {
- this.#slurp(data);
- }
- }
- decode(buf, off, ex, gex) {
- if (!off) {
- off = 0;
- }
- if (!buf || !(buf.length >= off + 512)) {
- throw new Error('need 512 bytes for header');
- }
- // Decode the typeflag (independent of any pending PAX/GNU extended header)
- // up front so we can tell whether THIS block is itself an intermediary
- // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
- // Per POSIX pax, a PAX extended header describes the *next file entry*, not
- // the extension headers that may sit between it and that file. Applying the
- // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
- // header desynchronizes the stream relative to other tar implementations
- // and enables tar interpretation-conflict / file-smuggling attacks.
- const t = decString(buf, off + 156, 1);
- const isNormalFS = types.normalFsTypes.has(t);
- const exForFields = isNormalFS ? ex : undefined;
- const gexForFields = isNormalFS ? gex : undefined;
- this.path = exForFields?.path ?? decString(buf, off, 100);
- this.mode =
- exForFields?.mode ??
- gexForFields?.mode ??
- decNumber(buf, off + 100, 8);
- this.uid =
- exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
- this.gid =
- exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
- this.size = notNegative(exForFields?.size ??
- gexForFields?.size ??
- decNumber(buf, off + 124, 12));
- this.mtime =
- exForFields?.mtime ??
- gexForFields?.mtime ??
- decDate(buf, off + 136, 12);
- this.cksum = decNumber(buf, off + 148, 12);
- // if we have extended or global extended headers, apply them now
- // See https://github.com/npm/node-tar/pull/187
- // Apply global before local, so it overrides. Never slurp the pending
- // extended-header fields onto an intermediary extension header.
- if (gexForFields)
- this.#slurp(gexForFields, true);
- if (exForFields)
- this.#slurp(exForFields);
- // old tar versions marked dirs as a file with a trailing /
- if (types.isCode(t)) {
- this.#type = t || '0';
- }
- if (this.#type === '0' && this.path.slice(-1) === '/') {
- this.#type = '5';
- }
- // tar implementations sometimes incorrectly put the stat(dir).size
- // as the size in the tarball, even though Directory entries are
- // not able to have any body at all. In the very rare chance that
- // it actually DOES have a body, we weren't going to do anything with
- // it anyway, and it'll just be a warning about an invalid header.
- if (this.#type === '5') {
- this.size = 0;
- }
- this.linkpath = decString(buf, off + 157, 100);
- if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
- /* c8 ignore start */
- this.uname =
- exForFields?.uname ??
- gexForFields?.uname ??
- decString(buf, off + 265, 32);
- this.gname =
- exForFields?.gname ??
- gexForFields?.gname ??
- decString(buf, off + 297, 32);
- this.devmaj =
- exForFields?.devmaj ??
- gexForFields?.devmaj ??
- decNumber(buf, off + 329, 8) ??
- 0;
- this.devmin =
- exForFields?.devmin ??
- gexForFields?.devmin ??
- decNumber(buf, off + 337, 8) ??
- 0;
- /* c8 ignore stop */
- if (buf[off + 475] !== 0) {
- // definitely a prefix, definitely >130 chars.
- const prefix = decString(buf, off + 345, 155);
- this.path = prefix + '/' + this.path;
- }
- else {
- const prefix = decString(buf, off + 345, 130);
- if (prefix) {
- this.path = prefix + '/' + this.path;
- }
- /* c8 ignore start */
- this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12);
- this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12);
- /* c8 ignore stop */
- }
- }
- let sum = 8 * 0x20;
- for (let i = off; i < off + 148; i++) {
- sum += buf[i];
- }
- for (let i = off + 156; i < off + 512; i++) {
- sum += buf[i];
- }
- this.cksumValid = sum === this.cksum;
- if (this.cksum === undefined && sum === 8 * 0x20) {
- this.nullBlock = true;
- }
- }
- #slurp(ex, gex = false) {
- Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
- // we slurp in everything except for the path attribute in
- // a global extended header, because that's weird. Also, any
- // null/undefined values are ignored.
- return !(v === null ||
- v === undefined ||
- (k === 'size' && Number(v) < 0) ||
- (k === 'path' && gex) ||
- (k === 'linkpath' && gex) ||
- k === 'global');
- })));
- }
- encode(buf, off = 0) {
- if (!buf) {
- buf = this.block = Buffer.alloc(512);
- }
- if (this.#type === 'Unsupported') {
- this.#type = '0';
- }
- if (!(buf.length >= off + 512)) {
- throw new Error('need 512 bytes for header');
- }
- const prefixSize = this.ctime || this.atime ? 130 : 155;
- const split = splitPrefix(this.path || '', prefixSize);
- const path = split[0];
- const prefix = split[1];
- this.needPax = !!split[2];
- this.needPax = encString(buf, off, 100, path) || this.needPax;
- this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
- this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
- this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
- this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
- this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
- buf[off + 156] = Number(this.#type.codePointAt(0));
- this.needPax =
- encString(buf, off + 157, 100, this.linkpath) || this.needPax;
- buf.write('ustar\u000000', off + 257, 8);
- this.needPax =
- encString(buf, off + 265, 32, this.uname) || this.needPax;
- this.needPax =
- encString(buf, off + 297, 32, this.gname) || this.needPax;
- this.needPax =
- encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
- this.needPax =
- encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
- this.needPax =
- encString(buf, off + 345, prefixSize, prefix) || this.needPax;
- if (buf[off + 475] !== 0) {
- this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax;
- }
- else {
- this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax;
- this.needPax =
- encDate(buf, off + 476, 12, this.atime) || this.needPax;
- this.needPax =
- encDate(buf, off + 488, 12, this.ctime) || this.needPax;
- }
- let sum = 8 * 0x20;
- for (let i = off; i < off + 148; i++) {
- sum += buf[i];
- }
- for (let i = off + 156; i < off + 512; i++) {
- sum += buf[i];
- }
- this.cksum = sum;
- encNumber(buf, off + 148, 8, this.cksum);
- this.cksumValid = true;
- return this.needPax;
- }
- get type() {
- return (this.#type === 'Unsupported' ?
- this.#type
- : types.name.get(this.#type));
- }
- get typeKey() {
- return this.#type;
- }
- set type(type) {
- const c = String(types.code.get(type));
- if (types.isCode(c) || c === 'Unsupported') {
- this.#type = c;
- }
- else if (types.isCode(type)) {
- this.#type = type;
- }
- else {
- throw new TypeError('invalid entry type: ' + type);
- }
- }
-}
-exports.Header = Header;
-const splitPrefix = (p, prefixSize) => {
- const pathSize = 100;
- let pp = p;
- let prefix = '';
- let ret = undefined;
- const root = node_path_1.posix.parse(p).root || '.';
- if (Buffer.byteLength(pp) < pathSize) {
- ret = [pp, prefix, false];
- }
- else {
- // first set prefix to the dir, and path to the base
- prefix = node_path_1.posix.dirname(pp);
- pp = node_path_1.posix.basename(pp);
- do {
- if (Buffer.byteLength(pp) <= pathSize &&
- Buffer.byteLength(prefix) <= prefixSize) {
- // both fit!
- ret = [pp, prefix, false];
- }
- else if (Buffer.byteLength(pp) > pathSize &&
- Buffer.byteLength(prefix) <= prefixSize) {
- // prefix fits in prefix, but path doesn't fit in path
- ret = [pp.slice(0, pathSize - 1), prefix, true];
- }
- else {
- // make path take a bit from prefix
- pp = node_path_1.posix.join(node_path_1.posix.basename(prefix), pp);
- prefix = node_path_1.posix.dirname(prefix);
- }
- } while (prefix !== root && ret === undefined);
- // at this point, found no resolution, just truncate
- if (!ret) {
- ret = [p.slice(0, pathSize - 1), '', true];
- }
- }
- return ret;
-};
-const decString = (buf, off, size) => buf
- .subarray(off, off + size)
- .toString('utf8')
- .replace(/\0.*/, '');
-const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
-const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000);
-const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ?
- large.parse(buf.subarray(off, off + size))
- : decSmallNumber(buf, off, size);
-const nanUndef = (value) => (isNaN(value) ? undefined : value);
-const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf
- .subarray(off, off + size)
- .toString('utf8')
- .replace(/\0.*$/, '')
- .trim(), 8));
-// the maximum encodable as a null-terminated octal, by field size
-const MAXNUM = {
- 12: 0o77777777777,
- 8: 0o7777777,
-};
-const encNumber = (buf, off, size, num) => num === undefined ? false
- : num > MAXNUM[size] || num < 0 ?
- (large.encode(num, buf.subarray(off, off + size)), true)
- : (encSmallNumber(buf, off, size, num), false);
-const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii');
-const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size);
-const padOctal = (str, size) => (str.length === size - 1 ?
- str
- : new Array(size - str.length - 1).join('0') + str + ' ') + '\0';
-const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000));
-// enough to fill the longest string we've got
-const NULLS = new Array(156).join('\0');
-// pad with nulls, return true if it's longer or non-ascii
-const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'),
- str.length !== Buffer.byteLength(str) || str.length > size));
-//# sourceMappingURL=header.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/index.d.ts b/node_modules/tar/dist/commonjs/index.d.ts
deleted file mode 100644
index a582123..0000000
--- a/node_modules/tar/dist/commonjs/index.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export { type TarOptionsWithAliasesAsync, type TarOptionsWithAliasesAsyncFile, type TarOptionsWithAliasesAsyncNoFile, type TarOptionsWithAliasesSyncNoFile, type TarOptionsWithAliases, type TarOptionsWithAliasesFile, type TarOptionsWithAliasesSync, type TarOptionsWithAliasesSyncFile, } from './options.js';
-export * from './create.js';
-export { create as c } from './create.js';
-export * from './extract.js';
-export { extract as x } from './extract.js';
-export * from './header.js';
-export * from './list.js';
-export { list as t } from './list.js';
-export * from './pack.js';
-export * from './parse.js';
-export * from './pax.js';
-export * from './read-entry.js';
-export * from './replace.js';
-export { replace as r } from './replace.js';
-export * as types from './types.js';
-export * from './unpack.js';
-export * from './update.js';
-export { update as u } from './update.js';
-export * from './write-entry.js';
-//# sourceMappingURL=index.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/index.js b/node_modules/tar/dist/commonjs/index.js
deleted file mode 100644
index bd975c7..0000000
--- a/node_modules/tar/dist/commonjs/index.js
+++ /dev/null
@@ -1,64 +0,0 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __exportStar = (this && this.__exportStar) || function(m, exports) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
-};
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.u = exports.types = exports.r = exports.t = exports.x = exports.c = void 0;
-__exportStar(require("./create.js"), exports);
-var create_js_1 = require("./create.js");
-Object.defineProperty(exports, "c", { enumerable: true, get: function () { return create_js_1.create; } });
-__exportStar(require("./extract.js"), exports);
-var extract_js_1 = require("./extract.js");
-Object.defineProperty(exports, "x", { enumerable: true, get: function () { return extract_js_1.extract; } });
-__exportStar(require("./header.js"), exports);
-__exportStar(require("./list.js"), exports);
-var list_js_1 = require("./list.js");
-Object.defineProperty(exports, "t", { enumerable: true, get: function () { return list_js_1.list; } });
-// classes
-__exportStar(require("./pack.js"), exports);
-__exportStar(require("./parse.js"), exports);
-__exportStar(require("./pax.js"), exports);
-__exportStar(require("./read-entry.js"), exports);
-__exportStar(require("./replace.js"), exports);
-var replace_js_1 = require("./replace.js");
-Object.defineProperty(exports, "r", { enumerable: true, get: function () { return replace_js_1.replace; } });
-exports.types = __importStar(require("./types.js"));
-__exportStar(require("./unpack.js"), exports);
-__exportStar(require("./update.js"), exports);
-var update_js_1 = require("./update.js");
-Object.defineProperty(exports, "u", { enumerable: true, get: function () { return update_js_1.update; } });
-__exportStar(require("./write-entry.js"), exports);
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/index.min.js b/node_modules/tar/dist/commonjs/index.min.js
deleted file mode 100644
index c1fe035..0000000
--- a/node_modules/tar/dist/commonjs/index.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-"use strict";var d=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var We=d(F=>{"use strict";var Do=F&&F.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(F,"__esModule",{value:!0});F.Minipass=F.isWritable=F.isReadable=F.isStream=void 0;var kr=typeof process=="object"&&process?process:{stdout:null,stderr:null},ss=require("node:events"),qr=Do(require("node:stream")),Po=require("node:string_decoder"),No=s=>!!s&&typeof s=="object"&&(s instanceof Zt||s instanceof qr.default||(0,F.isReadable)(s)||(0,F.isWritable)(s));F.isStream=No;var Mo=s=>!!s&&typeof s=="object"&&s instanceof ss.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==qr.default.Writable.prototype.pipe;F.isReadable=Mo;var Lo=s=>!!s&&typeof s=="object"&&s instanceof ss.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function";F.isWritable=Lo;var ce=Symbol("EOF"),ue=Symbol("maybeEmitEnd"),we=Symbol("emittedEnd"),jt=Symbol("emittingEnd"),dt=Symbol("emittedError"),Ut=Symbol("closed"),xr=Symbol("read"),qt=Symbol("flush"),jr=Symbol("flushChunk"),K=Symbol("encoding"),Ue=Symbol("decoder"),R=Symbol("flowing"),mt=Symbol("paused"),qe=Symbol("resume"),O=Symbol("buffer"),I=Symbol("pipes"),v=Symbol("bufferLength"),Xi=Symbol("bufferPush"),Wt=Symbol("bufferShift"),N=Symbol("objectMode"),E=Symbol("destroyed"),Qi=Symbol("error"),Ji=Symbol("emitData"),Ur=Symbol("emitEnd"),es=Symbol("emitEnd2"),J=Symbol("async"),ts=Symbol("abort"),Ht=Symbol("aborted"),pt=Symbol("signal"),Ne=Symbol("dataListeners"),x=Symbol("discarded"),_t=s=>Promise.resolve().then(s),Ao=s=>s(),Io=s=>s==="end"||s==="finish"||s==="prefinish",Fo=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,Co=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Gt=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[qe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},is=class extends Gt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>this.dest.emit("error",r),e.on("error",this.proxyErrors)}},Bo=s=>!!s.objectMode,zo=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Zt=class extends ss.EventEmitter{[R]=!1;[mt]=!1;[I]=[];[O]=[];[N];[K];[J];[Ue];[ce]=!1;[we]=!1;[jt]=!1;[Ut]=!1;[dt]=null;[v]=0;[E]=!1;[pt];[Ht]=!1;[Ne]=0;[x]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Bo(t)?(this[N]=!0,this[K]=null):zo(t)?(this[K]=t.encoding,this[N]=!1):(this[N]=!1,this[K]=null),this[J]=!!t.async,this[Ue]=this[K]?new Po.StringDecoder(this[K]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[I]});let{signal:i}=t;i&&(this[pt]=i,i.aborted?this[ts]():i.addEventListener("abort",()=>this[ts]()))}get bufferLength(){return this[v]}get encoding(){return this[K]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[J]}set async(e){this[J]=this[J]||!!e}[ts](){this[Ht]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Ht]}set aborted(e){}write(e,t,i){if(this[Ht])return!1;if(this[ce])throw new Error("write after end");if(this[E])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[J]?_t:Ao;if(!this[N]&&!Buffer.isBuffer(e)){if(Co(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Fo(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[R]&&this[v]!==0&&this[qt](!0),this[R]?this.emit("data",e):this[Xi](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Ue]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Ue].write(e)),this[R]&&this[v]!==0&&this[qt](!0),this[R]?this.emit("data",e):this[Xi](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):(this[v]!==0&&this.emit("readable"),i&&r(i),this[R])}read(e){if(this[E])return null;if(this[x]=!1,this[v]===0||e===0||e&&e>this[v])return this[ue](),null;this[N]&&(e=null),this[O].length>1&&!this[N]&&(this[O]=[this[K]?this[O].join(""):Buffer.concat(this[O],this[v])]);let t=this[xr](e||null,this[O][0]);return this[ue](),t}[xr](e,t){if(this[N])this[Wt]();else{let i=t;e===i.length||e===null?this[Wt]():typeof i=="string"?(this[O][0]=i.slice(e),t=i.slice(0,e),this[v]-=e):(this[O][0]=i.subarray(e),t=i.subarray(0,e),this[v]-=e)}return this.emit("data",t),!this[O].length&&!this[ce]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[ce]=!0,this.writable=!1,(this[R]||!this[mt])&&this[ue](),this}[qe](){this[E]||(!this[Ne]&&!this[I].length&&(this[x]=!0),this[mt]=!1,this[R]=!0,this.emit("resume"),this[O].length?this[qt]():this[ce]?this[ue]():this.emit("drain"))}resume(){return this[qe]()}pause(){this[R]=!1,this[mt]=!0,this[x]=!1}get destroyed(){return this[E]}get flowing(){return this[R]}get paused(){return this[mt]}[Xi](e){this[N]?this[v]+=1:this[v]+=e.length,this[O].push(e)}[Wt](){return this[N]?this[v]-=1:this[v]-=this[O][0].length,this[O].shift()}[qt](e=!1){do;while(this[jr](this[Wt]())&&this[O].length);!e&&!this[O].length&&!this[ce]&&this.emit("drain")}[jr](e){return this.emit("data",e),this[R]}pipe(e,t){if(this[E])return e;this[x]=!1;let i=this[we];return t=t||{},e===kr.stdout||e===kr.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[I].push(t.proxyErrors?new is(this,e,t):new Gt(this,e,t)),this[J]?_t(()=>this[qe]()):this[qe]()),e}unpipe(e){let t=this[I].find(i=>i.dest===e);t&&(this[I].length===1?(this[R]&&this[Ne]===0&&(this[R]=!1),this[I]=[]):this[I].splice(this[I].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[x]=!1,this[Ne]++,!this[I].length&&!this[R]&&this[qe]();else if(e==="readable"&&this[v]!==0)super.emit("readable");else if(Io(e)&&this[we])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[dt]){let r=t;this[J]?_t(()=>r.call(this,this[dt])):r.call(this,this[dt])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Ne]=this.listeners("data").length,this[Ne]===0&&!this[x]&&!this[I].length&&(this[R]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ne]=0,!this[x]&&!this[I].length&&(this[R]=!1)),t}get emittedEnd(){return this[we]}[ue](){!this[jt]&&!this[we]&&!this[E]&&this[O].length===0&&this[ce]&&(this[jt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ut]&&this.emit("close"),this[jt]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==E&&this[E])return!1;if(e==="data")return!this[N]&&!i?!1:this[J]?(_t(()=>this[Ji](i)),!0):this[Ji](i);if(e==="end")return this[Ur]();if(e==="close"){if(this[Ut]=!0,!this[we]&&!this[E])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dt]=i,super.emit(Qi,i);let n=!this[pt]||this.listeners("error").length?super.emit("error",i):!1;return this[ue](),n}else if(e==="resume"){let n=super.emit("resume");return this[ue](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let r=super.emit(e,...t);return this[ue](),r}[Ji](e){for(let i of this[I])i.dest.write(e)===!1&&this.pause();let t=this[x]?!1:super.emit("data",e);return this[ue](),t}[Ur](){return this[we]?!1:(this[we]=!0,this.readable=!1,this[J]?(_t(()=>this[es]()),!0):this[es]())}[es](){if(this[Ue]){let t=this[Ue].end();if(t){for(let i of this[I])i.dest.write(t);this[x]||super.emit("data",t)}}for(let t of this[I])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[N]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[N]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[K]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[x]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[ce])return t();let n,o,a=u=>{this.off("data",h),this.off("end",l),this.off(E,c),t(),o(u)},h=u=>{this.off("error",a),this.off("end",l),this.off(E,c),this.pause(),n({value:u,done:!!this[ce]})},l=()=>{this.off("error",a),this.off("data",h),this.off(E,c),t(),n({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((u,b)=>{o=b,n=u,this.once(E,c),this.once("error",a),this.once("end",l),this.once("data",h)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[x]=!1;let e=!1,t=()=>(this.pause(),this.off(Qi,t),this.off(E,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(Qi,t),this.once(E,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit("error",e):this.emit(E),this;this[E]=!0,this[x]=!0,this[O].length=0,this[v]=0;let t=this;return typeof t.close=="function"&&!this[Ut]&&t.close(),e?this.emit("error",e):this.emit(E),this}static get isStream(){return F.isStream}};F.Minipass=Zt});var Ke=d(W=>{"use strict";var Wr=W&&W.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(W,"__esModule",{value:!0});W.WriteStreamSync=W.WriteStream=W.ReadStreamSync=W.ReadStream=void 0;var ko=Wr(require("events")),z=Wr(require("fs")),xo=We(),jo=z.default.writev,Ee=Symbol("_autoClose"),$=Symbol("_close"),wt=Symbol("_ended"),p=Symbol("_fd"),rs=Symbol("_finished"),de=Symbol("_flags"),ns=Symbol("_flush"),ls=Symbol("_handleChunk"),cs=Symbol("_makeBuf"),Et=Symbol("_mode"),Yt=Symbol("_needDrain"),Ze=Symbol("_onerror"),Ye=Symbol("_onopen"),os=Symbol("_onread"),He=Symbol("_onwrite"),be=Symbol("_open"),V=Symbol("_path"),ye=Symbol("_pos"),ee=Symbol("_queue"),Ge=Symbol("_read"),as=Symbol("_readSize"),fe=Symbol("_reading"),yt=Symbol("_remain"),hs=Symbol("_size"),Kt=Symbol("_write"),Me=Symbol("_writing"),Vt=Symbol("_defaultFlag"),Le=Symbol("_errored"),$t=class extends xo.Minipass{[Le]=!1;[p];[V];[as];[fe]=!1;[hs];[yt];[Ee];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Le]=!1,this[p]=typeof t.fd=="number"?t.fd:void 0,this[V]=e,this[as]=t.readSize||16*1024*1024,this[fe]=!1,this[hs]=typeof t.size=="number"?t.size:1/0,this[yt]=this[hs],this[Ee]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[p]=="number"?this[Ge]():this[be]()}get fd(){return this[p]}get path(){return this[V]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[be](){z.default.open(this[V],"r",(e,t)=>this[Ye](e,t))}[Ye](e,t){e?this[Ze](e):(this[p]=t,this.emit("open",t),this[Ge]())}[cs](){return Buffer.allocUnsafe(Math.min(this[as],this[yt]))}[Ge](){if(!this[fe]){this[fe]=!0;let e=this[cs]();if(e.length===0)return process.nextTick(()=>this[os](null,0,e));z.default.read(this[p],e,0,e.length,null,(t,i,r)=>this[os](t,i,r))}}[os](e,t,i){this[fe]=!1,e?this[Ze](e):this[ls](t,i)&&this[Ge]()}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ze](e){this[fe]=!0,this[$](),this.emit("error",e)}[ls](e,t){let i=!1;return this[yt]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[yt]<=0)&&(i=!1,this[$](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[p]=="number"&&this[Ge](),!1;case"error":return this[Le]?!1:(this[Le]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};W.ReadStream=$t;var us=class extends $t{[be](){let e=!0;try{this[Ye](null,z.default.openSync(this[V],"r")),e=!1}finally{e&&this[$]()}}[Ge](){let e=!0;try{if(!this[fe]){this[fe]=!0;do{let t=this[cs](),i=t.length===0?0:z.default.readSync(this[p],t,0,t.length,null);if(!this[ls](i,t))break}while(!0);this[fe]=!1}e=!1}finally{e&&this[$]()}}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.closeSync(e),this.emit("close")}}};W.ReadStreamSync=us;var Xt=class extends ko.default{readable=!1;writable=!0;[Le]=!1;[Me]=!1;[wt]=!1;[ee]=[];[Yt]=!1;[V];[Et];[Ee];[p];[Vt];[de];[rs]=!1;[ye];constructor(e,t){t=t||{},super(t),this[V]=e,this[p]=typeof t.fd=="number"?t.fd:void 0,this[Et]=t.mode===void 0?438:t.mode,this[ye]=typeof t.start=="number"?t.start:void 0,this[Ee]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[ye]!==void 0?"r+":"w";this[Vt]=t.flags===void 0,this[de]=t.flags===void 0?i:t.flags,this[p]===void 0&&this[be]()}emit(e,...t){if(e==="error"){if(this[Le])return!1;this[Le]=!0}return super.emit(e,...t)}get fd(){return this[p]}get path(){return this[V]}[Ze](e){this[$](),this[Me]=!0,this.emit("error",e)}[be](){z.default.open(this[V],this[de],this[Et],(e,t)=>this[Ye](e,t))}[Ye](e,t){this[Vt]&&this[de]==="r+"&&e&&e.code==="ENOENT"?(this[de]="w",this[be]()):e?this[Ze](e):(this[p]=t,this.emit("open",t),this[Me]||this[ns]())}end(e,t){return e&&this.write(e,t),this[wt]=!0,!this[Me]&&!this[ee].length&&typeof this[p]=="number"&&this[He](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wt]?(this.emit("error",new Error("write() after end()")),!1):this[p]===void 0||this[Me]||this[ee].length?(this[ee].push(e),this[Yt]=!0,!1):(this[Me]=!0,this[Kt](e),!0)}[Kt](e){z.default.write(this[p],e,0,e.length,this[ye],(t,i)=>this[He](t,i))}[He](e,t){e?this[Ze](e):(this[ye]!==void 0&&typeof t=="number"&&(this[ye]+=t),this[ee].length?this[ns]():(this[Me]=!1,this[wt]&&!this[rs]?(this[rs]=!0,this[$](),this.emit("finish")):this[Yt]&&(this[Yt]=!1,this.emit("drain"))))}[ns](){if(this[ee].length===0)this[wt]&&this[He](null,0);else if(this[ee].length===1)this[Kt](this[ee].pop());else{let e=this[ee];this[ee]=[],jo(this[p],e,this[ye],(t,i)=>this[He](t,i))}}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};W.WriteStream=Xt;var fs=class extends Xt{[be](){let e;if(this[Vt]&&this[de]==="r+")try{e=z.default.openSync(this[V],this[de],this[Et])}catch(t){if(t?.code==="ENOENT")return this[de]="w",this[be]();throw t}else e=z.default.openSync(this[V],this[de],this[Et]);this[Ye](null,e)}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.closeSync(e),this.emit("close")}}[Kt](e){let t=!0;try{this[He](null,z.default.writeSync(this[p],e,0,e.length,this[ye])),t=!1}finally{if(t)try{this[$]()}catch{}}}};W.WriteStreamSync=fs});var Qt=d(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.dealias=S.isNoFile=S.isFile=S.isAsync=S.isSync=S.isAsyncNoFile=S.isSyncNoFile=S.isAsyncFile=S.isSyncFile=void 0;var Uo=new Map([["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","onReadEntry"]]),qo=s=>!!s.sync&&!!s.file;S.isSyncFile=qo;var Wo=s=>!s.sync&&!!s.file;S.isAsyncFile=Wo;var Ho=s=>!!s.sync&&!s.file;S.isSyncNoFile=Ho;var Go=s=>!s.sync&&!s.file;S.isAsyncNoFile=Go;var Zo=s=>!!s.sync;S.isSync=Zo;var Yo=s=>!s.sync;S.isAsync=Yo;var Ko=s=>!!s.file;S.isFile=Ko;var Vo=s=>!s.file;S.isNoFile=Vo;var $o=s=>{let e=Uo.get(s);return e||s},Xo=(s={})=>{if(!s)return{};let e={};for(let[t,i]of Object.entries(s)){let r=$o(t);e[r]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};S.dealias=Xo});var Ve=d(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.makeCommand=void 0;var bt=Qt(),Qo=(s,e,t,i,r)=>Object.assign((n=[],o,a)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(a=o,o=void 0),o=o?Array.from(o):[];let h=(0,bt.dealias)(n);if(r?.(h,o),(0,bt.isSyncFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return s(h,o)}else if((0,bt.isAsyncFile)(h)){let l=e(h,o);return a?l.then(()=>a(),a):l}else if((0,bt.isSyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return t(h,o)}else if((0,bt.isAsyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback only supported with file option");return i(h,o)}throw new Error("impossible options??")},{syncFile:s,asyncFile:e,syncNoFile:t,asyncNoFile:i,validate:r});Jt.makeCommand=Qo});var ds=d($e=>{"use strict";var Jo=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty($e,"__esModule",{value:!0});$e.constants=void 0;var ea=Jo(require("zlib")),ta=ea.default.constants||{ZLIB_VERNUM:4736};$e.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},ta))});var Ps=d(f=>{"use strict";var ia=f&&f.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),sa=f&&f.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ra=f&&f.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ia(t,e,i[r]);return sa(t,e),t}})(),na=f&&f.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(f,"__esModule",{value:!0});f.ZstdDecompress=f.ZstdCompress=f.BrotliDecompress=f.BrotliCompress=f.Unzip=f.InflateRaw=f.DeflateRaw=f.Gunzip=f.Gzip=f.Inflate=f.Deflate=f.Zlib=f.ZlibError=f.constants=void 0;var _s=na(require("assert")),Ae=require("buffer"),oa=We(),Hr=ra(require("zlib")),te=ds(),aa=ds();Object.defineProperty(f,"constants",{enumerable:!0,get:function(){return aa.constants}});var ha=Ae.Buffer.concat,Gr=Object.getOwnPropertyDescriptor(Ae.Buffer,"concat"),la=s=>s,ms=Gr?.writable===!0||Gr?.set!==void 0?s=>{Ae.Buffer.concat=s?la:ha}:s=>{},Ie=Symbol("_superWrite"),Fe=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};f.ZlibError=Fe;var ps=Symbol("flushFlag"),St=class extends oa.Minipass{#e=!1;#i=!1;#s;#n;#r;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof Hr[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#t=new Hr[t](e)}catch(i){throw new Fe(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Fe(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,_s.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(Ae.Buffer.alloc(0),{[ps]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Ie](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=Ae.Buffer.from(e,t)),this.#e)return;(0,_s.default)(this.#t,"zlib binding closed");let r=this.#t._handle,n=r.close;r.close=()=>{};let o=this.#t.close;this.#t.close=()=>{},ms(!0);let a;try{let l=typeof e[ps]=="number"?e[ps]:this.#s;a=this.#t._processChunk(e,l),ms(!1)}catch(l){ms(!1),this.#o(new Fe(l,this.write))}finally{this.#t&&(this.#t._handle=r,r.close=n,this.#t.close=o,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",l=>this.#o(new Fe(l,this.write)));let h;if(a)if(Array.isArray(a)&&a.length>0){let l=a[0];h=this[Ie](Ae.Buffer.from(l));for(let c=1;c<a.length;c++)h=this[Ie](a[c])}else h=this[Ie](Ae.Buffer.from(a));return i&&i(),h}},ie=class extends St{#e;#i;constructor(e,t){e=e||{},e.flush=e.flush||te.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||te.constants.Z_FINISH,e.fullFlushFlag=te.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#i!==t){this.flush(te.constants.Z_SYNC_FLUSH),(0,_s.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(r,n)=>{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}};f.Zlib=ie;var ws=class extends ie{constructor(e){super(e,"Deflate")}};f.Deflate=ws;var ys=class extends ie{constructor(e){super(e,"Inflate")}};f.Inflate=ys;var Es=class extends ie{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Ie](e){return this.#e?(this.#e=!1,e[9]=255,super[Ie](e)):super[Ie](e)}};f.Gzip=Es;var bs=class extends ie{constructor(e){super(e,"Gunzip")}};f.Gunzip=bs;var Ss=class extends ie{constructor(e){super(e,"DeflateRaw")}};f.DeflateRaw=Ss;var gs=class extends ie{constructor(e){super(e,"InflateRaw")}};f.InflateRaw=gs;var Rs=class extends ie{constructor(e){super(e,"Unzip")}};f.Unzip=Rs;var ei=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||te.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=te.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},Os=class extends ei{constructor(e){super(e,"BrotliCompress")}};f.BrotliCompress=Os;var vs=class extends ei{constructor(e){super(e,"BrotliDecompress")}};f.BrotliDecompress=vs;var ti=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||te.constants.ZSTD_e_end,e.fullFlushFlag=te.constants.ZSTD_e_flush,super(e,t)}},Ts=class extends ti{constructor(e){super(e,"ZstdCompress")}};f.ZstdCompress=Ts;var Ds=class extends ti{constructor(e){super(e,"ZstdDecompress")}};f.ZstdDecompress=Ds});var Kr=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.parse=Xe.encode=void 0;var ca=(s,e)=>{if(Number.isSafeInteger(s))s<0?fa(s,e):ua(s,e);else throw Error("cannot encode number outside of javascript safe integer range");return e};Xe.encode=ca;var ua=(s,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=s&255,s=Math.floor(s/256)},fa=(s,e)=>{e[0]=255;var t=!1;s=s*-1;for(var i=e.length;i>1;i--){var r=s&255;s=Math.floor(s/256),t?e[i-1]=Zr(r):r===0?e[i-1]=0:(t=!0,e[i-1]=Yr(r))}},da=s=>{let e=s[0],t=e===128?pa(s.subarray(1,s.length)):e===255?ma(s):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};Xe.parse=da;var ma=s=>{for(var e=s.length,t=0,i=!1,r=e-1;r>-1;r--){var n=Number(s[r]),o;i?o=Zr(n):n===0?o=n:(i=!0,o=Yr(n)),o!==0&&(t-=o*Math.pow(256,e-r-1))}return t},pa=s=>{for(var e=s.length,t=0,i=e-1;i>-1;i--){var r=Number(s[i]);r!==0&&(t+=r*Math.pow(256,e-i-1))}return t},Zr=s=>(255^s)&255,Yr=s=>(255^s)+1&255});var Ns=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.code=C.name=C.normalFsTypes=C.isName=C.isCode=void 0;var _a=s=>C.name.has(s);C.isCode=_a;var wa=s=>C.code.has(s);C.isName=wa;C.normalFsTypes=new Set(["0","","1","2","3","4","5","6","7","D"]);C.name=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"]]);C.code=new Map(Array.from(C.name).map(s=>[s[1],s[0]]))});var et=d(se=>{"use strict";var ya=se&&se.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ea=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Vr=se&&se.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ya(t,e,i[r]);return Ea(t,e),t}})();Object.defineProperty(se,"__esModule",{value:!0});se.Header=void 0;var Qe=require("node:path"),$r=Vr(Kr()),Je=Vr(Ns()),ba=s=>s===void 0||s<0?void 0:s,As=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,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#i(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");let n=Ce(e,t+156,1),o=Je.normalFsTypes.has(n),a=o?i:void 0,h=o?r:void 0;if(this.path=a?.path??Ce(e,t,100),this.mode=a?.mode??h?.mode??Se(e,t+100,8),this.uid=a?.uid??h?.uid??Se(e,t+108,8),this.gid=a?.gid??h?.gid??Se(e,t+116,8),this.size=ba(a?.size??h?.size??Se(e,t+124,12)),this.mtime=a?.mtime??h?.mtime??Ms(e,t+136,12),this.cksum=Se(e,t+148,12),h&&this.#i(h,!0),a&&this.#i(a),Je.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ce(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=a?.uname??h?.uname??Ce(e,t+265,32),this.gname=a?.gname??h?.gname??Ce(e,t+297,32),this.devmaj=a?.devmaj??h?.devmaj??Se(e,t+329,8)??0,this.devmin=a?.devmin??h?.devmin??Se(e,t+337,8)??0,e[t+475]!==0){let c=Ce(e,t+345,155);this.path=c+"/"+this.path}else{let c=Ce(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=i?.atime??r?.atime??Ms(e,t+476,12),this.ctime=i?.ctime??r?.ctime??Ms(e,t+488,12)}let l=256;for(let c=t;c<t+148;c++)l+=e[c];for(let c=t+156;c<t+512;c++)l+=e[c];this.cksumValid=l===this.cksum,this.cksum===void 0&&l===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="size"&&Number(r)<0||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=Sa(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=Be(e,t,100,n)||this.needPax,this.needPax=ge(e,t+100,8,this.mode)||this.needPax,this.needPax=ge(e,t+108,8,this.uid)||this.needPax,this.needPax=ge(e,t+116,8,this.gid)||this.needPax,this.needPax=ge(e,t+124,12,this.size)||this.needPax,this.needPax=Ls(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=Be(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Be(e,t+265,32,this.uname)||this.needPax,this.needPax=Be(e,t+297,32,this.gname)||this.needPax,this.needPax=ge(e,t+329,8,this.devmaj)||this.needPax,this.needPax=ge(e,t+337,8,this.devmin)||this.needPax,this.needPax=Be(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=Be(e,t+345,155,o)||this.needPax:(this.needPax=Be(e,t+345,130,o)||this.needPax,this.needPax=Ls(e,t+476,12,this.atime)||this.needPax,this.needPax=Ls(e,t+488,12,this.ctime)||this.needPax);let a=256;for(let h=t;h<t+148;h++)a+=e[h];for(let h=t+156;h<t+512;h++)a+=e[h];return this.cksum=a,ge(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Je.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Je.code.get(e));if(Je.isCode(t)||t==="Unsupported")this.#e=t;else if(Je.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};se.Header=As;var Sa=(s,e)=>{let i=s,r="",n,o=Qe.posix.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Qe.posix.dirname(i),i=Qe.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=e?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=e?n=[i.slice(0,99),r,!0]:(i=Qe.posix.join(Qe.posix.basename(r),i),r=Qe.posix.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},Ce=(s,e,t)=>s.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),Ms=(s,e,t)=>ga(Se(s,e,t)),ga=s=>s===void 0?void 0:new Date(s*1e3),Se=(s,e,t)=>Number(s[e])&128?$r.parse(s.subarray(e,e+t)):Oa(s,e,t),Ra=s=>isNaN(s)?void 0:s,Oa=(s,e,t)=>Ra(parseInt(s.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),va={12:8589934591,8:2097151},ge=(s,e,t,i)=>i===void 0?!1:i>va[t]||i<0?($r.encode(i,s.subarray(e,e+t)),!0):(Ta(s,e,t,i),!1),Ta=(s,e,t,i)=>s.write(Da(i,t),e,t,"ascii"),Da=(s,e)=>Pa(Math.floor(s).toString(8),e),Pa=(s,e)=>(s.length===e-1?s:new Array(e-s.length-1).join("0")+s+" ")+"\0",Ls=(s,e,t,i)=>i===void 0?!1:ge(s,e,t,i.getTime()/1e3),Na=new Array(156).join("\0"),Be=(s,e,t,i)=>i===void 0?!1:(s.write(i+Na,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t)});var si=d(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Pax=void 0;var Ma=require("node:path"),La=et(),Is=class s{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 Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new La.Header({path:("PaxHeader/"+(0,Ma.basename)(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(r),r.write(e,512,t,"utf8");for(let n=t+512;n<r.length;n++)r[n]=0;return r}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],i=t instanceof Date?t.getTime()/1e3:t,r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+i+`
-`,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(e,t,i=!1){return new s(Aa(Ia(e),t),i)}};ii.Pax=Is;var Aa=(s,e)=>e?Object.assign({},e,s):s,Ia=s=>s.replace(/\n$/,"").split(`
-`).reduce(Fa,Object.create(null)),Fa=(s,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return s;e=e.slice((t+" ").length);let i=e.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=").replace(/\0.*/,"");switch(n){case"path":case"linkpath":case"type":case"charset":case"comment":case"gname":case"uname":s[n]=o;break;case"ctime":case"atime":case"mtime":s[n]=new Date(Number(o)*1e3);break;case"size":let a=+o;a>=0&&(s[n]=a);break;case"gid":case"uid":case"dev":case"ino":case"nlink":case"mode":s[n]=+o;break}return s}});var tt=d(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.normalizeWindowsPath=void 0;var Ca=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;ri.normalizeWindowsPath=Ca!=="win32"?s=>String(s):s=>String(s).replaceAll(/\\/g,"/")});var Cs=d(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ReadEntry=void 0;var Ba=We(),ni=tt(),Fs=class extends Ba.Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,ni.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,ni.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=(0,ni.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,ni.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t))))}};oi.ReadEntry=Fs});var hi=d(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.warnMethod=void 0;var za=(s,e,t,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!s.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),s.emit("warn",e,t,i)):t instanceof Error?s.emit("error",Object.assign(t,i)):s.emit("error",Object.assign(new Error(`${e}: ${t}`),i))};ai.warnMethod=za});var _i=d(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.Parser=void 0;var ka=require("events"),Bs=Ps(),Xr=et(),Qr=si(),xa=Cs(),ja=hi(),Ua=1024*1024,qs=Buffer.from([31,139]),Ws=Buffer.from([40,181,47,253]),qa=Math.max(qs.length,Ws.length),H=Symbol("state"),ze=Symbol("writeEntry"),me=Symbol("readEntry"),zs=Symbol("nextEntry"),Jr=Symbol("processEntry"),re=Symbol("extendedHeader"),gt=Symbol("globalExtendedHeader"),Re=Symbol("meta"),en=Symbol("emitMeta"),_=Symbol("buffer"),pe=Symbol("queue"),Oe=Symbol("ended"),ks=Symbol("emittedEnd"),ke=Symbol("emit"),y=Symbol("unzip"),li=Symbol("consumeChunk"),ci=Symbol("consumeChunkSub"),xs=Symbol("consumeBody"),tn=Symbol("consumeMeta"),sn=Symbol("consumeHeader"),Rt=Symbol("consuming"),js=Symbol("bufferConcat"),ui=Symbol("maybeEnd"),it=Symbol("writing"),ne=Symbol("aborted"),fi=Symbol("onDone"),xe=Symbol("sawValidEntry"),di=Symbol("sawNullBlock"),mi=Symbol("sawEOF"),rn=Symbol("closeStream"),Wa=1e3,Ot=Symbol("compressedBytesRead"),Us=Symbol("decompressedBytesRead"),nn=Symbol("checkDecompressionRatio"),Ha=()=>!0,Hs=class extends ka.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;maxDecompressionRatio;writable=!0;readable=!1;[pe]=[];[_];[me];[ze];[H]="begin";[Re]="";[re];[gt];[Oe]=!1;[y];[ne]=!1;[xe];[di]=!1;[mi]=!1;[it]=!1;[Rt]=!1;[ks]=!1;[Ot]=0;[Us]=0;constructor(e={}){super(),this.file=e.file||"",this.on(fi,()=>{(this[H]==="begin"||this[xe]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(fi,e.ondone):this.on(fi,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxDecompressionRatio=typeof e.maxDecompressionRatio=="number"?e.maxDecompressionRatio:Wa,this.maxMetaEntrySize=e.maxMetaEntrySize||Ua,this.filter=typeof e.filter=="function"?e.filter:Ha;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[rn]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){(0,ja.warnMethod)(this,e,t,i)}[sn](e,t){this[xe]===void 0&&(this[xe]=!1);let i;try{i=new Xr.Header(e,t,this[re],this[gt])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[di]?(this[mi]=!0,this[H]==="begin"&&(this[H]="header"),this[ke]("eof")):(this[di]=!0,this[ke]("nullBlock"));else if(this[di]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[ze]=new xa.ReadEntry(i,this[re],this[gt]);if(!this[xe])if(n.remain){let o=()=>{n.invalid||(this[xe]=!0)};n.on("end",o)}else this[xe]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[ke]("ignoredEntry",n),this[H]="ignore",n.resume()):n.size>0&&(this[Re]="",n.on("data",o=>this[Re]+=o),this[H]="meta"):(this[re]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[ke]("ignoredEntry",n),this[H]=n.remain?"ignore":"header",n.resume()):(n.remain?this[H]="body":(this[H]="header",n.end()),this[me]?this[pe].push(n):(this[pe].push(n),this[zs]())))}}}[rn](){queueMicrotask(()=>this.emit("close"))}[Jr](e){let t=!0;if(!e)this[me]=void 0,t=!1;else if(Array.isArray(e)){let[i,...r]=e;this.emit(i,...r)}else this[me]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[zs]()),t=!1);return t}[zs](){do;while(this[Jr](this[pe].shift()));if(this[pe].length===0){let e=this[me];!e||e.flowing||e.size===e.remain?this[it]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[xs](e,t){let i=this[ze];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&t===0?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[H]="header",this[ze]=void 0,i.end()),n.length}[tn](e,t){let i=this[ze],r=this[xs](e,t);return!this[ze]&&i&&this[en](i),r}[ke](e,t,i){this[pe].length===0&&!this[me]?this.emit(e,t,i):this[pe].push([e,t,i])}[en](e){switch(this[ke]("meta",this[Re]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[re]=Qr.Pax.parse(this[Re],this[re],!1);break;case"GlobalExtendedHeader":this[gt]=Qr.Pax.parse(this[Re],this[gt],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[re]??Object.create(null);this[re]=t,t.path=this[Re].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[re]||Object.create(null);this[re]=t,t.linkpath=this[Re].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){if(!this[ne]){if(this[y]){let t=this[y];t.write=()=>!0,t.end=()=>t,t.emit=()=>!1,t.destroy?.()}this[ne]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}}[nn](e){this[Us]+=e.length;let t=this[Us]/this[Ot];return t>this.maxDecompressionRatio?(this.abort(new Error(`max decompression ratio exceeded: ${t.toFixed(2)} > ${this.maxDecompressionRatio}`)),!1):!0}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[ne])return i?.(),!1;if((this[y]===void 0||this.brotli===void 0&&this[y]===!1)&&e){if(this[_]&&(e=Buffer.concat([this[_],e]),this[_]=void 0),e.length<qa)return this[_]=e,i?.(),!0;for(let h=0;this[y]===void 0&&h<qs.length;h++)e[h]!==qs[h]&&(this[y]=!1);let o=!1;if(this[y]===!1&&this.zstd!==!1){o=!0;for(let h=0;h<Ws.length;h++)if(e[h]!==Ws[h]){o=!1;break}}let a=this.brotli===void 0&&!o;if(this[y]===!1&&a)if(e.length<512)if(this[Oe])this.brotli=!0;else return this[_]=e,i?.(),!0;else try{new Xr.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[y]===void 0||this[y]===!1&&(this.brotli||o)){let h=this[Oe];this[Oe]=!1,this[y]=this[y]===void 0?new Bs.Unzip({}):o?new Bs.ZstdDecompress({}):new Bs.BrotliDecompress({}),this[y].on("data",c=>{this[nn](c)&&this[li](c)}),this[y].on("error",c=>{this[ne]||this.abort(c)}),this[y].on("end",()=>{this[Oe]=!0,this[li]()}),this[it]=!0,this[Ot]+=e.length;let l=!!this[y][h?"end":"write"](e);return this[it]=!1,i?.(),l}}this[it]=!0,this[y]?(this[Ot]+=e.length,this[y].write(e)):this[li](e),this[it]=!1;let n=this[pe].length>0?!1:this[me]?this[me].flowing:!0;return!n&&this[pe].length===0&&this[me]?.once("drain",()=>this.emit("drain")),i?.(),n}[js](e){e&&!this[ne]&&(this[_]=this[_]?Buffer.concat([this[_],e]):e)}[ui](){if(this[Oe]&&!this[ks]&&!this[ne]&&!this[Rt]){this[ks]=!0;let e=this[ze];if(e?.blockRemain){let t=this[_]?this[_].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[_]&&e.write(this[_]),e.end()}this[ke](fi)}}[li](e){if(this[Rt]&&e)this[js](e);else if(!e&&!this[_])this[ui]();else if(e){if(this[Rt]=!0,this[_]){this[js](e);let t=this[_];this[_]=void 0,this[ci](t)}else this[ci](e);for(;this[_]&&this[_]?.length>=512&&!this[ne]&&!this[mi];){let t=this[_];this[_]=void 0,this[ci](t)}this[Rt]=!1}(!this[_]||this[Oe])&&this[ui]()}[ci](e){let t=0,i=e.length;for(;t+512<=i&&!this[ne]&&!this[mi];)switch(this[H]){case"begin":case"header":this[sn](e,t),t+=512;break;case"ignore":case"body":t+=this[xs](e,t);break;case"meta":t+=this[tn](e,t);break;default:throw new Error("invalid state: "+this[H])}t<i&&(this[_]=this[_]?Buffer.concat([e.subarray(t),this[_]]):e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[ne]||(this[y]?(e&&(this[Ot]+=e.length,this[y].write(e)),this[y].end()):(this[Oe]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[ui]())),this}};pi.Parser=Hs});var yi=d(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.stripTrailingSlashes=void 0;var Ga=s=>{let e=s.length-1,t=-1;for(;e>-1&&s.charAt(e)==="/";)t=e,e--;return t===-1?s:s.slice(0,t)};wi.stripTrailingSlashes=Ga});var rt=d(B=>{"use strict";var Za=B&&B.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ya=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ka=B&&B.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Za(t,e,i[r]);return Ya(t,e),t}})(),Va=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.list=B.filesFilter=void 0;var $a=Ka(Ke()),st=Va(require("node:fs")),on=require("path"),Xa=Ve(),Ei=_i(),Gs=yi(),Qa=s=>{let e=s.onReadEntry;s.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},Ja=(s,e)=>{let t=new Map(e.map(o=>[(0,Gs.stripTrailingSlashes)(o),!0])),i=s.filter,r=100,n=(o,a="",h=0)=>{if(h>=r)return t.set(o,!1),!1;let l=a||(0,on.parse)(o).root||".",c;if(o===l)c=!1;else{let u=t.get(o);c=u!==void 0?u:n((0,on.dirname)(o),l,h+1)}return t.set(o,c),c};s.filter=i?(o,a)=>i(o,a)&&n((0,Gs.stripTrailingSlashes)(o)):o=>n((0,Gs.stripTrailingSlashes)(o))};B.filesFilter=Ja;var eh=s=>{let e=new Ei.Parser(s),t=s.file,i;try{i=st.default.openSync(t,"r");let r=st.default.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),a=st.default.readSync(i,o,0,r.size,0);e.end(a===o.byteLength?o:o.subarray(0,a))}else{let o=0,a=Buffer.allocUnsafe(n);for(;o<r.size;){let h=st.default.readSync(i,a,0,n,o);if(h===0)break;o+=h,e.write(a.subarray(0,h))}e.end()}}finally{if(typeof i=="number")try{st.default.closeSync(i)}catch{}}},th=(s,e)=>{let t=new Ei.Parser(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("end",o),st.default.stat(r,(h,l)=>{if(h)a(h);else{let c=new $a.ReadStream(r,{readSize:i,size:l.size});c.on("error",a),c.pipe(t)}})})};B.list=(0,Xa.makeCommand)(eh,th,s=>new Ei.Parser(s),s=>new Ei.Parser(s),(s,e)=>{e?.length&&(0,B.filesFilter)(s,e),s.noResume||Qa(s)})});var an=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.modeFix=void 0;var ih=(s,e,t)=>(s&=4095,t&&(s=(s|384)&-19),e&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);bi.modeFix=ih});var Zs=d(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.stripAbsolutePath=void 0;var sh=require("node:path"),{isAbsolute:rh,parse:hn}=sh.win32,nh=s=>{let e="",t=hn(s);for(;rh(s)||t.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":t.root;s=s.slice(i.length),e+=i,t=hn(s)}return[e,s]};Si.stripAbsolutePath=nh});var Ks=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decode=nt.encode=void 0;var gi=["|","<",">","?",":"],Ys=gi.map(s=>String.fromCodePoint(61440+Number(s.codePointAt(0)))),oh=new Map(gi.map((s,e)=>[s,Ys[e]])),ah=new Map(Ys.map((s,e)=>[s,gi[e]])),hh=s=>gi.reduce((e,t)=>e.split(t).join(oh.get(t)),s);nt.encode=hh;var lh=s=>Ys.reduce((e,t)=>e.split(t).join(ah.get(t)),s);nt.decode=lh});var nr=d(M=>{"use strict";var ch=M&&M.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),uh=M&&M.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fh=M&&M.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ch(t,e,i[r]);return uh(t,e),t}})(),mn=M&&M.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(M,"__esModule",{value:!0});M.WriteEntryTar=M.WriteEntrySync=M.WriteEntry=void 0;var ae=mn(require("fs")),pn=We(),ln=mn(require("path")),_n=et(),wn=an(),oe=tt(),yn=Qt(),En=si(),bn=Zs(),dh=yi(),Sn=hi(),mh=fh(Ks()),gn=(s,e)=>e?(s=(0,oe.normalizeWindowsPath)(s).replace(/^\.(\/|$)/,""),(0,dh.stripTrailingSlashes)(e)+"/"+s):(0,oe.normalizeWindowsPath)(s),ph=16*1024*1024,cn=Symbol("process"),un=Symbol("file"),fn=Symbol("directory"),$s=Symbol("symlink"),dn=Symbol("hardlink"),vt=Symbol("header"),Ri=Symbol("read"),Xs=Symbol("lstat"),Oi=Symbol("onlstat"),Qs=Symbol("onread"),Js=Symbol("onreadlink"),er=Symbol("openfile"),tr=Symbol("onopenfile"),ve=Symbol("close"),vi=Symbol("mode"),ir=Symbol("awaitDrain"),Vs=Symbol("ondrain"),he=Symbol("prefix"),Ti=class extends pn.Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=(0,yn.dealias)(t);super(),this.path=(0,oe.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||ph,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,oe.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,oe.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,a]=(0,bn.stripAbsolutePath)(this.path);o&&typeof a=="string"&&(this.path=a,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=mh.decode(this.path.replaceAll(/\\/g,"/")),e=e.replaceAll(/\\/g,"/")),this.absolute=(0,oe.normalizeWindowsPath)(i.absolute||ln.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[Oi](n):this[Xs]()}warn(e,t,i={}){return(0,Sn.warnMethod)(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Xs](){ae.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Oi](t)})}[Oi](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=_h(e),this.emit("stat",e),this[cn]()}[cn](){switch(this.type){case"File":return this[un]();case"Directory":return this[fn]();case"SymbolicLink":return this[$s]();default:return this.end()}}[vi](e){return(0,wn.modeFix)(e,this.type==="Directory",this.portable)}[he](e){return gn(e,this.prefix)}[vt](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new _n.Header({path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,mode:this[vi](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new En.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[fn](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[vt](),this.end()}[$s](){ae.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Js](t)})}[Js](e){this.linkpath=(0,oe.normalizeWindowsPath)(e),this[vt](),this.end()}[dn](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,oe.normalizeWindowsPath)(ln.default.relative(this.cwd,e)),this.stat.size=0,this[vt](),this.end()}[un](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[dn](t);this.linkCache.set(e,this.absolute)}if(this[vt](),this.stat.size===0)return this.end();this[er]()}[er](){ae.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[tr](t)})}[tr](e){if(this.fd=e,this.#e)return this[ve]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Ri]()}[Ri](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");ae.default.read(e,t,i,r,n,(o,a)=>{if(o)return this[ve](()=>this.emit("error",o));this[Qs](a)})}[ve](e=()=>{}){this.fd!==void 0&&ae.default.close(this.fd,e)}[Qs](e){if(e<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(e>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let r=e;r<this.length&&e<this.blockRemain;r++)this.buf[r+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Vs]():this[ir](()=>this[Vs]())}[ir](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let r=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[Vs](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[ve](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[Ri]()}};M.WriteEntry=Ti;var sr=class extends Ti{sync=!0;[Xs](){this[Oi](ae.default.lstatSync(this.absolute))}[$s](){this[Js](ae.default.readlinkSync(this.absolute))}[er](){this[tr](ae.default.openSync(this.absolute,"r"))}[Ri](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:o}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let a=ae.default.readSync(t,i,r,n,o);this[Qs](a),e=!1}finally{if(e)try{this[ve](()=>{})}catch{}}}[ir](e){e()}[ve](e=()=>{}){this.fd!==void 0&&ae.default.closeSync(this.fd),e()}};M.WriteEntrySync=sr;var rr=class extends pn.Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return(0,Sn.warnMethod)(this,e,t,i)}constructor(e,t={}){let i=(0,yn.dealias)(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,oe.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[vi](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,oe.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[a,h]=(0,bn.stripAbsolutePath)(this.path);a&&typeof h=="string"&&(this.path=h,n=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new _n.Header({path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new En.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),e.pipe(this)}[he](e){return gn(e,this.prefix)}[vi](e){return(0,wn.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};M.WriteEntryTar=rr;var _h=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported"});var Rn=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.Node=at.Yallist=void 0;var or=class s{tail;head;length=0;static create(e=[]){return new s(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t<i;t++)yh(this,e[t]);return this.length}unshift(...e){for(var t=0,i=e.length;t<i;t++)Eh(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,r=0;i;r++)e.call(t,i.value,r,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,r=this.length-1;i;r--)e.call(t,i.value,r,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new s;for(let r=this.head;r;)i.push(e.call(t,r.value,this)),r=r.next;return i}mapReverse(e,t){t=t||this;var i=new s;for(let r=this.tail;r;)i.push(e.call(t,r.value,this)),r=r.prev;return i}reduce(e,t){let i,r=this.head;if(arguments.length>1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=e(i,r.value,n),r=r.prev;return i}toArray(){let e=new Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<t;n++,r=r.next)i.push(r.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let o=0;r&&o<e;o++)r=r.next;let n=[];for(let o=0;r&&o<t;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of i)r=wh(this,r,o);return n}reverse(){let e=this.head,t=this.tail;for(let i=e;i;i=i.prev){let r=i.prev;i.prev=i.next,i.next=r}return this.head=t,this.tail=e,this}};at.Yallist=or;function wh(s,e,t){let i=e,r=e?e.next:s.head,n=new ot(t,i,r,s);return n.next===void 0&&(s.tail=n),n.prev===void 0&&(s.head=n),s.length++,n}function yh(s,e){s.tail=new ot(e,s.tail,void 0,s),s.head||(s.head=s.tail),s.length++}function Eh(s,e){s.head=new ot(e,void 0,s.head,s),s.tail||(s.tail=s.head),s.length++}var ot=class{list;next;prev;value;constructor(e,t,i,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};at.Node=ot});var Ci=d(L=>{"use strict";var bh=L&&L.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Sh=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),gh=L&&L.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&bh(t,e,i[r]);return Sh(t,e),t}})(),Pn=L&&L.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(L,"__esModule",{value:!0});L.PackSync=L.Pack=L.PackJob=void 0;var Ii=Pn(require("fs")),fr=nr(),Nt=class{path;absolute;entry;stat;readdir;pending=!1;pendingLink=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};L.PackJob=Nt;var Rh=We(),ar=gh(Ps()),Oh=Rn(),vh=hi(),On=Buffer.alloc(1024),Pi=Symbol("onStat"),Tt=Symbol("ended"),X=Symbol("queue"),Dt=Symbol("pendingLinks"),Te=Symbol("current"),je=Symbol("process"),Pt=Symbol("processing"),Di=Symbol("processJob"),Q=Symbol("jobs"),hr=Symbol("jobDone"),Ni=Symbol("addFSEntry"),vn=Symbol("addTarEntry"),dr=Symbol("stat"),mr=Symbol("readdir"),Mi=Symbol("onreaddir"),Li=Symbol("pipe"),Tn=Symbol("entry"),lr=Symbol("entryOpt"),Ai=Symbol("writeEntryClass"),Nn=Symbol("write"),cr=Symbol("ondrain"),Dn=Pn(require("path")),ur=tt(),Fi=class extends Rh.Minipass{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Ai];onWriteEntry;[X];[Dt]=new Map;[Q]=0;[Pt]=!1;[Tt]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,ur.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[Ai]=fr.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ar.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new ar.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new ar.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[cr]()),this.on("resume",()=>t.resume())}else this.on("drain",this[cr]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[X]=new Oh.Yallist,this[Q]=0,this.jobs=Number(e.jobs)||4,this[Pt]=!1,this[Tt]=!1}[Nn](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[Tt]=!0,this[je](),i&&i(),this}write(e){if(this[Tt])throw new Error("write after end");return typeof e=="string"?this[Ni](e):this[vn](e),this.flowing}[vn](e){let t=(0,ur.normalizeWindowsPath)(Dn.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Nt(e.path,t);i.entry=new fr.WriteEntryTar(e,this[lr](i)),i.entry.on("end",()=>this[hr](i)),this[Q]+=1,this[X].push(i)}this[je]()}[Ni](e){let t=(0,ur.normalizeWindowsPath)(Dn.default.resolve(this.cwd,e));this[X].push(new Nt(e,t)),this[je]()}[dr](e){e.pending=!0,this[Q]+=1;let t=this.follow?"stat":"lstat";Ii.default[t](e.absolute,(i,r)=>{e.pending=!1,this[Q]-=1,i?this.emit("error",i):this[Pi](e,r)})}[Pi](e,t){if(this.statCache.set(e.absolute,t),e.stat=t,!this.filter(e.path,t))e.ignore=!0;else if(t.isFile()&&t.nlink>1&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync)if(e===this[Te])this[Di](e);else{let i=`${t.dev}:${t.ino}`,r=this[Dt].get(i);r?r.push(e):this[Dt].set(i,[e]),e.pendingLink=!0,e.pending=!0}this[je]()}[mr](e){e.pending=!0,this[Q]+=1,Ii.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[Q]-=1,t)return this.emit("error",t);this[Mi](e,i)})}[Mi](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[je]()}[je](){if(!this[Pt]){this[Pt]=!0;for(let e=this[X].head;e&&this[Q]<this.jobs;e=e.next)if(this[Di](e.value),e.value.ignore){let t=e.next;this[X].removeNode(e),e.next=t}this[Pt]=!1,this[Tt]&&this[X].length===0&&this[Q]===0&&(this.zip?this.zip.end(On):(super.write(On),super.end()))}}get[Te](){return this[X]&&this[X].head&&this[X].head.value}[hr](e){this[X].shift(),this[Q]-=1;let{stat:t}=e;if(t&&t.isFile()&&t.nlink>1){let i=`${t.dev}:${t.ino}`,r=this[Dt].get(i);if(r){this[Dt].delete(i);for(let n of r)n.pending=!1,this[Di](n)}}this[je]()}[Di](e){if(e.pending&&e.pendingLink&&e===this[Te]&&(e.pending=!1,e.pendingLink=!1),!e.pending){if(e.entry){e===this[Te]&&!e.piped&&this[Li](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[Pi](e,t):this[dr](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Mi](e,t):this[mr](e),!e.readdir)return}if(e.entry=this[Tn](e),!e.entry){e.ignore=!0;return}e===this[Te]&&!e.piped&&this[Li](e)}}}[lr](e){return{onwarn:(t,i,r)=>this.warn(t,i,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Tn](e){this[Q]+=1;try{return new this[Ai](e.path,this[lr](e)).on("end",()=>this[hr](e)).on("error",i=>this.emit("error",i))}catch(t){this.emit("error",t)}}[cr](){this[Te]&&this[Te].entry&&this[Te].entry.resume()}[Li](e){e.piped=!0,e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ni](o+r)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",r=>{i.write(r)||t.pause()}):t.on("data",r=>{super.write(r)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){(0,vh.warnMethod)(this,e,t,i)}};L.Pack=Fi;var pr=class extends Fi{sync=!0;constructor(e){super(e),this[Ai]=fr.WriteEntrySync}pause(){}resume(){}[dr](e){let t=this.follow?"statSync":"lstatSync";this[Pi](e,Ii.default[t](e.absolute))}[mr](e){this[Mi](e,Ii.default.readdirSync(e.absolute))}[Li](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ni](o+r)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",r=>{i.write(r)}):t.on("data",r=>{super[Nn](r)})}};L.PackSync=pr});var _r=d(ht=>{"use strict";var Th=ht&&ht.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ht,"__esModule",{value:!0});ht.create=void 0;var Mn=Ke(),Ln=Th(require("node:path")),An=rt(),Dh=Ve(),Bi=Ci(),Ph=(s,e)=>{let t=new Bi.PackSync(s),i=new Mn.WriteStreamSync(s.file,{mode:s.mode||438});t.pipe(i),In(t,e)},Nh=(s,e)=>{let t=new Bi.Pack(s),i=new Mn.WriteStream(s.file,{mode:s.mode||438});t.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),t.on("error",o)});return Fn(t,e).catch(n=>t.emit("error",n)),r},In=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,An.list)({file:Ln.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},Fn=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,An.list)({file:Ln.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>{s.add(i)}}):s.add(t);s.end()},Mh=(s,e)=>{let t=new Bi.PackSync(s);return In(t,e),t},Lh=(s,e)=>{let t=new Bi.Pack(s);return Fn(t,e).catch(i=>t.emit("error",i)),t};ht.create=(0,Dh.makeCommand)(Ph,Nh,Mh,Lh,(s,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var Wn=d(lt=>{"use strict";var Ah=lt&&lt.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(lt,"__esModule",{value:!0});lt.getWriteFlag=void 0;var zn=Ah(require("fs")),Ih=process.env.__FAKE_PLATFORM__||process.platform,kn=Ih==="win32",{O_CREAT:xn,O_NOFOLLOW:Cn,O_TRUNC:jn,O_WRONLY:Un}=zn.default.constants,qn=Number(process.env.__FAKE_FS_O_FILENAME__)||zn.default.constants.UV_FS_O_FILEMAP||0,Fh=kn&&!!qn,Ch=512*1024,Bh=qn|jn|xn|Un,Bn=!kn&&typeof Cn=="number"?Cn|jn|xn|Un:null;lt.getWriteFlag=Bn!==null?()=>Bn:Fh?s=>s<Ch?Bh:"w":()=>"w"});var Gn=d(le=>{"use strict";var Hn=le&&le.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(le,"__esModule",{value:!0});le.chownrSync=le.chownr=void 0;var ki=Hn(require("node:fs")),Mt=Hn(require("node:path")),wr=(s,e,t)=>{try{return ki.default.lchownSync(s,e,t)}catch(i){if(i?.code!=="ENOENT")throw i}},zi=(s,e,t,i)=>{ki.default.lchown(s,e,t,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},zh=(s,e,t,i,r)=>{if(e.isDirectory())(0,le.chownr)(Mt.default.resolve(s,e.name),t,i,n=>{if(n)return r(n);let o=Mt.default.resolve(s,e.name);zi(o,t,i,r)});else{let n=Mt.default.resolve(s,e.name);zi(n,t,i,r)}},kh=(s,e,t,i)=>{ki.default.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return zi(s,e,t,i);let o=n.length,a=null,h=l=>{if(!a){if(l)return i(a=l);if(--o===0)return zi(s,e,t,i)}};for(let l of n)zh(s,l,e,t,h)})};le.chownr=kh;var xh=(s,e,t,i)=>{e.isDirectory()&&(0,le.chownrSync)(Mt.default.resolve(s,e.name),t,i),wr(Mt.default.resolve(s,e.name),t,i)},jh=(s,e,t)=>{let i;try{i=ki.default.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return wr(s,e,t);throw n}for(let r of i)xh(s,r,e,t);return wr(s,e,t)};le.chownrSync=jh});var Zn=d(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.CwdError=void 0;var yr=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"}};xi.CwdError=yr});var br=d(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.SymlinkError=void 0;var Er=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"}};ji.SymlinkError=Er});var Xn=d(De=>{"use strict";var gr=De&&De.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(De,"__esModule",{value:!0});De.mkdirSync=De.mkdir=void 0;var Yn=Gn(),j=gr(require("node:fs")),Uh=gr(require("node:fs/promises")),Ui=gr(require("node:path")),Kn=Zn(),_e=tt(),Vn=br(),qh=(s,e)=>{j.default.stat(s,(t,i)=>{(t||!i.isDirectory())&&(t=new Kn.CwdError(s,t?.code||"ENOTDIR")),e(t)})},Wh=(s,e,t)=>{s=(0,_e.normalizeWindowsPath)(s);let i=e.umask??18,r=e.mode|448,n=(r&i)!==0,o=e.uid,a=e.gid,h=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),l=e.preserve,c=e.unlink,u=(0,_e.normalizeWindowsPath)(e.cwd),b=(w,P)=>{w?t(w):P&&h?(0,Yn.chownr)(P,o,a,xt=>b(xt)):n?j.default.chmod(s,r,t):t()};if(s===u)return qh(s,b);if(l)return Uh.default.mkdir(s,{mode:r,recursive:!0}).then(w=>b(null,w??void 0),b);let A=(0,_e.normalizeWindowsPath)(Ui.default.relative(u,s)).split("/");Sr(u,A,r,c,u,void 0,b)};De.mkdir=Wh;var Sr=(s,e,t,i,r,n,o)=>{if(e.length===0)return o(null,n);let a=e.shift(),h=(0,_e.normalizeWindowsPath)(Ui.default.resolve(s+"/"+a));j.default.mkdir(h,t,$n(h,e,t,i,r,n,o))},$n=(s,e,t,i,r,n,o)=>a=>{a?j.default.lstat(s,(h,l)=>{if(h)h.path=h.path&&(0,_e.normalizeWindowsPath)(h.path),o(h);else if(l.isDirectory())Sr(s,e,t,i,r,n,o);else if(i)j.default.unlink(s,c=>{if(c)return o(c);j.default.mkdir(s,t,$n(s,e,t,i,r,n,o))});else{if(l.isSymbolicLink())return o(new Vn.SymlinkError(s,s+"/"+e.join("/")));o(a)}}):(n=n||s,Sr(s,e,t,i,r,n,o))},Hh=s=>{let e=!1,t;try{e=j.default.statSync(s).isDirectory()}catch(i){t=i?.code}finally{if(!e)throw new Kn.CwdError(s,t??"ENOTDIR")}},Gh=(s,e)=>{s=(0,_e.normalizeWindowsPath)(s);let t=e.umask??18,i=e.mode|448,r=(i&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),h=e.preserve,l=e.unlink,c=(0,_e.normalizeWindowsPath)(e.cwd),u=w=>{w&&a&&(0,Yn.chownrSync)(w,n,o),r&&j.default.chmodSync(s,i)};if(s===c)return Hh(c),u();if(h)return u(j.default.mkdirSync(s,{mode:i,recursive:!0})??void 0);let D=(0,_e.normalizeWindowsPath)(Ui.default.relative(c,s)).split("/"),A;for(let w=D.shift(),P=c;w&&(P+="/"+w);w=D.shift()){P=(0,_e.normalizeWindowsPath)(Ui.default.resolve(P));try{j.default.mkdirSync(P,i),A=A||P}catch{let xt=j.default.lstatSync(P);if(xt.isDirectory())continue;if(l){j.default.unlinkSync(P),j.default.mkdirSync(P,i),A=A||P;continue}else if(xt.isSymbolicLink())return new Vn.SymlinkError(P,P+"/"+D.join("/"))}}return u(A)};De.mkdirSync=Gh});var Jn=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.normalizeUnicode=void 0;var Rr=Object.create(null),Qn=1e4,ct=new Set,Zh=s=>{ct.has(s)?ct.delete(s):Rr[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),ct.add(s);let e=Rr[s],t=ct.size-Qn;if(t>Qn/10){for(let i of ct)if(ct.delete(i),delete Rr[i],--t<=0)break}return e};qi.normalizeUnicode=Zh});var to=d(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.PathReservations=void 0;var eo=require("node:path"),Yh=Jn(),Kh=yi(),Vh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,$h=Vh==="win32",Xh=s=>s.split("/").slice(0,-1).reduce((t,i)=>{let r=t.at(-1);return r!==void 0&&(i=(0,eo.join)(r,i)),t.push(i||"/"),t},[]),Or=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=$h?["win32 parallelization disabled"]:e.map(r=>(0,Kh.stripTrailingSlashes)((0,eo.join)((0,Yh.normalizeUnicode)(r))));let i=new Set(e.map(r=>Xh(r)).reduce((r,n)=>r.concat(n)));this.#i.set(t,{dirs:i,paths:e});for(let r of e){let n=this.#e.get(r);n?n.push(t):this.#e.set(r,[t])}for(let r of i){let n=this.#e.get(r);if(!n)this.#e.set(r,[new Set([t])]);else{let o=n.at(-1);o instanceof Set?o.add(t):n.push(new Set([t]))}}return this.#r(t)}#n(e){let t=this.#i.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#n(e);return t.every(r=>r&&r[0]===e)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let o of i){let a=this.#e.get(o);if(!a||a?.[0]!==e)continue;let h=a[1];if(!h){this.#e.delete(o);continue}if(a.shift(),typeof h=="function")n.add(h);else for(let l of h)n.add(l)}for(let o of r){let a=this.#e.get(o),h=a?.[0];if(!(!a||!(h instanceof Set)))if(h.size===1&&a.length===1){this.#e.delete(o);continue}else if(h.size===1){a.shift();let l=a[0];typeof l=="function"&&n.add(l)}else h.delete(e)}return this.#s.delete(e),n.forEach(o=>this.#r(o)),!0}};Wi.PathReservations=Or});var io=d(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.umask=void 0;var Qh=()=>process.umask();Hi.umask=Qh});var Cr=d(k=>{"use strict";var Jh=k&&k.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),el=k&&k.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fo=k&&k.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Jh(t,e,i[r]);return el(t,e),t}})(),Fr=k&&k.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(k,"__esModule",{value:!0});k.UnpackSync=k.Unpack=void 0;var tl=fo(Ke()),il=Fr(require("node:assert")),mo=require("node:crypto"),m=Fr(require("node:fs")),g=Fr(require("node:path")),po=Wn(),_o=Xn(),U=tt(),sl=_i(),rl=Zs(),so=fo(Ks()),nl=to(),wo=br(),ol=io(),ro=Symbol("onEntry"),Pr=Symbol("checkFs"),no=Symbol("checkFs2"),Nr=Symbol("isReusable"),G=Symbol("makeFs"),Mr=Symbol("file"),Lr=Symbol("directory"),Zi=Symbol("link"),oo=Symbol("symlink"),ao=Symbol("hardlink"),At=Symbol("ensureNoSymlink"),ho=Symbol("unsupported"),lo=Symbol("checkPath"),vr=Symbol("stripAbsolutePath"),Pe=Symbol("mkdir"),T=Symbol("onError"),Gi=Symbol("pending"),co=Symbol("pend"),ut=Symbol("unpend"),Tr=Symbol("ended"),Dr=Symbol("maybeClose"),Ar=Symbol("skip"),It=Symbol("doChown"),Ft=Symbol("uid"),Ct=Symbol("gid"),Bt=Symbol("checkedCwd"),al=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,zt=al==="win32",hl=1024,ll=(s,e)=>{if(!zt)return m.default.unlink(s,e);let t=s+".DELETE."+(0,mo.randomBytes)(16).toString("hex");m.default.rename(s,t,i=>{if(i)return e(i);m.default.unlink(t,e)})},cl=s=>{if(!zt)return m.default.unlinkSync(s);let e=s+".DELETE."+(0,mo.randomBytes)(16).toString("hex");m.default.renameSync(s,e),m.default.unlinkSync(e)},uo=(s,e,t)=>s!==void 0&&s===s>>>0?s:e!==void 0&&e===e>>>0?e:t,Yi=class extends sl.Parser{[Tr]=!1;[Bt]=!1;[Gi]=0;reservations=new nl.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[Tr]=!0,this[Dr]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=e.preserveOwner===void 0&&typeof e.uid!="number"?process.getuid?.()===0:!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:hl,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||zt,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,U.normalizeWindowsPath)(g.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:(0,ol.umask)():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[ro](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[Dr](){this[Tr]&&this[Gi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[vr](e,t){let i=e[t],{type:r}=e;if(!i||this.preservePaths)return!0;let[n,o]=(0,rl.stripAbsolutePath)(i),a=o.replaceAll(/\\/g,"/").split("/");if(a.includes("..")||zt&&/^[a-z]:\.\.$/i.test(a[0]??"")){if(t==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;let h=g.default.posix.dirname(e.path),l=g.default.posix.normalize(g.default.posix.join(h,a.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}return n&&(e[t]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:i})),!0}[lo](e){let t=(0,U.normalizeWindowsPath)(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");if(r.length>=this.strip)e.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[vr](e,"path")||!this[vr](e,"linkpath"))return!1;if(e.absolute=g.default.isAbsolute(e.path)?(0,U.normalizeWindowsPath)(g.default.resolve(e.path)):(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,U.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=g.default.win32.parse(String(e.absolute));e.absolute=r+so.encode(String(e.absolute).slice(r.length));let{root:n}=g.default.win32.parse(e.path);e.path=n+so.encode(e.path.slice(n.length))}return!0}[ro](e){if(!this[lo](e))return e.resume();switch(il.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Pr](e);default:return this[ho](e)}}[T](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ut](),t.resume())}[Pe](e,t,i){(0,_o.mkdir)((0,U.normalizeWindowsPath)(e),{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:t},i)}[It](e){return 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}[Ft](e){return uo(this.uid,e.uid,this.processUid)}[Ct](e){return uo(this.gid,e.gid,this.processGid)}[Mr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=new tl.WriteStream(String(e.absolute),{flags:(0,po.getWriteFlag)(e.size),mode:i,autoClose:!1});r.on("error",h=>{r.fd&&m.default.close(r.fd,()=>{}),r.write=()=>!0,this[T](h,e),t()});let n=1,o=h=>{if(h){r.fd&&m.default.close(r.fd,()=>{}),this[T](h,e),t();return}--n===0&&r.fd!==void 0&&m.default.close(r.fd,l=>{l?this[T](l,e):this[ut](),t()})};r.on("finish",()=>{let h=String(e.absolute),l=r.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let c=e.atime||new Date,u=e.mtime;m.default.futimes(l,c,u,b=>b?m.default.utimes(h,c,u,D=>o(D&&b)):o())}if(typeof l=="number"&&this[It](e)){n++;let c=this[Ft](e),u=this[Ct](e);typeof c=="number"&&typeof u=="number"&&m.default.fchown(l,c,u,b=>b?m.default.chown(h,c,u,D=>o(D&&b)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",h=>{this[T](h,e),t()}),e.pipe(a)),a.pipe(r)}[Lr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Pe](String(e.absolute),i,r=>{if(r){this[T](r,e),t();return}let n=1,o=()=>{--n===0&&(t(),this[ut](),e.resume())};e.mtime&&!this.noMtime&&(n++,m.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[It](e)&&(n++,m.default.chown(String(e.absolute),Number(this[Ft](e)),Number(this[Ct](e)),o)),o()})}[ho](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[oo](e,t){let i=(0,U.normalizeWindowsPath)(g.default.relative(this.cwd,g.default.resolve(g.default.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[At](e,this.cwd,i,()=>this[Zi](e,String(e.linkpath),"symlink",t),r=>{this[T](r,e),t()})}[ao](e,t){let i=(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,String(e.linkpath))),r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");this[At](e,this.cwd,r,()=>this[Zi](e,i,"link",t),n=>{this[T](n,e),t()})}[At](e,t,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let a=g.default.resolve(t,o);m.default.lstat(a,(h,l)=>{if(h)return r();if(l?.isSymbolicLink())return n(new wo.SymlinkError(a,g.default.resolve(a,i.join("/"))));this[At](e,a,i,r,n)})}[co](){this[Gi]++}[ut](){this[Gi]--,this[Dr]()}[Ar](e){this[ut](),e.resume()}[Nr](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!zt}[Pr](e){this[co]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[no](e,i))}[no](e,t){let i=a=>{t(a)},r=()=>{this[Pe](this.cwd,this.dmode,a=>{if(a){this[T](a,e),i();return}this[Bt]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(a!==this.cwd)return this[Pe](a,this.dmode,h=>{if(h){this[T](h,e),i();return}o()})}o()},o=()=>{m.default.lstat(String(e.absolute),(a,h)=>{if(h&&(this.keep||this.newer&&h.mtime>(e.mtime??h.mtime))){this[Ar](e),i();return}if(a||this[Nr](e,h))return this[G](null,e,i);if(h.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(h.mode&4095)!==e.mode,c=u=>this[G](u??null,e,i);return l?m.default.chmod(String(e.absolute),Number(e.mode),c):c()}if(e.absolute!==this.cwd)return m.default.rmdir(String(e.absolute),l=>this[G](l??null,e,i))}if(e.absolute===this.cwd)return this[G](null,e,i);ll(String(e.absolute),l=>this[G](l??null,e,i))})};this[Bt]?n():r()}[G](e,t,i){if(e){this[T](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Mr](t,i);case"Link":return this[ao](t,i);case"SymbolicLink":return this[oo](t,i);case"Directory":case"GNUDumpDir":return this[Lr](t,i)}}[Zi](e,t,i,r){m.default[i](t,String(e.absolute),n=>{n?this[T](n,e):(this[ut](),e.resume()),r()})}};k.Unpack=Yi;var Lt=s=>{try{return[null,s()]}catch(e){return[e,null]}},Ir=class extends Yi{sync=!0;[G](e,t){return super[G](e,t,()=>{})}[Pr](e){if(!this[Bt]){let n=this[Pe](this.cwd,this.dmode);if(n)return this[T](n,e);this[Bt]=!0}if(e.absolute!==this.cwd){let n=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(n!==this.cwd){let o=this[Pe](n,this.dmode);if(o)return this[T](o,e)}}let[t,i]=Lt(()=>m.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[Ar](e);if(t||this[Nr](e,i))return this[G](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=o?Lt(()=>{m.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[G](a,e)}let[n]=Lt(()=>m.default.rmdirSync(String(e.absolute)));this[G](n,e)}let[r]=e.absolute===this.cwd?[]:Lt(()=>cl(String(e.absolute)));this[G](r,e)}[Mr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=a=>{let h;try{m.default.closeSync(n)}catch(l){h=l}(a||h)&&this[T](a||h,e),t()},n;try{n=m.default.openSync(String(e.absolute),(0,po.getWriteFlag)(e.size),i)}catch(a){return r(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[T](a,e)),e.pipe(o)),o.on("data",a=>{try{m.default.writeSync(n,a,0,a.length)}catch(h){r(h)}}),o.on("end",()=>{let a=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,l=e.mtime;try{m.default.futimesSync(n,h,l)}catch(c){try{m.default.utimesSync(String(e.absolute),h,l)}catch{a=c}}}if(this[It](e)){let h=this[Ft](e),l=this[Ct](e);try{m.default.fchownSync(n,Number(h),Number(l))}catch(c){try{m.default.chownSync(String(e.absolute),Number(h),Number(l))}catch{a=a||c}}}r(a)})}[Lr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,r=this[Pe](String(e.absolute),i);if(r){this[T](r,e),t();return}if(e.mtime&&!this.noMtime)try{m.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[It](e))try{m.default.chownSync(String(e.absolute),Number(this[Ft](e)),Number(this[Ct](e)))}catch{}t(),e.resume()}[Pe](e,t){try{return(0,_o.mkdirSync)((0,U.normalizeWindowsPath)(e),{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:t})}catch(i){return i}}[At](e,t,i,r,n){if(this.preservePaths||i.length===0)return r();let o=t;for(let a of i){o=g.default.resolve(o,a);let[h,l]=Lt(()=>m.default.lstatSync(o));if(h)return r();if(l.isSymbolicLink())return n(new wo.SymlinkError(o,g.default.resolve(t,i.join("/"))))}r()}[Zi](e,t,i,r){let n=`${i}Sync`;try{m.default[n](t,String(e.absolute)),r(),e.resume()}catch(o){return this[T](o,e)}}};k.UnpackSync=Ir});var Br=d(Z=>{"use strict";var ul=Z&&Z.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),fl=Z&&Z.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),dl=Z&&Z.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ul(t,e,i[r]);return fl(t,e),t}})(),ml=Z&&Z.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Z,"__esModule",{value:!0});Z.extract=void 0;var yo=dl(Ke()),Eo=ml(require("node:fs")),pl=rt(),_l=Ve(),Ki=Cr(),wl=s=>{let e=new Ki.UnpackSync(s),t=s.file,i=Eo.default.statSync(t),r=s.maxReadSize||16*1024*1024;new yo.ReadStreamSync(t,{readSize:r,size:i.size}).pipe(e)},yl=(s,e)=>{let t=new Ki.Unpack(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("close",o),Eo.default.stat(r,(h,l)=>{if(h)a(h);else{let c=new yo.ReadStream(r,{readSize:i,size:l.size});c.on("error",a),c.pipe(t)}})})};Z.extract=(0,_l.makeCommand)(wl,yl,s=>new Ki.UnpackSync(s),s=>new Ki.Unpack(s),(s,e)=>{e?.length&&(0,pl.filesFilter)(s,e)})});var Vi=d(ft=>{"use strict";var bo=ft&&ft.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ft,"__esModule",{value:!0});ft.replace=void 0;var So=Ke(),q=bo(require("node:fs")),go=bo(require("node:path")),Ro=et(),Oo=rt(),El=Ve(),bl=Qt(),vo=Ci(),Sl=(s,e)=>{let t=new vo.PackSync(s),i=!0,r,n;try{try{r=q.default.openSync(s.file,"r+")}catch(h){if(h?.code==="ENOENT")r=q.default.openSync(s.file,"w+");else throw h}let o=q.default.fstatSync(r),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let c=0,u=0;c<512;c+=u){if(u=q.default.readSync(r,a,c,a.length-c,n+c),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!u)break e}let h=new Ro.Header(a);if(!h.cksumValid)break;let l=512*Math.ceil((h.size||0)/512);if(n+l+512>o.size)break;n+=l,s.mtimeCache&&h.mtime&&s.mtimeCache.set(String(h.path),h.mtime)}i=!1,gl(s,t,n,r,e)}finally{if(i)try{q.default.closeSync(r)}catch{}}},gl=(s,e,t,i,r)=>{let n=new So.WriteStreamSync(s.file,{fd:i,start:t});e.pipe(n),Ol(e,r)},Rl=(s,e)=>{e=Array.from(e);let t=new vo.Pack(s),i=(n,o,a)=>{let h=(D,A)=>{D?q.default.close(n,w=>a(D)):a(null,A)},l=0;if(o===0)return h(null,0);let c=0,u=Buffer.alloc(512),b=(D,A)=>{if(D||A===void 0)return h(D);if(c+=A,c<512&&A)return q.default.read(n,u,c,u.length-c,l+c,b);if(l===0&&u[0]===31&&u[1]===139)return h(new Error("cannot append to compressed archives"));if(c<512)return h(null,l);let w=new Ro.Header(u);if(!w.cksumValid)return h(null,l);let P=512*Math.ceil((w.size??0)/512);if(l+P+512>o||(l+=P+512,l>=o))return h(null,l);s.mtimeCache&&w.mtime&&s.mtimeCache.set(String(w.path),w.mtime),c=0,q.default.read(n,u,0,512,l,b)};q.default.read(n,u,0,512,l,b)};return new Promise((n,o)=>{t.on("error",o);let a="r+",h=(l,c)=>{if(l&&l.code==="ENOENT"&&a==="r+")return a="w+",q.default.open(s.file,a,h);if(l||!c)return o(l);q.default.fstat(c,(u,b)=>{if(u)return q.default.close(c,()=>o(u));i(c,b.size,(D,A)=>{if(D)return o(D);let w=new So.WriteStream(s.file,{fd:c,start:A});t.pipe(w),w.on("error",o),w.on("close",n),vl(t,e)})})};q.default.open(s.file,a,h)})},Ol=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,Oo.list)({file:go.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},vl=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,Oo.list)({file:go.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t);s.end()};ft.replace=(0,El.makeCommand)(Sl,Rl,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,e)=>{if(!(0,bl.isFile)(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var zr=d($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.update=void 0;var Tl=Ve(),kt=Vi();$i.update=(0,Tl.makeCommand)(kt.replace.syncFile,kt.replace.asyncFile,kt.replace.syncNoFile,kt.replace.asyncNoFile,(s,e=[])=>{kt.replace.validate?.(s,e),Dl(s)});var Dl=s=>{let e=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=e?(t,i)=>e(t,i)&&!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0)):(t,i)=>!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))}});var To=exports&&exports.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Pl=exports&&exports.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Y=exports&&exports.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&To(e,s,t)},Nl=exports&&exports.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&To(t,e,i[r]);return Pl(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0});exports.u=exports.types=exports.r=exports.t=exports.x=exports.c=void 0;Y(_r(),exports);var Ml=_r();Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ml.create}});Y(Br(),exports);var Ll=Br();Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Ll.extract}});Y(et(),exports);Y(rt(),exports);var Al=rt();Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Al.list}});Y(Ci(),exports);Y(_i(),exports);Y(si(),exports);Y(Cs(),exports);Y(Vi(),exports);var Il=Vi();Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Il.replace}});exports.types=Nl(Ns());Y(Cr(),exports);Y(zr(),exports);var Fl=zr();Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Fl.update}});Y(nr(),exports);
-//# sourceMappingURL=index.min.js.map
diff --git a/node_modules/tar/dist/commonjs/large-numbers.d.ts b/node_modules/tar/dist/commonjs/large-numbers.d.ts
deleted file mode 100644
index a1ec25e..0000000
--- a/node_modules/tar/dist/commonjs/large-numbers.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export declare const encode: (num: number, buf: Buffer) => Buffer<ArrayBufferLike>;
-export declare const parse: (buf: Buffer) => number;
-//# sourceMappingURL=large-numbers.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/large-numbers.js b/node_modules/tar/dist/commonjs/large-numbers.js
deleted file mode 100644
index 5b07aa7..0000000
--- a/node_modules/tar/dist/commonjs/large-numbers.js
+++ /dev/null
@@ -1,99 +0,0 @@
-"use strict";
-// Tar can encode large and negative numbers using a leading byte of
-// 0xff for negative, and 0x80 for positive.
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.parse = exports.encode = void 0;
-const encode = (num, buf) => {
- if (!Number.isSafeInteger(num)) {
- // The number is so large that javascript cannot represent it with integer
- // precision.
- throw Error('cannot encode number outside of javascript safe integer range');
- }
- else if (num < 0) {
- encodeNegative(num, buf);
- }
- else {
- encodePositive(num, buf);
- }
- return buf;
-};
-exports.encode = encode;
-const encodePositive = (num, buf) => {
- buf[0] = 0x80;
- for (var i = buf.length; i > 1; i--) {
- buf[i - 1] = num & 0xff;
- num = Math.floor(num / 0x100);
- }
-};
-const encodeNegative = (num, buf) => {
- buf[0] = 0xff;
- var flipped = false;
- num = num * -1;
- for (var i = buf.length; i > 1; i--) {
- var byte = num & 0xff;
- num = Math.floor(num / 0x100);
- if (flipped) {
- buf[i - 1] = onesComp(byte);
- }
- else if (byte === 0) {
- buf[i - 1] = 0;
- }
- else {
- flipped = true;
- buf[i - 1] = twosComp(byte);
- }
- }
-};
-const parse = (buf) => {
- const pre = buf[0];
- const value = pre === 0x80 ? pos(buf.subarray(1, buf.length))
- : pre === 0xff ? twos(buf)
- : null;
- if (value === null) {
- throw Error('invalid base256 encoding');
- }
- if (!Number.isSafeInteger(value)) {
- // The number is so large that javascript cannot represent it with integer
- // precision.
- throw Error('parsed number outside of javascript safe integer range');
- }
- return value;
-};
-exports.parse = parse;
-const twos = (buf) => {
- var len = buf.length;
- var sum = 0;
- var flipped = false;
- for (var i = len - 1; i > -1; i--) {
- var byte = Number(buf[i]);
- var f;
- if (flipped) {
- f = onesComp(byte);
- }
- else if (byte === 0) {
- f = byte;
- }
- else {
- flipped = true;
- f = twosComp(byte);
- }
- if (f !== 0) {
- sum -= f * Math.pow(256, len - i - 1);
- }
- }
- return sum;
-};
-const pos = (buf) => {
- var len = buf.length;
- var sum = 0;
- for (var i = len - 1; i > -1; i--) {
- var byte = Number(buf[i]);
- if (byte !== 0) {
- sum += byte * Math.pow(256, len - i - 1);
- }
- }
- return sum;
-};
-const onesComp = (byte) => (0xff ^ byte) & 0xff;
-const twosComp = (byte) => ((0xff ^ byte) + 1) & 0xff;
-//# sourceMappingURL=large-numbers.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/list.d.ts b/node_modules/tar/dist/commonjs/list.d.ts
deleted file mode 100644
index 7f5bb80..0000000
--- a/node_modules/tar/dist/commonjs/list.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { TarOptions } from './options.js';
-import { Parser } from './parse.js';
-export declare const filesFilter: (opt: TarOptions, files: string[]) => void;
-export declare const list: import("./make-command.js").TarCommand<Parser, Parser & {
- sync: true;
-}>;
-//# sourceMappingURL=list.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/list.js b/node_modules/tar/dist/commonjs/list.js
deleted file mode 100644
index 5dfdb98..0000000
--- a/node_modules/tar/dist/commonjs/list.js
+++ /dev/null
@@ -1,153 +0,0 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.list = exports.filesFilter = void 0;
-// tar -t
-const fsm = __importStar(require("@isaacs/fs-minipass"));
-const node_fs_1 = __importDefault(require("node:fs"));
-const path_1 = require("path");
-const make_command_js_1 = require("./make-command.js");
-const parse_js_1 = require("./parse.js");
-const strip_trailing_slashes_js_1 = require("./strip-trailing-slashes.js");
-const onReadEntryFunction = (opt) => {
- const onReadEntry = opt.onReadEntry;
- opt.onReadEntry =
- onReadEntry ?
- e => {
- onReadEntry(e);
- e.resume();
- }
- : e => e.resume();
-};
-// construct a filter that limits the file entries listed
-// include child entries if a dir is included
-const filesFilter = (opt, files) => {
- const map = new Map(files.map(f => [(0, strip_trailing_slashes_js_1.stripTrailingSlashes)(f), true]));
- const filter = opt.filter;
- // limit recursion to 100 levels
- const MAX = 100;
- const mapHas = (file, r = '', depth = 0) => {
- /* c8 ignore start - excessive caution */
- if (depth >= MAX) {
- map.set(file, false);
- return false;
- }
- /* c8 ignore stop */
- const root = r || (0, path_1.parse)(file).root || '.';
- let ret;
- if (file === root)
- ret = false;
- else {
- const m = map.get(file);
- ret = m !== undefined ? m : mapHas((0, path_1.dirname)(file), root, depth + 1);
- }
- map.set(file, ret);
- return ret;
- };
- opt.filter =
- filter ?
- (file, entry) => filter(file, entry) && mapHas((0, strip_trailing_slashes_js_1.stripTrailingSlashes)(file))
- : file => mapHas((0, strip_trailing_slashes_js_1.stripTrailingSlashes)(file));
-};
-exports.filesFilter = filesFilter;
-const listFileSync = (opt) => {
- const p = new parse_js_1.Parser(opt);
- const file = opt.file;
- let fd;
- try {
- fd = node_fs_1.default.openSync(file, 'r');
- const stat = node_fs_1.default.fstatSync(fd);
- const readSize = opt.maxReadSize || 16 * 1024 * 1024;
- if (stat.size < readSize) {
- const buf = Buffer.allocUnsafe(stat.size);
- const read = node_fs_1.default.readSync(fd, buf, 0, stat.size, 0);
- p.end(read === buf.byteLength ? buf : buf.subarray(0, read));
- }
- else {
- let pos = 0;
- const buf = Buffer.allocUnsafe(readSize);
- while (pos < stat.size) {
- const bytesRead = node_fs_1.default.readSync(fd, buf, 0, readSize, pos);
- if (bytesRead === 0)
- break;
- pos += bytesRead;
- p.write(buf.subarray(0, bytesRead));
- }
- p.end();
- }
- }
- finally {
- if (typeof fd === 'number') {
- try {
- node_fs_1.default.closeSync(fd);
- /* c8 ignore next */
- }
- catch { }
- }
- }
-};
-const listFile = (opt, _files) => {
- const parse = new parse_js_1.Parser(opt);
- const readSize = opt.maxReadSize || 16 * 1024 * 1024;
- const file = opt.file;
- const p = new Promise((resolve, reject) => {
- parse.on('error', reject);
- parse.on('end', resolve);
- node_fs_1.default.stat(file, (er, stat) => {
- if (er) {
- reject(er);
- }
- else {
- const stream = new fsm.ReadStream(file, {
- readSize: readSize,
- size: stat.size,
- });
- stream.on('error', reject);
- stream.pipe(parse);
- }
- });
- });
- return p;
-};
-exports.list = (0, make_command_js_1.makeCommand)(listFileSync, listFile, opt => new parse_js_1.Parser(opt), opt => new parse_js_1.Parser(opt), (opt, files) => {
- if (files?.length)
- (0, exports.filesFilter)(opt, files);
- if (!opt.noResume)
- onReadEntryFunction(opt);
-});
-//# sourceMappingURL=list.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/make-command.d.ts b/node_modules/tar/dist/commonjs/make-command.d.ts
deleted file mode 100644
index 107ac52..0000000
--- a/node_modules/tar/dist/commonjs/make-command.d.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import type { TarOptions, TarOptionsAsyncFile, TarOptionsAsyncNoFile, TarOptionsSyncFile, TarOptionsSyncNoFile, TarOptionsWithAliases, TarOptionsWithAliasesAsync, TarOptionsWithAliasesAsyncFile, TarOptionsWithAliasesAsyncNoFile, TarOptionsWithAliasesFile, TarOptionsWithAliasesNoFile, TarOptionsWithAliasesSync, TarOptionsWithAliasesSyncFile, TarOptionsWithAliasesSyncNoFile } from './options.js';
-export type CB = (er?: Error) => unknown;
-export type TarCommand<AsyncClass, SyncClass extends {
- sync: true;
-}> = {
- (): AsyncClass;
- (opt: TarOptionsWithAliasesAsyncNoFile): AsyncClass;
- (entries: string[]): AsyncClass;
- (opt: TarOptionsWithAliasesAsyncNoFile, entries: string[]): AsyncClass;
-} & {
- (opt: TarOptionsWithAliasesSyncNoFile): SyncClass;
- (opt: TarOptionsWithAliasesSyncNoFile, entries: string[]): SyncClass;
-} & {
- (opt: TarOptionsWithAliasesAsyncFile): Promise<void>;
- (opt: TarOptionsWithAliasesAsyncFile, entries: string[]): Promise<void>;
- (opt: TarOptionsWithAliasesAsyncFile, cb: CB): Promise<void>;
- (opt: TarOptionsWithAliasesAsyncFile, entries: string[], cb: CB): Promise<void>;
-} & {
- (opt: TarOptionsWithAliasesSyncFile): void;
- (opt: TarOptionsWithAliasesSyncFile, entries: string[]): void;
-} & {
- (opt: TarOptionsWithAliasesSync): typeof opt extends (TarOptionsWithAliasesFile) ? void : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass : void | SyncClass;
- (opt: TarOptionsWithAliasesSync, entries: string[]): typeof opt extends TarOptionsWithAliasesFile ? void : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass : void | SyncClass;
-} & {
- (opt: TarOptionsWithAliasesAsync): typeof opt extends (TarOptionsWithAliasesFile) ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass : Promise<void> | AsyncClass;
- (opt: TarOptionsWithAliasesAsync, entries: string[]): typeof opt extends TarOptionsWithAliasesFile ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass : Promise<void> | AsyncClass;
- (opt: TarOptionsWithAliasesAsync, cb: CB): Promise<void>;
- (opt: TarOptionsWithAliasesAsync, entries: string[], cb: CB): typeof opt extends TarOptionsWithAliasesFile ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? never : Promise<void>;
-} & {
- (opt: TarOptionsWithAliasesFile): Promise<void> | void;
- (opt: TarOptionsWithAliasesFile, entries: string[]): typeof opt extends TarOptionsWithAliasesSync ? void : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : Promise<void> | void;
- (opt: TarOptionsWithAliasesFile, cb: CB): Promise<void>;
- (opt: TarOptionsWithAliasesFile, entries: string[], cb: CB): typeof opt extends TarOptionsWithAliasesSync ? never : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : Promise<void>;
-} & {
- (opt: TarOptionsWithAliasesNoFile): typeof opt extends (TarOptionsWithAliasesSync) ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass;
- (opt: TarOptionsWithAliasesNoFile, entries: string[]): typeof opt extends TarOptionsWithAliasesSync ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass;
-} & {
- (opt: TarOptionsWithAliases): typeof opt extends (TarOptionsWithAliasesFile) ? typeof opt extends TarOptionsWithAliasesSync ? void : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : void | Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? typeof opt extends TarOptionsWithAliasesSync ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass : typeof opt extends TarOptionsWithAliasesSync ? SyncClass | void : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass | Promise<void> : SyncClass | void | AsyncClass | Promise<void>;
-} & {
- syncFile: (opt: TarOptionsSyncFile, entries: string[]) => void;
- asyncFile: (opt: TarOptionsAsyncFile, entries: string[], cb?: CB) => Promise<void>;
- syncNoFile: (opt: TarOptionsSyncNoFile, entries: string[]) => SyncClass;
- asyncNoFile: (opt: TarOptionsAsyncNoFile, entries: string[]) => AsyncClass;
- validate?: (opt: TarOptions, entries?: string[]) => void;
-};
-export declare const makeCommand: <AsyncClass, SyncClass extends {
- sync: true;
-}>(syncFile: (opt: TarOptionsSyncFile, entries: string[]) => void, asyncFile: (opt: TarOptionsAsyncFile, entries: string[], cb?: CB) => Promise<void>, syncNoFile: (opt: TarOptionsSyncNoFile, entries: string[]) => SyncClass, asyncNoFile: (opt: TarOptionsAsyncNoFile, entries: string[]) => AsyncClass, validate?: (opt: TarOptions, entries?: string[]) => void) => TarCommand<AsyncClass, SyncClass>;
-//# sourceMappingURL=make-command.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/make-command.js b/node_modules/tar/dist/commonjs/make-command.js
deleted file mode 100644
index d6fc6c7..0000000
--- a/node_modules/tar/dist/commonjs/make-command.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.makeCommand = void 0;
-const options_js_1 = require("./options.js");
-const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => {
- return Object.assign((opt_ = [], entries, cb) => {
- if (Array.isArray(opt_)) {
- entries = opt_;
- opt_ = {};
- }
- if (typeof entries === 'function') {
- cb = entries;
- entries = undefined;
- }
- entries = !entries ? [] : Array.from(entries);
- const opt = (0, options_js_1.dealias)(opt_);
- validate?.(opt, entries);
- if ((0, options_js_1.isSyncFile)(opt)) {
- if (typeof cb === 'function') {
- throw new TypeError('callback not supported for sync tar functions');
- }
- return syncFile(opt, entries);
- }
- else if ((0, options_js_1.isAsyncFile)(opt)) {
- const p = asyncFile(opt, entries);
- return cb ? p.then(() => cb(), cb) : p;
- }
- else if ((0, options_js_1.isSyncNoFile)(opt)) {
- if (typeof cb === 'function') {
- throw new TypeError('callback not supported for sync tar functions');
- }
- return syncNoFile(opt, entries);
- }
- else if ((0, options_js_1.isAsyncNoFile)(opt)) {
- if (typeof cb === 'function') {
- throw new TypeError('callback only supported with file option');
- }
- return asyncNoFile(opt, entries);
- /* c8 ignore start */
- }
- throw new Error('impossible options??');
- /* c8 ignore stop */
- }, {
- syncFile,
- asyncFile,
- syncNoFile,
- asyncNoFile,
- validate,
- });
-};
-exports.makeCommand = makeCommand;
-//# sourceMappingURL=make-command.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/mkdir.d.ts b/node_modules/tar/dist/commonjs/mkdir.d.ts
deleted file mode 100644
index dcbea5c..0000000
--- a/node_modules/tar/dist/commonjs/mkdir.d.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { CwdError } from './cwd-error.js';
-import { SymlinkError } from './symlink-error.js';
-export type MkdirOptions = {
- uid?: number;
- gid?: number;
- processUid?: number;
- processGid?: number;
- umask?: number;
- preserve: boolean;
- unlink: boolean;
- cwd: string;
- mode: number;
-};
-export type MkdirError = NodeJS.ErrnoException | CwdError | SymlinkError;
-/**
- * Wrapper around fs/promises.mkdir for tar's needs.
- *
- * The main purpose is to avoid creating directories if we know that
- * they already exist (and track which ones exist for this purpose),
- * and prevent entries from being extracted into symlinked folders,
- * if `preservePaths` is not set.
- */
-export declare const mkdir: (dir: string, opt: MkdirOptions, cb: (er?: null | MkdirError, made?: string) => void) => void | Promise<void>;
-export declare const mkdirSync: (dir: string, opt: MkdirOptions) => void | SymlinkError;
-//# sourceMappingURL=mkdir.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/mkdir.js b/node_modules/tar/dist/commonjs/mkdir.js
deleted file mode 100644
index 050e6bb..0000000
--- a/node_modules/tar/dist/commonjs/mkdir.js
+++ /dev/null
@@ -1,187 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.mkdirSync = exports.mkdir = void 0;
-const chownr_1 = require("chownr");
-const node_fs_1 = __importDefault(require("node:fs"));
-const promises_1 = __importDefault(require("node:fs/promises"));
-const node_path_1 = __importDefault(require("node:path"));
-const cwd_error_js_1 = require("./cwd-error.js");
-const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
-const symlink_error_js_1 = require("./symlink-error.js");
-const checkCwd = (dir, cb) => {
- node_fs_1.default.stat(dir, (er, st) => {
- if (er || !st.isDirectory()) {
- er = new cwd_error_js_1.CwdError(dir, er?.code || 'ENOTDIR');
- }
- cb(er);
- });
-};
-/**
- * Wrapper around fs/promises.mkdir for tar's needs.
- *
- * The main purpose is to avoid creating directories if we know that
- * they already exist (and track which ones exist for this purpose),
- * and prevent entries from being extracted into symlinked folders,
- * if `preservePaths` is not set.
- */
-const mkdir = (dir, opt, cb) => {
- dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
- // if there's any overlap between mask and mode,
- // then we'll need an explicit chmod
- /* c8 ignore next */
- const umask = opt.umask ?? 0o22;
- const mode = opt.mode | 0o0700;
- const needChmod = (mode & umask) !== 0;
- const uid = opt.uid;
- const gid = opt.gid;
- const doChown = typeof uid === 'number' &&
- typeof gid === 'number' &&
- (uid !== opt.processUid || gid !== opt.processGid);
- const preserve = opt.preserve;
- const unlink = opt.unlink;
- const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
- const done = (er, created) => {
- if (er) {
- cb(er);
- }
- else {
- if (created && doChown) {
- (0, chownr_1.chownr)(created, uid, gid, er => done(er));
- }
- else if (needChmod) {
- node_fs_1.default.chmod(dir, mode, cb);
- }
- else {
- cb();
- }
- }
- };
- if (dir === cwd) {
- return checkCwd(dir, done);
- }
- if (preserve) {
- return promises_1.default.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
- done);
- }
- const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
- const parts = sub.split('/');
- mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
-};
-exports.mkdir = mkdir;
-const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
- if (parts.length === 0) {
- return cb(null, created);
- }
- const p = parts.shift();
- const part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(base + '/' + p));
- node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
-};
-const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
- if (er) {
- node_fs_1.default.lstat(part, (statEr, st) => {
- if (statEr) {
- statEr.path = statEr.path && (0, normalize_windows_path_js_1.normalizeWindowsPath)(statEr.path);
- cb(statEr);
- }
- else if (st.isDirectory()) {
- mkdir_(part, parts, mode, unlink, cwd, created, cb);
- }
- else if (unlink) {
- node_fs_1.default.unlink(part, er => {
- if (er) {
- return cb(er);
- }
- node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
- });
- }
- else if (st.isSymbolicLink()) {
- return cb(new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/')));
- }
- else {
- cb(er);
- }
- });
- }
- else {
- created = created || part;
- mkdir_(part, parts, mode, unlink, cwd, created, cb);
- }
-};
-const checkCwdSync = (dir) => {
- let ok = false;
- let code;
- try {
- ok = node_fs_1.default.statSync(dir).isDirectory();
- }
- catch (er) {
- code = er?.code;
- }
- finally {
- if (!ok) {
- throw new cwd_error_js_1.CwdError(dir, code ?? 'ENOTDIR');
- }
- }
-};
-const mkdirSync = (dir, opt) => {
- dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
- // if there's any overlap between mask and mode,
- // then we'll need an explicit chmod
- /* c8 ignore next */
- const umask = opt.umask ?? 0o22;
- const mode = opt.mode | 0o700;
- const needChmod = (mode & umask) !== 0;
- const uid = opt.uid;
- const gid = opt.gid;
- const doChown = typeof uid === 'number' &&
- typeof gid === 'number' &&
- (uid !== opt.processUid || gid !== opt.processGid);
- const preserve = opt.preserve;
- const unlink = opt.unlink;
- const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
- const done = (created) => {
- if (created && doChown) {
- (0, chownr_1.chownrSync)(created, uid, gid);
- }
- if (needChmod) {
- node_fs_1.default.chmodSync(dir, mode);
- }
- };
- if (dir === cwd) {
- checkCwdSync(cwd);
- return done();
- }
- if (preserve) {
- return done(node_fs_1.default.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
- }
- const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
- const parts = sub.split('/');
- let created;
- for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
- part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(part));
- try {
- node_fs_1.default.mkdirSync(part, mode);
- created = created || part;
- }
- catch {
- const st = node_fs_1.default.lstatSync(part);
- if (st.isDirectory()) {
- continue;
- }
- else if (unlink) {
- node_fs_1.default.unlinkSync(part);
- node_fs_1.default.mkdirSync(part, mode);
- created = created || part;
- continue;
- }
- else if (st.isSymbolicLink()) {
- return new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/'));
- }
- }
- }
- return done(created);
-};
-exports.mkdirSync = mkdirSync;
-//# sourceMappingURL=mkdir.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/mode-fix.d.ts b/node_modules/tar/dist/commonjs/mode-fix.d.ts
deleted file mode 100644
index 38f3d93..0000000
--- a/node_modules/tar/dist/commonjs/mode-fix.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const modeFix: (mode: number, isDir: boolean, portable: boolean) => number;
-//# sourceMappingURL=mode-fix.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/mode-fix.js b/node_modules/tar/dist/commonjs/mode-fix.js
deleted file mode 100644
index 49dd727..0000000
--- a/node_modules/tar/dist/commonjs/mode-fix.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.modeFix = void 0;
-const modeFix = (mode, isDir, portable) => {
- mode &= 0o7777;
- // in portable mode, use the minimum reasonable umask
- // if this system creates files with 0o664 by default
- // (as some linux distros do), then we'll write the
- // archive with 0o644 instead. Also, don't ever create
- // a file that is not readable/writable by the owner.
- if (portable) {
- mode = (mode | 0o600) & ~0o22;
- }
- // if dirs are readable, then they should be listable
- if (isDir) {
- if (mode & 0o400) {
- mode |= 0o100;
- }
- if (mode & 0o40) {
- mode |= 0o10;
- }
- if (mode & 0o4) {
- mode |= 0o1;
- }
- }
- return mode;
-};
-exports.modeFix = modeFix;
-//# sourceMappingURL=mode-fix.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/normalize-unicode.d.ts b/node_modules/tar/dist/commonjs/normalize-unicode.d.ts
deleted file mode 100644
index 71df092..0000000
--- a/node_modules/tar/dist/commonjs/normalize-unicode.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const normalizeUnicode: (s: string) => string;
-//# sourceMappingURL=normalize-unicode.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/normalize-unicode.js b/node_modules/tar/dist/commonjs/normalize-unicode.js
deleted file mode 100644
index 5b0eaec..0000000
--- a/node_modules/tar/dist/commonjs/normalize-unicode.js
+++ /dev/null
@@ -1,38 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.normalizeUnicode = void 0;
-// warning: extremely hot code path.
-// This has been meticulously optimized for use
-// within npm install on large package trees.
-// Do not edit without careful benchmarking.
-const normalizeCache = Object.create(null);
-// Limit the size of this. Very low-sophistication LRU cache
-const MAX = 10000;
-const cache = new Set();
-const normalizeUnicode = (s) => {
- if (!cache.has(s)) {
- // shake out identical accents and ligatures
- normalizeCache[s] = s
- .normalize('NFD')
- .toLocaleLowerCase('en')
- .toLocaleUpperCase('en');
- }
- else {
- cache.delete(s);
- }
- cache.add(s);
- const ret = normalizeCache[s];
- let i = cache.size - MAX;
- // only prune when we're 10% over the max
- if (i > MAX / 10) {
- for (const s of cache) {
- cache.delete(s);
- delete normalizeCache[s];
- if (--i <= 0)
- break;
- }
- }
- return ret;
-};
-exports.normalizeUnicode = normalizeUnicode;
-//# sourceMappingURL=normalize-unicode.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts b/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts
deleted file mode 100644
index 9041173..0000000
--- a/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const normalizeWindowsPath: (p: unknown) => string;
-//# sourceMappingURL=normalize-windows-path.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/normalize-windows-path.js b/node_modules/tar/dist/commonjs/normalize-windows-path.js
deleted file mode 100644
index 0e0c08a..0000000
--- a/node_modules/tar/dist/commonjs/normalize-windows-path.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-// on windows, either \ or / are valid directory separators.
-// on unix, \ is a valid character in filenames.
-// so, on windows, and only on windows, we replace all \ chars with /,
-// so that we can use / as our one and only directory separator char.
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.normalizeWindowsPath = void 0;
-const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
-exports.normalizeWindowsPath = platform !== 'win32' ?
- (p) => String(p)
- : (p) => String(p).replaceAll(/\\/g, '/');
-//# sourceMappingURL=normalize-windows-path.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/options.d.ts b/node_modules/tar/dist/commonjs/options.d.ts
deleted file mode 100644
index e91bd48..0000000
--- a/node_modules/tar/dist/commonjs/options.d.ts
+++ /dev/null
@@ -1,604 +0,0 @@
-import { type GzipOptions, type ZlibOptions } from 'minizlib';
-import { type Stats } from 'node:fs';
-import { type ReadEntry } from './read-entry.js';
-import { type WarnData } from './warn-method.js';
-import type { WriteEntry } from './write-entry.js';
-/**
- * The options that can be provided to tar commands.
- *
- * Note that some of these are only relevant for certain commands, since
- * they are specific to reading or writing.
- *
- * Aliases are provided in the {@link TarOptionsWithAliases} type.
- */
-export interface TarOptions {
- /**
- * Perform all I/O operations synchronously. If the stream is ended
- * immediately, then it will be processed entirely synchronously.
- */
- sync?: boolean;
- /**
- * The tar file to be read and/or written. When this is set, a stream
- * is not returned. Asynchronous commands will return a promise indicating
- * when the operation is completed, and synchronous commands will return
- * immediately.
- */
- file?: string;
- /**
- * Treat warnings as crash-worthy errors. Defaults false.
- */
- strict?: boolean;
- /**
- * The effective current working directory for this tar command
- */
- cwd?: string;
- /**
- * When creating a tar archive, this can be used to compress it as well.
- * Set to `true` to use the default gzip options, or customize them as
- * needed.
- *
- * When reading, if this is unset, then the compression status will be
- * inferred from the archive data. This is generally best, unless you are
- * sure of the compression settings in use to create the archive, and want to
- * fail if the archive doesn't match expectations.
- */
- gzip?: boolean | GzipOptions;
- /**
- * When creating archives, preserve absolute and `..` paths in the archive,
- * rather than sanitizing them under the cwd.
- *
- * When extracting, allow absolute paths, paths containing `..`, and
- * extracting through symbolic links. By default, the root `/` is stripped
- * from absolute paths (eg, turning `/x/y/z` into `x/y/z`), paths containing
- * `..` are not extracted, and any file whose location would be modified by a
- * symbolic link is not extracted.
- *
- * **WARNING** This is almost always unsafe, and must NEVER be used on
- * archives from untrusted sources, such as user input, and every entry must
- * be validated to ensure it is safe to write. Even if the input is not
- * malicious, mistakes can cause a lot of damage!
- */
- preservePaths?: boolean;
- /**
- * When extracting, do not set the `mtime` value for extracted entries to
- * match the `mtime` in the archive.
- *
- * When creating archives, do not store the `mtime` value in the entry. Note
- * that this prevents properly using other mtime-based features (such as
- * `tar.update` or the `newer` option) with the resulting archive.
- */
- noMtime?: boolean;
- /**
- * Set to `true` or an object with settings for `zlib.BrotliCompress()` to
- * create a brotli-compressed archive
- *
- * When extracting, this will cause the archive to be treated as a
- * brotli-compressed file if set to `true` or a ZlibOptions object.
- *
- * If set `false`, then brotli options will not be used.
- *
- * If this, the `gzip`, and `zstd` options are left `undefined`, then tar
- * will attempt to infer the brotli compression status, but can only do so
- * based on the filename. If the filename ends in `.tbr` or `.tar.br`, and
- * the first 512 bytes are not a valid tar header, then brotli decompression
- * will be attempted.
- */
- brotli?: boolean | ZlibOptions;
- /**
- * Set to `true` or an object with settings for `zstd.compress()` to
- * create a zstd-compressed archive
- *
- * When extracting, this will cause the archive to be treated as a
- * zstd-compressed file if set to `true` or a ZlibOptions object.
- *
- * If set `false`, then zstd options will not be used.
- *
- * If this, the `gzip`, and `brotli` options are left `undefined`, then tar
- * will attempt to infer the zstd compression status, but can only do so
- * based on the filename. If the filename ends in `.tzst` or `.tar.zst`, and
- * the first 512 bytes are not a valid tar header, then zstd decompression
- * will be attempted.
- */
- zstd?: boolean | ZlibOptions;
- /**
- * A function that is called with `(path, stat)` when creating an archive, or
- * `(path, entry)` when extracting. Return true to process the file/entry, or
- * false to exclude it.
- */
- filter?: (path: string, entry: Stats | ReadEntry) => boolean;
- /**
- * A function that gets called for any warning encountered.
- *
- * Note: if `strict` is set, then the warning will throw, and this method
- * will not be called.
- */
- onwarn?: (code: string, message: string, data: WarnData) => unknown;
- /**
- * The maximum allowed ratio of decompressed bytes to compressed bytes when
- * reading gzip, brotli, or zstd-compressed archives.
- *
- * This defaults to `1000` and aborts extraction or parsing when exceeded.
- * Set to `Infinity` to disable the limit.
- */
- maxDecompressionRatio?: number;
- /**
- * When extracting, unlink files before creating them. Without this option,
- * tar overwrites existing files, which preserves existing hardlinks. With
- * this option, existing hardlinks will be broken, as will any symlink that
- * would affect the location of an extracted file.
- */
- unlink?: boolean;
- /**
- * When extracting, strip the specified number of path portions from the
- * entry path. For example, with `{strip: 2}`, the entry `a/b/c/d` would be
- * extracted to `{cwd}/c/d`.
- *
- * Any entry whose entire path is stripped will be excluded.
- */
- strip?: number;
- /**
- * When extracting, keep the existing file on disk if it's newer than the
- * file in the archive.
- */
- newer?: boolean;
- /**
- * When extracting, do not overwrite existing files at all.
- */
- keep?: boolean;
- /**
- * When extracting, set the `uid` and `gid` of extracted entries to the `uid`
- * and `gid` fields in the archive. Defaults to true when run as root, and
- * false otherwise.
- *
- * If false, then files and directories will be set with the owner and group
- * of the user running the process. This is similar to `-p` in `tar(1)`, but
- * ACLs and other system-specific data is never unpacked in this
- * implementation, and modes are set by default already.
- */
- preserveOwner?: boolean;
- /**
- * The maximum depth of subfolders to extract into. This defaults to 1024.
- * Anything deeper than the limit will raise a warning and skip the entry.
- * Set to `Infinity` to remove the limitation.
- */
- maxDepth?: number;
- /**
- * When extracting, force all created files and directories, and all
- * implicitly created directories, to be owned by the specified user id,
- * regardless of the `uid` field in the archive.
- *
- * Cannot be used along with `preserveOwner`. Requires also setting the `gid`
- * option.
- */
- uid?: number;
- /**
- * When extracting, force all created files and directories, and all
- * implicitly created directories, to be owned by the specified group id,
- * regardless of the `gid` field in the archive.
- *
- * Cannot be used along with `preserveOwner`. Requires also setting the `uid`
- * option.
- */
- gid?: number;
- /**
- * When extracting, provide a function that takes an `entry` object, and
- * returns a stream, or any falsey value. If a stream is provided, then that
- * stream's data will be written instead of the contents of the archive
- * entry. If a falsey value is provided, then the entry is written to disk as
- * normal.
- *
- * To exclude items from extraction, use the `filter` option.
- *
- * Note that using an asynchronous stream type with the `transform` option
- * will cause undefined behavior in synchronous extractions.
- * [MiniPass](http://npm.im/minipass)-based streams are designed for this use
- * case.
- */
- transform?: (entry: ReadEntry) => ReadEntry | null | undefined | false | 0 | '';
- /**
- * Call `chmod()` to ensure that extracted files match the entry's mode
- * field. Without this field set, all mode fields in archive entries are a
- * best effort attempt only.
- *
- * Setting this necessitates a call to the deprecated `process.umask()`
- * method to determine the default umask value, unless a `processUmask`
- * config is provided as well.
- *
- * If not set, tar will attempt to create file system entries with whatever
- * mode is provided, and let the implicit process `umask` apply normally, but
- * if a file already exists to be written to, then its existing mode will not
- * be modified.
- *
- * When setting `chmod: true`, it is highly recommend to set the
- * {@link TarOptions#processUmask} option as well, to avoid the call to the
- * deprecated (and thread-unsafe) `process.umask()` method.
- */
- chmod?: boolean;
- /**
- * When setting the {@link TarOptions#chmod} option to `true`, you may
- * provide a value here to avoid having to call the deprecated and
- * thread-unsafe `process.umask()` method.
- *
- * This has no effect with `chmod` is not set to true, as mode values are not
- * set explicitly anyway. If `chmod` is set to `true`, and a value is not
- * provided here, then `process.umask()` must be called, which will result in
- * deprecation warnings.
- *
- * The most common values for this are `0o22` (resulting in directories
- * created with mode `0o755` and files with `0o644` by default) and `0o2`
- * (resulting in directores created with mode `0o775` and files `0o664`, so
- * they are group-writable).
- */
- processUmask?: number;
- /**
- * When parsing/listing archives, `entry` streams are by default resumed
- * (set into "flowing" mode) immediately after the call to `onReadEntry()`.
- * Set `noResume: true` to suppress this behavior.
- *
- * Note that when this is set, the stream will never complete until the
- * data is consumed somehow.
- *
- * Set automatically in extract operations, since the entry is piped to
- * a file system entry right away. Only relevant when parsing.
- */
- noResume?: boolean;
- /**
- * When creating, updating, or replacing within archives, this method will
- * be called with each WriteEntry that is created.
- */
- onWriteEntry?: (entry: WriteEntry) => unknown;
- /**
- * When extracting or listing archives, this method will be called with
- * each entry that is not excluded by a `filter`.
- *
- * Important when listing archives synchronously from a file, because there
- * is otherwise no way to interact with the data!
- */
- onReadEntry?: (entry: ReadEntry) => unknown;
- /**
- * Pack the targets of symbolic links rather than the link itself.
- */
- follow?: boolean;
- /**
- * When creating archives, omit any metadata that is system-specific:
- * `ctime`, `atime`, `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and
- * `nlink`. Note that `mtime` is still included, because this is necessary
- * for other time-based operations such as `tar.update`. Additionally, `mode`
- * is set to a "reasonable default" for mose unix systems, based on an
- * effective `umask` of `0o22`.
- *
- * This also defaults the `portable` option in the gzip configs when creating
- * a compressed archive, in order to produce deterministic archives that are
- * not operating-system specific.
- */
- portable?: boolean;
- /**
- * When creating archives, do not recursively archive the contents of
- * directories. By default, archiving a directory archives all of its
- * contents as well.
- */
- noDirRecurse?: boolean;
- /**
- * Suppress Pax extended headers when creating archives. Note that this means
- * long paths and linkpaths will be truncated, and large or negative numeric
- * values may be interpreted incorrectly.
- */
- noPax?: boolean;
- /**
- * Set to a `Date` object to force a specific `mtime` value for everything
- * written to an archive.
- *
- * This is useful when creating archives that are intended to be
- * deterministic based on their contents, irrespective of the file's last
- * modification time.
- *
- * Overridden by `noMtime`.
- */
- mtime?: Date;
- /**
- * A path portion to prefix onto the entries added to an archive.
- */
- prefix?: string;
- /**
- * The mode to set on any created file archive, defaults to 0o666
- * masked by the process umask, often resulting in 0o644.
- *
- * This does *not* affect the mode fields of individual entries, or the
- * mode status of extracted entries on the filesystem.
- */
- mode?: number;
- /**
- * A cache of mtime values, to avoid having to stat the same file repeatedly.
- *
- * @internal
- */
- mtimeCache?: Map<string, Date>;
- /**
- * maximum buffer size for `fs.read()` operations.
- *
- * @internal
- */
- maxReadSize?: number;
- /**
- * Filter modes of entries being unpacked, like `process.umask()`
- *
- * @internal
- */
- umask?: number;
- /**
- * Default mode for directories. Used for all implicitly created directories,
- * and any directories in the archive that do not have a mode field.
- *
- * @internal
- */
- dmode?: number;
- /**
- * default mode for files
- *
- * @internal
- */
- fmode?: number;
- /**
- * Map that tracks which directories already exist, for extraction
- *
- * @internal
- */
- dirCache?: Map<string, boolean>;
- /**
- * maximum supported size of meta entries. Defaults to 1MB
- *
- * @internal
- */
- maxMetaEntrySize?: number;
- /**
- * A Map object containing the device and inode value for any file whose
- * `nlink` value is greater than 1, to identify hard links when creating
- * archives.
- *
- * @internal
- */
- linkCache?: Map<LinkCacheKey, string>;
- /**
- * A map object containing the results of `fs.readdir()` calls.
- *
- * @internal
- */
- readdirCache?: Map<string, string[]>;
- /**
- * A cache of all `lstat` results, for use in creating archives.
- *
- * @internal
- */
- statCache?: Map<string, Stats>;
- /**
- * Number of concurrent jobs to run when creating archives.
- *
- * Defaults to 4.
- *
- * @internal
- */
- jobs?: number;
- /**
- * Automatically set to true on Windows systems.
- *
- * When extracting, causes behavior where filenames containing `<|>?:`
- * characters are converted to windows-compatible escape sequences in the
- * created filesystem entries.
- *
- * When packing, causes behavior where paths replace `\` with `/`, and
- * filenames containing the windows-compatible escaped forms of `<|>?:` are
- * converted to actual `<|>?:` characters in the archive.
- *
- * @internal
- */
- win32?: boolean;
- /**
- * For `WriteEntry` objects, the absolute path to the entry on the
- * filesystem. By default, this is `resolve(cwd, entry.path)`, but it can be
- * overridden explicitly.
- *
- * @internal
- */
- absolute?: string;
- /**
- * Used with Parser stream interface, to attach and take over when the
- * stream is completely parsed. If this is set, then the prefinish,
- * finish, and end events will not fire, and are the responsibility of
- * the ondone method to emit properly.
- *
- * @internal
- */
- ondone?: () => void;
- /**
- * Mostly for testing, but potentially useful in some cases.
- * Forcibly trigger a chown on every entry, no matter what.
- */
- forceChown?: boolean;
- /**
- * ambiguous deprecated name for {@link onReadEntry}
- *
- * @deprecated
- */
- onentry?: (entry: ReadEntry) => unknown;
-}
-export type TarOptionsSync = TarOptions & {
- sync: true;
-};
-export type TarOptionsAsync = TarOptions & {
- sync?: false;
-};
-export type TarOptionsFile = TarOptions & {
- file: string;
-};
-export type TarOptionsNoFile = TarOptions & {
- file?: undefined;
-};
-export type TarOptionsSyncFile = TarOptionsSync & TarOptionsFile;
-export type TarOptionsAsyncFile = TarOptionsAsync & TarOptionsFile;
-export type TarOptionsSyncNoFile = TarOptionsSync & TarOptionsNoFile;
-export type TarOptionsAsyncNoFile = TarOptionsAsync & TarOptionsNoFile;
-export type LinkCacheKey = `${number}:${number}`;
-export interface TarOptionsWithAliases extends TarOptions {
- /**
- * The effective current working directory for this tar command
- */
- C?: TarOptions['cwd'];
- /**
- * The tar file to be read and/or written. When this is set, a stream
- * is not returned. Asynchronous commands will return a promise indicating
- * when the operation is completed, and synchronous commands will return
- * immediately.
- */
- f?: TarOptions['file'];
- /**
- * When creating a tar archive, this can be used to compress it as well.
- * Set to `true` to use the default gzip options, or customize them as
- * needed.
- *
- * When reading, if this is unset, then the compression status will be
- * inferred from the archive data. This is generally best, unless you are
- * sure of the compression settings in use to create the archive, and want to
- * fail if the archive doesn't match expectations.
- */
- z?: TarOptions['gzip'];
- /**
- * When creating archives, preserve absolute and `..` paths in the archive,
- * rather than sanitizing them under the cwd.
- *
- * When extracting, allow absolute paths, paths containing `..`, and
- * extracting through symbolic links. By default, the root `/` is stripped
- * from absolute paths (eg, turning `/x/y/z` into `x/y/z`), paths containing
- * `..` are not extracted, and any file whose location would be modified by a
- * symbolic link is not extracted.
- *
- * **WARNING** This is almost always unsafe, and must NEVER be used on
- * archives from untrusted sources, such as user input, and every entry must
- * be validated to ensure it is safe to write. Even if the input is not
- * malicious, mistakes can cause a lot of damage!
- */
- P?: TarOptions['preservePaths'];
- /**
- * When extracting, unlink files before creating them. Without this option,
- * tar overwrites existing files, which preserves existing hardlinks. With
- * this option, existing hardlinks will be broken, as will any symlink that
- * would affect the location of an extracted file.
- */
- U?: TarOptions['unlink'];
- /**
- * When extracting, strip the specified number of path portions from the
- * entry path. For example, with `{strip: 2}`, the entry `a/b/c/d` would be
- * extracted to `{cwd}/c/d`.
- */
- 'strip-components'?: TarOptions['strip'];
- /**
- * When extracting, strip the specified number of path portions from the
- * entry path. For example, with `{strip: 2}`, the entry `a/b/c/d` would be
- * extracted to `{cwd}/c/d`.
- */
- stripComponents?: TarOptions['strip'];
- /**
- * When extracting, keep the existing file on disk if it's newer than the
- * file in the archive.
- */
- 'keep-newer'?: TarOptions['newer'];
- /**
- * When extracting, keep the existing file on disk if it's newer than the
- * file in the archive.
- */
- keepNewer?: TarOptions['newer'];
- /**
- * When extracting, keep the existing file on disk if it's newer than the
- * file in the archive.
- */
- 'keep-newer-files'?: TarOptions['newer'];
- /**
- * When extracting, keep the existing file on disk if it's newer than the
- * file in the archive.
- */
- keepNewerFiles?: TarOptions['newer'];
- /**
- * When extracting, do not overwrite existing files at all.
- */
- k?: TarOptions['keep'];
- /**
- * When extracting, do not overwrite existing files at all.
- */
- 'keep-existing'?: TarOptions['keep'];
- /**
- * When extracting, do not overwrite existing files at all.
- */
- keepExisting?: TarOptions['keep'];
- /**
- * When extracting, do not set the `mtime` value for extracted entries to
- * match the `mtime` in the archive.
- *
- * When creating archives, do not store the `mtime` value in the entry. Note
- * that this prevents properly using other mtime-based features (such as
- * `tar.update` or the `newer` option) with the resulting archive.
- */
- m?: TarOptions['noMtime'];
- /**
- * When extracting, do not set the `mtime` value for extracted entries to
- * match the `mtime` in the archive.
- *
- * When creating archives, do not store the `mtime` value in the entry. Note
- * that this prevents properly using other mtime-based features (such as
- * `tar.update` or the `newer` option) with the resulting archive.
- */
- 'no-mtime'?: TarOptions['noMtime'];
- /**
- * When extracting, set the `uid` and `gid` of extracted entries to the `uid`
- * and `gid` fields in the archive. Defaults to true when run as root, and
- * false otherwise.
- *
- * If false, then files and directories will be set with the owner and group
- * of the user running the process. This is similar to `-p` in `tar(1)`, but
- * ACLs and other system-specific data is never unpacked in this
- * implementation, and modes are set by default already.
- */
- p?: TarOptions['preserveOwner'];
- /**
- * Pack the targets of symbolic links rather than the link itself.
- */
- L?: TarOptions['follow'];
- /**
- * Pack the targets of symbolic links rather than the link itself.
- */
- h?: TarOptions['follow'];
- /**
- * Deprecated option. Set explicitly false to set `chmod: true`. Ignored
- * if {@link TarOptions#chmod} is set to any boolean value.
- *
- * @deprecated
- */
- noChmod?: boolean;
-}
-export type TarOptionsWithAliasesSync = TarOptionsWithAliases & {
- sync: true;
-};
-export type TarOptionsWithAliasesAsync = TarOptionsWithAliases & {
- sync?: false;
-};
-export type TarOptionsWithAliasesFile = (TarOptionsWithAliases & {
- file: string;
-}) | (TarOptionsWithAliases & {
- f: string;
-});
-export type TarOptionsWithAliasesSyncFile = TarOptionsWithAliasesSync & TarOptionsWithAliasesFile;
-export type TarOptionsWithAliasesAsyncFile = TarOptionsWithAliasesAsync & TarOptionsWithAliasesFile;
-export type TarOptionsWithAliasesNoFile = TarOptionsWithAliases & {
- f?: undefined;
- file?: undefined;
-};
-export type TarOptionsWithAliasesSyncNoFile = TarOptionsWithAliasesSync & TarOptionsWithAliasesNoFile;
-export type TarOptionsWithAliasesAsyncNoFile = TarOptionsWithAliasesAsync & TarOptionsWithAliasesNoFile;
-export declare const isSyncFile: <O extends TarOptions>(o: O) => o is O & TarOptionsSyncFile;
-export declare const isAsyncFile: <O extends TarOptions>(o: O) => o is O & TarOptionsAsyncFile;
-export declare const isSyncNoFile: <O extends TarOptions>(o: O) => o is O & TarOptionsSyncNoFile;
-export declare const isAsyncNoFile: <O extends TarOptions>(o: O) => o is O & TarOptionsAsyncNoFile;
-export declare const isSync: <O extends TarOptions>(o: O) => o is O & TarOptionsSync;
-export declare const isAsync: <O extends TarOptions>(o: O) => o is O & TarOptionsAsync;
-export declare const isFile: <O extends TarOptions>(o: O) => o is O & TarOptionsFile;
-export declare const isNoFile: <O extends TarOptions>(o: O) => o is O & TarOptionsNoFile;
-export declare const dealias: (opt?: TarOptionsWithAliases) => TarOptions;
-//# sourceMappingURL=options.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/options.js b/node_modules/tar/dist/commonjs/options.js
deleted file mode 100644
index 4cd0650..0000000
--- a/node_modules/tar/dist/commonjs/options.js
+++ /dev/null
@@ -1,66 +0,0 @@
-"use strict";
-// turn tar(1) style args like `C` into the more verbose things like `cwd`
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.dealias = exports.isNoFile = exports.isFile = exports.isAsync = exports.isSync = exports.isAsyncNoFile = exports.isSyncNoFile = exports.isAsyncFile = exports.isSyncFile = void 0;
-const argmap = new Map([
- ['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', 'onReadEntry'],
-]);
-const isSyncFile = (o) => !!o.sync && !!o.file;
-exports.isSyncFile = isSyncFile;
-const isAsyncFile = (o) => !o.sync && !!o.file;
-exports.isAsyncFile = isAsyncFile;
-const isSyncNoFile = (o) => !!o.sync && !o.file;
-exports.isSyncNoFile = isSyncNoFile;
-const isAsyncNoFile = (o) => !o.sync && !o.file;
-exports.isAsyncNoFile = isAsyncNoFile;
-const isSync = (o) => !!o.sync;
-exports.isSync = isSync;
-const isAsync = (o) => !o.sync;
-exports.isAsync = isAsync;
-const isFile = (o) => !!o.file;
-exports.isFile = isFile;
-const isNoFile = (o) => !o.file;
-exports.isNoFile = isNoFile;
-const dealiasKey = (k) => {
- const d = argmap.get(k);
- if (d)
- return d;
- return k;
-};
-const dealias = (opt = {}) => {
- if (!opt)
- return {};
- const result = {};
- for (const [key, v] of Object.entries(opt)) {
- // TS doesn't know that aliases are going to always be the same type
- const k = dealiasKey(key);
- result[k] = v;
- }
- // affordance for deprecated noChmod -> chmod
- if (result.chmod === undefined && result.noChmod === false) {
- result.chmod = true;
- }
- delete result.noChmod;
- return result;
-};
-exports.dealias = dealias;
-//# sourceMappingURL=options.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/pack.d.ts b/node_modules/tar/dist/commonjs/pack.d.ts
deleted file mode 100644
index 77eda34..0000000
--- a/node_modules/tar/dist/commonjs/pack.d.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-import { type Stats } from 'fs';
-import { WriteEntry, WriteEntrySync, WriteEntryTar } from './write-entry.js';
-export declare class PackJob {
- path: string;
- absolute: string;
- entry?: WriteEntry | WriteEntryTar;
- stat?: Stats;
- readdir?: string[];
- pending: boolean;
- pendingLink: boolean;
- ignore: boolean;
- piped: boolean;
- constructor(path: string, absolute: string);
-}
-import { Minipass } from 'minipass';
-import * as zlib from 'minizlib';
-import { Yallist } from 'yallist';
-import type { ReadEntry } from './read-entry.js';
-import type { WarnEvent } from './warn-method.js';
-import { type WarnData, type Warner } from './warn-method.js';
-declare const ONSTAT: unique symbol;
-declare const ENDED: unique symbol;
-declare const QUEUE: unique symbol;
-declare const PENDINGLINKS: unique symbol;
-declare const CURRENT: unique symbol;
-declare const PROCESS: unique symbol;
-declare const PROCESSING: unique symbol;
-declare const PROCESSJOB: unique symbol;
-declare const JOBS: unique symbol;
-declare const JOBDONE: unique symbol;
-declare const ADDFSENTRY: unique symbol;
-declare const ADDTARENTRY: unique symbol;
-declare const STAT: unique symbol;
-declare const READDIR: unique symbol;
-declare const ONREADDIR: unique symbol;
-declare const PIPE: unique symbol;
-declare const ENTRY: unique symbol;
-declare const ENTRYOPT: unique symbol;
-declare const WRITEENTRYCLASS: unique symbol;
-declare const WRITE: unique symbol;
-declare const ONDRAIN: unique symbol;
-import type { TarOptions } from './options.js';
-export declare class Pack extends Minipass<Buffer, ReadEntry | string, WarnEvent<Buffer>> implements Warner {
- sync: boolean;
- opt: TarOptions;
- cwd: string;
- maxReadSize?: number;
- preservePaths: boolean;
- strict: boolean;
- noPax: boolean;
- prefix: string;
- linkCache: Exclude<TarOptions['linkCache'], undefined>;
- statCache: Exclude<TarOptions['statCache'], undefined>;
- file: string;
- portable: boolean;
- zip?: zlib.BrotliCompress | zlib.Gzip | zlib.ZstdCompress;
- readdirCache: Exclude<TarOptions['readdirCache'], undefined>;
- noDirRecurse: boolean;
- follow: boolean;
- noMtime: boolean;
- mtime?: Date;
- filter: Exclude<TarOptions['filter'], undefined>;
- jobs: number;
- [WRITEENTRYCLASS]: typeof WriteEntry | typeof WriteEntrySync;
- onWriteEntry?: (entry: WriteEntry) => void;
- [QUEUE]: Yallist<PackJob>;
- [PENDINGLINKS]: Map<`${number}:${number}`, PackJob[]>;
- [JOBS]: number;
- [PROCESSING]: boolean;
- [ENDED]: boolean;
- constructor(opt?: TarOptions);
- [WRITE](chunk: Buffer): boolean;
- add(path: string | ReadEntry): this;
- end(cb?: () => void): this;
- end(path: string | ReadEntry, cb?: () => void): this;
- end(path: string | ReadEntry, encoding?: Minipass.Encoding, cb?: () => void): this;
- write(path: string | ReadEntry): boolean;
- [ADDTARENTRY](p: ReadEntry): void;
- [ADDFSENTRY](p: string): void;
- [STAT](job: PackJob): void;
- [ONSTAT](job: PackJob, stat: Stats): void;
- [READDIR](job: PackJob): void;
- [ONREADDIR](job: PackJob, entries: string[]): void;
- [PROCESS](): void;
- get [CURRENT](): PackJob | undefined;
- [JOBDONE](job: PackJob): void;
- [PROCESSJOB](job: PackJob): void;
- [ENTRYOPT](job: PackJob): TarOptions;
- [ENTRY](job: PackJob): WriteEntry | undefined;
- [ONDRAIN](): void;
- [PIPE](job: PackJob): void;
- pause(): void;
- warn(code: string, message: string | Error, data?: WarnData): void;
-}
-export declare class PackSync extends Pack {
- sync: true;
- constructor(opt: TarOptions);
- pause(): void;
- resume(): void;
- [STAT](job: PackJob): void;
- [READDIR](job: PackJob): void;
- [PIPE](job: PackJob): void;
-}
-export {};
-//# sourceMappingURL=pack.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/pack.js b/node_modules/tar/dist/commonjs/pack.js
deleted file mode 100644
index 5a4c37a..0000000
--- a/node_modules/tar/dist/commonjs/pack.js
+++ /dev/null
@@ -1,544 +0,0 @@
-"use strict";
-// A readable tar stream creator
-// Technically, this is a transform stream that you write paths into,
-// and tar format comes out of.
-// The `add()` method is like `write()` but returns this,
-// and end() return `this` as well, so you can
-// do `new Pack(opt).add('files').add('dir').end().pipe(output)
-// You could also do something like:
-// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar'))
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.PackSync = exports.Pack = exports.PackJob = void 0;
-const fs_1 = __importDefault(require("fs"));
-const write_entry_js_1 = require("./write-entry.js");
-class PackJob {
- path;
- absolute;
- entry;
- stat;
- readdir;
- pending = false;
- pendingLink = false;
- ignore = false;
- piped = false;
- constructor(path, absolute) {
- this.path = path || './';
- this.absolute = absolute;
- }
-}
-exports.PackJob = PackJob;
-const minipass_1 = require("minipass");
-const zlib = __importStar(require("minizlib"));
-const yallist_1 = require("yallist");
-const warn_method_js_1 = require("./warn-method.js");
-const EOF = Buffer.alloc(1024);
-const ONSTAT = Symbol('onStat');
-const ENDED = Symbol('ended');
-const QUEUE = Symbol('queue');
-const PENDINGLINKS = Symbol('pendingLinks');
-const CURRENT = Symbol('current');
-const PROCESS = Symbol('process');
-const PROCESSING = Symbol('processing');
-const PROCESSJOB = Symbol('processJob');
-const JOBS = Symbol('jobs');
-const JOBDONE = Symbol('jobDone');
-const ADDFSENTRY = Symbol('addFSEntry');
-const ADDTARENTRY = Symbol('addTarEntry');
-const STAT = Symbol('stat');
-const READDIR = Symbol('readdir');
-const ONREADDIR = Symbol('onreaddir');
-const PIPE = Symbol('pipe');
-const ENTRY = Symbol('entry');
-const ENTRYOPT = Symbol('entryOpt');
-const WRITEENTRYCLASS = Symbol('writeEntryClass');
-const WRITE = Symbol('write');
-const ONDRAIN = Symbol('ondrain');
-const path_1 = __importDefault(require("path"));
-const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
-class Pack extends minipass_1.Minipass {
- sync = false;
- opt;
- cwd;
- maxReadSize;
- preservePaths;
- strict;
- noPax;
- prefix;
- linkCache;
- statCache;
- file;
- portable;
- zip;
- readdirCache;
- noDirRecurse;
- follow;
- noMtime;
- mtime;
- filter;
- jobs;
- [WRITEENTRYCLASS];
- onWriteEntry;
- // Note: we actually DO need a linked list here, because we
- // shift() to update the head of the list where we start, but still
- // while that happens, need to know what the next item in the queue
- // will be. Since we do multiple jobs in parallel, it's not as simple
- // as just an Array.shift(), since that would lose the information about
- // the next job in the list. We could add a .next field on the PackJob
- // class, but then we'd have to be tracking the tail of the queue the
- // whole time, and Yallist just does that for us anyway.
- [QUEUE];
- [PENDINGLINKS] = new Map();
- [JOBS] = 0;
- [PROCESSING] = false;
- [ENDED] = false;
- constructor(opt = {}) {
- super();
- this.opt = opt;
- this.file = opt.file || '';
- this.cwd = opt.cwd || process.cwd();
- this.maxReadSize = opt.maxReadSize;
- this.preservePaths = !!opt.preservePaths;
- this.strict = !!opt.strict;
- this.noPax = !!opt.noPax;
- this.prefix = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.prefix || '');
- this.linkCache = opt.linkCache || new Map();
- this.statCache = opt.statCache || new Map();
- this.readdirCache = opt.readdirCache || new Map();
- this.onWriteEntry = opt.onWriteEntry;
- this[WRITEENTRYCLASS] = write_entry_js_1.WriteEntry;
- if (typeof opt.onwarn === 'function') {
- this.on('warn', opt.onwarn);
- }
- this.portable = !!opt.portable;
- if (opt.gzip || opt.brotli || opt.zstd) {
- if ((opt.gzip ? 1 : 0) + (opt.brotli ? 1 : 0) + (opt.zstd ? 1 : 0) >
- 1) {
- throw new TypeError('gzip, brotli, zstd are mutually exclusive');
- }
- if (opt.gzip) {
- if (typeof opt.gzip !== 'object') {
- opt.gzip = {};
- }
- if (this.portable) {
- opt.gzip.portable = true;
- }
- this.zip = new zlib.Gzip(opt.gzip);
- }
- if (opt.brotli) {
- if (typeof opt.brotli !== 'object') {
- opt.brotli = {};
- }
- this.zip = new zlib.BrotliCompress(opt.brotli);
- }
- if (opt.zstd) {
- if (typeof opt.zstd !== 'object') {
- opt.zstd = {};
- }
- this.zip = new zlib.ZstdCompress(opt.zstd);
- }
- /* c8 ignore next */
- if (!this.zip)
- throw new Error('impossible');
- const zip = this.zip;
- zip.on('data', chunk => super.write(chunk));
- zip.on('end', () => super.end());
- zip.on('drain', () => this[ONDRAIN]());
- this.on('resume', () => zip.resume());
- }
- else {
- this.on('drain', this[ONDRAIN]);
- }
- this.noDirRecurse = !!opt.noDirRecurse;
- this.follow = !!opt.follow;
- this.noMtime = !!opt.noMtime;
- if (opt.mtime)
- this.mtime = opt.mtime;
- this.filter =
- typeof opt.filter === 'function' ? opt.filter : () => true;
- this[QUEUE] = new yallist_1.Yallist();
- this[JOBS] = 0;
- this.jobs = Number(opt.jobs) || 4;
- this[PROCESSING] = false;
- this[ENDED] = false;
- }
- [WRITE](chunk) {
- return super.write(chunk);
- }
- add(path) {
- this.write(path);
- return this;
- }
- end(path, encoding, cb) {
- /* c8 ignore start */
- if (typeof path === 'function') {
- cb = path;
- path = undefined;
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- /* c8 ignore stop */
- if (path) {
- this.add(path);
- }
- this[ENDED] = true;
- this[PROCESS]();
- /* c8 ignore next */
- if (cb)
- cb();
- return this;
- }
- write(path) {
- if (this[ENDED]) {
- throw new Error('write after end');
- }
- if (typeof path === 'string') {
- this[ADDFSENTRY](path);
- }
- else {
- this[ADDTARENTRY](path);
- }
- return this.flowing;
- }
- [ADDTARENTRY](p) {
- const absolute = (0, normalize_windows_path_js_1.normalizeWindowsPath)(path_1.default.resolve(this.cwd, p.path));
- // in this case, we don't have to wait for the stat
- if (!this.filter(p.path, p)) {
- p.resume();
- }
- else {
- const job = new PackJob(p.path, absolute);
- job.entry = new write_entry_js_1.WriteEntryTar(p, this[ENTRYOPT](job));
- job.entry.on('end', () => this[JOBDONE](job));
- this[JOBS] += 1;
- this[QUEUE].push(job);
- }
- this[PROCESS]();
- }
- [ADDFSENTRY](p) {
- const absolute = (0, normalize_windows_path_js_1.normalizeWindowsPath)(path_1.default.resolve(this.cwd, p));
- this[QUEUE].push(new PackJob(p, absolute));
- this[PROCESS]();
- }
- [STAT](job) {
- job.pending = true;
- this[JOBS] += 1;
- const stat = this.follow ? 'stat' : 'lstat';
- fs_1.default[stat](job.absolute, (er, stat) => {
- job.pending = false;
- this[JOBS] -= 1;
- if (er) {
- this.emit('error', er);
- }
- else {
- this[ONSTAT](job, stat);
- }
- });
- }
- [ONSTAT](job, stat) {
- this.statCache.set(job.absolute, stat);
- job.stat = stat;
- // now we have the stat, we can filter it.
- if (!this.filter(job.path, stat)) {
- job.ignore = true;
- }
- else if (stat.isFile() &&
- stat.nlink > 1 &&
- !this.linkCache.get(`${stat.dev}:${stat.ino}`) &&
- !this.sync) {
- // if it's not filtered, and it's a new File entry, and next anyway
- // process right away in case any pending Link entries are about
- // to try to link to it.
- if (job === this[CURRENT]) {
- this[PROCESSJOB](job);
- }
- else {
- // if it's NOT the current entry, it needs to be deferred,
- // so that the link target can be built first.
- const key = `${stat.dev}:${stat.ino}`;
- const pending = this[PENDINGLINKS].get(key);
- if (pending)
- pending.push(job);
- else
- this[PENDINGLINKS].set(key, [job]);
- job.pendingLink = true;
- job.pending = true;
- }
- }
- this[PROCESS]();
- }
- [READDIR](job) {
- job.pending = true;
- this[JOBS] += 1;
- fs_1.default.readdir(job.absolute, (er, entries) => {
- job.pending = false;
- this[JOBS] -= 1;
- if (er) {
- return this.emit('error', er);
- }
- this[ONREADDIR](job, entries);
- });
- }
- [ONREADDIR](job, entries) {
- this.readdirCache.set(job.absolute, entries);
- job.readdir = entries;
- this[PROCESS]();
- }
- [PROCESS]() {
- if (this[PROCESSING]) {
- return;
- }
- this[PROCESSING] = true;
- for (let w = this[QUEUE].head; !!w && this[JOBS] < this.jobs; w = w.next) {
- this[PROCESSJOB](w.value);
- if (w.value.ignore) {
- const p = w.next;
- this[QUEUE].removeNode(w);
- w.next = p;
- }
- }
- this[PROCESSING] = false;
- if (this[ENDED] && this[QUEUE].length === 0 && this[JOBS] === 0) {
- if (this.zip) {
- this.zip.end(EOF);
- }
- else {
- super.write(EOF);
- super.end();
- }
- }
- }
- get [CURRENT]() {
- return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value;
- }
- [JOBDONE](job) {
- this[QUEUE].shift();
- this[JOBS] -= 1;
- const { stat } = job;
- if (stat && stat.isFile() && stat.nlink > 1) {
- // might be a file with pending links
- const key = `${stat.dev}:${stat.ino}`;
- const pending = this[PENDINGLINKS].get(key);
- if (pending) {
- this[PENDINGLINKS].delete(key);
- for (const job of pending) {
- job.pending = false;
- this[PROCESSJOB](job);
- }
- }
- }
- this[PROCESS]();
- }
- [PROCESSJOB](job) {
- if (job.pending && job.pendingLink && job === this[CURRENT]) {
- // At least one of the links to this file are not being included
- // in the tarball, so we need to just proceed.
- job.pending = false;
- job.pendingLink = false;
- }
- if (job.pending) {
- return;
- }
- if (job.entry) {
- if (job === this[CURRENT] && !job.piped) {
- this[PIPE](job);
- }
- return;
- }
- if (!job.stat) {
- const sc = this.statCache.get(job.absolute);
- if (sc) {
- this[ONSTAT](job, sc);
- }
- else {
- this[STAT](job);
- }
- }
- if (!job.stat) {
- return;
- }
- // filtered out!
- if (job.ignore) {
- return;
- }
- if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {
- const rc = this.readdirCache.get(job.absolute);
- if (rc) {
- this[ONREADDIR](job, rc);
- }
- else {
- this[READDIR](job);
- }
- if (!job.readdir) {
- return;
- }
- }
- // we know it doesn't have an entry, because that got checked above
- job.entry = this[ENTRY](job);
- if (!job.entry) {
- job.ignore = true;
- return;
- }
- if (job === this[CURRENT] && !job.piped) {
- this[PIPE](job);
- }
- }
- [ENTRYOPT](job) {
- return {
- onwarn: (code, msg, data) => this.warn(code, msg, data),
- noPax: this.noPax,
- cwd: this.cwd,
- absolute: job.absolute,
- preservePaths: this.preservePaths,
- maxReadSize: this.maxReadSize,
- strict: this.strict,
- portable: this.portable,
- linkCache: this.linkCache,
- statCache: this.statCache,
- noMtime: this.noMtime,
- mtime: this.mtime,
- prefix: this.prefix,
- onWriteEntry: this.onWriteEntry,
- };
- }
- [ENTRY](job) {
- this[JOBS] += 1;
- try {
- const e = new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job));
- return e
- .on('end', () => this[JOBDONE](job))
- .on('error', er => this.emit('error', er));
- }
- catch (er) {
- this.emit('error', er);
- }
- }
- [ONDRAIN]() {
- if (this[CURRENT] && this[CURRENT].entry) {
- this[CURRENT].entry.resume();
- }
- }
- // like .pipe() but using super, because our write() is special
- [PIPE](job) {
- job.piped = true;
- if (job.readdir) {
- job.readdir.forEach(entry => {
- const p = job.path;
- const base = p === './' ? '' : p.replace(/\/*$/, '/');
- this[ADDFSENTRY](base + entry);
- });
- }
- const source = job.entry;
- const zip = this.zip;
- /* c8 ignore start */
- if (!source)
- throw new Error('cannot pipe without source');
- /* c8 ignore stop */
- if (zip) {
- source.on('data', chunk => {
- if (!zip.write(chunk)) {
- source.pause();
- }
- });
- }
- else {
- source.on('data', chunk => {
- if (!super.write(chunk)) {
- source.pause();
- }
- });
- }
- }
- pause() {
- if (this.zip) {
- this.zip.pause();
- }
- return super.pause();
- }
- warn(code, message, data = {}) {
- (0, warn_method_js_1.warnMethod)(this, code, message, data);
- }
-}
-exports.Pack = Pack;
-class PackSync extends Pack {
- sync = true;
- constructor(opt) {
- super(opt);
- this[WRITEENTRYCLASS] = write_entry_js_1.WriteEntrySync;
- }
- // pause/resume are no-ops in sync streams.
- pause() { }
- resume() { }
- [STAT](job) {
- const stat = this.follow ? 'statSync' : 'lstatSync';
- this[ONSTAT](job, fs_1.default[stat](job.absolute));
- }
- [READDIR](job) {
- this[ONREADDIR](job, fs_1.default.readdirSync(job.absolute));
- }
- // gotta get it all in this tick
- [PIPE](job) {
- const source = job.entry;
- const zip = this.zip;
- if (job.readdir) {
- job.readdir.forEach(entry => {
- const p = job.path;
- const base = p === './' ? '' : p.replace(/\/*$/, '/');
- this[ADDFSENTRY](base + entry);
- });
- }
- /* c8 ignore start */
- if (!source)
- throw new Error('Cannot pipe without source');
- /* c8 ignore stop */
- if (zip) {
- source.on('data', chunk => {
- zip.write(chunk);
- });
- }
- else {
- source.on('data', chunk => {
- super[WRITE](chunk);
- });
- }
- }
-}
-exports.PackSync = PackSync;
-//# sourceMappingURL=pack.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/package.json b/node_modules/tar/dist/commonjs/package.json
deleted file mode 100644
index 5bbefff..0000000
--- a/node_modules/tar/dist/commonjs/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "type": "commonjs"
-}
diff --git a/node_modules/tar/dist/commonjs/parse.d.ts b/node_modules/tar/dist/commonjs/parse.d.ts
deleted file mode 100644
index bb37d88..0000000
--- a/node_modules/tar/dist/commonjs/parse.d.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { EventEmitter as EE } from 'events';
-import { BrotliDecompress, Unzip, ZstdDecompress } from 'minizlib';
-import type { TarOptions } from './options.js';
-import { Pax } from './pax.js';
-import { ReadEntry } from './read-entry.js';
-import { type WarnData, type Warner } from './warn-method.js';
-declare const STATE: unique symbol;
-declare const WRITEENTRY: unique symbol;
-declare const READENTRY: unique symbol;
-declare const NEXTENTRY: unique symbol;
-declare const PROCESSENTRY: unique symbol;
-declare const EX: unique symbol;
-declare const GEX: unique symbol;
-declare const META: unique symbol;
-declare const EMITMETA: unique symbol;
-declare const BUFFER: unique symbol;
-declare const QUEUE: unique symbol;
-declare const ENDED: unique symbol;
-declare const EMITTEDEND: unique symbol;
-declare const EMIT: unique symbol;
-declare const UNZIP: unique symbol;
-declare const CONSUMECHUNK: unique symbol;
-declare const CONSUMECHUNKSUB: unique symbol;
-declare const CONSUMEBODY: unique symbol;
-declare const CONSUMEMETA: unique symbol;
-declare const CONSUMEHEADER: unique symbol;
-declare const CONSUMING: unique symbol;
-declare const BUFFERCONCAT: unique symbol;
-declare const MAYBEEND: unique symbol;
-declare const WRITING: unique symbol;
-declare const ABORTED: unique symbol;
-declare const SAW_VALID_ENTRY: unique symbol;
-declare const SAW_NULL_BLOCK: unique symbol;
-declare const SAW_EOF: unique symbol;
-declare const CLOSESTREAM: unique symbol;
-declare const COMPRESSEDBYTESREAD: unique symbol;
-declare const DECOMPRESSEDBYTESREAD: unique symbol;
-declare const CHECKDECOMPRESSIONRATIO: unique symbol;
-export type State = 'begin' | 'header' | 'ignore' | 'meta' | 'body';
-export declare class Parser extends EE implements Warner {
- file: string;
- strict: boolean;
- maxMetaEntrySize: number;
- filter: Exclude<TarOptions['filter'], undefined>;
- brotli?: TarOptions['brotli'];
- zstd?: TarOptions['zstd'];
- maxDecompressionRatio: number;
- writable: true;
- readable: false;
- [QUEUE]: (ReadEntry | [string | symbol, unknown, unknown])[];
- [BUFFER]?: Buffer;
- [READENTRY]?: ReadEntry;
- [WRITEENTRY]?: ReadEntry;
- [STATE]: State;
- [META]: string;
- [EX]?: Pax;
- [GEX]?: Pax;
- [ENDED]: boolean;
- [UNZIP]?: false | Unzip | BrotliDecompress | ZstdDecompress;
- [ABORTED]: boolean;
- [SAW_VALID_ENTRY]?: boolean;
- [SAW_NULL_BLOCK]: boolean;
- [SAW_EOF]: boolean;
- [WRITING]: boolean;
- [CONSUMING]: boolean;
- [EMITTEDEND]: boolean;
- [COMPRESSEDBYTESREAD]: number;
- [DECOMPRESSEDBYTESREAD]: number;
- constructor(opt?: TarOptions);
- warn(code: string, message: string | Error, data?: WarnData): void;
- [CONSUMEHEADER](chunk: Buffer, position: number): void;
- [CLOSESTREAM](): void;
- [PROCESSENTRY](entry?: ReadEntry | [string | symbol, unknown, unknown]): boolean;
- [NEXTENTRY](): void;
- [CONSUMEBODY](chunk: Buffer, position: number): number;
- [CONSUMEMETA](chunk: Buffer, position: number): number;
- [EMIT](ev: string | symbol, data?: unknown, extra?: unknown): void;
- [EMITMETA](entry: ReadEntry): void;
- abort(error: Error): void;
- [CHECKDECOMPRESSIONRATIO](chunk: Buffer): boolean;
- write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
- write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
- [BUFFERCONCAT](c: Buffer): void;
- [MAYBEEND](): void;
- [CONSUMECHUNK](chunk?: Buffer): void;
- [CONSUMECHUNKSUB](chunk: Buffer): void;
- end(cb?: () => void): this;
- end(data: string | Buffer, cb?: () => void): this;
- end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
-}
-export {};
-//# sourceMappingURL=parse.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/parse.js b/node_modules/tar/dist/commonjs/parse.js
deleted file mode 100644
index 7bd4e1b..0000000
--- a/node_modules/tar/dist/commonjs/parse.js
+++ /dev/null
@@ -1,655 +0,0 @@
-"use strict";
-// this[BUFFER] is the remainder of a chunk if we're waiting for
-// the full 512 bytes of a header to come in. We will Buffer.concat()
-// it to the next write(), which is a mem copy, but a small one.
-//
-// this[QUEUE] is a list of entries that haven't been emitted
-// yet this can only get filled up if the user keeps write()ing after
-// a write() returns false, or does a write() with more than one entry
-//
-// We don't buffer chunks, we always parse them and either create an
-// entry, or push it into the active entry. The ReadEntry class knows
-// to throw data away if .ignore=true
-//
-// Shift entry off the buffer when it emits 'end', and emit 'entry' for
-// the next one in the list.
-//
-// At any time, we're pushing body chunks into the entry at WRITEENTRY,
-// and waiting for 'end' on the entry at READENTRY
-//
-// ignored entries get .resume() called on them straight away
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.Parser = void 0;
-const events_1 = require("events");
-const minizlib_1 = require("minizlib");
-const header_js_1 = require("./header.js");
-const pax_js_1 = require("./pax.js");
-const read_entry_js_1 = require("./read-entry.js");
-const warn_method_js_1 = require("./warn-method.js");
-const maxMetaEntrySize = 1024 * 1024;
-const gzipHeader = Buffer.from([0x1f, 0x8b]);
-const zstdHeader = Buffer.from([0x28, 0xb5, 0x2f, 0xfd]);
-const ZIP_HEADER_LEN = Math.max(gzipHeader.length, zstdHeader.length);
-const STATE = Symbol('state');
-const WRITEENTRY = Symbol('writeEntry');
-const READENTRY = Symbol('readEntry');
-const NEXTENTRY = Symbol('nextEntry');
-const PROCESSENTRY = Symbol('processEntry');
-const EX = Symbol('extendedHeader');
-const GEX = Symbol('globalExtendedHeader');
-const META = Symbol('meta');
-const EMITMETA = Symbol('emitMeta');
-const BUFFER = Symbol('buffer');
-const QUEUE = Symbol('queue');
-const ENDED = Symbol('ended');
-const EMITTEDEND = Symbol('emittedEnd');
-const EMIT = Symbol('emit');
-const UNZIP = Symbol('unzip');
-const CONSUMECHUNK = Symbol('consumeChunk');
-const CONSUMECHUNKSUB = Symbol('consumeChunkSub');
-const CONSUMEBODY = Symbol('consumeBody');
-const CONSUMEMETA = Symbol('consumeMeta');
-const CONSUMEHEADER = Symbol('consumeHeader');
-const CONSUMING = Symbol('consuming');
-const BUFFERCONCAT = Symbol('bufferConcat');
-const MAYBEEND = Symbol('maybeEnd');
-const WRITING = Symbol('writing');
-const ABORTED = Symbol('aborted');
-const DONE = Symbol('onDone');
-const SAW_VALID_ENTRY = Symbol('sawValidEntry');
-const SAW_NULL_BLOCK = Symbol('sawNullBlock');
-const SAW_EOF = Symbol('sawEOF');
-const CLOSESTREAM = Symbol('closeStream');
-const MAX_DECOMPRESSION_RATIO = 1000;
-const COMPRESSEDBYTESREAD = Symbol('compressedBytesRead');
-const DECOMPRESSEDBYTESREAD = Symbol('decompressedBytesRead');
-const CHECKDECOMPRESSIONRATIO = Symbol('checkDecompressionRatio');
-const noop = () => true;
-class Parser extends events_1.EventEmitter {
- file;
- strict;
- maxMetaEntrySize;
- filter;
- brotli;
- zstd;
- maxDecompressionRatio;
- writable = true;
- readable = false;
- [QUEUE] = [];
- [BUFFER];
- [READENTRY];
- [WRITEENTRY];
- [STATE] = 'begin';
- [META] = '';
- [EX];
- [GEX];
- [ENDED] = false;
- [UNZIP];
- [ABORTED] = false;
- [SAW_VALID_ENTRY];
- [SAW_NULL_BLOCK] = false;
- [SAW_EOF] = false;
- [WRITING] = false;
- [CONSUMING] = false;
- [EMITTEDEND] = false;
- [COMPRESSEDBYTESREAD] = 0;
- [DECOMPRESSEDBYTESREAD] = 0;
- constructor(opt = {}) {
- super();
- this.file = opt.file || '';
- // these BADARCHIVE errors can't be detected early. listen on DONE.
- this.on(DONE, () => {
- if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) {
- // either less than 1 block of data, or all entries were invalid.
- // Either way, probably not even a tarball.
- this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format');
- }
- });
- if (opt.ondone) {
- this.on(DONE, opt.ondone);
- }
- else {
- this.on(DONE, () => {
- this.emit('prefinish');
- this.emit('finish');
- this.emit('end');
- });
- }
- this.strict = !!opt.strict;
- this.maxDecompressionRatio =
- typeof opt.maxDecompressionRatio === 'number' ?
- opt.maxDecompressionRatio
- : MAX_DECOMPRESSION_RATIO;
- this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize;
- this.filter = typeof opt.filter === 'function' ? opt.filter : noop;
- // Unlike gzip, brotli doesn't have any magic bytes to identify it
- // Users need to explicitly tell us they're extracting a brotli file
- // Or we infer from the file extension
- const isTBR = opt.file &&
- (opt.file.endsWith('.tar.br') || opt.file.endsWith('.tbr'));
- // if it's a tbr file it MIGHT be brotli, but we don't know until
- // we look at it and verify it's not a valid tar file.
- this.brotli =
- !(opt.gzip || opt.zstd) && opt.brotli !== undefined ? opt.brotli
- : isTBR ? undefined
- : false;
- // zstd has magic bytes to identify it, but we also support explicit options
- // and file extension detection
- const isTZST = opt.file &&
- (opt.file.endsWith('.tar.zst') || opt.file.endsWith('.tzst'));
- this.zstd =
- !(opt.gzip || opt.brotli) && opt.zstd !== undefined ? opt.zstd
- : isTZST ? true
- : undefined;
- // have to set this so that streams are ok piping into it
- this.on('end', () => this[CLOSESTREAM]());
- if (typeof opt.onwarn === 'function') {
- this.on('warn', opt.onwarn);
- }
- if (typeof opt.onReadEntry === 'function') {
- this.on('entry', opt.onReadEntry);
- }
- }
- warn(code, message, data = {}) {
- (0, warn_method_js_1.warnMethod)(this, code, message, data);
- }
- [CONSUMEHEADER](chunk, position) {
- if (this[SAW_VALID_ENTRY] === undefined) {
- this[SAW_VALID_ENTRY] = false;
- }
- let header;
- try {
- header = new header_js_1.Header(chunk, position, this[EX], this[GEX]);
- }
- catch (er) {
- return this.warn('TAR_ENTRY_INVALID', er);
- }
- if (header.nullBlock) {
- if (this[SAW_NULL_BLOCK]) {
- this[SAW_EOF] = true;
- // ending an archive with no entries. pointless, but legal.
- if (this[STATE] === 'begin') {
- this[STATE] = 'header';
- }
- this[EMIT]('eof');
- }
- else {
- this[SAW_NULL_BLOCK] = true;
- this[EMIT]('nullBlock');
- }
- }
- else {
- this[SAW_NULL_BLOCK] = false;
- if (!header.cksumValid) {
- this.warn('TAR_ENTRY_INVALID', 'checksum failure', { header });
- }
- else if (!header.path) {
- this.warn('TAR_ENTRY_INVALID', 'path is required', { header });
- }
- else {
- const type = header.type;
- if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) {
- this.warn('TAR_ENTRY_INVALID', 'linkpath required', {
- header,
- });
- }
- else if (!/^(Symbolic)?Link$/.test(type) &&
- !/^(Global)?ExtendedHeader$/.test(type) &&
- header.linkpath) {
- this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {
- header,
- });
- }
- else {
- const entry = (this[WRITEENTRY] = new read_entry_js_1.ReadEntry(header, this[EX], this[GEX]));
- // we do this for meta & ignored entries as well, because they
- // are still valid tar, or else we wouldn't know to ignore them
- if (!this[SAW_VALID_ENTRY]) {
- if (entry.remain) {
- // this might be the one!
- const onend = () => {
- if (!entry.invalid) {
- this[SAW_VALID_ENTRY] = true;
- }
- };
- entry.on('end', onend);
- }
- else {
- this[SAW_VALID_ENTRY] = true;
- }
- }
- if (entry.meta) {
- if (entry.size > this.maxMetaEntrySize) {
- entry.ignore = true;
- this[EMIT]('ignoredEntry', entry);
- this[STATE] = 'ignore';
- entry.resume();
- }
- else if (entry.size > 0) {
- this[META] = '';
- entry.on('data', c => (this[META] += c));
- this[STATE] = 'meta';
- }
- }
- else {
- this[EX] = undefined;
- entry.ignore = entry.ignore || !this.filter(entry.path, entry);
- if (entry.ignore) {
- // probably valid, just not something we care about
- this[EMIT]('ignoredEntry', entry);
- this[STATE] = entry.remain ? 'ignore' : 'header';
- entry.resume();
- }
- else {
- if (entry.remain) {
- this[STATE] = 'body';
- }
- else {
- this[STATE] = 'header';
- entry.end();
- }
- if (!this[READENTRY]) {
- this[QUEUE].push(entry);
- this[NEXTENTRY]();
- }
- else {
- this[QUEUE].push(entry);
- }
- }
- }
- }
- }
- }
- }
- [CLOSESTREAM]() {
- queueMicrotask(() => this.emit('close'));
- }
- [PROCESSENTRY](entry) {
- let go = true;
- if (!entry) {
- this[READENTRY] = undefined;
- go = false;
- }
- else if (Array.isArray(entry)) {
- const [ev, ...args] = entry;
- this.emit(ev, ...args);
- }
- else {
- this[READENTRY] = entry;
- this.emit('entry', entry);
- if (!entry.emittedEnd) {
- entry.on('end', () => this[NEXTENTRY]());
- go = false;
- }
- }
- return go;
- }
- [NEXTENTRY]() {
- do { } while (this[PROCESSENTRY](this[QUEUE].shift()));
- if (this[QUEUE].length === 0) {
- // At this point, there's nothing in the queue, but we may have an
- // entry which is being consumed (readEntry).
- // If we don't, then we definitely can handle more data.
- // If we do, and either it's flowing, or it has never had any data
- // written to it, then it needs more.
- // The only other possibility is that it has returned false from a
- // write() call, so we wait for the next drain to continue.
- const re = this[READENTRY];
- const drainNow = !re || re.flowing || re.size === re.remain;
- if (drainNow) {
- if (!this[WRITING]) {
- this.emit('drain');
- }
- }
- else {
- re.once('drain', () => this.emit('drain'));
- }
- }
- }
- [CONSUMEBODY](chunk, position) {
- // write up to but no more than writeEntry.blockRemain
- const entry = this[WRITEENTRY];
- /* c8 ignore start */
- if (!entry) {
- throw new Error('attempt to consume body without entry??');
- }
- const br = entry.blockRemain ?? 0;
- /* c8 ignore stop */
- const c = br >= chunk.length && position === 0 ?
- chunk
- : chunk.subarray(position, position + br);
- entry.write(c);
- if (!entry.blockRemain) {
- this[STATE] = 'header';
- this[WRITEENTRY] = undefined;
- entry.end();
- }
- return c.length;
- }
- [CONSUMEMETA](chunk, position) {
- const entry = this[WRITEENTRY];
- const ret = this[CONSUMEBODY](chunk, position);
- // if we finished, then the entry is reset
- if (!this[WRITEENTRY] && entry) {
- this[EMITMETA](entry);
- }
- return ret;
- }
- [EMIT](ev, data, extra) {
- if (this[QUEUE].length === 0 && !this[READENTRY]) {
- this.emit(ev, data, extra);
- }
- else {
- this[QUEUE].push([ev, data, extra]);
- }
- }
- [EMITMETA](entry) {
- this[EMIT]('meta', this[META]);
- switch (entry.type) {
- case 'ExtendedHeader':
- case 'OldExtendedHeader':
- this[EX] = pax_js_1.Pax.parse(this[META], this[EX], false);
- break;
- case 'GlobalExtendedHeader':
- this[GEX] = pax_js_1.Pax.parse(this[META], this[GEX], true);
- break;
- case 'NextFileHasLongPath':
- case 'OldGnuLongPath': {
- const ex = this[EX] ?? Object.create(null);
- this[EX] = ex;
- ex.path = this[META].replace(/\0.*/, '');
- break;
- }
- case 'NextFileHasLongLinkpath': {
- const ex = this[EX] || Object.create(null);
- this[EX] = ex;
- ex.linkpath = this[META].replace(/\0.*/, '');
- break;
- }
- /* c8 ignore start */
- default:
- throw new Error('unknown meta: ' + entry.type);
- /* c8 ignore stop */
- }
- }
- abort(error) {
- if (this[ABORTED]) {
- return;
- }
- if (this[UNZIP]) {
- // fully nerf the decompressor and close its underlying binding
- const u = this[UNZIP];
- /* c8 ignore start */
- u.write = () => true;
- u.end = () => u;
- u.emit = () => false;
- /* c8 ignore stop */
- u.destroy?.();
- }
- this[ABORTED] = true;
- this.emit('abort', error);
- // always throws, even in non-strict mode
- this.warn('TAR_ABORT', error, { recoverable: false });
- }
- [CHECKDECOMPRESSIONRATIO](chunk) {
- this[DECOMPRESSEDBYTESREAD] += chunk.length;
- const ratio = this[DECOMPRESSEDBYTESREAD] / this[COMPRESSEDBYTESREAD];
- if (ratio > this.maxDecompressionRatio) {
- this.abort(new Error(`max decompression ratio exceeded: ${ratio.toFixed(2)} > ${this.maxDecompressionRatio}`));
- return false;
- }
- return true;
- }
- write(chunk, encoding, cb) {
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- if (typeof chunk === 'string') {
- chunk = Buffer.from(chunk,
- /* c8 ignore next */
- typeof encoding === 'string' ? encoding : 'utf8');
- }
- if (this[ABORTED]) {
- /* c8 ignore next */
- cb?.();
- return false;
- }
- // first write, might be gzipped, zstd, or brotli compressed
- const needSniff = this[UNZIP] === undefined ||
- (this.brotli === undefined && this[UNZIP] === false);
- if (needSniff && chunk) {
- if (this[BUFFER]) {
- chunk = Buffer.concat([this[BUFFER], chunk]);
- this[BUFFER] = undefined;
- }
- if (chunk.length < ZIP_HEADER_LEN) {
- this[BUFFER] = chunk;
- /* c8 ignore next */
- cb?.();
- return true;
- }
- // look for gzip header
- for (let i = 0; this[UNZIP] === undefined && i < gzipHeader.length; i++) {
- if (chunk[i] !== gzipHeader[i]) {
- this[UNZIP] = false;
- }
- }
- // look for zstd header if gzip header not found
- let isZstd = false;
- if (this[UNZIP] === false && this.zstd !== false) {
- isZstd = true;
- for (let i = 0; i < zstdHeader.length; i++) {
- if (chunk[i] !== zstdHeader[i]) {
- isZstd = false;
- break;
- }
- }
- }
- const maybeBrotli = this.brotli === undefined && !isZstd;
- if (this[UNZIP] === false && maybeBrotli) {
- // read the first header to see if it's a valid tar file. If so,
- // we can safely assume that it's not actually brotli, despite the
- // .tbr or .tar.br file extension.
- // if we ended before getting a full chunk, yes, def brotli
- if (chunk.length < 512) {
- if (this[ENDED]) {
- this.brotli = true;
- }
- else {
- this[BUFFER] = chunk;
- /* c8 ignore next */
- cb?.();
- return true;
- }
- }
- else {
- // if it's tar, it's pretty reliably not brotli, chances of
- // that happening are astronomical.
- try {
- new header_js_1.Header(chunk.subarray(0, 512));
- this.brotli = false;
- }
- catch (_) {
- this.brotli = true;
- }
- }
- }
- if (this[UNZIP] === undefined ||
- (this[UNZIP] === false && (this.brotli || isZstd))) {
- const ended = this[ENDED];
- this[ENDED] = false;
- this[UNZIP] =
- this[UNZIP] === undefined ? new minizlib_1.Unzip({})
- : isZstd ? new minizlib_1.ZstdDecompress({})
- : new minizlib_1.BrotliDecompress({});
- this[UNZIP].on('data', chunk => {
- if (this[CHECKDECOMPRESSIONRATIO](chunk)) {
- this[CONSUMECHUNK](chunk);
- }
- });
- this[UNZIP].on('error', er => {
- if (!this[ABORTED]) {
- this.abort(er);
- }
- });
- this[UNZIP].on('end', () => {
- this[ENDED] = true;
- this[CONSUMECHUNK]();
- });
- this[WRITING] = true;
- this[COMPRESSEDBYTESREAD] += chunk.length;
- const ret = !!this[UNZIP][ended ? 'end' : 'write'](chunk);
- this[WRITING] = false;
- cb?.();
- return ret;
- }
- }
- this[WRITING] = true;
- if (this[UNZIP]) {
- this[COMPRESSEDBYTESREAD] += chunk.length;
- this[UNZIP].write(chunk);
- }
- else {
- this[CONSUMECHUNK](chunk);
- }
- this[WRITING] = false;
- // return false if there's a queue, or if the current entry isn't flowing
- const ret = this[QUEUE].length > 0 ? false
- : this[READENTRY] ? this[READENTRY].flowing
- : true;
- // if we have no queue, then that means a clogged READENTRY
- if (!ret && this[QUEUE].length === 0) {
- this[READENTRY]?.once('drain', () => this.emit('drain'));
- }
- /* c8 ignore next */
- cb?.();
- return ret;
- }
- [BUFFERCONCAT](c) {
- if (c && !this[ABORTED]) {
- this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c;
- }
- }
- [MAYBEEND]() {
- if (this[ENDED] &&
- !this[EMITTEDEND] &&
- !this[ABORTED] &&
- !this[CONSUMING]) {
- this[EMITTEDEND] = true;
- const entry = this[WRITEENTRY];
- if (entry?.blockRemain) {
- // truncated, likely a damaged file
- const have = this[BUFFER] ? this[BUFFER].length : 0;
- this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry });
- if (this[BUFFER]) {
- entry.write(this[BUFFER]);
- }
- entry.end();
- }
- this[EMIT](DONE);
- }
- }
- [CONSUMECHUNK](chunk) {
- if (this[CONSUMING] && chunk) {
- this[BUFFERCONCAT](chunk);
- }
- else if (!chunk && !this[BUFFER]) {
- this[MAYBEEND]();
- }
- else if (chunk) {
- this[CONSUMING] = true;
- if (this[BUFFER]) {
- this[BUFFERCONCAT](chunk);
- const c = this[BUFFER];
- this[BUFFER] = undefined;
- this[CONSUMECHUNKSUB](c);
- }
- else {
- this[CONSUMECHUNKSUB](chunk);
- }
- while (this[BUFFER] &&
- this[BUFFER]?.length >= 512 &&
- !this[ABORTED] &&
- !this[SAW_EOF]) {
- const c = this[BUFFER];
- this[BUFFER] = undefined;
- this[CONSUMECHUNKSUB](c);
- }
- this[CONSUMING] = false;
- }
- if (!this[BUFFER] || this[ENDED]) {
- this[MAYBEEND]();
- }
- }
- [CONSUMECHUNKSUB](chunk) {
- // we know that we are in CONSUMING mode, so anything written goes into
- // the buffer. Advance the position and put any remainder in the buffer.
- let position = 0;
- const length = chunk.length;
- while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) {
- switch (this[STATE]) {
- case 'begin':
- case 'header':
- this[CONSUMEHEADER](chunk, position);
- position += 512;
- break;
- case 'ignore':
- case 'body':
- position += this[CONSUMEBODY](chunk, position);
- break;
- case 'meta':
- position += this[CONSUMEMETA](chunk, position);
- break;
- /* c8 ignore start */
- default:
- throw new Error('invalid state: ' + this[STATE]);
- /* c8 ignore stop */
- }
- }
- if (position < length) {
- this[BUFFER] =
- this[BUFFER] ?
- Buffer.concat([chunk.subarray(position), this[BUFFER]])
- : chunk.subarray(position);
- }
- }
- end(chunk, encoding, cb) {
- if (typeof chunk === 'function') {
- cb = chunk;
- encoding = undefined;
- chunk = undefined;
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- if (typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
- }
- if (cb)
- this.once('finish', cb);
- if (!this[ABORTED]) {
- if (this[UNZIP]) {
- /* c8 ignore start */
- if (chunk) {
- this[COMPRESSEDBYTESREAD] += chunk.length;
- this[UNZIP].write(chunk);
- }
- /* c8 ignore stop */
- this[UNZIP].end();
- }
- else {
- this[ENDED] = true;
- if (this.brotli === undefined || this.zstd === undefined)
- chunk = chunk || Buffer.alloc(0);
- if (chunk)
- this.write(chunk);
- this[MAYBEEND]();
- }
- }
- return this;
- }
-}
-exports.Parser = Parser;
-//# sourceMappingURL=parse.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/path-reservations.d.ts b/node_modules/tar/dist/commonjs/path-reservations.d.ts
deleted file mode 100644
index 44f0482..0000000
--- a/node_modules/tar/dist/commonjs/path-reservations.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export type Reservation = {
- paths: string[];
- dirs: Set<string>;
-};
-export type Handler = (clear: () => void) => void;
-export declare class PathReservations {
- #private;
- reserve(paths: string[], fn: Handler): boolean;
- check(fn: Handler): boolean;
-}
-//# sourceMappingURL=path-reservations.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/path-reservations.js b/node_modules/tar/dist/commonjs/path-reservations.js
deleted file mode 100644
index 68eeefb..0000000
--- a/node_modules/tar/dist/commonjs/path-reservations.js
+++ /dev/null
@@ -1,170 +0,0 @@
-"use strict";
-// A path exclusive reservation system
-// reserve([list, of, paths], fn)
-// When the fn is first in line for all its paths, it
-// is called with a cb that clears the reservation.
-//
-// Used by async unpack to avoid clobbering paths in use,
-// while still allowing maximal safe parallelization.
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.PathReservations = void 0;
-const node_path_1 = require("node:path");
-const normalize_unicode_js_1 = require("./normalize-unicode.js");
-const strip_trailing_slashes_js_1 = require("./strip-trailing-slashes.js");
-const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
-const isWindows = platform === 'win32';
-// return a set of parent dirs for a given path
-// '/a/b/c/d' -> ['/', '/a', '/a/b', '/a/b/c', '/a/b/c/d']
-const getDirs = (path) => {
- const dirs = path
- .split('/')
- .slice(0, -1)
- .reduce((set, path) => {
- const s = set.at(-1);
- if (s !== undefined) {
- path = (0, node_path_1.join)(s, path);
- }
- set.push(path || '/');
- return set;
- }, []);
- return dirs;
-};
-class PathReservations {
- // path => [function or Set]
- // A Set object means a directory reservation
- // A fn is a direct reservation on that path
- #queues = new Map();
- // fn => {paths:[path,...], dirs:[path, ...]}
- #reservations = new Map();
- // functions currently running
- #running = new Set();
- reserve(paths, fn) {
- paths =
- isWindows ?
- ['win32 parallelization disabled']
- : paths.map(p => {
- // don't need normPath, because we skip this entirely for windows
- return (0, strip_trailing_slashes_js_1.stripTrailingSlashes)((0, node_path_1.join)((0, normalize_unicode_js_1.normalizeUnicode)(p)));
- });
- const dirs = new Set(paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)));
- this.#reservations.set(fn, { dirs, paths });
- for (const p of paths) {
- const q = this.#queues.get(p);
- if (!q) {
- this.#queues.set(p, [fn]);
- }
- else {
- q.push(fn);
- }
- }
- for (const dir of dirs) {
- const q = this.#queues.get(dir);
- if (!q) {
- this.#queues.set(dir, [new Set([fn])]);
- }
- else {
- const l = q.at(-1);
- if (l instanceof Set) {
- l.add(fn);
- }
- else {
- q.push(new Set([fn]));
- }
- }
- }
- return this.#run(fn);
- }
- // return the queues for each path the function cares about
- // fn => {paths, dirs}
- #getQueues(fn) {
- const res = this.#reservations.get(fn);
- /* c8 ignore start */
- if (!res) {
- throw new Error('function does not have any path reservations');
- }
- /* c8 ignore stop */
- return {
- paths: res.paths.map((path) => this.#queues.get(path)),
- dirs: [...res.dirs].map(path => this.#queues.get(path)),
- };
- }
- // check if fn is first in line for all its paths, and is
- // included in the first set for all its dir queues
- check(fn) {
- const { paths, dirs } = this.#getQueues(fn);
- return (paths.every(q => q && q[0] === fn) &&
- dirs.every(q => q && q[0] instanceof Set && q[0].has(fn)));
- }
- // run the function if it's first in line and not already running
- #run(fn) {
- if (this.#running.has(fn) || !this.check(fn)) {
- return false;
- }
- this.#running.add(fn);
- fn(() => this.#clear(fn));
- return true;
- }
- #clear(fn) {
- if (!this.#running.has(fn)) {
- return false;
- }
- const res = this.#reservations.get(fn);
- /* c8 ignore start */
- if (!res) {
- throw new Error('invalid reservation');
- }
- /* c8 ignore stop */
- const { paths, dirs } = res;
- const next = new Set();
- for (const path of paths) {
- const q = this.#queues.get(path);
- /* c8 ignore start */
- if (!q || q?.[0] !== fn) {
- continue;
- }
- /* c8 ignore stop */
- const q0 = q[1];
- if (!q0) {
- this.#queues.delete(path);
- continue;
- }
- q.shift();
- if (typeof q0 === 'function') {
- next.add(q0);
- }
- else {
- for (const f of q0) {
- next.add(f);
- }
- }
- }
- for (const dir of dirs) {
- const q = this.#queues.get(dir);
- const q0 = q?.[0];
- /* c8 ignore next - type safety only */
- if (!q || !(q0 instanceof Set))
- continue;
- if (q0.size === 1 && q.length === 1) {
- this.#queues.delete(dir);
- continue;
- }
- else if (q0.size === 1) {
- q.shift();
- // next one must be a function,
- // or else the Set would've been reused
- const n = q[0];
- if (typeof n === 'function') {
- next.add(n);
- }
- }
- else {
- q0.delete(fn);
- }
- }
- this.#running.delete(fn);
- next.forEach(fn => this.#run(fn));
- return true;
- }
-}
-exports.PathReservations = PathReservations;
-//# sourceMappingURL=path-reservations.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/pax.d.ts b/node_modules/tar/dist/commonjs/pax.d.ts
deleted file mode 100644
index a4913c7..0000000
--- a/node_modules/tar/dist/commonjs/pax.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { HeaderData } from './header.js';
-export declare class Pax implements HeaderData {
- atime?: Date;
- mtime?: Date;
- ctime?: Date;
- charset?: string;
- comment?: string;
- gid?: number;
- uid?: number;
- gname?: string;
- uname?: string;
- linkpath?: string;
- dev?: number;
- ino?: number;
- nlink?: number;
- path?: string;
- size?: number;
- mode?: number;
- global: boolean;
- constructor(obj: HeaderData, global?: boolean);
- encode(): Buffer<ArrayBuffer>;
- encodeBody(): string;
- encodeField(field: keyof Pax): string;
- static parse(str: string, ex?: HeaderData, g?: boolean): Pax;
-}
-//# sourceMappingURL=pax.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/pax.js b/node_modules/tar/dist/commonjs/pax.js
deleted file mode 100644
index fce37f6..0000000
--- a/node_modules/tar/dist/commonjs/pax.js
+++ /dev/null
@@ -1,182 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.Pax = void 0;
-const node_path_1 = require("node:path");
-const header_js_1 = require("./header.js");
-class Pax {
- atime;
- mtime;
- ctime;
- charset;
- comment;
- gid;
- uid;
- gname;
- uname;
- linkpath;
- dev;
- ino;
- nlink;
- path;
- size;
- mode;
- global;
- constructor(obj, global = false) {
- this.atime = obj.atime;
- this.charset = obj.charset;
- this.comment = obj.comment;
- this.ctime = obj.ctime;
- this.dev = obj.dev;
- this.gid = obj.gid;
- this.global = global;
- this.gname = obj.gname;
- this.ino = obj.ino;
- this.linkpath = obj.linkpath;
- this.mtime = obj.mtime;
- this.nlink = obj.nlink;
- this.path = obj.path;
- this.size = obj.size;
- this.uid = obj.uid;
- this.uname = obj.uname;
- }
- encode() {
- const body = this.encodeBody();
- if (body === '') {
- return Buffer.allocUnsafe(0);
- }
- const bodyLen = Buffer.byteLength(body);
- // round up to 512 bytes
- // add 512 for header
- const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
- const buf = Buffer.allocUnsafe(bufLen);
- // 0-fill the header section, it might not hit every field
- for (let i = 0; i < 512; i++) {
- buf[i] = 0;
- }
- new header_js_1.Header({
- // XXX split the path
- // then the path should be PaxHeader + basename, but less than 99,
- // prepend with the dirname
- /* c8 ignore start */
- path: ('PaxHeader/' + (0, node_path_1.basename)(this.path ?? '')).slice(0, 99),
- /* c8 ignore stop */
- mode: this.mode || 0o644,
- uid: this.uid,
- gid: this.gid,
- size: bodyLen,
- 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(buf);
- buf.write(body, 512, bodyLen, 'utf8');
- // null pad after the body
- for (let i = bodyLen + 512; i < buf.length; i++) {
- buf[i] = 0;
- }
- return buf;
- }
- 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(field) {
- if (this[field] === undefined) {
- return '';
- }
- const r = this[field];
- const v = r instanceof Date ? r.getTime() / 1000 : r;
- const s = ' ' +
- (field === 'dev' || field === 'ino' || field === 'nlink' ?
- 'SCHILY.'
- : '') +
- field +
- '=' +
- v +
- '\n';
- const byteLen = Buffer.byteLength(s);
- // the digits includes the length of the digits in ascii base-10
- // so if it's 9 characters, then adding 1 for the 9 makes it 10
- // which makes it 11 chars.
- let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
- if (byteLen + digits >= Math.pow(10, digits)) {
- digits += 1;
- }
- const len = digits + byteLen;
- return len + s;
- }
- static parse(str, ex, g = false) {
- return new Pax(merge(parseKV(str), ex), g);
- }
-}
-exports.Pax = Pax;
-const merge = (a, b) => b ? Object.assign({}, b, a) : a;
-const parseKV = (str) => str
- .replace(/\n$/, '')
- .split('\n')
- .reduce(parseKVLine, Object.create(null));
-const parseKVLine = (set, line) => {
- const n = parseInt(line, 10);
- // XXX Values with \n in them will fail this.
- // Refactor to not be a naive line-by-line parse.
- if (n !== Buffer.byteLength(line) + 1) {
- return set;
- }
- line = line.slice((n + ' ').length);
- const kv = line.split('=');
- const r = kv.shift();
- if (!r) {
- return set;
- }
- const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, '$1');
- const v = kv.join('=').replace(/\0.*/, '');
- switch (k) {
- case 'path':
- case 'linkpath':
- case 'type':
- case 'charset':
- case 'comment':
- case 'gname':
- case 'uname':
- set[k] = v;
- break;
- case 'ctime':
- case 'atime':
- case 'mtime':
- set[k] = new Date(Number(v) * 1000);
- break;
- case 'size':
- const s = +v;
- if (s >= 0)
- set[k] = s;
- break;
- case 'gid':
- case 'uid':
- case 'dev':
- case 'ino':
- case 'nlink':
- case 'mode':
- set[k] = +v;
- break;
- }
- return set;
-};
-//# sourceMappingURL=pax.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/process-umask.d.ts b/node_modules/tar/dist/commonjs/process-umask.d.ts
deleted file mode 100644
index abde1b6..0000000
--- a/node_modules/tar/dist/commonjs/process-umask.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const umask: () => number;
-//# sourceMappingURL=process-umask.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/process-umask.js b/node_modules/tar/dist/commonjs/process-umask.js
deleted file mode 100644
index 9256bcc..0000000
--- a/node_modules/tar/dist/commonjs/process-umask.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.umask = void 0;
-// separate file so I stop getting nagged in vim about deprecated API.
-const umask = () => process.umask();
-exports.umask = umask;
-//# sourceMappingURL=process-umask.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/read-entry.d.ts b/node_modules/tar/dist/commonjs/read-entry.d.ts
deleted file mode 100644
index 6376739..0000000
--- a/node_modules/tar/dist/commonjs/read-entry.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Minipass } from 'minipass';
-import type { Header } from './header.js';
-import type { Pax } from './pax.js';
-import type { EntryTypeName } from './types.js';
-export declare class ReadEntry extends Minipass<Buffer, Buffer> {
- #private;
- extended?: Pax;
- globalExtended?: Pax;
- header: Header;
- startBlockSize: number;
- blockRemain: number;
- remain: number;
- type: EntryTypeName;
- meta: boolean;
- ignore: boolean;
- path: string;
- mode?: number;
- uid?: number;
- gid?: number;
- uname?: string;
- gname?: string;
- size: number;
- mtime?: Date;
- atime?: Date;
- ctime?: Date;
- linkpath?: string;
- dev?: number;
- ino?: number;
- nlink?: number;
- invalid: boolean;
- absolute?: string;
- unsupported: boolean;
- constructor(header: Header, ex?: Pax, gex?: Pax);
- write(data: Buffer): boolean;
-}
-//# sourceMappingURL=read-entry.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/read-entry.js b/node_modules/tar/dist/commonjs/read-entry.js
deleted file mode 100644
index 655d7db..0000000
--- a/node_modules/tar/dist/commonjs/read-entry.js
+++ /dev/null
@@ -1,136 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.ReadEntry = void 0;
-const minipass_1 = require("minipass");
-const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
-class ReadEntry extends minipass_1.Minipass {
- extended;
- globalExtended;
- header;
- startBlockSize;
- blockRemain;
- remain;
- type;
- meta = false;
- ignore = false;
- path;
- mode;
- uid;
- gid;
- uname;
- gname;
- size = 0;
- mtime;
- atime;
- ctime;
- linkpath;
- dev;
- ino;
- nlink;
- invalid = false;
- absolute;
- unsupported = false;
- constructor(header, ex, gex) {
- super({});
- // read entries always start life paused. this is to avoid the
- // situation where Minipass's auto-ending empty streams results
- // in an entry ending before we're ready for it.
- this.pause();
- this.extended = ex;
- this.globalExtended = gex;
- this.header = header;
- /* c8 ignore start */
- this.remain = header.size ?? 0;
- /* c8 ignore stop */
- this.startBlockSize = 512 * Math.ceil(this.remain / 512);
- this.blockRemain = this.startBlockSize;
- this.type = header.type;
- switch (this.type) {
- case 'File':
- case 'OldFile':
- case 'Link':
- case 'SymbolicLink':
- case 'CharacterDevice':
- case 'BlockDevice':
- case 'Directory':
- case 'FIFO':
- case 'ContiguousFile':
- case 'GNUDumpDir':
- break;
- case 'NextFileHasLongLinkpath':
- case 'NextFileHasLongPath':
- case 'OldGnuLongPath':
- case 'GlobalExtendedHeader':
- case 'ExtendedHeader':
- case 'OldExtendedHeader':
- this.meta = true;
- break;
- // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
- // it may be worth doing the same, but with a warning.
- default:
- this.ignore = true;
- }
- /* c8 ignore start */
- if (!header.path) {
- throw new Error('no path provided for tar.ReadEntry');
- }
- /* c8 ignore stop */
- this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.path);
- this.mode = header.mode;
- if (this.mode) {
- this.mode = this.mode & 0o7777;
- }
- this.uid = header.uid;
- this.gid = header.gid;
- this.uname = header.uname;
- this.gname = header.gname;
- this.size = this.remain;
- this.mtime = header.mtime;
- this.atime = header.atime;
- this.ctime = header.ctime;
- /* c8 ignore start */
- this.linkpath =
- header.linkpath ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.linkpath) : undefined;
- /* c8 ignore stop */
- this.uname = header.uname;
- this.gname = header.gname;
- if (ex) {
- this.#slurp(ex);
- }
- if (gex) {
- this.#slurp(gex, true);
- }
- }
- write(data) {
- const writeLen = data.length;
- if (writeLen > this.blockRemain) {
- throw new Error('writing more to entry than is appropriate');
- }
- const r = this.remain;
- const br = this.blockRemain;
- this.remain = Math.max(0, r - writeLen);
- this.blockRemain = Math.max(0, br - writeLen);
- if (this.ignore) {
- return true;
- }
- if (r >= writeLen) {
- return super.write(data);
- }
- // r < writeLen
- return super.write(data.subarray(0, r));
- }
- #slurp(ex, gex = false) {
- if (ex.path)
- ex.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.path);
- if (ex.linkpath)
- ex.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.linkpath);
- Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
- // we slurp in everything except for the path attribute in
- // a global extended header, because that's weird. Also, any
- // null/undefined values are ignored.
- return !(v === null || v === undefined || (k === 'path' && gex));
- })));
- }
-}
-exports.ReadEntry = ReadEntry;
-//# sourceMappingURL=read-entry.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/replace.d.ts b/node_modules/tar/dist/commonjs/replace.d.ts
deleted file mode 100644
index 8ae4035..0000000
--- a/node_modules/tar/dist/commonjs/replace.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const replace: import("./make-command.js").TarCommand<never, never>;
-//# sourceMappingURL=replace.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/replace.js b/node_modules/tar/dist/commonjs/replace.js
deleted file mode 100644
index 576a839..0000000
--- a/node_modules/tar/dist/commonjs/replace.js
+++ /dev/null
@@ -1,227 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.replace = void 0;
-// tar -r
-const fs_minipass_1 = require("@isaacs/fs-minipass");
-const node_fs_1 = __importDefault(require("node:fs"));
-const node_path_1 = __importDefault(require("node:path"));
-const header_js_1 = require("./header.js");
-const list_js_1 = require("./list.js");
-const make_command_js_1 = require("./make-command.js");
-const options_js_1 = require("./options.js");
-const pack_js_1 = require("./pack.js");
-// starting at the head of the file, read a Header
-// If the checksum is invalid, that's our position to start writing
-// If it is, jump forward by the specified size (round up to 512)
-// and try again.
-// Write the new Pack stream starting there.
-const replaceSync = (opt, files) => {
- const p = new pack_js_1.PackSync(opt);
- let threw = true;
- let fd;
- let position;
- try {
- try {
- fd = node_fs_1.default.openSync(opt.file, 'r+');
- }
- catch (er) {
- if (er?.code === 'ENOENT') {
- fd = node_fs_1.default.openSync(opt.file, 'w+');
- }
- else {
- throw er;
- }
- }
- const st = node_fs_1.default.fstatSync(fd);
- const headBuf = Buffer.alloc(512);
- POSITION: for (position = 0; position < st.size; position += 512) {
- for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
- bytes = node_fs_1.default.readSync(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos);
- if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {
- throw new Error('cannot append to compressed archives');
- }
- if (!bytes) {
- break POSITION;
- }
- }
- const h = new header_js_1.Header(headBuf);
- if (!h.cksumValid) {
- break;
- }
- const entryBlockSize = 512 * Math.ceil((h.size || 0) / 512);
- if (position + entryBlockSize + 512 > st.size) {
- break;
- }
- // the 512 for the header we just parsed will be added as well
- // also jump ahead all the blocks for the body
- position += entryBlockSize;
- if (opt.mtimeCache && h.mtime) {
- opt.mtimeCache.set(String(h.path), h.mtime);
- }
- }
- threw = false;
- streamSync(opt, p, position, fd, files);
- }
- finally {
- if (threw) {
- try {
- node_fs_1.default.closeSync(fd);
- }
- catch { }
- }
- }
-};
-const streamSync = (opt, p, position, fd, files) => {
- const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
- fd: fd,
- start: position,
- });
- p.pipe(stream);
- addFilesSync(p, files);
-};
-const replaceAsync = (opt, files) => {
- files = Array.from(files);
- const p = new pack_js_1.Pack(opt);
- const getPos = (fd, size, cb_) => {
- const cb = (er, pos) => {
- if (er) {
- node_fs_1.default.close(fd, _ => cb_(er));
- }
- else {
- cb_(null, pos);
- }
- };
- let position = 0;
- if (size === 0) {
- return cb(null, 0);
- }
- let bufPos = 0;
- const headBuf = Buffer.alloc(512);
- const onread = (er, bytes) => {
- if (er || bytes === undefined) {
- return cb(er);
- }
- bufPos += bytes;
- if (bufPos < 512 && bytes) {
- return node_fs_1.default.read(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread);
- }
- if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {
- return cb(new Error('cannot append to compressed archives'));
- }
- // truncated header
- if (bufPos < 512) {
- return cb(null, position);
- }
- const h = new header_js_1.Header(headBuf);
- if (!h.cksumValid) {
- return cb(null, position);
- }
- /* c8 ignore next */
- const entryBlockSize = 512 * Math.ceil((h.size ?? 0) / 512);
- if (position + entryBlockSize + 512 > size) {
- return cb(null, position);
- }
- position += entryBlockSize + 512;
- if (position >= size) {
- return cb(null, position);
- }
- if (opt.mtimeCache && h.mtime) {
- opt.mtimeCache.set(String(h.path), h.mtime);
- }
- bufPos = 0;
- node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
- };
- node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
- };
- const promise = new Promise((resolve, reject) => {
- p.on('error', reject);
- let flag = 'r+';
- const onopen = (er, fd) => {
- if (er && er.code === 'ENOENT' && flag === 'r+') {
- flag = 'w+';
- return node_fs_1.default.open(opt.file, flag, onopen);
- }
- if (er || !fd) {
- return reject(er);
- }
- node_fs_1.default.fstat(fd, (er, st) => {
- if (er) {
- return node_fs_1.default.close(fd, () => reject(er));
- }
- getPos(fd, st.size, (er, position) => {
- if (er) {
- return reject(er);
- }
- const stream = new fs_minipass_1.WriteStream(opt.file, {
- fd: fd,
- start: position,
- });
- p.pipe(stream);
- stream.on('error', reject);
- stream.on('close', resolve);
- addFilesAsync(p, files);
- });
- });
- };
- node_fs_1.default.open(opt.file, flag, onopen);
- });
- return promise;
-};
-const addFilesSync = (p, files) => {
- files.forEach(file => {
- if (file.charAt(0) === '@') {
- (0, list_js_1.list)({
- file: node_path_1.default.resolve(p.cwd, file.slice(1)),
- sync: true,
- noResume: true,
- onReadEntry: entry => p.add(entry),
- });
- }
- else {
- p.add(file);
- }
- });
- p.end();
-};
-const addFilesAsync = async (p, files) => {
- for (const file of files) {
- if (file.charAt(0) === '@') {
- await (0, list_js_1.list)({
- file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
- noResume: true,
- onReadEntry: entry => p.add(entry),
- });
- }
- else {
- p.add(file);
- }
- }
- p.end();
-};
-exports.replace = (0, make_command_js_1.makeCommand)(replaceSync, replaceAsync,
-/* c8 ignore start */
-() => {
- throw new TypeError('file is required');
-}, () => {
- throw new TypeError('file is required');
-},
-/* c8 ignore stop */
-(opt, entries) => {
- if (!(0, options_js_1.isFile)(opt)) {
- throw new TypeError('file is required');
- }
- if (opt.gzip ||
- opt.brotli ||
- opt.zstd ||
- opt.file.endsWith('.br') ||
- opt.file.endsWith('.tbr')) {
- throw new TypeError('cannot append to compressed archives');
- }
- if (!entries?.length) {
- throw new TypeError('no paths specified to add/replace');
- }
-});
-//# sourceMappingURL=replace.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts b/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts
deleted file mode 100644
index f355a58..0000000
--- a/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const stripAbsolutePath: (path: string) => [string, string];
-//# sourceMappingURL=strip-absolute-path.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/strip-absolute-path.js b/node_modules/tar/dist/commonjs/strip-absolute-path.js
deleted file mode 100644
index bb7639c..0000000
--- a/node_modules/tar/dist/commonjs/strip-absolute-path.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.stripAbsolutePath = void 0;
-// unix absolute paths are also absolute on win32, so we use this for both
-const node_path_1 = require("node:path");
-const { isAbsolute, parse } = node_path_1.win32;
-// returns [root, stripped]
-// Note that windows will think that //x/y/z/a has a "root" of //x/y, and in
-// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip /
-// explicitly if it's the first character.
-// drive-specific relative paths on Windows get their root stripped off even
-// though they are not absolute, so `c:../foo` becomes ['c:', '../foo']
-const stripAbsolutePath = (path) => {
- let r = '';
- let parsed = parse(path);
- while (isAbsolute(path) || parsed.root) {
- // windows will think that //x/y/z has a "root" of //x/y/
- // but strip the //?/C:/ off of //?/C:/path
- const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ?
- '/'
- : parsed.root;
- path = path.slice(root.length);
- r += root;
- parsed = parse(path);
- }
- return [r, path];
-};
-exports.stripAbsolutePath = stripAbsolutePath;
-//# sourceMappingURL=strip-absolute-path.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts b/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts
deleted file mode 100644
index dcc4637..0000000
--- a/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const stripTrailingSlashes: (str: string) => string;
-//# sourceMappingURL=strip-trailing-slashes.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/strip-trailing-slashes.js b/node_modules/tar/dist/commonjs/strip-trailing-slashes.js
deleted file mode 100644
index 6fa74ad..0000000
--- a/node_modules/tar/dist/commonjs/strip-trailing-slashes.js
+++ /dev/null
@@ -1,18 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.stripTrailingSlashes = void 0;
-// warning: extremely hot code path.
-// This has been meticulously optimized for use
-// within npm install on large package trees.
-// Do not edit without careful benchmarking.
-const stripTrailingSlashes = (str) => {
- let i = str.length - 1;
- let slashesStart = -1;
- while (i > -1 && str.charAt(i) === '/') {
- slashesStart = i;
- i--;
- }
- return slashesStart === -1 ? str : str.slice(0, slashesStart);
-};
-exports.stripTrailingSlashes = stripTrailingSlashes;
-//# sourceMappingURL=strip-trailing-slashes.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/symlink-error.d.ts b/node_modules/tar/dist/commonjs/symlink-error.d.ts
deleted file mode 100644
index 849b43d..0000000
--- a/node_modules/tar/dist/commonjs/symlink-error.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export declare class SymlinkError extends Error {
- path: string;
- symlink: string;
- syscall: "symlink";
- code: "TAR_SYMLINK_ERROR";
- constructor(symlink: string, path: string);
- get name(): string;
-}
-//# sourceMappingURL=symlink-error.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/symlink-error.js b/node_modules/tar/dist/commonjs/symlink-error.js
deleted file mode 100644
index cc19ac1..0000000
--- a/node_modules/tar/dist/commonjs/symlink-error.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.SymlinkError = void 0;
-class SymlinkError extends Error {
- path;
- symlink;
- syscall = 'symlink';
- code = 'TAR_SYMLINK_ERROR';
- constructor(symlink, path) {
- super('TAR_SYMLINK_ERROR: Cannot extract through symbolic link');
- this.symlink = symlink;
- this.path = path;
- }
- get name() {
- return 'SymlinkError';
- }
-}
-exports.SymlinkError = SymlinkError;
-//# sourceMappingURL=symlink-error.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/types.d.ts b/node_modules/tar/dist/commonjs/types.d.ts
deleted file mode 100644
index 578669a..0000000
--- a/node_modules/tar/dist/commonjs/types.d.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export declare const isCode: (c: string) => c is EntryTypeCode;
-export declare const isName: (c: string) => c is EntryTypeName;
-export type EntryTypeCode = '0' | '' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | 'g' | 'x' | 'A' | 'D' | 'I' | 'K' | 'L' | 'M' | 'N' | 'S' | 'V' | 'X';
-export type EntryTypeName = 'File' | 'OldFile' | 'Link' | 'SymbolicLink' | 'CharacterDevice' | 'BlockDevice' | 'Directory' | 'FIFO' | 'ContiguousFile' | 'GlobalExtendedHeader' | 'ExtendedHeader' | 'SolarisACL' | 'GNUDumpDir' | 'Inode' | 'NextFileHasLongLinkpath' | 'NextFileHasLongPath' | 'ContinuationFile' | 'OldGnuLongPath' | 'SparseFile' | 'TapeVolumeHeader' | 'OldExtendedHeader' | 'Unsupported';
-/**
- * types that are a normal file system entry, not metadata.
- *
- * These can be the subject of extended/globalExtended headers, long path
- * names, long linkpath names, etc.
- *
- * Any other types are meta, and cannot be targetted by extended PAX headers.
- */
-export declare const normalFsTypes: Set<EntryTypeCode>;
-export declare const name: Map<EntryTypeCode, EntryTypeName>;
-export declare const code: Map<EntryTypeName, EntryTypeCode>;
-//# sourceMappingURL=types.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/types.js b/node_modules/tar/dist/commonjs/types.js
deleted file mode 100644
index 7cbcc17..0000000
--- a/node_modules/tar/dist/commonjs/types.js
+++ /dev/null
@@ -1,70 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.code = exports.name = exports.normalFsTypes = exports.isName = exports.isCode = void 0;
-const isCode = (c) => exports.name.has(c);
-exports.isCode = isCode;
-const isName = (c) => exports.code.has(c);
-exports.isName = isName;
-/**
- * types that are a normal file system entry, not metadata.
- *
- * These can be the subject of extended/globalExtended headers, long path
- * names, long linkpath names, etc.
- *
- * Any other types are meta, and cannot be targetted by extended PAX headers.
- */
-exports.normalFsTypes = new Set([
- '0',
- '',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- 'D',
-]);
-// map types from key to human-friendly name
-exports.name = new Map([
- ['0', 'File'],
- // same as File
- ['', 'OldFile'],
- ['1', 'Link'],
- ['2', 'SymbolicLink'],
- // Devices and FIFOs aren't fully supported
- // they are parsed, but skipped when unpacking
- ['3', 'CharacterDevice'],
- ['4', 'BlockDevice'],
- ['5', 'Directory'],
- ['6', 'FIFO'],
- // same as File
- ['7', 'ContiguousFile'],
- // pax headers
- ['g', 'GlobalExtendedHeader'],
- ['x', 'ExtendedHeader'],
- // vendor-specific stuff
- // skip
- ['A', 'SolarisACL'],
- // like 5, but with data, which should be skipped
- ['D', 'GNUDumpDir'],
- // metadata only, skip
- ['I', 'Inode'],
- // data = link path of next file
- ['K', 'NextFileHasLongLinkpath'],
- // data = path of next file
- ['L', 'NextFileHasLongPath'],
- // skip
- ['M', 'ContinuationFile'],
- // like L
- ['N', 'OldGnuLongPath'],
- // skip
- ['S', 'SparseFile'],
- // skip
- ['V', 'TapeVolumeHeader'],
- // like x
- ['X', 'OldExtendedHeader'],
-]);
-// map the other direction
-exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]));
-//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/unpack.d.ts b/node_modules/tar/dist/commonjs/unpack.d.ts
deleted file mode 100644
index bdb9cc2..0000000
--- a/node_modules/tar/dist/commonjs/unpack.d.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-import { type Stats } from 'node:fs';
-import type { MkdirError } from './mkdir.js';
-import { Parser } from './parse.js';
-import type { TarOptions } from './options.js';
-import { PathReservations } from './path-reservations.js';
-import type { ReadEntry } from './read-entry.js';
-import type { WarnData } from './warn-method.js';
-import { SymlinkError } from './symlink-error.js';
-declare const ONENTRY: unique symbol;
-declare const CHECKFS: unique symbol;
-declare const CHECKFS2: unique symbol;
-declare const ISREUSABLE: unique symbol;
-declare const MAKEFS: unique symbol;
-declare const FILE: unique symbol;
-declare const DIRECTORY: unique symbol;
-declare const LINK: unique symbol;
-declare const SYMLINK: unique symbol;
-declare const HARDLINK: unique symbol;
-declare const ENSURE_NO_SYMLINK: unique symbol;
-declare const UNSUPPORTED: unique symbol;
-declare const CHECKPATH: unique symbol;
-declare const STRIPABSOLUTEPATH: unique symbol;
-declare const MKDIR: unique symbol;
-declare const ONERROR: unique symbol;
-declare const PENDING: unique symbol;
-declare const PEND: unique symbol;
-declare const UNPEND: unique symbol;
-declare const ENDED: unique symbol;
-declare const MAYBECLOSE: unique symbol;
-declare const SKIP: unique symbol;
-declare const DOCHOWN: unique symbol;
-declare const UID: unique symbol;
-declare const GID: unique symbol;
-declare const CHECKED_CWD: unique symbol;
-export declare class Unpack extends Parser {
- [ENDED]: boolean;
- [CHECKED_CWD]: boolean;
- [PENDING]: number;
- reservations: PathReservations;
- transform?: TarOptions['transform'];
- writable: true;
- readable: false;
- uid?: number;
- gid?: number;
- setOwner: boolean;
- preserveOwner: boolean;
- processGid?: number;
- processUid?: number;
- maxDepth: number;
- forceChown: boolean;
- win32: boolean;
- newer: boolean;
- keep: boolean;
- noMtime: boolean;
- preservePaths: boolean;
- unlink: boolean;
- cwd: string;
- strip: number;
- processUmask: number;
- umask: number;
- dmode: number;
- fmode: number;
- chmod: boolean;
- constructor(opt?: TarOptions);
- warn(code: string, msg: string | Error, data?: WarnData): void;
- [MAYBECLOSE](): void;
- [STRIPABSOLUTEPATH](entry: ReadEntry, field: 'path' | 'linkpath'): boolean;
- [CHECKPATH](entry: ReadEntry): boolean;
- [ONENTRY](entry: ReadEntry): void;
- [ONERROR](er: Error, entry: ReadEntry): void;
- [MKDIR](dir: string, mode: number, cb: (er?: null | MkdirError, made?: string) => void): void;
- [DOCHOWN](entry: ReadEntry): boolean;
- [UID](entry: ReadEntry): number | undefined;
- [GID](entry: ReadEntry): number | undefined;
- [FILE](entry: ReadEntry, fullyDone: () => void): void;
- [DIRECTORY](entry: ReadEntry, fullyDone: () => void): void;
- [UNSUPPORTED](entry: ReadEntry): void;
- [SYMLINK](entry: ReadEntry, done: () => void): void;
- [HARDLINK](entry: ReadEntry, done: () => void): void;
- [ENSURE_NO_SYMLINK](entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void;
- [PEND](): void;
- [UNPEND](): void;
- [SKIP](entry: ReadEntry): void;
- [ISREUSABLE](entry: ReadEntry, st: Stats): boolean;
- [CHECKFS](entry: ReadEntry): void;
- [CHECKFS2](entry: ReadEntry, fullyDone: (er?: Error) => void): void;
- [MAKEFS](er: null | undefined | Error, entry: ReadEntry, done: () => void): void;
- [LINK](entry: ReadEntry, linkpath: string, link: 'link' | 'symlink', done: () => void): void;
-}
-export declare class UnpackSync extends Unpack {
- sync: true;
- [MAKEFS](er: null | Error | undefined, entry: ReadEntry): void;
- [CHECKFS](entry: ReadEntry): void;
- [FILE](entry: ReadEntry, done: () => void): void;
- [DIRECTORY](entry: ReadEntry, done: () => void): void;
- [MKDIR](dir: string, mode: number): unknown;
- [ENSURE_NO_SYMLINK](_entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void;
- [LINK](entry: ReadEntry, linkpath: string, link: 'link' | 'symlink', done: () => void): void;
-}
-export {};
-//# sourceMappingURL=unpack.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/unpack.js b/node_modules/tar/dist/commonjs/unpack.js
deleted file mode 100644
index 0e9f861..0000000
--- a/node_modules/tar/dist/commonjs/unpack.js
+++ /dev/null
@@ -1,932 +0,0 @@
-"use strict";
-// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.
-// but the path reservations are required to avoid race conditions where
-// parallelized unpack ops may mess with one another, due to dependencies
-// (like a Link depending on its target) or destructive operations (like
-// clobbering an fs object to create one of a different type.)
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.UnpackSync = exports.Unpack = void 0;
-const fsm = __importStar(require("@isaacs/fs-minipass"));
-const node_assert_1 = __importDefault(require("node:assert"));
-const node_crypto_1 = require("node:crypto");
-const node_fs_1 = __importDefault(require("node:fs"));
-const node_path_1 = __importDefault(require("node:path"));
-const get_write_flag_js_1 = require("./get-write-flag.js");
-const mkdir_js_1 = require("./mkdir.js");
-const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
-const parse_js_1 = require("./parse.js");
-const strip_absolute_path_js_1 = require("./strip-absolute-path.js");
-const wc = __importStar(require("./winchars.js"));
-const path_reservations_js_1 = require("./path-reservations.js");
-const symlink_error_js_1 = require("./symlink-error.js");
-const process_umask_js_1 = require("./process-umask.js");
-const ONENTRY = Symbol('onEntry');
-const CHECKFS = Symbol('checkFs');
-const CHECKFS2 = Symbol('checkFs2');
-const ISREUSABLE = Symbol('isReusable');
-const MAKEFS = Symbol('makeFs');
-const FILE = Symbol('file');
-const DIRECTORY = Symbol('directory');
-const LINK = Symbol('link');
-const SYMLINK = Symbol('symlink');
-const HARDLINK = Symbol('hardlink');
-const ENSURE_NO_SYMLINK = Symbol('ensureNoSymlink');
-const UNSUPPORTED = Symbol('unsupported');
-const CHECKPATH = Symbol('checkPath');
-const STRIPABSOLUTEPATH = Symbol('stripAbsolutePath');
-const MKDIR = Symbol('mkdir');
-const ONERROR = Symbol('onError');
-const PENDING = Symbol('pending');
-const PEND = Symbol('pend');
-const UNPEND = Symbol('unpend');
-const ENDED = Symbol('ended');
-const MAYBECLOSE = Symbol('maybeClose');
-const SKIP = Symbol('skip');
-const DOCHOWN = Symbol('doChown');
-const UID = Symbol('uid');
-const GID = Symbol('gid');
-const CHECKED_CWD = Symbol('checkedCwd');
-const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
-const isWindows = platform === 'win32';
-const DEFAULT_MAX_DEPTH = 1024;
-// Unlinks on Windows are not atomic.
-//
-// This means that if you have a file entry, followed by another
-// file entry with an identical name, and you cannot re-use the file
-// (because it's a hardlink, or because unlink:true is set, or it's
-// Windows, which does not have useful nlink values), then the unlink
-// will be committed to the disk AFTER the new file has been written
-// over the old one, deleting the new file.
-//
-// To work around this, on Windows systems, we rename the file and then
-// delete the renamed file. It's a sloppy kludge, but frankly, I do not
-// know of a better way to do this, given windows' non-atomic unlink
-// semantics.
-//
-// See: https://github.com/npm/node-tar/issues/183
-/* c8 ignore start */
-const unlinkFile = (path, cb) => {
- if (!isWindows) {
- return node_fs_1.default.unlink(path, cb);
- }
- const name = path + '.DELETE.' + (0, node_crypto_1.randomBytes)(16).toString('hex');
- node_fs_1.default.rename(path, name, er => {
- if (er) {
- return cb(er);
- }
- node_fs_1.default.unlink(name, cb);
- });
-};
-/* c8 ignore stop */
-/* c8 ignore start */
-const unlinkFileSync = (path) => {
- if (!isWindows) {
- return node_fs_1.default.unlinkSync(path);
- }
- const name = path + '.DELETE.' + (0, node_crypto_1.randomBytes)(16).toString('hex');
- node_fs_1.default.renameSync(path, name);
- node_fs_1.default.unlinkSync(name);
-};
-/* c8 ignore stop */
-// this.gid, entry.gid, this.processUid
-const uint32 = (a, b, c) => a !== undefined && a === a >>> 0 ? a
- : b !== undefined && b === b >>> 0 ? b
- : c;
-class Unpack extends parse_js_1.Parser {
- [ENDED] = false;
- [CHECKED_CWD] = false;
- [PENDING] = 0;
- reservations = new path_reservations_js_1.PathReservations();
- transform;
- writable = true;
- readable = false;
- uid;
- gid;
- setOwner;
- preserveOwner;
- processGid;
- processUid;
- maxDepth;
- forceChown;
- win32;
- newer;
- keep;
- noMtime;
- preservePaths;
- unlink;
- cwd;
- strip;
- processUmask;
- umask;
- dmode;
- fmode;
- chmod;
- constructor(opt = {}) {
- opt.ondone = () => {
- this[ENDED] = true;
- this[MAYBECLOSE]();
- };
- super(opt);
- this.transform = opt.transform;
- this.chmod = !!opt.chmod;
- if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {
- // need both or neither
- if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') {
- throw new TypeError('cannot set owner without number uid and gid');
- }
- if (opt.preserveOwner) {
- throw new TypeError('cannot preserve owner in archive and also set owner explicitly');
- }
- this.uid = opt.uid;
- this.gid = opt.gid;
- this.setOwner = true;
- }
- else {
- this.uid = undefined;
- this.gid = undefined;
- this.setOwner = false;
- }
- // default true for root
- this.preserveOwner =
- opt.preserveOwner === undefined && typeof opt.uid !== 'number' ?
- !!(process.getuid?.() === 0)
- : !!opt.preserveOwner;
- this.processUid =
- (this.preserveOwner || this.setOwner) && process.getuid ?
- process.getuid()
- : undefined;
- this.processGid =
- (this.preserveOwner || this.setOwner) && process.getgid ?
- process.getgid()
- : undefined;
- // prevent excessively deep nesting of subfolders
- // set to `Infinity` to remove this restriction
- this.maxDepth =
- typeof opt.maxDepth === 'number' ? opt.maxDepth : DEFAULT_MAX_DEPTH;
- // mostly just for testing, but useful in some cases.
- // Forcibly trigger a chown on every entry, no matter what
- this.forceChown = opt.forceChown === true;
- // turn ><?| in filenames into 0xf000-higher encoded forms
- this.win32 = !!opt.win32 || isWindows;
- // do not unpack over files that are newer than what's in the archive
- this.newer = !!opt.newer;
- // do not unpack over ANY files
- this.keep = !!opt.keep;
- // do not set mtime/atime of extracted entries
- this.noMtime = !!opt.noMtime;
- // allow .., absolute path entries, and unpacking through symlinks
- // without this, warn and skip .., relativize absolutes, and error
- // on symlinks in extraction path
- this.preservePaths = !!opt.preservePaths;
- // unlink files and links before writing. This breaks existing hard
- // links, and removes symlink directories rather than erroring
- this.unlink = !!opt.unlink;
- this.cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(opt.cwd || process.cwd()));
- this.strip = Number(opt.strip) || 0;
- // if we're not chmodding, then we don't need the process umask
- this.processUmask =
- !this.chmod ? 0
- : typeof opt.processUmask === 'number' ? opt.processUmask
- : (0, process_umask_js_1.umask)();
- this.umask =
- typeof opt.umask === 'number' ? opt.umask : this.processUmask;
- // default mode for dirs created as parents
- this.dmode = opt.dmode || 0o0777 & ~this.umask;
- this.fmode = opt.fmode || 0o0666 & ~this.umask;
- this.on('entry', entry => this[ONENTRY](entry));
- }
- // a bad or damaged archive is a warning for Parser, but an error
- // when extracting. Mark those errors as unrecoverable, because
- // the Unpack contract cannot be met.
- warn(code, msg, data = {}) {
- if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {
- data.recoverable = false;
- }
- return super.warn(code, msg, data);
- }
- [MAYBECLOSE]() {
- if (this[ENDED] && this[PENDING] === 0) {
- this.emit('prefinish');
- this.emit('finish');
- this.emit('end');
- }
- }
- // return false if we need to skip this file
- // return true if the field was successfully sanitized
- [STRIPABSOLUTEPATH](entry, field) {
- const p = entry[field];
- const { type } = entry;
- if (!p || this.preservePaths)
- return true;
- // strip off the root
- const [root, stripped] = (0, strip_absolute_path_js_1.stripAbsolutePath)(p);
- const parts = stripped.replaceAll(/\\/g, '/').split('/');
- if (parts.includes('..') ||
- /* c8 ignore next */
- (isWindows && /^[a-z]:\.\.$/i.test(parts[0] ?? ''))) {
- // For linkpath, check if the resolved path escapes cwd rather than
- // just rejecting any path with '..' - relative symlinks like
- // '../sibling/file' are valid if they resolve within the cwd.
- // For paths, they just simply may not ever use .. at all.
- if (field === 'path' || type === 'Link') {
- this.warn('TAR_ENTRY_ERROR', `${field} contains '..'`, {
- entry,
- [field]: p,
- });
- // not ok!
- return false;
- }
- // Resolve linkpath relative to the entry's directory.
- // `path.posix` is safe to use because we're operating on
- // tar paths, not a filesystem.
- const entryDir = node_path_1.default.posix.dirname(entry.path);
- const resolved = node_path_1.default.posix.normalize(node_path_1.default.posix.join(entryDir, parts.join('/')));
- // If the resolved path escapes (starts with ..), reject it
- if (resolved.startsWith('../') || resolved === '..') {
- this.warn('TAR_ENTRY_ERROR', `${field} escapes extraction directory`, {
- entry,
- [field]: p,
- });
- return false;
- }
- }
- if (root) {
- // ok, but triggers warning about stripping root
- entry[field] = String(stripped);
- this.warn('TAR_ENTRY_INFO', `stripping ${root} from absolute ${field}`, {
- entry,
- [field]: p,
- });
- }
- return true;
- }
- // no IO, just string checking for absolute indicators
- [CHECKPATH](entry) {
- const p = (0, normalize_windows_path_js_1.normalizeWindowsPath)(entry.path);
- const parts = p.split('/');
- if (this.strip) {
- if (parts.length < this.strip) {
- return false;
- }
- if (entry.type === 'Link') {
- const linkparts = (0, normalize_windows_path_js_1.normalizeWindowsPath)(String(entry.linkpath)).split('/');
- if (linkparts.length >= this.strip) {
- entry.linkpath = linkparts.slice(this.strip).join('/');
- }
- else {
- return false;
- }
- }
- parts.splice(0, this.strip);
- entry.path = parts.join('/');
- }
- if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {
- this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {
- entry,
- path: p,
- depth: parts.length,
- maxDepth: this.maxDepth,
- });
- return false;
- }
- if (!this[STRIPABSOLUTEPATH](entry, 'path') ||
- !this[STRIPABSOLUTEPATH](entry, 'linkpath')) {
- return false;
- }
- entry.absolute =
- node_path_1.default.isAbsolute(entry.path) ?
- (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(entry.path))
- : (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(this.cwd, entry.path));
- // if we somehow ended up with a path that escapes the cwd, and we are
- // not in preservePaths mode, then something is fishy! This should have
- // been prevented above, so ignore this for coverage.
- /* c8 ignore start - defense in depth */
- if (!this.preservePaths &&
- typeof entry.absolute === 'string' &&
- entry.absolute.indexOf(this.cwd + '/') !== 0 &&
- entry.absolute !== this.cwd) {
- this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {
- entry,
- path: (0, normalize_windows_path_js_1.normalizeWindowsPath)(entry.path),
- resolvedPath: entry.absolute,
- cwd: this.cwd,
- });
- return false;
- }
- /* c8 ignore stop */
- // an archive can set properties on the extraction directory, but it
- // may not replace the cwd with a different kind of thing entirely.
- if (entry.absolute === this.cwd &&
- entry.type !== 'Directory' &&
- entry.type !== 'GNUDumpDir') {
- return false;
- }
- // only encode : chars that aren't drive letter indicators
- if (this.win32) {
- const { root: aRoot } = node_path_1.default.win32.parse(String(entry.absolute));
- entry.absolute =
- aRoot + wc.encode(String(entry.absolute).slice(aRoot.length));
- const { root: pRoot } = node_path_1.default.win32.parse(entry.path);
- entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length));
- }
- return true;
- }
- [ONENTRY](entry) {
- if (!this[CHECKPATH](entry)) {
- return entry.resume();
- }
- node_assert_1.default.equal(typeof entry.absolute, 'string');
- switch (entry.type) {
- case 'Directory':
- case 'GNUDumpDir':
- if (entry.mode) {
- entry.mode = entry.mode | 0o700;
- }
- // eslint-disable-next-line no-fallthrough
- case 'File':
- case 'OldFile':
- case 'ContiguousFile':
- case 'Link':
- case 'SymbolicLink':
- return this[CHECKFS](entry);
- case 'CharacterDevice':
- case 'BlockDevice':
- case 'FIFO':
- default:
- return this[UNSUPPORTED](entry);
- }
- }
- [ONERROR](er, entry) {
- // Cwd has to exist, or else nothing works. That's serious.
- // Other errors are warnings, which raise the error in strict
- // mode, but otherwise continue on.
- if (er.name === 'CwdError') {
- this.emit('error', er);
- }
- else {
- this.warn('TAR_ENTRY_ERROR', er, { entry });
- this[UNPEND]();
- entry.resume();
- }
- }
- [MKDIR](dir, mode, cb) {
- void (0, mkdir_js_1.mkdir)((0, normalize_windows_path_js_1.normalizeWindowsPath)(dir), {
- 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: mode,
- }, cb);
- }
- [DOCHOWN](entry) {
- // in preserve owner mode, chown if the entry doesn't match process
- // in set owner mode, chown if setting doesn't match process
- return (this.forceChown ||
- (this.preserveOwner &&
- ((typeof entry.uid === 'number' &&
- entry.uid !== this.processUid) ||
- (typeof entry.gid === 'number' &&
- entry.gid !== this.processGid))) ||
- (typeof this.uid === 'number' && this.uid !== this.processUid) ||
- (typeof this.gid === 'number' && this.gid !== this.processGid));
- }
- [UID](entry) {
- return uint32(this.uid, entry.uid, this.processUid);
- }
- [GID](entry) {
- return uint32(this.gid, entry.gid, this.processGid);
- }
- [FILE](entry, fullyDone) {
- const mode = typeof entry.mode === 'number' ? entry.mode & 0o7777 : this.fmode;
- const stream = new fsm.WriteStream(String(entry.absolute), {
- // slight lie, but it can be numeric flags
- flags: (0, get_write_flag_js_1.getWriteFlag)(entry.size),
- mode: mode,
- autoClose: false,
- });
- stream.on('error', (er) => {
- if (stream.fd) {
- node_fs_1.default.close(stream.fd, () => { });
- }
- // flush all the data out so that we aren't left hanging
- // if the error wasn't actually fatal. otherwise the parse
- // is blocked, and we never proceed.
- stream.write = () => true;
- this[ONERROR](er, entry);
- fullyDone();
- });
- let actions = 1;
- const done = (er) => {
- if (er) {
- /* c8 ignore start - we should always have a fd by now */
- if (stream.fd) {
- node_fs_1.default.close(stream.fd, () => { });
- }
- /* c8 ignore stop */
- this[ONERROR](er, entry);
- fullyDone();
- return;
- }
- if (--actions === 0) {
- if (stream.fd !== undefined) {
- node_fs_1.default.close(stream.fd, er => {
- if (er) {
- this[ONERROR](er, entry);
- }
- else {
- this[UNPEND]();
- }
- fullyDone();
- });
- }
- }
- };
- stream.on('finish', () => {
- // if futimes fails, try utimes
- // if utimes fails, fail with the original error
- // same for fchown/chown
- const abs = String(entry.absolute);
- const fd = stream.fd;
- if (typeof fd === 'number' && entry.mtime && !this.noMtime) {
- actions++;
- const atime = entry.atime || new Date();
- const mtime = entry.mtime;
- node_fs_1.default.futimes(fd, atime, mtime, er => er ?
- node_fs_1.default.utimes(abs, atime, mtime, er2 => done(er2 && er))
- : done());
- }
- if (typeof fd === 'number' && this[DOCHOWN](entry)) {
- actions++;
- const uid = this[UID](entry);
- const gid = this[GID](entry);
- if (typeof uid === 'number' && typeof gid === 'number') {
- node_fs_1.default.fchown(fd, uid, gid, er => er ? node_fs_1.default.chown(abs, uid, gid, er2 => done(er2 && er)) : done());
- }
- }
- done();
- });
- const tx = this.transform ? this.transform(entry) || entry : entry;
- if (tx !== entry) {
- tx.on('error', er => {
- this[ONERROR](er, entry);
- fullyDone();
- });
- entry.pipe(tx);
- }
- tx.pipe(stream);
- }
- [DIRECTORY](entry, fullyDone) {
- const mode = typeof entry.mode === 'number' ? entry.mode & 0o7777 : this.dmode;
- this[MKDIR](String(entry.absolute), mode, er => {
- if (er) {
- this[ONERROR](er, entry);
- fullyDone();
- return;
- }
- let actions = 1;
- const done = () => {
- if (--actions === 0) {
- fullyDone();
- this[UNPEND]();
- entry.resume();
- }
- };
- if (entry.mtime && !this.noMtime) {
- actions++;
- node_fs_1.default.utimes(String(entry.absolute), entry.atime || new Date(), entry.mtime, done);
- }
- if (this[DOCHOWN](entry)) {
- actions++;
- node_fs_1.default.chown(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry)), done);
- }
- done();
- });
- }
- [UNSUPPORTED](entry) {
- entry.unsupported = true;
- this.warn('TAR_ENTRY_UNSUPPORTED', `unsupported entry type: ${entry.type}`, { entry });
- entry.resume();
- }
- [SYMLINK](entry, done) {
- const parts = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(this.cwd, node_path_1.default.resolve(node_path_1.default.dirname(String(entry.absolute)), String(entry.linkpath)))).split('/');
- this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, String(entry.linkpath), 'symlink', done), er => {
- this[ONERROR](er, entry);
- done();
- });
- }
- [HARDLINK](entry, done) {
- const linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(this.cwd, String(entry.linkpath)));
- const parts = (0, normalize_windows_path_js_1.normalizeWindowsPath)(String(entry.linkpath)).split('/');
- this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, linkpath, 'link', done), er => {
- this[ONERROR](er, entry);
- done();
- });
- }
- [ENSURE_NO_SYMLINK](entry, cwd, parts, done, onError) {
- const p = parts.shift();
- if (this.preservePaths || p === undefined)
- return done();
- const t = node_path_1.default.resolve(cwd, p);
- node_fs_1.default.lstat(t, (er, st) => {
- if (er)
- return done();
- if (st?.isSymbolicLink()) {
- return onError(new symlink_error_js_1.SymlinkError(t, node_path_1.default.resolve(t, parts.join('/'))));
- }
- this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError);
- });
- }
- [PEND]() {
- this[PENDING]++;
- }
- [UNPEND]() {
- this[PENDING]--;
- this[MAYBECLOSE]();
- }
- [SKIP](entry) {
- this[UNPEND]();
- entry.resume();
- }
- // Check if we can reuse an existing filesystem entry safely and
- // overwrite it, rather than unlinking and recreating
- // Windows doesn't report a useful nlink, so we just never reuse entries
- [ISREUSABLE](entry, st) {
- return (entry.type === 'File' &&
- !this.unlink &&
- st.isFile() &&
- st.nlink <= 1 &&
- !isWindows);
- }
- // check if a thing is there, and if so, try to clobber it
- [CHECKFS](entry) {
- this[PEND]();
- const paths = [entry.path];
- if (entry.linkpath) {
- paths.push(entry.linkpath);
- }
- this.reservations.reserve(paths, done => this[CHECKFS2](entry, done));
- }
- [CHECKFS2](entry, fullyDone) {
- const done = (er) => {
- fullyDone(er);
- };
- const checkCwd = () => {
- this[MKDIR](this.cwd, this.dmode, er => {
- if (er) {
- this[ONERROR](er, entry);
- done();
- return;
- }
- this[CHECKED_CWD] = true;
- start();
- });
- };
- const start = () => {
- if (entry.absolute !== this.cwd) {
- const parent = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.dirname(String(entry.absolute)));
- if (parent !== this.cwd) {
- return this[MKDIR](parent, this.dmode, er => {
- if (er) {
- this[ONERROR](er, entry);
- done();
- return;
- }
- afterMakeParent();
- });
- }
- }
- afterMakeParent();
- };
- const afterMakeParent = () => {
- node_fs_1.default.lstat(String(entry.absolute), (lstatEr, st) => {
- if (st &&
- (this.keep ||
- /* c8 ignore next */
- (this.newer && st.mtime > (entry.mtime ?? st.mtime)))) {
- this[SKIP](entry);
- done();
- return;
- }
- if (lstatEr || this[ISREUSABLE](entry, st)) {
- return this[MAKEFS](null, entry, done);
- }
- if (st.isDirectory()) {
- if (entry.type === 'Directory') {
- const needChmod = this.chmod && entry.mode && (st.mode & 0o7777) !== entry.mode;
- const afterChmod = (er) => this[MAKEFS](er ?? null, entry, done);
- if (!needChmod) {
- return afterChmod();
- }
- return node_fs_1.default.chmod(String(entry.absolute), Number(entry.mode), afterChmod);
- }
- // Not a dir entry, have to remove it.
- // NB: the only way to end up with an entry that is the cwd
- // itself, in such a way that == does not detect, is a
- // tricky windows absolute path with UNC or 8.3 parts (and
- // preservePaths:true, or else it will have been stripped).
- // In that case, the user has opted out of path protections
- // explicitly, so if they blow away the cwd, c'est la vie.
- if (entry.absolute !== this.cwd) {
- return node_fs_1.default.rmdir(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done));
- }
- }
- // not a dir, and not reusable
- // don't remove if the cwd, we want that error
- if (entry.absolute === this.cwd) {
- return this[MAKEFS](null, entry, done);
- }
- unlinkFile(String(entry.absolute), er => this[MAKEFS](er ?? null, entry, done));
- });
- };
- if (this[CHECKED_CWD]) {
- start();
- }
- else {
- checkCwd();
- }
- }
- [MAKEFS](er, entry, done) {
- if (er) {
- this[ONERROR](er, entry);
- done();
- return;
- }
- switch (entry.type) {
- case 'File':
- case 'OldFile':
- case 'ContiguousFile':
- return this[FILE](entry, done);
- case 'Link':
- return this[HARDLINK](entry, done);
- case 'SymbolicLink':
- return this[SYMLINK](entry, done);
- case 'Directory':
- case 'GNUDumpDir':
- return this[DIRECTORY](entry, done);
- }
- }
- [LINK](entry, linkpath, link, done) {
- node_fs_1.default[link](linkpath, String(entry.absolute), er => {
- if (er) {
- this[ONERROR](er, entry);
- }
- else {
- this[UNPEND]();
- entry.resume();
- }
- done();
- });
- }
-}
-exports.Unpack = Unpack;
-const callSync = (fn) => {
- try {
- return [null, fn()];
- }
- catch (er) {
- return [er, null];
- }
-};
-class UnpackSync extends Unpack {
- sync = true;
- [MAKEFS](er, entry) {
- return super[MAKEFS](er, entry, () => { });
- }
- [CHECKFS](entry) {
- if (!this[CHECKED_CWD]) {
- const er = this[MKDIR](this.cwd, this.dmode);
- if (er) {
- return this[ONERROR](er, entry);
- }
- this[CHECKED_CWD] = true;
- }
- // don't bother to make the parent if the current entry is the cwd,
- // we've already checked it.
- if (entry.absolute !== this.cwd) {
- const parent = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.dirname(String(entry.absolute)));
- if (parent !== this.cwd) {
- const mkParent = this[MKDIR](parent, this.dmode);
- if (mkParent) {
- return this[ONERROR](mkParent, entry);
- }
- }
- }
- const [lstatEr, st] = callSync(() => node_fs_1.default.lstatSync(String(entry.absolute)));
- if (st &&
- (this.keep ||
- /* c8 ignore next */
- (this.newer && st.mtime > (entry.mtime ?? st.mtime)))) {
- return this[SKIP](entry);
- }
- if (lstatEr || this[ISREUSABLE](entry, st)) {
- return this[MAKEFS](null, entry);
- }
- if (st.isDirectory()) {
- if (entry.type === 'Directory') {
- const needChmod = this.chmod && entry.mode && (st.mode & 0o7777) !== entry.mode;
- const [er] = needChmod ?
- callSync(() => {
- node_fs_1.default.chmodSync(String(entry.absolute), Number(entry.mode));
- })
- : [];
- return this[MAKEFS](er, entry);
- }
- // not a dir entry, have to remove it
- const [er] = callSync(() => node_fs_1.default.rmdirSync(String(entry.absolute)));
- this[MAKEFS](er, entry);
- }
- // not a dir, and not reusable.
- // don't remove if it's the cwd, since we want that error.
- const [er] = entry.absolute === this.cwd ?
- []
- : callSync(() => unlinkFileSync(String(entry.absolute)));
- this[MAKEFS](er, entry);
- }
- [FILE](entry, done) {
- const mode = typeof entry.mode === 'number' ? entry.mode & 0o7777 : this.fmode;
- const oner = (er) => {
- let closeError;
- try {
- node_fs_1.default.closeSync(fd);
- }
- catch (e) {
- closeError = e;
- }
- if (er || closeError) {
- this[ONERROR](er || closeError, entry);
- }
- done();
- };
- let fd;
- try {
- fd = node_fs_1.default.openSync(String(entry.absolute), (0, get_write_flag_js_1.getWriteFlag)(entry.size), mode);
- /* c8 ignore start - This is only a problem if the file was successfully
- * statted, BUT failed to open. Testing this is annoying, and we
- * already have ample testint for other uses of oner() methods.
- */
- }
- catch (er) {
- return oner(er);
- }
- /* c8 ignore stop */
- const tx = this.transform ? this.transform(entry) || entry : entry;
- if (tx !== entry) {
- tx.on('error', er => this[ONERROR](er, entry));
- entry.pipe(tx);
- }
- tx.on('data', (chunk) => {
- try {
- node_fs_1.default.writeSync(fd, chunk, 0, chunk.length);
- }
- catch (er) {
- oner(er);
- }
- });
- tx.on('end', () => {
- let er = null;
- // try both, falling futimes back to utimes
- // if either fails, handle the first error
- if (entry.mtime && !this.noMtime) {
- const atime = entry.atime || new Date();
- const mtime = entry.mtime;
- try {
- node_fs_1.default.futimesSync(fd, atime, mtime);
- }
- catch (futimeser) {
- try {
- node_fs_1.default.utimesSync(String(entry.absolute), atime, mtime);
- }
- catch {
- er = futimeser;
- }
- }
- }
- if (this[DOCHOWN](entry)) {
- const uid = this[UID](entry);
- const gid = this[GID](entry);
- try {
- node_fs_1.default.fchownSync(fd, Number(uid), Number(gid));
- }
- catch (fchowner) {
- try {
- node_fs_1.default.chownSync(String(entry.absolute), Number(uid), Number(gid));
- }
- catch {
- er = er || fchowner;
- }
- }
- }
- oner(er);
- });
- }
- [DIRECTORY](entry, done) {
- const mode = typeof entry.mode === 'number' ? entry.mode & 0o7777 : this.dmode;
- const er = this[MKDIR](String(entry.absolute), mode);
- if (er) {
- this[ONERROR](er, entry);
- done();
- return;
- }
- if (entry.mtime && !this.noMtime) {
- try {
- node_fs_1.default.utimesSync(String(entry.absolute), entry.atime || new Date(), entry.mtime);
- /* c8 ignore next */
- }
- catch { }
- }
- if (this[DOCHOWN](entry)) {
- try {
- node_fs_1.default.chownSync(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry)));
- }
- catch { }
- }
- done();
- entry.resume();
- }
- [MKDIR](dir, mode) {
- try {
- return (0, mkdir_js_1.mkdirSync)((0, normalize_windows_path_js_1.normalizeWindowsPath)(dir), {
- 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: mode,
- });
- }
- catch (er) {
- return er;
- }
- }
- [ENSURE_NO_SYMLINK](_entry, cwd, parts, done, onError) {
- if (this.preservePaths || parts.length === 0)
- return done();
- let t = cwd;
- for (const p of parts) {
- t = node_path_1.default.resolve(t, p);
- const [er, st] = callSync(() => node_fs_1.default.lstatSync(t));
- if (er)
- return done();
- if (st.isSymbolicLink()) {
- return onError(new symlink_error_js_1.SymlinkError(t, node_path_1.default.resolve(cwd, parts.join('/'))));
- }
- }
- done();
- }
- [LINK](entry, linkpath, link, done) {
- const linkSync = `${link}Sync`;
- try {
- node_fs_1.default[linkSync](linkpath, String(entry.absolute));
- done();
- entry.resume();
- }
- catch (er) {
- return this[ONERROR](er, entry);
- }
- }
-}
-exports.UnpackSync = UnpackSync;
-//# sourceMappingURL=unpack.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/update.d.ts b/node_modules/tar/dist/commonjs/update.d.ts
deleted file mode 100644
index 45784eb..0000000
--- a/node_modules/tar/dist/commonjs/update.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const update: import("./make-command.js").TarCommand<never, never>;
-//# sourceMappingURL=update.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/update.js b/node_modules/tar/dist/commonjs/update.js
deleted file mode 100644
index 7687896..0000000
--- a/node_modules/tar/dist/commonjs/update.js
+++ /dev/null
@@ -1,33 +0,0 @@
-"use strict";
-// tar -u
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.update = void 0;
-const make_command_js_1 = require("./make-command.js");
-const replace_js_1 = require("./replace.js");
-// just call tar.r with the filter and mtimeCache
-exports.update = (0, make_command_js_1.makeCommand)(replace_js_1.replace.syncFile, replace_js_1.replace.asyncFile, replace_js_1.replace.syncNoFile, replace_js_1.replace.asyncNoFile, (opt, entries = []) => {
- replace_js_1.replace.validate?.(opt, entries);
- mtimeFilter(opt);
-});
-const mtimeFilter = (opt) => {
- const filter = opt.filter;
- if (!opt.mtimeCache) {
- opt.mtimeCache = new Map();
- }
- opt.filter =
- filter ?
- (path, stat) => filter(path, stat) &&
- !(
- /* c8 ignore start */
- ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) >
- (stat.mtime ?? 0))
- /* c8 ignore stop */
- )
- : (path, stat) => !(
- /* c8 ignore start */
- ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) >
- (stat.mtime ?? 0))
- /* c8 ignore stop */
- );
-};
-//# sourceMappingURL=update.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/warn-method.d.ts b/node_modules/tar/dist/commonjs/warn-method.d.ts
deleted file mode 100644
index 2dd9861..0000000
--- a/node_modules/tar/dist/commonjs/warn-method.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { type Minipass } from 'minipass';
-/** has a warn method */
-export type Warner = {
- warn(code: string, message: string | Error, data: unknown): void;
- file?: string;
- cwd?: string;
- strict?: boolean;
- emit(event: 'warn', code: string, message: string, data?: WarnData): void;
- emit(event: 'error', error: TarError): void;
-};
-export type WarnEvent<T = Buffer> = Minipass.Events<T> & {
- warn: [code: string, message: string, data: WarnData];
-};
-export type WarnData = {
- file?: string;
- cwd?: string;
- code?: string;
- tarCode?: string;
- recoverable?: boolean;
- [k: string]: unknown;
-};
-export type TarError = Error & WarnData;
-export declare const warnMethod: (self: Warner, code: string, message: string | Error, data?: WarnData) => void;
-//# sourceMappingURL=warn-method.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/warn-method.js b/node_modules/tar/dist/commonjs/warn-method.js
deleted file mode 100644
index f255027..0000000
--- a/node_modules/tar/dist/commonjs/warn-method.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.warnMethod = void 0;
-const warnMethod = (self, code, message, data = {}) => {
- if (self.file) {
- data.file = self.file;
- }
- if (self.cwd) {
- data.cwd = self.cwd;
- }
- data.code =
- (message instanceof Error &&
- message.code) ||
- code;
- data.tarCode = code;
- if (!self.strict && data.recoverable !== false) {
- if (message instanceof Error) {
- data = Object.assign(message, data);
- message = message.message;
- }
- self.emit('warn', code, message, data);
- }
- else if (message instanceof Error) {
- self.emit('error', Object.assign(message, data));
- }
- else {
- self.emit('error', Object.assign(new Error(`${code}: ${message}`), data));
- }
-};
-exports.warnMethod = warnMethod;
-//# sourceMappingURL=warn-method.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/winchars.d.ts b/node_modules/tar/dist/commonjs/winchars.d.ts
deleted file mode 100644
index 6c24143..0000000
--- a/node_modules/tar/dist/commonjs/winchars.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export declare const encode: (s: string) => string;
-export declare const decode: (s: string) => string;
-//# sourceMappingURL=winchars.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/winchars.js b/node_modules/tar/dist/commonjs/winchars.js
deleted file mode 100644
index 1ce0963..0000000
--- a/node_modules/tar/dist/commonjs/winchars.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-// When writing files on Windows, translate the characters to their
-// 0xf000 higher-encoded versions.
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.decode = exports.encode = void 0;
-const raw = ['|', '<', '>', '?', ':'];
-const win = raw.map(char => String.fromCodePoint(0xf000 + Number(char.codePointAt(0))));
-const toWin = new Map(raw.map((char, i) => [char, win[i]]));
-const toRaw = new Map(win.map((char, i) => [char, raw[i]]));
-const encode = (s) => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s);
-exports.encode = encode;
-const decode = (s) => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s);
-exports.decode = decode;
-//# sourceMappingURL=winchars.js.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/write-entry.d.ts b/node_modules/tar/dist/commonjs/write-entry.d.ts
deleted file mode 100644
index 9a7c623..0000000
--- a/node_modules/tar/dist/commonjs/write-entry.d.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-import { type Stats } from 'fs';
-import { Minipass } from 'minipass';
-import { Header } from './header.js';
-import type { TarOptions, TarOptionsWithAliases } from './options.js';
-import type { ReadEntry } from './read-entry.js';
-import type { EntryTypeName } from './types.js';
-import type { WarnData, Warner, WarnEvent } from './warn-method.js';
-declare const PROCESS: unique symbol;
-declare const FILE: unique symbol;
-declare const DIRECTORY: unique symbol;
-declare const SYMLINK: unique symbol;
-declare const HARDLINK: unique symbol;
-declare const HEADER: unique symbol;
-declare const READ: unique symbol;
-declare const LSTAT: unique symbol;
-declare const ONLSTAT: unique symbol;
-declare const ONREAD: unique symbol;
-declare const ONREADLINK: unique symbol;
-declare const OPENFILE: unique symbol;
-declare const ONOPENFILE: unique symbol;
-declare const CLOSE: unique symbol;
-declare const MODE: unique symbol;
-declare const AWAITDRAIN: unique symbol;
-declare const ONDRAIN: unique symbol;
-declare const PREFIX: unique symbol;
-export declare class WriteEntry extends Minipass<Buffer, Minipass.ContiguousData, WarnEvent> implements Warner {
- #private;
- path: string;
- portable: boolean;
- myuid: number;
- myuser: string;
- maxReadSize: number;
- linkCache: Exclude<TarOptions['linkCache'], undefined>;
- statCache: Exclude<TarOptions['statCache'], undefined>;
- preservePaths: boolean;
- cwd: string;
- strict: boolean;
- mtime?: Date;
- noPax: boolean;
- noMtime: boolean;
- prefix?: string;
- fd?: number;
- blockLen: number;
- blockRemain: number;
- buf?: Buffer;
- pos: number;
- remain: number;
- length: number;
- offset: number;
- win32: boolean;
- absolute: string;
- header?: Header;
- type?: EntryTypeName | 'Unsupported';
- linkpath?: string;
- stat?: Stats;
- onWriteEntry?: (entry: WriteEntry) => unknown;
- constructor(p: string, opt_?: TarOptionsWithAliases);
- warn(code: string, message: string | Error, data?: WarnData): void;
- emit(ev: keyof WarnEvent, ...data: unknown[]): boolean;
- [LSTAT](): void;
- [ONLSTAT](stat: Stats): void;
- [PROCESS](): void | this;
- [MODE](mode: number): number;
- [PREFIX](path: string): string;
- [HEADER](): void;
- [DIRECTORY](): void;
- [SYMLINK](): void;
- [ONREADLINK](linkpath: string): void;
- [HARDLINK](linkpath: string): void;
- [FILE](): void | this;
- [OPENFILE](): void;
- [ONOPENFILE](fd: number): void;
- [READ](): void;
- [CLOSE](cb?: (er?: null | Error | NodeJS.ErrnoException) => unknown): void;
- [ONREAD](bytesRead: number): void;
- [AWAITDRAIN](cb: () => unknown): void;
- write(buffer: Buffer | string, cb?: () => void): boolean;
- write(str: Buffer | string, encoding?: BufferEncoding | null, cb?: () => void): boolean;
- [ONDRAIN](): void;
-}
-export declare class WriteEntrySync extends WriteEntry implements Warner {
- sync: true;
- [LSTAT](): void;
- [SYMLINK](): void;
- [OPENFILE](): void;
- [READ](): void;
- [AWAITDRAIN](cb: () => unknown): void;
- [CLOSE](cb?: (er?: null | Error | NodeJS.ErrnoException) => unknown): void;
-}
-export declare class WriteEntryTar extends Minipass<Buffer, Buffer | string, WarnEvent> implements Warner {
- blockLen: number;
- blockRemain: number;
- buf: number;
- pos: number;
- remain: number;
- length: number;
- preservePaths: boolean;
- portable: boolean;
- strict: boolean;
- noPax: boolean;
- noMtime: boolean;
- readEntry: ReadEntry;
- type: EntryTypeName;
- prefix?: string;
- path: string;
- mode?: number;
- uid?: number;
- gid?: number;
- uname?: string;
- gname?: string;
- header?: Header;
- mtime?: Date;
- atime?: Date;
- ctime?: Date;
- linkpath?: string;
- size: number;
- onWriteEntry?: (entry: WriteEntry) => unknown;
- warn(code: string, message: string | Error, data?: WarnData): void;
- constructor(readEntry: ReadEntry, opt_?: TarOptionsWithAliases);
- [PREFIX](path: string): string;
- [MODE](mode: number): number;
- write(buffer: Buffer | string, cb?: () => void): boolean;
- write(str: Buffer | string, encoding?: BufferEncoding | null, cb?: () => void): boolean;
- end(cb?: () => void): this;
- end(chunk: Buffer | string, cb?: () => void): this;
- end(chunk: Buffer | string, encoding?: BufferEncoding, cb?: () => void): this;
-}
-export {};
-//# sourceMappingURL=write-entry.d.ts.map \ No newline at end of file
diff --git a/node_modules/tar/dist/commonjs/write-entry.js b/node_modules/tar/dist/commonjs/write-entry.js
deleted file mode 100644
index db4fa77..0000000
--- a/node_modules/tar/dist/commonjs/write-entry.js
+++ /dev/null
@@ -1,698 +0,0 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.WriteEntryTar = exports.WriteEntrySync = exports.WriteEntry = void 0;
-const fs_1 = __importDefault(require("fs"));
-const minipass_1 = require("minipass");
-const path_1 = __importDefault(require("path"));
-const header_js_1 = require("./header.js");
-const mode_fix_js_1 = require("./mode-fix.js");
-const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
-const options_js_1 = require("./options.js");
-const pax_js_1 = require("./pax.js");
-const strip_absolute_path_js_1 = require("./strip-absolute-path.js");
-const strip_trailing_slashes_js_1 = require("./strip-trailing-slashes.js");
-const warn_method_js_1 = require("./warn-method.js");
-const winchars = __importStar(require("./winchars.js"));
-const prefixPath = (path, prefix) => {
- if (!prefix) {
- return (0, normalize_windows_path_js_1.normalizeWindowsPath)(path);
- }
- path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(path).replace(/^\.(\/|$)/, '');
- return (0, strip_trailing_slashes_js_1.stripTrailingSlashes)(prefix) + '/' + path;
-};
-const maxReadSize = 16 * 1024 * 1024;
-const PROCESS = Symbol('process');
-const FILE = Symbol('file');
-const DIRECTORY = Symbol('directory');
-const SYMLINK = Symbol('symlink');
-const HARDLINK = Symbol('hardlink');
-const HEADER = Symbol('header');
-const READ = Symbol('read');
-const LSTAT = Symbol('lstat');
-const ONLSTAT = Symbol('onlstat');
-const ONREAD = Symbol('onread');
-const ONREADLINK = Symbol('onreadlink');
-const OPENFILE = Symbol('openfile');
-const ONOPENFILE = Symbol('onopenfile');
-const CLOSE = Symbol('close');
-const MODE = Symbol('mode');
-const AWAITDRAIN = Symbol('awaitDrain');
-const ONDRAIN = Symbol('ondrain');
-const PREFIX = Symbol('prefix');
-class WriteEntry extends minipass_1.Minipass {
- path;
- portable;
- myuid = (process.getuid && process.getuid()) || 0;
- // until node has builtin pwnam functions, this'll have to do
- myuser = process.env.USER || '';
- maxReadSize;
- linkCache;
- statCache;
- preservePaths;
- cwd;
- strict;
- mtime;
- noPax;
- noMtime;
- prefix;
- fd;
- blockLen = 0;
- blockRemain = 0;
- buf;
- pos = 0;
- remain = 0;
- length = 0;
- offset = 0;
- win32;
- absolute;
- header;
- type;
- linkpath;
- stat;
- onWriteEntry;
- #hadError = false;
- constructor(p, opt_ = {}) {
- const opt = (0, options_js_1.dealias)(opt_);
- super();
- this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(p);
- // suppress atime, ctime, uid, gid, uname, gname
- this.portable = !!opt.portable;
- this.maxReadSize = opt.maxReadSize || maxReadSize;
- this.linkCache = opt.linkCache || new Map();
- this.statCache = opt.statCache || new Map();
- this.preservePaths = !!opt.preservePaths;
- this.cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd || process.cwd());
- this.strict = !!opt.strict;
- this.noPax = !!opt.noPax;
- this.noMtime = !!opt.noMtime;
- this.mtime = opt.mtime;
- this.prefix = opt.prefix ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.prefix) : undefined;
- this.onWriteEntry = opt.onWriteEntry;
- if (typeof opt.onwarn === 'function') {
- this.on('warn', opt.onwarn);
- }
- let pathWarn = false;
- if (!this.preservePaths) {
- const [root, stripped] = (0, strip_absolute_path_js_1.stripAbsolutePath)(this.path);
- if (root && typeof stripped === 'string') {
- this.path = stripped;
- pathWarn = root;
- }
- }
- this.win32 = !!opt.win32 || process.platform === 'win32';
- if (this.win32) {
- // force the \ to / normalization, since we might not *actually*
- // be on windows, but want \ to be considered a path separator.
- this.path = winchars.decode(this.path.replaceAll(/\\/g, '/'));
- p = p.replaceAll(/\\/g, '/');
- }
- this.absolute = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.absolute || path_1.default.resolve(this.cwd, p));
- if (this.path === '') {
- this.path = './';
- }
- if (pathWarn) {
- this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {
- entry: this,
- path: pathWarn + this.path,
- });
- }
- const cs = this.statCache.get(this.absolute);
- if (cs) {
- this[ONLSTAT](cs);
- }
- else {
- this[LSTAT]();
- }
- }
- warn(code, message, data = {}) {
- return (0, warn_method_js_1.warnMethod)(this, code, message, data);
- }
- emit(ev, ...data) {
- if (ev === 'error') {
- this.#hadError = true;
- }
- return super.emit(ev, ...data);
- }
- [LSTAT]() {
- fs_1.default.lstat(this.absolute, (er, stat) => {
- if (er) {
- return this.emit('error', er);
- }
- this[ONLSTAT](stat);
- });
- }
- [ONLSTAT](stat) {
- this.statCache.set(this.absolute, stat);
- this.stat = stat;
- if (!stat.isFile()) {
- stat.size = 0;
- }
- this.type = getType(stat);
- this.emit('stat', stat);
- this[PROCESS]();
- }
- [PROCESS]() {
- switch (this.type) {
- case 'File':
- return this[FILE]();
- case 'Directory':
- return this[DIRECTORY]();
- case 'SymbolicLink':
- return this[SYMLINK]();
- // unsupported types are ignored.
- default:
- return this.end();
- }
- }
- [MODE](mode) {
- return (0, mode_fix_js_1.modeFix)(mode, this.type === 'Directory', this.portable);
- }
- [PREFIX](path) {
- return prefixPath(path, this.prefix);
- }
- [HEADER]() {
- /* c8 ignore start */
- if (!this.stat) {
- throw new Error('cannot write header before stat');
- }
- /* c8 ignore stop */
- if (this.type === 'Directory' && this.portable) {
- this.noMtime = true;
- }
- this.onWriteEntry?.(this);
- this.header = new header_js_1.Header({
- path: this[PREFIX](this.path),
- // only apply the prefix to hard links.
- linkpath: this.type === 'Link' && this.linkpath !== undefined ?
- this[PREFIX](this.linkpath)
- : this.linkpath,
- // only the permissions and setuid/setgid/sticky bitflags
- // not the higher-order bits that specify file type
- mode: this[MODE](this.stat.mode),
- uid: this.portable ? undefined : this.stat.uid,
- gid: this.portable ? undefined : this.stat.gid,
- size: this.stat.size,
- mtime: this.noMtime ? undefined : this.mtime || this.stat.mtime,
- /* c8 ignore next */
- type: this.type === 'Unsupported' ? undefined : this.type,
- uname: this.portable ? undefined
- : this.stat.uid === this.myuid ? this.myuser
- : '',
- atime: this.portable ? undefined : this.stat.atime,
- ctime: this.portable ? undefined : this.stat.ctime,
- });
- if (this.header.encode() && !this.noPax) {
- super.write(new pax_js_1.Pax({
- atime: this.portable ? undefined : this.header.atime,
- ctime: this.portable ? undefined : this.header.ctime,
- gid: this.portable ? undefined : this.header.gid,
- mtime: this.noMtime ? undefined : this.mtime || this.header.mtime,
- path: this[PREFIX](this.path),
- linkpath: this.type === 'Link' && this.linkpath !== undefined ?
- this[PREFIX](this.linkpath)
- : this.linkpath,
- size: this.header.size,
- uid: this.portable ? undefined : this.header.uid,
- uname: this.portable ? undefined : this.header.uname,
- dev: this.portable ? undefined : this.stat.dev,
- ino: this.portable ? undefined : this.stat.ino,
- nlink: this.portable ? undefined : this.stat.nlink,
- }).encode());
- }
- const block = this.header?.block;
- /* c8 ignore start */
- if (!block) {
- throw new Error('failed to encode header');
- }
- /* c8 ignore stop */
- super.write(block);
- }
- [DIRECTORY]() {
- /* c8 ignore start */
- if (!this.stat) {
- throw new Error('cannot create directory entry without stat');
- }
- /* c8 ignore stop */
- if (this.path.slice(-1) !== '/') {
- this.path += '/';
- }
- this.stat.size = 0;
- this[HEADER]();
- this.end();
- }
- [SYMLINK]() {
- fs_1.default.readlink(this.absolute, (er, linkpath) => {
- if (er) {
- return this.emit('error', er);
- }
- this[ONREADLINK](linkpath);
- });
- }
- [ONREADLINK](linkpath) {
- this.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(linkpath);
- this[HEADER]();
- this.end();
- }
- [HARDLINK](linkpath) {
- /* c8 ignore start */
- if (!this.stat) {
- throw new Error('cannot create link entry without stat');
- }
- /* c8 ignore stop */
- this.type = 'Link';
- this.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(path_1.default.relative(this.cwd, linkpath));
- this.stat.size = 0;
- this[HEADER]();
- this.end();
- }
- [FILE]() {
- /* c8 ignore start */
- if (!this.stat) {
- throw new Error('cannot create file entry without stat');
- }
- /* c8 ignore stop */
- if (this.stat.nlink > 1) {
- const linkKey = `${this.stat.dev}:${this.stat.ino}`;
- const linkpath = this.linkCache.get(linkKey);
- if (linkpath?.indexOf(this.cwd) === 0) {
- return this[HARDLINK](linkpath);
- }
- this.linkCache.set(linkKey, this.absolute);
- }
- this[HEADER]();
- if (this.stat.size === 0) {
- return this.end();
- }
- this[OPENFILE]();
- }
- [OPENFILE]() {
- fs_1.default.open(this.absolute, 'r', (er, fd) => {
- if (er) {
- return this.emit('error', er);
- }
- this[ONOPENFILE](fd);
- });
- }
- [ONOPENFILE](fd) {
- this.fd = fd;
- if (this.#hadError) {
- return this[CLOSE]();
- }
- /* c8 ignore start */
- if (!this.stat) {
- throw new Error('should stat before calling onopenfile');
- }
- /* c8 ignore start */
- this.blockLen = 512 * Math.ceil(this.stat.size / 512);
- this.blockRemain = this.blockLen;
- const bufLen = Math.min(this.blockLen, this.maxReadSize);
- this.buf = Buffer.allocUnsafe(bufLen);
- this.offset = 0;
- this.pos = 0;
- this.remain = this.stat.size;
- this.length = this.buf.length;
- this[READ]();
- }
- [READ]() {
- const { fd, buf, offset, length, pos } = this;
- if (fd === undefined || buf === undefined) {
- throw new Error('cannot read file without first opening');
- }
- fs_1.default.read(fd, buf, offset, length, pos, (er, bytesRead) => {
- if (er) {
- // ignoring the error from close(2) is a bad practice, but at
- // this point we already have an error, don't need another one
- return this[CLOSE](() => this.emit('error', er));
- }
- this[ONREAD](bytesRead);
- });
- }
- /* c8 ignore start */
- [CLOSE](cb = () => { }) {
- /* c8 ignore stop */
- if (this.fd !== undefined)
- fs_1.default.close(this.fd, cb);
- }
- [ONREAD](bytesRead) {
- if (bytesRead <= 0 && this.remain > 0) {
- const er = Object.assign(new Error('encountered unexpected EOF'), {
- path: this.absolute,
- syscall: 'read',
- code: 'EOF',
- });
- return this[CLOSE](() => this.emit('error', er));
- }
- if (bytesRead > this.remain) {
- const er = Object.assign(new Error('did not encounter expected EOF'), {
- path: this.absolute,
- syscall: 'read',
- code: 'EOF',
- });
- return this[CLOSE](() => this.emit('error', er));
- }
- /* c8 ignore start */
- if (!this.buf) {
- throw new Error('should have created buffer prior to reading');
- }
- /* c8 ignore stop */
- // null out the rest of the buffer, if we could fit the block padding
- // at the end of this loop, we've incremented bytesRead and this.remain
- // to be incremented up to the blockRemain level, as if we had expected
- // to get a null-padded file, and read it until the end. then we will
- // decrement both remain and blockRemain by bytesRead, and know that we
- // reached the expected EOF, without any null buffer to append.
- if (bytesRead === this.remain) {
- for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) {
- this.buf[i + this.offset] = 0;
- bytesRead++;
- this.remain++;
- }
- }
- const chunk = this.offset === 0 && bytesRead === this.buf.length ?
- this.buf
- : this.buf.subarray(this.offset, this.offset + bytesRead);
- const flushed = this.write(chunk);
- if (!flushed) {
- this[AWAITDRAIN](() => this[ONDRAIN]());
- }
- else {
- this[ONDRAIN]();
- }
- }
- [AWAITDRAIN](cb) {
- this.once('drain', cb);
- }
- write(chunk, encoding, cb) {
- /* c8 ignore start - just junk to comply with NodeJS.WritableStream */
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- if (typeof chunk === 'string') {
- chunk = Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8');
- }
- /* c8 ignore stop */
- if (this.blockRemain < chunk.length) {
- const er = Object.assign(new Error('writing more data than expected'), {
- path: this.absolute,
- });
- return this.emit('error', er);
- }
- this.remain -= chunk.length;
- this.blockRemain -= chunk.length;
- this.pos += chunk.length;
- this.offset += chunk.length;
- return super.write(chunk, null, cb);
- }
- [ONDRAIN]() {
- if (!this.remain) {
- if (this.blockRemain) {
- super.write(Buffer.alloc(this.blockRemain));
- }
- return this[CLOSE](er => (er ? this.emit('error', er) : this.end()));
- }
- /* c8 ignore start */
- if (!this.buf) {
- throw new Error('buffer lost somehow in ONDRAIN');
- }
- /* c8 ignore stop */
- if (this.offset >= this.length) {
- // if we only have a smaller bit left to read, alloc a smaller buffer
- // otherwise, keep it the same length it was before.
- this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length));
- this.offset = 0;
- }
- this.length = this.buf.length - this.offset;
- this[READ]();
- }
-}
-exports.WriteEntry = WriteEntry;
-class WriteEntrySync extends WriteEntry {
- sync = true;
- [LSTAT]() {
- this[ONLSTAT](fs_1.default.lstatSync(this.absolute));
- }
- [SYMLINK]() {
- this[ONREADLINK](fs_1.default.readlinkSync(this.absolute));
- }
- [OPENFILE]() {
- this[ONOPENFILE](fs_1.default.openSync(this.absolute, 'r'));
- }
- [READ]() {
- let threw = true;
- try {
- const { fd, buf, offset, length, pos } = this;
- /* c8 ignore start */
- if (fd === undefined || buf === undefined) {
- throw new Error('fd and buf must be set in READ method');
- }
- /* c8 ignore stop */
- const bytesRead = fs_1.default.readSync(fd, buf, offset, length, pos);
- this[ONREAD](bytesRead);
- threw = false;
- }
- finally {
- // ignoring the error from close(2) is a bad practice, but at
- // this point we already have an error, don't need another one
- if (threw) {
- try {
- this[CLOSE](() => { });
- }
- catch { }
- }
- }
- }
- [AWAITDRAIN](cb) {
- cb();
- }
- /* c8 ignore start */
- [CLOSE](cb = () => { }) {
- /* c8 ignore stop */
- if (this.fd !== undefined)
- fs_1.default.closeSync(this.fd);
- cb();
- }
-}
-exports.WriteEntrySync = WriteEntrySync;
-class WriteEntryTar extends minipass_1.Minipass {
- blockLen = 0;
- blockRemain = 0;
- buf = 0;
- pos = 0;
- remain = 0;
- length = 0;
- preservePaths;
- portable;
- strict;
- noPax;
- noMtime;
- readEntry;
- type;
- prefix;
- path;
- mode;
- uid;
- gid;
- uname;
- gname;
- header;
- mtime;
- atime;
- ctime;
- linkpath;
- size;
- onWriteEntry;
- warn(code, message, data = {}) {
- return (0, warn_method_js_1.warnMethod)(this, code, message, data);
- }
- constructor(readEntry, opt_ = {}) {
- const opt = (0, options_js_1.dealias)(opt_);
- super();
- this.preservePaths = !!opt.preservePaths;
- this.portable = !!opt.portable;
- this.strict = !!opt.strict;
- this.noPax = !!opt.noPax;
- this.noMtime = !!opt.noMtime;
- this.onWriteEntry = opt.onWriteEntry;
- this.readEntry = readEntry;
- const { type } = readEntry;
- /* c8 ignore start */
- if (type === 'Unsupported') {
- throw new Error('writing entry that should be ignored');
- }
- /* c8 ignore stop */
- this.type = type;
- if (this.type === 'Directory' && this.portable) {
- this.noMtime = true;
- }
- this.prefix = opt.prefix;
- this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(readEntry.path);
- this.mode =
- readEntry.mode !== undefined ? this[MODE](readEntry.mode) : undefined;
- this.uid = this.portable ? undefined : readEntry.uid;
- this.gid = this.portable ? undefined : readEntry.gid;
- this.uname = this.portable ? undefined : readEntry.uname;
- this.gname = this.portable ? undefined : readEntry.gname;
- this.size = readEntry.size;
- this.mtime = this.noMtime ? undefined : opt.mtime || readEntry.mtime;
- this.atime = this.portable ? undefined : readEntry.atime;
- this.ctime = this.portable ? undefined : readEntry.ctime;
- this.linkpath =
- readEntry.linkpath !== undefined ?
- (0, normalize_windows_path_js_1.normalizeWindowsPath)(readEntry.linkpath)
- : undefined;
- if (typeof opt.onwarn === 'function') {
- this.on('warn', opt.onwarn);
- }
- let pathWarn = false;
- if (!this.preservePaths) {
- const [root, stripped] = (0, strip_absolute_path_js_1.stripAbsolutePath)(this.path);
- if (root && typeof stripped === 'string') {
- this.path = stripped;
- pathWarn = root;
- }
- }
- this.remain = readEntry.size;
- this.blockRemain = readEntry.startBlockSize;
- this.onWriteEntry?.(this);
- this.header = new header_js_1.Header({
- path: this[PREFIX](this.path),
- linkpath: this.type === 'Link' && this.linkpath !== undefined ?
- this[PREFIX](this.linkpath)
- : this.linkpath,
- // only the permissions and setuid/setgid/sticky bitflags
- // not the higher-order bits that specify file type
- mode: this.mode,
- uid: this.portable ? undefined : this.uid,
- gid: this.portable ? undefined : this.gid,
- size: this.size,
- mtime: this.noMtime ? undefined : this.mtime,
- type: this.type,
- uname: this.portable ? undefined : this.uname,
- atime: this.portable ? undefined : this.atime,
- ctime: this.portable ? undefined : this.ctime,
- });
- if (pathWarn) {
- this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {
- entry: this,
- path: pathWarn + this.path,
- });
- }
- if (this.header.encode() && !this.noPax) {
- super.write(new pax_js_1.Pax({
- atime: this.portable ? undefined : this.atime,
- ctime: this.portable ? undefined : this.ctime,
- gid: this.portable ? undefined : this.gid,
- mtime: this.noMtime ? undefined : this.mtime,
- path: this[PREFIX](this.path),
- linkpath: this.type === 'Link' && this.linkpath !== undefined ?
- this[PREFIX](this.linkpath)
- : this.linkpath,
- size: this.size,
- uid: this.portable ? undefined : this.uid,
- uname: this.portable ? undefined : this.uname,
- dev: this.portable ? undefined : this.readEntry.dev,
- ino: this.portable ? undefined : this.readEntry.ino,
- nlink: this.portable ? undefined : this.readEntry.nlink,
- }).encode());
- }
- const b = this.header?.block;
- /* c8 ignore start */
- if (!b)
- throw new Error('failed to encode header');
- /* c8 ignore stop */
- super.write(b);
- readEntry.pipe(this);
- }
- [PREFIX](path) {
- return prefixPath(path, this.prefix);
- }
- [MODE](mode) {
- return (0, mode_fix_js_1.modeFix)(mode, this.type === 'Directory', this.portable);
- }
- write(chunk, encoding, cb) {
- /* c8 ignore start - just junk to comply with NodeJS.WritableStream */
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- if (typeof chunk === 'string') {
- chunk = Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8');
- }
- /* c8 ignore stop */
- const writeLen = chunk.length;
- if (writeLen > this.blockRemain) {
- throw new Error('writing more to entry than is appropriate');
- }
- this.blockRemain -= writeLen;
- return super.write(chunk, cb);
- }
- end(chunk, encoding, cb) {
- if (this.blockRemain) {
- super.write(Buffer.alloc(this.blockRemain));
- }
- /* c8 ignore start - just junk to comply with NodeJS.WritableStream */
- if (typeof chunk === 'function') {
- cb = chunk;
- encoding = undefined;
- chunk = undefined;
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = undefined;
- }
- if (typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding ?? 'utf8');
- }
- if (cb)
- this.once('finish', cb);
- if (chunk)
- super.end(chunk, cb);
- else
- super.end(cb);
- /* c8 ignore stop */
- return this;
- }
-}
-exports.WriteEntryTar = WriteEntryTar;
-const getType = (stat) => stat.isFile() ? 'File'
- : stat.isDirectory() ? 'Directory'
- : stat.isSymbolicLink() ? 'SymbolicLink'
- : 'Unsupported';
-//# sourceMappingURL=write-entry.js.map \ No newline at end of file