@lousy-agents/mcp 5.17.15 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/316.js +604 -557
- package/dist/653.js +110 -69
- package/dist/mcp-server.js +365 -40
- package/package.json +1 -1
package/dist/316.js
CHANGED
|
@@ -36,27 +36,27 @@ var zlib__rspack_import_11_namespace_cache;
|
|
|
36
36
|
|
|
37
37
|
var ce = (0,_rolldown_runtime_mjs__rspack_import_14/* .__exportAll */.I)({
|
|
38
38
|
Header: () => I,
|
|
39
|
-
Pack: () =>
|
|
40
|
-
PackJob: () =>
|
|
41
|
-
PackSync: () =>
|
|
42
|
-
Parser: () =>
|
|
43
|
-
Pax: () =>
|
|
44
|
-
ReadEntry: () =>
|
|
45
|
-
Unpack: () =>
|
|
46
|
-
UnpackSync: () =>
|
|
47
|
-
WriteEntry: () =>
|
|
48
|
-
WriteEntrySync: () =>
|
|
49
|
-
WriteEntryTar: () =>
|
|
50
|
-
c: () =>
|
|
51
|
-
create: () =>
|
|
52
|
-
extract: () =>
|
|
53
|
-
filesFilter: () =>
|
|
54
|
-
list: () =>
|
|
55
|
-
r: () =>
|
|
56
|
-
replace: () =>
|
|
57
|
-
t: () =>
|
|
39
|
+
Pack: () => li,
|
|
40
|
+
PackJob: () => Ur,
|
|
41
|
+
PackSync: () => ui,
|
|
42
|
+
Parser: () => tr,
|
|
43
|
+
Pax: () => yn,
|
|
44
|
+
ReadEntry: () => Cn,
|
|
45
|
+
Unpack: () => wa,
|
|
46
|
+
UnpackSync: () => Ea,
|
|
47
|
+
WriteEntry: () => Pr,
|
|
48
|
+
WriteEntrySync: () => Fr,
|
|
49
|
+
WriteEntryTar: () => Ir,
|
|
50
|
+
c: () => hi,
|
|
51
|
+
create: () => hi,
|
|
52
|
+
extract: () => Da,
|
|
53
|
+
filesFilter: () => ir,
|
|
54
|
+
list: () => ar,
|
|
55
|
+
r: () => Na,
|
|
56
|
+
replace: () => Na,
|
|
57
|
+
t: () => ar,
|
|
58
58
|
types: () => Xt,
|
|
59
|
-
x: () =>
|
|
59
|
+
x: () => Da
|
|
60
60
|
}), le = Object.defineProperty, ue = (e, t) => {
|
|
61
61
|
for (var n in t) le(e, n, {
|
|
62
62
|
get: t[n],
|
|
@@ -276,7 +276,7 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
276
276
|
}
|
|
277
277
|
[De](e) {
|
|
278
278
|
for (let t of this[x]) t.dest.write(e) === !1 && this.pause();
|
|
279
|
-
let t = this[E]
|
|
279
|
+
let t = !this[E] && super.emit(`data`, e);
|
|
280
280
|
return this[g](), t;
|
|
281
281
|
}
|
|
282
282
|
[Oe]() {
|
|
@@ -384,10 +384,10 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
384
384
|
static get isStream() {
|
|
385
385
|
return fe;
|
|
386
386
|
}
|
|
387
|
-
}, We = fs__rspack_import_5.writev, D = Symbol(`_autoClose`), O = Symbol(`_close`), Ge = Symbol(`_ended`), k = Symbol(`_fd`), Ke = Symbol(`_finished`), A = Symbol(`_flags`), qe = Symbol(`_flush`), Je = Symbol(`_handleChunk`), Ye = Symbol(`_makeBuf`), Xe = Symbol(`_mode`), Ze = Symbol(`_needDrain`), Qe = Symbol(`_onerror`), $e = Symbol(`_onopen`), et = Symbol(`_onread`), tt = Symbol(`_onwrite`),
|
|
387
|
+
}, We = fs__rspack_import_5.writev, D = Symbol(`_autoClose`), O = Symbol(`_close`), Ge = Symbol(`_ended`), k = Symbol(`_fd`), Ke = Symbol(`_finished`), A = Symbol(`_flags`), qe = Symbol(`_flush`), Je = Symbol(`_handleChunk`), Ye = Symbol(`_makeBuf`), Xe = Symbol(`_mode`), Ze = Symbol(`_needDrain`), Qe = Symbol(`_onerror`), $e = Symbol(`_onopen`), et = Symbol(`_onread`), tt = Symbol(`_onwrite`), nt = Symbol(`_open`), j = Symbol(`_path`), M = Symbol(`_pos`), N = Symbol(`_queue`), rt = Symbol(`_read`), it = Symbol(`_readSize`), P = Symbol(`_reading`), at = Symbol(`_remain`), ot = Symbol(`_size`), st = Symbol(`_write`), ct = Symbol(`_writing`), lt = Symbol(`_defaultFlag`), ut = Symbol(`_errored`), dt = class extends Ue {
|
|
388
388
|
[ut] = !1;
|
|
389
389
|
[k];
|
|
390
|
-
[
|
|
390
|
+
[j];
|
|
391
391
|
[it];
|
|
392
392
|
[P] = !1;
|
|
393
393
|
[ot];
|
|
@@ -395,13 +395,13 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
395
395
|
[D];
|
|
396
396
|
constructor(e, t) {
|
|
397
397
|
if (t ||= {}, super(t), this.readable = !0, this.writable = !1, typeof e != `string`) throw TypeError(`path must be a string`);
|
|
398
|
-
this[ut] = !1, this[k] = typeof t.fd == `number` ? t.fd : void 0, this[
|
|
398
|
+
this[ut] = !1, this[k] = typeof t.fd == `number` ? t.fd : void 0, this[j] = e, this[it] = t.readSize || 16 * 1024 * 1024, this[P] = !1, this[ot] = typeof t.size == `number` ? t.size : Infinity, this[at] = this[ot], this[D] = typeof t.autoClose != `boolean` || t.autoClose, typeof this[k] == `number` ? this[rt]() : this[nt]();
|
|
399
399
|
}
|
|
400
400
|
get fd() {
|
|
401
401
|
return this[k];
|
|
402
402
|
}
|
|
403
403
|
get path() {
|
|
404
|
-
return this[
|
|
404
|
+
return this[j];
|
|
405
405
|
}
|
|
406
406
|
write() {
|
|
407
407
|
throw TypeError(`this is a readable stream`);
|
|
@@ -409,8 +409,8 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
409
409
|
end() {
|
|
410
410
|
throw TypeError(`this is a readable stream`);
|
|
411
411
|
}
|
|
412
|
-
[
|
|
413
|
-
fs__rspack_import_5.open(this[
|
|
412
|
+
[nt]() {
|
|
413
|
+
fs__rspack_import_5.open(this[j], `r`, (e, t) => this[$e](e, t));
|
|
414
414
|
}
|
|
415
415
|
[$e](e, t) {
|
|
416
416
|
e ? this[Qe](e) : (this[k] = t, this.emit(`open`, t), this[rt]());
|
|
@@ -452,10 +452,10 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}, ft = class extends dt {
|
|
455
|
-
[
|
|
455
|
+
[nt]() {
|
|
456
456
|
let e = !0;
|
|
457
457
|
try {
|
|
458
|
-
this[$e](null, fs__rspack_import_5.openSync(this[
|
|
458
|
+
this[$e](null, fs__rspack_import_5.openSync(this[j], `r`)), e = !1;
|
|
459
459
|
} finally {
|
|
460
460
|
e && this[O]();
|
|
461
461
|
}
|
|
@@ -490,18 +490,18 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
490
490
|
[Ge] = !1;
|
|
491
491
|
[N] = [];
|
|
492
492
|
[Ze] = !1;
|
|
493
|
-
[
|
|
493
|
+
[j];
|
|
494
494
|
[Xe];
|
|
495
495
|
[D];
|
|
496
496
|
[k];
|
|
497
497
|
[lt];
|
|
498
498
|
[A];
|
|
499
499
|
[Ke] = !1;
|
|
500
|
-
[
|
|
500
|
+
[M];
|
|
501
501
|
constructor(e, t) {
|
|
502
|
-
t ||= {}, super(t), this[
|
|
503
|
-
let n = this[
|
|
504
|
-
this[lt] = t.flags === void 0, this[A] = t.flags === void 0 ? n : t.flags, this[k] === void 0 && this[
|
|
502
|
+
t ||= {}, super(t), this[j] = e, this[k] = typeof t.fd == `number` ? t.fd : void 0, this[Xe] = t.mode === void 0 ? 438 : t.mode, this[M] = typeof t.start == `number` ? t.start : void 0, this[D] = typeof t.autoClose != `boolean` || t.autoClose;
|
|
503
|
+
let n = this[M] === void 0 ? `w` : `r+`;
|
|
504
|
+
this[lt] = t.flags === void 0, this[A] = t.flags === void 0 ? n : t.flags, this[k] === void 0 && this[nt]();
|
|
505
505
|
}
|
|
506
506
|
emit(e, ...t) {
|
|
507
507
|
if (e === `error`) {
|
|
@@ -514,16 +514,16 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
514
514
|
return this[k];
|
|
515
515
|
}
|
|
516
516
|
get path() {
|
|
517
|
-
return this[
|
|
517
|
+
return this[j];
|
|
518
518
|
}
|
|
519
519
|
[Qe](e) {
|
|
520
520
|
this[O](), this[ct] = !0, this.emit(`error`, e);
|
|
521
521
|
}
|
|
522
|
-
[
|
|
523
|
-
fs__rspack_import_5.open(this[
|
|
522
|
+
[nt]() {
|
|
523
|
+
fs__rspack_import_5.open(this[j], this[A], this[Xe], (e, t) => this[$e](e, t));
|
|
524
524
|
}
|
|
525
525
|
[$e](e, t) {
|
|
526
|
-
this[lt] && this[A] === `r+` && e && e.code === `ENOENT` ? (this[A] = `w`, this[
|
|
526
|
+
this[lt] && this[A] === `r+` && e && e.code === `ENOENT` ? (this[A] = `w`, this[nt]()) : e ? this[Qe](e) : (this[k] = t, this.emit(`open`, t), this[ct] || this[qe]());
|
|
527
527
|
}
|
|
528
528
|
end(e, t) {
|
|
529
529
|
return e && this.write(e, t), this[Ge] = !0, !this[ct] && !this[N].length && typeof this[k] == `number` && this[tt](null, 0), this;
|
|
@@ -532,17 +532,17 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
532
532
|
return typeof e == `string` && (e = Buffer.from(e, t)), this[Ge] ? (this.emit(`error`, Error(`write() after end()`)), !1) : this[k] === void 0 || this[ct] || this[N].length ? (this[N].push(e), this[Ze] = !0, !1) : (this[ct] = !0, this[st](e), !0);
|
|
533
533
|
}
|
|
534
534
|
[st](e) {
|
|
535
|
-
fs__rspack_import_5.write(this[k], e, 0, e.length, this[
|
|
535
|
+
fs__rspack_import_5.write(this[k], e, 0, e.length, this[M], (e, t) => this[tt](e, t));
|
|
536
536
|
}
|
|
537
537
|
[tt](e, t) {
|
|
538
|
-
e ? this[Qe](e) : (this[
|
|
538
|
+
e ? this[Qe](e) : (this[M] !== void 0 && typeof t == `number` && (this[M] += t), this[N].length ? this[qe]() : (this[ct] = !1, this[Ge] && !this[Ke] ? (this[Ke] = !0, this[O](), this.emit(`finish`)) : this[Ze] && (this[Ze] = !1, this.emit(`drain`))));
|
|
539
539
|
}
|
|
540
540
|
[qe]() {
|
|
541
541
|
if (this[N].length === 0) this[Ge] && this[tt](null, 0);
|
|
542
542
|
else if (this[N].length === 1) this[st](this[N].pop());
|
|
543
543
|
else {
|
|
544
544
|
let e = this[N];
|
|
545
|
-
this[N] = [], We(this[k], e, this[
|
|
545
|
+
this[N] = [], We(this[k], e, this[M], (e, t) => this[tt](e, t));
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
[O]() {
|
|
@@ -552,15 +552,15 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
}, mt = class extends pt {
|
|
555
|
-
[
|
|
555
|
+
[nt]() {
|
|
556
556
|
let e;
|
|
557
557
|
if (this[lt] && this[A] === `r+`) try {
|
|
558
|
-
e = fs__rspack_import_5.openSync(this[
|
|
558
|
+
e = fs__rspack_import_5.openSync(this[j], this[A], this[Xe]);
|
|
559
559
|
} catch (e) {
|
|
560
|
-
if (e?.code === `ENOENT`) return this[A] = `w`, this[
|
|
560
|
+
if (e?.code === `ENOENT`) return this[A] = `w`, this[nt]();
|
|
561
561
|
throw e;
|
|
562
562
|
}
|
|
563
|
-
else e = fs__rspack_import_5.openSync(this[
|
|
563
|
+
else e = fs__rspack_import_5.openSync(this[j], this[A], this[Xe]);
|
|
564
564
|
this[$e](null, e);
|
|
565
565
|
}
|
|
566
566
|
[O]() {
|
|
@@ -572,14 +572,14 @@ while (this[be](this[Te]()) && this[b].length);
|
|
|
572
572
|
[st](e) {
|
|
573
573
|
let t = !0;
|
|
574
574
|
try {
|
|
575
|
-
this[tt](null, fs__rspack_import_5.writeSync(this[k], e, 0, e.length, this[
|
|
575
|
+
this[tt](null, fs__rspack_import_5.writeSync(this[k], e, 0, e.length, this[M])), t = !1;
|
|
576
576
|
} finally {
|
|
577
577
|
if (t) try {
|
|
578
578
|
this[O]();
|
|
579
579
|
} catch {}
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
}, ht = new Map([
|
|
582
|
+
}, ht = /* @__PURE__ */ new Map([
|
|
583
583
|
[`C`, `cwd`],
|
|
584
584
|
[`f`, `file`],
|
|
585
585
|
[`z`, `gzip`],
|
|
@@ -922,7 +922,7 @@ ue(Xt, {
|
|
|
922
922
|
name: () => en,
|
|
923
923
|
normalFsTypes: () => $t
|
|
924
924
|
});
|
|
925
|
-
var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
925
|
+
var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = /* @__PURE__ */ new Set([
|
|
926
926
|
`0`,
|
|
927
927
|
``,
|
|
928
928
|
`1`,
|
|
@@ -933,7 +933,7 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
933
933
|
`6`,
|
|
934
934
|
`7`,
|
|
935
935
|
`D`
|
|
936
|
-
]), en = new Map([
|
|
936
|
+
]), en = /* @__PURE__ */ new Map([
|
|
937
937
|
[`0`, `File`],
|
|
938
938
|
[``, `OldFile`],
|
|
939
939
|
[`1`, `Link`],
|
|
@@ -955,7 +955,7 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
955
955
|
[`S`, `SparseFile`],
|
|
956
956
|
[`V`, `TapeVolumeHeader`],
|
|
957
957
|
[`X`, `OldExtendedHeader`]
|
|
958
|
-
]), tn = new Map(Array.from(en).map((e) => [e[1], e[0]])), I = class {
|
|
958
|
+
]), tn = new Map(Array.from(en).map((e) => [e[1], e[0]])), nn = (e) => e === void 0 || e < 0 ? void 0 : e, I = class {
|
|
959
959
|
cksumValid = !1;
|
|
960
960
|
needPax = !1;
|
|
961
961
|
nullBlock = !1;
|
|
@@ -982,13 +982,13 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
982
982
|
}
|
|
983
983
|
decode(e, t, n, r) {
|
|
984
984
|
if (t ||= 0, !e || !(e.length >= t + 512)) throw Error(`need 512 bytes for header`);
|
|
985
|
-
let i =
|
|
986
|
-
if (this.path = o?.path ??
|
|
987
|
-
let n =
|
|
985
|
+
let i = an(e, t + 156, 1), a = $t.has(i), o = a ? n : void 0, s = a ? r : void 0;
|
|
986
|
+
if (this.path = o?.path ?? an(e, t, 100), this.mode = o?.mode ?? s?.mode ?? cn(e, t + 100, 8), this.uid = o?.uid ?? s?.uid ?? cn(e, t + 108, 8), this.gid = o?.gid ?? s?.gid ?? cn(e, t + 116, 8), this.size = nn(o?.size ?? s?.size ?? cn(e, t + 124, 12)), this.mtime = o?.mtime ?? s?.mtime ?? on(e, t + 136, 12), this.cksum = cn(e, t + 148, 12), s && this.#i(s, !0), o && this.#i(o), Zt(i) && (this.#t = i || `0`), this.#t === `0` && this.path.slice(-1) === `/` && (this.#t = `5`), this.#t === `5` && (this.size = 0), this.linkpath = an(e, t + 157, 100), e.subarray(t + 257, t + 265).toString() === `ustar\x0000`) if (this.uname = o?.uname ?? s?.uname ?? an(e, t + 265, 32), this.gname = o?.gname ?? s?.gname ?? an(e, t + 297, 32), this.devmaj = o?.devmaj ?? s?.devmaj ?? cn(e, t + 329, 8) ?? 0, this.devmin = o?.devmin ?? s?.devmin ?? cn(e, t + 337, 8) ?? 0, e[t + 475] !== 0) {
|
|
987
|
+
let n = an(e, t + 345, 155);
|
|
988
988
|
this.path = n + `/` + this.path;
|
|
989
989
|
} else {
|
|
990
|
-
let i =
|
|
991
|
-
i && (this.path = i + `/` + this.path), this.atime = n?.atime ?? r?.atime ??
|
|
990
|
+
let i = an(e, t + 345, 130);
|
|
991
|
+
i && (this.path = i + `/` + this.path), this.atime = n?.atime ?? r?.atime ?? on(e, t + 476, 12), this.ctime = n?.ctime ?? r?.ctime ?? on(e, t + 488, 12);
|
|
992
992
|
}
|
|
993
993
|
let c = 256;
|
|
994
994
|
for (let n = t; n < t + 148; n++) c += e[n];
|
|
@@ -996,16 +996,16 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
996
996
|
this.cksumValid = c === this.cksum, this.cksum === void 0 && c === 256 && (this.nullBlock = !0);
|
|
997
997
|
}
|
|
998
998
|
#i(e, t = !1) {
|
|
999
|
-
Object.assign(this, Object.fromEntries(Object.entries(e).filter(([e, n]) => !(n == null || e === `path` && t || e === `linkpath` && t || e === `global`))));
|
|
999
|
+
Object.assign(this, Object.fromEntries(Object.entries(e).filter(([e, n]) => !(n == null || e === `size` && Number(n) < 0 || e === `path` && t || e === `linkpath` && t || e === `global`))));
|
|
1000
1000
|
}
|
|
1001
1001
|
encode(e, t = 0) {
|
|
1002
1002
|
if (e ||= this.block = Buffer.alloc(512), this.#t === `Unsupported` && (this.#t = `0`), !(e.length >= t + 512)) throw Error(`need 512 bytes for header`);
|
|
1003
|
-
let n = this.ctime || this.atime ? 130 : 155, r =
|
|
1004
|
-
this.needPax = !!r[2], this.needPax =
|
|
1003
|
+
let n = this.ctime || this.atime ? 130 : 155, r = rn(this.path || ``, n), i = r[0], a = r[1];
|
|
1004
|
+
this.needPax = !!r[2], this.needPax = vn(e, t, 100, i) || this.needPax, this.needPax = fn(e, t + 100, 8, this.mode) || this.needPax, this.needPax = fn(e, t + 108, 8, this.uid) || this.needPax, this.needPax = fn(e, t + 116, 8, this.gid) || this.needPax, this.needPax = fn(e, t + 124, 12, this.size) || this.needPax, this.needPax = gn(e, t + 136, 12, this.mtime) || this.needPax, e[t + 156] = Number(this.#t.codePointAt(0)), this.needPax = vn(e, t + 157, 100, this.linkpath) || this.needPax, e.write(`ustar\x0000`, t + 257, 8), this.needPax = vn(e, t + 265, 32, this.uname) || this.needPax, this.needPax = vn(e, t + 297, 32, this.gname) || this.needPax, this.needPax = fn(e, t + 329, 8, this.devmaj) || this.needPax, this.needPax = fn(e, t + 337, 8, this.devmin) || this.needPax, this.needPax = vn(e, t + 345, n, a) || this.needPax, e[t + 475] === 0 ? (this.needPax = vn(e, t + 345, 130, a) || this.needPax, this.needPax = gn(e, t + 476, 12, this.atime) || this.needPax, this.needPax = gn(e, t + 488, 12, this.ctime) || this.needPax) : this.needPax = vn(e, t + 345, 155, a) || this.needPax;
|
|
1005
1005
|
let o = 256;
|
|
1006
1006
|
for (let n = t; n < t + 148; n++) o += e[n];
|
|
1007
1007
|
for (let n = t + 156; n < t + 512; n++) o += e[n];
|
|
1008
|
-
return this.cksum = o,
|
|
1008
|
+
return this.cksum = o, fn(e, t + 148, 8, this.cksum), this.cksumValid = !0, this.needPax;
|
|
1009
1009
|
}
|
|
1010
1010
|
get type() {
|
|
1011
1011
|
return this.#t === `Unsupported` ? this.#t : en.get(this.#t);
|
|
@@ -1019,7 +1019,7 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
1019
1019
|
else if (Zt(e)) this.#t = e;
|
|
1020
1020
|
else throw TypeError(`invalid entry type: ` + e);
|
|
1021
1021
|
}
|
|
1022
|
-
},
|
|
1022
|
+
}, rn = (e, t) => {
|
|
1023
1023
|
let n = e, r = ``, i, a = node_path__rspack_import_3.posix.parse(e).root || `.`;
|
|
1024
1024
|
if (Buffer.byteLength(n) < 100) i = [
|
|
1025
1025
|
n,
|
|
@@ -1046,10 +1046,10 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
1046
1046
|
];
|
|
1047
1047
|
}
|
|
1048
1048
|
return i;
|
|
1049
|
-
},
|
|
1049
|
+
}, an = (e, t, n) => e.subarray(t, t + n).toString(`utf8`).replace(/\0.*/, ``), on = (e, t, n) => sn(cn(e, t, n)), sn = (e) => e === void 0 ? void 0 : /* @__PURE__ */ new Date(e * 1e3), cn = (e, t, n) => Number(e[t]) & 128 ? Gt(e.subarray(t, t + n)) : un(e, t, n), ln = (e) => isNaN(e) ? void 0 : e, un = (e, t, n) => ln(parseInt(e.subarray(t, t + n).toString(`utf8`).replace(/\0.*$/, ``).trim(), 8)), dn = {
|
|
1050
1050
|
12: 8589934591,
|
|
1051
1051
|
8: 2097151
|
|
1052
|
-
},
|
|
1052
|
+
}, fn = (e, t, n, r) => r === void 0 ? !1 : r > dn[n] || r < 0 ? (Ht(r, e.subarray(t, t + n)), !0) : (pn(e, t, n, r), !1), pn = (e, t, n, r) => e.write(mn(r, n), t, n, `ascii`), mn = (e, t) => hn(Math.floor(e).toString(8), t), hn = (e, t) => (e.length === t - 1 ? e : Array(t - e.length - 1).join(`0`) + e + ` `) + `\0`, gn = (e, t, n, r) => r !== void 0 && fn(e, t, n, r.getTime() / 1e3), _n = Array(156).join(`\0`), vn = (e, t, n, r) => r === void 0 ? !1 : (e.write(r + _n, t, n, `utf8`), r.length !== Buffer.byteLength(r) || r.length > n), yn = class e {
|
|
1053
1053
|
atime;
|
|
1054
1054
|
mtime;
|
|
1055
1055
|
ctime;
|
|
@@ -1104,18 +1104,46 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
1104
1104
|
return i + a >= 10 ** a && (a += 1), a + i + r;
|
|
1105
1105
|
}
|
|
1106
1106
|
static parse(t, n, r = !1) {
|
|
1107
|
-
return new e(
|
|
1107
|
+
return new e(bn(xn(t), n), r);
|
|
1108
1108
|
}
|
|
1109
|
-
},
|
|
1110
|
-
`).reduce(
|
|
1109
|
+
}, bn = (e, t) => t ? Object.assign({}, t, e) : e, xn = (e) => e.replace(/\n$/, ``).split(`
|
|
1110
|
+
`).reduce(Sn, Object.create(null)), Sn = (e, t) => {
|
|
1111
1111
|
let n = parseInt(t, 10);
|
|
1112
1112
|
if (n !== Buffer.byteLength(t) + 1) return e;
|
|
1113
1113
|
t = t.slice((n + ` `).length);
|
|
1114
1114
|
let r = t.split(`=`), i = r.shift();
|
|
1115
1115
|
if (!i) return e;
|
|
1116
|
-
let a = i.replace(/^SCHILY\.(dev|ino|nlink)/, `$1`), o = r.join(`=`);
|
|
1117
|
-
|
|
1118
|
-
|
|
1116
|
+
let a = i.replace(/^SCHILY\.(dev|ino|nlink)/, `$1`), o = r.join(`=`).replace(/\0.*/, ``);
|
|
1117
|
+
switch (a) {
|
|
1118
|
+
case `path`:
|
|
1119
|
+
case `linkpath`:
|
|
1120
|
+
case `type`:
|
|
1121
|
+
case `charset`:
|
|
1122
|
+
case `comment`:
|
|
1123
|
+
case `gname`:
|
|
1124
|
+
case `uname`:
|
|
1125
|
+
e[a] = o;
|
|
1126
|
+
break;
|
|
1127
|
+
case `ctime`:
|
|
1128
|
+
case `atime`:
|
|
1129
|
+
case `mtime`:
|
|
1130
|
+
e[a] = /* @__PURE__ */ new Date(Number(o) * 1e3);
|
|
1131
|
+
break;
|
|
1132
|
+
case `size`:
|
|
1133
|
+
let t = +o;
|
|
1134
|
+
t >= 0 && (e[a] = t);
|
|
1135
|
+
break;
|
|
1136
|
+
case `gid`:
|
|
1137
|
+
case `uid`:
|
|
1138
|
+
case `dev`:
|
|
1139
|
+
case `ino`:
|
|
1140
|
+
case `nlink`:
|
|
1141
|
+
case `mode`:
|
|
1142
|
+
e[a] = +o;
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
return e;
|
|
1146
|
+
}, L = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32` ? (e) => String(e).replaceAll(/\\/g, `/`) : (e) => String(e), Cn = class extends Ue {
|
|
1119
1147
|
extended;
|
|
1120
1148
|
globalExtended;
|
|
1121
1149
|
header;
|
|
@@ -1165,7 +1193,7 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
1165
1193
|
default: this.ignore = !0;
|
|
1166
1194
|
}
|
|
1167
1195
|
if (!e.path) throw Error(`no path provided for tar.ReadEntry`);
|
|
1168
|
-
this.path =
|
|
1196
|
+
this.path = L(e.path), this.mode = e.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 ? L(e.linkpath) : void 0, this.uname = e.uname, this.gname = e.gname, t && this.#t(t), n && this.#t(n, !0);
|
|
1169
1197
|
}
|
|
1170
1198
|
write(e) {
|
|
1171
1199
|
let t = e.length;
|
|
@@ -1174,249 +1202,268 @@ var Zt = (e) => en.has(e), Qt = (e) => tn.has(e), $t = new Set([
|
|
|
1174
1202
|
return this.remain = Math.max(0, n - t), this.blockRemain = Math.max(0, r - t), this.ignore ? !0 : n >= t ? super.write(e) : super.write(e.subarray(0, n));
|
|
1175
1203
|
}
|
|
1176
1204
|
#t(e, t = !1) {
|
|
1177
|
-
e.path &&=
|
|
1205
|
+
e.path &&= L(e.path), e.linkpath &&= L(e.linkpath), Object.assign(this, Object.fromEntries(Object.entries(e).filter(([e, n]) => !(n == null || e === `path` && t))));
|
|
1178
1206
|
}
|
|
1179
|
-
},
|
|
1207
|
+
}, wn = (e, t, n, r = {}) => {
|
|
1180
1208
|
e.file && (r.file = e.file), e.cwd && (r.cwd = e.cwd), r.code = n instanceof Error && n.code || t, r.tarCode = t, !e.strict && r.recoverable !== !1 ? (n instanceof Error && (r = Object.assign(n, r), n = n.message), e.emit(`warn`, t, n, r)) : n instanceof Error ? e.emit(`error`, Object.assign(n, r)) : e.emit(`error`, Object.assign(Error(`${t}: ${n}`), r));
|
|
1181
|
-
},
|
|
1209
|
+
}, Tn = 1024 * 1024, En = Buffer.from([31, 139]), Dn = Buffer.from([
|
|
1182
1210
|
40,
|
|
1183
1211
|
181,
|
|
1184
1212
|
47,
|
|
1185
1213
|
253
|
|
1186
|
-
]),
|
|
1214
|
+
]), On = Math.max(En.length, Dn.length), R = Symbol(`state`), kn = Symbol(`writeEntry`), z = Symbol(`readEntry`), An = Symbol(`nextEntry`), jn = Symbol(`processEntry`), B = Symbol(`extendedHeader`), Mn = Symbol(`globalExtendedHeader`), V = Symbol(`meta`), Nn = Symbol(`emitMeta`), H = Symbol(`buffer`), U = Symbol(`queue`), W = Symbol(`ended`), Pn = Symbol(`emittedEnd`), Fn = Symbol(`emit`), G = Symbol(`unzip`), In = Symbol(`consumeChunk`), Ln = Symbol(`consumeChunkSub`), Rn = Symbol(`consumeBody`), zn = Symbol(`consumeMeta`), Bn = Symbol(`consumeHeader`), Vn = Symbol(`consuming`), Hn = Symbol(`bufferConcat`), Un = Symbol(`maybeEnd`), Wn = Symbol(`writing`), K = Symbol(`aborted`), Gn = Symbol(`onDone`), Kn = Symbol(`sawValidEntry`), qn = Symbol(`sawNullBlock`), Jn = Symbol(`sawEOF`), Yn = Symbol(`closeStream`), Xn = 1e3, Zn = Symbol(`compressedBytesRead`), Qn = Symbol(`decompressedBytesRead`), $n = Symbol(`checkDecompressionRatio`), er = () => !0, tr = class extends events__rspack_import_4.EventEmitter {
|
|
1187
1215
|
file;
|
|
1188
1216
|
strict;
|
|
1189
1217
|
maxMetaEntrySize;
|
|
1190
1218
|
filter;
|
|
1191
1219
|
brotli;
|
|
1192
1220
|
zstd;
|
|
1221
|
+
maxDecompressionRatio;
|
|
1193
1222
|
writable = !0;
|
|
1194
1223
|
readable = !1;
|
|
1195
|
-
[
|
|
1196
|
-
[W];
|
|
1197
|
-
[V];
|
|
1198
|
-
[En];
|
|
1199
|
-
[B] = `begin`;
|
|
1200
|
-
[U] = ``;
|
|
1224
|
+
[U] = [];
|
|
1201
1225
|
[H];
|
|
1226
|
+
[z];
|
|
1202
1227
|
[kn];
|
|
1228
|
+
[R] = `begin`;
|
|
1229
|
+
[V] = ``;
|
|
1230
|
+
[B];
|
|
1231
|
+
[Mn];
|
|
1232
|
+
[W] = !1;
|
|
1233
|
+
[G];
|
|
1203
1234
|
[K] = !1;
|
|
1204
|
-
[
|
|
1205
|
-
[
|
|
1206
|
-
[
|
|
1235
|
+
[Kn];
|
|
1236
|
+
[qn] = !1;
|
|
1237
|
+
[Jn] = !1;
|
|
1207
1238
|
[Wn] = !1;
|
|
1208
|
-
[Gn] = !1;
|
|
1209
1239
|
[Vn] = !1;
|
|
1210
|
-
[
|
|
1211
|
-
[
|
|
1240
|
+
[Pn] = !1;
|
|
1241
|
+
[Zn] = 0;
|
|
1242
|
+
[Qn] = 0;
|
|
1212
1243
|
constructor(e = {}) {
|
|
1213
|
-
super(), this.file = e.file || ``, this.on(
|
|
1214
|
-
(this[
|
|
1215
|
-
}), e.ondone ? this.on(
|
|
1244
|
+
super(), this.file = e.file || ``, this.on(Gn, () => {
|
|
1245
|
+
(this[R] === `begin` || this[Kn] === !1) && this.warn(`TAR_BAD_ARCHIVE`, `Unrecognized archive format`);
|
|
1246
|
+
}), e.ondone ? this.on(Gn, e.ondone) : this.on(Gn, () => {
|
|
1216
1247
|
this.emit(`prefinish`), this.emit(`finish`), this.emit(`end`);
|
|
1217
|
-
}), this.strict = !!e.strict, this.maxMetaEntrySize = e.maxMetaEntrySize ||
|
|
1248
|
+
}), this.strict = !!e.strict, this.maxDecompressionRatio = typeof e.maxDecompressionRatio == `number` ? e.maxDecompressionRatio : Xn, this.maxMetaEntrySize = e.maxMetaEntrySize || Tn, this.filter = typeof e.filter == `function` ? e.filter : er;
|
|
1218
1249
|
let t = e.file && (e.file.endsWith(`.tar.br`) || e.file.endsWith(`.tbr`));
|
|
1219
1250
|
this.brotli = !(e.gzip || e.zstd) && e.brotli !== void 0 ? e.brotli : t ? void 0 : !1;
|
|
1220
1251
|
let n = e.file && (e.file.endsWith(`.tar.zst`) || e.file.endsWith(`.tzst`));
|
|
1221
|
-
this.zstd = !(e.gzip || e.brotli) && e.zstd !== void 0 ? e.zstd : n ? !0 : void 0, this.on(`end`, () => this[
|
|
1252
|
+
this.zstd = !(e.gzip || e.brotli) && e.zstd !== void 0 ? e.zstd : n ? !0 : void 0, this.on(`end`, () => this[Yn]()), typeof e.onwarn == `function` && this.on(`warn`, e.onwarn), typeof e.onReadEntry == `function` && this.on(`entry`, e.onReadEntry);
|
|
1222
1253
|
}
|
|
1223
1254
|
warn(e, t, n = {}) {
|
|
1224
|
-
|
|
1255
|
+
wn(this, e, t, n);
|
|
1225
1256
|
}
|
|
1226
|
-
[
|
|
1227
|
-
this[
|
|
1257
|
+
[Bn](e, t) {
|
|
1258
|
+
this[Kn] === void 0 && (this[Kn] = !1);
|
|
1228
1259
|
let n;
|
|
1229
1260
|
try {
|
|
1230
|
-
n = new I(e, t, this[
|
|
1261
|
+
n = new I(e, t, this[B], this[Mn]);
|
|
1231
1262
|
} catch (e) {
|
|
1232
1263
|
return this.warn(`TAR_ENTRY_INVALID`, e);
|
|
1233
1264
|
}
|
|
1234
|
-
if (n.nullBlock) this[
|
|
1235
|
-
else if (this[
|
|
1265
|
+
if (n.nullBlock) this[qn] ? (this[Jn] = !0, this[R] === `begin` && (this[R] = `header`), this[Fn](`eof`)) : (this[qn] = !0, this[Fn](`nullBlock`));
|
|
1266
|
+
else if (this[qn] = !1, !n.cksumValid) this.warn(`TAR_ENTRY_INVALID`, `checksum failure`, { header: n });
|
|
1236
1267
|
else if (!n.path) this.warn(`TAR_ENTRY_INVALID`, `path is required`, { header: n });
|
|
1237
1268
|
else {
|
|
1238
1269
|
let e = n.type;
|
|
1239
1270
|
if (/^(Symbolic)?Link$/.test(e) && !n.linkpath) this.warn(`TAR_ENTRY_INVALID`, `linkpath required`, { header: n });
|
|
1240
1271
|
else if (!/^(Symbolic)?Link$/.test(e) && !/^(Global)?ExtendedHeader$/.test(e) && n.linkpath) this.warn(`TAR_ENTRY_INVALID`, `linkpath forbidden`, { header: n });
|
|
1241
1272
|
else {
|
|
1242
|
-
let e = this[
|
|
1243
|
-
this[
|
|
1244
|
-
e.invalid || (this[
|
|
1245
|
-
}) : this[
|
|
1273
|
+
let e = this[kn] = new Cn(n, this[B], this[Mn]);
|
|
1274
|
+
this[Kn] || (e.remain ? e.on(`end`, () => {
|
|
1275
|
+
e.invalid || (this[Kn] = !0);
|
|
1276
|
+
}) : this[Kn] = !0), e.meta ? e.size > this.maxMetaEntrySize ? (e.ignore = !0, this[Fn](`ignoredEntry`, e), this[R] = `ignore`, e.resume()) : e.size > 0 && (this[V] = ``, e.on(`data`, (e) => this[V] += e), this[R] = `meta`) : (this[B] = void 0, e.ignore = e.ignore || !this.filter(e.path, e), e.ignore ? (this[Fn](`ignoredEntry`, e), this[R] = e.remain ? `ignore` : `header`, e.resume()) : (e.remain ? this[R] = `body` : (this[R] = `header`, e.end()), this[z] ? this[U].push(e) : (this[U].push(e), this[An]())));
|
|
1246
1277
|
}
|
|
1247
1278
|
}
|
|
1248
1279
|
}
|
|
1249
|
-
[
|
|
1280
|
+
[Yn]() {
|
|
1250
1281
|
queueMicrotask(() => this.emit(`close`));
|
|
1251
1282
|
}
|
|
1252
|
-
[
|
|
1283
|
+
[jn](e) {
|
|
1253
1284
|
let t = !0;
|
|
1254
|
-
if (!e) this[
|
|
1285
|
+
if (!e) this[z] = void 0, t = !1;
|
|
1255
1286
|
else if (Array.isArray(e)) {
|
|
1256
1287
|
let [t, ...n] = e;
|
|
1257
1288
|
this.emit(t, ...n);
|
|
1258
|
-
} else this[
|
|
1289
|
+
} else this[z] = e, this.emit(`entry`, e), e.emittedEnd || (e.on(`end`, () => this[An]()), t = !1);
|
|
1259
1290
|
return t;
|
|
1260
1291
|
}
|
|
1261
|
-
[
|
|
1292
|
+
[An]() {
|
|
1262
1293
|
do ;
|
|
1263
|
-
while (this[
|
|
1264
|
-
if (this[
|
|
1265
|
-
let e = this[
|
|
1266
|
-
!e || e.flowing || e.size === e.remain ? this[
|
|
1294
|
+
while (this[jn](this[U].shift()));
|
|
1295
|
+
if (this[U].length === 0) {
|
|
1296
|
+
let e = this[z];
|
|
1297
|
+
!e || e.flowing || e.size === e.remain ? this[Wn] || this.emit(`drain`) : e.once(`drain`, () => this.emit(`drain`));
|
|
1267
1298
|
}
|
|
1268
1299
|
}
|
|
1269
|
-
[
|
|
1270
|
-
let n = this[
|
|
1300
|
+
[Rn](e, t) {
|
|
1301
|
+
let n = this[kn];
|
|
1271
1302
|
if (!n) throw Error(`attempt to consume body without entry??`);
|
|
1272
1303
|
let r = n.blockRemain ?? 0, i = r >= e.length && t === 0 ? e : e.subarray(t, t + r);
|
|
1273
|
-
return n.write(i), n.blockRemain || (this[
|
|
1304
|
+
return n.write(i), n.blockRemain || (this[R] = `header`, this[kn] = void 0, n.end()), i.length;
|
|
1274
1305
|
}
|
|
1275
|
-
[
|
|
1276
|
-
let n = this[
|
|
1277
|
-
return !this[
|
|
1306
|
+
[zn](e, t) {
|
|
1307
|
+
let n = this[kn], r = this[Rn](e, t);
|
|
1308
|
+
return !this[kn] && n && this[Nn](n), r;
|
|
1278
1309
|
}
|
|
1279
|
-
[
|
|
1280
|
-
this[
|
|
1310
|
+
[Fn](e, t, n) {
|
|
1311
|
+
this[U].length === 0 && !this[z] ? this.emit(e, t, n) : this[U].push([
|
|
1281
1312
|
e,
|
|
1282
1313
|
t,
|
|
1283
1314
|
n
|
|
1284
1315
|
]);
|
|
1285
1316
|
}
|
|
1286
|
-
[
|
|
1287
|
-
switch (this[
|
|
1317
|
+
[Nn](e) {
|
|
1318
|
+
switch (this[Fn](`meta`, this[V]), e.type) {
|
|
1288
1319
|
case `ExtendedHeader`:
|
|
1289
1320
|
case `OldExtendedHeader`:
|
|
1290
|
-
this[
|
|
1321
|
+
this[B] = yn.parse(this[V], this[B], !1);
|
|
1291
1322
|
break;
|
|
1292
1323
|
case `GlobalExtendedHeader`:
|
|
1293
|
-
this[
|
|
1324
|
+
this[Mn] = yn.parse(this[V], this[Mn], !0);
|
|
1294
1325
|
break;
|
|
1295
1326
|
case `NextFileHasLongPath`:
|
|
1296
1327
|
case `OldGnuLongPath`: {
|
|
1297
|
-
let e = this[
|
|
1298
|
-
this[
|
|
1328
|
+
let e = this[B] ?? Object.create(null);
|
|
1329
|
+
this[B] = e, e.path = this[V].replace(/\0.*/, ``);
|
|
1299
1330
|
break;
|
|
1300
1331
|
}
|
|
1301
1332
|
case `NextFileHasLongLinkpath`: {
|
|
1302
|
-
let e = this[
|
|
1303
|
-
this[
|
|
1333
|
+
let e = this[B] || Object.create(null);
|
|
1334
|
+
this[B] = e, e.linkpath = this[V].replace(/\0.*/, ``);
|
|
1304
1335
|
break;
|
|
1305
1336
|
}
|
|
1306
1337
|
default: throw Error(`unknown meta: ` + e.type);
|
|
1307
1338
|
}
|
|
1308
1339
|
}
|
|
1309
1340
|
abort(e) {
|
|
1310
|
-
this[
|
|
1341
|
+
if (!this[K]) {
|
|
1342
|
+
if (this[G]) {
|
|
1343
|
+
let e = this[G];
|
|
1344
|
+
e.write = () => !0, e.end = () => e, e.emit = () => !1, e.destroy?.();
|
|
1345
|
+
}
|
|
1346
|
+
this[K] = !0, this.emit(`abort`, e), this.warn(`TAR_ABORT`, e, { recoverable: !1 });
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
[$n](e) {
|
|
1350
|
+
this[Qn] += e.length;
|
|
1351
|
+
let t = this[Qn] / this[Zn];
|
|
1352
|
+
return t > this.maxDecompressionRatio ? (this.abort(Error(`max decompression ratio exceeded: ${t.toFixed(2)} > ${this.maxDecompressionRatio}`)), !1) : !0;
|
|
1311
1353
|
}
|
|
1312
1354
|
write(e, t, n) {
|
|
1313
|
-
if (typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`)), this[
|
|
1314
|
-
if ((this[
|
|
1315
|
-
if (this[
|
|
1316
|
-
for (let t = 0; this[
|
|
1355
|
+
if (typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`)), this[K]) return n?.(), !1;
|
|
1356
|
+
if ((this[G] === void 0 || this.brotli === void 0 && this[G] === !1) && e) {
|
|
1357
|
+
if (this[H] && (e = Buffer.concat([this[H], e]), this[H] = void 0), e.length < On) return this[H] = e, n?.(), !0;
|
|
1358
|
+
for (let t = 0; this[G] === void 0 && t < En.length; t++) e[t] !== En[t] && (this[G] = !1);
|
|
1317
1359
|
let t = !1;
|
|
1318
|
-
if (this[
|
|
1360
|
+
if (this[G] === !1 && this.zstd !== !1) {
|
|
1319
1361
|
t = !0;
|
|
1320
|
-
for (let n = 0; n <
|
|
1362
|
+
for (let n = 0; n < Dn.length; n++) if (e[n] !== Dn[n]) {
|
|
1321
1363
|
t = !1;
|
|
1322
1364
|
break;
|
|
1323
1365
|
}
|
|
1324
1366
|
}
|
|
1325
1367
|
let r = this.brotli === void 0 && !t;
|
|
1326
|
-
if (this[
|
|
1327
|
-
else return this[
|
|
1368
|
+
if (this[G] === !1 && r) if (e.length < 512) if (this[W]) this.brotli = !0;
|
|
1369
|
+
else return this[H] = e, n?.(), !0;
|
|
1328
1370
|
else try {
|
|
1329
1371
|
new I(e.subarray(0, 512)), this.brotli = !1;
|
|
1330
1372
|
} catch {
|
|
1331
1373
|
this.brotli = !0;
|
|
1332
1374
|
}
|
|
1333
|
-
if (this[
|
|
1334
|
-
let r = this[
|
|
1335
|
-
this[
|
|
1336
|
-
this[
|
|
1337
|
-
}), this[
|
|
1338
|
-
|
|
1339
|
-
|
|
1375
|
+
if (this[G] === void 0 || this[G] === !1 && (this.brotli || t)) {
|
|
1376
|
+
let r = this[W];
|
|
1377
|
+
this[W] = !1, this[G] = this[G] === void 0 ? new Ft({}) : t ? new Vt({}) : new Rt({}), this[G].on(`data`, (e) => {
|
|
1378
|
+
this[$n](e) && this[In](e);
|
|
1379
|
+
}), this[G].on(`error`, (e) => {
|
|
1380
|
+
this[K] || this.abort(e);
|
|
1381
|
+
}), this[G].on(`end`, () => {
|
|
1382
|
+
this[W] = !0, this[In]();
|
|
1383
|
+
}), this[Wn] = !0, this[Zn] += e.length;
|
|
1384
|
+
let i = !!this[G][r ? `end` : `write`](e);
|
|
1385
|
+
return this[Wn] = !1, n?.(), i;
|
|
1340
1386
|
}
|
|
1341
1387
|
}
|
|
1342
|
-
this[
|
|
1343
|
-
let r = this[
|
|
1344
|
-
return !r && this[
|
|
1388
|
+
this[Wn] = !0, this[G] ? (this[Zn] += e.length, this[G].write(e)) : this[In](e), this[Wn] = !1;
|
|
1389
|
+
let r = this[U].length > 0 ? !1 : !this[z] || this[z].flowing;
|
|
1390
|
+
return !r && this[U].length === 0 && this[z]?.once(`drain`, () => this.emit(`drain`)), n?.(), r;
|
|
1345
1391
|
}
|
|
1346
|
-
[
|
|
1347
|
-
e && !this[
|
|
1392
|
+
[Hn](e) {
|
|
1393
|
+
e && !this[K] && (this[H] = this[H] ? Buffer.concat([this[H], e]) : e);
|
|
1348
1394
|
}
|
|
1349
|
-
[
|
|
1350
|
-
if (this[
|
|
1351
|
-
this[
|
|
1352
|
-
let e = this[
|
|
1353
|
-
if (e
|
|
1354
|
-
let t = this[
|
|
1355
|
-
this.warn(`TAR_BAD_ARCHIVE`, `Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`, { entry: e }), this[
|
|
1395
|
+
[Un]() {
|
|
1396
|
+
if (this[W] && !this[Pn] && !this[K] && !this[Vn]) {
|
|
1397
|
+
this[Pn] = !0;
|
|
1398
|
+
let e = this[kn];
|
|
1399
|
+
if (e?.blockRemain) {
|
|
1400
|
+
let t = this[H] ? this[H].length : 0;
|
|
1401
|
+
this.warn(`TAR_BAD_ARCHIVE`, `Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`, { entry: e }), this[H] && e.write(this[H]), e.end();
|
|
1356
1402
|
}
|
|
1357
|
-
this[
|
|
1403
|
+
this[Fn](Gn);
|
|
1358
1404
|
}
|
|
1359
1405
|
}
|
|
1360
|
-
[
|
|
1361
|
-
if (this[
|
|
1362
|
-
else if (!e && !this[
|
|
1406
|
+
[In](e) {
|
|
1407
|
+
if (this[Vn] && e) this[Hn](e);
|
|
1408
|
+
else if (!e && !this[H]) this[Un]();
|
|
1363
1409
|
else if (e) {
|
|
1364
|
-
if (this[
|
|
1365
|
-
this[
|
|
1366
|
-
let t = this[
|
|
1367
|
-
this[
|
|
1368
|
-
} else this[
|
|
1369
|
-
for (; this[
|
|
1370
|
-
let e = this[
|
|
1371
|
-
this[
|
|
1410
|
+
if (this[Vn] = !0, this[H]) {
|
|
1411
|
+
this[Hn](e);
|
|
1412
|
+
let t = this[H];
|
|
1413
|
+
this[H] = void 0, this[Ln](t);
|
|
1414
|
+
} else this[Ln](e);
|
|
1415
|
+
for (; this[H] && this[H]?.length >= 512 && !this[K] && !this[Jn];) {
|
|
1416
|
+
let e = this[H];
|
|
1417
|
+
this[H] = void 0, this[Ln](e);
|
|
1372
1418
|
}
|
|
1373
|
-
this[
|
|
1419
|
+
this[Vn] = !1;
|
|
1374
1420
|
}
|
|
1375
|
-
(!this[
|
|
1421
|
+
(!this[H] || this[W]) && this[Un]();
|
|
1376
1422
|
}
|
|
1377
|
-
[
|
|
1423
|
+
[Ln](e) {
|
|
1378
1424
|
let t = 0, n = e.length;
|
|
1379
|
-
for (; t + 512 <= n && !this[
|
|
1425
|
+
for (; t + 512 <= n && !this[K] && !this[Jn];) switch (this[R]) {
|
|
1380
1426
|
case `begin`:
|
|
1381
1427
|
case `header`:
|
|
1382
|
-
this[
|
|
1428
|
+
this[Bn](e, t), t += 512;
|
|
1383
1429
|
break;
|
|
1384
1430
|
case `ignore`:
|
|
1385
1431
|
case `body`:
|
|
1386
|
-
t += this[
|
|
1432
|
+
t += this[Rn](e, t);
|
|
1387
1433
|
break;
|
|
1388
1434
|
case `meta`:
|
|
1389
|
-
t += this[
|
|
1435
|
+
t += this[zn](e, t);
|
|
1390
1436
|
break;
|
|
1391
|
-
default: throw Error(`invalid state: ` + this[
|
|
1437
|
+
default: throw Error(`invalid state: ` + this[R]);
|
|
1392
1438
|
}
|
|
1393
|
-
t < n && (this[
|
|
1439
|
+
t < n && (this[H] = this[H] ? Buffer.concat([e.subarray(t), this[H]]) : e.subarray(t));
|
|
1394
1440
|
}
|
|
1395
1441
|
end(e, t, n) {
|
|
1396
|
-
return typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, t)), n && this.once(`finish`, n), this[
|
|
1442
|
+
return typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, t)), n && this.once(`finish`, n), this[K] || (this[G] ? (e && (this[Zn] += e.length, this[G].write(e)), this[G].end()) : (this[W] = !0, (this.brotli === void 0 || this.zstd === void 0) && (e ||= Buffer.alloc(0)), e && this.write(e), this[Un]())), this;
|
|
1397
1443
|
}
|
|
1398
|
-
},
|
|
1444
|
+
}, nr = (e) => {
|
|
1399
1445
|
let t = e.length - 1, n = -1;
|
|
1400
1446
|
for (; t > -1 && e.charAt(t) === `/`;) n = t, t--;
|
|
1401
1447
|
return n === -1 ? e : e.slice(0, n);
|
|
1402
|
-
},
|
|
1448
|
+
}, rr = (e) => {
|
|
1403
1449
|
let t = e.onReadEntry;
|
|
1404
1450
|
e.onReadEntry = t ? (e) => {
|
|
1405
1451
|
t(e), e.resume();
|
|
1406
1452
|
} : (e) => e.resume();
|
|
1407
|
-
},
|
|
1408
|
-
let n = new Map(t.map((e) => [
|
|
1409
|
-
|
|
1410
|
-
|
|
1453
|
+
}, ir = (e, t) => {
|
|
1454
|
+
let n = new Map(t.map((e) => [nr(e), !0])), r = e.filter, i = (e, t = ``, r = 0) => {
|
|
1455
|
+
if (r >= 100) return n.set(e, !1), !1;
|
|
1456
|
+
let a = t || (0,path__rspack_import_8.parse)(e).root || `.`, o;
|
|
1457
|
+
if (e === a) o = !1;
|
|
1411
1458
|
else {
|
|
1412
1459
|
let t = n.get(e);
|
|
1413
|
-
|
|
1460
|
+
o = t === void 0 ? i((0,path__rspack_import_8.dirname)(e), a, r + 1) : t;
|
|
1414
1461
|
}
|
|
1415
|
-
return n.set(e,
|
|
1462
|
+
return n.set(e, o), o;
|
|
1416
1463
|
};
|
|
1417
|
-
e.filter = r ? (e, t) => r(e, t) && i(
|
|
1418
|
-
},
|
|
1419
|
-
let n = new
|
|
1464
|
+
e.filter = r ? (e, t) => r(e, t) && i(nr(e)) : (e) => i(nr(e));
|
|
1465
|
+
}, ar = Ct((e) => {
|
|
1466
|
+
let n = new tr(e), r = e.file, i;
|
|
1420
1467
|
try {
|
|
1421
1468
|
i = node_fs__rspack_import_0.openSync(r, `r`);
|
|
1422
1469
|
let a = node_fs__rspack_import_0.fstatSync(i), o = e.maxReadSize || 16 * 1024 * 1024;
|
|
@@ -1438,7 +1485,7 @@ while (this[On](this[G].shift()));
|
|
|
1438
1485
|
} catch {}
|
|
1439
1486
|
}
|
|
1440
1487
|
}, (e, n) => {
|
|
1441
|
-
let r = new
|
|
1488
|
+
let r = new tr(e), i = e.maxReadSize || 16 * 1024 * 1024, a = e.file;
|
|
1442
1489
|
return new Promise((e, n) => {
|
|
1443
1490
|
r.on(`error`, n), r.on(`end`, e), node_fs__rspack_import_0.stat(a, (e, t) => {
|
|
1444
1491
|
if (e) n(e);
|
|
@@ -1451,22 +1498,22 @@ while (this[On](this[G].shift()));
|
|
|
1451
1498
|
}
|
|
1452
1499
|
});
|
|
1453
1500
|
});
|
|
1454
|
-
}, (e) => new
|
|
1455
|
-
t?.length &&
|
|
1456
|
-
}),
|
|
1457
|
-
let t = ``, n =
|
|
1458
|
-
for (;
|
|
1501
|
+
}, (e) => new tr(e), (e) => new tr(e), (e, t) => {
|
|
1502
|
+
t?.length && ir(e, t), e.noResume || rr(e);
|
|
1503
|
+
}), or = (e, t, n) => (e &= 4095, n && (e = (e | 384) & -19), t && (e & 256 && (e |= 64), e & 32 && (e |= 8), e & 4 && (e |= 1)), e), { isAbsolute: sr, parse: cr } = node_path__rspack_import_3.win32, lr = (e) => {
|
|
1504
|
+
let t = ``, n = cr(e);
|
|
1505
|
+
for (; sr(e) || n.root;) {
|
|
1459
1506
|
let r = e.charAt(0) === `/` && e.slice(0, 4) !== `//?/` ? `/` : n.root;
|
|
1460
|
-
e = e.slice(r.length), t += r, n =
|
|
1507
|
+
e = e.slice(r.length), t += r, n = cr(e);
|
|
1461
1508
|
}
|
|
1462
1509
|
return [t, e];
|
|
1463
|
-
},
|
|
1510
|
+
}, ur = [
|
|
1464
1511
|
`|`,
|
|
1465
1512
|
`<`,
|
|
1466
1513
|
`>`,
|
|
1467
1514
|
`?`,
|
|
1468
1515
|
`:`
|
|
1469
|
-
],
|
|
1516
|
+
], dr = ur.map((e) => String.fromCodePoint(61440 + Number(e.codePointAt(0)))), fr = new Map(ur.map((e, t) => [e, dr[t]])), pr = new Map(dr.map((e, t) => [e, ur[t]])), mr = (e) => ur.reduce((e, t) => e.split(t).join(fr.get(t)), e), hr = (e) => dr.reduce((e, t) => e.split(t).join(pr.get(t)), e), gr = (e, t) => t ? (e = L(e).replace(/^\.(\/|$)/, ``), nr(t) + `/` + e) : L(e), _r = 16 * 1024 * 1024, vr = Symbol(`process`), yr = Symbol(`file`), br = Symbol(`directory`), xr = Symbol(`symlink`), Sr = Symbol(`hardlink`), Cr = Symbol(`header`), wr = Symbol(`read`), Tr = Symbol(`lstat`), Er = Symbol(`onlstat`), Dr = Symbol(`onread`), Or = Symbol(`onreadlink`), kr = Symbol(`openfile`), Ar = Symbol(`onopenfile`), q = Symbol(`close`), jr = Symbol(`mode`), Mr = Symbol(`awaitDrain`), Nr = Symbol(`ondrain`), J = Symbol(`prefix`), Pr = class extends Ue {
|
|
1470
1517
|
path;
|
|
1471
1518
|
portable;
|
|
1472
1519
|
myuid = process.getuid && process.getuid() || 0;
|
|
@@ -1499,54 +1546,54 @@ while (this[On](this[G].shift()));
|
|
|
1499
1546
|
#t = !1;
|
|
1500
1547
|
constructor(e, t = {}) {
|
|
1501
1548
|
let n = St(t);
|
|
1502
|
-
super(), this.path =
|
|
1549
|
+
super(), this.path = L(e), this.portable = !!n.portable, this.maxReadSize = n.maxReadSize || _r, this.linkCache = n.linkCache || /* @__PURE__ */ new Map(), this.statCache = n.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!n.preservePaths, this.cwd = L(n.cwd || process.cwd()), this.strict = !!n.strict, this.noPax = !!n.noPax, this.noMtime = !!n.noMtime, this.mtime = n.mtime, this.prefix = n.prefix ? L(n.prefix) : void 0, this.onWriteEntry = n.onWriteEntry, typeof n.onwarn == `function` && this.on(`warn`, n.onwarn);
|
|
1503
1550
|
let r = !1;
|
|
1504
1551
|
if (!this.preservePaths) {
|
|
1505
|
-
let [e, t] =
|
|
1552
|
+
let [e, t] = lr(this.path);
|
|
1506
1553
|
e && typeof t == `string` && (this.path = t, r = e);
|
|
1507
1554
|
}
|
|
1508
|
-
this.win32 = !!n.win32 || process.platform === `win32`, this.win32 && (this.path =
|
|
1555
|
+
this.win32 = !!n.win32 || process.platform === `win32`, this.win32 && (this.path = hr(this.path.replaceAll(/\\/g, `/`)), e = e.replaceAll(/\\/g, `/`)), this.absolute = L(n.absolute || path__rspack_import_8.resolve(this.cwd, e)), this.path === `` && (this.path = `./`), r && this.warn(`TAR_ENTRY_INFO`, `stripping ${r} from absolute path`, {
|
|
1509
1556
|
entry: this,
|
|
1510
1557
|
path: r + this.path
|
|
1511
1558
|
});
|
|
1512
1559
|
let i = this.statCache.get(this.absolute);
|
|
1513
|
-
i ? this[
|
|
1560
|
+
i ? this[Er](i) : this[Tr]();
|
|
1514
1561
|
}
|
|
1515
1562
|
warn(e, t, n = {}) {
|
|
1516
|
-
return
|
|
1563
|
+
return wn(this, e, t, n);
|
|
1517
1564
|
}
|
|
1518
1565
|
emit(e, ...t) {
|
|
1519
1566
|
return e === `error` && (this.#t = !0), super.emit(e, ...t);
|
|
1520
1567
|
}
|
|
1521
|
-
[
|
|
1568
|
+
[Tr]() {
|
|
1522
1569
|
fs__rspack_import_5.lstat(this.absolute, (e, t) => {
|
|
1523
1570
|
if (e) return this.emit(`error`, e);
|
|
1524
|
-
this[
|
|
1571
|
+
this[Er](t);
|
|
1525
1572
|
});
|
|
1526
1573
|
}
|
|
1527
|
-
[
|
|
1528
|
-
this.statCache.set(this.absolute, e), this.stat = e, e.isFile() || (e.size = 0), this.type =
|
|
1574
|
+
[Er](e) {
|
|
1575
|
+
this.statCache.set(this.absolute, e), this.stat = e, e.isFile() || (e.size = 0), this.type = Lr(e), this.emit(`stat`, e), this[vr]();
|
|
1529
1576
|
}
|
|
1530
|
-
[
|
|
1577
|
+
[vr]() {
|
|
1531
1578
|
switch (this.type) {
|
|
1532
|
-
case `File`: return this[
|
|
1533
|
-
case `Directory`: return this[
|
|
1534
|
-
case `SymbolicLink`: return this[
|
|
1579
|
+
case `File`: return this[yr]();
|
|
1580
|
+
case `Directory`: return this[br]();
|
|
1581
|
+
case `SymbolicLink`: return this[xr]();
|
|
1535
1582
|
default: return this.end();
|
|
1536
1583
|
}
|
|
1537
1584
|
}
|
|
1538
|
-
[
|
|
1539
|
-
return
|
|
1585
|
+
[jr](e) {
|
|
1586
|
+
return or(e, this.type === `Directory`, this.portable);
|
|
1540
1587
|
}
|
|
1541
|
-
[
|
|
1542
|
-
return
|
|
1588
|
+
[J](e) {
|
|
1589
|
+
return gr(e, this.prefix);
|
|
1543
1590
|
}
|
|
1544
|
-
[
|
|
1591
|
+
[Cr]() {
|
|
1545
1592
|
if (!this.stat) throw Error(`cannot write header before stat`);
|
|
1546
1593
|
this.type === `Directory` && this.portable && (this.noMtime = !0), this.onWriteEntry?.(this), this.header = new I({
|
|
1547
|
-
path: this[
|
|
1548
|
-
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[
|
|
1549
|
-
mode: this[
|
|
1594
|
+
path: this[J](this.path),
|
|
1595
|
+
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[J](this.linkpath) : this.linkpath,
|
|
1596
|
+
mode: this[jr](this.stat.mode),
|
|
1550
1597
|
uid: this.portable ? void 0 : this.stat.uid,
|
|
1551
1598
|
gid: this.portable ? void 0 : this.stat.gid,
|
|
1552
1599
|
size: this.stat.size,
|
|
@@ -1555,13 +1602,13 @@ while (this[On](this[G].shift()));
|
|
|
1555
1602
|
uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : ``,
|
|
1556
1603
|
atime: this.portable ? void 0 : this.stat.atime,
|
|
1557
1604
|
ctime: this.portable ? void 0 : this.stat.ctime
|
|
1558
|
-
}), this.header.encode() && !this.noPax && super.write(new
|
|
1605
|
+
}), this.header.encode() && !this.noPax && super.write(new yn({
|
|
1559
1606
|
atime: this.portable ? void 0 : this.header.atime,
|
|
1560
1607
|
ctime: this.portable ? void 0 : this.header.ctime,
|
|
1561
1608
|
gid: this.portable ? void 0 : this.header.gid,
|
|
1562
1609
|
mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime,
|
|
1563
|
-
path: this[
|
|
1564
|
-
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[
|
|
1610
|
+
path: this[J](this.path),
|
|
1611
|
+
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[J](this.linkpath) : this.linkpath,
|
|
1565
1612
|
size: this.header.size,
|
|
1566
1613
|
uid: this.portable ? void 0 : this.header.uid,
|
|
1567
1614
|
uname: this.portable ? void 0 : this.header.uname,
|
|
@@ -1573,65 +1620,65 @@ while (this[On](this[G].shift()));
|
|
|
1573
1620
|
if (!e) throw Error(`failed to encode header`);
|
|
1574
1621
|
super.write(e);
|
|
1575
1622
|
}
|
|
1576
|
-
[
|
|
1623
|
+
[br]() {
|
|
1577
1624
|
if (!this.stat) throw Error(`cannot create directory entry without stat`);
|
|
1578
|
-
this.path.slice(-1) !== `/` && (this.path += `/`), this.stat.size = 0, this[
|
|
1625
|
+
this.path.slice(-1) !== `/` && (this.path += `/`), this.stat.size = 0, this[Cr](), this.end();
|
|
1579
1626
|
}
|
|
1580
|
-
[
|
|
1627
|
+
[xr]() {
|
|
1581
1628
|
fs__rspack_import_5.readlink(this.absolute, (e, t) => {
|
|
1582
1629
|
if (e) return this.emit(`error`, e);
|
|
1583
|
-
this[
|
|
1630
|
+
this[Or](t);
|
|
1584
1631
|
});
|
|
1585
1632
|
}
|
|
1586
|
-
[
|
|
1587
|
-
this.linkpath =
|
|
1633
|
+
[Or](e) {
|
|
1634
|
+
this.linkpath = L(e), this[Cr](), this.end();
|
|
1588
1635
|
}
|
|
1589
|
-
[
|
|
1636
|
+
[Sr](e) {
|
|
1590
1637
|
if (!this.stat) throw Error(`cannot create link entry without stat`);
|
|
1591
|
-
this.type = `Link`, this.linkpath =
|
|
1638
|
+
this.type = `Link`, this.linkpath = L(path__rspack_import_8.relative(this.cwd, e)), this.stat.size = 0, this[Cr](), this.end();
|
|
1592
1639
|
}
|
|
1593
|
-
[
|
|
1640
|
+
[yr]() {
|
|
1594
1641
|
if (!this.stat) throw Error(`cannot create file entry without stat`);
|
|
1595
1642
|
if (this.stat.nlink > 1) {
|
|
1596
1643
|
let e = `${this.stat.dev}:${this.stat.ino}`, t = this.linkCache.get(e);
|
|
1597
|
-
if (t?.indexOf(this.cwd) === 0) return this[
|
|
1644
|
+
if (t?.indexOf(this.cwd) === 0) return this[Sr](t);
|
|
1598
1645
|
this.linkCache.set(e, this.absolute);
|
|
1599
1646
|
}
|
|
1600
|
-
if (this[
|
|
1601
|
-
this[
|
|
1647
|
+
if (this[Cr](), this.stat.size === 0) return this.end();
|
|
1648
|
+
this[kr]();
|
|
1602
1649
|
}
|
|
1603
|
-
[
|
|
1650
|
+
[kr]() {
|
|
1604
1651
|
fs__rspack_import_5.open(this.absolute, `r`, (e, t) => {
|
|
1605
1652
|
if (e) return this.emit(`error`, e);
|
|
1606
|
-
this[
|
|
1653
|
+
this[Ar](t);
|
|
1607
1654
|
});
|
|
1608
1655
|
}
|
|
1609
|
-
[
|
|
1610
|
-
if (this.fd = e, this.#t) return this[
|
|
1656
|
+
[Ar](e) {
|
|
1657
|
+
if (this.fd = e, this.#t) return this[q]();
|
|
1611
1658
|
if (!this.stat) throw Error(`should stat before calling onopenfile`);
|
|
1612
1659
|
this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
|
|
1613
1660
|
let t = Math.min(this.blockLen, this.maxReadSize);
|
|
1614
|
-
this.buf = Buffer.allocUnsafe(t), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[
|
|
1661
|
+
this.buf = Buffer.allocUnsafe(t), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[wr]();
|
|
1615
1662
|
}
|
|
1616
|
-
[
|
|
1663
|
+
[wr]() {
|
|
1617
1664
|
let { fd: e, buf: t, offset: n, length: r, pos: i } = this;
|
|
1618
1665
|
if (e === void 0 || t === void 0) throw Error(`cannot read file without first opening`);
|
|
1619
1666
|
fs__rspack_import_5.read(e, t, n, r, i, (e, t) => {
|
|
1620
|
-
if (e) return this[
|
|
1621
|
-
this[
|
|
1667
|
+
if (e) return this[q](() => this.emit(`error`, e));
|
|
1668
|
+
this[Dr](t);
|
|
1622
1669
|
});
|
|
1623
1670
|
}
|
|
1624
|
-
[
|
|
1671
|
+
[q](e = () => {}) {
|
|
1625
1672
|
this.fd !== void 0 && fs__rspack_import_5.close(this.fd, e);
|
|
1626
1673
|
}
|
|
1627
|
-
[
|
|
1674
|
+
[Dr](e) {
|
|
1628
1675
|
if (e <= 0 && this.remain > 0) {
|
|
1629
1676
|
let e = Object.assign(Error(`encountered unexpected EOF`), {
|
|
1630
1677
|
path: this.absolute,
|
|
1631
1678
|
syscall: `read`,
|
|
1632
1679
|
code: `EOF`
|
|
1633
1680
|
});
|
|
1634
|
-
return this[
|
|
1681
|
+
return this[q](() => this.emit(`error`, e));
|
|
1635
1682
|
}
|
|
1636
1683
|
if (e > this.remain) {
|
|
1637
1684
|
let e = Object.assign(Error(`did not encounter expected EOF`), {
|
|
@@ -1639,14 +1686,14 @@ while (this[On](this[G].shift()));
|
|
|
1639
1686
|
syscall: `read`,
|
|
1640
1687
|
code: `EOF`
|
|
1641
1688
|
});
|
|
1642
|
-
return this[
|
|
1689
|
+
return this[q](() => this.emit(`error`, e));
|
|
1643
1690
|
}
|
|
1644
1691
|
if (!this.buf) throw Error(`should have created buffer prior to reading`);
|
|
1645
1692
|
if (e === this.remain) for (let t = e; t < this.length && e < this.blockRemain; t++) this.buf[t + this.offset] = 0, e++, this.remain++;
|
|
1646
1693
|
let t = this.offset === 0 && e === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + e);
|
|
1647
|
-
this.write(t) ? this[
|
|
1694
|
+
this.write(t) ? this[Nr]() : this[Mr](() => this[Nr]());
|
|
1648
1695
|
}
|
|
1649
|
-
[
|
|
1696
|
+
[Mr](e) {
|
|
1650
1697
|
this.once(`drain`, e);
|
|
1651
1698
|
}
|
|
1652
1699
|
write(e, t, n) {
|
|
@@ -1656,42 +1703,42 @@ while (this[On](this[G].shift()));
|
|
|
1656
1703
|
}
|
|
1657
1704
|
return this.remain -= e.length, this.blockRemain -= e.length, this.pos += e.length, this.offset += e.length, super.write(e, null, n);
|
|
1658
1705
|
}
|
|
1659
|
-
[
|
|
1660
|
-
if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[
|
|
1706
|
+
[Nr]() {
|
|
1707
|
+
if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[q]((e) => e ? this.emit(`error`, e) : this.end());
|
|
1661
1708
|
if (!this.buf) throw Error(`buffer lost somehow in ONDRAIN`);
|
|
1662
|
-
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[
|
|
1709
|
+
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[wr]();
|
|
1663
1710
|
}
|
|
1664
|
-
},
|
|
1711
|
+
}, Fr = class extends Pr {
|
|
1665
1712
|
sync = !0;
|
|
1666
|
-
[
|
|
1667
|
-
this[
|
|
1713
|
+
[Tr]() {
|
|
1714
|
+
this[Er](fs__rspack_import_5.lstatSync(this.absolute));
|
|
1668
1715
|
}
|
|
1669
|
-
[
|
|
1670
|
-
this[
|
|
1716
|
+
[xr]() {
|
|
1717
|
+
this[Or](fs__rspack_import_5.readlinkSync(this.absolute));
|
|
1671
1718
|
}
|
|
1672
|
-
[
|
|
1673
|
-
this[
|
|
1719
|
+
[kr]() {
|
|
1720
|
+
this[Ar](fs__rspack_import_5.openSync(this.absolute, `r`));
|
|
1674
1721
|
}
|
|
1675
|
-
[
|
|
1722
|
+
[wr]() {
|
|
1676
1723
|
let e = !0;
|
|
1677
1724
|
try {
|
|
1678
1725
|
let { fd: t, buf: n, offset: r, length: i, pos: a } = this;
|
|
1679
1726
|
if (t === void 0 || n === void 0) throw Error(`fd and buf must be set in READ method`);
|
|
1680
1727
|
let o = fs__rspack_import_5.readSync(t, n, r, i, a);
|
|
1681
|
-
this[
|
|
1728
|
+
this[Dr](o), e = !1;
|
|
1682
1729
|
} finally {
|
|
1683
1730
|
if (e) try {
|
|
1684
|
-
this[
|
|
1731
|
+
this[q](() => {});
|
|
1685
1732
|
} catch {}
|
|
1686
1733
|
}
|
|
1687
1734
|
}
|
|
1688
|
-
[
|
|
1735
|
+
[Mr](e) {
|
|
1689
1736
|
e();
|
|
1690
1737
|
}
|
|
1691
|
-
[
|
|
1738
|
+
[q](e = () => {}) {
|
|
1692
1739
|
this.fd !== void 0 && fs__rspack_import_5.closeSync(this.fd), e();
|
|
1693
1740
|
}
|
|
1694
|
-
},
|
|
1741
|
+
}, Ir = class extends Ue {
|
|
1695
1742
|
blockLen = 0;
|
|
1696
1743
|
blockRemain = 0;
|
|
1697
1744
|
buf = 0;
|
|
@@ -1720,22 +1767,22 @@ while (this[On](this[G].shift()));
|
|
|
1720
1767
|
size;
|
|
1721
1768
|
onWriteEntry;
|
|
1722
1769
|
warn(e, t, n = {}) {
|
|
1723
|
-
return
|
|
1770
|
+
return wn(this, e, t, n);
|
|
1724
1771
|
}
|
|
1725
1772
|
constructor(e, t = {}) {
|
|
1726
1773
|
let n = St(t);
|
|
1727
1774
|
super(), this.preservePaths = !!n.preservePaths, this.portable = !!n.portable, this.strict = !!n.strict, this.noPax = !!n.noPax, this.noMtime = !!n.noMtime, this.onWriteEntry = n.onWriteEntry, this.readEntry = e;
|
|
1728
1775
|
let { type: r } = e;
|
|
1729
1776
|
if (r === `Unsupported`) throw Error(`writing entry that should be ignored`);
|
|
1730
|
-
this.type = r, this.type === `Directory` && this.portable && (this.noMtime = !0), this.prefix = n.prefix, this.path =
|
|
1777
|
+
this.type = r, this.type === `Directory` && this.portable && (this.noMtime = !0), this.prefix = n.prefix, this.path = L(e.path), this.mode = e.mode === void 0 ? void 0 : this[jr](e.mode), 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 : n.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 ? void 0 : L(e.linkpath), typeof n.onwarn == `function` && this.on(`warn`, n.onwarn);
|
|
1731
1778
|
let i = !1;
|
|
1732
1779
|
if (!this.preservePaths) {
|
|
1733
|
-
let [e, t] =
|
|
1780
|
+
let [e, t] = lr(this.path);
|
|
1734
1781
|
e && typeof t == `string` && (this.path = t, i = e);
|
|
1735
1782
|
}
|
|
1736
1783
|
this.remain = e.size, this.blockRemain = e.startBlockSize, this.onWriteEntry?.(this), this.header = new I({
|
|
1737
|
-
path: this[
|
|
1738
|
-
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[
|
|
1784
|
+
path: this[J](this.path),
|
|
1785
|
+
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[J](this.linkpath) : this.linkpath,
|
|
1739
1786
|
mode: this.mode,
|
|
1740
1787
|
uid: this.portable ? void 0 : this.uid,
|
|
1741
1788
|
gid: this.portable ? void 0 : this.gid,
|
|
@@ -1748,13 +1795,13 @@ while (this[On](this[G].shift()));
|
|
|
1748
1795
|
}), i && this.warn(`TAR_ENTRY_INFO`, `stripping ${i} from absolute path`, {
|
|
1749
1796
|
entry: this,
|
|
1750
1797
|
path: i + this.path
|
|
1751
|
-
}), this.header.encode() && !this.noPax && super.write(new
|
|
1798
|
+
}), this.header.encode() && !this.noPax && super.write(new yn({
|
|
1752
1799
|
atime: this.portable ? void 0 : this.atime,
|
|
1753
1800
|
ctime: this.portable ? void 0 : this.ctime,
|
|
1754
1801
|
gid: this.portable ? void 0 : this.gid,
|
|
1755
1802
|
mtime: this.noMtime ? void 0 : this.mtime,
|
|
1756
|
-
path: this[
|
|
1757
|
-
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[
|
|
1803
|
+
path: this[J](this.path),
|
|
1804
|
+
linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[J](this.linkpath) : this.linkpath,
|
|
1758
1805
|
size: this.size,
|
|
1759
1806
|
uid: this.portable ? void 0 : this.uid,
|
|
1760
1807
|
uname: this.portable ? void 0 : this.uname,
|
|
@@ -1766,11 +1813,11 @@ while (this[On](this[G].shift()));
|
|
|
1766
1813
|
if (!a) throw Error(`failed to encode header`);
|
|
1767
1814
|
super.write(a), e.pipe(this);
|
|
1768
1815
|
}
|
|
1769
|
-
[
|
|
1770
|
-
return
|
|
1816
|
+
[J](e) {
|
|
1817
|
+
return gr(e, this.prefix);
|
|
1771
1818
|
}
|
|
1772
|
-
[
|
|
1773
|
-
return
|
|
1819
|
+
[jr](e) {
|
|
1820
|
+
return or(e, this.type === `Directory`, this.portable);
|
|
1774
1821
|
}
|
|
1775
1822
|
write(e, t, n) {
|
|
1776
1823
|
typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`));
|
|
@@ -1781,7 +1828,7 @@ while (this[On](this[G].shift()));
|
|
|
1781
1828
|
end(e, t, n) {
|
|
1782
1829
|
return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, t ?? `utf8`)), n && this.once(`finish`, n), e ? super.end(e, n) : super.end(n), this;
|
|
1783
1830
|
}
|
|
1784
|
-
},
|
|
1831
|
+
}, Lr = (e) => e.isFile() ? `File` : e.isDirectory() ? `Directory` : e.isSymbolicLink() ? `SymbolicLink` : `Unsupported`, Rr = class e {
|
|
1785
1832
|
tail;
|
|
1786
1833
|
head;
|
|
1787
1834
|
length = 0;
|
|
@@ -1812,11 +1859,11 @@ while (this[On](this[G].shift()));
|
|
|
1812
1859
|
e.list = this, e.prev = t, t && (t.next = e), this.tail = e, this.head ||= e, this.length++;
|
|
1813
1860
|
}
|
|
1814
1861
|
push(...e) {
|
|
1815
|
-
for (let t = 0, n = e.length; t < n; t++)
|
|
1862
|
+
for (let t = 0, n = e.length; t < n; t++) Br(this, e[t]);
|
|
1816
1863
|
return this.length;
|
|
1817
1864
|
}
|
|
1818
1865
|
unshift(...e) {
|
|
1819
|
-
for (var t = 0, n = e.length; t < n; t++)
|
|
1866
|
+
for (var t = 0, n = e.length; t < n; t++) Vr(this, e[t]);
|
|
1820
1867
|
return this.length;
|
|
1821
1868
|
}
|
|
1822
1869
|
pop() {
|
|
@@ -1912,7 +1959,7 @@ while (this[On](this[G].shift()));
|
|
|
1912
1959
|
let i = [];
|
|
1913
1960
|
for (let e = 0; r && e < t; e++) i.push(r.value), r = this.removeNode(r);
|
|
1914
1961
|
r ? r !== this.tail && (r = r.prev) : r = this.tail;
|
|
1915
|
-
for (let e of n) r =
|
|
1962
|
+
for (let e of n) r = zr(this, r, e);
|
|
1916
1963
|
return i;
|
|
1917
1964
|
}
|
|
1918
1965
|
reverse() {
|
|
@@ -1924,17 +1971,17 @@ while (this[On](this[G].shift()));
|
|
|
1924
1971
|
return this.head = t, this.tail = e, this;
|
|
1925
1972
|
}
|
|
1926
1973
|
};
|
|
1927
|
-
function
|
|
1928
|
-
let r = new
|
|
1974
|
+
function zr(e, t, n) {
|
|
1975
|
+
let r = new Hr(n, t, t ? t.next : e.head, e);
|
|
1929
1976
|
return r.next === void 0 && (e.tail = r), r.prev === void 0 && (e.head = r), e.length++, r;
|
|
1930
1977
|
}
|
|
1931
|
-
function
|
|
1932
|
-
e.tail = new
|
|
1978
|
+
function Br(e, t) {
|
|
1979
|
+
e.tail = new Hr(t, e.tail, void 0, e), e.head ||= e.tail, e.length++;
|
|
1933
1980
|
}
|
|
1934
|
-
function
|
|
1935
|
-
e.head = new
|
|
1981
|
+
function Vr(e, t) {
|
|
1982
|
+
e.head = new Hr(t, void 0, e.head, e), e.tail ||= e.head, e.length++;
|
|
1936
1983
|
}
|
|
1937
|
-
var
|
|
1984
|
+
var Hr = class {
|
|
1938
1985
|
list;
|
|
1939
1986
|
next;
|
|
1940
1987
|
prev;
|
|
@@ -1942,7 +1989,7 @@ var Ir = class {
|
|
|
1942
1989
|
constructor(e, t, n, r) {
|
|
1943
1990
|
this.list = r, this.value = e, t ? (t.next = this, this.prev = t) : this.prev = void 0, n ? (n.prev = this, this.next = n) : this.next = void 0;
|
|
1944
1991
|
}
|
|
1945
|
-
},
|
|
1992
|
+
}, Ur = class {
|
|
1946
1993
|
path;
|
|
1947
1994
|
absolute;
|
|
1948
1995
|
entry;
|
|
@@ -1955,7 +2002,7 @@ var Ir = class {
|
|
|
1955
2002
|
constructor(e, t) {
|
|
1956
2003
|
this.path = e || `./`, this.absolute = t;
|
|
1957
2004
|
}
|
|
1958
|
-
},
|
|
2005
|
+
}, Wr = Buffer.alloc(1024), Gr = Symbol(`onStat`), Kr = Symbol(`ended`), Y = Symbol(`queue`), qr = Symbol(`pendingLinks`), X = Symbol(`current`), Jr = Symbol(`process`), Yr = Symbol(`processing`), Xr = Symbol(`processJob`), Z = Symbol(`jobs`), Zr = Symbol(`jobDone`), Qr = Symbol(`addFSEntry`), $r = Symbol(`addTarEntry`), ei = Symbol(`stat`), ti = Symbol(`readdir`), ni = Symbol(`onreaddir`), ri = Symbol(`pipe`), ii = Symbol(`entry`), ai = Symbol(`entryOpt`), oi = Symbol(`writeEntryClass`), si = Symbol(`write`), ci = Symbol(`ondrain`), li = class extends Ue {
|
|
1959
2006
|
sync = !1;
|
|
1960
2007
|
opt;
|
|
1961
2008
|
cwd;
|
|
@@ -1976,120 +2023,120 @@ var Ir = class {
|
|
|
1976
2023
|
mtime;
|
|
1977
2024
|
filter;
|
|
1978
2025
|
jobs;
|
|
1979
|
-
[
|
|
2026
|
+
[oi];
|
|
1980
2027
|
onWriteEntry;
|
|
1981
|
-
[
|
|
1982
|
-
[
|
|
2028
|
+
[Y];
|
|
2029
|
+
[qr] = /* @__PURE__ */ new Map();
|
|
1983
2030
|
[Z] = 0;
|
|
1984
|
-
[
|
|
1985
|
-
[
|
|
2031
|
+
[Yr] = !1;
|
|
2032
|
+
[Kr] = !1;
|
|
1986
2033
|
constructor(e = {}) {
|
|
1987
|
-
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 =
|
|
2034
|
+
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 = L(e.prefix || ``), this.linkCache = e.linkCache || /* @__PURE__ */ new Map(), this.statCache = e.statCache || /* @__PURE__ */ new Map(), this.readdirCache = e.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = e.onWriteEntry, this[oi] = Pr, typeof e.onwarn == `function` && this.on(`warn`, e.onwarn), this.portable = !!e.portable, e.gzip || e.brotli || e.zstd) {
|
|
1988
2035
|
if (+!!e.gzip + +!!e.brotli + +!!e.zstd > 1) throw TypeError(`gzip, brotli, zstd are mutually exclusive`);
|
|
1989
2036
|
if (e.gzip && (typeof e.gzip != `object` && (e.gzip = {}), this.portable && (e.gzip.portable = !0), this.zip = new Pt(e.gzip)), e.brotli && (typeof e.brotli != `object` && (e.brotli = {}), this.zip = new Lt(e.brotli)), e.zstd && (typeof e.zstd != `object` && (e.zstd = {}), this.zip = new Bt(e.zstd)), !this.zip) throw Error(`impossible`);
|
|
1990
2037
|
let t = this.zip;
|
|
1991
|
-
t.on(`data`, (e) => super.write(e)), t.on(`end`, () => super.end()), t.on(`drain`, () => this[
|
|
1992
|
-
} else this.on(`drain`, this[
|
|
1993
|
-
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[
|
|
2038
|
+
t.on(`data`, (e) => super.write(e)), t.on(`end`, () => super.end()), t.on(`drain`, () => this[ci]()), this.on(`resume`, () => t.resume());
|
|
2039
|
+
} else this.on(`drain`, this[ci]);
|
|
2040
|
+
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[Y] = new Rr(), this[Z] = 0, this.jobs = Number(e.jobs) || 4, this[Yr] = !1, this[Kr] = !1;
|
|
1994
2041
|
}
|
|
1995
|
-
[
|
|
2042
|
+
[si](e) {
|
|
1996
2043
|
return super.write(e);
|
|
1997
2044
|
}
|
|
1998
2045
|
add(e) {
|
|
1999
2046
|
return this.write(e), this;
|
|
2000
2047
|
}
|
|
2001
2048
|
end(e, t, n) {
|
|
2002
|
-
return typeof e == `function` && (n = e, e = void 0), typeof t == `function` && (n = t, t = void 0), e && this.add(e), this[
|
|
2049
|
+
return typeof e == `function` && (n = e, e = void 0), typeof t == `function` && (n = t, t = void 0), e && this.add(e), this[Kr] = !0, this[Jr](), n && n(), this;
|
|
2003
2050
|
}
|
|
2004
2051
|
write(e) {
|
|
2005
|
-
if (this[
|
|
2006
|
-
return typeof e == `string` ? this[
|
|
2052
|
+
if (this[Kr]) throw Error(`write after end`);
|
|
2053
|
+
return typeof e == `string` ? this[Qr](e) : this[$r](e), this.flowing;
|
|
2007
2054
|
}
|
|
2008
|
-
[
|
|
2009
|
-
let t =
|
|
2055
|
+
[$r](e) {
|
|
2056
|
+
let t = L(path__rspack_import_8.resolve(this.cwd, e.path));
|
|
2010
2057
|
if (!this.filter(e.path, e)) e.resume();
|
|
2011
2058
|
else {
|
|
2012
|
-
let n = new
|
|
2013
|
-
n.entry = new
|
|
2059
|
+
let n = new Ur(e.path, t);
|
|
2060
|
+
n.entry = new Ir(e, this[ai](n)), n.entry.on(`end`, () => this[Zr](n)), this[Z] += 1, this[Y].push(n);
|
|
2014
2061
|
}
|
|
2015
|
-
this[
|
|
2062
|
+
this[Jr]();
|
|
2016
2063
|
}
|
|
2017
|
-
[
|
|
2018
|
-
let t =
|
|
2019
|
-
this[
|
|
2064
|
+
[Qr](e) {
|
|
2065
|
+
let t = L(path__rspack_import_8.resolve(this.cwd, e));
|
|
2066
|
+
this[Y].push(new Ur(e, t)), this[Jr]();
|
|
2020
2067
|
}
|
|
2021
|
-
[
|
|
2068
|
+
[ei](e) {
|
|
2022
2069
|
e.pending = !0, this[Z] += 1, fs__rspack_import_5[this.follow ? `stat` : `lstat`](e.absolute, (t, n) => {
|
|
2023
|
-
e.pending = !1, --this[Z], t ? this.emit(`error`, t) : this[
|
|
2070
|
+
e.pending = !1, --this[Z], t ? this.emit(`error`, t) : this[Gr](e, n);
|
|
2024
2071
|
});
|
|
2025
2072
|
}
|
|
2026
|
-
[
|
|
2073
|
+
[Gr](e, t) {
|
|
2027
2074
|
if (this.statCache.set(e.absolute, t), e.stat = t, !this.filter(e.path, t)) e.ignore = !0;
|
|
2028
|
-
else if (t.isFile() && t.nlink > 1 && !this.linkCache.get(`${t.dev}:${t.ino}`) && !this.sync) if (e === this[
|
|
2075
|
+
else if (t.isFile() && t.nlink > 1 && !this.linkCache.get(`${t.dev}:${t.ino}`) && !this.sync) if (e === this[X]) this[Xr](e);
|
|
2029
2076
|
else {
|
|
2030
|
-
let n = `${t.dev}:${t.ino}`, r = this[
|
|
2031
|
-
r ? r.push(e) : this[
|
|
2077
|
+
let n = `${t.dev}:${t.ino}`, r = this[qr].get(n);
|
|
2078
|
+
r ? r.push(e) : this[qr].set(n, [e]), e.pendingLink = !0, e.pending = !0;
|
|
2032
2079
|
}
|
|
2033
|
-
this[
|
|
2080
|
+
this[Jr]();
|
|
2034
2081
|
}
|
|
2035
|
-
[
|
|
2082
|
+
[ti](e) {
|
|
2036
2083
|
e.pending = !0, this[Z] += 1, fs__rspack_import_5.readdir(e.absolute, (t, n) => {
|
|
2037
2084
|
if (e.pending = !1, --this[Z], t) return this.emit(`error`, t);
|
|
2038
|
-
this[
|
|
2085
|
+
this[ni](e, n);
|
|
2039
2086
|
});
|
|
2040
2087
|
}
|
|
2041
|
-
[
|
|
2042
|
-
this.readdirCache.set(e.absolute, t), e.readdir = t, this[
|
|
2088
|
+
[ni](e, t) {
|
|
2089
|
+
this.readdirCache.set(e.absolute, t), e.readdir = t, this[Jr]();
|
|
2043
2090
|
}
|
|
2044
|
-
[
|
|
2045
|
-
if (!this[
|
|
2046
|
-
this[
|
|
2047
|
-
for (let e = this[
|
|
2091
|
+
[Jr]() {
|
|
2092
|
+
if (!this[Yr]) {
|
|
2093
|
+
this[Yr] = !0;
|
|
2094
|
+
for (let e = this[Y].head; e && this[Z] < this.jobs; e = e.next) if (this[Xr](e.value), e.value.ignore) {
|
|
2048
2095
|
let t = e.next;
|
|
2049
|
-
this[
|
|
2096
|
+
this[Y].removeNode(e), e.next = t;
|
|
2050
2097
|
}
|
|
2051
|
-
this[
|
|
2098
|
+
this[Yr] = !1, this[Kr] && this[Y].length === 0 && this[Z] === 0 && (this.zip ? this.zip.end(Wr) : (super.write(Wr), super.end()));
|
|
2052
2099
|
}
|
|
2053
2100
|
}
|
|
2054
|
-
get [
|
|
2055
|
-
return this[
|
|
2101
|
+
get [X]() {
|
|
2102
|
+
return this[Y] && this[Y].head && this[Y].head.value;
|
|
2056
2103
|
}
|
|
2057
|
-
[
|
|
2058
|
-
this[
|
|
2104
|
+
[Zr](e) {
|
|
2105
|
+
this[Y].shift(), --this[Z];
|
|
2059
2106
|
let { stat: t } = e;
|
|
2060
2107
|
if (t && t.isFile() && t.nlink > 1) {
|
|
2061
|
-
let e = `${t.dev}:${t.ino}`, n = this[
|
|
2108
|
+
let e = `${t.dev}:${t.ino}`, n = this[qr].get(e);
|
|
2062
2109
|
if (n) {
|
|
2063
|
-
this[
|
|
2064
|
-
for (let e of n) e.pending = !1, this[
|
|
2110
|
+
this[qr].delete(e);
|
|
2111
|
+
for (let e of n) e.pending = !1, this[Xr](e);
|
|
2065
2112
|
}
|
|
2066
2113
|
}
|
|
2067
|
-
this[
|
|
2114
|
+
this[Jr]();
|
|
2068
2115
|
}
|
|
2069
|
-
[
|
|
2070
|
-
if (e.pending && e.pendingLink && e === this[
|
|
2116
|
+
[Xr](e) {
|
|
2117
|
+
if (e.pending && e.pendingLink && e === this[X] && (e.pending = !1, e.pendingLink = !1), !e.pending) {
|
|
2071
2118
|
if (e.entry) {
|
|
2072
|
-
e === this[
|
|
2119
|
+
e === this[X] && !e.piped && this[ri](e);
|
|
2073
2120
|
return;
|
|
2074
2121
|
}
|
|
2075
2122
|
if (!e.stat) {
|
|
2076
2123
|
let t = this.statCache.get(e.absolute);
|
|
2077
|
-
t ? this[
|
|
2124
|
+
t ? this[Gr](e, t) : this[ei](e);
|
|
2078
2125
|
}
|
|
2079
2126
|
if (e.stat && !e.ignore) {
|
|
2080
2127
|
if (!this.noDirRecurse && e.stat.isDirectory() && !e.readdir) {
|
|
2081
2128
|
let t = this.readdirCache.get(e.absolute);
|
|
2082
|
-
if (t ? this[
|
|
2129
|
+
if (t ? this[ni](e, t) : this[ti](e), !e.readdir) return;
|
|
2083
2130
|
}
|
|
2084
|
-
if (e.entry = this[
|
|
2131
|
+
if (e.entry = this[ii](e), !e.entry) {
|
|
2085
2132
|
e.ignore = !0;
|
|
2086
2133
|
return;
|
|
2087
2134
|
}
|
|
2088
|
-
e === this[
|
|
2135
|
+
e === this[X] && !e.piped && this[ri](e);
|
|
2089
2136
|
}
|
|
2090
2137
|
}
|
|
2091
2138
|
}
|
|
2092
|
-
[
|
|
2139
|
+
[ai](e) {
|
|
2093
2140
|
return {
|
|
2094
2141
|
onwarn: (e, t, n) => this.warn(e, t, n),
|
|
2095
2142
|
noPax: this.noPax,
|
|
@@ -2107,21 +2154,21 @@ var Ir = class {
|
|
|
2107
2154
|
onWriteEntry: this.onWriteEntry
|
|
2108
2155
|
};
|
|
2109
2156
|
}
|
|
2110
|
-
[
|
|
2157
|
+
[ii](e) {
|
|
2111
2158
|
this[Z] += 1;
|
|
2112
2159
|
try {
|
|
2113
|
-
return new this[
|
|
2160
|
+
return new this[oi](e.path, this[ai](e)).on(`end`, () => this[Zr](e)).on(`error`, (e) => this.emit(`error`, e));
|
|
2114
2161
|
} catch (e) {
|
|
2115
2162
|
this.emit(`error`, e);
|
|
2116
2163
|
}
|
|
2117
2164
|
}
|
|
2118
|
-
[
|
|
2119
|
-
this[
|
|
2165
|
+
[ci]() {
|
|
2166
|
+
this[X] && this[X].entry && this[X].entry.resume();
|
|
2120
2167
|
}
|
|
2121
|
-
[
|
|
2168
|
+
[ri](e) {
|
|
2122
2169
|
e.piped = !0, e.readdir && e.readdir.forEach((t) => {
|
|
2123
2170
|
let n = e.path, r = n === `./` ? `` : n.replace(/\/*$/, `/`);
|
|
2124
|
-
this[
|
|
2171
|
+
this[Qr](r + t);
|
|
2125
2172
|
});
|
|
2126
2173
|
let t = e.entry, n = this.zip;
|
|
2127
2174
|
if (!t) throw Error(`cannot pipe without source`);
|
|
@@ -2135,55 +2182,55 @@ var Ir = class {
|
|
|
2135
2182
|
return this.zip && this.zip.pause(), super.pause();
|
|
2136
2183
|
}
|
|
2137
2184
|
warn(e, t, n = {}) {
|
|
2138
|
-
|
|
2185
|
+
wn(this, e, t, n);
|
|
2139
2186
|
}
|
|
2140
|
-
},
|
|
2187
|
+
}, ui = class extends li {
|
|
2141
2188
|
sync = !0;
|
|
2142
2189
|
constructor(e) {
|
|
2143
|
-
super(e), this[
|
|
2190
|
+
super(e), this[oi] = Fr;
|
|
2144
2191
|
}
|
|
2145
2192
|
pause() {}
|
|
2146
2193
|
resume() {}
|
|
2147
|
-
[
|
|
2194
|
+
[ei](e) {
|
|
2148
2195
|
let t = this.follow ? `statSync` : `lstatSync`;
|
|
2149
|
-
this[
|
|
2196
|
+
this[Gr](e, fs__rspack_import_5[t](e.absolute));
|
|
2150
2197
|
}
|
|
2151
|
-
[
|
|
2152
|
-
this[
|
|
2198
|
+
[ti](e) {
|
|
2199
|
+
this[ni](e, fs__rspack_import_5.readdirSync(e.absolute));
|
|
2153
2200
|
}
|
|
2154
|
-
[
|
|
2201
|
+
[ri](e) {
|
|
2155
2202
|
let t = e.entry, n = this.zip;
|
|
2156
2203
|
if (e.readdir && e.readdir.forEach((t) => {
|
|
2157
2204
|
let n = e.path, r = n === `./` ? `` : n.replace(/\/*$/, `/`);
|
|
2158
|
-
this[
|
|
2205
|
+
this[Qr](r + t);
|
|
2159
2206
|
}), !t) throw Error(`Cannot pipe without source`);
|
|
2160
2207
|
n ? t.on(`data`, (e) => {
|
|
2161
2208
|
n.write(e);
|
|
2162
2209
|
}) : t.on(`data`, (e) => {
|
|
2163
|
-
super[
|
|
2210
|
+
super[si](e);
|
|
2164
2211
|
});
|
|
2165
2212
|
}
|
|
2166
|
-
},
|
|
2167
|
-
let n = new
|
|
2168
|
-
n.pipe(r),
|
|
2169
|
-
},
|
|
2170
|
-
let n = new
|
|
2213
|
+
}, di = (e, t) => {
|
|
2214
|
+
let n = new ui(e), r = new mt(e.file, { mode: e.mode || 438 });
|
|
2215
|
+
n.pipe(r), pi(n, t);
|
|
2216
|
+
}, fi = (e, t) => {
|
|
2217
|
+
let n = new li(e), r = new pt(e.file, { mode: e.mode || 438 });
|
|
2171
2218
|
n.pipe(r);
|
|
2172
2219
|
let i = new Promise((e, t) => {
|
|
2173
2220
|
r.on(`error`, t), r.on(`close`, e), n.on(`error`, t);
|
|
2174
2221
|
});
|
|
2175
|
-
return
|
|
2176
|
-
},
|
|
2222
|
+
return mi(n, t).catch((e) => n.emit(`error`, e)), i;
|
|
2223
|
+
}, pi = (e, t) => {
|
|
2177
2224
|
t.forEach((t) => {
|
|
2178
|
-
t.charAt(0) === `@` ?
|
|
2225
|
+
t.charAt(0) === `@` ? ar({
|
|
2179
2226
|
file: node_path__rspack_import_3.resolve(e.cwd, t.slice(1)),
|
|
2180
2227
|
sync: !0,
|
|
2181
2228
|
noResume: !0,
|
|
2182
2229
|
onReadEntry: (t) => e.add(t)
|
|
2183
2230
|
}) : e.add(t);
|
|
2184
2231
|
}), e.end();
|
|
2185
|
-
},
|
|
2186
|
-
for (let n of t) n.charAt(0) === `@` ? await
|
|
2232
|
+
}, mi = async (e, t) => {
|
|
2233
|
+
for (let n of t) n.charAt(0) === `@` ? await ar({
|
|
2187
2234
|
file: node_path__rspack_import_3.resolve(String(e.cwd), n.slice(1)),
|
|
2188
2235
|
noResume: !0,
|
|
2189
2236
|
onReadEntry: (t) => {
|
|
@@ -2191,59 +2238,59 @@ var Ir = class {
|
|
|
2191
2238
|
}
|
|
2192
2239
|
}) : e.add(n);
|
|
2193
2240
|
e.end();
|
|
2194
|
-
},
|
|
2195
|
-
let n = new
|
|
2196
|
-
return
|
|
2241
|
+
}, hi = Ct(di, fi, (e, t) => {
|
|
2242
|
+
let n = new ui(e);
|
|
2243
|
+
return pi(n, t), n;
|
|
2197
2244
|
}, (e, t) => {
|
|
2198
|
-
let n = new
|
|
2199
|
-
return
|
|
2245
|
+
let n = new li(e);
|
|
2246
|
+
return mi(n, t).catch((e) => n.emit(`error`, e)), n;
|
|
2200
2247
|
}, (e, t) => {
|
|
2201
2248
|
if (!t?.length) throw TypeError(`no paths specified to add to archive`);
|
|
2202
|
-
}),
|
|
2249
|
+
}), gi = (process.env.__FAKE_PLATFORM__ || process.platform) === `win32`, { O_CREAT: _i, O_NOFOLLOW: vi, O_TRUNC: yi, O_WRONLY: bi } = fs__rspack_import_5.constants, xi = Number(process.env.__FAKE_FS_O_FILENAME__) || fs__rspack_import_5.constants.UV_FS_O_FILEMAP || 0, Si = gi && !!xi, Ci = 512 * 1024, wi = xi | yi | _i | bi, Ti = !gi && typeof vi == `number` ? vi | yi | _i | bi : null, Ei = Ti === null ? Si ? (e) => e < Ci ? wi : `w` : () => `w` : () => Ti, Di = (e, n, r) => {
|
|
2203
2250
|
try {
|
|
2204
2251
|
return node_fs__rspack_import_0.lchownSync(e, n, r);
|
|
2205
2252
|
} catch (e) {
|
|
2206
2253
|
if (e?.code !== `ENOENT`) throw e;
|
|
2207
2254
|
}
|
|
2208
|
-
},
|
|
2255
|
+
}, Oi = (e, n, r, i) => {
|
|
2209
2256
|
node_fs__rspack_import_0.lchown(e, n, r, (e) => {
|
|
2210
2257
|
i(e && e?.code !== `ENOENT` ? e : null);
|
|
2211
2258
|
});
|
|
2212
|
-
},
|
|
2213
|
-
t.isDirectory() ?
|
|
2259
|
+
}, ki = (e, t, n, r, a) => {
|
|
2260
|
+
t.isDirectory() ? Ai(node_path__rspack_import_3.resolve(e, t.name), n, r, (o) => {
|
|
2214
2261
|
if (o) return a(o);
|
|
2215
|
-
|
|
2216
|
-
}) :
|
|
2217
|
-
},
|
|
2262
|
+
Oi(node_path__rspack_import_3.resolve(e, t.name), n, r, a);
|
|
2263
|
+
}) : Oi(node_path__rspack_import_3.resolve(e, t.name), n, r, a);
|
|
2264
|
+
}, Ai = (e, n, r, i) => {
|
|
2218
2265
|
node_fs__rspack_import_0.readdir(e, { withFileTypes: !0 }, (t, a) => {
|
|
2219
2266
|
if (t) {
|
|
2220
2267
|
if (t.code === `ENOENT`) return i();
|
|
2221
2268
|
if (t.code !== `ENOTDIR` && t.code !== `ENOTSUP`) return i(t);
|
|
2222
2269
|
}
|
|
2223
|
-
if (t || !a.length) return
|
|
2270
|
+
if (t || !a.length) return Oi(e, n, r, i);
|
|
2224
2271
|
let o = a.length, s = null, c = (t) => {
|
|
2225
2272
|
if (!s) {
|
|
2226
2273
|
if (t) return i(s = t);
|
|
2227
|
-
if (--o === 0) return
|
|
2274
|
+
if (--o === 0) return Oi(e, n, r, i);
|
|
2228
2275
|
}
|
|
2229
2276
|
};
|
|
2230
|
-
for (let t of a)
|
|
2277
|
+
for (let t of a) ki(e, t, n, r, c);
|
|
2231
2278
|
});
|
|
2232
|
-
},
|
|
2233
|
-
t.isDirectory() &&
|
|
2234
|
-
},
|
|
2279
|
+
}, ji = (e, t, n, r) => {
|
|
2280
|
+
t.isDirectory() && Mi(node_path__rspack_import_3.resolve(e, t.name), n, r), Di(node_path__rspack_import_3.resolve(e, t.name), n, r);
|
|
2281
|
+
}, Mi = (e, n, r) => {
|
|
2235
2282
|
let i;
|
|
2236
2283
|
try {
|
|
2237
2284
|
i = node_fs__rspack_import_0.readdirSync(e, { withFileTypes: !0 });
|
|
2238
2285
|
} catch (t) {
|
|
2239
2286
|
let i = t;
|
|
2240
2287
|
if (i?.code === `ENOENT`) return;
|
|
2241
|
-
if (i?.code === `ENOTDIR` || i?.code === `ENOTSUP`) return
|
|
2288
|
+
if (i?.code === `ENOTDIR` || i?.code === `ENOTSUP`) return Di(e, n, r);
|
|
2242
2289
|
throw i;
|
|
2243
2290
|
}
|
|
2244
|
-
for (let t of i)
|
|
2245
|
-
return
|
|
2246
|
-
},
|
|
2291
|
+
for (let t of i) ji(e, t, n, r);
|
|
2292
|
+
return Di(e, n, r);
|
|
2293
|
+
}, Ni = class extends Error {
|
|
2247
2294
|
path;
|
|
2248
2295
|
code;
|
|
2249
2296
|
syscall = `chdir`;
|
|
@@ -2253,7 +2300,7 @@ var Ir = class {
|
|
|
2253
2300
|
get name() {
|
|
2254
2301
|
return `CwdError`;
|
|
2255
2302
|
}
|
|
2256
|
-
},
|
|
2303
|
+
}, Pi = class extends Error {
|
|
2257
2304
|
path;
|
|
2258
2305
|
symlink;
|
|
2259
2306
|
syscall = `symlink`;
|
|
@@ -2264,60 +2311,60 @@ var Ir = class {
|
|
|
2264
2311
|
get name() {
|
|
2265
2312
|
return `SymlinkError`;
|
|
2266
2313
|
}
|
|
2267
|
-
},
|
|
2314
|
+
}, Fi = (e, n) => {
|
|
2268
2315
|
node_fs__rspack_import_0.stat(e, (t, r) => {
|
|
2269
|
-
(t || !r.isDirectory()) && (t = new
|
|
2316
|
+
(t || !r.isDirectory()) && (t = new Ni(e, t?.code || `ENOTDIR`)), n(t);
|
|
2270
2317
|
});
|
|
2271
|
-
},
|
|
2272
|
-
e =
|
|
2273
|
-
let o = r.umask ?? 18, s = r.mode | 448, c = (s & o) !== 0, l = r.uid, u = r.gid, d = typeof l == `number` && typeof u == `number` && (l !== r.processUid || u !== r.processGid), f = r.preserve, ee = r.unlink, p =
|
|
2274
|
-
n ? a(n) : r && d ?
|
|
2318
|
+
}, Ii = (e, r, a) => {
|
|
2319
|
+
e = L(e);
|
|
2320
|
+
let o = r.umask ?? 18, s = r.mode | 448, c = (s & o) !== 0, l = r.uid, u = r.gid, d = typeof l == `number` && typeof u == `number` && (l !== r.processUid || u !== r.processGid), f = r.preserve, ee = r.unlink, p = L(r.cwd), m = (n, r) => {
|
|
2321
|
+
n ? a(n) : r && d ? Ai(r, l, u, (e) => m(e)) : c ? node_fs__rspack_import_0.chmod(e, s, a) : a();
|
|
2275
2322
|
};
|
|
2276
|
-
if (e === p) return
|
|
2323
|
+
if (e === p) return Fi(e, m);
|
|
2277
2324
|
if (f) return node_fs_promises__rspack_import_1.mkdir(e, {
|
|
2278
2325
|
mode: s,
|
|
2279
2326
|
recursive: !0
|
|
2280
2327
|
}).then((e) => m(null, e ?? void 0), m);
|
|
2281
|
-
|
|
2282
|
-
},
|
|
2328
|
+
Li(p, L(node_path__rspack_import_3.relative(p, e)).split(`/`), s, ee, p, void 0, m);
|
|
2329
|
+
}, Li = (e, n, r, a, o, s, c) => {
|
|
2283
2330
|
if (n.length === 0) return c(null, s);
|
|
2284
|
-
let l = n.shift(), u =
|
|
2285
|
-
node_fs__rspack_import_0.mkdir(u, r,
|
|
2286
|
-
},
|
|
2331
|
+
let l = n.shift(), u = L(node_path__rspack_import_3.resolve(e + `/` + l));
|
|
2332
|
+
node_fs__rspack_import_0.mkdir(u, r, Ri(u, n, r, a, o, s, c));
|
|
2333
|
+
}, Ri = (e, n, r, i, a, o, s) => (c) => {
|
|
2287
2334
|
c ? node_fs__rspack_import_0.lstat(e, (l, u) => {
|
|
2288
|
-
if (l) l.path = l.path &&
|
|
2289
|
-
else if (u.isDirectory())
|
|
2335
|
+
if (l) l.path = l.path && L(l.path), s(l);
|
|
2336
|
+
else if (u.isDirectory()) Li(e, n, r, i, a, o, s);
|
|
2290
2337
|
else if (i) node_fs__rspack_import_0.unlink(e, (c) => {
|
|
2291
2338
|
if (c) return s(c);
|
|
2292
|
-
node_fs__rspack_import_0.mkdir(e, r,
|
|
2339
|
+
node_fs__rspack_import_0.mkdir(e, r, Ri(e, n, r, i, a, o, s));
|
|
2293
2340
|
});
|
|
2294
2341
|
else {
|
|
2295
|
-
if (u.isSymbolicLink()) return s(new
|
|
2342
|
+
if (u.isSymbolicLink()) return s(new Pi(e, e + `/` + n.join(`/`)));
|
|
2296
2343
|
s(c);
|
|
2297
2344
|
}
|
|
2298
|
-
}) : (o ||= e,
|
|
2299
|
-
},
|
|
2345
|
+
}) : (o ||= e, Li(e, n, r, i, a, o, s));
|
|
2346
|
+
}, zi = (e) => {
|
|
2300
2347
|
let n = !1, r;
|
|
2301
2348
|
try {
|
|
2302
2349
|
n = node_fs__rspack_import_0.statSync(e).isDirectory();
|
|
2303
2350
|
} catch (e) {
|
|
2304
2351
|
r = e?.code;
|
|
2305
2352
|
} finally {
|
|
2306
|
-
if (!n) throw new
|
|
2353
|
+
if (!n) throw new Ni(e, r ?? `ENOTDIR`);
|
|
2307
2354
|
}
|
|
2308
|
-
},
|
|
2309
|
-
e =
|
|
2310
|
-
let r = n.umask ?? 18, a = n.mode | 448, o = (a & r) !== 0, s = n.uid, c = n.gid, l = typeof s == `number` && typeof c == `number` && (s !== n.processUid || c !== n.processGid), u = n.preserve, d = n.unlink, f =
|
|
2311
|
-
n && l &&
|
|
2355
|
+
}, Bi = (e, n) => {
|
|
2356
|
+
e = L(e);
|
|
2357
|
+
let r = n.umask ?? 18, a = n.mode | 448, o = (a & r) !== 0, s = n.uid, c = n.gid, l = typeof s == `number` && typeof c == `number` && (s !== n.processUid || c !== n.processGid), u = n.preserve, d = n.unlink, f = L(n.cwd), ee = (n) => {
|
|
2358
|
+
n && l && Mi(n, s, c), o && node_fs__rspack_import_0.chmodSync(e, a);
|
|
2312
2359
|
};
|
|
2313
|
-
if (e === f) return
|
|
2360
|
+
if (e === f) return zi(f), ee();
|
|
2314
2361
|
if (u) return ee(node_fs__rspack_import_0.mkdirSync(e, {
|
|
2315
2362
|
mode: a,
|
|
2316
2363
|
recursive: !0
|
|
2317
2364
|
}) ?? void 0);
|
|
2318
|
-
let p =
|
|
2365
|
+
let p = L(node_path__rspack_import_3.relative(f, e)).split(`/`), m;
|
|
2319
2366
|
for (let e = p.shift(), n = f; e && (n += `/` + e); e = p.shift()) {
|
|
2320
|
-
n =
|
|
2367
|
+
n = L(node_path__rspack_import_3.resolve(n));
|
|
2321
2368
|
try {
|
|
2322
2369
|
node_fs__rspack_import_0.mkdirSync(n, a), m ||= n;
|
|
2323
2370
|
} catch {
|
|
@@ -2326,27 +2373,27 @@ var Ir = class {
|
|
|
2326
2373
|
if (d) {
|
|
2327
2374
|
node_fs__rspack_import_0.unlinkSync(n), node_fs__rspack_import_0.mkdirSync(n, a), m ||= n;
|
|
2328
2375
|
continue;
|
|
2329
|
-
} else if (e.isSymbolicLink()) return new
|
|
2376
|
+
} else if (e.isSymbolicLink()) return new Pi(n, n + `/` + p.join(`/`));
|
|
2330
2377
|
}
|
|
2331
2378
|
}
|
|
2332
2379
|
return ee(m);
|
|
2333
|
-
},
|
|
2334
|
-
|
|
2335
|
-
let t =
|
|
2336
|
-
if (n >
|
|
2337
|
-
for (let e of
|
|
2380
|
+
}, Vi = Object.create(null), Hi = 1e4, Ui = /* @__PURE__ */ new Set(), Wi = (e) => {
|
|
2381
|
+
Ui.has(e) ? Ui.delete(e) : Vi[e] = e.normalize(`NFD`).toLocaleLowerCase(`en`).toLocaleUpperCase(`en`), Ui.add(e);
|
|
2382
|
+
let t = Vi[e], n = Ui.size - Hi;
|
|
2383
|
+
if (n > Hi / 10) {
|
|
2384
|
+
for (let e of Ui) if (Ui.delete(e), delete Vi[e], --n <= 0) break;
|
|
2338
2385
|
}
|
|
2339
2386
|
return t;
|
|
2340
|
-
},
|
|
2387
|
+
}, Gi = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32`, Ki = (e) => e.split(`/`).slice(0, -1).reduce((e, t) => {
|
|
2341
2388
|
let n = e.at(-1);
|
|
2342
2389
|
return n !== void 0 && (t = (0,node_path__rspack_import_3.join)(n, t)), e.push(t || `/`), e;
|
|
2343
|
-
}, []),
|
|
2390
|
+
}, []), qi = class {
|
|
2344
2391
|
#t = /* @__PURE__ */ new Map();
|
|
2345
2392
|
#i = /* @__PURE__ */ new Map();
|
|
2346
2393
|
#s = /* @__PURE__ */ new Set();
|
|
2347
2394
|
reserve(e, t) {
|
|
2348
|
-
e =
|
|
2349
|
-
let n = new Set(e.map((e) =>
|
|
2395
|
+
e = Gi ? [`win32 parallelization disabled`] : e.map((e) => nr((0,node_path__rspack_import_3.join)(Wi(e))));
|
|
2396
|
+
let n = new Set(e.map((e) => Ki(e)).reduce((e, t) => e.concat(t)));
|
|
2350
2397
|
this.#i.set(t, {
|
|
2351
2398
|
dirs: n,
|
|
2352
2399
|
paths: e
|
|
@@ -2357,10 +2404,10 @@ var Ir = class {
|
|
|
2357
2404
|
}
|
|
2358
2405
|
for (let e of n) {
|
|
2359
2406
|
let n = this.#t.get(e);
|
|
2360
|
-
if (!n) this.#t.set(e, [new Set([t])]);
|
|
2407
|
+
if (!n) this.#t.set(e, [/* @__PURE__ */ new Set([t])]);
|
|
2361
2408
|
else {
|
|
2362
2409
|
let e = n.at(-1);
|
|
2363
|
-
e instanceof Set ? e.add(t) : n.push(new Set([t]));
|
|
2410
|
+
e instanceof Set ? e.add(t) : n.push(/* @__PURE__ */ new Set([t]));
|
|
2364
2411
|
}
|
|
2365
2412
|
}
|
|
2366
2413
|
return this.#r(t);
|
|
@@ -2409,22 +2456,22 @@ var Ir = class {
|
|
|
2409
2456
|
}
|
|
2410
2457
|
return this.#s.delete(e), i.forEach((e) => this.#r(e)), !0;
|
|
2411
2458
|
}
|
|
2412
|
-
},
|
|
2413
|
-
if (!
|
|
2459
|
+
}, Ji = () => process.umask(), Yi = Symbol(`onEntry`), Xi = Symbol(`checkFs`), Zi = Symbol(`checkFs2`), Qi = Symbol(`isReusable`), Q = Symbol(`makeFs`), $i = Symbol(`file`), ea = Symbol(`directory`), ta = Symbol(`link`), na = Symbol(`symlink`), ra = Symbol(`hardlink`), ia = Symbol(`ensureNoSymlink`), aa = Symbol(`unsupported`), oa = Symbol(`checkPath`), sa = Symbol(`stripAbsolutePath`), ca = Symbol(`mkdir`), $ = Symbol(`onError`), la = Symbol(`pending`), ua = Symbol(`pend`), da = Symbol(`unpend`), fa = Symbol(`ended`), pa = Symbol(`maybeClose`), ma = Symbol(`skip`), ha = Symbol(`doChown`), ga = Symbol(`uid`), _a = Symbol(`gid`), va = Symbol(`checkedCwd`), ya = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32`, ba = 1024, xa = (e, n) => {
|
|
2460
|
+
if (!ya) return node_fs__rspack_import_0.unlink(e, n);
|
|
2414
2461
|
let r = e + `.DELETE.` + (0,node_crypto__rspack_import_13.randomBytes)(16).toString(`hex`);
|
|
2415
2462
|
node_fs__rspack_import_0.rename(e, r, (e) => {
|
|
2416
2463
|
if (e) return n(e);
|
|
2417
2464
|
node_fs__rspack_import_0.unlink(r, n);
|
|
2418
2465
|
});
|
|
2419
|
-
},
|
|
2420
|
-
if (!
|
|
2466
|
+
}, Sa = (e) => {
|
|
2467
|
+
if (!ya) return node_fs__rspack_import_0.unlinkSync(e);
|
|
2421
2468
|
let n = e + `.DELETE.` + (0,node_crypto__rspack_import_13.randomBytes)(16).toString(`hex`);
|
|
2422
2469
|
node_fs__rspack_import_0.renameSync(e, n), node_fs__rspack_import_0.unlinkSync(n);
|
|
2423
|
-
},
|
|
2424
|
-
[
|
|
2425
|
-
[
|
|
2426
|
-
[
|
|
2427
|
-
reservations = new
|
|
2470
|
+
}, Ca = (e, t, n) => e !== void 0 && e === e >>> 0 ? e : t !== void 0 && t === t >>> 0 ? t : n, wa = class extends tr {
|
|
2471
|
+
[fa] = !1;
|
|
2472
|
+
[va] = !1;
|
|
2473
|
+
[la] = 0;
|
|
2474
|
+
reservations = new qi();
|
|
2428
2475
|
transform;
|
|
2429
2476
|
writable = !0;
|
|
2430
2477
|
readable = !1;
|
|
@@ -2451,25 +2498,25 @@ var Ir = class {
|
|
|
2451
2498
|
chmod;
|
|
2452
2499
|
constructor(e = {}) {
|
|
2453
2500
|
if (e.ondone = () => {
|
|
2454
|
-
this[
|
|
2501
|
+
this[fa] = !0, this[pa]();
|
|
2455
2502
|
}, super(e), this.transform = e.transform, this.chmod = !!e.chmod, typeof e.uid == `number` || typeof e.gid == `number`) {
|
|
2456
2503
|
if (typeof e.uid != `number` || typeof e.gid != `number`) throw TypeError(`cannot set owner without number uid and gid`);
|
|
2457
2504
|
if (e.preserveOwner) throw TypeError(`cannot preserve owner in archive and also set owner explicitly`);
|
|
2458
2505
|
this.uid = e.uid, this.gid = e.gid, this.setOwner = !0;
|
|
2459
2506
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = !1;
|
|
2460
|
-
this.preserveOwner = e.preserveOwner === void 0 && typeof e.uid != `number` ?
|
|
2507
|
+
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 : ba, this.forceChown = e.forceChown === !0, this.win32 = !!e.win32 || ya, this.newer = !!e.newer, this.keep = !!e.keep, this.noMtime = !!e.noMtime, this.preservePaths = !!e.preservePaths, this.unlink = !!e.unlink, this.cwd = L(node_path__rspack_import_3.resolve(e.cwd || process.cwd())), this.strip = Number(e.strip) || 0, this.processUmask = this.chmod ? typeof e.processUmask == `number` ? e.processUmask : Ji() : 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`, (e) => this[Yi](e));
|
|
2461
2508
|
}
|
|
2462
2509
|
warn(e, t, n = {}) {
|
|
2463
2510
|
return (e === `TAR_BAD_ARCHIVE` || e === `TAR_ABORT`) && (n.recoverable = !1), super.warn(e, t, n);
|
|
2464
2511
|
}
|
|
2465
|
-
[
|
|
2466
|
-
this[
|
|
2512
|
+
[pa]() {
|
|
2513
|
+
this[fa] && this[la] === 0 && (this.emit(`prefinish`), this.emit(`finish`), this.emit(`end`));
|
|
2467
2514
|
}
|
|
2468
|
-
[
|
|
2515
|
+
[sa](e, t) {
|
|
2469
2516
|
let n = e[t], { type: r } = e;
|
|
2470
2517
|
if (!n || this.preservePaths) return !0;
|
|
2471
|
-
let [a, o] =
|
|
2472
|
-
if (s.includes(`..`) ||
|
|
2518
|
+
let [a, o] = lr(n), s = o.replaceAll(/\\/g, `/`).split(`/`);
|
|
2519
|
+
if (s.includes(`..`) || ya && /^[a-z]:\.\.$/i.test(s[0] ?? ``)) {
|
|
2473
2520
|
if (t === `path` || r === `Link`) return this.warn(`TAR_ENTRY_ERROR`, `${t} contains '..'`, {
|
|
2474
2521
|
entry: e,
|
|
2475
2522
|
[t]: n
|
|
@@ -2485,12 +2532,12 @@ var Ir = class {
|
|
|
2485
2532
|
[t]: n
|
|
2486
2533
|
})), !0;
|
|
2487
2534
|
}
|
|
2488
|
-
[
|
|
2489
|
-
let t =
|
|
2535
|
+
[oa](e) {
|
|
2536
|
+
let t = L(e.path), n = t.split(`/`);
|
|
2490
2537
|
if (this.strip) {
|
|
2491
2538
|
if (n.length < this.strip) return !1;
|
|
2492
2539
|
if (e.type === `Link`) {
|
|
2493
|
-
let t =
|
|
2540
|
+
let t = L(String(e.linkpath)).split(`/`);
|
|
2494
2541
|
if (t.length >= this.strip) e.linkpath = t.slice(this.strip).join(`/`);
|
|
2495
2542
|
else return !1;
|
|
2496
2543
|
}
|
|
@@ -2502,24 +2549,24 @@ var Ir = class {
|
|
|
2502
2549
|
depth: n.length,
|
|
2503
2550
|
maxDepth: this.maxDepth
|
|
2504
2551
|
}), !1;
|
|
2505
|
-
if (!this[
|
|
2506
|
-
if (e.absolute = node_path__rspack_import_3.isAbsolute(e.path) ?
|
|
2552
|
+
if (!this[sa](e, `path`) || !this[sa](e, `linkpath`)) return !1;
|
|
2553
|
+
if (e.absolute = node_path__rspack_import_3.isAbsolute(e.path) ? L(node_path__rspack_import_3.resolve(e.path)) : L(node_path__rspack_import_3.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`, {
|
|
2507
2554
|
entry: e,
|
|
2508
|
-
path:
|
|
2555
|
+
path: L(e.path),
|
|
2509
2556
|
resolvedPath: e.absolute,
|
|
2510
2557
|
cwd: this.cwd
|
|
2511
2558
|
}), !1;
|
|
2512
2559
|
if (e.absolute === this.cwd && e.type !== `Directory` && e.type !== `GNUDumpDir`) return !1;
|
|
2513
2560
|
if (this.win32) {
|
|
2514
2561
|
let { root: t } = node_path__rspack_import_3.win32.parse(String(e.absolute));
|
|
2515
|
-
e.absolute = t +
|
|
2562
|
+
e.absolute = t + mr(String(e.absolute).slice(t.length));
|
|
2516
2563
|
let { root: n } = node_path__rspack_import_3.win32.parse(e.path);
|
|
2517
|
-
e.path = n +
|
|
2564
|
+
e.path = n + mr(e.path.slice(n.length));
|
|
2518
2565
|
}
|
|
2519
2566
|
return !0;
|
|
2520
2567
|
}
|
|
2521
|
-
[
|
|
2522
|
-
if (!this[
|
|
2568
|
+
[Yi](e) {
|
|
2569
|
+
if (!this[oa](e)) return e.resume();
|
|
2523
2570
|
switch (node_assert__rspack_import_12.equal(typeof e.absolute, `string`), e.type) {
|
|
2524
2571
|
case `Directory`:
|
|
2525
2572
|
case `GNUDumpDir`: e.mode && (e.mode |= 448);
|
|
@@ -2527,15 +2574,15 @@ var Ir = class {
|
|
|
2527
2574
|
case `OldFile`:
|
|
2528
2575
|
case `ContiguousFile`:
|
|
2529
2576
|
case `Link`:
|
|
2530
|
-
case `SymbolicLink`: return this[
|
|
2531
|
-
default: return this[
|
|
2577
|
+
case `SymbolicLink`: return this[Xi](e);
|
|
2578
|
+
default: return this[aa](e);
|
|
2532
2579
|
}
|
|
2533
2580
|
}
|
|
2534
2581
|
[$](e, t) {
|
|
2535
|
-
e.name === `CwdError` ? this.emit(`error`, e) : (this.warn(`TAR_ENTRY_ERROR`, e, { entry: t }), this[
|
|
2582
|
+
e.name === `CwdError` ? this.emit(`error`, e) : (this.warn(`TAR_ENTRY_ERROR`, e, { entry: t }), this[da](), t.resume());
|
|
2536
2583
|
}
|
|
2537
|
-
[
|
|
2538
|
-
|
|
2584
|
+
[ca](e, t, n) {
|
|
2585
|
+
Ii(L(e), {
|
|
2539
2586
|
uid: this.uid,
|
|
2540
2587
|
gid: this.gid,
|
|
2541
2588
|
processUid: this.processUid,
|
|
@@ -2547,18 +2594,18 @@ var Ir = class {
|
|
|
2547
2594
|
mode: t
|
|
2548
2595
|
}, n);
|
|
2549
2596
|
}
|
|
2550
|
-
[
|
|
2597
|
+
[ha](e) {
|
|
2551
2598
|
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;
|
|
2552
2599
|
}
|
|
2553
|
-
[
|
|
2554
|
-
return
|
|
2600
|
+
[ga](e) {
|
|
2601
|
+
return Ca(this.uid, e.uid, this.processUid);
|
|
2555
2602
|
}
|
|
2556
|
-
[
|
|
2557
|
-
return
|
|
2603
|
+
[_a](e) {
|
|
2604
|
+
return Ca(this.gid, e.gid, this.processGid);
|
|
2558
2605
|
}
|
|
2559
|
-
[
|
|
2606
|
+
[$i](e, n) {
|
|
2560
2607
|
let r = typeof e.mode == `number` ? e.mode & 4095 : this.fmode, i = new pt(String(e.absolute), {
|
|
2561
|
-
flags:
|
|
2608
|
+
flags: Ei(e.size),
|
|
2562
2609
|
mode: r,
|
|
2563
2610
|
autoClose: !1
|
|
2564
2611
|
});
|
|
@@ -2571,7 +2618,7 @@ var Ir = class {
|
|
|
2571
2618
|
return;
|
|
2572
2619
|
}
|
|
2573
2620
|
--a === 0 && i.fd !== void 0 && node_fs__rspack_import_0.close(i.fd, (t) => {
|
|
2574
|
-
t ? this[$](t, e) : this[
|
|
2621
|
+
t ? this[$](t, e) : this[da](), n();
|
|
2575
2622
|
});
|
|
2576
2623
|
};
|
|
2577
2624
|
i.on(`finish`, () => {
|
|
@@ -2581,9 +2628,9 @@ var Ir = class {
|
|
|
2581
2628
|
let i = e.atime || /* @__PURE__ */ new Date(), s = e.mtime;
|
|
2582
2629
|
node_fs__rspack_import_0.futimes(r, i, s, (e) => e ? node_fs__rspack_import_0.utimes(n, i, s, (t) => o(t && e)) : o());
|
|
2583
2630
|
}
|
|
2584
|
-
if (typeof r == `number` && this[
|
|
2631
|
+
if (typeof r == `number` && this[ha](e)) {
|
|
2585
2632
|
a++;
|
|
2586
|
-
let i = this[
|
|
2633
|
+
let i = this[ga](e), s = this[_a](e);
|
|
2587
2634
|
typeof i == `number` && typeof s == `number` && node_fs__rspack_import_0.fchown(r, i, s, (e) => e ? node_fs__rspack_import_0.chown(n, i, s, (t) => o(t && e)) : o());
|
|
2588
2635
|
}
|
|
2589
2636
|
o();
|
|
@@ -2593,76 +2640,76 @@ var Ir = class {
|
|
|
2593
2640
|
this[$](t, e), n();
|
|
2594
2641
|
}), e.pipe(s)), s.pipe(i);
|
|
2595
2642
|
}
|
|
2596
|
-
[
|
|
2643
|
+
[ea](e, n) {
|
|
2597
2644
|
let r = typeof e.mode == `number` ? e.mode & 4095 : this.dmode;
|
|
2598
|
-
this[
|
|
2645
|
+
this[ca](String(e.absolute), r, (r) => {
|
|
2599
2646
|
if (r) {
|
|
2600
2647
|
this[$](r, e), n();
|
|
2601
2648
|
return;
|
|
2602
2649
|
}
|
|
2603
2650
|
let i = 1, a = () => {
|
|
2604
|
-
--i === 0 && (n(), this[
|
|
2651
|
+
--i === 0 && (n(), this[da](), e.resume());
|
|
2605
2652
|
};
|
|
2606
|
-
e.mtime && !this.noMtime && (i++, node_fs__rspack_import_0.utimes(String(e.absolute), e.atime || /* @__PURE__ */ new Date(), e.mtime, a)), this[
|
|
2653
|
+
e.mtime && !this.noMtime && (i++, node_fs__rspack_import_0.utimes(String(e.absolute), e.atime || /* @__PURE__ */ new Date(), e.mtime, a)), this[ha](e) && (i++, node_fs__rspack_import_0.chown(String(e.absolute), Number(this[ga](e)), Number(this[_a](e)), a)), a();
|
|
2607
2654
|
});
|
|
2608
2655
|
}
|
|
2609
|
-
[
|
|
2656
|
+
[aa](e) {
|
|
2610
2657
|
e.unsupported = !0, this.warn(`TAR_ENTRY_UNSUPPORTED`, `unsupported entry type: ${e.type}`, { entry: e }), e.resume();
|
|
2611
2658
|
}
|
|
2612
|
-
[
|
|
2613
|
-
let n =
|
|
2614
|
-
this[
|
|
2659
|
+
[na](e, t) {
|
|
2660
|
+
let n = L(node_path__rspack_import_3.relative(this.cwd, node_path__rspack_import_3.resolve(node_path__rspack_import_3.dirname(String(e.absolute)), String(e.linkpath)))).split(`/`);
|
|
2661
|
+
this[ia](e, this.cwd, n, () => this[ta](e, String(e.linkpath), `symlink`, t), (n) => {
|
|
2615
2662
|
this[$](n, e), t();
|
|
2616
2663
|
});
|
|
2617
2664
|
}
|
|
2618
|
-
[
|
|
2619
|
-
let n =
|
|
2620
|
-
this[
|
|
2665
|
+
[ra](e, t) {
|
|
2666
|
+
let n = L(node_path__rspack_import_3.resolve(this.cwd, String(e.linkpath))), r = L(String(e.linkpath)).split(`/`);
|
|
2667
|
+
this[ia](e, this.cwd, r, () => this[ta](e, n, `link`, t), (n) => {
|
|
2621
2668
|
this[$](n, e), t();
|
|
2622
2669
|
});
|
|
2623
2670
|
}
|
|
2624
|
-
[
|
|
2671
|
+
[ia](e, n, r, a, o) {
|
|
2625
2672
|
let s = r.shift();
|
|
2626
2673
|
if (this.preservePaths || s === void 0) return a();
|
|
2627
2674
|
let c = node_path__rspack_import_3.resolve(n, s);
|
|
2628
2675
|
node_fs__rspack_import_0.lstat(c, (t, n) => {
|
|
2629
2676
|
if (t) return a();
|
|
2630
|
-
if (n?.isSymbolicLink()) return o(new
|
|
2631
|
-
this[
|
|
2677
|
+
if (n?.isSymbolicLink()) return o(new Pi(c, node_path__rspack_import_3.resolve(c, r.join(`/`))));
|
|
2678
|
+
this[ia](e, c, r, a, o);
|
|
2632
2679
|
});
|
|
2633
2680
|
}
|
|
2634
|
-
[
|
|
2635
|
-
this[
|
|
2681
|
+
[ua]() {
|
|
2682
|
+
this[la]++;
|
|
2636
2683
|
}
|
|
2637
|
-
[
|
|
2638
|
-
this[
|
|
2684
|
+
[da]() {
|
|
2685
|
+
this[la]--, this[pa]();
|
|
2639
2686
|
}
|
|
2640
|
-
[
|
|
2641
|
-
this[
|
|
2687
|
+
[ma](e) {
|
|
2688
|
+
this[da](), e.resume();
|
|
2642
2689
|
}
|
|
2643
|
-
[
|
|
2644
|
-
return e.type === `File` && !this.unlink && t.isFile() && t.nlink <= 1 && !
|
|
2690
|
+
[Qi](e, t) {
|
|
2691
|
+
return e.type === `File` && !this.unlink && t.isFile() && t.nlink <= 1 && !ya;
|
|
2645
2692
|
}
|
|
2646
|
-
[
|
|
2647
|
-
this[
|
|
2693
|
+
[Xi](e) {
|
|
2694
|
+
this[ua]();
|
|
2648
2695
|
let t = [e.path];
|
|
2649
|
-
e.linkpath && t.push(e.linkpath), this.reservations.reserve(t, (t) => this[
|
|
2696
|
+
e.linkpath && t.push(e.linkpath), this.reservations.reserve(t, (t) => this[Zi](e, t));
|
|
2650
2697
|
}
|
|
2651
|
-
[
|
|
2698
|
+
[Zi](e, n) {
|
|
2652
2699
|
let r = (e) => {
|
|
2653
2700
|
n(e);
|
|
2654
2701
|
}, a = () => {
|
|
2655
|
-
this[
|
|
2702
|
+
this[ca](this.cwd, this.dmode, (t) => {
|
|
2656
2703
|
if (t) {
|
|
2657
2704
|
this[$](t, e), r();
|
|
2658
2705
|
return;
|
|
2659
2706
|
}
|
|
2660
|
-
this[
|
|
2707
|
+
this[va] = !0, o();
|
|
2661
2708
|
});
|
|
2662
2709
|
}, o = () => {
|
|
2663
2710
|
if (e.absolute !== this.cwd) {
|
|
2664
|
-
let t =
|
|
2665
|
-
if (t !== this.cwd) return this[
|
|
2711
|
+
let t = L(node_path__rspack_import_3.dirname(String(e.absolute)));
|
|
2712
|
+
if (t !== this.cwd) return this[ca](t, this.dmode, (t) => {
|
|
2666
2713
|
if (t) {
|
|
2667
2714
|
this[$](t, e), r();
|
|
2668
2715
|
return;
|
|
@@ -2674,10 +2721,10 @@ var Ir = class {
|
|
|
2674
2721
|
}, s = () => {
|
|
2675
2722
|
node_fs__rspack_import_0.lstat(String(e.absolute), (n, i) => {
|
|
2676
2723
|
if (i && (this.keep || this.newer && i.mtime > (e.mtime ?? i.mtime))) {
|
|
2677
|
-
this[
|
|
2724
|
+
this[ma](e), r();
|
|
2678
2725
|
return;
|
|
2679
2726
|
}
|
|
2680
|
-
if (n || this[
|
|
2727
|
+
if (n || this[Qi](e, i)) return this[Q](null, e, r);
|
|
2681
2728
|
if (i.isDirectory()) {
|
|
2682
2729
|
if (e.type === `Directory`) {
|
|
2683
2730
|
let n = this.chmod && e.mode && (i.mode & 4095) !== e.mode, a = (t) => this[Q](t ?? null, e, r);
|
|
@@ -2686,10 +2733,10 @@ var Ir = class {
|
|
|
2686
2733
|
if (e.absolute !== this.cwd) return node_fs__rspack_import_0.rmdir(String(e.absolute), (t) => this[Q](t ?? null, e, r));
|
|
2687
2734
|
}
|
|
2688
2735
|
if (e.absolute === this.cwd) return this[Q](null, e, r);
|
|
2689
|
-
|
|
2736
|
+
xa(String(e.absolute), (t) => this[Q](t ?? null, e, r));
|
|
2690
2737
|
});
|
|
2691
2738
|
};
|
|
2692
|
-
this[
|
|
2739
|
+
this[va] ? o() : a();
|
|
2693
2740
|
}
|
|
2694
2741
|
[Q](e, t, n) {
|
|
2695
2742
|
if (e) {
|
|
@@ -2699,59 +2746,59 @@ var Ir = class {
|
|
|
2699
2746
|
switch (t.type) {
|
|
2700
2747
|
case `File`:
|
|
2701
2748
|
case `OldFile`:
|
|
2702
|
-
case `ContiguousFile`: return this[
|
|
2703
|
-
case `Link`: return this[
|
|
2704
|
-
case `SymbolicLink`: return this[
|
|
2749
|
+
case `ContiguousFile`: return this[$i](t, n);
|
|
2750
|
+
case `Link`: return this[ra](t, n);
|
|
2751
|
+
case `SymbolicLink`: return this[na](t, n);
|
|
2705
2752
|
case `Directory`:
|
|
2706
|
-
case `GNUDumpDir`: return this[
|
|
2753
|
+
case `GNUDumpDir`: return this[ea](t, n);
|
|
2707
2754
|
}
|
|
2708
2755
|
}
|
|
2709
|
-
[
|
|
2756
|
+
[ta](e, n, r, i) {
|
|
2710
2757
|
node_fs__rspack_import_0[r](n, String(e.absolute), (t) => {
|
|
2711
|
-
t ? this[$](t, e) : (this[
|
|
2758
|
+
t ? this[$](t, e) : (this[da](), e.resume()), i();
|
|
2712
2759
|
});
|
|
2713
2760
|
}
|
|
2714
|
-
},
|
|
2761
|
+
}, Ta = (e) => {
|
|
2715
2762
|
try {
|
|
2716
2763
|
return [null, e()];
|
|
2717
2764
|
} catch (e) {
|
|
2718
2765
|
return [e, null];
|
|
2719
2766
|
}
|
|
2720
|
-
},
|
|
2767
|
+
}, Ea = class extends wa {
|
|
2721
2768
|
sync = !0;
|
|
2722
2769
|
[Q](e, t) {
|
|
2723
2770
|
return super[Q](e, t, () => {});
|
|
2724
2771
|
}
|
|
2725
|
-
[
|
|
2726
|
-
if (!this[
|
|
2727
|
-
let t = this[
|
|
2772
|
+
[Xi](e) {
|
|
2773
|
+
if (!this[va]) {
|
|
2774
|
+
let t = this[ca](this.cwd, this.dmode);
|
|
2728
2775
|
if (t) return this[$](t, e);
|
|
2729
|
-
this[
|
|
2776
|
+
this[va] = !0;
|
|
2730
2777
|
}
|
|
2731
2778
|
if (e.absolute !== this.cwd) {
|
|
2732
|
-
let t =
|
|
2779
|
+
let t = L(node_path__rspack_import_3.dirname(String(e.absolute)));
|
|
2733
2780
|
if (t !== this.cwd) {
|
|
2734
|
-
let n = this[
|
|
2781
|
+
let n = this[ca](t, this.dmode);
|
|
2735
2782
|
if (n) return this[$](n, e);
|
|
2736
2783
|
}
|
|
2737
2784
|
}
|
|
2738
|
-
let [n, r] =
|
|
2739
|
-
if (r && (this.keep || this.newer && r.mtime > (e.mtime ?? r.mtime))) return this[
|
|
2740
|
-
if (n || this[
|
|
2785
|
+
let [n, r] = Ta(() => node_fs__rspack_import_0.lstatSync(String(e.absolute)));
|
|
2786
|
+
if (r && (this.keep || this.newer && r.mtime > (e.mtime ?? r.mtime))) return this[ma](e);
|
|
2787
|
+
if (n || this[Qi](e, r)) return this[Q](null, e);
|
|
2741
2788
|
if (r.isDirectory()) {
|
|
2742
2789
|
if (e.type === `Directory`) {
|
|
2743
|
-
let [n] = this.chmod && e.mode && (r.mode & 4095) !== e.mode ?
|
|
2790
|
+
let [n] = this.chmod && e.mode && (r.mode & 4095) !== e.mode ? Ta(() => {
|
|
2744
2791
|
node_fs__rspack_import_0.chmodSync(String(e.absolute), Number(e.mode));
|
|
2745
2792
|
}) : [];
|
|
2746
2793
|
return this[Q](n, e);
|
|
2747
2794
|
}
|
|
2748
|
-
let [n] =
|
|
2795
|
+
let [n] = Ta(() => node_fs__rspack_import_0.rmdirSync(String(e.absolute)));
|
|
2749
2796
|
this[Q](n, e);
|
|
2750
2797
|
}
|
|
2751
|
-
let [a] = e.absolute === this.cwd ? [] :
|
|
2798
|
+
let [a] = e.absolute === this.cwd ? [] : Ta(() => Sa(String(e.absolute)));
|
|
2752
2799
|
this[Q](a, e);
|
|
2753
2800
|
}
|
|
2754
|
-
[
|
|
2801
|
+
[$i](e, n) {
|
|
2755
2802
|
let r = typeof e.mode == `number` ? e.mode & 4095 : this.fmode, i = (r) => {
|
|
2756
2803
|
let i;
|
|
2757
2804
|
try {
|
|
@@ -2762,7 +2809,7 @@ var Ir = class {
|
|
|
2762
2809
|
(r || i) && this[$](r || i, e), n();
|
|
2763
2810
|
}, a;
|
|
2764
2811
|
try {
|
|
2765
|
-
a = node_fs__rspack_import_0.openSync(String(e.absolute),
|
|
2812
|
+
a = node_fs__rspack_import_0.openSync(String(e.absolute), Ei(e.size), r);
|
|
2766
2813
|
} catch (e) {
|
|
2767
2814
|
return i(e);
|
|
2768
2815
|
}
|
|
@@ -2787,8 +2834,8 @@ var Ir = class {
|
|
|
2787
2834
|
}
|
|
2788
2835
|
}
|
|
2789
2836
|
}
|
|
2790
|
-
if (this[
|
|
2791
|
-
let r = this[
|
|
2837
|
+
if (this[ha](e)) {
|
|
2838
|
+
let r = this[ga](e), i = this[_a](e);
|
|
2792
2839
|
try {
|
|
2793
2840
|
node_fs__rspack_import_0.fchownSync(a, Number(r), Number(i));
|
|
2794
2841
|
} catch (a) {
|
|
@@ -2802,8 +2849,8 @@ var Ir = class {
|
|
|
2802
2849
|
i(n);
|
|
2803
2850
|
});
|
|
2804
2851
|
}
|
|
2805
|
-
[
|
|
2806
|
-
let r = typeof e.mode == `number` ? e.mode & 4095 : this.dmode, i = this[
|
|
2852
|
+
[ea](e, n) {
|
|
2853
|
+
let r = typeof e.mode == `number` ? e.mode & 4095 : this.dmode, i = this[ca](String(e.absolute), r);
|
|
2807
2854
|
if (i) {
|
|
2808
2855
|
this[$](i, e), n();
|
|
2809
2856
|
return;
|
|
@@ -2811,14 +2858,14 @@ var Ir = class {
|
|
|
2811
2858
|
if (e.mtime && !this.noMtime) try {
|
|
2812
2859
|
node_fs__rspack_import_0.utimesSync(String(e.absolute), e.atime || /* @__PURE__ */ new Date(), e.mtime);
|
|
2813
2860
|
} catch {}
|
|
2814
|
-
if (this[
|
|
2815
|
-
node_fs__rspack_import_0.chownSync(String(e.absolute), Number(this[
|
|
2861
|
+
if (this[ha](e)) try {
|
|
2862
|
+
node_fs__rspack_import_0.chownSync(String(e.absolute), Number(this[ga](e)), Number(this[_a](e)));
|
|
2816
2863
|
} catch {}
|
|
2817
2864
|
n(), e.resume();
|
|
2818
2865
|
}
|
|
2819
|
-
[
|
|
2866
|
+
[ca](e, t) {
|
|
2820
2867
|
try {
|
|
2821
|
-
return
|
|
2868
|
+
return Bi(L(e), {
|
|
2822
2869
|
uid: this.uid,
|
|
2823
2870
|
gid: this.gid,
|
|
2824
2871
|
processUid: this.processUid,
|
|
@@ -2833,18 +2880,18 @@ var Ir = class {
|
|
|
2833
2880
|
return e;
|
|
2834
2881
|
}
|
|
2835
2882
|
}
|
|
2836
|
-
[
|
|
2883
|
+
[ia](e, n, r, a, o) {
|
|
2837
2884
|
if (this.preservePaths || r.length === 0) return a();
|
|
2838
2885
|
let s = n;
|
|
2839
2886
|
for (let e of r) {
|
|
2840
2887
|
s = node_path__rspack_import_3.resolve(s, e);
|
|
2841
|
-
let [c, l] =
|
|
2888
|
+
let [c, l] = Ta(() => node_fs__rspack_import_0.lstatSync(s));
|
|
2842
2889
|
if (c) return a();
|
|
2843
|
-
if (l.isSymbolicLink()) return o(new
|
|
2890
|
+
if (l.isSymbolicLink()) return o(new Pi(s, node_path__rspack_import_3.resolve(n, r.join(`/`))));
|
|
2844
2891
|
}
|
|
2845
2892
|
a();
|
|
2846
2893
|
}
|
|
2847
|
-
[
|
|
2894
|
+
[ta](e, n, r, i) {
|
|
2848
2895
|
let a = `${r}Sync`;
|
|
2849
2896
|
try {
|
|
2850
2897
|
node_fs__rspack_import_0[a](n, String(e.absolute)), i(), e.resume();
|
|
@@ -2852,14 +2899,14 @@ var Ir = class {
|
|
|
2852
2899
|
return this[$](t, e);
|
|
2853
2900
|
}
|
|
2854
2901
|
}
|
|
2855
|
-
},
|
|
2856
|
-
let n = new
|
|
2902
|
+
}, Da = Ct((e) => {
|
|
2903
|
+
let n = new Ea(e), r = e.file, i = node_fs__rspack_import_0.statSync(r);
|
|
2857
2904
|
new ft(r, {
|
|
2858
2905
|
readSize: e.maxReadSize || 16 * 1024 * 1024,
|
|
2859
2906
|
size: i.size
|
|
2860
2907
|
}).pipe(n);
|
|
2861
2908
|
}, (e, n) => {
|
|
2862
|
-
let r = new
|
|
2909
|
+
let r = new wa(e), i = e.maxReadSize || 16 * 1024 * 1024, a = e.file;
|
|
2863
2910
|
return new Promise((e, n) => {
|
|
2864
2911
|
r.on(`error`, n), r.on(`close`, e), node_fs__rspack_import_0.stat(a, (e, t) => {
|
|
2865
2912
|
if (e) n(e);
|
|
@@ -2872,10 +2919,10 @@ var Ir = class {
|
|
|
2872
2919
|
}
|
|
2873
2920
|
});
|
|
2874
2921
|
});
|
|
2875
|
-
}, (e) => new
|
|
2876
|
-
t?.length &&
|
|
2877
|
-
}),
|
|
2878
|
-
let r = new
|
|
2922
|
+
}, (e) => new Ea(e), (e) => new wa(e), (e, t) => {
|
|
2923
|
+
t?.length && ir(e, t);
|
|
2924
|
+
}), Oa = (e, n) => {
|
|
2925
|
+
let r = new ui(e), i = !0, a, o;
|
|
2879
2926
|
try {
|
|
2880
2927
|
try {
|
|
2881
2928
|
a = node_fs__rspack_import_0.openSync(e.file, `r+`);
|
|
@@ -2895,21 +2942,21 @@ var Ir = class {
|
|
|
2895
2942
|
if (o + r + 512 > s.size) break;
|
|
2896
2943
|
o += r, e.mtimeCache && n.mtime && e.mtimeCache.set(String(n.path), n.mtime);
|
|
2897
2944
|
}
|
|
2898
|
-
i = !1,
|
|
2945
|
+
i = !1, ka(e, r, o, a, n);
|
|
2899
2946
|
} finally {
|
|
2900
2947
|
if (i) try {
|
|
2901
2948
|
node_fs__rspack_import_0.closeSync(a);
|
|
2902
2949
|
} catch {}
|
|
2903
2950
|
}
|
|
2904
|
-
},
|
|
2951
|
+
}, ka = (e, t, n, r, i) => {
|
|
2905
2952
|
let a = new mt(e.file, {
|
|
2906
2953
|
fd: r,
|
|
2907
2954
|
start: n
|
|
2908
2955
|
});
|
|
2909
|
-
t.pipe(a),
|
|
2910
|
-
},
|
|
2956
|
+
t.pipe(a), ja(t, i);
|
|
2957
|
+
}, Aa = (e, n) => {
|
|
2911
2958
|
n = Array.from(n);
|
|
2912
|
-
let r = new
|
|
2959
|
+
let r = new li(e), i = (n, r, i) => {
|
|
2913
2960
|
let a = (e, r) => {
|
|
2914
2961
|
e ? node_fs__rspack_import_0.close(n, (t) => i(e)) : i(null, r);
|
|
2915
2962
|
}, o = 0;
|
|
@@ -2940,29 +2987,29 @@ var Ir = class {
|
|
|
2940
2987
|
fd: u,
|
|
2941
2988
|
start: i
|
|
2942
2989
|
});
|
|
2943
|
-
r.pipe(s), s.on(`error`, o), s.on(`close`, a),
|
|
2990
|
+
r.pipe(s), s.on(`error`, o), s.on(`close`, a), Ma(r, n);
|
|
2944
2991
|
});
|
|
2945
2992
|
});
|
|
2946
2993
|
};
|
|
2947
2994
|
node_fs__rspack_import_0.open(e.file, s, c);
|
|
2948
2995
|
});
|
|
2949
|
-
},
|
|
2996
|
+
}, ja = (e, t) => {
|
|
2950
2997
|
t.forEach((t) => {
|
|
2951
|
-
t.charAt(0) === `@` ?
|
|
2998
|
+
t.charAt(0) === `@` ? ar({
|
|
2952
2999
|
file: node_path__rspack_import_3.resolve(e.cwd, t.slice(1)),
|
|
2953
3000
|
sync: !0,
|
|
2954
3001
|
noResume: !0,
|
|
2955
3002
|
onReadEntry: (t) => e.add(t)
|
|
2956
3003
|
}) : e.add(t);
|
|
2957
3004
|
}), e.end();
|
|
2958
|
-
},
|
|
2959
|
-
for (let n of t) n.charAt(0) === `@` ? await
|
|
3005
|
+
}, Ma = async (e, t) => {
|
|
3006
|
+
for (let n of t) n.charAt(0) === `@` ? await ar({
|
|
2960
3007
|
file: node_path__rspack_import_3.resolve(String(e.cwd), n.slice(1)),
|
|
2961
3008
|
noResume: !0,
|
|
2962
3009
|
onReadEntry: (t) => e.add(t)
|
|
2963
3010
|
}) : e.add(n);
|
|
2964
3011
|
e.end();
|
|
2965
|
-
},
|
|
3012
|
+
}, Na = Ct(Oa, Aa, () => {
|
|
2966
3013
|
throw TypeError(`file is required`);
|
|
2967
3014
|
}, () => {
|
|
2968
3015
|
throw TypeError(`file is required`);
|
|
@@ -2971,10 +3018,10 @@ var Ir = class {
|
|
|
2971
3018
|
if (e.gzip || e.brotli || e.zstd || e.file.endsWith(`.br`) || e.file.endsWith(`.tbr`)) throw TypeError(`cannot append to compressed archives`);
|
|
2972
3019
|
if (!t?.length) throw TypeError(`no paths specified to add/replace`);
|
|
2973
3020
|
});
|
|
2974
|
-
Ct(
|
|
2975
|
-
|
|
3021
|
+
Ct(Na.syncFile, Na.asyncFile, Na.syncNoFile, Na.asyncNoFile, (e, t = []) => {
|
|
3022
|
+
Na.validate?.(e, t), Pa(e);
|
|
2976
3023
|
});
|
|
2977
|
-
var
|
|
3024
|
+
var Pa = (e) => {
|
|
2978
3025
|
let t = e.filter;
|
|
2979
3026
|
e.mtimeCache ||= /* @__PURE__ */ new Map(), e.filter = t ? (n, r) => t(n, r) && !((e.mtimeCache?.get(n) ?? r.mtime ?? 0) > (r.mtime ?? 0)) : (t, n) => !((e.mtimeCache?.get(t) ?? n.mtime ?? 0) > (n.mtime ?? 0));
|
|
2980
3027
|
};
|