npm-pkg-lint 5.1.8 → 5.1.10
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/index.js +1073 -1023
- package/dist/index.js.map +3 -3
- package/package.json +1 -7
package/dist/index.js
CHANGED
|
@@ -496,7 +496,7 @@ var require_argparse = __commonJS({
|
|
|
496
496
|
var no_default = /* @__PURE__ */ Symbol("no_default_value");
|
|
497
497
|
function _parse_opts(args, descriptor) {
|
|
498
498
|
function get_name() {
|
|
499
|
-
let stack = new Error().stack.split("\n").map((x) => x.match(/^ at (.*) \(.*\)$/)).filter(Boolean).map((m2) => m2[1]).map((
|
|
499
|
+
let stack = new Error().stack.split("\n").map((x) => x.match(/^ at (.*) \(.*\)$/)).filter(Boolean).map((m2) => m2[1]).map((fn) => fn.match(/[^ .]*$/)[0]);
|
|
500
500
|
if (stack.length && stack[0] === get_name.name) stack.shift();
|
|
501
501
|
if (stack.length && stack[0] === _parse_opts.name) stack.shift();
|
|
502
502
|
return stack.length ? stack[0] : "";
|
|
@@ -6086,8 +6086,8 @@ var CharCodeReader = class {
|
|
|
6086
6086
|
* @param {(number) => boolean} fn A function to call on the next character.
|
|
6087
6087
|
* @returns {boolean} True if the next character code matches, false if not.
|
|
6088
6088
|
*/
|
|
6089
|
-
match(
|
|
6090
|
-
if (
|
|
6089
|
+
match(fn) {
|
|
6090
|
+
if (fn(this.peek())) {
|
|
6091
6091
|
this.next();
|
|
6092
6092
|
return true;
|
|
6093
6093
|
}
|
|
@@ -7352,9 +7352,9 @@ function pLimit(concurrency) {
|
|
|
7352
7352
|
queue.dequeue()();
|
|
7353
7353
|
}
|
|
7354
7354
|
};
|
|
7355
|
-
const run2 = async (
|
|
7355
|
+
const run2 = async (fn, resolve, args) => {
|
|
7356
7356
|
activeCount++;
|
|
7357
|
-
const result = (async () =>
|
|
7357
|
+
const result = (async () => fn(...args))();
|
|
7358
7358
|
resolve(result);
|
|
7359
7359
|
try {
|
|
7360
7360
|
await result;
|
|
@@ -7362,8 +7362,8 @@ function pLimit(concurrency) {
|
|
|
7362
7362
|
}
|
|
7363
7363
|
next();
|
|
7364
7364
|
};
|
|
7365
|
-
const enqueue = (
|
|
7366
|
-
queue.enqueue(run2.bind(void 0,
|
|
7365
|
+
const enqueue = (fn, resolve, args) => {
|
|
7366
|
+
queue.enqueue(run2.bind(void 0, fn, resolve, args));
|
|
7367
7367
|
(async () => {
|
|
7368
7368
|
await Promise.resolve();
|
|
7369
7369
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -7371,8 +7371,8 @@ function pLimit(concurrency) {
|
|
|
7371
7371
|
}
|
|
7372
7372
|
})();
|
|
7373
7373
|
};
|
|
7374
|
-
const generator = (
|
|
7375
|
-
enqueue(
|
|
7374
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
7375
|
+
enqueue(fn, resolve, args);
|
|
7376
7376
|
});
|
|
7377
7377
|
Object.defineProperties(generator, {
|
|
7378
7378
|
activeCount: {
|
|
@@ -7740,84 +7740,84 @@ function isBlacklisted(filename2) {
|
|
|
7740
7740
|
import fs3 from "node:fs";
|
|
7741
7741
|
|
|
7742
7742
|
// node_modules/tar/dist/esm/index.min.js
|
|
7743
|
-
import
|
|
7743
|
+
import Qr from "events";
|
|
7744
7744
|
import I from "fs";
|
|
7745
|
-
import { EventEmitter as
|
|
7746
|
-
import
|
|
7747
|
-
import { StringDecoder as
|
|
7748
|
-
import
|
|
7745
|
+
import { EventEmitter as Di } from "node:events";
|
|
7746
|
+
import Cs from "node:stream";
|
|
7747
|
+
import { StringDecoder as Hr } from "node:string_decoder";
|
|
7748
|
+
import cr from "node:path";
|
|
7749
7749
|
import Kt from "node:fs";
|
|
7750
|
-
import { dirname as
|
|
7751
|
-
import { EventEmitter as
|
|
7752
|
-
import
|
|
7750
|
+
import { dirname as Fn, parse as kn } from "path";
|
|
7751
|
+
import { EventEmitter as Dn } from "events";
|
|
7752
|
+
import zi from "assert";
|
|
7753
7753
|
import { Buffer as Ot } from "buffer";
|
|
7754
|
-
import * as
|
|
7755
|
-
import
|
|
7754
|
+
import * as Ps from "zlib";
|
|
7755
|
+
import en from "zlib";
|
|
7756
7756
|
import { posix as Zt } from "node:path";
|
|
7757
|
-
import { basename as
|
|
7757
|
+
import { basename as _n } from "node:path";
|
|
7758
7758
|
import ui from "fs";
|
|
7759
|
-
import
|
|
7760
|
-
import
|
|
7761
|
-
import { win32 as
|
|
7762
|
-
import
|
|
7763
|
-
import
|
|
7764
|
-
import
|
|
7765
|
-
import { randomBytes as
|
|
7766
|
-
import
|
|
7759
|
+
import X from "fs";
|
|
7760
|
+
import js from "path";
|
|
7761
|
+
import { win32 as Pn } from "node:path";
|
|
7762
|
+
import ar from "path";
|
|
7763
|
+
import Br from "node:fs";
|
|
7764
|
+
import co from "node:assert";
|
|
7765
|
+
import { randomBytes as Mr } from "node:crypto";
|
|
7766
|
+
import m from "node:fs";
|
|
7767
7767
|
import R from "node:path";
|
|
7768
|
-
import
|
|
7769
|
-
import
|
|
7770
|
-
import
|
|
7768
|
+
import pr from "fs";
|
|
7769
|
+
import wi from "node:fs";
|
|
7770
|
+
import we from "node:path";
|
|
7771
7771
|
import k from "node:fs";
|
|
7772
|
-
import
|
|
7773
|
-
import
|
|
7774
|
-
import { join as
|
|
7772
|
+
import ro from "node:fs/promises";
|
|
7773
|
+
import Si from "node:path";
|
|
7774
|
+
import { join as xr } from "node:path";
|
|
7775
7775
|
import v from "node:fs";
|
|
7776
|
-
import
|
|
7777
|
-
var
|
|
7778
|
-
var
|
|
7779
|
-
for (var e in t)
|
|
7776
|
+
import Pr from "node:path";
|
|
7777
|
+
var zr = Object.defineProperty;
|
|
7778
|
+
var Ur = (s3, t) => {
|
|
7779
|
+
for (var e in t) zr(s3, e, { get: t[e], enumerable: true });
|
|
7780
7780
|
};
|
|
7781
|
-
var
|
|
7782
|
-
var
|
|
7783
|
-
var
|
|
7784
|
-
var
|
|
7785
|
-
var
|
|
7786
|
-
var
|
|
7787
|
-
var
|
|
7788
|
-
var
|
|
7781
|
+
var Ds = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
7782
|
+
var Wr = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof A || s3 instanceof Cs || Gr(s3) || Zr(s3));
|
|
7783
|
+
var Gr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Di && typeof s3.pipe == "function" && s3.pipe !== Cs.Writable.prototype.pipe;
|
|
7784
|
+
var Zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Di && typeof s3.write == "function" && typeof s3.end == "function";
|
|
7785
|
+
var Q = /* @__PURE__ */ Symbol("EOF");
|
|
7786
|
+
var J = /* @__PURE__ */ Symbol("maybeEmitEnd");
|
|
7787
|
+
var nt = /* @__PURE__ */ Symbol("emittedEnd");
|
|
7788
|
+
var De = /* @__PURE__ */ Symbol("emittingEnd");
|
|
7789
7789
|
var qt = /* @__PURE__ */ Symbol("emittedError");
|
|
7790
7790
|
var Ne = /* @__PURE__ */ Symbol("closed");
|
|
7791
|
-
var
|
|
7792
|
-
var
|
|
7793
|
-
var
|
|
7791
|
+
var Ns = /* @__PURE__ */ Symbol("read");
|
|
7792
|
+
var Ae = /* @__PURE__ */ Symbol("flush");
|
|
7793
|
+
var As = /* @__PURE__ */ Symbol("flushChunk");
|
|
7794
7794
|
var z = /* @__PURE__ */ Symbol("encoding");
|
|
7795
7795
|
var Mt = /* @__PURE__ */ Symbol("decoder");
|
|
7796
7796
|
var g = /* @__PURE__ */ Symbol("flowing");
|
|
7797
7797
|
var Qt = /* @__PURE__ */ Symbol("paused");
|
|
7798
7798
|
var Bt = /* @__PURE__ */ Symbol("resume");
|
|
7799
7799
|
var b = /* @__PURE__ */ Symbol("buffer");
|
|
7800
|
-
var
|
|
7800
|
+
var N = /* @__PURE__ */ Symbol("pipes");
|
|
7801
7801
|
var _ = /* @__PURE__ */ Symbol("bufferLength");
|
|
7802
|
-
var
|
|
7803
|
-
var
|
|
7802
|
+
var bi = /* @__PURE__ */ Symbol("bufferPush");
|
|
7803
|
+
var Ie = /* @__PURE__ */ Symbol("bufferShift");
|
|
7804
7804
|
var L = /* @__PURE__ */ Symbol("objectMode");
|
|
7805
7805
|
var w = /* @__PURE__ */ Symbol("destroyed");
|
|
7806
|
-
var
|
|
7807
|
-
var
|
|
7808
|
-
var
|
|
7809
|
-
var
|
|
7806
|
+
var _i = /* @__PURE__ */ Symbol("error");
|
|
7807
|
+
var Oi = /* @__PURE__ */ Symbol("emitData");
|
|
7808
|
+
var Is = /* @__PURE__ */ Symbol("emitEnd");
|
|
7809
|
+
var Ti = /* @__PURE__ */ Symbol("emitEnd2");
|
|
7810
7810
|
var Z = /* @__PURE__ */ Symbol("async");
|
|
7811
|
-
var
|
|
7812
|
-
var
|
|
7811
|
+
var xi = /* @__PURE__ */ Symbol("abort");
|
|
7812
|
+
var Ce = /* @__PURE__ */ Symbol("aborted");
|
|
7813
7813
|
var Jt = /* @__PURE__ */ Symbol("signal");
|
|
7814
7814
|
var Rt = /* @__PURE__ */ Symbol("dataListeners");
|
|
7815
|
-
var
|
|
7815
|
+
var C = /* @__PURE__ */ Symbol("discarded");
|
|
7816
7816
|
var jt = (s3) => Promise.resolve().then(s3);
|
|
7817
|
-
var
|
|
7818
|
-
var
|
|
7819
|
-
var
|
|
7820
|
-
var
|
|
7817
|
+
var Yr = (s3) => s3();
|
|
7818
|
+
var Kr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
|
|
7819
|
+
var Vr = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
|
|
7820
|
+
var $r = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
|
|
7821
7821
|
var Fe = class {
|
|
7822
7822
|
src;
|
|
7823
7823
|
dest;
|
|
@@ -7835,7 +7835,7 @@ var Fe = class {
|
|
|
7835
7835
|
this.unpipe(), this.opts.end && this.dest.end();
|
|
7836
7836
|
}
|
|
7837
7837
|
};
|
|
7838
|
-
var
|
|
7838
|
+
var Li = class extends Fe {
|
|
7839
7839
|
unpipe() {
|
|
7840
7840
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
7841
7841
|
}
|
|
@@ -7843,36 +7843,36 @@ var xi = class extends Fe {
|
|
|
7843
7843
|
super(t, e, i), this.proxyErrors = (r) => this.dest.emit("error", r), t.on("error", this.proxyErrors);
|
|
7844
7844
|
}
|
|
7845
7845
|
};
|
|
7846
|
-
var
|
|
7847
|
-
var
|
|
7848
|
-
var A = class extends
|
|
7846
|
+
var Xr = (s3) => !!s3.objectMode;
|
|
7847
|
+
var qr = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
|
|
7848
|
+
var A = class extends Di {
|
|
7849
7849
|
[g] = false;
|
|
7850
7850
|
[Qt] = false;
|
|
7851
|
-
[
|
|
7851
|
+
[N] = [];
|
|
7852
7852
|
[b] = [];
|
|
7853
7853
|
[L];
|
|
7854
7854
|
[z];
|
|
7855
7855
|
[Z];
|
|
7856
7856
|
[Mt];
|
|
7857
|
-
[
|
|
7858
|
-
[
|
|
7859
|
-
[
|
|
7857
|
+
[Q] = false;
|
|
7858
|
+
[nt] = false;
|
|
7859
|
+
[De] = false;
|
|
7860
7860
|
[Ne] = false;
|
|
7861
7861
|
[qt] = null;
|
|
7862
7862
|
[_] = 0;
|
|
7863
7863
|
[w] = false;
|
|
7864
7864
|
[Jt];
|
|
7865
|
-
[
|
|
7865
|
+
[Ce] = false;
|
|
7866
7866
|
[Rt] = 0;
|
|
7867
|
-
[
|
|
7867
|
+
[C] = false;
|
|
7868
7868
|
writable = true;
|
|
7869
7869
|
readable = true;
|
|
7870
7870
|
constructor(...t) {
|
|
7871
7871
|
let e = t[0] || {};
|
|
7872
7872
|
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
7873
|
-
|
|
7873
|
+
Xr(e) ? (this[L] = true, this[z] = null) : qr(e) ? (this[z] = e.encoding, this[L] = false) : (this[L] = false, this[z] = null), this[Z] = !!e.async, this[Mt] = this[z] ? new Hr(this[z]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[b] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[N] });
|
|
7874
7874
|
let { signal: i } = e;
|
|
7875
|
-
i && (this[Jt] = i, i.aborted ? this[
|
|
7875
|
+
i && (this[Jt] = i, i.aborted ? this[xi]() : i.addEventListener("abort", () => this[xi]()));
|
|
7876
7876
|
}
|
|
7877
7877
|
get bufferLength() {
|
|
7878
7878
|
return this[_];
|
|
@@ -7898,53 +7898,53 @@ var A = class extends Li {
|
|
|
7898
7898
|
set async(t) {
|
|
7899
7899
|
this[Z] = this[Z] || !!t;
|
|
7900
7900
|
}
|
|
7901
|
-
[
|
|
7902
|
-
this[
|
|
7901
|
+
[xi]() {
|
|
7902
|
+
this[Ce] = true, this.emit("abort", this[Jt]?.reason), this.destroy(this[Jt]?.reason);
|
|
7903
7903
|
}
|
|
7904
7904
|
get aborted() {
|
|
7905
|
-
return this[
|
|
7905
|
+
return this[Ce];
|
|
7906
7906
|
}
|
|
7907
7907
|
set aborted(t) {
|
|
7908
7908
|
}
|
|
7909
7909
|
write(t, e, i) {
|
|
7910
|
-
if (this[
|
|
7911
|
-
if (this[
|
|
7910
|
+
if (this[Ce]) return false;
|
|
7911
|
+
if (this[Q]) throw new Error("write after end");
|
|
7912
7912
|
if (this[w]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
7913
7913
|
typeof e == "function" && (i = e, e = "utf8"), e || (e = "utf8");
|
|
7914
|
-
let r = this[Z] ? jt :
|
|
7914
|
+
let r = this[Z] ? jt : Yr;
|
|
7915
7915
|
if (!this[L] && !Buffer.isBuffer(t)) {
|
|
7916
|
-
if (
|
|
7917
|
-
else if (
|
|
7916
|
+
if ($r(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
7917
|
+
else if (Vr(t)) t = Buffer.from(t);
|
|
7918
7918
|
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
7919
7919
|
}
|
|
7920
|
-
return this[L] ? (this[g] && this[_] !== 0 && this[
|
|
7920
|
+
return this[L] ? (this[g] && this[_] !== 0 && this[Ae](true), this[g] ? this.emit("data", t) : this[bi](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[g]) : t.length ? (typeof t == "string" && !(e === this[z] && !this[Mt]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[z] && (t = this[Mt].write(t)), this[g] && this[_] !== 0 && this[Ae](true), this[g] ? this.emit("data", t) : this[bi](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[g]) : (this[_] !== 0 && this.emit("readable"), i && r(i), this[g]);
|
|
7921
7921
|
}
|
|
7922
7922
|
read(t) {
|
|
7923
7923
|
if (this[w]) return null;
|
|
7924
|
-
if (this[
|
|
7924
|
+
if (this[C] = false, this[_] === 0 || t === 0 || t && t > this[_]) return this[J](), null;
|
|
7925
7925
|
this[L] && (t = null), this[b].length > 1 && !this[L] && (this[b] = [this[z] ? this[b].join("") : Buffer.concat(this[b], this[_])]);
|
|
7926
|
-
let e = this[
|
|
7927
|
-
return this[
|
|
7926
|
+
let e = this[Ns](t || null, this[b][0]);
|
|
7927
|
+
return this[J](), e;
|
|
7928
7928
|
}
|
|
7929
|
-
[
|
|
7930
|
-
if (this[L]) this[
|
|
7929
|
+
[Ns](t, e) {
|
|
7930
|
+
if (this[L]) this[Ie]();
|
|
7931
7931
|
else {
|
|
7932
7932
|
let i = e;
|
|
7933
|
-
t === i.length || t === null ? this[
|
|
7933
|
+
t === i.length || t === null ? this[Ie]() : typeof i == "string" ? (this[b][0] = i.slice(t), e = i.slice(0, t), this[_] -= t) : (this[b][0] = i.subarray(t), e = i.subarray(0, t), this[_] -= t);
|
|
7934
7934
|
}
|
|
7935
|
-
return this.emit("data", e), !this[b].length && !this[
|
|
7935
|
+
return this.emit("data", e), !this[b].length && !this[Q] && this.emit("drain"), e;
|
|
7936
7936
|
}
|
|
7937
7937
|
end(t, e, i) {
|
|
7938
|
-
return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = "utf8"), t !== void 0 && this.write(t, e), i && this.once("end", i), this[
|
|
7938
|
+
return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = "utf8"), t !== void 0 && this.write(t, e), i && this.once("end", i), this[Q] = true, this.writable = false, (this[g] || !this[Qt]) && this[J](), this;
|
|
7939
7939
|
}
|
|
7940
7940
|
[Bt]() {
|
|
7941
|
-
this[w] || (!this[Rt] && !this[
|
|
7941
|
+
this[w] || (!this[Rt] && !this[N].length && (this[C] = true), this[Qt] = false, this[g] = true, this.emit("resume"), this[b].length ? this[Ae]() : this[Q] ? this[J]() : this.emit("drain"));
|
|
7942
7942
|
}
|
|
7943
7943
|
resume() {
|
|
7944
7944
|
return this[Bt]();
|
|
7945
7945
|
}
|
|
7946
7946
|
pause() {
|
|
7947
|
-
this[g] = false, this[Qt] = true, this[
|
|
7947
|
+
this[g] = false, this[Qt] = true, this[C] = false;
|
|
7948
7948
|
}
|
|
7949
7949
|
get destroyed() {
|
|
7950
7950
|
return this[w];
|
|
@@ -7955,39 +7955,39 @@ var A = class extends Li {
|
|
|
7955
7955
|
get paused() {
|
|
7956
7956
|
return this[Qt];
|
|
7957
7957
|
}
|
|
7958
|
-
[
|
|
7958
|
+
[bi](t) {
|
|
7959
7959
|
this[L] ? this[_] += 1 : this[_] += t.length, this[b].push(t);
|
|
7960
7960
|
}
|
|
7961
|
-
[
|
|
7961
|
+
[Ie]() {
|
|
7962
7962
|
return this[L] ? this[_] -= 1 : this[_] -= this[b][0].length, this[b].shift();
|
|
7963
7963
|
}
|
|
7964
|
-
[
|
|
7964
|
+
[Ae](t = false) {
|
|
7965
7965
|
do
|
|
7966
7966
|
;
|
|
7967
|
-
while (this[
|
|
7968
|
-
!t && !this[b].length && !this[
|
|
7967
|
+
while (this[As](this[Ie]()) && this[b].length);
|
|
7968
|
+
!t && !this[b].length && !this[Q] && this.emit("drain");
|
|
7969
7969
|
}
|
|
7970
|
-
[
|
|
7970
|
+
[As](t) {
|
|
7971
7971
|
return this.emit("data", t), this[g];
|
|
7972
7972
|
}
|
|
7973
7973
|
pipe(t, e) {
|
|
7974
7974
|
if (this[w]) return t;
|
|
7975
|
-
this[
|
|
7976
|
-
let i = this[
|
|
7977
|
-
return e = e || {}, t ===
|
|
7975
|
+
this[C] = false;
|
|
7976
|
+
let i = this[nt];
|
|
7977
|
+
return e = e || {}, t === Ds.stdout || t === Ds.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, i ? e.end && t.end() : (this[N].push(e.proxyErrors ? new Li(this, t, e) : new Fe(this, t, e)), this[Z] ? jt(() => this[Bt]()) : this[Bt]()), t;
|
|
7978
7978
|
}
|
|
7979
7979
|
unpipe(t) {
|
|
7980
|
-
let e = this[
|
|
7981
|
-
e && (this[
|
|
7980
|
+
let e = this[N].find((i) => i.dest === t);
|
|
7981
|
+
e && (this[N].length === 1 ? (this[g] && this[Rt] === 0 && (this[g] = false), this[N] = []) : this[N].splice(this[N].indexOf(e), 1), e.unpipe());
|
|
7982
7982
|
}
|
|
7983
7983
|
addListener(t, e) {
|
|
7984
7984
|
return this.on(t, e);
|
|
7985
7985
|
}
|
|
7986
7986
|
on(t, e) {
|
|
7987
7987
|
let i = super.on(t, e);
|
|
7988
|
-
if (t === "data") this[
|
|
7988
|
+
if (t === "data") this[C] = false, this[Rt]++, !this[N].length && !this[g] && this[Bt]();
|
|
7989
7989
|
else if (t === "readable" && this[_] !== 0) super.emit("readable");
|
|
7990
|
-
else if (
|
|
7990
|
+
else if (Kr(t) && this[nt]) super.emit(t), this.removeAllListeners(t);
|
|
7991
7991
|
else if (t === "error" && this[qt]) {
|
|
7992
7992
|
let r = e;
|
|
7993
7993
|
this[Z] ? jt(() => r.call(this, this[qt])) : r.call(this, this[qt]);
|
|
@@ -7999,58 +7999,58 @@ var A = class extends Li {
|
|
|
7999
7999
|
}
|
|
8000
8000
|
off(t, e) {
|
|
8001
8001
|
let i = super.off(t, e);
|
|
8002
|
-
return t === "data" && (this[Rt] = this.listeners("data").length, this[Rt] === 0 && !this[
|
|
8002
|
+
return t === "data" && (this[Rt] = this.listeners("data").length, this[Rt] === 0 && !this[C] && !this[N].length && (this[g] = false)), i;
|
|
8003
8003
|
}
|
|
8004
8004
|
removeAllListeners(t) {
|
|
8005
8005
|
let e = super.removeAllListeners(t);
|
|
8006
|
-
return (t === "data" || t === void 0) && (this[Rt] = 0, !this[
|
|
8006
|
+
return (t === "data" || t === void 0) && (this[Rt] = 0, !this[C] && !this[N].length && (this[g] = false)), e;
|
|
8007
8007
|
}
|
|
8008
8008
|
get emittedEnd() {
|
|
8009
|
-
return this[
|
|
8009
|
+
return this[nt];
|
|
8010
8010
|
}
|
|
8011
|
-
[
|
|
8012
|
-
!this[
|
|
8011
|
+
[J]() {
|
|
8012
|
+
!this[De] && !this[nt] && !this[w] && this[b].length === 0 && this[Q] && (this[De] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Ne] && this.emit("close"), this[De] = false);
|
|
8013
8013
|
}
|
|
8014
8014
|
emit(t, ...e) {
|
|
8015
8015
|
let i = e[0];
|
|
8016
8016
|
if (t !== "error" && t !== "close" && t !== w && this[w]) return false;
|
|
8017
|
-
if (t === "data") return !this[L] && !i ? false : this[Z] ? (jt(() => this[
|
|
8018
|
-
if (t === "end") return this[
|
|
8017
|
+
if (t === "data") return !this[L] && !i ? false : this[Z] ? (jt(() => this[Oi](i)), true) : this[Oi](i);
|
|
8018
|
+
if (t === "end") return this[Is]();
|
|
8019
8019
|
if (t === "close") {
|
|
8020
|
-
if (this[Ne] = true, !this[
|
|
8020
|
+
if (this[Ne] = true, !this[nt] && !this[w]) return false;
|
|
8021
8021
|
let n = super.emit("close");
|
|
8022
8022
|
return this.removeAllListeners("close"), n;
|
|
8023
8023
|
} else if (t === "error") {
|
|
8024
|
-
this[qt] = i, super.emit(
|
|
8024
|
+
this[qt] = i, super.emit(_i, i);
|
|
8025
8025
|
let n = !this[Jt] || this.listeners("error").length ? super.emit("error", i) : false;
|
|
8026
|
-
return this[
|
|
8026
|
+
return this[J](), n;
|
|
8027
8027
|
} else if (t === "resume") {
|
|
8028
8028
|
let n = super.emit("resume");
|
|
8029
|
-
return this[
|
|
8029
|
+
return this[J](), n;
|
|
8030
8030
|
} else if (t === "finish" || t === "prefinish") {
|
|
8031
8031
|
let n = super.emit(t);
|
|
8032
8032
|
return this.removeAllListeners(t), n;
|
|
8033
8033
|
}
|
|
8034
8034
|
let r = super.emit(t, ...e);
|
|
8035
|
-
return this[
|
|
8035
|
+
return this[J](), r;
|
|
8036
8036
|
}
|
|
8037
|
-
[
|
|
8038
|
-
for (let i of this[
|
|
8039
|
-
let e = this[
|
|
8040
|
-
return this[
|
|
8037
|
+
[Oi](t) {
|
|
8038
|
+
for (let i of this[N]) i.dest.write(t) === false && this.pause();
|
|
8039
|
+
let e = this[C] ? false : super.emit("data", t);
|
|
8040
|
+
return this[J](), e;
|
|
8041
8041
|
}
|
|
8042
|
-
[
|
|
8043
|
-
return this[
|
|
8042
|
+
[Is]() {
|
|
8043
|
+
return this[nt] ? false : (this[nt] = true, this.readable = false, this[Z] ? (jt(() => this[Ti]()), true) : this[Ti]());
|
|
8044
8044
|
}
|
|
8045
|
-
[
|
|
8045
|
+
[Ti]() {
|
|
8046
8046
|
if (this[Mt]) {
|
|
8047
8047
|
let e = this[Mt].end();
|
|
8048
8048
|
if (e) {
|
|
8049
|
-
for (let i of this[
|
|
8050
|
-
this[
|
|
8049
|
+
for (let i of this[N]) i.dest.write(e);
|
|
8050
|
+
this[C] || super.emit("data", e);
|
|
8051
8051
|
}
|
|
8052
8052
|
}
|
|
8053
|
-
for (let e of this[
|
|
8053
|
+
for (let e of this[N]) e.end();
|
|
8054
8054
|
let t = super.emit("end");
|
|
8055
8055
|
return this.removeAllListeners("end"), t;
|
|
8056
8056
|
}
|
|
@@ -8073,22 +8073,22 @@ var A = class extends Li {
|
|
|
8073
8073
|
});
|
|
8074
8074
|
}
|
|
8075
8075
|
[Symbol.asyncIterator]() {
|
|
8076
|
-
this[
|
|
8076
|
+
this[C] = false;
|
|
8077
8077
|
let t = false, e = async () => (this.pause(), t = true, { value: void 0, done: true });
|
|
8078
8078
|
return { next: () => {
|
|
8079
8079
|
if (t) return e();
|
|
8080
8080
|
let r = this.read();
|
|
8081
8081
|
if (r !== null) return Promise.resolve({ done: false, value: r });
|
|
8082
|
-
if (this[
|
|
8083
|
-
let n, o,
|
|
8084
|
-
this.off("data",
|
|
8085
|
-
},
|
|
8086
|
-
this.off("error",
|
|
8082
|
+
if (this[Q]) return e();
|
|
8083
|
+
let n, o, h = (d) => {
|
|
8084
|
+
this.off("data", a), this.off("end", l), this.off(w, c), e(), o(d);
|
|
8085
|
+
}, a = (d) => {
|
|
8086
|
+
this.off("error", h), this.off("end", l), this.off(w, c), this.pause(), n({ value: d, done: !!this[Q] });
|
|
8087
8087
|
}, l = () => {
|
|
8088
|
-
this.off("error",
|
|
8089
|
-
}, c = () =>
|
|
8088
|
+
this.off("error", h), this.off("data", a), this.off(w, c), e(), n({ done: true, value: void 0 });
|
|
8089
|
+
}, c = () => h(new Error("stream destroyed"));
|
|
8090
8090
|
return new Promise((d, S) => {
|
|
8091
|
-
o = S, n = d, this.once(w, c), this.once("error",
|
|
8091
|
+
o = S, n = d, this.once(w, c), this.once("error", h), this.once("end", l), this.once("data", a);
|
|
8092
8092
|
});
|
|
8093
8093
|
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
8094
8094
|
return this;
|
|
@@ -8096,71 +8096,71 @@ var A = class extends Li {
|
|
|
8096
8096
|
} };
|
|
8097
8097
|
}
|
|
8098
8098
|
[Symbol.iterator]() {
|
|
8099
|
-
this[
|
|
8100
|
-
let t = false, e = () => (this.pause(), this.off(
|
|
8099
|
+
this[C] = false;
|
|
8100
|
+
let t = false, e = () => (this.pause(), this.off(_i, e), this.off(w, e), this.off("end", e), t = true, { done: true, value: void 0 }), i = () => {
|
|
8101
8101
|
if (t) return e();
|
|
8102
8102
|
let r = this.read();
|
|
8103
8103
|
return r === null ? e() : { done: false, value: r };
|
|
8104
8104
|
};
|
|
8105
|
-
return this.once("end", e), this.once(
|
|
8105
|
+
return this.once("end", e), this.once(_i, e), this.once(w, e), { next: i, throw: e, return: e, [Symbol.iterator]() {
|
|
8106
8106
|
return this;
|
|
8107
8107
|
}, [Symbol.dispose]: () => {
|
|
8108
8108
|
} };
|
|
8109
8109
|
}
|
|
8110
8110
|
destroy(t) {
|
|
8111
8111
|
if (this[w]) return t ? this.emit("error", t) : this.emit(w), this;
|
|
8112
|
-
this[w] = true, this[
|
|
8112
|
+
this[w] = true, this[C] = true, this[b].length = 0, this[_] = 0;
|
|
8113
8113
|
let e = this;
|
|
8114
8114
|
return typeof e.close == "function" && !this[Ne] && e.close(), t ? this.emit("error", t) : this.emit(w), this;
|
|
8115
8115
|
}
|
|
8116
8116
|
static get isStream() {
|
|
8117
|
-
return
|
|
8117
|
+
return Wr;
|
|
8118
8118
|
}
|
|
8119
8119
|
};
|
|
8120
|
-
var
|
|
8121
|
-
var
|
|
8120
|
+
var Jr = I.writev;
|
|
8121
|
+
var ht = /* @__PURE__ */ Symbol("_autoClose");
|
|
8122
8122
|
var H = /* @__PURE__ */ Symbol("_close");
|
|
8123
8123
|
var te = /* @__PURE__ */ Symbol("_ended");
|
|
8124
|
-
var
|
|
8124
|
+
var u = /* @__PURE__ */ Symbol("_fd");
|
|
8125
8125
|
var Ni = /* @__PURE__ */ Symbol("_finished");
|
|
8126
|
-
var
|
|
8127
|
-
var
|
|
8128
|
-
var
|
|
8129
|
-
var
|
|
8126
|
+
var tt2 = /* @__PURE__ */ Symbol("_flags");
|
|
8127
|
+
var Ai = /* @__PURE__ */ Symbol("_flush");
|
|
8128
|
+
var ki = /* @__PURE__ */ Symbol("_handleChunk");
|
|
8129
|
+
var vi = /* @__PURE__ */ Symbol("_makeBuf");
|
|
8130
8130
|
var ie = /* @__PURE__ */ Symbol("_mode");
|
|
8131
|
-
var
|
|
8131
|
+
var ke = /* @__PURE__ */ Symbol("_needDrain");
|
|
8132
8132
|
var Ut = /* @__PURE__ */ Symbol("_onerror");
|
|
8133
8133
|
var Ht = /* @__PURE__ */ Symbol("_onopen");
|
|
8134
|
-
var
|
|
8134
|
+
var Ii = /* @__PURE__ */ Symbol("_onread");
|
|
8135
8135
|
var Pt = /* @__PURE__ */ Symbol("_onwrite");
|
|
8136
|
-
var
|
|
8136
|
+
var at = /* @__PURE__ */ Symbol("_open");
|
|
8137
8137
|
var U = /* @__PURE__ */ Symbol("_path");
|
|
8138
|
-
var
|
|
8138
|
+
var ot = /* @__PURE__ */ Symbol("_pos");
|
|
8139
8139
|
var Y = /* @__PURE__ */ Symbol("_queue");
|
|
8140
8140
|
var zt = /* @__PURE__ */ Symbol("_read");
|
|
8141
|
-
var
|
|
8142
|
-
var
|
|
8141
|
+
var Ci = /* @__PURE__ */ Symbol("_readSize");
|
|
8142
|
+
var j = /* @__PURE__ */ Symbol("_reading");
|
|
8143
8143
|
var ee = /* @__PURE__ */ Symbol("_remain");
|
|
8144
8144
|
var Fi = /* @__PURE__ */ Symbol("_size");
|
|
8145
|
-
var
|
|
8145
|
+
var ve = /* @__PURE__ */ Symbol("_write");
|
|
8146
8146
|
var gt = /* @__PURE__ */ Symbol("_writing");
|
|
8147
|
-
var
|
|
8147
|
+
var Me = /* @__PURE__ */ Symbol("_defaultFlag");
|
|
8148
8148
|
var bt = /* @__PURE__ */ Symbol("_errored");
|
|
8149
8149
|
var _t = class extends A {
|
|
8150
8150
|
[bt] = false;
|
|
8151
|
-
[
|
|
8151
|
+
[u];
|
|
8152
8152
|
[U];
|
|
8153
|
-
[
|
|
8154
|
-
[
|
|
8153
|
+
[Ci];
|
|
8154
|
+
[j] = false;
|
|
8155
8155
|
[Fi];
|
|
8156
8156
|
[ee];
|
|
8157
|
-
[
|
|
8157
|
+
[ht];
|
|
8158
8158
|
constructor(t, e) {
|
|
8159
8159
|
if (e = e || {}, super(e), this.readable = true, this.writable = false, typeof t != "string") throw new TypeError("path must be a string");
|
|
8160
|
-
this[bt] = false, this[
|
|
8160
|
+
this[bt] = false, this[u] = typeof e.fd == "number" ? e.fd : void 0, this[U] = t, this[Ci] = e.readSize || 16 * 1024 * 1024, this[j] = false, this[Fi] = typeof e.size == "number" ? e.size : 1 / 0, this[ee] = this[Fi], this[ht] = typeof e.autoClose == "boolean" ? e.autoClose : true, typeof this[u] == "number" ? this[zt]() : this[at]();
|
|
8161
8161
|
}
|
|
8162
8162
|
get fd() {
|
|
8163
|
-
return this[
|
|
8163
|
+
return this[u];
|
|
8164
8164
|
}
|
|
8165
8165
|
get path() {
|
|
8166
8166
|
return this[U];
|
|
@@ -8171,36 +8171,36 @@ var _t = class extends A {
|
|
|
8171
8171
|
end() {
|
|
8172
8172
|
throw new TypeError("this is a readable stream");
|
|
8173
8173
|
}
|
|
8174
|
-
[
|
|
8174
|
+
[at]() {
|
|
8175
8175
|
I.open(this[U], "r", (t, e) => this[Ht](t, e));
|
|
8176
8176
|
}
|
|
8177
8177
|
[Ht](t, e) {
|
|
8178
|
-
t ? this[Ut](t) : (this[
|
|
8178
|
+
t ? this[Ut](t) : (this[u] = e, this.emit("open", e), this[zt]());
|
|
8179
8179
|
}
|
|
8180
|
-
[
|
|
8181
|
-
return Buffer.allocUnsafe(Math.min(this[
|
|
8180
|
+
[vi]() {
|
|
8181
|
+
return Buffer.allocUnsafe(Math.min(this[Ci], this[ee]));
|
|
8182
8182
|
}
|
|
8183
8183
|
[zt]() {
|
|
8184
|
-
if (!this[
|
|
8185
|
-
this[
|
|
8186
|
-
let t = this[
|
|
8187
|
-
if (t.length === 0) return process.nextTick(() => this[
|
|
8188
|
-
I.read(this[
|
|
8184
|
+
if (!this[j]) {
|
|
8185
|
+
this[j] = true;
|
|
8186
|
+
let t = this[vi]();
|
|
8187
|
+
if (t.length === 0) return process.nextTick(() => this[Ii](null, 0, t));
|
|
8188
|
+
I.read(this[u], t, 0, t.length, null, (e, i, r) => this[Ii](e, i, r));
|
|
8189
8189
|
}
|
|
8190
8190
|
}
|
|
8191
|
-
[
|
|
8192
|
-
this[
|
|
8191
|
+
[Ii](t, e, i) {
|
|
8192
|
+
this[j] = false, t ? this[Ut](t) : this[ki](e, i) && this[zt]();
|
|
8193
8193
|
}
|
|
8194
8194
|
[H]() {
|
|
8195
|
-
if (this[
|
|
8196
|
-
let t = this[
|
|
8197
|
-
this[
|
|
8195
|
+
if (this[ht] && typeof this[u] == "number") {
|
|
8196
|
+
let t = this[u];
|
|
8197
|
+
this[u] = void 0, I.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
8198
8198
|
}
|
|
8199
8199
|
}
|
|
8200
8200
|
[Ut](t) {
|
|
8201
|
-
this[
|
|
8201
|
+
this[j] = true, this[H](), this.emit("error", t);
|
|
8202
8202
|
}
|
|
8203
|
-
[
|
|
8203
|
+
[ki](t, e) {
|
|
8204
8204
|
let i = false;
|
|
8205
8205
|
return this[ee] -= t, t > 0 && (i = super.write(t < e.length ? e.subarray(0, t) : e)), (t === 0 || this[ee] <= 0) && (i = false, this[H](), super.end()), i;
|
|
8206
8206
|
}
|
|
@@ -8210,7 +8210,7 @@ var _t = class extends A {
|
|
|
8210
8210
|
case "finish":
|
|
8211
8211
|
return false;
|
|
8212
8212
|
case "drain":
|
|
8213
|
-
return typeof this[
|
|
8213
|
+
return typeof this[u] == "number" && this[zt](), false;
|
|
8214
8214
|
case "error":
|
|
8215
8215
|
return this[bt] ? false : (this[bt] = true, super.emit(t, ...e));
|
|
8216
8216
|
default:
|
|
@@ -8218,8 +8218,8 @@ var _t = class extends A {
|
|
|
8218
8218
|
}
|
|
8219
8219
|
}
|
|
8220
8220
|
};
|
|
8221
|
-
var
|
|
8222
|
-
[
|
|
8221
|
+
var Be = class extends _t {
|
|
8222
|
+
[at]() {
|
|
8223
8223
|
let t = true;
|
|
8224
8224
|
try {
|
|
8225
8225
|
this[Ht](null, I.openSync(this[U], "r")), t = false;
|
|
@@ -8230,13 +8230,13 @@ var Me = class extends _t {
|
|
|
8230
8230
|
[zt]() {
|
|
8231
8231
|
let t = true;
|
|
8232
8232
|
try {
|
|
8233
|
-
if (!this[
|
|
8234
|
-
this[
|
|
8233
|
+
if (!this[j]) {
|
|
8234
|
+
this[j] = true;
|
|
8235
8235
|
do {
|
|
8236
|
-
let e = this[
|
|
8237
|
-
if (!this[
|
|
8236
|
+
let e = this[vi](), i = e.length === 0 ? 0 : I.readSync(this[u], e, 0, e.length, null);
|
|
8237
|
+
if (!this[ki](i, e)) break;
|
|
8238
8238
|
} while (true);
|
|
8239
|
-
this[
|
|
8239
|
+
this[j] = false;
|
|
8240
8240
|
}
|
|
8241
8241
|
t = false;
|
|
8242
8242
|
} finally {
|
|
@@ -8244,32 +8244,32 @@ var Me = class extends _t {
|
|
|
8244
8244
|
}
|
|
8245
8245
|
}
|
|
8246
8246
|
[H]() {
|
|
8247
|
-
if (this[
|
|
8248
|
-
let t = this[
|
|
8249
|
-
this[
|
|
8247
|
+
if (this[ht] && typeof this[u] == "number") {
|
|
8248
|
+
let t = this[u];
|
|
8249
|
+
this[u] = void 0, I.closeSync(t), this.emit("close");
|
|
8250
8250
|
}
|
|
8251
8251
|
}
|
|
8252
8252
|
};
|
|
8253
|
-
var
|
|
8253
|
+
var et = class extends Qr {
|
|
8254
8254
|
readable = false;
|
|
8255
8255
|
writable = true;
|
|
8256
8256
|
[bt] = false;
|
|
8257
8257
|
[gt] = false;
|
|
8258
8258
|
[te] = false;
|
|
8259
8259
|
[Y] = [];
|
|
8260
|
-
[
|
|
8260
|
+
[ke] = false;
|
|
8261
8261
|
[U];
|
|
8262
8262
|
[ie];
|
|
8263
|
-
[
|
|
8264
|
-
[
|
|
8265
|
-
[
|
|
8266
|
-
[
|
|
8263
|
+
[ht];
|
|
8264
|
+
[u];
|
|
8265
|
+
[Me];
|
|
8266
|
+
[tt2];
|
|
8267
8267
|
[Ni] = false;
|
|
8268
|
-
[
|
|
8268
|
+
[ot];
|
|
8269
8269
|
constructor(t, e) {
|
|
8270
|
-
e = e || {}, super(e), this[U] = t, this[
|
|
8271
|
-
let i = this[
|
|
8272
|
-
this[
|
|
8270
|
+
e = e || {}, super(e), this[U] = t, this[u] = typeof e.fd == "number" ? e.fd : void 0, this[ie] = e.mode === void 0 ? 438 : e.mode, this[ot] = typeof e.start == "number" ? e.start : void 0, this[ht] = typeof e.autoClose == "boolean" ? e.autoClose : true;
|
|
8271
|
+
let i = this[ot] !== void 0 ? "r+" : "w";
|
|
8272
|
+
this[Me] = e.flags === void 0, this[tt2] = e.flags === void 0 ? i : e.flags, this[u] === void 0 && this[at]();
|
|
8273
8273
|
}
|
|
8274
8274
|
emit(t, ...e) {
|
|
8275
8275
|
if (t === "error") {
|
|
@@ -8279,7 +8279,7 @@ var tt2 = class extends $r {
|
|
|
8279
8279
|
return super.emit(t, ...e);
|
|
8280
8280
|
}
|
|
8281
8281
|
get fd() {
|
|
8282
|
-
return this[
|
|
8282
|
+
return this[u];
|
|
8283
8283
|
}
|
|
8284
8284
|
get path() {
|
|
8285
8285
|
return this[U];
|
|
@@ -8287,61 +8287,61 @@ var tt2 = class extends $r {
|
|
|
8287
8287
|
[Ut](t) {
|
|
8288
8288
|
this[H](), this[gt] = true, this.emit("error", t);
|
|
8289
8289
|
}
|
|
8290
|
-
[
|
|
8291
|
-
I.open(this[U], this[
|
|
8290
|
+
[at]() {
|
|
8291
|
+
I.open(this[U], this[tt2], this[ie], (t, e) => this[Ht](t, e));
|
|
8292
8292
|
}
|
|
8293
8293
|
[Ht](t, e) {
|
|
8294
|
-
this[
|
|
8294
|
+
this[Me] && this[tt2] === "r+" && t && t.code === "ENOENT" ? (this[tt2] = "w", this[at]()) : t ? this[Ut](t) : (this[u] = e, this.emit("open", e), this[gt] || this[Ai]());
|
|
8295
8295
|
}
|
|
8296
8296
|
end(t, e) {
|
|
8297
|
-
return t && this.write(t, e), this[te] = true, !this[gt] && !this[Y].length && typeof this[
|
|
8297
|
+
return t && this.write(t, e), this[te] = true, !this[gt] && !this[Y].length && typeof this[u] == "number" && this[Pt](null, 0), this;
|
|
8298
8298
|
}
|
|
8299
8299
|
write(t, e) {
|
|
8300
|
-
return typeof t == "string" && (t = Buffer.from(t, e)), this[te] ? (this.emit("error", new Error("write() after end()")), false) : this[
|
|
8300
|
+
return typeof t == "string" && (t = Buffer.from(t, e)), this[te] ? (this.emit("error", new Error("write() after end()")), false) : this[u] === void 0 || this[gt] || this[Y].length ? (this[Y].push(t), this[ke] = true, false) : (this[gt] = true, this[ve](t), true);
|
|
8301
8301
|
}
|
|
8302
|
-
[
|
|
8303
|
-
I.write(this[
|
|
8302
|
+
[ve](t) {
|
|
8303
|
+
I.write(this[u], t, 0, t.length, this[ot], (e, i) => this[Pt](e, i));
|
|
8304
8304
|
}
|
|
8305
8305
|
[Pt](t, e) {
|
|
8306
|
-
t ? this[Ut](t) : (this[
|
|
8306
|
+
t ? this[Ut](t) : (this[ot] !== void 0 && typeof e == "number" && (this[ot] += e), this[Y].length ? this[Ai]() : (this[gt] = false, this[te] && !this[Ni] ? (this[Ni] = true, this[H](), this.emit("finish")) : this[ke] && (this[ke] = false, this.emit("drain"))));
|
|
8307
8307
|
}
|
|
8308
|
-
[
|
|
8308
|
+
[Ai]() {
|
|
8309
8309
|
if (this[Y].length === 0) this[te] && this[Pt](null, 0);
|
|
8310
|
-
else if (this[Y].length === 1) this[
|
|
8310
|
+
else if (this[Y].length === 1) this[ve](this[Y].pop());
|
|
8311
8311
|
else {
|
|
8312
8312
|
let t = this[Y];
|
|
8313
|
-
this[Y] = [],
|
|
8313
|
+
this[Y] = [], Jr(this[u], t, this[ot], (e, i) => this[Pt](e, i));
|
|
8314
8314
|
}
|
|
8315
8315
|
}
|
|
8316
8316
|
[H]() {
|
|
8317
|
-
if (this[
|
|
8318
|
-
let t = this[
|
|
8319
|
-
this[
|
|
8317
|
+
if (this[ht] && typeof this[u] == "number") {
|
|
8318
|
+
let t = this[u];
|
|
8319
|
+
this[u] = void 0, I.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
8320
8320
|
}
|
|
8321
8321
|
}
|
|
8322
8322
|
};
|
|
8323
|
-
var Wt = class extends
|
|
8324
|
-
[
|
|
8323
|
+
var Wt = class extends et {
|
|
8324
|
+
[at]() {
|
|
8325
8325
|
let t;
|
|
8326
|
-
if (this[
|
|
8327
|
-
t = I.openSync(this[U], this[
|
|
8326
|
+
if (this[Me] && this[tt2] === "r+") try {
|
|
8327
|
+
t = I.openSync(this[U], this[tt2], this[ie]);
|
|
8328
8328
|
} catch (e) {
|
|
8329
|
-
if (e?.code === "ENOENT") return this[
|
|
8329
|
+
if (e?.code === "ENOENT") return this[tt2] = "w", this[at]();
|
|
8330
8330
|
throw e;
|
|
8331
8331
|
}
|
|
8332
|
-
else t = I.openSync(this[U], this[
|
|
8332
|
+
else t = I.openSync(this[U], this[tt2], this[ie]);
|
|
8333
8333
|
this[Ht](null, t);
|
|
8334
8334
|
}
|
|
8335
8335
|
[H]() {
|
|
8336
|
-
if (this[
|
|
8337
|
-
let t = this[
|
|
8338
|
-
this[
|
|
8336
|
+
if (this[ht] && typeof this[u] == "number") {
|
|
8337
|
+
let t = this[u];
|
|
8338
|
+
this[u] = void 0, I.closeSync(t), this.emit("close");
|
|
8339
8339
|
}
|
|
8340
8340
|
}
|
|
8341
|
-
[
|
|
8341
|
+
[ve](t) {
|
|
8342
8342
|
let e = true;
|
|
8343
8343
|
try {
|
|
8344
|
-
this[Pt](null, I.writeSync(this[
|
|
8344
|
+
this[Pt](null, I.writeSync(this[u], t, 0, t.length, this[ot])), e = false;
|
|
8345
8345
|
} finally {
|
|
8346
8346
|
if (e) try {
|
|
8347
8347
|
this[H]();
|
|
@@ -8350,50 +8350,50 @@ var Wt = class extends tt2 {
|
|
|
8350
8350
|
}
|
|
8351
8351
|
}
|
|
8352
8352
|
};
|
|
8353
|
-
var
|
|
8354
|
-
var
|
|
8355
|
-
var
|
|
8356
|
-
var
|
|
8357
|
-
var
|
|
8358
|
-
var
|
|
8359
|
-
var
|
|
8360
|
-
let t =
|
|
8353
|
+
var jr = /* @__PURE__ */ new Map([["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ["onentry", "onReadEntry"]]);
|
|
8354
|
+
var Fs = (s3) => !!s3.sync && !!s3.file;
|
|
8355
|
+
var ks = (s3) => !s3.sync && !!s3.file;
|
|
8356
|
+
var vs = (s3) => !!s3.sync && !s3.file;
|
|
8357
|
+
var Ms = (s3) => !s3.sync && !s3.file;
|
|
8358
|
+
var Bs = (s3) => !!s3.file;
|
|
8359
|
+
var tn = (s3) => {
|
|
8360
|
+
let t = jr.get(s3);
|
|
8361
8361
|
return t || s3;
|
|
8362
8362
|
};
|
|
8363
8363
|
var se = (s3 = {}) => {
|
|
8364
8364
|
if (!s3) return {};
|
|
8365
8365
|
let t = {};
|
|
8366
8366
|
for (let [e, i] of Object.entries(s3)) {
|
|
8367
|
-
let r =
|
|
8367
|
+
let r = tn(e);
|
|
8368
8368
|
t[r] = i;
|
|
8369
8369
|
}
|
|
8370
8370
|
return t.chmod === void 0 && t.noChmod === false && (t.chmod = true), delete t.noChmod, t;
|
|
8371
8371
|
};
|
|
8372
|
-
var K = (s3, t, e, i, r) => Object.assign((n = [], o,
|
|
8373
|
-
Array.isArray(n) && (o = n, n = {}), typeof o == "function" && (
|
|
8374
|
-
let
|
|
8375
|
-
if (r?.(
|
|
8376
|
-
if (typeof
|
|
8377
|
-
return s3(
|
|
8378
|
-
} else if (
|
|
8379
|
-
let l = t(
|
|
8380
|
-
return
|
|
8381
|
-
} else if (
|
|
8382
|
-
if (typeof
|
|
8383
|
-
return e(
|
|
8384
|
-
} else if (
|
|
8385
|
-
if (typeof
|
|
8386
|
-
return i(
|
|
8372
|
+
var K = (s3, t, e, i, r) => Object.assign((n = [], o, h) => {
|
|
8373
|
+
Array.isArray(n) && (o = n, n = {}), typeof o == "function" && (h = o, o = void 0), o = o ? Array.from(o) : [];
|
|
8374
|
+
let a = se(n);
|
|
8375
|
+
if (r?.(a, o), Fs(a)) {
|
|
8376
|
+
if (typeof h == "function") throw new TypeError("callback not supported for sync tar functions");
|
|
8377
|
+
return s3(a, o);
|
|
8378
|
+
} else if (ks(a)) {
|
|
8379
|
+
let l = t(a, o);
|
|
8380
|
+
return h ? l.then(() => h(), h) : l;
|
|
8381
|
+
} else if (vs(a)) {
|
|
8382
|
+
if (typeof h == "function") throw new TypeError("callback not supported for sync tar functions");
|
|
8383
|
+
return e(a, o);
|
|
8384
|
+
} else if (Ms(a)) {
|
|
8385
|
+
if (typeof h == "function") throw new TypeError("callback only supported with file option");
|
|
8386
|
+
return i(a, o);
|
|
8387
8387
|
}
|
|
8388
8388
|
throw new Error("impossible options??");
|
|
8389
8389
|
}, { syncFile: s3, asyncFile: t, syncNoFile: e, asyncNoFile: i, validate: r });
|
|
8390
|
-
var
|
|
8391
|
-
var M = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 },
|
|
8392
|
-
var
|
|
8393
|
-
var
|
|
8394
|
-
var
|
|
8395
|
-
var
|
|
8396
|
-
Ot.concat = s3 ?
|
|
8390
|
+
var sn = en.constants || { ZLIB_VERNUM: 4736 };
|
|
8391
|
+
var M = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, sn));
|
|
8392
|
+
var rn = Ot.concat;
|
|
8393
|
+
var zs = Object.getOwnPropertyDescriptor(Ot, "concat");
|
|
8394
|
+
var nn = (s3) => s3;
|
|
8395
|
+
var Bi = zs?.writable === true || zs?.set !== void 0 ? (s3) => {
|
|
8396
|
+
Ot.concat = s3 ? nn : rn;
|
|
8397
8397
|
} : (s3) => {
|
|
8398
8398
|
};
|
|
8399
8399
|
var Tt = /* @__PURE__ */ Symbol("_superWrite");
|
|
@@ -8407,7 +8407,7 @@ var Gt = class extends Error {
|
|
|
8407
8407
|
return "ZlibError";
|
|
8408
8408
|
}
|
|
8409
8409
|
};
|
|
8410
|
-
var
|
|
8410
|
+
var Pi = /* @__PURE__ */ Symbol("flushFlag");
|
|
8411
8411
|
var re = class extends A {
|
|
8412
8412
|
#t = false;
|
|
8413
8413
|
#i = false;
|
|
@@ -8427,9 +8427,9 @@ var re = class extends A {
|
|
|
8427
8427
|
}
|
|
8428
8428
|
constructor(t, e) {
|
|
8429
8429
|
if (!t || typeof t != "object") throw new TypeError("invalid options for ZlibBase constructor");
|
|
8430
|
-
if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof
|
|
8430
|
+
if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof Ps[e] != "function") throw new TypeError("Compression method not supported: " + e);
|
|
8431
8431
|
try {
|
|
8432
|
-
this.#e = new
|
|
8432
|
+
this.#e = new Ps[e](t);
|
|
8433
8433
|
} catch (i) {
|
|
8434
8434
|
throw new Gt(i, this.constructor);
|
|
8435
8435
|
}
|
|
@@ -8441,10 +8441,10 @@ var re = class extends A {
|
|
|
8441
8441
|
this.#e && (this.#e.close(), this.#e = void 0, this.emit("close"));
|
|
8442
8442
|
}
|
|
8443
8443
|
reset() {
|
|
8444
|
-
if (!this.#t) return
|
|
8444
|
+
if (!this.#t) return zi(this.#e, "zlib binding closed"), this.#e.reset?.();
|
|
8445
8445
|
}
|
|
8446
8446
|
flush(t) {
|
|
8447
|
-
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(Ot.alloc(0), { [
|
|
8447
|
+
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(Ot.alloc(0), { [Pi]: t })));
|
|
8448
8448
|
}
|
|
8449
8449
|
end(t, e, i) {
|
|
8450
8450
|
return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), t && (e ? this.write(t, e) : this.write(t)), this.flush(this.#n), this.#i = true, super.end(i);
|
|
@@ -8457,33 +8457,33 @@ var re = class extends A {
|
|
|
8457
8457
|
}
|
|
8458
8458
|
write(t, e, i) {
|
|
8459
8459
|
if (typeof e == "function" && (i = e, e = "utf8"), typeof t == "string" && (t = Ot.from(t, e)), this.#t) return;
|
|
8460
|
-
|
|
8460
|
+
zi(this.#e, "zlib binding closed");
|
|
8461
8461
|
let r = this.#e._handle, n = r.close;
|
|
8462
8462
|
r.close = () => {
|
|
8463
8463
|
};
|
|
8464
8464
|
let o = this.#e.close;
|
|
8465
8465
|
this.#e.close = () => {
|
|
8466
|
-
},
|
|
8467
|
-
let
|
|
8466
|
+
}, Bi(true);
|
|
8467
|
+
let h;
|
|
8468
8468
|
try {
|
|
8469
|
-
let l = typeof t[
|
|
8470
|
-
|
|
8469
|
+
let l = typeof t[Pi] == "number" ? t[Pi] : this.#s;
|
|
8470
|
+
h = this.#e._processChunk(t, l), Bi(false);
|
|
8471
8471
|
} catch (l) {
|
|
8472
|
-
|
|
8472
|
+
Bi(false), this.#o(new Gt(l, this.write));
|
|
8473
8473
|
} finally {
|
|
8474
8474
|
this.#e && (this.#e._handle = r, r.close = n, this.#e.close = o, this.#e.removeAllListeners("error"));
|
|
8475
8475
|
}
|
|
8476
8476
|
this.#e && this.#e.on("error", (l) => this.#o(new Gt(l, this.write)));
|
|
8477
|
-
let
|
|
8478
|
-
if (
|
|
8479
|
-
let l =
|
|
8480
|
-
|
|
8481
|
-
for (let c = 1; c <
|
|
8482
|
-
} else
|
|
8483
|
-
return i && i(),
|
|
8477
|
+
let a;
|
|
8478
|
+
if (h) if (Array.isArray(h) && h.length > 0) {
|
|
8479
|
+
let l = h[0];
|
|
8480
|
+
a = this[Tt](Ot.from(l));
|
|
8481
|
+
for (let c = 1; c < h.length; c++) a = this[Tt](h[c]);
|
|
8482
|
+
} else a = this[Tt](Ot.from(h));
|
|
8483
|
+
return i && i(), a;
|
|
8484
8484
|
}
|
|
8485
8485
|
};
|
|
8486
|
-
var
|
|
8486
|
+
var Pe = class extends re {
|
|
8487
8487
|
#t;
|
|
8488
8488
|
#i;
|
|
8489
8489
|
constructor(t, e) {
|
|
@@ -8494,7 +8494,7 @@ var Be = class extends re {
|
|
|
8494
8494
|
if (!this.handle) throw new Error("cannot switch params when binding is closed");
|
|
8495
8495
|
if (!this.handle.params) throw new Error("not supported in this implementation");
|
|
8496
8496
|
if (this.#t !== t || this.#i !== e) {
|
|
8497
|
-
this.flush(M.Z_SYNC_FLUSH),
|
|
8497
|
+
this.flush(M.Z_SYNC_FLUSH), zi(this.handle, "zlib binding closed");
|
|
8498
8498
|
let i = this.handle.flush;
|
|
8499
8499
|
this.handle.flush = (r, n) => {
|
|
8500
8500
|
typeof r == "function" && (n = r, r = this.flushFlag), this.flush(r), n?.();
|
|
@@ -8509,7 +8509,7 @@ var Be = class extends re {
|
|
|
8509
8509
|
}
|
|
8510
8510
|
}
|
|
8511
8511
|
};
|
|
8512
|
-
var
|
|
8512
|
+
var ze = class extends Pe {
|
|
8513
8513
|
#t;
|
|
8514
8514
|
constructor(t) {
|
|
8515
8515
|
super(t, "Gzip"), this.#t = t && !!t.portable;
|
|
@@ -8518,89 +8518,90 @@ var Pe = class extends Be {
|
|
|
8518
8518
|
return this.#t ? (this.#t = false, t[9] = 255, super[Tt](t)) : super[Tt](t);
|
|
8519
8519
|
}
|
|
8520
8520
|
};
|
|
8521
|
-
var
|
|
8521
|
+
var Ue = class extends Pe {
|
|
8522
8522
|
constructor(t) {
|
|
8523
8523
|
super(t, "Unzip");
|
|
8524
8524
|
}
|
|
8525
8525
|
};
|
|
8526
|
-
var
|
|
8526
|
+
var He = class extends re {
|
|
8527
8527
|
constructor(t, e) {
|
|
8528
8528
|
t = t || {}, t.flush = t.flush || M.BROTLI_OPERATION_PROCESS, t.finishFlush = t.finishFlush || M.BROTLI_OPERATION_FINISH, t.fullFlushFlag = M.BROTLI_OPERATION_FLUSH, super(t, e);
|
|
8529
8529
|
}
|
|
8530
8530
|
};
|
|
8531
|
-
var
|
|
8531
|
+
var We = class extends He {
|
|
8532
8532
|
constructor(t) {
|
|
8533
8533
|
super(t, "BrotliCompress");
|
|
8534
8534
|
}
|
|
8535
8535
|
};
|
|
8536
|
-
var
|
|
8536
|
+
var Ge = class extends He {
|
|
8537
8537
|
constructor(t) {
|
|
8538
8538
|
super(t, "BrotliDecompress");
|
|
8539
8539
|
}
|
|
8540
8540
|
};
|
|
8541
|
-
var
|
|
8541
|
+
var Ze = class extends re {
|
|
8542
8542
|
constructor(t, e) {
|
|
8543
8543
|
t = t || {}, t.flush = t.flush || M.ZSTD_e_continue, t.finishFlush = t.finishFlush || M.ZSTD_e_end, t.fullFlushFlag = M.ZSTD_e_flush, super(t, e);
|
|
8544
8544
|
}
|
|
8545
8545
|
};
|
|
8546
|
-
var
|
|
8546
|
+
var Ye = class extends Ze {
|
|
8547
8547
|
constructor(t) {
|
|
8548
8548
|
super(t, "ZstdCompress");
|
|
8549
8549
|
}
|
|
8550
8550
|
};
|
|
8551
|
-
var
|
|
8551
|
+
var Ke = class extends Ze {
|
|
8552
8552
|
constructor(t) {
|
|
8553
8553
|
super(t, "ZstdDecompress");
|
|
8554
8554
|
}
|
|
8555
8555
|
};
|
|
8556
|
-
var
|
|
8557
|
-
if (Number.isSafeInteger(s3)) s3 < 0 ?
|
|
8556
|
+
var Us = (s3, t) => {
|
|
8557
|
+
if (Number.isSafeInteger(s3)) s3 < 0 ? an(s3, t) : hn(s3, t);
|
|
8558
8558
|
else throw Error("cannot encode number outside of javascript safe integer range");
|
|
8559
8559
|
return t;
|
|
8560
8560
|
};
|
|
8561
|
-
var
|
|
8561
|
+
var hn = (s3, t) => {
|
|
8562
8562
|
t[0] = 128;
|
|
8563
8563
|
for (var e = t.length; e > 1; e--) t[e - 1] = s3 & 255, s3 = Math.floor(s3 / 256);
|
|
8564
8564
|
};
|
|
8565
|
-
var
|
|
8565
|
+
var an = (s3, t) => {
|
|
8566
8566
|
t[0] = 255;
|
|
8567
8567
|
var e = false;
|
|
8568
8568
|
s3 = s3 * -1;
|
|
8569
8569
|
for (var i = t.length; i > 1; i--) {
|
|
8570
8570
|
var r = s3 & 255;
|
|
8571
|
-
s3 = Math.floor(s3 / 256), e ? t[i - 1] =
|
|
8571
|
+
s3 = Math.floor(s3 / 256), e ? t[i - 1] = Ws(r) : r === 0 ? t[i - 1] = 0 : (e = true, t[i - 1] = Gs(r));
|
|
8572
8572
|
}
|
|
8573
8573
|
};
|
|
8574
|
-
var
|
|
8575
|
-
let t = s3[0], e = t === 128 ?
|
|
8574
|
+
var Hs = (s3) => {
|
|
8575
|
+
let t = s3[0], e = t === 128 ? cn(s3.subarray(1, s3.length)) : t === 255 ? ln(s3) : null;
|
|
8576
8576
|
if (e === null) throw Error("invalid base256 encoding");
|
|
8577
8577
|
if (!Number.isSafeInteger(e)) throw Error("parsed number outside of javascript safe integer range");
|
|
8578
8578
|
return e;
|
|
8579
8579
|
};
|
|
8580
|
-
var
|
|
8580
|
+
var ln = (s3) => {
|
|
8581
8581
|
for (var t = s3.length, e = 0, i = false, r = t - 1; r > -1; r--) {
|
|
8582
8582
|
var n = Number(s3[r]), o;
|
|
8583
|
-
i ? o =
|
|
8583
|
+
i ? o = Ws(n) : n === 0 ? o = n : (i = true, o = Gs(n)), o !== 0 && (e -= o * Math.pow(256, t - r - 1));
|
|
8584
8584
|
}
|
|
8585
8585
|
return e;
|
|
8586
8586
|
};
|
|
8587
|
-
var
|
|
8587
|
+
var cn = (s3) => {
|
|
8588
8588
|
for (var t = s3.length, e = 0, i = t - 1; i > -1; i--) {
|
|
8589
8589
|
var r = Number(s3[i]);
|
|
8590
8590
|
r !== 0 && (e += r * Math.pow(256, t - i - 1));
|
|
8591
8591
|
}
|
|
8592
8592
|
return e;
|
|
8593
8593
|
};
|
|
8594
|
-
var
|
|
8595
|
-
var
|
|
8596
|
-
var
|
|
8597
|
-
|
|
8594
|
+
var Ws = (s3) => (255 ^ s3) & 255;
|
|
8595
|
+
var Gs = (s3) => (255 ^ s3) + 1 & 255;
|
|
8596
|
+
var Hi = {};
|
|
8597
|
+
Ur(Hi, { code: () => Ve, isCode: () => ne, isName: () => dn, name: () => oe, normalFsTypes: () => Ui });
|
|
8598
8598
|
var ne = (s3) => oe.has(s3);
|
|
8599
|
-
var
|
|
8600
|
-
var
|
|
8599
|
+
var dn = (s3) => Ve.has(s3);
|
|
8600
|
+
var Ui = /* @__PURE__ */ new Set(["0", "", "1", "2", "3", "4", "5", "6", "7", "D"]);
|
|
8601
8601
|
var oe = /* @__PURE__ */ new Map([["0", "File"], ["", "OldFile"], ["1", "Link"], ["2", "SymbolicLink"], ["3", "CharacterDevice"], ["4", "BlockDevice"], ["5", "Directory"], ["6", "FIFO"], ["7", "ContiguousFile"], ["g", "GlobalExtendedHeader"], ["x", "ExtendedHeader"], ["A", "SolarisACL"], ["D", "GNUDumpDir"], ["I", "Inode"], ["K", "NextFileHasLongLinkpath"], ["L", "NextFileHasLongPath"], ["M", "ContinuationFile"], ["N", "OldGnuLongPath"], ["S", "SparseFile"], ["V", "TapeVolumeHeader"], ["X", "OldExtendedHeader"]]);
|
|
8602
|
-
var
|
|
8603
|
-
var
|
|
8602
|
+
var Ve = new Map(Array.from(oe).map((s3) => [s3[1], s3[0]]));
|
|
8603
|
+
var mn = (s3) => s3 === void 0 || s3 < 0 ? void 0 : s3;
|
|
8604
|
+
var F = class {
|
|
8604
8605
|
cksumValid = false;
|
|
8605
8606
|
needPax = false;
|
|
8606
8607
|
nullBlock = false;
|
|
@@ -8627,13 +8628,13 @@ var C = class {
|
|
|
8627
8628
|
}
|
|
8628
8629
|
decode(t, e, i, r) {
|
|
8629
8630
|
if (e || (e = 0), !t || !(t.length >= e + 512)) throw new Error("need 512 bytes for header");
|
|
8630
|
-
let n = xt(t, e + 156, 1), o =
|
|
8631
|
-
if (this.path =
|
|
8631
|
+
let n = xt(t, e + 156, 1), o = Ui.has(n), h = o ? i : void 0, a = o ? r : void 0;
|
|
8632
|
+
if (this.path = h?.path ?? xt(t, e, 100), this.mode = h?.mode ?? a?.mode ?? lt(t, e + 100, 8), this.uid = h?.uid ?? a?.uid ?? lt(t, e + 108, 8), this.gid = h?.gid ?? a?.gid ?? lt(t, e + 116, 8), this.size = mn(h?.size ?? a?.size ?? lt(t, e + 124, 12)), this.mtime = h?.mtime ?? a?.mtime ?? Wi(t, e + 136, 12), this.cksum = lt(t, e + 148, 12), a && this.#i(a, true), h && this.#i(h), ne(n) && (this.#t = n || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = xt(t, e + 157, 100), t.subarray(e + 257, e + 265).toString() === "ustar\x0000") if (this.uname = h?.uname ?? a?.uname ?? xt(t, e + 265, 32), this.gname = h?.gname ?? a?.gname ?? xt(t, e + 297, 32), this.devmaj = h?.devmaj ?? a?.devmaj ?? lt(t, e + 329, 8) ?? 0, this.devmin = h?.devmin ?? a?.devmin ?? lt(t, e + 337, 8) ?? 0, t[e + 475] !== 0) {
|
|
8632
8633
|
let c = xt(t, e + 345, 155);
|
|
8633
8634
|
this.path = c + "/" + this.path;
|
|
8634
8635
|
} else {
|
|
8635
8636
|
let c = xt(t, e + 345, 130);
|
|
8636
|
-
c && (this.path = c + "/" + this.path), this.atime = i?.atime ?? r?.atime ??
|
|
8637
|
+
c && (this.path = c + "/" + this.path), this.atime = i?.atime ?? r?.atime ?? Wi(t, e + 476, 12), this.ctime = i?.ctime ?? r?.ctime ?? Wi(t, e + 488, 12);
|
|
8637
8638
|
}
|
|
8638
8639
|
let l = 256;
|
|
8639
8640
|
for (let c = e; c < e + 148; c++) l += t[c];
|
|
@@ -8641,16 +8642,16 @@ var C = class {
|
|
|
8641
8642
|
this.cksumValid = l === this.cksum, this.cksum === void 0 && l === 256 && (this.nullBlock = true);
|
|
8642
8643
|
}
|
|
8643
8644
|
#i(t, e = false) {
|
|
8644
|
-
Object.assign(this, Object.fromEntries(Object.entries(t).filter(([i, r]) => !(r == null || i === "path" && e || i === "linkpath" && e || i === "global"))));
|
|
8645
|
+
Object.assign(this, Object.fromEntries(Object.entries(t).filter(([i, r]) => !(r == null || i === "size" && Number(r) < 0 || i === "path" && e || i === "linkpath" && e || i === "global"))));
|
|
8645
8646
|
}
|
|
8646
8647
|
encode(t, e = 0) {
|
|
8647
8648
|
if (t || (t = this.block = Buffer.alloc(512)), this.#t === "Unsupported" && (this.#t = "0"), !(t.length >= e + 512)) throw new Error("need 512 bytes for header");
|
|
8648
|
-
let i = this.ctime || this.atime ? 130 : 155, r =
|
|
8649
|
-
this.needPax = !!r[2], this.needPax = Lt(t, e, 100, n) || this.needPax, this.needPax =
|
|
8650
|
-
let
|
|
8651
|
-
for (let
|
|
8652
|
-
for (let
|
|
8653
|
-
return this.cksum =
|
|
8649
|
+
let i = this.ctime || this.atime ? 130 : 155, r = un(this.path || "", i), n = r[0], o = r[1];
|
|
8650
|
+
this.needPax = !!r[2], this.needPax = Lt(t, e, 100, n) || this.needPax, this.needPax = ct(t, e + 100, 8, this.mode) || this.needPax, this.needPax = ct(t, e + 108, 8, this.uid) || this.needPax, this.needPax = ct(t, e + 116, 8, this.gid) || this.needPax, this.needPax = ct(t, e + 124, 12, this.size) || this.needPax, this.needPax = Gi(t, e + 136, 12, this.mtime) || this.needPax, t[e + 156] = Number(this.#t.codePointAt(0)), this.needPax = Lt(t, e + 157, 100, this.linkpath) || this.needPax, t.write("ustar\x0000", e + 257, 8), this.needPax = Lt(t, e + 265, 32, this.uname) || this.needPax, this.needPax = Lt(t, e + 297, 32, this.gname) || this.needPax, this.needPax = ct(t, e + 329, 8, this.devmaj) || this.needPax, this.needPax = ct(t, e + 337, 8, this.devmin) || this.needPax, this.needPax = Lt(t, e + 345, i, o) || this.needPax, t[e + 475] !== 0 ? this.needPax = Lt(t, e + 345, 155, o) || this.needPax : (this.needPax = Lt(t, e + 345, 130, o) || this.needPax, this.needPax = Gi(t, e + 476, 12, this.atime) || this.needPax, this.needPax = Gi(t, e + 488, 12, this.ctime) || this.needPax);
|
|
8651
|
+
let h = 256;
|
|
8652
|
+
for (let a = e; a < e + 148; a++) h += t[a];
|
|
8653
|
+
for (let a = e + 156; a < e + 512; a++) h += t[a];
|
|
8654
|
+
return this.cksum = h, ct(t, e + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
|
|
8654
8655
|
}
|
|
8655
8656
|
get type() {
|
|
8656
8657
|
return this.#t === "Unsupported" ? this.#t : oe.get(this.#t);
|
|
@@ -8659,13 +8660,13 @@ var C = class {
|
|
|
8659
8660
|
return this.#t;
|
|
8660
8661
|
}
|
|
8661
8662
|
set type(t) {
|
|
8662
|
-
let e = String(
|
|
8663
|
+
let e = String(Ve.get(t));
|
|
8663
8664
|
if (ne(e) || e === "Unsupported") this.#t = e;
|
|
8664
8665
|
else if (ne(t)) this.#t = t;
|
|
8665
8666
|
else throw new TypeError("invalid entry type: " + t);
|
|
8666
8667
|
}
|
|
8667
8668
|
};
|
|
8668
|
-
var
|
|
8669
|
+
var un = (s3, t) => {
|
|
8669
8670
|
let i = s3, r = "", n, o = Zt.parse(s3).root || ".";
|
|
8670
8671
|
if (Buffer.byteLength(i) < 100) n = [i, r, false];
|
|
8671
8672
|
else {
|
|
@@ -8678,20 +8679,20 @@ var cn = (s3, t) => {
|
|
|
8678
8679
|
return n;
|
|
8679
8680
|
};
|
|
8680
8681
|
var xt = (s3, t, e) => s3.subarray(t, t + e).toString("utf8").replace(/\0.*/, "");
|
|
8681
|
-
var
|
|
8682
|
-
var
|
|
8683
|
-
var
|
|
8684
|
-
var
|
|
8685
|
-
var
|
|
8686
|
-
var
|
|
8687
|
-
var
|
|
8688
|
-
var
|
|
8689
|
-
var
|
|
8690
|
-
var
|
|
8691
|
-
var
|
|
8692
|
-
var
|
|
8693
|
-
var Lt = (s3, t, e, i) => i === void 0 ? false : (s3.write(i +
|
|
8694
|
-
var
|
|
8682
|
+
var Wi = (s3, t, e) => pn(lt(s3, t, e));
|
|
8683
|
+
var pn = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
|
|
8684
|
+
var lt = (s3, t, e) => Number(s3[t]) & 128 ? Hs(s3.subarray(t, t + e)) : wn(s3, t, e);
|
|
8685
|
+
var En = (s3) => isNaN(s3) ? void 0 : s3;
|
|
8686
|
+
var wn = (s3, t, e) => En(parseInt(s3.subarray(t, t + e).toString("utf8").replace(/\0.*$/, "").trim(), 8));
|
|
8687
|
+
var Sn = { 12: 8589934591, 8: 2097151 };
|
|
8688
|
+
var ct = (s3, t, e, i) => i === void 0 ? false : i > Sn[e] || i < 0 ? (Us(i, s3.subarray(t, t + e)), true) : (yn(s3, t, e, i), false);
|
|
8689
|
+
var yn = (s3, t, e, i) => s3.write(Rn(i, e), t, e, "ascii");
|
|
8690
|
+
var Rn = (s3, t) => gn(Math.floor(s3).toString(8), t);
|
|
8691
|
+
var gn = (s3, t) => (s3.length === t - 1 ? s3 : new Array(t - s3.length - 1).join("0") + s3 + " ") + "\0";
|
|
8692
|
+
var Gi = (s3, t, e, i) => i === void 0 ? false : ct(s3, t, e, i.getTime() / 1e3);
|
|
8693
|
+
var bn = new Array(156).join("\0");
|
|
8694
|
+
var Lt = (s3, t, e, i) => i === void 0 ? false : (s3.write(i + bn, t, e, "utf8"), i.length !== Buffer.byteLength(i) || i.length > e);
|
|
8695
|
+
var ft = class s {
|
|
8695
8696
|
atime;
|
|
8696
8697
|
mtime;
|
|
8697
8698
|
ctime;
|
|
@@ -8717,7 +8718,7 @@ var ct = class s {
|
|
|
8717
8718
|
if (t === "") return Buffer.allocUnsafe(0);
|
|
8718
8719
|
let e = Buffer.byteLength(t), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
|
|
8719
8720
|
for (let n = 0; n < 512; n++) r[n] = 0;
|
|
8720
|
-
new
|
|
8721
|
+
new F({ path: ("PaxHeader/" + _n(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t, 512, e, "utf8");
|
|
8721
8722
|
for (let n = e + 512; n < r.length; n++) r[n] = 0;
|
|
8722
8723
|
return r;
|
|
8723
8724
|
}
|
|
@@ -8731,24 +8732,52 @@ var ct = class s {
|
|
|
8731
8732
|
return n + o >= Math.pow(10, o) && (o += 1), o + n + r;
|
|
8732
8733
|
}
|
|
8733
8734
|
static parse(t, e, i = false) {
|
|
8734
|
-
return new s(
|
|
8735
|
+
return new s(On(Tn(t), e), i);
|
|
8735
8736
|
}
|
|
8736
8737
|
};
|
|
8737
|
-
var
|
|
8738
|
-
var
|
|
8739
|
-
`).reduce(
|
|
8740
|
-
var
|
|
8738
|
+
var On = (s3, t) => t ? Object.assign({}, t, s3) : s3;
|
|
8739
|
+
var Tn = (s3) => s3.replace(/\n$/, "").split(`
|
|
8740
|
+
`).reduce(xn, /* @__PURE__ */ Object.create(null));
|
|
8741
|
+
var xn = (s3, t) => {
|
|
8741
8742
|
let e = parseInt(t, 10);
|
|
8742
8743
|
if (e !== Buffer.byteLength(t) + 1) return s3;
|
|
8743
8744
|
t = t.slice((e + " ").length);
|
|
8744
8745
|
let i = t.split("="), r = i.shift();
|
|
8745
8746
|
if (!r) return s3;
|
|
8746
|
-
let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o = i.join("=");
|
|
8747
|
-
|
|
8747
|
+
let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o = i.join("=").replace(/\0.*/, "");
|
|
8748
|
+
switch (n) {
|
|
8749
|
+
case "path":
|
|
8750
|
+
case "linkpath":
|
|
8751
|
+
case "type":
|
|
8752
|
+
case "charset":
|
|
8753
|
+
case "comment":
|
|
8754
|
+
case "gname":
|
|
8755
|
+
case "uname":
|
|
8756
|
+
s3[n] = o;
|
|
8757
|
+
break;
|
|
8758
|
+
case "ctime":
|
|
8759
|
+
case "atime":
|
|
8760
|
+
case "mtime":
|
|
8761
|
+
s3[n] = new Date(Number(o) * 1e3);
|
|
8762
|
+
break;
|
|
8763
|
+
case "size":
|
|
8764
|
+
let h = +o;
|
|
8765
|
+
h >= 0 && (s3[n] = h);
|
|
8766
|
+
break;
|
|
8767
|
+
case "gid":
|
|
8768
|
+
case "uid":
|
|
8769
|
+
case "dev":
|
|
8770
|
+
case "ino":
|
|
8771
|
+
case "nlink":
|
|
8772
|
+
case "mode":
|
|
8773
|
+
s3[n] = +o;
|
|
8774
|
+
break;
|
|
8775
|
+
}
|
|
8776
|
+
return s3;
|
|
8748
8777
|
};
|
|
8749
|
-
var
|
|
8750
|
-
var f =
|
|
8751
|
-
var
|
|
8778
|
+
var Ln = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
8779
|
+
var f = Ln !== "win32" ? (s3) => String(s3) : (s3) => String(s3).replaceAll(/\\/g, "/");
|
|
8780
|
+
var $e = class extends A {
|
|
8752
8781
|
extended;
|
|
8753
8782
|
globalExtended;
|
|
8754
8783
|
header;
|
|
@@ -8812,163 +8841,170 @@ var Ve = class extends A {
|
|
|
8812
8841
|
t.path && (t.path = f(t.path)), t.linkpath && (t.linkpath = f(t.linkpath)), Object.assign(this, Object.fromEntries(Object.entries(t).filter(([i, r]) => !(r == null || i === "path" && e))));
|
|
8813
8842
|
}
|
|
8814
8843
|
};
|
|
8815
|
-
var
|
|
8844
|
+
var Dt = (s3, t, e, i = {}) => {
|
|
8816
8845
|
s3.file && (i.file = s3.file), s3.cwd && (i.cwd = s3.cwd), i.code = e instanceof Error && e.code || t, i.tarCode = t, !s3.strict && i.recoverable !== false ? (e instanceof Error && (i = Object.assign(e, i), e = e.message), s3.emit("warn", t, e, i)) : e instanceof Error ? s3.emit("error", Object.assign(e, i)) : s3.emit("error", Object.assign(new Error(`${t}: ${e}`), i));
|
|
8817
8846
|
};
|
|
8818
|
-
var
|
|
8819
|
-
var
|
|
8820
|
-
var
|
|
8821
|
-
var
|
|
8847
|
+
var Nn = 1024 * 1024;
|
|
8848
|
+
var Xi = Buffer.from([31, 139]);
|
|
8849
|
+
var qi = Buffer.from([40, 181, 47, 253]);
|
|
8850
|
+
var An = Math.max(Xi.length, qi.length);
|
|
8822
8851
|
var B = /* @__PURE__ */ Symbol("state");
|
|
8823
|
-
var
|
|
8824
|
-
var
|
|
8825
|
-
var
|
|
8826
|
-
var
|
|
8852
|
+
var Nt = /* @__PURE__ */ Symbol("writeEntry");
|
|
8853
|
+
var it = /* @__PURE__ */ Symbol("readEntry");
|
|
8854
|
+
var Zi = /* @__PURE__ */ Symbol("nextEntry");
|
|
8855
|
+
var Zs = /* @__PURE__ */ Symbol("processEntry");
|
|
8827
8856
|
var V = /* @__PURE__ */ Symbol("extendedHeader");
|
|
8828
8857
|
var he = /* @__PURE__ */ Symbol("globalExtendedHeader");
|
|
8829
|
-
var
|
|
8830
|
-
var
|
|
8858
|
+
var dt = /* @__PURE__ */ Symbol("meta");
|
|
8859
|
+
var Ys = /* @__PURE__ */ Symbol("emitMeta");
|
|
8831
8860
|
var p = /* @__PURE__ */ Symbol("buffer");
|
|
8832
|
-
var
|
|
8833
|
-
var
|
|
8834
|
-
var
|
|
8861
|
+
var st = /* @__PURE__ */ Symbol("queue");
|
|
8862
|
+
var mt = /* @__PURE__ */ Symbol("ended");
|
|
8863
|
+
var Yi = /* @__PURE__ */ Symbol("emittedEnd");
|
|
8835
8864
|
var At = /* @__PURE__ */ Symbol("emit");
|
|
8836
8865
|
var y = /* @__PURE__ */ Symbol("unzip");
|
|
8837
|
-
var
|
|
8838
|
-
var
|
|
8839
|
-
var
|
|
8840
|
-
var
|
|
8841
|
-
var
|
|
8866
|
+
var Xe = /* @__PURE__ */ Symbol("consumeChunk");
|
|
8867
|
+
var qe = /* @__PURE__ */ Symbol("consumeChunkSub");
|
|
8868
|
+
var Ki = /* @__PURE__ */ Symbol("consumeBody");
|
|
8869
|
+
var Ks = /* @__PURE__ */ Symbol("consumeMeta");
|
|
8870
|
+
var Vs = /* @__PURE__ */ Symbol("consumeHeader");
|
|
8842
8871
|
var ae = /* @__PURE__ */ Symbol("consuming");
|
|
8843
|
-
var
|
|
8844
|
-
var
|
|
8872
|
+
var Vi = /* @__PURE__ */ Symbol("bufferConcat");
|
|
8873
|
+
var Qe = /* @__PURE__ */ Symbol("maybeEnd");
|
|
8845
8874
|
var Yt = /* @__PURE__ */ Symbol("writing");
|
|
8846
|
-
var
|
|
8847
|
-
var
|
|
8875
|
+
var $ = /* @__PURE__ */ Symbol("aborted");
|
|
8876
|
+
var Je = /* @__PURE__ */ Symbol("onDone");
|
|
8848
8877
|
var It = /* @__PURE__ */ Symbol("sawValidEntry");
|
|
8849
|
-
var
|
|
8850
|
-
var
|
|
8851
|
-
var
|
|
8852
|
-
var
|
|
8853
|
-
var
|
|
8878
|
+
var je = /* @__PURE__ */ Symbol("sawNullBlock");
|
|
8879
|
+
var ti = /* @__PURE__ */ Symbol("sawEOF");
|
|
8880
|
+
var $s = /* @__PURE__ */ Symbol("closeStream");
|
|
8881
|
+
var In = 1e3;
|
|
8882
|
+
var le = /* @__PURE__ */ Symbol("compressedBytesRead");
|
|
8883
|
+
var $i = /* @__PURE__ */ Symbol("decompressedBytesRead");
|
|
8884
|
+
var Xs = /* @__PURE__ */ Symbol("checkDecompressionRatio");
|
|
8885
|
+
var Cn = () => true;
|
|
8886
|
+
var rt = class extends Dn {
|
|
8854
8887
|
file;
|
|
8855
8888
|
strict;
|
|
8856
8889
|
maxMetaEntrySize;
|
|
8857
8890
|
filter;
|
|
8858
8891
|
brotli;
|
|
8859
8892
|
zstd;
|
|
8893
|
+
maxDecompressionRatio;
|
|
8860
8894
|
writable = true;
|
|
8861
8895
|
readable = false;
|
|
8862
|
-
[
|
|
8896
|
+
[st] = [];
|
|
8863
8897
|
[p];
|
|
8864
|
-
[
|
|
8865
|
-
[
|
|
8898
|
+
[it];
|
|
8899
|
+
[Nt];
|
|
8866
8900
|
[B] = "begin";
|
|
8867
|
-
[
|
|
8901
|
+
[dt] = "";
|
|
8868
8902
|
[V];
|
|
8869
8903
|
[he];
|
|
8870
|
-
[
|
|
8904
|
+
[mt] = false;
|
|
8871
8905
|
[y];
|
|
8872
|
-
[
|
|
8906
|
+
[$] = false;
|
|
8873
8907
|
[It];
|
|
8874
|
-
[Je] = false;
|
|
8875
8908
|
[je] = false;
|
|
8909
|
+
[ti] = false;
|
|
8876
8910
|
[Yt] = false;
|
|
8877
8911
|
[ae] = false;
|
|
8878
|
-
[
|
|
8912
|
+
[Yi] = false;
|
|
8913
|
+
[le] = 0;
|
|
8914
|
+
[$i] = 0;
|
|
8879
8915
|
constructor(t = {}) {
|
|
8880
|
-
super(), this.file = t.file || "", this.on(
|
|
8916
|
+
super(), this.file = t.file || "", this.on(Je, () => {
|
|
8881
8917
|
(this[B] === "begin" || this[It] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
|
|
8882
|
-
}), t.ondone ? this.on(
|
|
8918
|
+
}), t.ondone ? this.on(Je, t.ondone) : this.on(Je, () => {
|
|
8883
8919
|
this.emit("prefinish"), this.emit("finish"), this.emit("end");
|
|
8884
|
-
}), this.strict = !!t.strict, this.maxMetaEntrySize = t.maxMetaEntrySize ||
|
|
8920
|
+
}), this.strict = !!t.strict, this.maxDecompressionRatio = typeof t.maxDecompressionRatio == "number" ? t.maxDecompressionRatio : In, this.maxMetaEntrySize = t.maxMetaEntrySize || Nn, this.filter = typeof t.filter == "function" ? t.filter : Cn;
|
|
8885
8921
|
let e = t.file && (t.file.endsWith(".tar.br") || t.file.endsWith(".tbr"));
|
|
8886
8922
|
this.brotli = !(t.gzip || t.zstd) && t.brotli !== void 0 ? t.brotli : e ? void 0 : false;
|
|
8887
8923
|
let i = t.file && (t.file.endsWith(".tar.zst") || t.file.endsWith(".tzst"));
|
|
8888
|
-
this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[
|
|
8924
|
+
this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[$s]()), typeof t.onwarn == "function" && this.on("warn", t.onwarn), typeof t.onReadEntry == "function" && this.on("entry", t.onReadEntry);
|
|
8889
8925
|
}
|
|
8890
8926
|
warn(t, e, i = {}) {
|
|
8891
|
-
|
|
8927
|
+
Dt(this, t, e, i);
|
|
8892
8928
|
}
|
|
8893
|
-
[
|
|
8929
|
+
[Vs](t, e) {
|
|
8894
8930
|
this[It] === void 0 && (this[It] = false);
|
|
8895
8931
|
let i;
|
|
8896
8932
|
try {
|
|
8897
|
-
i = new
|
|
8933
|
+
i = new F(t, e, this[V], this[he]);
|
|
8898
8934
|
} catch (r) {
|
|
8899
8935
|
return this.warn("TAR_ENTRY_INVALID", r);
|
|
8900
8936
|
}
|
|
8901
|
-
if (i.nullBlock) this[
|
|
8902
|
-
else if (this[
|
|
8937
|
+
if (i.nullBlock) this[je] ? (this[ti] = true, this[B] === "begin" && (this[B] = "header"), this[At]("eof")) : (this[je] = true, this[At]("nullBlock"));
|
|
8938
|
+
else if (this[je] = false, !i.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: i });
|
|
8903
8939
|
else if (!i.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: i });
|
|
8904
8940
|
else {
|
|
8905
8941
|
let r = i.type;
|
|
8906
8942
|
if (/^(Symbolic)?Link$/.test(r) && !i.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: i });
|
|
8907
8943
|
else if (!/^(Symbolic)?Link$/.test(r) && !/^(Global)?ExtendedHeader$/.test(r) && i.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: i });
|
|
8908
8944
|
else {
|
|
8909
|
-
let n = this[
|
|
8945
|
+
let n = this[Nt] = new $e(i, this[V], this[he]);
|
|
8910
8946
|
if (!this[It]) if (n.remain) {
|
|
8911
8947
|
let o = () => {
|
|
8912
8948
|
n.invalid || (this[It] = true);
|
|
8913
8949
|
};
|
|
8914
8950
|
n.on("end", o);
|
|
8915
8951
|
} else this[It] = true;
|
|
8916
|
-
n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[At]("ignoredEntry", n), this[B] = "ignore", n.resume()) : n.size > 0 && (this[
|
|
8952
|
+
n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[At]("ignoredEntry", n), this[B] = "ignore", n.resume()) : n.size > 0 && (this[dt] = "", n.on("data", (o) => this[dt] += o), this[B] = "meta") : (this[V] = void 0, n.ignore = n.ignore || !this.filter(n.path, n), n.ignore ? (this[At]("ignoredEntry", n), this[B] = n.remain ? "ignore" : "header", n.resume()) : (n.remain ? this[B] = "body" : (this[B] = "header", n.end()), this[it] ? this[st].push(n) : (this[st].push(n), this[Zi]())));
|
|
8917
8953
|
}
|
|
8918
8954
|
}
|
|
8919
8955
|
}
|
|
8920
|
-
[
|
|
8956
|
+
[$s]() {
|
|
8921
8957
|
queueMicrotask(() => this.emit("close"));
|
|
8922
8958
|
}
|
|
8923
|
-
[
|
|
8959
|
+
[Zs](t) {
|
|
8924
8960
|
let e = true;
|
|
8925
|
-
if (!t) this[
|
|
8961
|
+
if (!t) this[it] = void 0, e = false;
|
|
8926
8962
|
else if (Array.isArray(t)) {
|
|
8927
8963
|
let [i, ...r] = t;
|
|
8928
8964
|
this.emit(i, ...r);
|
|
8929
|
-
} else this[
|
|
8965
|
+
} else this[it] = t, this.emit("entry", t), t.emittedEnd || (t.on("end", () => this[Zi]()), e = false);
|
|
8930
8966
|
return e;
|
|
8931
8967
|
}
|
|
8932
|
-
[
|
|
8968
|
+
[Zi]() {
|
|
8933
8969
|
do
|
|
8934
8970
|
;
|
|
8935
|
-
while (this[
|
|
8936
|
-
if (this[
|
|
8937
|
-
let t = this[
|
|
8971
|
+
while (this[Zs](this[st].shift()));
|
|
8972
|
+
if (this[st].length === 0) {
|
|
8973
|
+
let t = this[it];
|
|
8938
8974
|
!t || t.flowing || t.size === t.remain ? this[Yt] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
|
|
8939
8975
|
}
|
|
8940
8976
|
}
|
|
8941
|
-
[
|
|
8942
|
-
let i = this[
|
|
8977
|
+
[Ki](t, e) {
|
|
8978
|
+
let i = this[Nt];
|
|
8943
8979
|
if (!i) throw new Error("attempt to consume body without entry??");
|
|
8944
8980
|
let r = i.blockRemain ?? 0, n = r >= t.length && e === 0 ? t : t.subarray(e, e + r);
|
|
8945
|
-
return i.write(n), i.blockRemain || (this[B] = "header", this[
|
|
8981
|
+
return i.write(n), i.blockRemain || (this[B] = "header", this[Nt] = void 0, i.end()), n.length;
|
|
8946
8982
|
}
|
|
8947
|
-
[
|
|
8948
|
-
let i = this[
|
|
8949
|
-
return !this[
|
|
8983
|
+
[Ks](t, e) {
|
|
8984
|
+
let i = this[Nt], r = this[Ki](t, e);
|
|
8985
|
+
return !this[Nt] && i && this[Ys](i), r;
|
|
8950
8986
|
}
|
|
8951
8987
|
[At](t, e, i) {
|
|
8952
|
-
this[
|
|
8988
|
+
this[st].length === 0 && !this[it] ? this.emit(t, e, i) : this[st].push([t, e, i]);
|
|
8953
8989
|
}
|
|
8954
|
-
[
|
|
8955
|
-
switch (this[At]("meta", this[
|
|
8990
|
+
[Ys](t) {
|
|
8991
|
+
switch (this[At]("meta", this[dt]), t.type) {
|
|
8956
8992
|
case "ExtendedHeader":
|
|
8957
8993
|
case "OldExtendedHeader":
|
|
8958
|
-
this[V] =
|
|
8994
|
+
this[V] = ft.parse(this[dt], this[V], false);
|
|
8959
8995
|
break;
|
|
8960
8996
|
case "GlobalExtendedHeader":
|
|
8961
|
-
this[he] =
|
|
8997
|
+
this[he] = ft.parse(this[dt], this[he], true);
|
|
8962
8998
|
break;
|
|
8963
8999
|
case "NextFileHasLongPath":
|
|
8964
9000
|
case "OldGnuLongPath": {
|
|
8965
9001
|
let e = this[V] ?? /* @__PURE__ */ Object.create(null);
|
|
8966
|
-
this[V] = e, e.path = this[
|
|
9002
|
+
this[V] = e, e.path = this[dt].replace(/\0.*/, "");
|
|
8967
9003
|
break;
|
|
8968
9004
|
}
|
|
8969
9005
|
case "NextFileHasLongLinkpath": {
|
|
8970
9006
|
let e = this[V] || /* @__PURE__ */ Object.create(null);
|
|
8971
|
-
this[V] = e, e.linkpath = this[
|
|
9007
|
+
this[V] = e, e.linkpath = this[dt].replace(/\0.*/, "");
|
|
8972
9008
|
break;
|
|
8973
9009
|
}
|
|
8974
9010
|
default:
|
|
@@ -8976,86 +9012,95 @@ var st = class extends On {
|
|
|
8976
9012
|
}
|
|
8977
9013
|
}
|
|
8978
9014
|
abort(t) {
|
|
8979
|
-
this[
|
|
9015
|
+
this[$] || (this[$] = true, this.emit("abort", t), this.warn("TAR_ABORT", t, { recoverable: false }));
|
|
9016
|
+
}
|
|
9017
|
+
[Xs](t) {
|
|
9018
|
+
this[$i] += t.length;
|
|
9019
|
+
let e = this[$i] / this[le];
|
|
9020
|
+
return e > this.maxDecompressionRatio ? (this.abort(new Error(`max decompression ratio exceeded: ${e.toFixed(2)} > ${this.maxDecompressionRatio}`)), false) : true;
|
|
8980
9021
|
}
|
|
8981
9022
|
write(t, e, i) {
|
|
8982
|
-
if (typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e == "string" ? e : "utf8")), this[
|
|
9023
|
+
if (typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e == "string" ? e : "utf8")), this[$]) return i?.(), false;
|
|
8983
9024
|
if ((this[y] === void 0 || this.brotli === void 0 && this[y] === false) && t) {
|
|
8984
|
-
if (this[p] && (t = Buffer.concat([this[p], t]), this[p] = void 0), t.length <
|
|
8985
|
-
for (let
|
|
9025
|
+
if (this[p] && (t = Buffer.concat([this[p], t]), this[p] = void 0), t.length < An) return this[p] = t, i?.(), true;
|
|
9026
|
+
for (let a = 0; this[y] === void 0 && a < Xi.length; a++) t[a] !== Xi[a] && (this[y] = false);
|
|
8986
9027
|
let o = false;
|
|
8987
9028
|
if (this[y] === false && this.zstd !== false) {
|
|
8988
9029
|
o = true;
|
|
8989
|
-
for (let
|
|
9030
|
+
for (let a = 0; a < qi.length; a++) if (t[a] !== qi[a]) {
|
|
8990
9031
|
o = false;
|
|
8991
9032
|
break;
|
|
8992
9033
|
}
|
|
8993
9034
|
}
|
|
8994
|
-
let
|
|
8995
|
-
if (this[y] === false &&
|
|
9035
|
+
let h = this.brotli === void 0 && !o;
|
|
9036
|
+
if (this[y] === false && h) if (t.length < 512) if (this[mt]) this.brotli = true;
|
|
8996
9037
|
else return this[p] = t, i?.(), true;
|
|
8997
9038
|
else try {
|
|
8998
|
-
new
|
|
9039
|
+
new F(t.subarray(0, 512)), this.brotli = false;
|
|
8999
9040
|
} catch {
|
|
9000
9041
|
this.brotli = true;
|
|
9001
9042
|
}
|
|
9002
9043
|
if (this[y] === void 0 || this[y] === false && (this.brotli || o)) {
|
|
9003
|
-
let
|
|
9004
|
-
this[
|
|
9005
|
-
this[
|
|
9006
|
-
}), this[
|
|
9007
|
-
|
|
9044
|
+
let a = this[mt];
|
|
9045
|
+
this[mt] = false, this[y] = this[y] === void 0 ? new Ue({}) : o ? new Ke({}) : new Ge({}), this[y].on("data", (c) => {
|
|
9046
|
+
this[Xs](c) && this[Xe](c);
|
|
9047
|
+
}), this[y].on("error", (c) => {
|
|
9048
|
+
this[$] || this.abort(c);
|
|
9049
|
+
}), this[y].on("end", () => {
|
|
9050
|
+
this[mt] = true, this[Xe]();
|
|
9051
|
+
}), this[Yt] = true, this[le] += t.length;
|
|
9052
|
+
let l = !!this[y][a ? "end" : "write"](t);
|
|
9008
9053
|
return this[Yt] = false, i?.(), l;
|
|
9009
9054
|
}
|
|
9010
9055
|
}
|
|
9011
|
-
this[Yt] = true, this[y] ? this[y].write(t) : this[
|
|
9012
|
-
let n = this[
|
|
9013
|
-
return !n && this[
|
|
9056
|
+
this[Yt] = true, this[y] ? (this[le] += t.length, this[y].write(t)) : this[Xe](t), this[Yt] = false;
|
|
9057
|
+
let n = this[st].length > 0 ? false : this[it] ? this[it].flowing : true;
|
|
9058
|
+
return !n && this[st].length === 0 && this[it]?.once("drain", () => this.emit("drain")), i?.(), n;
|
|
9014
9059
|
}
|
|
9015
|
-
[
|
|
9016
|
-
t && !this[
|
|
9060
|
+
[Vi](t) {
|
|
9061
|
+
t && !this[$] && (this[p] = this[p] ? Buffer.concat([this[p], t]) : t);
|
|
9017
9062
|
}
|
|
9018
|
-
[
|
|
9019
|
-
if (this[
|
|
9020
|
-
this[
|
|
9021
|
-
let t = this[
|
|
9022
|
-
if (t
|
|
9063
|
+
[Qe]() {
|
|
9064
|
+
if (this[mt] && !this[Yi] && !this[$] && !this[ae]) {
|
|
9065
|
+
this[Yi] = true;
|
|
9066
|
+
let t = this[Nt];
|
|
9067
|
+
if (t?.blockRemain) {
|
|
9023
9068
|
let e = this[p] ? this[p].length : 0;
|
|
9024
9069
|
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`, { entry: t }), this[p] && t.write(this[p]), t.end();
|
|
9025
9070
|
}
|
|
9026
|
-
this[At](
|
|
9071
|
+
this[At](Je);
|
|
9027
9072
|
}
|
|
9028
9073
|
}
|
|
9029
|
-
[
|
|
9030
|
-
if (this[ae] && t) this[
|
|
9031
|
-
else if (!t && !this[p]) this[
|
|
9074
|
+
[Xe](t) {
|
|
9075
|
+
if (this[ae] && t) this[Vi](t);
|
|
9076
|
+
else if (!t && !this[p]) this[Qe]();
|
|
9032
9077
|
else if (t) {
|
|
9033
9078
|
if (this[ae] = true, this[p]) {
|
|
9034
|
-
this[
|
|
9079
|
+
this[Vi](t);
|
|
9035
9080
|
let e = this[p];
|
|
9036
|
-
this[p] = void 0, this[
|
|
9037
|
-
} else this[
|
|
9038
|
-
for (; this[p] && this[p]?.length >= 512 && !this[
|
|
9081
|
+
this[p] = void 0, this[qe](e);
|
|
9082
|
+
} else this[qe](t);
|
|
9083
|
+
for (; this[p] && this[p]?.length >= 512 && !this[$] && !this[ti]; ) {
|
|
9039
9084
|
let e = this[p];
|
|
9040
|
-
this[p] = void 0, this[
|
|
9085
|
+
this[p] = void 0, this[qe](e);
|
|
9041
9086
|
}
|
|
9042
9087
|
this[ae] = false;
|
|
9043
9088
|
}
|
|
9044
|
-
(!this[p] || this[
|
|
9089
|
+
(!this[p] || this[mt]) && this[Qe]();
|
|
9045
9090
|
}
|
|
9046
|
-
[
|
|
9091
|
+
[qe](t) {
|
|
9047
9092
|
let e = 0, i = t.length;
|
|
9048
|
-
for (; e + 512 <= i && !this[
|
|
9093
|
+
for (; e + 512 <= i && !this[$] && !this[ti]; ) switch (this[B]) {
|
|
9049
9094
|
case "begin":
|
|
9050
9095
|
case "header":
|
|
9051
|
-
this[
|
|
9096
|
+
this[Vs](t, e), e += 512;
|
|
9052
9097
|
break;
|
|
9053
9098
|
case "ignore":
|
|
9054
9099
|
case "body":
|
|
9055
|
-
e += this[
|
|
9100
|
+
e += this[Ki](t, e);
|
|
9056
9101
|
break;
|
|
9057
9102
|
case "meta":
|
|
9058
|
-
e += this[
|
|
9103
|
+
e += this[Ks](t, e);
|
|
9059
9104
|
break;
|
|
9060
9105
|
default:
|
|
9061
9106
|
throw new Error("invalid state: " + this[B]);
|
|
@@ -9063,46 +9108,46 @@ var st = class extends On {
|
|
|
9063
9108
|
e < i && (this[p] = this[p] ? Buffer.concat([t.subarray(e), this[p]]) : t.subarray(e));
|
|
9064
9109
|
}
|
|
9065
9110
|
end(t, e, i) {
|
|
9066
|
-
return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e)), i && this.once("finish", i), this[
|
|
9111
|
+
return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e)), i && this.once("finish", i), this[$] || (this[y] ? (t && (this[le] += t.length, this[y].write(t)), this[y].end()) : (this[mt] = true, (this.brotli === void 0 || this.zstd === void 0) && (t = t || Buffer.alloc(0)), t && this.write(t), this[Qe]())), this;
|
|
9067
9112
|
}
|
|
9068
9113
|
};
|
|
9069
|
-
var
|
|
9114
|
+
var ut = (s3) => {
|
|
9070
9115
|
let t = s3.length - 1, e = -1;
|
|
9071
9116
|
for (; t > -1 && s3.charAt(t) === "/"; ) e = t, t--;
|
|
9072
9117
|
return e === -1 ? s3 : s3.slice(0, e);
|
|
9073
9118
|
};
|
|
9074
|
-
var
|
|
9119
|
+
var vn = (s3) => {
|
|
9075
9120
|
let t = s3.onReadEntry;
|
|
9076
9121
|
s3.onReadEntry = t ? (e) => {
|
|
9077
9122
|
t(e), e.resume();
|
|
9078
9123
|
} : (e) => e.resume();
|
|
9079
9124
|
};
|
|
9080
|
-
var
|
|
9081
|
-
let e = new Map(t.map((n) => [
|
|
9082
|
-
let
|
|
9083
|
-
if (n ===
|
|
9125
|
+
var Qi = (s3, t) => {
|
|
9126
|
+
let e = new Map(t.map((n) => [ut(n), true])), i = s3.filter, r = (n, o = "") => {
|
|
9127
|
+
let h = o || kn(n).root || ".", a;
|
|
9128
|
+
if (n === h) a = false;
|
|
9084
9129
|
else {
|
|
9085
9130
|
let l = e.get(n);
|
|
9086
|
-
|
|
9131
|
+
a = l !== void 0 ? l : r(Fn(n), h);
|
|
9087
9132
|
}
|
|
9088
|
-
return e.set(n,
|
|
9133
|
+
return e.set(n, a), a;
|
|
9089
9134
|
};
|
|
9090
|
-
s3.filter = i ? (n, o) => i(n, o) && r(
|
|
9135
|
+
s3.filter = i ? (n, o) => i(n, o) && r(ut(n)) : (n) => r(ut(n));
|
|
9091
9136
|
};
|
|
9092
|
-
var
|
|
9093
|
-
let t = new
|
|
9137
|
+
var Mn = (s3) => {
|
|
9138
|
+
let t = new rt(s3), e = s3.file, i;
|
|
9094
9139
|
try {
|
|
9095
9140
|
i = Kt.openSync(e, "r");
|
|
9096
9141
|
let r = Kt.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
|
|
9097
9142
|
if (r.size < n) {
|
|
9098
|
-
let o = Buffer.allocUnsafe(r.size),
|
|
9099
|
-
t.end(
|
|
9143
|
+
let o = Buffer.allocUnsafe(r.size), h = Kt.readSync(i, o, 0, r.size, 0);
|
|
9144
|
+
t.end(h === o.byteLength ? o : o.subarray(0, h));
|
|
9100
9145
|
} else {
|
|
9101
|
-
let o = 0,
|
|
9146
|
+
let o = 0, h = Buffer.allocUnsafe(n);
|
|
9102
9147
|
for (; o < r.size; ) {
|
|
9103
|
-
let
|
|
9104
|
-
if (
|
|
9105
|
-
o +=
|
|
9148
|
+
let a = Kt.readSync(i, h, 0, n, o);
|
|
9149
|
+
if (a === 0) break;
|
|
9150
|
+
o += a, t.write(h.subarray(0, a));
|
|
9106
9151
|
}
|
|
9107
9152
|
t.end();
|
|
9108
9153
|
}
|
|
@@ -9113,58 +9158,58 @@ var In = (s3) => {
|
|
|
9113
9158
|
}
|
|
9114
9159
|
}
|
|
9115
9160
|
};
|
|
9116
|
-
var
|
|
9117
|
-
let e = new
|
|
9118
|
-
return new Promise((o,
|
|
9119
|
-
e.on("error",
|
|
9120
|
-
if (
|
|
9161
|
+
var Bn = (s3, t) => {
|
|
9162
|
+
let e = new rt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
|
|
9163
|
+
return new Promise((o, h) => {
|
|
9164
|
+
e.on("error", h), e.on("end", o), Kt.stat(r, (a, l) => {
|
|
9165
|
+
if (a) h(a);
|
|
9121
9166
|
else {
|
|
9122
9167
|
let c = new _t(r, { readSize: i, size: l.size });
|
|
9123
|
-
c.on("error",
|
|
9168
|
+
c.on("error", h), c.pipe(e);
|
|
9124
9169
|
}
|
|
9125
9170
|
});
|
|
9126
9171
|
});
|
|
9127
9172
|
};
|
|
9128
|
-
var
|
|
9129
|
-
t?.length &&
|
|
9173
|
+
var Ct = K(Mn, Bn, (s3) => new rt(s3), (s3) => new rt(s3), (s3, t) => {
|
|
9174
|
+
t?.length && Qi(s3, t), s3.noResume || vn(s3);
|
|
9130
9175
|
});
|
|
9131
|
-
var
|
|
9132
|
-
var { isAbsolute:
|
|
9133
|
-
var
|
|
9134
|
-
let t = "", e =
|
|
9135
|
-
for (;
|
|
9176
|
+
var Ji = (s3, t, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
|
|
9177
|
+
var { isAbsolute: zn, parse: qs } = Pn;
|
|
9178
|
+
var ce = (s3) => {
|
|
9179
|
+
let t = "", e = qs(s3);
|
|
9180
|
+
for (; zn(s3) || e.root; ) {
|
|
9136
9181
|
let i = s3.charAt(0) === "/" && s3.slice(0, 4) !== "//?/" ? "/" : e.root;
|
|
9137
|
-
s3 = s3.slice(i.length), t += i, e =
|
|
9182
|
+
s3 = s3.slice(i.length), t += i, e = qs(s3);
|
|
9138
9183
|
}
|
|
9139
9184
|
return [t, s3];
|
|
9140
9185
|
};
|
|
9141
|
-
var
|
|
9142
|
-
var
|
|
9143
|
-
var
|
|
9144
|
-
var
|
|
9145
|
-
var
|
|
9146
|
-
var
|
|
9147
|
-
var
|
|
9148
|
-
var
|
|
9149
|
-
var
|
|
9150
|
-
var
|
|
9151
|
-
var
|
|
9152
|
-
var
|
|
9153
|
-
var
|
|
9154
|
-
var
|
|
9155
|
-
var
|
|
9156
|
-
var
|
|
9157
|
-
var
|
|
9158
|
-
var
|
|
9159
|
-
var
|
|
9160
|
-
var
|
|
9161
|
-
var
|
|
9186
|
+
var ei = ["|", "<", ">", "?", ":"];
|
|
9187
|
+
var ji = ei.map((s3) => String.fromCodePoint(61440 + Number(s3.codePointAt(0))));
|
|
9188
|
+
var Un = new Map(ei.map((s3, t) => [s3, ji[t]]));
|
|
9189
|
+
var Hn = new Map(ji.map((s3, t) => [s3, ei[t]]));
|
|
9190
|
+
var ts = (s3) => ei.reduce((t, e) => t.split(e).join(Un.get(e)), s3);
|
|
9191
|
+
var Qs = (s3) => ji.reduce((t, e) => t.split(e).join(Hn.get(e)), s3);
|
|
9192
|
+
var rr = (s3, t) => t ? (s3 = f(s3).replace(/^\.(\/|$)/, ""), ut(t) + "/" + s3) : f(s3);
|
|
9193
|
+
var Wn = 16 * 1024 * 1024;
|
|
9194
|
+
var tr = /* @__PURE__ */ Symbol("process");
|
|
9195
|
+
var er = /* @__PURE__ */ Symbol("file");
|
|
9196
|
+
var ir = /* @__PURE__ */ Symbol("directory");
|
|
9197
|
+
var is = /* @__PURE__ */ Symbol("symlink");
|
|
9198
|
+
var sr = /* @__PURE__ */ Symbol("hardlink");
|
|
9199
|
+
var fe = /* @__PURE__ */ Symbol("header");
|
|
9200
|
+
var ii = /* @__PURE__ */ Symbol("read");
|
|
9201
|
+
var ss = /* @__PURE__ */ Symbol("lstat");
|
|
9202
|
+
var si = /* @__PURE__ */ Symbol("onlstat");
|
|
9203
|
+
var rs = /* @__PURE__ */ Symbol("onread");
|
|
9204
|
+
var ns = /* @__PURE__ */ Symbol("onreadlink");
|
|
9205
|
+
var os = /* @__PURE__ */ Symbol("openfile");
|
|
9206
|
+
var hs = /* @__PURE__ */ Symbol("onopenfile");
|
|
9162
9207
|
var pt = /* @__PURE__ */ Symbol("close");
|
|
9163
|
-
var
|
|
9164
|
-
var
|
|
9165
|
-
var
|
|
9166
|
-
var
|
|
9167
|
-
var
|
|
9208
|
+
var ri = /* @__PURE__ */ Symbol("mode");
|
|
9209
|
+
var as = /* @__PURE__ */ Symbol("awaitDrain");
|
|
9210
|
+
var es = /* @__PURE__ */ Symbol("ondrain");
|
|
9211
|
+
var q = /* @__PURE__ */ Symbol("prefix");
|
|
9212
|
+
var de = class extends A {
|
|
9168
9213
|
path;
|
|
9169
9214
|
portable;
|
|
9170
9215
|
myuid = process.getuid && process.getuid() || 0;
|
|
@@ -9197,109 +9242,109 @@ var fe = class extends A {
|
|
|
9197
9242
|
#t = false;
|
|
9198
9243
|
constructor(t, e = {}) {
|
|
9199
9244
|
let i = se(e);
|
|
9200
|
-
super(), this.path = f(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize ||
|
|
9245
|
+
super(), this.path = f(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize || Wn, this.linkCache = i.linkCache || /* @__PURE__ */ new Map(), this.statCache = i.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i.preservePaths, this.cwd = f(i.cwd || process.cwd()), this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.mtime = i.mtime, this.prefix = i.prefix ? f(i.prefix) : void 0, this.onWriteEntry = i.onWriteEntry, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
|
|
9201
9246
|
let r = false;
|
|
9202
9247
|
if (!this.preservePaths) {
|
|
9203
|
-
let [o,
|
|
9204
|
-
o && typeof
|
|
9248
|
+
let [o, h] = ce(this.path);
|
|
9249
|
+
o && typeof h == "string" && (this.path = h, r = o);
|
|
9205
9250
|
}
|
|
9206
|
-
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path =
|
|
9251
|
+
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Qs(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || js.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
|
|
9207
9252
|
let n = this.statCache.get(this.absolute);
|
|
9208
|
-
n ? this[
|
|
9253
|
+
n ? this[si](n) : this[ss]();
|
|
9209
9254
|
}
|
|
9210
9255
|
warn(t, e, i = {}) {
|
|
9211
|
-
return
|
|
9256
|
+
return Dt(this, t, e, i);
|
|
9212
9257
|
}
|
|
9213
9258
|
emit(t, ...e) {
|
|
9214
9259
|
return t === "error" && (this.#t = true), super.emit(t, ...e);
|
|
9215
9260
|
}
|
|
9216
|
-
[
|
|
9217
|
-
|
|
9261
|
+
[ss]() {
|
|
9262
|
+
X.lstat(this.absolute, (t, e) => {
|
|
9218
9263
|
if (t) return this.emit("error", t);
|
|
9219
|
-
this[
|
|
9264
|
+
this[si](e);
|
|
9220
9265
|
});
|
|
9221
9266
|
}
|
|
9222
|
-
[
|
|
9223
|
-
this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type =
|
|
9267
|
+
[si](t) {
|
|
9268
|
+
this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type = Gn(t), this.emit("stat", t), this[tr]();
|
|
9224
9269
|
}
|
|
9225
|
-
[
|
|
9270
|
+
[tr]() {
|
|
9226
9271
|
switch (this.type) {
|
|
9227
9272
|
case "File":
|
|
9228
|
-
return this[
|
|
9273
|
+
return this[er]();
|
|
9229
9274
|
case "Directory":
|
|
9230
|
-
return this[
|
|
9275
|
+
return this[ir]();
|
|
9231
9276
|
case "SymbolicLink":
|
|
9232
|
-
return this[
|
|
9277
|
+
return this[is]();
|
|
9233
9278
|
default:
|
|
9234
9279
|
return this.end();
|
|
9235
9280
|
}
|
|
9236
9281
|
}
|
|
9237
|
-
[
|
|
9238
|
-
return
|
|
9282
|
+
[ri](t) {
|
|
9283
|
+
return Ji(t, this.type === "Directory", this.portable);
|
|
9239
9284
|
}
|
|
9240
|
-
[
|
|
9241
|
-
return
|
|
9285
|
+
[q](t) {
|
|
9286
|
+
return rr(t, this.prefix);
|
|
9242
9287
|
}
|
|
9243
|
-
[
|
|
9288
|
+
[fe]() {
|
|
9244
9289
|
if (!this.stat) throw new Error("cannot write header before stat");
|
|
9245
|
-
this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new
|
|
9290
|
+
this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F({ path: this[q](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q](this.linkpath) : this.linkpath, mode: this[ri](this.stat.mode), uid: this.portable ? void 0 : this.stat.uid, gid: this.portable ? void 0 : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, type: this.type === "Unsupported" ? void 0 : this.type, uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", atime: this.portable ? void 0 : this.stat.atime, ctime: this.portable ? void 0 : this.stat.ctime }), this.header.encode() && !this.noPax && super.write(new ft({ atime: this.portable ? void 0 : this.header.atime, ctime: this.portable ? void 0 : this.header.ctime, gid: this.portable ? void 0 : this.header.gid, mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, path: this[q](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? void 0 : this.header.uid, uname: this.portable ? void 0 : this.header.uname, dev: this.portable ? void 0 : this.stat.dev, ino: this.portable ? void 0 : this.stat.ino, nlink: this.portable ? void 0 : this.stat.nlink }).encode());
|
|
9246
9291
|
let t = this.header?.block;
|
|
9247
9292
|
if (!t) throw new Error("failed to encode header");
|
|
9248
9293
|
super.write(t);
|
|
9249
9294
|
}
|
|
9250
|
-
[
|
|
9295
|
+
[ir]() {
|
|
9251
9296
|
if (!this.stat) throw new Error("cannot create directory entry without stat");
|
|
9252
|
-
this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[
|
|
9297
|
+
this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[fe](), this.end();
|
|
9253
9298
|
}
|
|
9254
|
-
[
|
|
9255
|
-
|
|
9299
|
+
[is]() {
|
|
9300
|
+
X.readlink(this.absolute, (t, e) => {
|
|
9256
9301
|
if (t) return this.emit("error", t);
|
|
9257
|
-
this[
|
|
9302
|
+
this[ns](e);
|
|
9258
9303
|
});
|
|
9259
9304
|
}
|
|
9260
|
-
[
|
|
9261
|
-
this.linkpath = f(t), this[
|
|
9305
|
+
[ns](t) {
|
|
9306
|
+
this.linkpath = f(t), this[fe](), this.end();
|
|
9262
9307
|
}
|
|
9263
|
-
[
|
|
9308
|
+
[sr](t) {
|
|
9264
9309
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
9265
|
-
this.type = "Link", this.linkpath = f(
|
|
9310
|
+
this.type = "Link", this.linkpath = f(js.relative(this.cwd, t)), this.stat.size = 0, this[fe](), this.end();
|
|
9266
9311
|
}
|
|
9267
|
-
[
|
|
9312
|
+
[er]() {
|
|
9268
9313
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
9269
9314
|
if (this.stat.nlink > 1) {
|
|
9270
9315
|
let t = `${this.stat.dev}:${this.stat.ino}`, e = this.linkCache.get(t);
|
|
9271
|
-
if (e?.indexOf(this.cwd) === 0) return this[
|
|
9316
|
+
if (e?.indexOf(this.cwd) === 0) return this[sr](e);
|
|
9272
9317
|
this.linkCache.set(t, this.absolute);
|
|
9273
9318
|
}
|
|
9274
|
-
if (this[
|
|
9275
|
-
this[
|
|
9319
|
+
if (this[fe](), this.stat.size === 0) return this.end();
|
|
9320
|
+
this[os]();
|
|
9276
9321
|
}
|
|
9277
|
-
[
|
|
9278
|
-
|
|
9322
|
+
[os]() {
|
|
9323
|
+
X.open(this.absolute, "r", (t, e) => {
|
|
9279
9324
|
if (t) return this.emit("error", t);
|
|
9280
|
-
this[
|
|
9325
|
+
this[hs](e);
|
|
9281
9326
|
});
|
|
9282
9327
|
}
|
|
9283
|
-
[
|
|
9328
|
+
[hs](t) {
|
|
9284
9329
|
if (this.fd = t, this.#t) return this[pt]();
|
|
9285
9330
|
if (!this.stat) throw new Error("should stat before calling onopenfile");
|
|
9286
9331
|
this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
|
|
9287
9332
|
let e = Math.min(this.blockLen, this.maxReadSize);
|
|
9288
|
-
this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[
|
|
9333
|
+
this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[ii]();
|
|
9289
9334
|
}
|
|
9290
|
-
[
|
|
9335
|
+
[ii]() {
|
|
9291
9336
|
let { fd: t, buf: e, offset: i, length: r, pos: n } = this;
|
|
9292
9337
|
if (t === void 0 || e === void 0) throw new Error("cannot read file without first opening");
|
|
9293
|
-
|
|
9338
|
+
X.read(t, e, i, r, n, (o, h) => {
|
|
9294
9339
|
if (o) return this[pt](() => this.emit("error", o));
|
|
9295
|
-
this[
|
|
9340
|
+
this[rs](h);
|
|
9296
9341
|
});
|
|
9297
9342
|
}
|
|
9298
9343
|
[pt](t = () => {
|
|
9299
9344
|
}) {
|
|
9300
|
-
this.fd !== void 0 &&
|
|
9345
|
+
this.fd !== void 0 && X.close(this.fd, t);
|
|
9301
9346
|
}
|
|
9302
|
-
[
|
|
9347
|
+
[rs](t) {
|
|
9303
9348
|
if (t <= 0 && this.remain > 0) {
|
|
9304
9349
|
let r = Object.assign(new Error("encountered unexpected EOF"), { path: this.absolute, syscall: "read", code: "EOF" });
|
|
9305
9350
|
return this[pt](() => this.emit("error", r));
|
|
@@ -9311,9 +9356,9 @@ var fe = class extends A {
|
|
|
9311
9356
|
if (!this.buf) throw new Error("should have created buffer prior to reading");
|
|
9312
9357
|
if (t === this.remain) for (let r = t; r < this.length && t < this.blockRemain; r++) this.buf[r + this.offset] = 0, t++, this.remain++;
|
|
9313
9358
|
let e = this.offset === 0 && t === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + t);
|
|
9314
|
-
this.write(e) ? this[
|
|
9359
|
+
this.write(e) ? this[es]() : this[as](() => this[es]());
|
|
9315
9360
|
}
|
|
9316
|
-
[
|
|
9361
|
+
[as](t) {
|
|
9317
9362
|
this.once("drain", t);
|
|
9318
9363
|
}
|
|
9319
9364
|
write(t, e, i) {
|
|
@@ -9323,30 +9368,30 @@ var fe = class extends A {
|
|
|
9323
9368
|
}
|
|
9324
9369
|
return this.remain -= t.length, this.blockRemain -= t.length, this.pos += t.length, this.offset += t.length, super.write(t, null, i);
|
|
9325
9370
|
}
|
|
9326
|
-
[
|
|
9371
|
+
[es]() {
|
|
9327
9372
|
if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[pt]((t) => t ? this.emit("error", t) : this.end());
|
|
9328
9373
|
if (!this.buf) throw new Error("buffer lost somehow in ONDRAIN");
|
|
9329
|
-
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[
|
|
9374
|
+
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[ii]();
|
|
9330
9375
|
}
|
|
9331
9376
|
};
|
|
9332
|
-
var
|
|
9377
|
+
var ni = class extends de {
|
|
9333
9378
|
sync = true;
|
|
9334
|
-
[
|
|
9335
|
-
this[
|
|
9379
|
+
[ss]() {
|
|
9380
|
+
this[si](X.lstatSync(this.absolute));
|
|
9336
9381
|
}
|
|
9337
|
-
[
|
|
9338
|
-
this[
|
|
9382
|
+
[is]() {
|
|
9383
|
+
this[ns](X.readlinkSync(this.absolute));
|
|
9339
9384
|
}
|
|
9340
|
-
[
|
|
9341
|
-
this[
|
|
9385
|
+
[os]() {
|
|
9386
|
+
this[hs](X.openSync(this.absolute, "r"));
|
|
9342
9387
|
}
|
|
9343
|
-
[
|
|
9388
|
+
[ii]() {
|
|
9344
9389
|
let t = true;
|
|
9345
9390
|
try {
|
|
9346
9391
|
let { fd: e, buf: i, offset: r, length: n, pos: o } = this;
|
|
9347
9392
|
if (e === void 0 || i === void 0) throw new Error("fd and buf must be set in READ method");
|
|
9348
|
-
let
|
|
9349
|
-
this[
|
|
9393
|
+
let h = X.readSync(e, i, r, n, o);
|
|
9394
|
+
this[rs](h), t = false;
|
|
9350
9395
|
} finally {
|
|
9351
9396
|
if (t) try {
|
|
9352
9397
|
this[pt](() => {
|
|
@@ -9355,15 +9400,15 @@ var ri = class extends fe {
|
|
|
9355
9400
|
}
|
|
9356
9401
|
}
|
|
9357
9402
|
}
|
|
9358
|
-
[
|
|
9403
|
+
[as](t) {
|
|
9359
9404
|
t();
|
|
9360
9405
|
}
|
|
9361
9406
|
[pt](t = () => {
|
|
9362
9407
|
}) {
|
|
9363
|
-
this.fd !== void 0 &&
|
|
9408
|
+
this.fd !== void 0 && X.closeSync(this.fd), t();
|
|
9364
9409
|
}
|
|
9365
9410
|
};
|
|
9366
|
-
var
|
|
9411
|
+
var oi = class extends A {
|
|
9367
9412
|
blockLen = 0;
|
|
9368
9413
|
blockRemain = 0;
|
|
9369
9414
|
buf = 0;
|
|
@@ -9392,29 +9437,29 @@ var ni = class extends A {
|
|
|
9392
9437
|
size;
|
|
9393
9438
|
onWriteEntry;
|
|
9394
9439
|
warn(t, e, i = {}) {
|
|
9395
|
-
return
|
|
9440
|
+
return Dt(this, t, e, i);
|
|
9396
9441
|
}
|
|
9397
9442
|
constructor(t, e = {}) {
|
|
9398
9443
|
let i = se(e);
|
|
9399
9444
|
super(), this.preservePaths = !!i.preservePaths, this.portable = !!i.portable, this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.onWriteEntry = i.onWriteEntry, this.readEntry = t;
|
|
9400
9445
|
let { type: r } = t;
|
|
9401
9446
|
if (r === "Unsupported") throw new Error("writing entry that should be ignored");
|
|
9402
|
-
this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f(t.path), this.mode = t.mode !== void 0 ? this[
|
|
9447
|
+
this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f(t.path), this.mode = t.mode !== void 0 ? this[ri](t.mode) : void 0, this.uid = this.portable ? void 0 : t.uid, this.gid = this.portable ? void 0 : t.gid, this.uname = this.portable ? void 0 : t.uname, this.gname = this.portable ? void 0 : t.gname, this.size = t.size, this.mtime = this.noMtime ? void 0 : i.mtime || t.mtime, this.atime = this.portable ? void 0 : t.atime, this.ctime = this.portable ? void 0 : t.ctime, this.linkpath = t.linkpath !== void 0 ? f(t.linkpath) : void 0, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
|
|
9403
9448
|
let n = false;
|
|
9404
9449
|
if (!this.preservePaths) {
|
|
9405
|
-
let [
|
|
9406
|
-
|
|
9450
|
+
let [h, a] = ce(this.path);
|
|
9451
|
+
h && typeof a == "string" && (this.path = a, n = h);
|
|
9407
9452
|
}
|
|
9408
|
-
this.remain = t.size, this.blockRemain = t.startBlockSize, this.onWriteEntry?.(this), this.header = new
|
|
9453
|
+
this.remain = t.size, this.blockRemain = t.startBlockSize, this.onWriteEntry?.(this), this.header = new F({ path: this[q](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q](this.linkpath) : this.linkpath, mode: this.mode, uid: this.portable ? void 0 : this.uid, gid: this.portable ? void 0 : this.gid, size: this.size, mtime: this.noMtime ? void 0 : this.mtime, type: this.type, uname: this.portable ? void 0 : this.uname, atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime }), n && this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute path`, { entry: this, path: n + this.path }), this.header.encode() && !this.noPax && super.write(new ft({ atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime, gid: this.portable ? void 0 : this.gid, mtime: this.noMtime ? void 0 : this.mtime, path: this[q](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? void 0 : this.uid, uname: this.portable ? void 0 : this.uname, dev: this.portable ? void 0 : this.readEntry.dev, ino: this.portable ? void 0 : this.readEntry.ino, nlink: this.portable ? void 0 : this.readEntry.nlink }).encode());
|
|
9409
9454
|
let o = this.header?.block;
|
|
9410
9455
|
if (!o) throw new Error("failed to encode header");
|
|
9411
9456
|
super.write(o), t.pipe(this);
|
|
9412
9457
|
}
|
|
9413
|
-
[
|
|
9414
|
-
return
|
|
9458
|
+
[q](t) {
|
|
9459
|
+
return rr(t, this.prefix);
|
|
9415
9460
|
}
|
|
9416
|
-
[
|
|
9417
|
-
return
|
|
9461
|
+
[ri](t) {
|
|
9462
|
+
return Ji(t, this.type === "Directory", this.portable);
|
|
9418
9463
|
}
|
|
9419
9464
|
write(t, e, i) {
|
|
9420
9465
|
typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e == "string" ? e : "utf8"));
|
|
@@ -9426,8 +9471,8 @@ var ni = class extends A {
|
|
|
9426
9471
|
return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e ?? "utf8")), i && this.once("finish", i), t ? super.end(t, i) : super.end(i), this;
|
|
9427
9472
|
}
|
|
9428
9473
|
};
|
|
9429
|
-
var
|
|
9430
|
-
var
|
|
9474
|
+
var Gn = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
|
|
9475
|
+
var hi = class s2 {
|
|
9431
9476
|
tail;
|
|
9432
9477
|
head;
|
|
9433
9478
|
length = 0;
|
|
@@ -9458,11 +9503,11 @@ var oi = class s2 {
|
|
|
9458
9503
|
t.list = this, t.prev = e, e && (e.next = t), this.tail = t, this.head || (this.head = t), this.length++;
|
|
9459
9504
|
}
|
|
9460
9505
|
push(...t) {
|
|
9461
|
-
for (let e = 0, i = t.length; e < i; e++)
|
|
9506
|
+
for (let e = 0, i = t.length; e < i; e++) Yn(this, t[e]);
|
|
9462
9507
|
return this.length;
|
|
9463
9508
|
}
|
|
9464
9509
|
unshift(...t) {
|
|
9465
|
-
for (var e = 0, i = t.length; e < i; e++)
|
|
9510
|
+
for (var e = 0, i = t.length; e < i; e++) Kn(this, t[e]);
|
|
9466
9511
|
return this.length;
|
|
9467
9512
|
}
|
|
9468
9513
|
pop() {
|
|
@@ -9558,7 +9603,7 @@ var oi = class s2 {
|
|
|
9558
9603
|
let n = [];
|
|
9559
9604
|
for (let o = 0; r && o < e; o++) n.push(r.value), r = this.removeNode(r);
|
|
9560
9605
|
r ? r !== this.tail && (r = r.prev) : r = this.tail;
|
|
9561
|
-
for (let o of i) r =
|
|
9606
|
+
for (let o of i) r = Zn(this, r, o);
|
|
9562
9607
|
return n;
|
|
9563
9608
|
}
|
|
9564
9609
|
reverse() {
|
|
@@ -9570,17 +9615,17 @@ var oi = class s2 {
|
|
|
9570
9615
|
return this.head = e, this.tail = t, this;
|
|
9571
9616
|
}
|
|
9572
9617
|
};
|
|
9573
|
-
function
|
|
9574
|
-
let i = t, r = t ? t.next : s3.head, n = new
|
|
9618
|
+
function Zn(s3, t, e) {
|
|
9619
|
+
let i = t, r = t ? t.next : s3.head, n = new me(e, i, r, s3);
|
|
9575
9620
|
return n.next === void 0 && (s3.tail = n), n.prev === void 0 && (s3.head = n), s3.length++, n;
|
|
9576
9621
|
}
|
|
9577
|
-
function
|
|
9578
|
-
s3.tail = new
|
|
9622
|
+
function Yn(s3, t) {
|
|
9623
|
+
s3.tail = new me(t, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
|
|
9579
9624
|
}
|
|
9580
|
-
function
|
|
9581
|
-
s3.head = new
|
|
9625
|
+
function Kn(s3, t) {
|
|
9626
|
+
s3.head = new me(t, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
|
|
9582
9627
|
}
|
|
9583
|
-
var
|
|
9628
|
+
var me = class {
|
|
9584
9629
|
list;
|
|
9585
9630
|
next;
|
|
9586
9631
|
prev;
|
|
@@ -9589,7 +9634,7 @@ var de = class {
|
|
|
9589
9634
|
this.list = r, this.value = t, e ? (e.next = this, this.prev = e) : this.prev = void 0, i ? (i.prev = this, this.next = i) : this.next = void 0;
|
|
9590
9635
|
}
|
|
9591
9636
|
};
|
|
9592
|
-
var
|
|
9637
|
+
var pi = class {
|
|
9593
9638
|
path;
|
|
9594
9639
|
absolute;
|
|
9595
9640
|
entry;
|
|
@@ -9603,28 +9648,28 @@ var mi = class {
|
|
|
9603
9648
|
this.path = t || "./", this.absolute = e;
|
|
9604
9649
|
}
|
|
9605
9650
|
};
|
|
9606
|
-
var
|
|
9607
|
-
var
|
|
9651
|
+
var nr = Buffer.alloc(1024);
|
|
9652
|
+
var li = /* @__PURE__ */ Symbol("onStat");
|
|
9608
9653
|
var ue = /* @__PURE__ */ Symbol("ended");
|
|
9609
9654
|
var W = /* @__PURE__ */ Symbol("queue");
|
|
9610
|
-
var
|
|
9655
|
+
var pe = /* @__PURE__ */ Symbol("pendingLinks");
|
|
9611
9656
|
var Et = /* @__PURE__ */ Symbol("current");
|
|
9612
|
-
var
|
|
9613
|
-
var
|
|
9614
|
-
var
|
|
9657
|
+
var Ft = /* @__PURE__ */ Symbol("process");
|
|
9658
|
+
var Ee = /* @__PURE__ */ Symbol("processing");
|
|
9659
|
+
var ai = /* @__PURE__ */ Symbol("processJob");
|
|
9615
9660
|
var G = /* @__PURE__ */ Symbol("jobs");
|
|
9616
|
-
var
|
|
9617
|
-
var
|
|
9618
|
-
var
|
|
9619
|
-
var
|
|
9620
|
-
var
|
|
9621
|
-
var
|
|
9622
|
-
var
|
|
9623
|
-
var
|
|
9624
|
-
var
|
|
9625
|
-
var
|
|
9626
|
-
var
|
|
9627
|
-
var
|
|
9661
|
+
var ls = /* @__PURE__ */ Symbol("jobDone");
|
|
9662
|
+
var ci = /* @__PURE__ */ Symbol("addFSEntry");
|
|
9663
|
+
var or = /* @__PURE__ */ Symbol("addTarEntry");
|
|
9664
|
+
var ds = /* @__PURE__ */ Symbol("stat");
|
|
9665
|
+
var ms = /* @__PURE__ */ Symbol("readdir");
|
|
9666
|
+
var fi = /* @__PURE__ */ Symbol("onreaddir");
|
|
9667
|
+
var di = /* @__PURE__ */ Symbol("pipe");
|
|
9668
|
+
var hr = /* @__PURE__ */ Symbol("entry");
|
|
9669
|
+
var cs = /* @__PURE__ */ Symbol("entryOpt");
|
|
9670
|
+
var mi = /* @__PURE__ */ Symbol("writeEntryClass");
|
|
9671
|
+
var lr = /* @__PURE__ */ Symbol("write");
|
|
9672
|
+
var fs2 = /* @__PURE__ */ Symbol("ondrain");
|
|
9628
9673
|
var wt = class extends A {
|
|
9629
9674
|
sync = false;
|
|
9630
9675
|
opt;
|
|
@@ -9646,139 +9691,139 @@ var wt = class extends A {
|
|
|
9646
9691
|
mtime;
|
|
9647
9692
|
filter;
|
|
9648
9693
|
jobs;
|
|
9649
|
-
[
|
|
9694
|
+
[mi];
|
|
9650
9695
|
onWriteEntry;
|
|
9651
9696
|
[W];
|
|
9652
|
-
[
|
|
9697
|
+
[pe] = /* @__PURE__ */ new Map();
|
|
9653
9698
|
[G] = 0;
|
|
9654
|
-
[
|
|
9699
|
+
[Ee] = false;
|
|
9655
9700
|
[ue] = false;
|
|
9656
9701
|
constructor(t = {}) {
|
|
9657
|
-
if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[
|
|
9702
|
+
if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[mi] = de, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
|
|
9658
9703
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
9659
|
-
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new
|
|
9704
|
+
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new ze(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new We(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ye(t.zstd)), !this.zip) throw new Error("impossible");
|
|
9660
9705
|
let e = this.zip;
|
|
9661
|
-
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[
|
|
9662
|
-
} else this.on("drain", this[
|
|
9663
|
-
this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => true, this[W] = new
|
|
9706
|
+
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs2]()), this.on("resume", () => e.resume());
|
|
9707
|
+
} else this.on("drain", this[fs2]);
|
|
9708
|
+
this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => true, this[W] = new hi(), this[G] = 0, this.jobs = Number(t.jobs) || 4, this[Ee] = false, this[ue] = false;
|
|
9664
9709
|
}
|
|
9665
|
-
[
|
|
9710
|
+
[lr](t) {
|
|
9666
9711
|
return super.write(t);
|
|
9667
9712
|
}
|
|
9668
9713
|
add(t) {
|
|
9669
9714
|
return this.write(t), this;
|
|
9670
9715
|
}
|
|
9671
9716
|
end(t, e, i) {
|
|
9672
|
-
return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = void 0), t && this.add(t), this[ue] = true, this[
|
|
9717
|
+
return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = void 0), t && this.add(t), this[ue] = true, this[Ft](), i && i(), this;
|
|
9673
9718
|
}
|
|
9674
9719
|
write(t) {
|
|
9675
9720
|
if (this[ue]) throw new Error("write after end");
|
|
9676
|
-
return typeof t == "string" ? this[
|
|
9721
|
+
return typeof t == "string" ? this[ci](t) : this[or](t), this.flowing;
|
|
9677
9722
|
}
|
|
9678
|
-
[
|
|
9679
|
-
let e = f(
|
|
9723
|
+
[or](t) {
|
|
9724
|
+
let e = f(ar.resolve(this.cwd, t.path));
|
|
9680
9725
|
if (!this.filter(t.path, t)) t.resume();
|
|
9681
9726
|
else {
|
|
9682
|
-
let i = new
|
|
9683
|
-
i.entry = new
|
|
9727
|
+
let i = new pi(t.path, e);
|
|
9728
|
+
i.entry = new oi(t, this[cs](i)), i.entry.on("end", () => this[ls](i)), this[G] += 1, this[W].push(i);
|
|
9684
9729
|
}
|
|
9685
|
-
this[
|
|
9730
|
+
this[Ft]();
|
|
9686
9731
|
}
|
|
9687
|
-
[
|
|
9688
|
-
let e = f(
|
|
9689
|
-
this[W].push(new
|
|
9732
|
+
[ci](t) {
|
|
9733
|
+
let e = f(ar.resolve(this.cwd, t));
|
|
9734
|
+
this[W].push(new pi(t, e)), this[Ft]();
|
|
9690
9735
|
}
|
|
9691
|
-
[
|
|
9736
|
+
[ds](t) {
|
|
9692
9737
|
t.pending = true, this[G] += 1;
|
|
9693
9738
|
let e = this.follow ? "stat" : "lstat";
|
|
9694
9739
|
ui[e](t.absolute, (i, r) => {
|
|
9695
|
-
t.pending = false, this[G] -= 1, i ? this.emit("error", i) : this[
|
|
9740
|
+
t.pending = false, this[G] -= 1, i ? this.emit("error", i) : this[li](t, r);
|
|
9696
9741
|
});
|
|
9697
9742
|
}
|
|
9698
|
-
[
|
|
9743
|
+
[li](t, e) {
|
|
9699
9744
|
if (this.statCache.set(t.absolute, e), t.stat = e, !this.filter(t.path, e)) t.ignore = true;
|
|
9700
|
-
else if (e.isFile() && e.nlink > 1 && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync) if (t === this[Et]) this[
|
|
9745
|
+
else if (e.isFile() && e.nlink > 1 && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync) if (t === this[Et]) this[ai](t);
|
|
9701
9746
|
else {
|
|
9702
|
-
let i = `${e.dev}:${e.ino}`, r = this[
|
|
9703
|
-
r ? r.push(t) : this[
|
|
9747
|
+
let i = `${e.dev}:${e.ino}`, r = this[pe].get(i);
|
|
9748
|
+
r ? r.push(t) : this[pe].set(i, [t]), t.pendingLink = true, t.pending = true;
|
|
9704
9749
|
}
|
|
9705
|
-
this[
|
|
9750
|
+
this[Ft]();
|
|
9706
9751
|
}
|
|
9707
|
-
[
|
|
9752
|
+
[ms](t) {
|
|
9708
9753
|
t.pending = true, this[G] += 1, ui.readdir(t.absolute, (e, i) => {
|
|
9709
9754
|
if (t.pending = false, this[G] -= 1, e) return this.emit("error", e);
|
|
9710
|
-
this[
|
|
9755
|
+
this[fi](t, i);
|
|
9711
9756
|
});
|
|
9712
9757
|
}
|
|
9713
|
-
[
|
|
9714
|
-
this.readdirCache.set(t.absolute, e), t.readdir = e, this[
|
|
9758
|
+
[fi](t, e) {
|
|
9759
|
+
this.readdirCache.set(t.absolute, e), t.readdir = e, this[Ft]();
|
|
9715
9760
|
}
|
|
9716
|
-
[
|
|
9717
|
-
if (!this[
|
|
9718
|
-
this[
|
|
9719
|
-
for (let t = this[W].head; t && this[G] < this.jobs; t = t.next) if (this[
|
|
9761
|
+
[Ft]() {
|
|
9762
|
+
if (!this[Ee]) {
|
|
9763
|
+
this[Ee] = true;
|
|
9764
|
+
for (let t = this[W].head; t && this[G] < this.jobs; t = t.next) if (this[ai](t.value), t.value.ignore) {
|
|
9720
9765
|
let e = t.next;
|
|
9721
9766
|
this[W].removeNode(t), t.next = e;
|
|
9722
9767
|
}
|
|
9723
|
-
this[
|
|
9768
|
+
this[Ee] = false, this[ue] && this[W].length === 0 && this[G] === 0 && (this.zip ? this.zip.end(nr) : (super.write(nr), super.end()));
|
|
9724
9769
|
}
|
|
9725
9770
|
}
|
|
9726
9771
|
get [Et]() {
|
|
9727
9772
|
return this[W] && this[W].head && this[W].head.value;
|
|
9728
9773
|
}
|
|
9729
|
-
[
|
|
9774
|
+
[ls](t) {
|
|
9730
9775
|
this[W].shift(), this[G] -= 1;
|
|
9731
9776
|
let { stat: e } = t;
|
|
9732
9777
|
if (e && e.isFile() && e.nlink > 1) {
|
|
9733
|
-
let i = `${e.dev}:${e.ino}`, r = this[
|
|
9778
|
+
let i = `${e.dev}:${e.ino}`, r = this[pe].get(i);
|
|
9734
9779
|
if (r) {
|
|
9735
|
-
this[
|
|
9736
|
-
for (let n of r) n.pending = false, this[
|
|
9780
|
+
this[pe].delete(i);
|
|
9781
|
+
for (let n of r) n.pending = false, this[ai](n);
|
|
9737
9782
|
}
|
|
9738
9783
|
}
|
|
9739
|
-
this[
|
|
9784
|
+
this[Ft]();
|
|
9740
9785
|
}
|
|
9741
|
-
[
|
|
9786
|
+
[ai](t) {
|
|
9742
9787
|
if (t.pending && t.pendingLink && t === this[Et] && (t.pending = false, t.pendingLink = false), !t.pending) {
|
|
9743
9788
|
if (t.entry) {
|
|
9744
|
-
t === this[Et] && !t.piped && this[
|
|
9789
|
+
t === this[Et] && !t.piped && this[di](t);
|
|
9745
9790
|
return;
|
|
9746
9791
|
}
|
|
9747
9792
|
if (!t.stat) {
|
|
9748
9793
|
let e = this.statCache.get(t.absolute);
|
|
9749
|
-
e ? this[
|
|
9794
|
+
e ? this[li](t, e) : this[ds](t);
|
|
9750
9795
|
}
|
|
9751
9796
|
if (t.stat && !t.ignore) {
|
|
9752
9797
|
if (!this.noDirRecurse && t.stat.isDirectory() && !t.readdir) {
|
|
9753
9798
|
let e = this.readdirCache.get(t.absolute);
|
|
9754
|
-
if (e ? this[
|
|
9799
|
+
if (e ? this[fi](t, e) : this[ms](t), !t.readdir) return;
|
|
9755
9800
|
}
|
|
9756
|
-
if (t.entry = this[
|
|
9801
|
+
if (t.entry = this[hr](t), !t.entry) {
|
|
9757
9802
|
t.ignore = true;
|
|
9758
9803
|
return;
|
|
9759
9804
|
}
|
|
9760
|
-
t === this[Et] && !t.piped && this[
|
|
9805
|
+
t === this[Et] && !t.piped && this[di](t);
|
|
9761
9806
|
}
|
|
9762
9807
|
}
|
|
9763
9808
|
}
|
|
9764
|
-
[
|
|
9809
|
+
[cs](t) {
|
|
9765
9810
|
return { onwarn: (e, i, r) => this.warn(e, i, r), noPax: this.noPax, cwd: this.cwd, absolute: t.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime, prefix: this.prefix, onWriteEntry: this.onWriteEntry };
|
|
9766
9811
|
}
|
|
9767
|
-
[
|
|
9812
|
+
[hr](t) {
|
|
9768
9813
|
this[G] += 1;
|
|
9769
9814
|
try {
|
|
9770
|
-
return new this[
|
|
9815
|
+
return new this[mi](t.path, this[cs](t)).on("end", () => this[ls](t)).on("error", (i) => this.emit("error", i));
|
|
9771
9816
|
} catch (e) {
|
|
9772
9817
|
this.emit("error", e);
|
|
9773
9818
|
}
|
|
9774
9819
|
}
|
|
9775
|
-
[
|
|
9820
|
+
[fs2]() {
|
|
9776
9821
|
this[Et] && this[Et].entry && this[Et].entry.resume();
|
|
9777
9822
|
}
|
|
9778
|
-
[
|
|
9823
|
+
[di](t) {
|
|
9779
9824
|
t.piped = true, t.readdir && t.readdir.forEach((r) => {
|
|
9780
9825
|
let n = t.path, o = n === "./" ? "" : n.replace(/\/*$/, "/");
|
|
9781
|
-
this[
|
|
9826
|
+
this[ci](o + r);
|
|
9782
9827
|
});
|
|
9783
9828
|
let e = t.entry, i = this.zip;
|
|
9784
9829
|
if (!e) throw new Error("cannot pipe without source");
|
|
@@ -9792,137 +9837,137 @@ var wt = class extends A {
|
|
|
9792
9837
|
return this.zip && this.zip.pause(), super.pause();
|
|
9793
9838
|
}
|
|
9794
9839
|
warn(t, e, i = {}) {
|
|
9795
|
-
|
|
9840
|
+
Dt(this, t, e, i);
|
|
9796
9841
|
}
|
|
9797
9842
|
};
|
|
9798
9843
|
var kt = class extends wt {
|
|
9799
9844
|
sync = true;
|
|
9800
9845
|
constructor(t) {
|
|
9801
|
-
super(t), this[
|
|
9846
|
+
super(t), this[mi] = ni;
|
|
9802
9847
|
}
|
|
9803
9848
|
pause() {
|
|
9804
9849
|
}
|
|
9805
9850
|
resume() {
|
|
9806
9851
|
}
|
|
9807
|
-
[
|
|
9852
|
+
[ds](t) {
|
|
9808
9853
|
let e = this.follow ? "statSync" : "lstatSync";
|
|
9809
|
-
this[
|
|
9854
|
+
this[li](t, ui[e](t.absolute));
|
|
9810
9855
|
}
|
|
9811
|
-
[
|
|
9812
|
-
this[
|
|
9856
|
+
[ms](t) {
|
|
9857
|
+
this[fi](t, ui.readdirSync(t.absolute));
|
|
9813
9858
|
}
|
|
9814
|
-
[
|
|
9859
|
+
[di](t) {
|
|
9815
9860
|
let e = t.entry, i = this.zip;
|
|
9816
9861
|
if (t.readdir && t.readdir.forEach((r) => {
|
|
9817
9862
|
let n = t.path, o = n === "./" ? "" : n.replace(/\/*$/, "/");
|
|
9818
|
-
this[
|
|
9863
|
+
this[ci](o + r);
|
|
9819
9864
|
}), !e) throw new Error("Cannot pipe without source");
|
|
9820
9865
|
i ? e.on("data", (r) => {
|
|
9821
9866
|
i.write(r);
|
|
9822
9867
|
}) : e.on("data", (r) => {
|
|
9823
|
-
super[
|
|
9868
|
+
super[lr](r);
|
|
9824
9869
|
});
|
|
9825
9870
|
}
|
|
9826
9871
|
};
|
|
9827
|
-
var
|
|
9872
|
+
var Vn = (s3, t) => {
|
|
9828
9873
|
let e = new kt(s3), i = new Wt(s3.file, { mode: s3.mode || 438 });
|
|
9829
|
-
e.pipe(i),
|
|
9874
|
+
e.pipe(i), fr(e, t);
|
|
9830
9875
|
};
|
|
9831
|
-
var
|
|
9832
|
-
let e = new wt(s3), i = new
|
|
9876
|
+
var $n = (s3, t) => {
|
|
9877
|
+
let e = new wt(s3), i = new et(s3.file, { mode: s3.mode || 438 });
|
|
9833
9878
|
e.pipe(i);
|
|
9834
9879
|
let r = new Promise((n, o) => {
|
|
9835
9880
|
i.on("error", o), i.on("close", n), e.on("error", o);
|
|
9836
9881
|
});
|
|
9837
|
-
return
|
|
9882
|
+
return dr(e, t).catch((n) => e.emit("error", n)), r;
|
|
9838
9883
|
};
|
|
9839
|
-
var
|
|
9884
|
+
var fr = (s3, t) => {
|
|
9840
9885
|
t.forEach((e) => {
|
|
9841
|
-
e.charAt(0) === "@" ?
|
|
9886
|
+
e.charAt(0) === "@" ? Ct({ file: cr.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
|
|
9842
9887
|
}), s3.end();
|
|
9843
9888
|
};
|
|
9844
|
-
var
|
|
9845
|
-
for (let e of t) e.charAt(0) === "@" ? await
|
|
9889
|
+
var dr = async (s3, t) => {
|
|
9890
|
+
for (let e of t) e.charAt(0) === "@" ? await Ct({ file: cr.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
|
|
9846
9891
|
s3.add(i);
|
|
9847
9892
|
} }) : s3.add(e);
|
|
9848
9893
|
s3.end();
|
|
9849
9894
|
};
|
|
9850
|
-
var
|
|
9895
|
+
var Xn = (s3, t) => {
|
|
9851
9896
|
let e = new kt(s3);
|
|
9852
|
-
return
|
|
9897
|
+
return fr(e, t), e;
|
|
9853
9898
|
};
|
|
9854
|
-
var
|
|
9899
|
+
var qn = (s3, t) => {
|
|
9855
9900
|
let e = new wt(s3);
|
|
9856
|
-
return
|
|
9901
|
+
return dr(e, t).catch((i) => e.emit("error", i)), e;
|
|
9857
9902
|
};
|
|
9858
|
-
var
|
|
9903
|
+
var Qn = K(Vn, $n, Xn, qn, (s3, t) => {
|
|
9859
9904
|
if (!t?.length) throw new TypeError("no paths specified to add to archive");
|
|
9860
9905
|
});
|
|
9861
|
-
var
|
|
9862
|
-
var
|
|
9863
|
-
var { O_CREAT:
|
|
9864
|
-
var
|
|
9865
|
-
var
|
|
9866
|
-
var
|
|
9867
|
-
var
|
|
9868
|
-
var
|
|
9869
|
-
var
|
|
9870
|
-
var
|
|
9906
|
+
var Jn = process.env.__FAKE_PLATFORM__ || process.platform;
|
|
9907
|
+
var Er = Jn === "win32";
|
|
9908
|
+
var { O_CREAT: wr, O_NOFOLLOW: mr, O_TRUNC: Sr, O_WRONLY: yr } = pr.constants;
|
|
9909
|
+
var Rr = Number(process.env.__FAKE_FS_O_FILENAME__) || pr.constants.UV_FS_O_FILEMAP || 0;
|
|
9910
|
+
var jn = Er && !!Rr;
|
|
9911
|
+
var to = 512 * 1024;
|
|
9912
|
+
var eo = Rr | Sr | wr | yr;
|
|
9913
|
+
var ur = !Er && typeof mr == "number" ? mr | Sr | wr | yr : null;
|
|
9914
|
+
var us = ur !== null ? () => ur : jn ? (s3) => s3 < to ? eo : "w" : () => "w";
|
|
9915
|
+
var ps = (s3, t, e) => {
|
|
9871
9916
|
try {
|
|
9872
|
-
return
|
|
9917
|
+
return wi.lchownSync(s3, t, e);
|
|
9873
9918
|
} catch (i) {
|
|
9874
9919
|
if (i?.code !== "ENOENT") throw i;
|
|
9875
9920
|
}
|
|
9876
9921
|
};
|
|
9877
|
-
var
|
|
9878
|
-
|
|
9922
|
+
var Ei = (s3, t, e, i) => {
|
|
9923
|
+
wi.lchown(s3, t, e, (r) => {
|
|
9879
9924
|
i(r && r?.code !== "ENOENT" ? r : null);
|
|
9880
9925
|
});
|
|
9881
9926
|
};
|
|
9882
|
-
var
|
|
9883
|
-
if (t.isDirectory())
|
|
9927
|
+
var io = (s3, t, e, i, r) => {
|
|
9928
|
+
if (t.isDirectory()) Es(we.resolve(s3, t.name), e, i, (n) => {
|
|
9884
9929
|
if (n) return r(n);
|
|
9885
|
-
let o =
|
|
9886
|
-
|
|
9930
|
+
let o = we.resolve(s3, t.name);
|
|
9931
|
+
Ei(o, e, i, r);
|
|
9887
9932
|
});
|
|
9888
9933
|
else {
|
|
9889
|
-
let n =
|
|
9890
|
-
|
|
9934
|
+
let n = we.resolve(s3, t.name);
|
|
9935
|
+
Ei(n, e, i, r);
|
|
9891
9936
|
}
|
|
9892
9937
|
};
|
|
9893
|
-
var
|
|
9894
|
-
|
|
9938
|
+
var Es = (s3, t, e, i) => {
|
|
9939
|
+
wi.readdir(s3, { withFileTypes: true }, (r, n) => {
|
|
9895
9940
|
if (r) {
|
|
9896
9941
|
if (r.code === "ENOENT") return i();
|
|
9897
9942
|
if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
|
|
9898
9943
|
}
|
|
9899
|
-
if (r || !n.length) return
|
|
9900
|
-
let o = n.length,
|
|
9901
|
-
if (!
|
|
9902
|
-
if (l) return i(
|
|
9903
|
-
if (--o === 0) return
|
|
9944
|
+
if (r || !n.length) return Ei(s3, t, e, i);
|
|
9945
|
+
let o = n.length, h = null, a = (l) => {
|
|
9946
|
+
if (!h) {
|
|
9947
|
+
if (l) return i(h = l);
|
|
9948
|
+
if (--o === 0) return Ei(s3, t, e, i);
|
|
9904
9949
|
}
|
|
9905
9950
|
};
|
|
9906
|
-
for (let l of n)
|
|
9951
|
+
for (let l of n) io(s3, l, t, e, a);
|
|
9907
9952
|
});
|
|
9908
9953
|
};
|
|
9909
|
-
var
|
|
9910
|
-
t.isDirectory() &&
|
|
9954
|
+
var so = (s3, t, e, i) => {
|
|
9955
|
+
t.isDirectory() && ws(we.resolve(s3, t.name), e, i), ps(we.resolve(s3, t.name), e, i);
|
|
9911
9956
|
};
|
|
9912
|
-
var
|
|
9957
|
+
var ws = (s3, t, e) => {
|
|
9913
9958
|
let i;
|
|
9914
9959
|
try {
|
|
9915
|
-
i =
|
|
9960
|
+
i = wi.readdirSync(s3, { withFileTypes: true });
|
|
9916
9961
|
} catch (r) {
|
|
9917
9962
|
let n = r;
|
|
9918
9963
|
if (n?.code === "ENOENT") return;
|
|
9919
|
-
if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return
|
|
9964
|
+
if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return ps(s3, t, e);
|
|
9920
9965
|
throw n;
|
|
9921
9966
|
}
|
|
9922
|
-
for (let r of i)
|
|
9923
|
-
return
|
|
9967
|
+
for (let r of i) so(s3, r, t, e);
|
|
9968
|
+
return ps(s3, t, e);
|
|
9924
9969
|
};
|
|
9925
|
-
var
|
|
9970
|
+
var Se = class extends Error {
|
|
9926
9971
|
path;
|
|
9927
9972
|
code;
|
|
9928
9973
|
syscall = "chdir";
|
|
@@ -9945,97 +9990,97 @@ var St = class extends Error {
|
|
|
9945
9990
|
return "SymlinkError";
|
|
9946
9991
|
}
|
|
9947
9992
|
};
|
|
9948
|
-
var
|
|
9993
|
+
var no = (s3, t) => {
|
|
9949
9994
|
k.stat(s3, (e, i) => {
|
|
9950
|
-
(e || !i.isDirectory()) && (e = new
|
|
9995
|
+
(e || !i.isDirectory()) && (e = new Se(s3, e?.code || "ENOTDIR")), t(e);
|
|
9951
9996
|
});
|
|
9952
9997
|
};
|
|
9953
|
-
var
|
|
9998
|
+
var gr = (s3, t, e) => {
|
|
9954
9999
|
s3 = f(s3);
|
|
9955
|
-
let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid,
|
|
9956
|
-
E ? e(E) : x &&
|
|
10000
|
+
let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, h = t.gid, a = typeof o == "number" && typeof h == "number" && (o !== t.processUid || h !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
|
|
10001
|
+
E ? e(E) : x && a ? Es(x, o, h, (Le) => S(Le)) : n ? k.chmod(s3, r, e) : e();
|
|
9957
10002
|
};
|
|
9958
|
-
if (s3 === d) return
|
|
9959
|
-
if (l) return
|
|
9960
|
-
let
|
|
9961
|
-
|
|
10003
|
+
if (s3 === d) return no(s3, S);
|
|
10004
|
+
if (l) return ro.mkdir(s3, { mode: r, recursive: true }).then((E) => S(null, E ?? void 0), S);
|
|
10005
|
+
let D = f(Si.relative(d, s3)).split("/");
|
|
10006
|
+
Ss(d, D, r, c, d, void 0, S);
|
|
9962
10007
|
};
|
|
9963
|
-
var
|
|
10008
|
+
var Ss = (s3, t, e, i, r, n, o) => {
|
|
9964
10009
|
if (t.length === 0) return o(null, n);
|
|
9965
|
-
let
|
|
9966
|
-
k.mkdir(
|
|
10010
|
+
let h = t.shift(), a = f(Si.resolve(s3 + "/" + h));
|
|
10011
|
+
k.mkdir(a, e, br(a, t, e, i, r, n, o));
|
|
9967
10012
|
};
|
|
9968
|
-
var
|
|
9969
|
-
|
|
9970
|
-
if (
|
|
9971
|
-
else if (l.isDirectory())
|
|
10013
|
+
var br = (s3, t, e, i, r, n, o) => (h) => {
|
|
10014
|
+
h ? k.lstat(s3, (a, l) => {
|
|
10015
|
+
if (a) a.path = a.path && f(a.path), o(a);
|
|
10016
|
+
else if (l.isDirectory()) Ss(s3, t, e, i, r, n, o);
|
|
9972
10017
|
else if (i) k.unlink(s3, (c) => {
|
|
9973
10018
|
if (c) return o(c);
|
|
9974
|
-
k.mkdir(s3, e,
|
|
10019
|
+
k.mkdir(s3, e, br(s3, t, e, i, r, n, o));
|
|
9975
10020
|
});
|
|
9976
10021
|
else {
|
|
9977
10022
|
if (l.isSymbolicLink()) return o(new St(s3, s3 + "/" + t.join("/")));
|
|
9978
|
-
o(
|
|
10023
|
+
o(h);
|
|
9979
10024
|
}
|
|
9980
|
-
}) : (n = n || s3,
|
|
10025
|
+
}) : (n = n || s3, Ss(s3, t, e, i, r, n, o));
|
|
9981
10026
|
};
|
|
9982
|
-
var
|
|
10027
|
+
var oo = (s3) => {
|
|
9983
10028
|
let t = false, e;
|
|
9984
10029
|
try {
|
|
9985
10030
|
t = k.statSync(s3).isDirectory();
|
|
9986
10031
|
} catch (i) {
|
|
9987
10032
|
e = i?.code;
|
|
9988
10033
|
} finally {
|
|
9989
|
-
if (!t) throw new
|
|
10034
|
+
if (!t) throw new Se(s3, e ?? "ENOTDIR");
|
|
9990
10035
|
}
|
|
9991
10036
|
};
|
|
9992
|
-
var
|
|
10037
|
+
var _r = (s3, t) => {
|
|
9993
10038
|
s3 = f(s3);
|
|
9994
|
-
let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid,
|
|
9995
|
-
E &&
|
|
10039
|
+
let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, h = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), a = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
|
|
10040
|
+
E && h && ws(E, n, o), r && k.chmodSync(s3, i);
|
|
9996
10041
|
};
|
|
9997
|
-
if (s3 === c) return
|
|
9998
|
-
if (
|
|
9999
|
-
let T = f(
|
|
10042
|
+
if (s3 === c) return oo(c), d();
|
|
10043
|
+
if (a) return d(k.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
|
|
10044
|
+
let T = f(Si.relative(c, s3)).split("/"), D;
|
|
10000
10045
|
for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
|
|
10001
|
-
x = f(
|
|
10046
|
+
x = f(Si.resolve(x));
|
|
10002
10047
|
try {
|
|
10003
|
-
k.mkdirSync(x, i),
|
|
10048
|
+
k.mkdirSync(x, i), D = D || x;
|
|
10004
10049
|
} catch {
|
|
10005
|
-
let
|
|
10006
|
-
if (
|
|
10050
|
+
let Le = k.lstatSync(x);
|
|
10051
|
+
if (Le.isDirectory()) continue;
|
|
10007
10052
|
if (l) {
|
|
10008
|
-
k.unlinkSync(x), k.mkdirSync(x, i),
|
|
10053
|
+
k.unlinkSync(x), k.mkdirSync(x, i), D = D || x;
|
|
10009
10054
|
continue;
|
|
10010
|
-
} else if (
|
|
10055
|
+
} else if (Le.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
|
|
10011
10056
|
}
|
|
10012
10057
|
}
|
|
10013
|
-
return d(
|
|
10058
|
+
return d(D);
|
|
10014
10059
|
};
|
|
10015
|
-
var
|
|
10016
|
-
var
|
|
10060
|
+
var ys = /* @__PURE__ */ Object.create(null);
|
|
10061
|
+
var Or = 1e4;
|
|
10017
10062
|
var Vt = /* @__PURE__ */ new Set();
|
|
10018
|
-
var
|
|
10019
|
-
Vt.has(s3) ? Vt.delete(s3) :
|
|
10020
|
-
let t =
|
|
10021
|
-
if (e >
|
|
10022
|
-
for (let i of Vt) if (Vt.delete(i), delete
|
|
10063
|
+
var Tr = (s3) => {
|
|
10064
|
+
Vt.has(s3) ? Vt.delete(s3) : ys[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), Vt.add(s3);
|
|
10065
|
+
let t = ys[s3], e = Vt.size - Or;
|
|
10066
|
+
if (e > Or / 10) {
|
|
10067
|
+
for (let i of Vt) if (Vt.delete(i), delete ys[i], --e <= 0) break;
|
|
10023
10068
|
}
|
|
10024
10069
|
return t;
|
|
10025
10070
|
};
|
|
10026
|
-
var
|
|
10027
|
-
var
|
|
10028
|
-
var
|
|
10071
|
+
var ho = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
10072
|
+
var ao = ho === "win32";
|
|
10073
|
+
var lo = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
|
|
10029
10074
|
let r = e.at(-1);
|
|
10030
|
-
return r !== void 0 && (i =
|
|
10075
|
+
return r !== void 0 && (i = xr(r, i)), e.push(i || "/"), e;
|
|
10031
10076
|
}, []);
|
|
10032
|
-
var
|
|
10077
|
+
var yi = class {
|
|
10033
10078
|
#t = /* @__PURE__ */ new Map();
|
|
10034
10079
|
#i = /* @__PURE__ */ new Map();
|
|
10035
10080
|
#s = /* @__PURE__ */ new Set();
|
|
10036
10081
|
reserve(t, e) {
|
|
10037
|
-
t =
|
|
10038
|
-
let i = new Set(t.map((r) =>
|
|
10082
|
+
t = ao ? ["win32 parallelization disabled"] : t.map((r) => ut(xr(Tr(r))));
|
|
10083
|
+
let i = new Set(t.map((r) => lo(r)).reduce((r, n) => r.concat(n)));
|
|
10039
10084
|
this.#i.set(e, { dirs: i, paths: t });
|
|
10040
10085
|
for (let r of t) {
|
|
10041
10086
|
let n = this.#t.get(r);
|
|
@@ -10069,79 +10114,79 @@ var Si = class {
|
|
|
10069
10114
|
if (!e) throw new Error("invalid reservation");
|
|
10070
10115
|
let { paths: i, dirs: r } = e, n = /* @__PURE__ */ new Set();
|
|
10071
10116
|
for (let o of i) {
|
|
10072
|
-
let
|
|
10073
|
-
if (!
|
|
10074
|
-
let
|
|
10075
|
-
if (!
|
|
10117
|
+
let h = this.#t.get(o);
|
|
10118
|
+
if (!h || h?.[0] !== t) continue;
|
|
10119
|
+
let a = h[1];
|
|
10120
|
+
if (!a) {
|
|
10076
10121
|
this.#t.delete(o);
|
|
10077
10122
|
continue;
|
|
10078
10123
|
}
|
|
10079
|
-
if (
|
|
10080
|
-
else for (let l of
|
|
10124
|
+
if (h.shift(), typeof a == "function") n.add(a);
|
|
10125
|
+
else for (let l of a) n.add(l);
|
|
10081
10126
|
}
|
|
10082
10127
|
for (let o of r) {
|
|
10083
|
-
let
|
|
10084
|
-
if (!(!
|
|
10128
|
+
let h = this.#t.get(o), a = h?.[0];
|
|
10129
|
+
if (!(!h || !(a instanceof Set))) if (a.size === 1 && h.length === 1) {
|
|
10085
10130
|
this.#t.delete(o);
|
|
10086
10131
|
continue;
|
|
10087
|
-
} else if (
|
|
10088
|
-
|
|
10089
|
-
let l =
|
|
10132
|
+
} else if (a.size === 1) {
|
|
10133
|
+
h.shift();
|
|
10134
|
+
let l = h[0];
|
|
10090
10135
|
typeof l == "function" && n.add(l);
|
|
10091
|
-
} else
|
|
10136
|
+
} else a.delete(t);
|
|
10092
10137
|
}
|
|
10093
10138
|
return this.#s.delete(t), n.forEach((o) => this.#r(o)), true;
|
|
10094
10139
|
}
|
|
10095
10140
|
};
|
|
10096
|
-
var
|
|
10097
|
-
var
|
|
10098
|
-
var
|
|
10099
|
-
var
|
|
10100
|
-
var
|
|
10141
|
+
var Lr = () => process.umask();
|
|
10142
|
+
var Dr = /* @__PURE__ */ Symbol("onEntry");
|
|
10143
|
+
var _s = /* @__PURE__ */ Symbol("checkFs");
|
|
10144
|
+
var Nr = /* @__PURE__ */ Symbol("checkFs2");
|
|
10145
|
+
var Os = /* @__PURE__ */ Symbol("isReusable");
|
|
10101
10146
|
var P = /* @__PURE__ */ Symbol("makeFs");
|
|
10102
|
-
var
|
|
10103
|
-
var
|
|
10104
|
-
var
|
|
10105
|
-
var
|
|
10106
|
-
var
|
|
10107
|
-
var
|
|
10108
|
-
var
|
|
10109
|
-
var
|
|
10110
|
-
var
|
|
10147
|
+
var Ts = /* @__PURE__ */ Symbol("file");
|
|
10148
|
+
var xs = /* @__PURE__ */ Symbol("directory");
|
|
10149
|
+
var gi = /* @__PURE__ */ Symbol("link");
|
|
10150
|
+
var Ar = /* @__PURE__ */ Symbol("symlink");
|
|
10151
|
+
var Ir = /* @__PURE__ */ Symbol("hardlink");
|
|
10152
|
+
var Re = /* @__PURE__ */ Symbol("ensureNoSymlink");
|
|
10153
|
+
var Cr = /* @__PURE__ */ Symbol("unsupported");
|
|
10154
|
+
var Fr = /* @__PURE__ */ Symbol("checkPath");
|
|
10155
|
+
var Rs = /* @__PURE__ */ Symbol("stripAbsolutePath");
|
|
10111
10156
|
var yt = /* @__PURE__ */ Symbol("mkdir");
|
|
10112
10157
|
var O = /* @__PURE__ */ Symbol("onError");
|
|
10113
|
-
var
|
|
10114
|
-
var
|
|
10158
|
+
var Ri = /* @__PURE__ */ Symbol("pending");
|
|
10159
|
+
var kr = /* @__PURE__ */ Symbol("pend");
|
|
10115
10160
|
var $t = /* @__PURE__ */ Symbol("unpend");
|
|
10116
|
-
var
|
|
10117
|
-
var
|
|
10118
|
-
var
|
|
10119
|
-
var
|
|
10120
|
-
var
|
|
10121
|
-
var
|
|
10122
|
-
var
|
|
10123
|
-
var
|
|
10124
|
-
var
|
|
10125
|
-
var
|
|
10126
|
-
var
|
|
10127
|
-
if (!
|
|
10128
|
-
let e = s3 + ".DELETE." +
|
|
10129
|
-
|
|
10161
|
+
var gs = /* @__PURE__ */ Symbol("ended");
|
|
10162
|
+
var bs = /* @__PURE__ */ Symbol("maybeClose");
|
|
10163
|
+
var Ls = /* @__PURE__ */ Symbol("skip");
|
|
10164
|
+
var ge = /* @__PURE__ */ Symbol("doChown");
|
|
10165
|
+
var be = /* @__PURE__ */ Symbol("uid");
|
|
10166
|
+
var _e = /* @__PURE__ */ Symbol("gid");
|
|
10167
|
+
var Oe = /* @__PURE__ */ Symbol("checkedCwd");
|
|
10168
|
+
var fo = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
10169
|
+
var Te = fo === "win32";
|
|
10170
|
+
var mo = 1024;
|
|
10171
|
+
var uo = (s3, t) => {
|
|
10172
|
+
if (!Te) return m.unlink(s3, t);
|
|
10173
|
+
let e = s3 + ".DELETE." + Mr(16).toString("hex");
|
|
10174
|
+
m.rename(s3, e, (i) => {
|
|
10130
10175
|
if (i) return t(i);
|
|
10131
|
-
|
|
10176
|
+
m.unlink(e, t);
|
|
10132
10177
|
});
|
|
10133
10178
|
};
|
|
10134
|
-
var
|
|
10135
|
-
if (!
|
|
10136
|
-
let t = s3 + ".DELETE." +
|
|
10137
|
-
|
|
10179
|
+
var po = (s3) => {
|
|
10180
|
+
if (!Te) return m.unlinkSync(s3);
|
|
10181
|
+
let t = s3 + ".DELETE." + Mr(16).toString("hex");
|
|
10182
|
+
m.renameSync(s3, t), m.unlinkSync(t);
|
|
10138
10183
|
};
|
|
10139
|
-
var
|
|
10140
|
-
var Xt = class extends
|
|
10141
|
-
[
|
|
10142
|
-
[
|
|
10143
|
-
[
|
|
10144
|
-
reservations = new
|
|
10184
|
+
var vr = (s3, t, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e;
|
|
10185
|
+
var Xt = class extends rt {
|
|
10186
|
+
[gs] = false;
|
|
10187
|
+
[Oe] = false;
|
|
10188
|
+
[Ri] = 0;
|
|
10189
|
+
reservations = new yi();
|
|
10145
10190
|
transform;
|
|
10146
10191
|
writable = true;
|
|
10147
10192
|
readable = false;
|
|
@@ -10168,32 +10213,32 @@ var Xt = class extends st {
|
|
|
10168
10213
|
chmod;
|
|
10169
10214
|
constructor(t = {}) {
|
|
10170
10215
|
if (t.ondone = () => {
|
|
10171
|
-
this[
|
|
10216
|
+
this[gs] = true, this[bs]();
|
|
10172
10217
|
}, super(t), this.transform = t.transform, this.chmod = !!t.chmod, typeof t.uid == "number" || typeof t.gid == "number") {
|
|
10173
10218
|
if (typeof t.uid != "number" || typeof t.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
|
|
10174
10219
|
if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
10175
10220
|
this.uid = t.uid, this.gid = t.gid, this.setOwner = true;
|
|
10176
10221
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = false;
|
|
10177
|
-
this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ?
|
|
10222
|
+
this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? process.getuid?.() === 0 : !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : mo, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Te, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(R.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : Lr() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Dr](e));
|
|
10178
10223
|
}
|
|
10179
10224
|
warn(t, e, i = {}) {
|
|
10180
10225
|
return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = false), super.warn(t, e, i);
|
|
10181
10226
|
}
|
|
10182
|
-
[
|
|
10183
|
-
this[
|
|
10227
|
+
[bs]() {
|
|
10228
|
+
this[gs] && this[Ri] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
|
|
10184
10229
|
}
|
|
10185
|
-
[
|
|
10230
|
+
[Rs](t, e) {
|
|
10186
10231
|
let i = t[e], { type: r } = t;
|
|
10187
10232
|
if (!i || this.preservePaths) return true;
|
|
10188
|
-
let [n, o] =
|
|
10189
|
-
if (
|
|
10233
|
+
let [n, o] = ce(i), h = o.replaceAll(/\\/g, "/").split("/");
|
|
10234
|
+
if (h.includes("..") || Te && /^[a-z]:\.\.$/i.test(h[0] ?? "")) {
|
|
10190
10235
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t, [e]: i }), false;
|
|
10191
|
-
let
|
|
10236
|
+
let a = R.posix.dirname(t.path), l = R.posix.normalize(R.posix.join(a, h.join("/")));
|
|
10192
10237
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t, [e]: i }), false;
|
|
10193
10238
|
}
|
|
10194
10239
|
return n && (t[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t, [e]: i })), true;
|
|
10195
10240
|
}
|
|
10196
|
-
[
|
|
10241
|
+
[Fr](t) {
|
|
10197
10242
|
let e = f(t.path), i = e.split("/");
|
|
10198
10243
|
if (this.strip) {
|
|
10199
10244
|
if (i.length < this.strip) return false;
|
|
@@ -10205,20 +10250,20 @@ var Xt = class extends st {
|
|
|
10205
10250
|
i.splice(0, this.strip), t.path = i.join("/");
|
|
10206
10251
|
}
|
|
10207
10252
|
if (isFinite(this.maxDepth) && i.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t, path: e, depth: i.length, maxDepth: this.maxDepth }), false;
|
|
10208
|
-
if (!this[
|
|
10253
|
+
if (!this[Rs](t, "path") || !this[Rs](t, "linkpath")) return false;
|
|
10209
10254
|
if (t.absolute = R.isAbsolute(t.path) ? f(R.resolve(t.path)) : f(R.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t, path: f(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
|
|
10210
10255
|
if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return false;
|
|
10211
10256
|
if (this.win32) {
|
|
10212
10257
|
let { root: r } = R.win32.parse(String(t.absolute));
|
|
10213
|
-
t.absolute = r +
|
|
10258
|
+
t.absolute = r + ts(String(t.absolute).slice(r.length));
|
|
10214
10259
|
let { root: n } = R.win32.parse(t.path);
|
|
10215
|
-
t.path = n +
|
|
10260
|
+
t.path = n + ts(t.path.slice(n.length));
|
|
10216
10261
|
}
|
|
10217
10262
|
return true;
|
|
10218
10263
|
}
|
|
10219
|
-
[
|
|
10220
|
-
if (!this[
|
|
10221
|
-
switch (
|
|
10264
|
+
[Dr](t) {
|
|
10265
|
+
if (!this[Fr](t)) return t.resume();
|
|
10266
|
+
switch (co.equal(typeof t.absolute, "string"), t.type) {
|
|
10222
10267
|
case "Directory":
|
|
10223
10268
|
case "GNUDumpDir":
|
|
10224
10269
|
t.mode && (t.mode = t.mode | 448);
|
|
@@ -10227,62 +10272,62 @@ var Xt = class extends st {
|
|
|
10227
10272
|
case "ContiguousFile":
|
|
10228
10273
|
case "Link":
|
|
10229
10274
|
case "SymbolicLink":
|
|
10230
|
-
return this[
|
|
10275
|
+
return this[_s](t);
|
|
10231
10276
|
default:
|
|
10232
|
-
return this[
|
|
10277
|
+
return this[Cr](t);
|
|
10233
10278
|
}
|
|
10234
10279
|
}
|
|
10235
10280
|
[O](t, e) {
|
|
10236
10281
|
t.name === "CwdError" ? this.emit("error", t) : (this.warn("TAR_ENTRY_ERROR", t, { entry: e }), this[$t](), e.resume());
|
|
10237
10282
|
}
|
|
10238
10283
|
[yt](t, e, i) {
|
|
10239
|
-
|
|
10240
|
-
}
|
|
10241
|
-
[Re](t) {
|
|
10242
|
-
return this.forceChown || this.preserveOwner && (typeof t.uid == "number" && t.uid !== this.processUid || typeof t.gid == "number" && t.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
|
|
10284
|
+
gr(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e }, i);
|
|
10243
10285
|
}
|
|
10244
10286
|
[ge](t) {
|
|
10245
|
-
return
|
|
10287
|
+
return this.forceChown || this.preserveOwner && (typeof t.uid == "number" && t.uid !== this.processUid || typeof t.gid == "number" && t.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
|
|
10246
10288
|
}
|
|
10247
10289
|
[be](t) {
|
|
10248
|
-
return
|
|
10290
|
+
return vr(this.uid, t.uid, this.processUid);
|
|
10249
10291
|
}
|
|
10250
|
-
[
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10292
|
+
[_e](t) {
|
|
10293
|
+
return vr(this.gid, t.gid, this.processGid);
|
|
10294
|
+
}
|
|
10295
|
+
[Ts](t, e) {
|
|
10296
|
+
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new et(String(t.absolute), { flags: us(t.size), mode: i, autoClose: false });
|
|
10297
|
+
r.on("error", (a) => {
|
|
10298
|
+
r.fd && m.close(r.fd, () => {
|
|
10299
|
+
}), r.write = () => true, this[O](a, t), e();
|
|
10255
10300
|
});
|
|
10256
|
-
let n = 1, o = (
|
|
10257
|
-
if (
|
|
10258
|
-
r.fd &&
|
|
10259
|
-
}), this[O](
|
|
10301
|
+
let n = 1, o = (a) => {
|
|
10302
|
+
if (a) {
|
|
10303
|
+
r.fd && m.close(r.fd, () => {
|
|
10304
|
+
}), this[O](a, t), e();
|
|
10260
10305
|
return;
|
|
10261
10306
|
}
|
|
10262
|
-
--n === 0 && r.fd !== void 0 &&
|
|
10307
|
+
--n === 0 && r.fd !== void 0 && m.close(r.fd, (l) => {
|
|
10263
10308
|
l ? this[O](l, t) : this[$t](), e();
|
|
10264
10309
|
});
|
|
10265
10310
|
};
|
|
10266
10311
|
r.on("finish", () => {
|
|
10267
|
-
let
|
|
10312
|
+
let a = String(t.absolute), l = r.fd;
|
|
10268
10313
|
if (typeof l == "number" && t.mtime && !this.noMtime) {
|
|
10269
10314
|
n++;
|
|
10270
10315
|
let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
|
|
10271
|
-
|
|
10316
|
+
m.futimes(l, c, d, (S) => S ? m.utimes(a, c, d, (T) => o(T && S)) : o());
|
|
10272
10317
|
}
|
|
10273
|
-
if (typeof l == "number" && this[
|
|
10318
|
+
if (typeof l == "number" && this[ge](t)) {
|
|
10274
10319
|
n++;
|
|
10275
|
-
let c = this[
|
|
10276
|
-
typeof c == "number" && typeof d == "number" &&
|
|
10320
|
+
let c = this[be](t), d = this[_e](t);
|
|
10321
|
+
typeof c == "number" && typeof d == "number" && m.fchown(l, c, d, (S) => S ? m.chown(a, c, d, (T) => o(T && S)) : o());
|
|
10277
10322
|
}
|
|
10278
10323
|
o();
|
|
10279
10324
|
});
|
|
10280
|
-
let
|
|
10281
|
-
|
|
10282
|
-
this[O](
|
|
10283
|
-
}), t.pipe(
|
|
10325
|
+
let h = this.transform && this.transform(t) || t;
|
|
10326
|
+
h !== t && (h.on("error", (a) => {
|
|
10327
|
+
this[O](a, t), e();
|
|
10328
|
+
}), t.pipe(h)), h.pipe(r);
|
|
10284
10329
|
}
|
|
10285
|
-
[
|
|
10330
|
+
[xs](t, e) {
|
|
10286
10331
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode;
|
|
10287
10332
|
this[yt](String(t.absolute), i, (r) => {
|
|
10288
10333
|
if (r) {
|
|
@@ -10292,68 +10337,68 @@ var Xt = class extends st {
|
|
|
10292
10337
|
let n = 1, o = () => {
|
|
10293
10338
|
--n === 0 && (e(), this[$t](), t.resume());
|
|
10294
10339
|
};
|
|
10295
|
-
t.mtime && !this.noMtime && (n++,
|
|
10340
|
+
t.mtime && !this.noMtime && (n++, m.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, m.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
|
|
10296
10341
|
});
|
|
10297
10342
|
}
|
|
10298
|
-
[
|
|
10343
|
+
[Cr](t) {
|
|
10299
10344
|
t.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
|
|
10300
10345
|
}
|
|
10301
|
-
[
|
|
10346
|
+
[Ar](t, e) {
|
|
10302
10347
|
let i = f(R.relative(this.cwd, R.resolve(R.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
|
|
10303
|
-
this[
|
|
10348
|
+
this[Re](t, this.cwd, i, () => this[gi](t, String(t.linkpath), "symlink", e), (r) => {
|
|
10304
10349
|
this[O](r, t), e();
|
|
10305
10350
|
});
|
|
10306
10351
|
}
|
|
10307
|
-
[
|
|
10352
|
+
[Ir](t, e) {
|
|
10308
10353
|
let i = f(R.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
|
|
10309
|
-
this[
|
|
10354
|
+
this[Re](t, this.cwd, r, () => this[gi](t, i, "link", e), (n) => {
|
|
10310
10355
|
this[O](n, t), e();
|
|
10311
10356
|
});
|
|
10312
10357
|
}
|
|
10313
|
-
[
|
|
10358
|
+
[Re](t, e, i, r, n) {
|
|
10314
10359
|
let o = i.shift();
|
|
10315
10360
|
if (this.preservePaths || o === void 0) return r();
|
|
10316
|
-
let
|
|
10317
|
-
|
|
10318
|
-
if (
|
|
10319
|
-
if (l?.isSymbolicLink()) return n(new St(
|
|
10320
|
-
this[
|
|
10361
|
+
let h = R.resolve(e, o);
|
|
10362
|
+
m.lstat(h, (a, l) => {
|
|
10363
|
+
if (a) return r();
|
|
10364
|
+
if (l?.isSymbolicLink()) return n(new St(h, R.resolve(h, i.join("/"))));
|
|
10365
|
+
this[Re](t, h, i, r, n);
|
|
10321
10366
|
});
|
|
10322
10367
|
}
|
|
10323
|
-
[
|
|
10324
|
-
this[
|
|
10368
|
+
[kr]() {
|
|
10369
|
+
this[Ri]++;
|
|
10325
10370
|
}
|
|
10326
10371
|
[$t]() {
|
|
10327
|
-
this[
|
|
10372
|
+
this[Ri]--, this[bs]();
|
|
10328
10373
|
}
|
|
10329
|
-
[
|
|
10374
|
+
[Ls](t) {
|
|
10330
10375
|
this[$t](), t.resume();
|
|
10331
10376
|
}
|
|
10332
|
-
[
|
|
10333
|
-
return t.type === "File" && !this.unlink && e.isFile() && e.nlink <= 1 && !
|
|
10377
|
+
[Os](t, e) {
|
|
10378
|
+
return t.type === "File" && !this.unlink && e.isFile() && e.nlink <= 1 && !Te;
|
|
10334
10379
|
}
|
|
10335
|
-
[
|
|
10336
|
-
this[
|
|
10380
|
+
[_s](t) {
|
|
10381
|
+
this[kr]();
|
|
10337
10382
|
let e = [t.path];
|
|
10338
|
-
t.linkpath && e.push(t.linkpath), this.reservations.reserve(e, (i) => this[
|
|
10383
|
+
t.linkpath && e.push(t.linkpath), this.reservations.reserve(e, (i) => this[Nr](t, i));
|
|
10339
10384
|
}
|
|
10340
|
-
[
|
|
10341
|
-
let i = (
|
|
10342
|
-
e(
|
|
10385
|
+
[Nr](t, e) {
|
|
10386
|
+
let i = (h) => {
|
|
10387
|
+
e(h);
|
|
10343
10388
|
}, r = () => {
|
|
10344
|
-
this[yt](this.cwd, this.dmode, (
|
|
10345
|
-
if (
|
|
10346
|
-
this[O](
|
|
10389
|
+
this[yt](this.cwd, this.dmode, (h) => {
|
|
10390
|
+
if (h) {
|
|
10391
|
+
this[O](h, t), i();
|
|
10347
10392
|
return;
|
|
10348
10393
|
}
|
|
10349
|
-
this[
|
|
10394
|
+
this[Oe] = true, n();
|
|
10350
10395
|
});
|
|
10351
10396
|
}, n = () => {
|
|
10352
10397
|
if (t.absolute !== this.cwd) {
|
|
10353
|
-
let
|
|
10354
|
-
if (
|
|
10355
|
-
if (
|
|
10356
|
-
this[O](
|
|
10398
|
+
let h = f(R.dirname(String(t.absolute)));
|
|
10399
|
+
if (h !== this.cwd) return this[yt](h, this.dmode, (a) => {
|
|
10400
|
+
if (a) {
|
|
10401
|
+
this[O](a, t), i();
|
|
10357
10402
|
return;
|
|
10358
10403
|
}
|
|
10359
10404
|
o();
|
|
@@ -10361,24 +10406,24 @@ var Xt = class extends st {
|
|
|
10361
10406
|
}
|
|
10362
10407
|
o();
|
|
10363
10408
|
}, o = () => {
|
|
10364
|
-
|
|
10365
|
-
if (
|
|
10366
|
-
this[
|
|
10409
|
+
m.lstat(String(t.absolute), (h, a) => {
|
|
10410
|
+
if (a && (this.keep || this.newer && a.mtime > (t.mtime ?? a.mtime))) {
|
|
10411
|
+
this[Ls](t), i();
|
|
10367
10412
|
return;
|
|
10368
10413
|
}
|
|
10369
|
-
if (
|
|
10370
|
-
if (
|
|
10414
|
+
if (h || this[Os](t, a)) return this[P](null, t, i);
|
|
10415
|
+
if (a.isDirectory()) {
|
|
10371
10416
|
if (t.type === "Directory") {
|
|
10372
|
-
let l = this.chmod && t.mode && (
|
|
10373
|
-
return l ?
|
|
10417
|
+
let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
|
|
10418
|
+
return l ? m.chmod(String(t.absolute), Number(t.mode), c) : c();
|
|
10374
10419
|
}
|
|
10375
|
-
if (t.absolute !== this.cwd) return
|
|
10420
|
+
if (t.absolute !== this.cwd) return m.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
10376
10421
|
}
|
|
10377
10422
|
if (t.absolute === this.cwd) return this[P](null, t, i);
|
|
10378
|
-
|
|
10423
|
+
uo(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
10379
10424
|
});
|
|
10380
10425
|
};
|
|
10381
|
-
this[
|
|
10426
|
+
this[Oe] ? n() : r();
|
|
10382
10427
|
}
|
|
10383
10428
|
[P](t, e, i) {
|
|
10384
10429
|
if (t) {
|
|
@@ -10389,40 +10434,40 @@ var Xt = class extends st {
|
|
|
10389
10434
|
case "File":
|
|
10390
10435
|
case "OldFile":
|
|
10391
10436
|
case "ContiguousFile":
|
|
10392
|
-
return this[
|
|
10437
|
+
return this[Ts](e, i);
|
|
10393
10438
|
case "Link":
|
|
10394
|
-
return this[
|
|
10439
|
+
return this[Ir](e, i);
|
|
10395
10440
|
case "SymbolicLink":
|
|
10396
|
-
return this[
|
|
10441
|
+
return this[Ar](e, i);
|
|
10397
10442
|
case "Directory":
|
|
10398
10443
|
case "GNUDumpDir":
|
|
10399
|
-
return this[
|
|
10444
|
+
return this[xs](e, i);
|
|
10400
10445
|
}
|
|
10401
10446
|
}
|
|
10402
|
-
[
|
|
10403
|
-
|
|
10447
|
+
[gi](t, e, i, r) {
|
|
10448
|
+
m[i](e, String(t.absolute), (n) => {
|
|
10404
10449
|
n ? this[O](n, t) : (this[$t](), t.resume()), r();
|
|
10405
10450
|
});
|
|
10406
10451
|
}
|
|
10407
10452
|
};
|
|
10408
|
-
var
|
|
10453
|
+
var ye = (s3) => {
|
|
10409
10454
|
try {
|
|
10410
10455
|
return [null, s3()];
|
|
10411
10456
|
} catch (t) {
|
|
10412
10457
|
return [t, null];
|
|
10413
10458
|
}
|
|
10414
10459
|
};
|
|
10415
|
-
var
|
|
10460
|
+
var xe = class extends Xt {
|
|
10416
10461
|
sync = true;
|
|
10417
10462
|
[P](t, e) {
|
|
10418
10463
|
return super[P](t, e, () => {
|
|
10419
10464
|
});
|
|
10420
10465
|
}
|
|
10421
|
-
[
|
|
10422
|
-
if (!this[
|
|
10466
|
+
[_s](t) {
|
|
10467
|
+
if (!this[Oe]) {
|
|
10423
10468
|
let n = this[yt](this.cwd, this.dmode);
|
|
10424
10469
|
if (n) return this[O](n, t);
|
|
10425
|
-
this[
|
|
10470
|
+
this[Oe] = true;
|
|
10426
10471
|
}
|
|
10427
10472
|
if (t.absolute !== this.cwd) {
|
|
10428
10473
|
let n = f(R.dirname(String(t.absolute)));
|
|
@@ -10431,157 +10476,157 @@ var Te = class extends Xt {
|
|
|
10431
10476
|
if (o) return this[O](o, t);
|
|
10432
10477
|
}
|
|
10433
10478
|
}
|
|
10434
|
-
let [e, i] =
|
|
10435
|
-
if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[
|
|
10436
|
-
if (e || this[
|
|
10479
|
+
let [e, i] = ye(() => m.lstatSync(String(t.absolute)));
|
|
10480
|
+
if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ls](t);
|
|
10481
|
+
if (e || this[Os](t, i)) return this[P](null, t);
|
|
10437
10482
|
if (i.isDirectory()) {
|
|
10438
10483
|
if (t.type === "Directory") {
|
|
10439
|
-
let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [
|
|
10440
|
-
|
|
10484
|
+
let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [h] = o ? ye(() => {
|
|
10485
|
+
m.chmodSync(String(t.absolute), Number(t.mode));
|
|
10441
10486
|
}) : [];
|
|
10442
|
-
return this[P](
|
|
10487
|
+
return this[P](h, t);
|
|
10443
10488
|
}
|
|
10444
|
-
let [n] =
|
|
10489
|
+
let [n] = ye(() => m.rmdirSync(String(t.absolute)));
|
|
10445
10490
|
this[P](n, t);
|
|
10446
10491
|
}
|
|
10447
|
-
let [r] = t.absolute === this.cwd ? [] :
|
|
10492
|
+
let [r] = t.absolute === this.cwd ? [] : ye(() => po(String(t.absolute)));
|
|
10448
10493
|
this[P](r, t);
|
|
10449
10494
|
}
|
|
10450
|
-
[
|
|
10451
|
-
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (
|
|
10452
|
-
let
|
|
10495
|
+
[Ts](t, e) {
|
|
10496
|
+
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h) => {
|
|
10497
|
+
let a;
|
|
10453
10498
|
try {
|
|
10454
|
-
|
|
10499
|
+
m.closeSync(n);
|
|
10455
10500
|
} catch (l) {
|
|
10456
|
-
|
|
10501
|
+
a = l;
|
|
10457
10502
|
}
|
|
10458
|
-
(
|
|
10503
|
+
(h || a) && this[O](h || a, t), e();
|
|
10459
10504
|
}, n;
|
|
10460
10505
|
try {
|
|
10461
|
-
n =
|
|
10462
|
-
} catch (
|
|
10463
|
-
return r(
|
|
10506
|
+
n = m.openSync(String(t.absolute), us(t.size), i);
|
|
10507
|
+
} catch (h) {
|
|
10508
|
+
return r(h);
|
|
10464
10509
|
}
|
|
10465
10510
|
let o = this.transform && this.transform(t) || t;
|
|
10466
|
-
o !== t && (o.on("error", (
|
|
10511
|
+
o !== t && (o.on("error", (h) => this[O](h, t)), t.pipe(o)), o.on("data", (h) => {
|
|
10467
10512
|
try {
|
|
10468
|
-
|
|
10469
|
-
} catch (
|
|
10470
|
-
r(
|
|
10513
|
+
m.writeSync(n, h, 0, h.length);
|
|
10514
|
+
} catch (a) {
|
|
10515
|
+
r(a);
|
|
10471
10516
|
}
|
|
10472
10517
|
}), o.on("end", () => {
|
|
10473
|
-
let
|
|
10518
|
+
let h = null;
|
|
10474
10519
|
if (t.mtime && !this.noMtime) {
|
|
10475
|
-
let
|
|
10520
|
+
let a = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
|
|
10476
10521
|
try {
|
|
10477
|
-
|
|
10522
|
+
m.futimesSync(n, a, l);
|
|
10478
10523
|
} catch (c) {
|
|
10479
10524
|
try {
|
|
10480
|
-
|
|
10525
|
+
m.utimesSync(String(t.absolute), a, l);
|
|
10481
10526
|
} catch {
|
|
10482
|
-
|
|
10527
|
+
h = c;
|
|
10483
10528
|
}
|
|
10484
10529
|
}
|
|
10485
10530
|
}
|
|
10486
|
-
if (this[
|
|
10487
|
-
let
|
|
10531
|
+
if (this[ge](t)) {
|
|
10532
|
+
let a = this[be](t), l = this[_e](t);
|
|
10488
10533
|
try {
|
|
10489
|
-
|
|
10534
|
+
m.fchownSync(n, Number(a), Number(l));
|
|
10490
10535
|
} catch (c) {
|
|
10491
10536
|
try {
|
|
10492
|
-
|
|
10537
|
+
m.chownSync(String(t.absolute), Number(a), Number(l));
|
|
10493
10538
|
} catch {
|
|
10494
|
-
|
|
10539
|
+
h = h || c;
|
|
10495
10540
|
}
|
|
10496
10541
|
}
|
|
10497
10542
|
}
|
|
10498
|
-
r(
|
|
10543
|
+
r(h);
|
|
10499
10544
|
});
|
|
10500
10545
|
}
|
|
10501
|
-
[
|
|
10546
|
+
[xs](t, e) {
|
|
10502
10547
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode, r = this[yt](String(t.absolute), i);
|
|
10503
10548
|
if (r) {
|
|
10504
10549
|
this[O](r, t), e();
|
|
10505
10550
|
return;
|
|
10506
10551
|
}
|
|
10507
10552
|
if (t.mtime && !this.noMtime) try {
|
|
10508
|
-
|
|
10553
|
+
m.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
|
|
10509
10554
|
} catch {
|
|
10510
10555
|
}
|
|
10511
|
-
if (this[
|
|
10512
|
-
|
|
10556
|
+
if (this[ge](t)) try {
|
|
10557
|
+
m.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
|
|
10513
10558
|
} catch {
|
|
10514
10559
|
}
|
|
10515
10560
|
e(), t.resume();
|
|
10516
10561
|
}
|
|
10517
10562
|
[yt](t, e) {
|
|
10518
10563
|
try {
|
|
10519
|
-
return
|
|
10564
|
+
return _r(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e });
|
|
10520
10565
|
} catch (i) {
|
|
10521
10566
|
return i;
|
|
10522
10567
|
}
|
|
10523
10568
|
}
|
|
10524
|
-
[
|
|
10569
|
+
[Re](t, e, i, r, n) {
|
|
10525
10570
|
if (this.preservePaths || i.length === 0) return r();
|
|
10526
10571
|
let o = e;
|
|
10527
|
-
for (let
|
|
10528
|
-
o = R.resolve(o,
|
|
10529
|
-
let [
|
|
10530
|
-
if (
|
|
10572
|
+
for (let h of i) {
|
|
10573
|
+
o = R.resolve(o, h);
|
|
10574
|
+
let [a, l] = ye(() => m.lstatSync(o));
|
|
10575
|
+
if (a) return r();
|
|
10531
10576
|
if (l.isSymbolicLink()) return n(new St(o, R.resolve(e, i.join("/"))));
|
|
10532
10577
|
}
|
|
10533
10578
|
r();
|
|
10534
10579
|
}
|
|
10535
|
-
[
|
|
10580
|
+
[gi](t, e, i, r) {
|
|
10536
10581
|
let n = `${i}Sync`;
|
|
10537
10582
|
try {
|
|
10538
|
-
|
|
10583
|
+
m[n](e, String(t.absolute)), r(), t.resume();
|
|
10539
10584
|
} catch (o) {
|
|
10540
10585
|
return this[O](o, t);
|
|
10541
10586
|
}
|
|
10542
10587
|
}
|
|
10543
10588
|
};
|
|
10544
|
-
var
|
|
10545
|
-
let t = new
|
|
10546
|
-
new
|
|
10589
|
+
var Eo = (s3) => {
|
|
10590
|
+
let t = new xe(s3), e = s3.file, i = Br.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
|
|
10591
|
+
new Be(e, { readSize: r, size: i.size }).pipe(t);
|
|
10547
10592
|
};
|
|
10548
|
-
var
|
|
10593
|
+
var wo = (s3, t) => {
|
|
10549
10594
|
let e = new Xt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
|
|
10550
|
-
return new Promise((o,
|
|
10551
|
-
e.on("error",
|
|
10552
|
-
if (
|
|
10595
|
+
return new Promise((o, h) => {
|
|
10596
|
+
e.on("error", h), e.on("close", o), Br.stat(r, (a, l) => {
|
|
10597
|
+
if (a) h(a);
|
|
10553
10598
|
else {
|
|
10554
10599
|
let c = new _t(r, { readSize: i, size: l.size });
|
|
10555
|
-
c.on("error",
|
|
10600
|
+
c.on("error", h), c.pipe(e);
|
|
10556
10601
|
}
|
|
10557
10602
|
});
|
|
10558
10603
|
});
|
|
10559
10604
|
};
|
|
10560
|
-
var
|
|
10561
|
-
t?.length &&
|
|
10605
|
+
var So = K(Eo, wo, (s3) => new xe(s3), (s3) => new Xt(s3), (s3, t) => {
|
|
10606
|
+
t?.length && Qi(s3, t);
|
|
10562
10607
|
});
|
|
10563
|
-
var
|
|
10608
|
+
var yo = (s3, t) => {
|
|
10564
10609
|
let e = new kt(s3), i = true, r, n;
|
|
10565
10610
|
try {
|
|
10566
10611
|
try {
|
|
10567
10612
|
r = v.openSync(s3.file, "r+");
|
|
10568
|
-
} catch (
|
|
10569
|
-
if (
|
|
10570
|
-
else throw
|
|
10613
|
+
} catch (a) {
|
|
10614
|
+
if (a?.code === "ENOENT") r = v.openSync(s3.file, "w+");
|
|
10615
|
+
else throw a;
|
|
10571
10616
|
}
|
|
10572
|
-
let o = v.fstatSync(r),
|
|
10617
|
+
let o = v.fstatSync(r), h = Buffer.alloc(512);
|
|
10573
10618
|
t: for (n = 0; n < o.size; n += 512) {
|
|
10574
10619
|
for (let c = 0, d = 0; c < 512; c += d) {
|
|
10575
|
-
if (d = v.readSync(r,
|
|
10620
|
+
if (d = v.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
|
|
10576
10621
|
if (!d) break t;
|
|
10577
10622
|
}
|
|
10578
|
-
let
|
|
10579
|
-
if (!
|
|
10580
|
-
let l = 512 * Math.ceil((
|
|
10623
|
+
let a = new F(h);
|
|
10624
|
+
if (!a.cksumValid) break;
|
|
10625
|
+
let l = 512 * Math.ceil((a.size || 0) / 512);
|
|
10581
10626
|
if (n + l + 512 > o.size) break;
|
|
10582
|
-
n += l, s3.mtimeCache &&
|
|
10627
|
+
n += l, s3.mtimeCache && a.mtime && s3.mtimeCache.set(String(a.path), a.mtime);
|
|
10583
10628
|
}
|
|
10584
|
-
i = false,
|
|
10629
|
+
i = false, Ro(s3, e, n, r, t);
|
|
10585
10630
|
} finally {
|
|
10586
10631
|
if (i) try {
|
|
10587
10632
|
v.closeSync(r);
|
|
@@ -10589,69 +10634,69 @@ var mo = (s3, t) => {
|
|
|
10589
10634
|
}
|
|
10590
10635
|
}
|
|
10591
10636
|
};
|
|
10592
|
-
var
|
|
10637
|
+
var Ro = (s3, t, e, i, r) => {
|
|
10593
10638
|
let n = new Wt(s3.file, { fd: i, start: e });
|
|
10594
|
-
t.pipe(n),
|
|
10639
|
+
t.pipe(n), bo(t, r);
|
|
10595
10640
|
};
|
|
10596
|
-
var
|
|
10641
|
+
var go = (s3, t) => {
|
|
10597
10642
|
t = Array.from(t);
|
|
10598
|
-
let e = new wt(s3), i = (n, o,
|
|
10599
|
-
let
|
|
10600
|
-
T ? v.close(n, (E) =>
|
|
10643
|
+
let e = new wt(s3), i = (n, o, h) => {
|
|
10644
|
+
let a = (T, D) => {
|
|
10645
|
+
T ? v.close(n, (E) => h(T)) : h(null, D);
|
|
10601
10646
|
}, l = 0;
|
|
10602
|
-
if (o === 0) return
|
|
10603
|
-
let c = 0, d = Buffer.alloc(512), S = (T,
|
|
10604
|
-
if (T ||
|
|
10605
|
-
if (c +=
|
|
10606
|
-
if (l === 0 && d[0] === 31 && d[1] === 139) return
|
|
10607
|
-
if (c < 512) return
|
|
10608
|
-
let E = new
|
|
10609
|
-
if (!E.cksumValid) return
|
|
10647
|
+
if (o === 0) return a(null, 0);
|
|
10648
|
+
let c = 0, d = Buffer.alloc(512), S = (T, D) => {
|
|
10649
|
+
if (T || D === void 0) return a(T);
|
|
10650
|
+
if (c += D, c < 512 && D) return v.read(n, d, c, d.length - c, l + c, S);
|
|
10651
|
+
if (l === 0 && d[0] === 31 && d[1] === 139) return a(new Error("cannot append to compressed archives"));
|
|
10652
|
+
if (c < 512) return a(null, l);
|
|
10653
|
+
let E = new F(d);
|
|
10654
|
+
if (!E.cksumValid) return a(null, l);
|
|
10610
10655
|
let x = 512 * Math.ceil((E.size ?? 0) / 512);
|
|
10611
|
-
if (l + x + 512 > o || (l += x + 512, l >= o)) return
|
|
10656
|
+
if (l + x + 512 > o || (l += x + 512, l >= o)) return a(null, l);
|
|
10612
10657
|
s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c = 0, v.read(n, d, 0, 512, l, S);
|
|
10613
10658
|
};
|
|
10614
10659
|
v.read(n, d, 0, 512, l, S);
|
|
10615
10660
|
};
|
|
10616
10661
|
return new Promise((n, o) => {
|
|
10617
10662
|
e.on("error", o);
|
|
10618
|
-
let
|
|
10619
|
-
if (l && l.code === "ENOENT" &&
|
|
10663
|
+
let h = "r+", a = (l, c) => {
|
|
10664
|
+
if (l && l.code === "ENOENT" && h === "r+") return h = "w+", v.open(s3.file, h, a);
|
|
10620
10665
|
if (l || !c) return o(l);
|
|
10621
10666
|
v.fstat(c, (d, S) => {
|
|
10622
10667
|
if (d) return v.close(c, () => o(d));
|
|
10623
|
-
i(c, S.size, (T,
|
|
10668
|
+
i(c, S.size, (T, D) => {
|
|
10624
10669
|
if (T) return o(T);
|
|
10625
|
-
let E = new
|
|
10626
|
-
e.pipe(E), E.on("error", o), E.on("close", n),
|
|
10670
|
+
let E = new et(s3.file, { fd: c, start: D });
|
|
10671
|
+
e.pipe(E), E.on("error", o), E.on("close", n), _o(e, t);
|
|
10627
10672
|
});
|
|
10628
10673
|
});
|
|
10629
10674
|
};
|
|
10630
|
-
v.open(s3.file,
|
|
10675
|
+
v.open(s3.file, h, a);
|
|
10631
10676
|
});
|
|
10632
10677
|
};
|
|
10633
|
-
var
|
|
10678
|
+
var bo = (s3, t) => {
|
|
10634
10679
|
t.forEach((e) => {
|
|
10635
|
-
e.charAt(0) === "@" ?
|
|
10680
|
+
e.charAt(0) === "@" ? Ct({ file: Pr.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
|
|
10636
10681
|
}), s3.end();
|
|
10637
10682
|
};
|
|
10638
|
-
var
|
|
10639
|
-
for (let e of t) e.charAt(0) === "@" ? await
|
|
10683
|
+
var _o = async (s3, t) => {
|
|
10684
|
+
for (let e of t) e.charAt(0) === "@" ? await Ct({ file: Pr.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
|
|
10640
10685
|
s3.end();
|
|
10641
10686
|
};
|
|
10642
|
-
var vt = K(
|
|
10687
|
+
var vt = K(yo, go, () => {
|
|
10643
10688
|
throw new TypeError("file is required");
|
|
10644
10689
|
}, () => {
|
|
10645
10690
|
throw new TypeError("file is required");
|
|
10646
10691
|
}, (s3, t) => {
|
|
10647
|
-
if (!
|
|
10692
|
+
if (!Bs(s3)) throw new TypeError("file is required");
|
|
10648
10693
|
if (s3.gzip || s3.brotli || s3.zstd || s3.file.endsWith(".br") || s3.file.endsWith(".tbr")) throw new TypeError("cannot append to compressed archives");
|
|
10649
10694
|
if (!t?.length) throw new TypeError("no paths specified to add/replace");
|
|
10650
10695
|
});
|
|
10651
|
-
var
|
|
10652
|
-
vt.validate?.(s3, t),
|
|
10696
|
+
var Oo = K(vt.syncFile, vt.asyncFile, vt.syncNoFile, vt.asyncNoFile, (s3, t = []) => {
|
|
10697
|
+
vt.validate?.(s3, t), To(s3);
|
|
10653
10698
|
});
|
|
10654
|
-
var
|
|
10699
|
+
var To = (s3) => {
|
|
10655
10700
|
let t = s3.filter;
|
|
10656
10701
|
s3.mtimeCache || (s3.mtimeCache = /* @__PURE__ */ new Map()), s3.filter = t ? (e, i) => t(e, i) && !((s3.mtimeCache?.get(e) ?? i.mtime ?? 0) > (i.mtime ?? 0)) : (e, i) => !((s3.mtimeCache?.get(e) ?? i.mtime ?? 0) > (i.mtime ?? 0));
|
|
10657
10702
|
};
|
|
@@ -10663,7 +10708,7 @@ function normalize(filename2) {
|
|
|
10663
10708
|
}
|
|
10664
10709
|
async function getFileList(filename2) {
|
|
10665
10710
|
const entries = [];
|
|
10666
|
-
await
|
|
10711
|
+
await Ct({
|
|
10667
10712
|
file: filename2,
|
|
10668
10713
|
strict: true,
|
|
10669
10714
|
onReadEntry(entry) {
|
|
@@ -10678,7 +10723,7 @@ async function getFileList(filename2) {
|
|
|
10678
10723
|
async function getFileContent(tarball, filenames) {
|
|
10679
10724
|
const contents = {};
|
|
10680
10725
|
return new Promise((resolve, reject) => {
|
|
10681
|
-
const t = new
|
|
10726
|
+
const t = new rt({
|
|
10682
10727
|
filter(path8) {
|
|
10683
10728
|
return filenames.includes(normalize(path8));
|
|
10684
10729
|
}
|
|
@@ -10993,7 +11038,7 @@ var escapeArgument = (argument) => escapeFile(escapeFile(`"${argument.replaceAll
|
|
|
10993
11038
|
var escapeFile = (file) => file.replaceAll(/([()\][%!^"`<>&|;, *?])/g, "^$1");
|
|
10994
11039
|
|
|
10995
11040
|
// node_modules/nano-spawn/source/result.js
|
|
10996
|
-
import { once, on
|
|
11041
|
+
import { once, on } from "node:events";
|
|
10997
11042
|
import process6 from "node:process";
|
|
10998
11043
|
var getResult = async (nodeChildProcess, options, context) => {
|
|
10999
11044
|
const instance = await nodeChildProcess;
|
|
@@ -11014,7 +11059,7 @@ var getResult = async (nodeChildProcess, options, context) => {
|
|
|
11014
11059
|
}
|
|
11015
11060
|
};
|
|
11016
11061
|
var onStreamError = async (stream) => {
|
|
11017
|
-
for await (const [error] of
|
|
11062
|
+
for await (const [error] of on(stream, "error")) {
|
|
11018
11063
|
if (!["ERR_STREAM_PREMATURE_CLOSE", "EPIPE"].includes(error?.code)) {
|
|
11019
11064
|
throw error;
|
|
11020
11065
|
}
|
|
@@ -11480,17 +11525,21 @@ function* validateOrder2(pkgAst, value, path8) {
|
|
|
11480
11525
|
const keys = Object.keys(value);
|
|
11481
11526
|
if (keys.includes("require")) {
|
|
11482
11527
|
for (const esm of ["import", "module"]) {
|
|
11483
|
-
if (keys.includes(esm)
|
|
11484
|
-
|
|
11485
|
-
const property = path8.map((it2) => `["${it2}"]`).join("");
|
|
11486
|
-
yield {
|
|
11487
|
-
ruleId: ruleId5,
|
|
11488
|
-
severity: severity3,
|
|
11489
|
-
message: `"${esm}" must come before "require" in "exports${property}"`,
|
|
11490
|
-
line,
|
|
11491
|
-
column
|
|
11492
|
-
};
|
|
11528
|
+
if (!keys.includes(esm)) {
|
|
11529
|
+
continue;
|
|
11493
11530
|
}
|
|
11531
|
+
if (keys.indexOf(esm) <= keys.indexOf("require")) {
|
|
11532
|
+
continue;
|
|
11533
|
+
}
|
|
11534
|
+
const { line, column } = jsonLocation(pkgAst, "member", "exports", ...path8, esm);
|
|
11535
|
+
const property = path8.map((it2) => `["${it2}"]`).join("");
|
|
11536
|
+
yield {
|
|
11537
|
+
ruleId: ruleId5,
|
|
11538
|
+
severity: severity3,
|
|
11539
|
+
message: `"${esm}" must come before "require" in "exports${property}"`,
|
|
11540
|
+
line,
|
|
11541
|
+
column
|
|
11542
|
+
};
|
|
11494
11543
|
}
|
|
11495
11544
|
}
|
|
11496
11545
|
for (const key of keys) {
|
|
@@ -11886,7 +11935,8 @@ async function* getDeepDependencies(pkg, visited, dependency) {
|
|
|
11886
11935
|
if (!pkgData) {
|
|
11887
11936
|
return;
|
|
11888
11937
|
}
|
|
11889
|
-
|
|
11938
|
+
const { dependencies = {} } = pkgData;
|
|
11939
|
+
for (let [key, version2] of Object.entries(dependencies)) {
|
|
11890
11940
|
if (version2.startsWith("npm:")) {
|
|
11891
11941
|
const [newKey, newVersion] = version2.slice("npm:".length).split("@", 2);
|
|
11892
11942
|
key = newKey;
|