nexum-code 0.7.11 → 0.7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{app-BwutxHqk.mjs → app-Dn2QN6KQ.mjs} +3722 -2709
- package/dist/dist-CP92tKmm.mjs +2003 -0
- package/dist/dist-DC_zVbxT.mjs +7 -0
- package/dist/{dist-0bMQWc-B.mjs → dist-Dh_F9syl.mjs} +1 -1
- package/dist/{esm-BLHs2dah.mjs → esm-C7p5AwJU.mjs} +39 -39
- package/dist/{from-CKE2n10i.mjs → from-D_EZ04z8.mjs} +1 -1
- package/dist/{index.min-DtYFUEA3.mjs → index.min-Di7B-aJf.mjs} +138 -138
- package/dist/main.mjs +1 -1
- package/dist/{multipart-parser-BxHsVgPe.mjs → multipart-parser-uEw3PR6T.mjs} +2 -2
- package/dist/{chunk-apG1qJts.mjs → rolldown-runtime-CDCXy-ZS.mjs} +9 -2
- package/dist/{src-C6XAfwit.mjs → src-BAMmHkmC.mjs} +6 -6
- package/package.json +3 -1
|
@@ -5,15 +5,15 @@ const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
6
|
import { randomBytes } from "node:crypto";
|
|
7
7
|
import jn from "node:fs/promises";
|
|
8
|
-
import
|
|
8
|
+
import $ from "fs";
|
|
9
9
|
import $r, { EventEmitter } from "events";
|
|
10
|
-
import
|
|
10
|
+
import nr, { dirname, parse } from "path";
|
|
11
11
|
import { Buffer as Buffer$1 } from "buffer";
|
|
12
12
|
import As from "node:stream";
|
|
13
13
|
import * as Ms from "zlib";
|
|
14
14
|
import Jr from "zlib";
|
|
15
|
-
import
|
|
16
|
-
import path
|
|
15
|
+
import Ei from "node:fs";
|
|
16
|
+
import path, { basename, join, posix, win32 } from "node:path";
|
|
17
17
|
import { StringDecoder } from "node:string_decoder";
|
|
18
18
|
import { EventEmitter as EventEmitter$1 } from "node:events";
|
|
19
19
|
import Pi from "assert";
|
|
@@ -349,7 +349,7 @@ while (this[Ns](this[Ae]()) && this[b].length);
|
|
|
349
349
|
return zr;
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
var Xr =
|
|
352
|
+
var Xr = $.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol("_ended"), m = Symbol("_fd"), Ni = Symbol("_finished"), j = Symbol("_flags"), Di = Symbol("_flush"), Ci = Symbol("_handleChunk"), ki = Symbol("_makeBuf"), ie = Symbol("_mode"), Ce = Symbol("_needDrain"), Ut = Symbol("_onerror"), Ht = Symbol("_onopen"), Ai = Symbol("_onread"), Pt = Symbol("_onwrite"), ht = Symbol("_open"), U = Symbol("_path"), nt = Symbol("_pos"), Y = Symbol("_queue"), zt = Symbol("_read"), Ii = Symbol("_readSize"), J = Symbol("_reading"), ee = Symbol("_remain"), Fi = Symbol("_size"), ke = Symbol("_write"), gt = Symbol("_writing"), ve = Symbol("_defaultFlag"), bt = Symbol("_errored"), _t = class extends A {
|
|
353
353
|
[bt] = !1;
|
|
354
354
|
[m];
|
|
355
355
|
[U];
|
|
@@ -375,7 +375,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
375
375
|
throw new TypeError("this is a readable stream");
|
|
376
376
|
}
|
|
377
377
|
[ht]() {
|
|
378
|
-
|
|
378
|
+
$.open(this[U], "r", (t, e) => this[Ht](t, e));
|
|
379
379
|
}
|
|
380
380
|
[Ht](t, e) {
|
|
381
381
|
t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[zt]());
|
|
@@ -388,7 +388,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
388
388
|
this[J] = !0;
|
|
389
389
|
let t = this[ki]();
|
|
390
390
|
if (t.length === 0) return process.nextTick(() => this[Ai](null, 0, t));
|
|
391
|
-
|
|
391
|
+
$.read(this[m], t, 0, t.length, null, (e, i, r) => this[Ai](e, i, r));
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
[Ai](t, e, i) {
|
|
@@ -397,7 +397,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
397
397
|
[H]() {
|
|
398
398
|
if (this[ot] && typeof this[m] == "number") {
|
|
399
399
|
let t = this[m];
|
|
400
|
-
this[m] = void 0,
|
|
400
|
+
this[m] = void 0, $.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
[Ut](t) {
|
|
@@ -420,7 +420,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
420
420
|
[ht]() {
|
|
421
421
|
let t = !0;
|
|
422
422
|
try {
|
|
423
|
-
this[Ht](null,
|
|
423
|
+
this[Ht](null, $.openSync(this[U], "r")), t = !1;
|
|
424
424
|
} finally {
|
|
425
425
|
t && this[H]();
|
|
426
426
|
}
|
|
@@ -431,7 +431,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
431
431
|
if (!this[J]) {
|
|
432
432
|
this[J] = !0;
|
|
433
433
|
do {
|
|
434
|
-
let e = this[ki](), i = e.length === 0 ? 0 :
|
|
434
|
+
let e = this[ki](), i = e.length === 0 ? 0 : $.readSync(this[m], e, 0, e.length, null);
|
|
435
435
|
if (!this[Ci](i, e)) break;
|
|
436
436
|
} while (!0);
|
|
437
437
|
this[J] = !1;
|
|
@@ -444,7 +444,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
444
444
|
[H]() {
|
|
445
445
|
if (this[ot] && typeof this[m] == "number") {
|
|
446
446
|
let t = this[m];
|
|
447
|
-
this[m] = void 0,
|
|
447
|
+
this[m] = void 0, $.closeSync(t), this.emit("close");
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
}, tt = class extends $r {
|
|
@@ -485,7 +485,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
485
485
|
this[H](), this[gt] = !0, this.emit("error", t);
|
|
486
486
|
}
|
|
487
487
|
[ht]() {
|
|
488
|
-
|
|
488
|
+
$.open(this[U], this[j], this[ie], (t, e) => this[Ht](t, e));
|
|
489
489
|
}
|
|
490
490
|
[Ht](t, e) {
|
|
491
491
|
this[ve] && this[j] === "r+" && t && t.code === "ENOENT" ? (this[j] = "w", this[ht]()) : t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[gt] || this[Di]());
|
|
@@ -497,7 +497,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
497
497
|
return typeof t == "string" && (t = Buffer.from(t, e)), this[te] ? (this.emit("error", /* @__PURE__ */ new Error("write() after end()")), !1) : this[m] === void 0 || this[gt] || this[Y].length ? (this[Y].push(t), this[Ce] = !0, !1) : (this[gt] = !0, this[ke](t), !0);
|
|
498
498
|
}
|
|
499
499
|
[ke](t) {
|
|
500
|
-
|
|
500
|
+
$.write(this[m], t, 0, t.length, this[nt], (e, i) => this[Pt](e, i));
|
|
501
501
|
}
|
|
502
502
|
[Pt](t, e) {
|
|
503
503
|
t ? this[Ut](t) : (this[nt] !== void 0 && typeof e == "number" && (this[nt] += e), this[Y].length ? this[Di]() : (this[gt] = !1, this[te] && !this[Ni] ? (this[Ni] = !0, this[H](), this.emit("finish")) : this[Ce] && (this[Ce] = !1, this.emit("drain"))));
|
|
@@ -513,31 +513,31 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
513
513
|
[H]() {
|
|
514
514
|
if (this[ot] && typeof this[m] == "number") {
|
|
515
515
|
let t = this[m];
|
|
516
|
-
this[m] = void 0,
|
|
516
|
+
this[m] = void 0, $.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
}, Wt = class extends tt {
|
|
520
520
|
[ht]() {
|
|
521
521
|
let t;
|
|
522
522
|
if (this[ve] && this[j] === "r+") try {
|
|
523
|
-
t =
|
|
523
|
+
t = $.openSync(this[U], this[j], this[ie]);
|
|
524
524
|
} catch (e) {
|
|
525
525
|
if (e?.code === "ENOENT") return this[j] = "w", this[ht]();
|
|
526
526
|
throw e;
|
|
527
527
|
}
|
|
528
|
-
else t =
|
|
528
|
+
else t = $.openSync(this[U], this[j], this[ie]);
|
|
529
529
|
this[Ht](null, t);
|
|
530
530
|
}
|
|
531
531
|
[H]() {
|
|
532
532
|
if (this[ot] && typeof this[m] == "number") {
|
|
533
533
|
let t = this[m];
|
|
534
|
-
this[m] = void 0,
|
|
534
|
+
this[m] = void 0, $.closeSync(t), this.emit("close");
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
[ke](t) {
|
|
538
538
|
let e = !0;
|
|
539
539
|
try {
|
|
540
|
-
this[Pt](null,
|
|
540
|
+
this[Pt](null, $.writeSync(this[m], t, 0, t.length, this[nt])), e = !1;
|
|
541
541
|
} finally {
|
|
542
542
|
if (e) try {
|
|
543
543
|
this[H]();
|
|
@@ -545,7 +545,7 @@ var Xr = fs.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol
|
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
|
-
var qr = new Map([
|
|
548
|
+
var qr = /* @__PURE__ */ new Map([
|
|
549
549
|
["C", "cwd"],
|
|
550
550
|
["f", "file"],
|
|
551
551
|
["z", "gzip"],
|
|
@@ -898,7 +898,7 @@ Br({}, {
|
|
|
898
898
|
name: () => oe,
|
|
899
899
|
normalFsTypes: () => zi
|
|
900
900
|
});
|
|
901
|
-
var ne = (s) => oe.has(s), ln = (s) => Ke.has(s), zi = new Set([
|
|
901
|
+
var ne = (s) => oe.has(s), ln = (s) => Ke.has(s), zi = /* @__PURE__ */ new Set([
|
|
902
902
|
"0",
|
|
903
903
|
"",
|
|
904
904
|
"1",
|
|
@@ -909,7 +909,7 @@ var ne = (s) => oe.has(s), ln = (s) => Ke.has(s), zi = new Set([
|
|
|
909
909
|
"6",
|
|
910
910
|
"7",
|
|
911
911
|
"D"
|
|
912
|
-
]), oe = new Map([
|
|
912
|
+
]), oe = /* @__PURE__ */ new Map([
|
|
913
913
|
["0", "File"],
|
|
914
914
|
["", "OldFile"],
|
|
915
915
|
["1", "Link"],
|
|
@@ -1406,15 +1406,15 @@ var An = (s) => {
|
|
|
1406
1406
|
}, In = (s) => {
|
|
1407
1407
|
let t = new st(s), e = s.file, i;
|
|
1408
1408
|
try {
|
|
1409
|
-
i =
|
|
1410
|
-
let r =
|
|
1409
|
+
i = Ei.openSync(e, "r");
|
|
1410
|
+
let r = Ei.fstatSync(i), n = s.maxReadSize || 16 * 1024 * 1024;
|
|
1411
1411
|
if (r.size < n) {
|
|
1412
|
-
let o = Buffer.allocUnsafe(r.size), a =
|
|
1412
|
+
let o = Buffer.allocUnsafe(r.size), a = Ei.readSync(i, o, 0, r.size, 0);
|
|
1413
1413
|
t.end(a === o.byteLength ? o : o.subarray(0, a));
|
|
1414
1414
|
} else {
|
|
1415
1415
|
let o = 0, a = Buffer.allocUnsafe(n);
|
|
1416
1416
|
for (; o < r.size;) {
|
|
1417
|
-
let h =
|
|
1417
|
+
let h = Ei.readSync(i, a, 0, n, o);
|
|
1418
1418
|
if (h === 0) break;
|
|
1419
1419
|
o += h, t.write(a.subarray(0, h));
|
|
1420
1420
|
}
|
|
@@ -1422,13 +1422,13 @@ var An = (s) => {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
} finally {
|
|
1424
1424
|
if (typeof i == "number") try {
|
|
1425
|
-
|
|
1425
|
+
Ei.closeSync(i);
|
|
1426
1426
|
} catch {}
|
|
1427
1427
|
}
|
|
1428
1428
|
}, Fn = (s, t) => {
|
|
1429
1429
|
let e = new st(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
|
|
1430
1430
|
return new Promise((o, a) => {
|
|
1431
|
-
e.on("error", a), e.on("end", o),
|
|
1431
|
+
e.on("error", a), e.on("end", o), Ei.stat(r, (h, l) => {
|
|
1432
1432
|
if (h) a(h);
|
|
1433
1433
|
else {
|
|
1434
1434
|
let c = new _t(r, {
|
|
@@ -1497,7 +1497,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1497
1497
|
let [o, a] = le(this.path);
|
|
1498
1498
|
o && typeof a == "string" && (this.path = a, r = o);
|
|
1499
1499
|
}
|
|
1500
|
-
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = $s(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute ||
|
|
1500
|
+
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = $s(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || nr.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
|
|
1501
1501
|
entry: this,
|
|
1502
1502
|
path: r + this.path
|
|
1503
1503
|
});
|
|
@@ -1511,7 +1511,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1511
1511
|
return t === "error" && (this.#t = !0), super.emit(t, ...e);
|
|
1512
1512
|
}
|
|
1513
1513
|
[es]() {
|
|
1514
|
-
|
|
1514
|
+
$.lstat(this.absolute, (t, e) => {
|
|
1515
1515
|
if (t) return this.emit("error", t);
|
|
1516
1516
|
this[ii](e);
|
|
1517
1517
|
});
|
|
@@ -1570,7 +1570,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1570
1570
|
this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[ce](), this.end();
|
|
1571
1571
|
}
|
|
1572
1572
|
[ts]() {
|
|
1573
|
-
|
|
1573
|
+
$.readlink(this.absolute, (t, e) => {
|
|
1574
1574
|
if (t) return this.emit("error", t);
|
|
1575
1575
|
this[ss](e);
|
|
1576
1576
|
});
|
|
@@ -1580,7 +1580,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1580
1580
|
}
|
|
1581
1581
|
[tr](t) {
|
|
1582
1582
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
1583
|
-
this.type = "Link", this.linkpath = f(
|
|
1583
|
+
this.type = "Link", this.linkpath = f(nr.relative(this.cwd, t)), this.stat.size = 0, this[ce](), this.end();
|
|
1584
1584
|
}
|
|
1585
1585
|
[Js]() {
|
|
1586
1586
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -1593,7 +1593,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1593
1593
|
this[rs]();
|
|
1594
1594
|
}
|
|
1595
1595
|
[rs]() {
|
|
1596
|
-
|
|
1596
|
+
$.open(this.absolute, "r", (t, e) => {
|
|
1597
1597
|
if (t) return this.emit("error", t);
|
|
1598
1598
|
this[ns](e);
|
|
1599
1599
|
});
|
|
@@ -1608,13 +1608,13 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1608
1608
|
[ei]() {
|
|
1609
1609
|
let { fd: t, buf: e, offset: i, length: r, pos: n } = this;
|
|
1610
1610
|
if (t === void 0 || e === void 0) throw new Error("cannot read file without first opening");
|
|
1611
|
-
|
|
1611
|
+
$.read(t, e, i, r, n, (o, a) => {
|
|
1612
1612
|
if (o) return this[pt](() => this.emit("error", o));
|
|
1613
1613
|
this[is](a);
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
[pt](t = () => {}) {
|
|
1617
|
-
this.fd !== void 0 &&
|
|
1617
|
+
this.fd !== void 0 && $.close(this.fd, t);
|
|
1618
1618
|
}
|
|
1619
1619
|
[is](t) {
|
|
1620
1620
|
if (t <= 0 && this.remain > 0) {
|
|
@@ -1656,20 +1656,20 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1656
1656
|
}, ri = class extends fe {
|
|
1657
1657
|
sync = !0;
|
|
1658
1658
|
[es]() {
|
|
1659
|
-
this[ii](
|
|
1659
|
+
this[ii]($.lstatSync(this.absolute));
|
|
1660
1660
|
}
|
|
1661
1661
|
[ts]() {
|
|
1662
|
-
this[ss](
|
|
1662
|
+
this[ss]($.readlinkSync(this.absolute));
|
|
1663
1663
|
}
|
|
1664
1664
|
[rs]() {
|
|
1665
|
-
this[ns](
|
|
1665
|
+
this[ns]($.openSync(this.absolute, "r"));
|
|
1666
1666
|
}
|
|
1667
1667
|
[ei]() {
|
|
1668
1668
|
let t = !0;
|
|
1669
1669
|
try {
|
|
1670
1670
|
let { fd: e, buf: i, offset: r, length: n, pos: o } = this;
|
|
1671
1671
|
if (e === void 0 || i === void 0) throw new Error("fd and buf must be set in READ method");
|
|
1672
|
-
let a =
|
|
1672
|
+
let a = $.readSync(e, i, r, n, o);
|
|
1673
1673
|
this[is](a), t = !1;
|
|
1674
1674
|
} finally {
|
|
1675
1675
|
if (t) try {
|
|
@@ -1681,7 +1681,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1681
1681
|
t();
|
|
1682
1682
|
}
|
|
1683
1683
|
[pt](t = () => {}) {
|
|
1684
|
-
this.fd !== void 0 &&
|
|
1684
|
+
this.fd !== void 0 && $.closeSync(this.fd), t();
|
|
1685
1685
|
}
|
|
1686
1686
|
}, ni = class extends A {
|
|
1687
1687
|
blockLen = 0;
|
|
@@ -1949,7 +1949,7 @@ var mi = class {
|
|
|
1949
1949
|
constructor(t, e) {
|
|
1950
1950
|
this.path = t || "./", this.absolute = e;
|
|
1951
1951
|
}
|
|
1952
|
-
}, ir = Buffer.alloc(1024), ai = Symbol("onStat"), ue = Symbol("ended"), W = Symbol("queue"), me = Symbol("pendingLinks"), Et = Symbol("current"), Ct = Symbol("process"), pe = Symbol("processing"), hi = Symbol("processJob"), G = Symbol("jobs"), hs = Symbol("jobDone"), li = Symbol("addFSEntry"), sr = Symbol("addTarEntry"), cs = Symbol("stat"), fs
|
|
1952
|
+
}, ir = Buffer.alloc(1024), ai = Symbol("onStat"), ue = Symbol("ended"), W = Symbol("queue"), me = Symbol("pendingLinks"), Et = Symbol("current"), Ct = Symbol("process"), pe = Symbol("processing"), hi = Symbol("processJob"), G = Symbol("jobs"), hs = Symbol("jobDone"), li = Symbol("addFSEntry"), sr = Symbol("addTarEntry"), cs = Symbol("stat"), fs = Symbol("readdir"), ci = Symbol("onreaddir"), fi = Symbol("pipe"), rr = Symbol("entry"), as = Symbol("entryOpt"), di = Symbol("writeEntryClass"), or = Symbol("write"), ls = Symbol("ondrain"), wt = class extends A {
|
|
1953
1953
|
sync = !1;
|
|
1954
1954
|
opt;
|
|
1955
1955
|
cwd;
|
|
@@ -2000,7 +2000,7 @@ var mi = class {
|
|
|
2000
2000
|
return typeof t == "string" ? this[li](t) : this[sr](t), this.flowing;
|
|
2001
2001
|
}
|
|
2002
2002
|
[sr](t) {
|
|
2003
|
-
let e = f(
|
|
2003
|
+
let e = f(nr.resolve(this.cwd, t.path));
|
|
2004
2004
|
if (!this.filter(t.path, t)) t.resume();
|
|
2005
2005
|
else {
|
|
2006
2006
|
let i = new mi(t.path, e);
|
|
@@ -2009,12 +2009,12 @@ var mi = class {
|
|
|
2009
2009
|
this[Ct]();
|
|
2010
2010
|
}
|
|
2011
2011
|
[li](t) {
|
|
2012
|
-
let e = f(
|
|
2012
|
+
let e = f(nr.resolve(this.cwd, t));
|
|
2013
2013
|
this[W].push(new mi(t, e)), this[Ct]();
|
|
2014
2014
|
}
|
|
2015
2015
|
[cs](t) {
|
|
2016
2016
|
t.pending = !0, this[G] += 1;
|
|
2017
|
-
|
|
2017
|
+
$[this.follow ? "stat" : "lstat"](t.absolute, (i, r) => {
|
|
2018
2018
|
t.pending = !1, this[G] -= 1, i ? this.emit("error", i) : this[ai](t, r);
|
|
2019
2019
|
});
|
|
2020
2020
|
}
|
|
@@ -2027,8 +2027,8 @@ var mi = class {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
this[Ct]();
|
|
2029
2029
|
}
|
|
2030
|
-
[fs
|
|
2031
|
-
t.pending = !0, this[G] += 1,
|
|
2030
|
+
[fs](t) {
|
|
2031
|
+
t.pending = !0, this[G] += 1, $.readdir(t.absolute, (e, i) => {
|
|
2032
2032
|
if (t.pending = !1, this[G] -= 1, e) return this.emit("error", e);
|
|
2033
2033
|
this[ci](t, i);
|
|
2034
2034
|
});
|
|
@@ -2074,7 +2074,7 @@ var mi = class {
|
|
|
2074
2074
|
if (t.stat && !t.ignore) {
|
|
2075
2075
|
if (!this.noDirRecurse && t.stat.isDirectory() && !t.readdir) {
|
|
2076
2076
|
let e = this.readdirCache.get(t.absolute);
|
|
2077
|
-
if (e ? this[ci](t, e) : this[fs
|
|
2077
|
+
if (e ? this[ci](t, e) : this[fs](t), !t.readdir) return;
|
|
2078
2078
|
}
|
|
2079
2079
|
if (t.entry = this[rr](t), !t.entry) {
|
|
2080
2080
|
t.ignore = !0;
|
|
@@ -2141,10 +2141,10 @@ var mi = class {
|
|
|
2141
2141
|
resume() {}
|
|
2142
2142
|
[cs](t) {
|
|
2143
2143
|
let e = this.follow ? "statSync" : "lstatSync";
|
|
2144
|
-
this[ai](t,
|
|
2144
|
+
this[ai](t, $[e](t.absolute));
|
|
2145
2145
|
}
|
|
2146
|
-
[fs
|
|
2147
|
-
this[ci](t,
|
|
2146
|
+
[fs](t) {
|
|
2147
|
+
this[ci](t, $.readdirSync(t.absolute));
|
|
2148
2148
|
}
|
|
2149
2149
|
[fi](t) {
|
|
2150
2150
|
let e = t.entry, i = this.zip;
|
|
@@ -2171,7 +2171,7 @@ var mi = class {
|
|
|
2171
2171
|
}, ar = (s, t) => {
|
|
2172
2172
|
t.forEach((e) => {
|
|
2173
2173
|
e.charAt(0) === "@" ? Ft({
|
|
2174
|
-
file: path
|
|
2174
|
+
file: path.resolve(s.cwd, e.slice(1)),
|
|
2175
2175
|
sync: !0,
|
|
2176
2176
|
noResume: !0,
|
|
2177
2177
|
onReadEntry: (i) => s.add(i)
|
|
@@ -2179,7 +2179,7 @@ var mi = class {
|
|
|
2179
2179
|
}), s.end();
|
|
2180
2180
|
}, lr = async (s, t) => {
|
|
2181
2181
|
for (let e of t) e.charAt(0) === "@" ? await Ft({
|
|
2182
|
-
file: path
|
|
2182
|
+
file: path.resolve(String(s.cwd), e.slice(1)),
|
|
2183
2183
|
noResume: !0,
|
|
2184
2184
|
onReadEntry: (i) => {
|
|
2185
2185
|
s.add(i);
|
|
@@ -2196,25 +2196,25 @@ var mi = class {
|
|
|
2196
2196
|
K(Wn, Gn, Zn, Yn, (s, t) => {
|
|
2197
2197
|
if (!t?.length) throw new TypeError("no paths specified to add to archive");
|
|
2198
2198
|
});
|
|
2199
|
-
var ur = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", { O_CREAT: mr, O_NOFOLLOW: cr, O_TRUNC: pr, O_WRONLY: Er } =
|
|
2199
|
+
var ur = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", { O_CREAT: mr, O_NOFOLLOW: cr, O_TRUNC: pr, O_WRONLY: Er } = $.constants, wr = Number(process.env.__FAKE_FS_O_FILENAME__) || $.constants.UV_FS_O_FILEMAP || 0, $n = ur && !!wr, Xn = 512 * 1024, qn = wr | pr | mr | Er, fr = !ur && typeof cr == "number" ? cr | pr | mr | Er : null, ds = fr !== null ? () => fr : $n ? (s) => s < Xn ? qn : "w" : () => "w";
|
|
2200
2200
|
var us = (s, t, e) => {
|
|
2201
2201
|
try {
|
|
2202
|
-
return
|
|
2202
|
+
return Ei.lchownSync(s, t, e);
|
|
2203
2203
|
} catch (i) {
|
|
2204
2204
|
if (i?.code !== "ENOENT") throw i;
|
|
2205
2205
|
}
|
|
2206
2206
|
}, pi = (s, t, e, i) => {
|
|
2207
|
-
|
|
2207
|
+
Ei.lchown(s, t, e, (r) => {
|
|
2208
2208
|
i(r && r?.code !== "ENOENT" ? r : null);
|
|
2209
2209
|
});
|
|
2210
2210
|
}, Qn = (s, t, e, i, r) => {
|
|
2211
|
-
if (t.isDirectory()) ms(path
|
|
2211
|
+
if (t.isDirectory()) ms(path.resolve(s, t.name), e, i, (n) => {
|
|
2212
2212
|
if (n) return r(n);
|
|
2213
|
-
pi(path
|
|
2213
|
+
pi(path.resolve(s, t.name), e, i, r);
|
|
2214
2214
|
});
|
|
2215
|
-
else pi(path
|
|
2215
|
+
else pi(path.resolve(s, t.name), e, i, r);
|
|
2216
2216
|
}, ms = (s, t, e, i) => {
|
|
2217
|
-
|
|
2217
|
+
Ei.readdir(s, { withFileTypes: !0 }, (r, n) => {
|
|
2218
2218
|
if (r) {
|
|
2219
2219
|
if (r.code === "ENOENT") return i();
|
|
2220
2220
|
if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
|
|
@@ -2229,11 +2229,11 @@ var us = (s, t, e) => {
|
|
|
2229
2229
|
for (let l of n) Qn(s, l, t, e, h);
|
|
2230
2230
|
});
|
|
2231
2231
|
}, Jn = (s, t, e, i) => {
|
|
2232
|
-
t.isDirectory() && ps(path
|
|
2232
|
+
t.isDirectory() && ps(path.resolve(s, t.name), e, i), us(path.resolve(s, t.name), e, i);
|
|
2233
2233
|
}, ps = (s, t, e) => {
|
|
2234
2234
|
let i;
|
|
2235
2235
|
try {
|
|
2236
|
-
i =
|
|
2236
|
+
i = Ei.readdirSync(s, { withFileTypes: !0 });
|
|
2237
2237
|
} catch (r) {
|
|
2238
2238
|
let n = r;
|
|
2239
2239
|
if (n?.code === "ENOENT") return;
|
|
@@ -2267,31 +2267,31 @@ var St = class extends Error {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
};
|
|
2269
2269
|
var to = (s, t) => {
|
|
2270
|
-
|
|
2270
|
+
Ei.stat(s, (e, i) => {
|
|
2271
2271
|
(e || !i.isDirectory()) && (e = new we(s, e?.code || "ENOTDIR")), t(e);
|
|
2272
2272
|
});
|
|
2273
2273
|
}, Sr = (s, t, e) => {
|
|
2274
2274
|
s = f(s);
|
|
2275
2275
|
let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, a = t.gid, h = typeof o == "number" && typeof a == "number" && (o !== t.processUid || a !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
|
|
2276
|
-
E ? e(E) : x && h ? ms(x, o, a, (xe) => S(xe)) : n ?
|
|
2276
|
+
E ? e(E) : x && h ? ms(x, o, a, (xe) => S(xe)) : n ? Ei.chmod(s, r, e) : e();
|
|
2277
2277
|
};
|
|
2278
2278
|
if (s === d) return to(s, S);
|
|
2279
2279
|
if (l) return jn.mkdir(s, {
|
|
2280
2280
|
mode: r,
|
|
2281
2281
|
recursive: !0
|
|
2282
2282
|
}).then((E) => S(null, E ?? void 0), S);
|
|
2283
|
-
Es(d, f(path
|
|
2283
|
+
Es(d, f(path.relative(d, s)).split("/"), r, c, d, void 0, S);
|
|
2284
2284
|
}, Es = (s, t, e, i, r, n, o) => {
|
|
2285
2285
|
if (t.length === 0) return o(null, n);
|
|
2286
|
-
let a = t.shift(), h = f(path
|
|
2287
|
-
|
|
2286
|
+
let a = t.shift(), h = f(path.resolve(s + "/" + a));
|
|
2287
|
+
Ei.mkdir(h, e, yr(h, t, e, i, r, n, o));
|
|
2288
2288
|
}, yr = (s, t, e, i, r, n, o) => (a) => {
|
|
2289
|
-
a ?
|
|
2289
|
+
a ? Ei.lstat(s, (h, l) => {
|
|
2290
2290
|
if (h) h.path = h.path && f(h.path), o(h);
|
|
2291
2291
|
else if (l.isDirectory()) Es(s, t, e, i, r, n, o);
|
|
2292
|
-
else if (i)
|
|
2292
|
+
else if (i) Ei.unlink(s, (c) => {
|
|
2293
2293
|
if (c) return o(c);
|
|
2294
|
-
|
|
2294
|
+
Ei.mkdir(s, e, yr(s, t, e, i, r, n, o));
|
|
2295
2295
|
});
|
|
2296
2296
|
else {
|
|
2297
2297
|
if (l.isSymbolicLink()) return o(new St(s, s + "/" + t.join("/")));
|
|
@@ -2301,7 +2301,7 @@ var to = (s, t) => {
|
|
|
2301
2301
|
}, eo = (s) => {
|
|
2302
2302
|
let t = !1, e;
|
|
2303
2303
|
try {
|
|
2304
|
-
t =
|
|
2304
|
+
t = Ei.statSync(s).isDirectory();
|
|
2305
2305
|
} catch (i) {
|
|
2306
2306
|
e = i?.code;
|
|
2307
2307
|
} finally {
|
|
@@ -2310,23 +2310,23 @@ var to = (s, t) => {
|
|
|
2310
2310
|
}, Rr = (s, t) => {
|
|
2311
2311
|
s = f(s);
|
|
2312
2312
|
let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, a = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), h = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
|
|
2313
|
-
E && a && ps(E, n, o), r &&
|
|
2313
|
+
E && a && ps(E, n, o), r && Ei.chmodSync(s, i);
|
|
2314
2314
|
};
|
|
2315
2315
|
if (s === c) return eo(c), d();
|
|
2316
|
-
if (h) return d(
|
|
2316
|
+
if (h) return d(Ei.mkdirSync(s, {
|
|
2317
2317
|
mode: i,
|
|
2318
2318
|
recursive: !0
|
|
2319
2319
|
}) ?? void 0);
|
|
2320
|
-
let T = f(path
|
|
2320
|
+
let T = f(path.relative(c, s)).split("/"), N;
|
|
2321
2321
|
for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
|
|
2322
|
-
x = f(path
|
|
2322
|
+
x = f(path.resolve(x));
|
|
2323
2323
|
try {
|
|
2324
|
-
|
|
2324
|
+
Ei.mkdirSync(x, i), N = N || x;
|
|
2325
2325
|
} catch {
|
|
2326
|
-
let xe =
|
|
2326
|
+
let xe = Ei.lstatSync(x);
|
|
2327
2327
|
if (xe.isDirectory()) continue;
|
|
2328
2328
|
if (l) {
|
|
2329
|
-
|
|
2329
|
+
Ei.unlinkSync(x), Ei.mkdirSync(x, i), N = N || x;
|
|
2330
2330
|
continue;
|
|
2331
2331
|
} else if (xe.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
|
|
2332
2332
|
}
|
|
@@ -2361,10 +2361,10 @@ var so = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32"
|
|
|
2361
2361
|
}
|
|
2362
2362
|
for (let r of i) {
|
|
2363
2363
|
let n = this.#t.get(r);
|
|
2364
|
-
if (!n) this.#t.set(r, [new Set([e])]);
|
|
2364
|
+
if (!n) this.#t.set(r, [/* @__PURE__ */ new Set([e])]);
|
|
2365
2365
|
else {
|
|
2366
2366
|
let o = n.at(-1);
|
|
2367
|
-
o instanceof Set ? o.add(e) : n.push(new Set([e]));
|
|
2367
|
+
o instanceof Set ? o.add(e) : n.push(/* @__PURE__ */ new Set([e]));
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
return this.#r(e);
|
|
@@ -2416,16 +2416,16 @@ var so = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32"
|
|
|
2416
2416
|
};
|
|
2417
2417
|
var Or = () => process.umask();
|
|
2418
2418
|
var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs = Symbol("isReusable"), P = Symbol("makeFs"), _s = Symbol("file"), Os = Symbol("directory"), Ri = Symbol("link"), Lr = Symbol("symlink"), Nr = Symbol("hardlink"), ye = Symbol("ensureNoSymlink"), Dr = Symbol("unsupported"), Ar = Symbol("checkPath"), Ss = Symbol("stripAbsolutePath"), yt = Symbol("mkdir"), O = Symbol("onError"), yi = Symbol("pending"), Ir = Symbol("pend"), $t = Symbol("unpend"), ys = Symbol("ended"), Rs = Symbol("maybeClose"), Ts = Symbol("skip"), Re = Symbol("doChown"), ge = Symbol("uid"), be = Symbol("gid"), _e = Symbol("checkedCwd"), Oe = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", ho = 1024, ao = (s, t) => {
|
|
2419
|
-
if (!Oe) return
|
|
2419
|
+
if (!Oe) return Ei.unlink(s, t);
|
|
2420
2420
|
let e = s + ".DELETE." + randomBytes(16).toString("hex");
|
|
2421
|
-
|
|
2421
|
+
Ei.rename(s, e, (i) => {
|
|
2422
2422
|
if (i) return t(i);
|
|
2423
|
-
|
|
2423
|
+
Ei.unlink(e, t);
|
|
2424
2424
|
});
|
|
2425
2425
|
}, lo = (s) => {
|
|
2426
|
-
if (!Oe) return
|
|
2426
|
+
if (!Oe) return Ei.unlinkSync(s);
|
|
2427
2427
|
let t = s + ".DELETE." + randomBytes(16).toString("hex");
|
|
2428
|
-
|
|
2428
|
+
Ei.renameSync(s, t), Ei.unlinkSync(t);
|
|
2429
2429
|
}, Fr = (s, t, e) => s !== void 0 && s === s >>> 0 ? s : t !== void 0 && t === t >>> 0 ? t : e, Xt = class extends st {
|
|
2430
2430
|
[ys] = !1;
|
|
2431
2431
|
[_e] = !1;
|
|
@@ -2463,7 +2463,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2463
2463
|
if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
2464
2464
|
this.uid = t.uid, this.gid = t.gid, this.setOwner = !0;
|
|
2465
2465
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = !1;
|
|
2466
|
-
this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t.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 t.maxDepth == "number" ? t.maxDepth : ho, this.forceChown = t.forceChown === !0, this.win32 = !!t.win32 || Oe, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(path
|
|
2466
|
+
this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t.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 t.maxDepth == "number" ? t.maxDepth : ho, this.forceChown = t.forceChown === !0, this.win32 = !!t.win32 || Oe, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(path.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : Or() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Tr](e));
|
|
2467
2467
|
}
|
|
2468
2468
|
warn(t, e, i = {}) {
|
|
2469
2469
|
return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = !1), super.warn(t, e, i);
|
|
@@ -2480,7 +2480,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2480
2480
|
entry: t,
|
|
2481
2481
|
[e]: i
|
|
2482
2482
|
}), !1;
|
|
2483
|
-
let h = path
|
|
2483
|
+
let h = path.posix.dirname(t.path), l = path.posix.normalize(path.posix.join(h, a.join("/")));
|
|
2484
2484
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, {
|
|
2485
2485
|
entry: t,
|
|
2486
2486
|
[e]: i
|
|
@@ -2509,7 +2509,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2509
2509
|
maxDepth: this.maxDepth
|
|
2510
2510
|
}), !1;
|
|
2511
2511
|
if (!this[Ss](t, "path") || !this[Ss](t, "linkpath")) return !1;
|
|
2512
|
-
if (t.absolute = path
|
|
2512
|
+
if (t.absolute = path.isAbsolute(t.path) ? f(path.resolve(t.path)) : f(path.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", {
|
|
2513
2513
|
entry: t,
|
|
2514
2514
|
path: f(t.path),
|
|
2515
2515
|
resolvedPath: t.absolute,
|
|
@@ -2517,9 +2517,9 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2517
2517
|
}), !1;
|
|
2518
2518
|
if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return !1;
|
|
2519
2519
|
if (this.win32) {
|
|
2520
|
-
let { root: r } = path
|
|
2520
|
+
let { root: r } = path.win32.parse(String(t.absolute));
|
|
2521
2521
|
t.absolute = r + Ji(String(t.absolute).slice(r.length));
|
|
2522
|
-
let { root: n } = path
|
|
2522
|
+
let { root: n } = path.win32.parse(t.path);
|
|
2523
2523
|
t.path = n + Ji(t.path.slice(n.length));
|
|
2524
2524
|
}
|
|
2525
2525
|
return !0;
|
|
@@ -2569,14 +2569,14 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2569
2569
|
autoClose: !1
|
|
2570
2570
|
});
|
|
2571
2571
|
r.on("error", (h) => {
|
|
2572
|
-
r.fd &&
|
|
2572
|
+
r.fd && Ei.close(r.fd, () => {}), r.write = () => !0, this[O](h, t), e();
|
|
2573
2573
|
});
|
|
2574
2574
|
let n = 1, o = (h) => {
|
|
2575
2575
|
if (h) {
|
|
2576
|
-
r.fd &&
|
|
2576
|
+
r.fd && Ei.close(r.fd, () => {}), this[O](h, t), e();
|
|
2577
2577
|
return;
|
|
2578
2578
|
}
|
|
2579
|
-
--n === 0 && r.fd !== void 0 &&
|
|
2579
|
+
--n === 0 && r.fd !== void 0 && Ei.close(r.fd, (l) => {
|
|
2580
2580
|
l ? this[O](l, t) : this[$t](), e();
|
|
2581
2581
|
});
|
|
2582
2582
|
};
|
|
@@ -2585,12 +2585,12 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2585
2585
|
if (typeof l == "number" && t.mtime && !this.noMtime) {
|
|
2586
2586
|
n++;
|
|
2587
2587
|
let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
|
|
2588
|
-
|
|
2588
|
+
Ei.futimes(l, c, d, (S) => S ? Ei.utimes(h, c, d, (T) => o(T && S)) : o());
|
|
2589
2589
|
}
|
|
2590
2590
|
if (typeof l == "number" && this[Re](t)) {
|
|
2591
2591
|
n++;
|
|
2592
2592
|
let c = this[ge](t), d = this[be](t);
|
|
2593
|
-
typeof c == "number" && typeof d == "number" &&
|
|
2593
|
+
typeof c == "number" && typeof d == "number" && Ei.fchown(l, c, d, (S) => S ? Ei.chown(h, c, d, (T) => o(T && S)) : o());
|
|
2594
2594
|
}
|
|
2595
2595
|
o();
|
|
2596
2596
|
});
|
|
@@ -2609,20 +2609,20 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2609
2609
|
let n = 1, o = () => {
|
|
2610
2610
|
--n === 0 && (e(), this[$t](), t.resume());
|
|
2611
2611
|
};
|
|
2612
|
-
t.mtime && !this.noMtime && (n++,
|
|
2612
|
+
t.mtime && !this.noMtime && (n++, Ei.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[Re](t) && (n++, Ei.chown(String(t.absolute), Number(this[ge](t)), Number(this[be](t)), o)), o();
|
|
2613
2613
|
});
|
|
2614
2614
|
}
|
|
2615
2615
|
[Dr](t) {
|
|
2616
2616
|
t.unsupported = !0, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
|
|
2617
2617
|
}
|
|
2618
2618
|
[Lr](t, e) {
|
|
2619
|
-
let i = f(path
|
|
2619
|
+
let i = f(path.relative(this.cwd, path.resolve(path.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
|
|
2620
2620
|
this[ye](t, this.cwd, i, () => this[Ri](t, String(t.linkpath), "symlink", e), (r) => {
|
|
2621
2621
|
this[O](r, t), e();
|
|
2622
2622
|
});
|
|
2623
2623
|
}
|
|
2624
2624
|
[Nr](t, e) {
|
|
2625
|
-
let i = f(path
|
|
2625
|
+
let i = f(path.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
|
|
2626
2626
|
this[ye](t, this.cwd, r, () => this[Ri](t, i, "link", e), (n) => {
|
|
2627
2627
|
this[O](n, t), e();
|
|
2628
2628
|
});
|
|
@@ -2630,10 +2630,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2630
2630
|
[ye](t, e, i, r, n) {
|
|
2631
2631
|
let o = i.shift();
|
|
2632
2632
|
if (this.preservePaths || o === void 0) return r();
|
|
2633
|
-
let a = path
|
|
2634
|
-
|
|
2633
|
+
let a = path.resolve(e, o);
|
|
2634
|
+
Ei.lstat(a, (h, l) => {
|
|
2635
2635
|
if (h) return r();
|
|
2636
|
-
if (l?.isSymbolicLink()) return n(new St(a, path
|
|
2636
|
+
if (l?.isSymbolicLink()) return n(new St(a, path.resolve(a, i.join("/"))));
|
|
2637
2637
|
this[ye](t, a, i, r, n);
|
|
2638
2638
|
});
|
|
2639
2639
|
}
|
|
@@ -2667,7 +2667,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2667
2667
|
});
|
|
2668
2668
|
}, n = () => {
|
|
2669
2669
|
if (t.absolute !== this.cwd) {
|
|
2670
|
-
let a = f(path
|
|
2670
|
+
let a = f(path.dirname(String(t.absolute)));
|
|
2671
2671
|
if (a !== this.cwd) return this[yt](a, this.dmode, (h) => {
|
|
2672
2672
|
if (h) {
|
|
2673
2673
|
this[O](h, t), i();
|
|
@@ -2678,7 +2678,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2678
2678
|
}
|
|
2679
2679
|
o();
|
|
2680
2680
|
}, o = () => {
|
|
2681
|
-
|
|
2681
|
+
Ei.lstat(String(t.absolute), (a, h) => {
|
|
2682
2682
|
if (h && (this.keep || this.newer && h.mtime > (t.mtime ?? h.mtime))) {
|
|
2683
2683
|
this[Ts](t), i();
|
|
2684
2684
|
return;
|
|
@@ -2687,9 +2687,9 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2687
2687
|
if (h.isDirectory()) {
|
|
2688
2688
|
if (t.type === "Directory") {
|
|
2689
2689
|
let l = this.chmod && t.mode && (h.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
|
|
2690
|
-
return l ?
|
|
2690
|
+
return l ? Ei.chmod(String(t.absolute), Number(t.mode), c) : c();
|
|
2691
2691
|
}
|
|
2692
|
-
if (t.absolute !== this.cwd) return
|
|
2692
|
+
if (t.absolute !== this.cwd) return Ei.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
2693
2693
|
}
|
|
2694
2694
|
if (t.absolute === this.cwd) return this[P](null, t, i);
|
|
2695
2695
|
ao(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
@@ -2713,7 +2713,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
[Ri](t, e, i, r) {
|
|
2716
|
-
|
|
2716
|
+
Ei[i](e, String(t.absolute), (n) => {
|
|
2717
2717
|
n ? this[O](n, t) : (this[$t](), t.resume()), r();
|
|
2718
2718
|
});
|
|
2719
2719
|
}
|
|
@@ -2735,23 +2735,23 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2735
2735
|
this[_e] = !0;
|
|
2736
2736
|
}
|
|
2737
2737
|
if (t.absolute !== this.cwd) {
|
|
2738
|
-
let n = f(path
|
|
2738
|
+
let n = f(path.dirname(String(t.absolute)));
|
|
2739
2739
|
if (n !== this.cwd) {
|
|
2740
2740
|
let o = this[yt](n, this.dmode);
|
|
2741
2741
|
if (o) return this[O](o, t);
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
|
-
let [e, i] = Se(() =>
|
|
2744
|
+
let [e, i] = Se(() => Ei.lstatSync(String(t.absolute)));
|
|
2745
2745
|
if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ts](t);
|
|
2746
2746
|
if (e || this[bs](t, i)) return this[P](null, t);
|
|
2747
2747
|
if (i.isDirectory()) {
|
|
2748
2748
|
if (t.type === "Directory") {
|
|
2749
2749
|
let [a] = this.chmod && t.mode && (i.mode & 4095) !== t.mode ? Se(() => {
|
|
2750
|
-
|
|
2750
|
+
Ei.chmodSync(String(t.absolute), Number(t.mode));
|
|
2751
2751
|
}) : [];
|
|
2752
2752
|
return this[P](a, t);
|
|
2753
2753
|
}
|
|
2754
|
-
let [n] = Se(() =>
|
|
2754
|
+
let [n] = Se(() => Ei.rmdirSync(String(t.absolute)));
|
|
2755
2755
|
this[P](n, t);
|
|
2756
2756
|
}
|
|
2757
2757
|
let [r] = t.absolute === this.cwd ? [] : Se(() => lo(String(t.absolute)));
|
|
@@ -2761,21 +2761,21 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2761
2761
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (a) => {
|
|
2762
2762
|
let h;
|
|
2763
2763
|
try {
|
|
2764
|
-
|
|
2764
|
+
Ei.closeSync(n);
|
|
2765
2765
|
} catch (l) {
|
|
2766
2766
|
h = l;
|
|
2767
2767
|
}
|
|
2768
2768
|
(a || h) && this[O](a || h, t), e();
|
|
2769
2769
|
}, n;
|
|
2770
2770
|
try {
|
|
2771
|
-
n =
|
|
2771
|
+
n = Ei.openSync(String(t.absolute), ds(t.size), i);
|
|
2772
2772
|
} catch (a) {
|
|
2773
2773
|
return r(a);
|
|
2774
2774
|
}
|
|
2775
2775
|
let o = this.transform && this.transform(t) || t;
|
|
2776
2776
|
o !== t && (o.on("error", (a) => this[O](a, t)), t.pipe(o)), o.on("data", (a) => {
|
|
2777
2777
|
try {
|
|
2778
|
-
|
|
2778
|
+
Ei.writeSync(n, a, 0, a.length);
|
|
2779
2779
|
} catch (h) {
|
|
2780
2780
|
r(h);
|
|
2781
2781
|
}
|
|
@@ -2784,10 +2784,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2784
2784
|
if (t.mtime && !this.noMtime) {
|
|
2785
2785
|
let h = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
|
|
2786
2786
|
try {
|
|
2787
|
-
|
|
2787
|
+
Ei.futimesSync(n, h, l);
|
|
2788
2788
|
} catch (c) {
|
|
2789
2789
|
try {
|
|
2790
|
-
|
|
2790
|
+
Ei.utimesSync(String(t.absolute), h, l);
|
|
2791
2791
|
} catch {
|
|
2792
2792
|
a = c;
|
|
2793
2793
|
}
|
|
@@ -2796,10 +2796,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2796
2796
|
if (this[Re](t)) {
|
|
2797
2797
|
let h = this[ge](t), l = this[be](t);
|
|
2798
2798
|
try {
|
|
2799
|
-
|
|
2799
|
+
Ei.fchownSync(n, Number(h), Number(l));
|
|
2800
2800
|
} catch (c) {
|
|
2801
2801
|
try {
|
|
2802
|
-
|
|
2802
|
+
Ei.chownSync(String(t.absolute), Number(h), Number(l));
|
|
2803
2803
|
} catch {
|
|
2804
2804
|
a = a || c;
|
|
2805
2805
|
}
|
|
@@ -2815,10 +2815,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2815
2815
|
return;
|
|
2816
2816
|
}
|
|
2817
2817
|
if (t.mtime && !this.noMtime) try {
|
|
2818
|
-
|
|
2818
|
+
Ei.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
|
|
2819
2819
|
} catch {}
|
|
2820
2820
|
if (this[Re](t)) try {
|
|
2821
|
-
|
|
2821
|
+
Ei.chownSync(String(t.absolute), Number(this[ge](t)), Number(this[be](t)));
|
|
2822
2822
|
} catch {}
|
|
2823
2823
|
e(), t.resume();
|
|
2824
2824
|
}
|
|
@@ -2843,24 +2843,24 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
2843
2843
|
if (this.preservePaths || i.length === 0) return r();
|
|
2844
2844
|
let o = e;
|
|
2845
2845
|
for (let a of i) {
|
|
2846
|
-
o = path
|
|
2847
|
-
let [h, l] = Se(() =>
|
|
2846
|
+
o = path.resolve(o, a);
|
|
2847
|
+
let [h, l] = Se(() => Ei.lstatSync(o));
|
|
2848
2848
|
if (h) return r();
|
|
2849
|
-
if (l.isSymbolicLink()) return n(new St(o, path
|
|
2849
|
+
if (l.isSymbolicLink()) return n(new St(o, path.resolve(e, i.join("/"))));
|
|
2850
2850
|
}
|
|
2851
2851
|
r();
|
|
2852
2852
|
}
|
|
2853
2853
|
[Ri](t, e, i, r) {
|
|
2854
2854
|
let n = `${i}Sync`;
|
|
2855
2855
|
try {
|
|
2856
|
-
|
|
2856
|
+
Ei[n](e, String(t.absolute)), r(), t.resume();
|
|
2857
2857
|
} catch (o) {
|
|
2858
2858
|
return this[O](o, t);
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
};
|
|
2862
2862
|
var co = (s) => {
|
|
2863
|
-
let t = new Te(s), e = s.file, i =
|
|
2863
|
+
let t = new Te(s), e = s.file, i = Ei.statSync(e);
|
|
2864
2864
|
new Me(e, {
|
|
2865
2865
|
readSize: s.maxReadSize || 16 * 1024 * 1024,
|
|
2866
2866
|
size: i.size
|
|
@@ -2868,7 +2868,7 @@ var co = (s) => {
|
|
|
2868
2868
|
}, fo = (s, t) => {
|
|
2869
2869
|
let e = new Xt(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
|
|
2870
2870
|
return new Promise((o, a) => {
|
|
2871
|
-
e.on("error", a), e.on("close", o),
|
|
2871
|
+
e.on("error", a), e.on("close", o), Ei.stat(r, (h, l) => {
|
|
2872
2872
|
if (h) a(h);
|
|
2873
2873
|
else {
|
|
2874
2874
|
let c = new _t(r, {
|
|
@@ -2886,15 +2886,15 @@ var mo = (s, t) => {
|
|
|
2886
2886
|
let e = new kt(s), i = !0, r, n;
|
|
2887
2887
|
try {
|
|
2888
2888
|
try {
|
|
2889
|
-
r =
|
|
2889
|
+
r = Ei.openSync(s.file, "r+");
|
|
2890
2890
|
} catch (h) {
|
|
2891
|
-
if (h?.code === "ENOENT") r =
|
|
2891
|
+
if (h?.code === "ENOENT") r = Ei.openSync(s.file, "w+");
|
|
2892
2892
|
else throw h;
|
|
2893
2893
|
}
|
|
2894
|
-
let o =
|
|
2894
|
+
let o = Ei.fstatSync(r), a = Buffer.alloc(512);
|
|
2895
2895
|
t: for (n = 0; n < o.size; n += 512) {
|
|
2896
2896
|
for (let c = 0, d = 0; c < 512; c += d) {
|
|
2897
|
-
if (d =
|
|
2897
|
+
if (d = Ei.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");
|
|
2898
2898
|
if (!d) break t;
|
|
2899
2899
|
}
|
|
2900
2900
|
let h = new C(a);
|
|
@@ -2906,7 +2906,7 @@ var mo = (s, t) => {
|
|
|
2906
2906
|
i = !1, po(s, e, n, r, t);
|
|
2907
2907
|
} finally {
|
|
2908
2908
|
if (i) try {
|
|
2909
|
-
|
|
2909
|
+
Ei.closeSync(r);
|
|
2910
2910
|
} catch {}
|
|
2911
2911
|
}
|
|
2912
2912
|
}, po = (s, t, e, i, r) => {
|
|
@@ -2919,29 +2919,29 @@ var mo = (s, t) => {
|
|
|
2919
2919
|
t = Array.from(t);
|
|
2920
2920
|
let e = new wt(s), i = (n, o, a) => {
|
|
2921
2921
|
let h = (T, N) => {
|
|
2922
|
-
T ?
|
|
2922
|
+
T ? Ei.close(n, (E) => a(T)) : a(null, N);
|
|
2923
2923
|
}, l = 0;
|
|
2924
2924
|
if (o === 0) return h(null, 0);
|
|
2925
2925
|
let c = 0, d = Buffer.alloc(512), S = (T, N) => {
|
|
2926
2926
|
if (T || N === void 0) return h(T);
|
|
2927
|
-
if (c += N, c < 512 && N) return
|
|
2927
|
+
if (c += N, c < 512 && N) return Ei.read(n, d, c, d.length - c, l + c, S);
|
|
2928
2928
|
if (l === 0 && d[0] === 31 && d[1] === 139) return h(/* @__PURE__ */ new Error("cannot append to compressed archives"));
|
|
2929
2929
|
if (c < 512) return h(null, l);
|
|
2930
2930
|
let E = new C(d);
|
|
2931
2931
|
if (!E.cksumValid) return h(null, l);
|
|
2932
2932
|
let x = 512 * Math.ceil((E.size ?? 0) / 512);
|
|
2933
2933
|
if (l + x + 512 > o || (l += x + 512, l >= o)) return h(null, l);
|
|
2934
|
-
s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0,
|
|
2934
|
+
s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0, Ei.read(n, d, 0, 512, l, S);
|
|
2935
2935
|
};
|
|
2936
|
-
|
|
2936
|
+
Ei.read(n, d, 0, 512, l, S);
|
|
2937
2937
|
};
|
|
2938
2938
|
return new Promise((n, o) => {
|
|
2939
2939
|
e.on("error", o);
|
|
2940
2940
|
let a = "r+", h = (l, c) => {
|
|
2941
|
-
if (l && l.code === "ENOENT" && a === "r+") return a = "w+",
|
|
2941
|
+
if (l && l.code === "ENOENT" && a === "r+") return a = "w+", Ei.open(s.file, a, h);
|
|
2942
2942
|
if (l || !c) return o(l);
|
|
2943
|
-
|
|
2944
|
-
if (d) return
|
|
2943
|
+
Ei.fstat(c, (d, S) => {
|
|
2944
|
+
if (d) return Ei.close(c, () => o(d));
|
|
2945
2945
|
i(c, S.size, (T, N) => {
|
|
2946
2946
|
if (T) return o(T);
|
|
2947
2947
|
let E = new tt(s.file, {
|
|
@@ -2952,12 +2952,12 @@ var mo = (s, t) => {
|
|
|
2952
2952
|
});
|
|
2953
2953
|
});
|
|
2954
2954
|
};
|
|
2955
|
-
|
|
2955
|
+
Ei.open(s.file, a, h);
|
|
2956
2956
|
});
|
|
2957
2957
|
}, wo = (s, t) => {
|
|
2958
2958
|
t.forEach((e) => {
|
|
2959
2959
|
e.charAt(0) === "@" ? Ft({
|
|
2960
|
-
file: path
|
|
2960
|
+
file: path.resolve(s.cwd, e.slice(1)),
|
|
2961
2961
|
sync: !0,
|
|
2962
2962
|
noResume: !0,
|
|
2963
2963
|
onReadEntry: (i) => s.add(i)
|
|
@@ -2965,7 +2965,7 @@ var mo = (s, t) => {
|
|
|
2965
2965
|
}), s.end();
|
|
2966
2966
|
}, So = async (s, t) => {
|
|
2967
2967
|
for (let e of t) e.charAt(0) === "@" ? await Ft({
|
|
2968
|
-
file: path
|
|
2968
|
+
file: path.resolve(String(s.cwd), e.slice(1)),
|
|
2969
2969
|
noResume: !0,
|
|
2970
2970
|
onReadEntry: (i) => s.add(i)
|
|
2971
2971
|
}) : s.add(e);
|