create-tldraw 4.6.0-next.fecc64eee134 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/main.cjs +624 -630
- package/dist-cjs/main.cjs.map +3 -3
- package/package.json +3 -3
package/dist-cjs/main.cjs
CHANGED
|
@@ -768,7 +768,7 @@ var import_path = require("path");
|
|
|
768
768
|
var import_events2 = require("events");
|
|
769
769
|
var import_assert = __toESM(require("assert"), 1);
|
|
770
770
|
var import_buffer = require("buffer");
|
|
771
|
-
var
|
|
771
|
+
var ks = __toESM(require("zlib"), 1);
|
|
772
772
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
773
773
|
var import_node_path2 = require("node:path");
|
|
774
774
|
var import_node_path3 = require("node:path");
|
|
@@ -791,51 +791,51 @@ var import_node_path7 = __toESM(require("node:path"), 1);
|
|
|
791
791
|
var import_node_path8 = require("node:path");
|
|
792
792
|
var import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
793
793
|
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
794
|
-
var
|
|
795
|
-
var
|
|
796
|
-
for (var e2 in t)
|
|
794
|
+
var kr = Object.defineProperty;
|
|
795
|
+
var vr = (s3, t) => {
|
|
796
|
+
for (var e2 in t) kr(s3, e2, { get: t[e2], enumerable: true });
|
|
797
797
|
};
|
|
798
|
-
var
|
|
799
|
-
var
|
|
800
|
-
var
|
|
801
|
-
var
|
|
798
|
+
var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
799
|
+
var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D2 || s3 instanceof import_node_stream.default || Pr(s3) || zr(s3));
|
|
800
|
+
var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== import_node_stream.default.Writable.prototype.pipe;
|
|
801
|
+
var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
|
|
802
802
|
var q3 = /* @__PURE__ */ Symbol("EOF");
|
|
803
803
|
var j2 = /* @__PURE__ */ Symbol("maybeEmitEnd");
|
|
804
804
|
var rt = /* @__PURE__ */ Symbol("emittedEnd");
|
|
805
|
-
var
|
|
805
|
+
var Le = /* @__PURE__ */ Symbol("emittingEnd");
|
|
806
806
|
var jt = /* @__PURE__ */ Symbol("emittedError");
|
|
807
|
-
var
|
|
808
|
-
var
|
|
809
|
-
var
|
|
810
|
-
var
|
|
807
|
+
var Ne = /* @__PURE__ */ Symbol("closed");
|
|
808
|
+
var Ts = /* @__PURE__ */ Symbol("read");
|
|
809
|
+
var Ae = /* @__PURE__ */ Symbol("flush");
|
|
810
|
+
var xs = /* @__PURE__ */ Symbol("flushChunk");
|
|
811
811
|
var z2 = /* @__PURE__ */ Symbol("encoding");
|
|
812
812
|
var Mt = /* @__PURE__ */ Symbol("decoder");
|
|
813
813
|
var b3 = /* @__PURE__ */ Symbol("flowing");
|
|
814
814
|
var Qt = /* @__PURE__ */ Symbol("paused");
|
|
815
815
|
var Bt = /* @__PURE__ */ Symbol("resume");
|
|
816
|
-
var
|
|
817
|
-
var
|
|
818
|
-
var
|
|
819
|
-
var
|
|
816
|
+
var _2 = /* @__PURE__ */ Symbol("buffer");
|
|
817
|
+
var A2 = /* @__PURE__ */ Symbol("pipes");
|
|
818
|
+
var g = /* @__PURE__ */ Symbol("bufferLength");
|
|
819
|
+
var yi = /* @__PURE__ */ Symbol("bufferPush");
|
|
820
820
|
var De = /* @__PURE__ */ Symbol("bufferShift");
|
|
821
821
|
var L3 = /* @__PURE__ */ Symbol("objectMode");
|
|
822
822
|
var w = /* @__PURE__ */ Symbol("destroyed");
|
|
823
|
-
var
|
|
824
|
-
var
|
|
825
|
-
var
|
|
826
|
-
var
|
|
823
|
+
var Ri = /* @__PURE__ */ Symbol("error");
|
|
824
|
+
var bi = /* @__PURE__ */ Symbol("emitData");
|
|
825
|
+
var Ls = /* @__PURE__ */ Symbol("emitEnd");
|
|
826
|
+
var _i = /* @__PURE__ */ Symbol("emitEnd2");
|
|
827
827
|
var Z2 = /* @__PURE__ */ Symbol("async");
|
|
828
828
|
var gi = /* @__PURE__ */ Symbol("abort");
|
|
829
|
-
var
|
|
829
|
+
var Ie = /* @__PURE__ */ Symbol("aborted");
|
|
830
830
|
var Jt = /* @__PURE__ */ Symbol("signal");
|
|
831
831
|
var yt = /* @__PURE__ */ Symbol("dataListeners");
|
|
832
832
|
var C3 = /* @__PURE__ */ Symbol("discarded");
|
|
833
833
|
var te = (s3) => Promise.resolve().then(s3);
|
|
834
|
-
var
|
|
835
|
-
var
|
|
836
|
-
var
|
|
837
|
-
var
|
|
838
|
-
var
|
|
834
|
+
var Ur = (s3) => s3();
|
|
835
|
+
var Hr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
|
|
836
|
+
var Wr = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
|
|
837
|
+
var Gr = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
|
|
838
|
+
var Ce = class {
|
|
839
839
|
src;
|
|
840
840
|
dest;
|
|
841
841
|
opts;
|
|
@@ -852,7 +852,7 @@ var Ie = class {
|
|
|
852
852
|
this.unpipe(), this.opts.end && this.dest.end();
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
|
-
var
|
|
855
|
+
var Oi = class extends Ce {
|
|
856
856
|
unpipe() {
|
|
857
857
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
858
858
|
}
|
|
@@ -860,26 +860,26 @@ var _i = class extends Ie {
|
|
|
860
860
|
super(t, e2, i), this.proxyErrors = (r) => this.dest.emit("error", r), t.on("error", this.proxyErrors);
|
|
861
861
|
}
|
|
862
862
|
};
|
|
863
|
-
var
|
|
864
|
-
var
|
|
865
|
-
var
|
|
863
|
+
var Zr = (s3) => !!s3.objectMode;
|
|
864
|
+
var Yr = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
|
|
865
|
+
var D2 = class extends import_node_events.EventEmitter {
|
|
866
866
|
[b3] = false;
|
|
867
867
|
[Qt] = false;
|
|
868
|
-
[
|
|
869
|
-
[
|
|
868
|
+
[A2] = [];
|
|
869
|
+
[_2] = [];
|
|
870
870
|
[L3];
|
|
871
871
|
[z2];
|
|
872
872
|
[Z2];
|
|
873
873
|
[Mt];
|
|
874
874
|
[q3] = false;
|
|
875
875
|
[rt] = false;
|
|
876
|
-
[xe] = false;
|
|
877
876
|
[Le] = false;
|
|
877
|
+
[Ne] = false;
|
|
878
878
|
[jt] = null;
|
|
879
|
-
[
|
|
879
|
+
[g] = 0;
|
|
880
880
|
[w] = false;
|
|
881
881
|
[Jt];
|
|
882
|
-
[
|
|
882
|
+
[Ie] = false;
|
|
883
883
|
[yt] = 0;
|
|
884
884
|
[C3] = false;
|
|
885
885
|
writable = true;
|
|
@@ -887,12 +887,12 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
887
887
|
constructor(...t) {
|
|
888
888
|
let e2 = t[0] || {};
|
|
889
889
|
if (super(), e2.objectMode && typeof e2.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
890
|
-
|
|
890
|
+
Zr(e2) ? (this[L3] = true, this[z2] = null) : Yr(e2) ? (this[z2] = e2.encoding, this[L3] = false) : (this[L3] = false, this[z2] = null), this[Z2] = !!e2.async, this[Mt] = this[z2] ? new import_node_string_decoder.StringDecoder(this[z2]) : null, e2 && e2.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[_2] }), e2 && e2.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[A2] });
|
|
891
891
|
let { signal: i } = e2;
|
|
892
892
|
i && (this[Jt] = i, i.aborted ? this[gi]() : i.addEventListener("abort", () => this[gi]()));
|
|
893
893
|
}
|
|
894
894
|
get bufferLength() {
|
|
895
|
-
return this[
|
|
895
|
+
return this[g];
|
|
896
896
|
}
|
|
897
897
|
get encoding() {
|
|
898
898
|
return this[z2];
|
|
@@ -916,46 +916,46 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
916
916
|
this[Z2] = this[Z2] || !!t;
|
|
917
917
|
}
|
|
918
918
|
[gi]() {
|
|
919
|
-
this[
|
|
919
|
+
this[Ie] = true, this.emit("abort", this[Jt]?.reason), this.destroy(this[Jt]?.reason);
|
|
920
920
|
}
|
|
921
921
|
get aborted() {
|
|
922
|
-
return this[
|
|
922
|
+
return this[Ie];
|
|
923
923
|
}
|
|
924
924
|
set aborted(t) {
|
|
925
925
|
}
|
|
926
926
|
write(t, e2, i) {
|
|
927
|
-
if (this[
|
|
927
|
+
if (this[Ie]) return false;
|
|
928
928
|
if (this[q3]) throw new Error("write after end");
|
|
929
929
|
if (this[w]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
930
930
|
typeof e2 == "function" && (i = e2, e2 = "utf8"), e2 || (e2 = "utf8");
|
|
931
|
-
let r = this[Z2] ? te :
|
|
931
|
+
let r = this[Z2] ? te : Ur;
|
|
932
932
|
if (!this[L3] && !Buffer.isBuffer(t)) {
|
|
933
|
-
if (
|
|
934
|
-
else if (
|
|
933
|
+
if (Gr(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
934
|
+
else if (Wr(t)) t = Buffer.from(t);
|
|
935
935
|
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
936
936
|
}
|
|
937
|
-
return this[L3] ? (this[b3] && this[
|
|
937
|
+
return this[L3] ? (this[b3] && this[g] !== 0 && this[Ae](true), this[b3] ? this.emit("data", t) : this[yi](t), this[g] !== 0 && this.emit("readable"), i && r(i), this[b3]) : t.length ? (typeof t == "string" && !(e2 === this[z2] && !this[Mt]?.lastNeed) && (t = Buffer.from(t, e2)), Buffer.isBuffer(t) && this[z2] && (t = this[Mt].write(t)), this[b3] && this[g] !== 0 && this[Ae](true), this[b3] ? this.emit("data", t) : this[yi](t), this[g] !== 0 && this.emit("readable"), i && r(i), this[b3]) : (this[g] !== 0 && this.emit("readable"), i && r(i), this[b3]);
|
|
938
938
|
}
|
|
939
939
|
read(t) {
|
|
940
940
|
if (this[w]) return null;
|
|
941
|
-
if (this[C3] = false, this[
|
|
942
|
-
this[L3] && (t = null), this[
|
|
943
|
-
let e2 = this[
|
|
941
|
+
if (this[C3] = false, this[g] === 0 || t === 0 || t && t > this[g]) return this[j2](), null;
|
|
942
|
+
this[L3] && (t = null), this[_2].length > 1 && !this[L3] && (this[_2] = [this[z2] ? this[_2].join("") : Buffer.concat(this[_2], this[g])]);
|
|
943
|
+
let e2 = this[Ts](t || null, this[_2][0]);
|
|
944
944
|
return this[j2](), e2;
|
|
945
945
|
}
|
|
946
|
-
[
|
|
946
|
+
[Ts](t, e2) {
|
|
947
947
|
if (this[L3]) this[De]();
|
|
948
948
|
else {
|
|
949
949
|
let i = e2;
|
|
950
|
-
t === i.length || t === null ? this[De]() : typeof i == "string" ? (this[
|
|
950
|
+
t === i.length || t === null ? this[De]() : typeof i == "string" ? (this[_2][0] = i.slice(t), e2 = i.slice(0, t), this[g] -= t) : (this[_2][0] = i.subarray(t), e2 = i.subarray(0, t), this[g] -= t);
|
|
951
951
|
}
|
|
952
|
-
return this.emit("data", e2), !this[
|
|
952
|
+
return this.emit("data", e2), !this[_2].length && !this[q3] && this.emit("drain"), e2;
|
|
953
953
|
}
|
|
954
954
|
end(t, e2, i) {
|
|
955
955
|
return typeof t == "function" && (i = t, t = void 0), typeof e2 == "function" && (i = e2, e2 = "utf8"), t !== void 0 && this.write(t, e2), i && this.once("end", i), this[q3] = true, this.writable = false, (this[b3] || !this[Qt]) && this[j2](), this;
|
|
956
956
|
}
|
|
957
957
|
[Bt]() {
|
|
958
|
-
this[w] || (!this[yt] && !this[
|
|
958
|
+
this[w] || (!this[yt] && !this[A2].length && (this[C3] = true), this[Qt] = false, this[b3] = true, this.emit("resume"), this[_2].length ? this[Ae]() : this[q3] ? this[j2]() : this.emit("drain"));
|
|
959
959
|
}
|
|
960
960
|
resume() {
|
|
961
961
|
return this[Bt]();
|
|
@@ -972,39 +972,39 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
972
972
|
get paused() {
|
|
973
973
|
return this[Qt];
|
|
974
974
|
}
|
|
975
|
-
[
|
|
976
|
-
this[L3] ? this[
|
|
975
|
+
[yi](t) {
|
|
976
|
+
this[L3] ? this[g] += 1 : this[g] += t.length, this[_2].push(t);
|
|
977
977
|
}
|
|
978
978
|
[De]() {
|
|
979
|
-
return this[L3] ? this[
|
|
979
|
+
return this[L3] ? this[g] -= 1 : this[g] -= this[_2][0].length, this[_2].shift();
|
|
980
980
|
}
|
|
981
|
-
[
|
|
981
|
+
[Ae](t = false) {
|
|
982
982
|
do
|
|
983
983
|
;
|
|
984
|
-
while (this[
|
|
985
|
-
!t && !this[
|
|
984
|
+
while (this[xs](this[De]()) && this[_2].length);
|
|
985
|
+
!t && !this[_2].length && !this[q3] && this.emit("drain");
|
|
986
986
|
}
|
|
987
|
-
[
|
|
987
|
+
[xs](t) {
|
|
988
988
|
return this.emit("data", t), this[b3];
|
|
989
989
|
}
|
|
990
990
|
pipe(t, e2) {
|
|
991
991
|
if (this[w]) return t;
|
|
992
992
|
this[C3] = false;
|
|
993
993
|
let i = this[rt];
|
|
994
|
-
return e2 = e2 || {}, t ===
|
|
994
|
+
return e2 = e2 || {}, t === Os.stdout || t === Os.stderr ? e2.end = false : e2.end = e2.end !== false, e2.proxyErrors = !!e2.proxyErrors, i ? e2.end && t.end() : (this[A2].push(e2.proxyErrors ? new Oi(this, t, e2) : new Ce(this, t, e2)), this[Z2] ? te(() => this[Bt]()) : this[Bt]()), t;
|
|
995
995
|
}
|
|
996
996
|
unpipe(t) {
|
|
997
|
-
let e2 = this[
|
|
998
|
-
e2 && (this[
|
|
997
|
+
let e2 = this[A2].find((i) => i.dest === t);
|
|
998
|
+
e2 && (this[A2].length === 1 ? (this[b3] && this[yt] === 0 && (this[b3] = false), this[A2] = []) : this[A2].splice(this[A2].indexOf(e2), 1), e2.unpipe());
|
|
999
999
|
}
|
|
1000
1000
|
addListener(t, e2) {
|
|
1001
1001
|
return this.on(t, e2);
|
|
1002
1002
|
}
|
|
1003
1003
|
on(t, e2) {
|
|
1004
1004
|
let i = super.on(t, e2);
|
|
1005
|
-
if (t === "data") this[C3] = false, this[yt]++, !this[
|
|
1006
|
-
else if (t === "readable" && this[
|
|
1007
|
-
else if (
|
|
1005
|
+
if (t === "data") this[C3] = false, this[yt]++, !this[A2].length && !this[b3] && this[Bt]();
|
|
1006
|
+
else if (t === "readable" && this[g] !== 0) super.emit("readable");
|
|
1007
|
+
else if (Hr(t) && this[rt]) super.emit(t), this.removeAllListeners(t);
|
|
1008
1008
|
else if (t === "error" && this[jt]) {
|
|
1009
1009
|
let r = e2;
|
|
1010
1010
|
this[Z2] ? te(() => r.call(this, this[jt])) : r.call(this, this[jt]);
|
|
@@ -1016,29 +1016,29 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
off(t, e2) {
|
|
1018
1018
|
let i = super.off(t, e2);
|
|
1019
|
-
return t === "data" && (this[yt] = this.listeners("data").length, this[yt] === 0 && !this[C3] && !this[
|
|
1019
|
+
return t === "data" && (this[yt] = this.listeners("data").length, this[yt] === 0 && !this[C3] && !this[A2].length && (this[b3] = false)), i;
|
|
1020
1020
|
}
|
|
1021
1021
|
removeAllListeners(t) {
|
|
1022
1022
|
let e2 = super.removeAllListeners(t);
|
|
1023
|
-
return (t === "data" || t === void 0) && (this[yt] = 0, !this[C3] && !this[
|
|
1023
|
+
return (t === "data" || t === void 0) && (this[yt] = 0, !this[C3] && !this[A2].length && (this[b3] = false)), e2;
|
|
1024
1024
|
}
|
|
1025
1025
|
get emittedEnd() {
|
|
1026
1026
|
return this[rt];
|
|
1027
1027
|
}
|
|
1028
1028
|
[j2]() {
|
|
1029
|
-
!this[
|
|
1029
|
+
!this[Le] && !this[rt] && !this[w] && this[_2].length === 0 && this[q3] && (this[Le] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Ne] && this.emit("close"), this[Le] = false);
|
|
1030
1030
|
}
|
|
1031
1031
|
emit(t, ...e2) {
|
|
1032
1032
|
let i = e2[0];
|
|
1033
1033
|
if (t !== "error" && t !== "close" && t !== w && this[w]) return false;
|
|
1034
|
-
if (t === "data") return !this[L3] && !i ? false : this[Z2] ? (te(() => this[
|
|
1035
|
-
if (t === "end") return this[
|
|
1034
|
+
if (t === "data") return !this[L3] && !i ? false : this[Z2] ? (te(() => this[bi](i)), true) : this[bi](i);
|
|
1035
|
+
if (t === "end") return this[Ls]();
|
|
1036
1036
|
if (t === "close") {
|
|
1037
|
-
if (this[
|
|
1037
|
+
if (this[Ne] = true, !this[rt] && !this[w]) return false;
|
|
1038
1038
|
let n = super.emit("close");
|
|
1039
1039
|
return this.removeAllListeners("close"), n;
|
|
1040
1040
|
} else if (t === "error") {
|
|
1041
|
-
this[jt] = i, super.emit(
|
|
1041
|
+
this[jt] = i, super.emit(Ri, i);
|
|
1042
1042
|
let n = !this[Jt] || this.listeners("error").length ? super.emit("error", i) : false;
|
|
1043
1043
|
return this[j2](), n;
|
|
1044
1044
|
} else if (t === "resume") {
|
|
@@ -1051,23 +1051,23 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
1051
1051
|
let r = super.emit(t, ...e2);
|
|
1052
1052
|
return this[j2](), r;
|
|
1053
1053
|
}
|
|
1054
|
-
[
|
|
1055
|
-
for (let i of this[
|
|
1054
|
+
[bi](t) {
|
|
1055
|
+
for (let i of this[A2]) i.dest.write(t) === false && this.pause();
|
|
1056
1056
|
let e2 = this[C3] ? false : super.emit("data", t);
|
|
1057
1057
|
return this[j2](), e2;
|
|
1058
1058
|
}
|
|
1059
|
-
[
|
|
1060
|
-
return this[rt] ? false : (this[rt] = true, this.readable = false, this[Z2] ? (te(() => this[
|
|
1059
|
+
[Ls]() {
|
|
1060
|
+
return this[rt] ? false : (this[rt] = true, this.readable = false, this[Z2] ? (te(() => this[_i]()), true) : this[_i]());
|
|
1061
1061
|
}
|
|
1062
|
-
[
|
|
1062
|
+
[_i]() {
|
|
1063
1063
|
if (this[Mt]) {
|
|
1064
1064
|
let e2 = this[Mt].end();
|
|
1065
1065
|
if (e2) {
|
|
1066
|
-
for (let i of this[
|
|
1066
|
+
for (let i of this[A2]) i.dest.write(e2);
|
|
1067
1067
|
this[C3] || super.emit("data", e2);
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
for (let e2 of this[
|
|
1070
|
+
for (let e2 of this[A2]) e2.end();
|
|
1071
1071
|
let t = super.emit("end");
|
|
1072
1072
|
return this.removeAllListeners("end"), t;
|
|
1073
1073
|
}
|
|
@@ -1114,67 +1114,67 @@ var A2 = class extends import_node_events.EventEmitter {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
[Symbol.iterator]() {
|
|
1116
1116
|
this[C3] = false;
|
|
1117
|
-
let t = false, e2 = () => (this.pause(), this.off(
|
|
1117
|
+
let t = false, e2 = () => (this.pause(), this.off(Ri, e2), this.off(w, e2), this.off("end", e2), t = true, { done: true, value: void 0 }), i = () => {
|
|
1118
1118
|
if (t) return e2();
|
|
1119
1119
|
let r = this.read();
|
|
1120
1120
|
return r === null ? e2() : { done: false, value: r };
|
|
1121
1121
|
};
|
|
1122
|
-
return this.once("end", e2), this.once(
|
|
1122
|
+
return this.once("end", e2), this.once(Ri, e2), this.once(w, e2), { next: i, throw: e2, return: e2, [Symbol.iterator]() {
|
|
1123
1123
|
return this;
|
|
1124
1124
|
}, [Symbol.dispose]: () => {
|
|
1125
1125
|
} };
|
|
1126
1126
|
}
|
|
1127
1127
|
destroy(t) {
|
|
1128
1128
|
if (this[w]) return t ? this.emit("error", t) : this.emit(w), this;
|
|
1129
|
-
this[w] = true, this[C3] = true, this[
|
|
1129
|
+
this[w] = true, this[C3] = true, this[_2].length = 0, this[g] = 0;
|
|
1130
1130
|
let e2 = this;
|
|
1131
|
-
return typeof e2.close == "function" && !this[
|
|
1131
|
+
return typeof e2.close == "function" && !this[Ne] && e2.close(), t ? this.emit("error", t) : this.emit(w), this;
|
|
1132
1132
|
}
|
|
1133
1133
|
static get isStream() {
|
|
1134
|
-
return
|
|
1134
|
+
return Br;
|
|
1135
1135
|
}
|
|
1136
1136
|
};
|
|
1137
|
-
var
|
|
1137
|
+
var Vr = import_fs.default.writev;
|
|
1138
1138
|
var ot = /* @__PURE__ */ Symbol("_autoClose");
|
|
1139
1139
|
var H3 = /* @__PURE__ */ Symbol("_close");
|
|
1140
1140
|
var ee = /* @__PURE__ */ Symbol("_ended");
|
|
1141
1141
|
var m2 = /* @__PURE__ */ Symbol("_fd");
|
|
1142
|
-
var
|
|
1142
|
+
var xi = /* @__PURE__ */ Symbol("_finished");
|
|
1143
1143
|
var J3 = /* @__PURE__ */ Symbol("_flags");
|
|
1144
|
-
var
|
|
1145
|
-
var
|
|
1146
|
-
var
|
|
1144
|
+
var Li = /* @__PURE__ */ Symbol("_flush");
|
|
1145
|
+
var Ii = /* @__PURE__ */ Symbol("_handleChunk");
|
|
1146
|
+
var Ci = /* @__PURE__ */ Symbol("_makeBuf");
|
|
1147
1147
|
var se = /* @__PURE__ */ Symbol("_mode");
|
|
1148
|
-
var
|
|
1148
|
+
var Fe2 = /* @__PURE__ */ Symbol("_needDrain");
|
|
1149
1149
|
var Ut = /* @__PURE__ */ Symbol("_onerror");
|
|
1150
1150
|
var Ht = /* @__PURE__ */ Symbol("_onopen");
|
|
1151
|
-
var
|
|
1151
|
+
var Ni = /* @__PURE__ */ Symbol("_onread");
|
|
1152
1152
|
var Pt = /* @__PURE__ */ Symbol("_onwrite");
|
|
1153
1153
|
var ht = /* @__PURE__ */ Symbol("_open");
|
|
1154
1154
|
var U3 = /* @__PURE__ */ Symbol("_path");
|
|
1155
1155
|
var nt = /* @__PURE__ */ Symbol("_pos");
|
|
1156
1156
|
var Y2 = /* @__PURE__ */ Symbol("_queue");
|
|
1157
1157
|
var zt = /* @__PURE__ */ Symbol("_read");
|
|
1158
|
-
var
|
|
1158
|
+
var Ai = /* @__PURE__ */ Symbol("_readSize");
|
|
1159
1159
|
var Q2 = /* @__PURE__ */ Symbol("_reading");
|
|
1160
1160
|
var ie2 = /* @__PURE__ */ Symbol("_remain");
|
|
1161
1161
|
var Di = /* @__PURE__ */ Symbol("_size");
|
|
1162
|
-
var
|
|
1162
|
+
var ke = /* @__PURE__ */ Symbol("_write");
|
|
1163
1163
|
var Rt = /* @__PURE__ */ Symbol("_writing");
|
|
1164
|
-
var
|
|
1164
|
+
var ve = /* @__PURE__ */ Symbol("_defaultFlag");
|
|
1165
1165
|
var bt = /* @__PURE__ */ Symbol("_errored");
|
|
1166
|
-
var
|
|
1166
|
+
var _t = class extends D2 {
|
|
1167
1167
|
[bt] = false;
|
|
1168
1168
|
[m2];
|
|
1169
1169
|
[U3];
|
|
1170
|
-
[
|
|
1170
|
+
[Ai];
|
|
1171
1171
|
[Q2] = false;
|
|
1172
1172
|
[Di];
|
|
1173
1173
|
[ie2];
|
|
1174
1174
|
[ot];
|
|
1175
1175
|
constructor(t, e2) {
|
|
1176
1176
|
if (e2 = e2 || {}, super(e2), this.readable = true, this.writable = false, typeof t != "string") throw new TypeError("path must be a string");
|
|
1177
|
-
this[bt] = false, this[m2] = typeof e2.fd == "number" ? e2.fd : void 0, this[U3] = t, this[
|
|
1177
|
+
this[bt] = false, this[m2] = typeof e2.fd == "number" ? e2.fd : void 0, this[U3] = t, this[Ai] = e2.readSize || 16 * 1024 * 1024, this[Q2] = false, this[Di] = typeof e2.size == "number" ? e2.size : 1 / 0, this[ie2] = this[Di], this[ot] = typeof e2.autoClose == "boolean" ? e2.autoClose : true, typeof this[m2] == "number" ? this[zt]() : this[ht]();
|
|
1178
1178
|
}
|
|
1179
1179
|
get fd() {
|
|
1180
1180
|
return this[m2];
|
|
@@ -1194,19 +1194,19 @@ var gt = class extends A2 {
|
|
|
1194
1194
|
[Ht](t, e2) {
|
|
1195
1195
|
t ? this[Ut](t) : (this[m2] = e2, this.emit("open", e2), this[zt]());
|
|
1196
1196
|
}
|
|
1197
|
-
[
|
|
1198
|
-
return Buffer.allocUnsafe(Math.min(this[
|
|
1197
|
+
[Ci]() {
|
|
1198
|
+
return Buffer.allocUnsafe(Math.min(this[Ai], this[ie2]));
|
|
1199
1199
|
}
|
|
1200
1200
|
[zt]() {
|
|
1201
1201
|
if (!this[Q2]) {
|
|
1202
1202
|
this[Q2] = true;
|
|
1203
|
-
let t = this[
|
|
1204
|
-
if (t.length === 0) return process.nextTick(() => this[
|
|
1205
|
-
import_fs.default.read(this[m2], t, 0, t.length, null, (e2, i, r) => this[
|
|
1203
|
+
let t = this[Ci]();
|
|
1204
|
+
if (t.length === 0) return process.nextTick(() => this[Ni](null, 0, t));
|
|
1205
|
+
import_fs.default.read(this[m2], t, 0, t.length, null, (e2, i, r) => this[Ni](e2, i, r));
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
[
|
|
1209
|
-
this[Q2] = false, t ? this[Ut](t) : this[
|
|
1208
|
+
[Ni](t, e2, i) {
|
|
1209
|
+
this[Q2] = false, t ? this[Ut](t) : this[Ii](e2, i) && this[zt]();
|
|
1210
1210
|
}
|
|
1211
1211
|
[H3]() {
|
|
1212
1212
|
if (this[ot] && typeof this[m2] == "number") {
|
|
@@ -1217,7 +1217,7 @@ var gt = class extends A2 {
|
|
|
1217
1217
|
[Ut](t) {
|
|
1218
1218
|
this[Q2] = true, this[H3](), this.emit("error", t);
|
|
1219
1219
|
}
|
|
1220
|
-
[
|
|
1220
|
+
[Ii](t, e2) {
|
|
1221
1221
|
let i = false;
|
|
1222
1222
|
return this[ie2] -= t, t > 0 && (i = super.write(t < e2.length ? e2.subarray(0, t) : e2)), (t === 0 || this[ie2] <= 0) && (i = false, this[H3](), super.end()), i;
|
|
1223
1223
|
}
|
|
@@ -1235,7 +1235,7 @@ var gt = class extends A2 {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
|
-
var
|
|
1238
|
+
var Me = class extends _t {
|
|
1239
1239
|
[ht]() {
|
|
1240
1240
|
let t = true;
|
|
1241
1241
|
try {
|
|
@@ -1250,8 +1250,8 @@ var ve = class extends gt {
|
|
|
1250
1250
|
if (!this[Q2]) {
|
|
1251
1251
|
this[Q2] = true;
|
|
1252
1252
|
do {
|
|
1253
|
-
let e2 = this[
|
|
1254
|
-
if (!this[
|
|
1253
|
+
let e2 = this[Ci](), i = e2.length === 0 ? 0 : import_fs.default.readSync(this[m2], e2, 0, e2.length, null);
|
|
1254
|
+
if (!this[Ii](i, e2)) break;
|
|
1255
1255
|
} while (true);
|
|
1256
1256
|
this[Q2] = false;
|
|
1257
1257
|
}
|
|
@@ -1274,19 +1274,19 @@ var tt = class extends import_events.default {
|
|
|
1274
1274
|
[Rt] = false;
|
|
1275
1275
|
[ee] = false;
|
|
1276
1276
|
[Y2] = [];
|
|
1277
|
-
[
|
|
1277
|
+
[Fe2] = false;
|
|
1278
1278
|
[U3];
|
|
1279
1279
|
[se];
|
|
1280
1280
|
[ot];
|
|
1281
1281
|
[m2];
|
|
1282
|
-
[
|
|
1282
|
+
[ve];
|
|
1283
1283
|
[J3];
|
|
1284
|
-
[
|
|
1284
|
+
[xi] = false;
|
|
1285
1285
|
[nt];
|
|
1286
1286
|
constructor(t, e2) {
|
|
1287
1287
|
e2 = e2 || {}, super(e2), this[U3] = t, this[m2] = typeof e2.fd == "number" ? e2.fd : void 0, this[se] = e2.mode === void 0 ? 438 : e2.mode, this[nt] = typeof e2.start == "number" ? e2.start : void 0, this[ot] = typeof e2.autoClose == "boolean" ? e2.autoClose : true;
|
|
1288
1288
|
let i = this[nt] !== void 0 ? "r+" : "w";
|
|
1289
|
-
this[
|
|
1289
|
+
this[ve] = e2.flags === void 0, this[J3] = e2.flags === void 0 ? i : e2.flags, this[m2] === void 0 && this[ht]();
|
|
1290
1290
|
}
|
|
1291
1291
|
emit(t, ...e2) {
|
|
1292
1292
|
if (t === "error") {
|
|
@@ -1308,26 +1308,26 @@ var tt = class extends import_events.default {
|
|
|
1308
1308
|
import_fs.default.open(this[U3], this[J3], this[se], (t, e2) => this[Ht](t, e2));
|
|
1309
1309
|
}
|
|
1310
1310
|
[Ht](t, e2) {
|
|
1311
|
-
this[
|
|
1311
|
+
this[ve] && this[J3] === "r+" && t && t.code === "ENOENT" ? (this[J3] = "w", this[ht]()) : t ? this[Ut](t) : (this[m2] = e2, this.emit("open", e2), this[Rt] || this[Li]());
|
|
1312
1312
|
}
|
|
1313
1313
|
end(t, e2) {
|
|
1314
1314
|
return t && this.write(t, e2), this[ee] = true, !this[Rt] && !this[Y2].length && typeof this[m2] == "number" && this[Pt](null, 0), this;
|
|
1315
1315
|
}
|
|
1316
1316
|
write(t, e2) {
|
|
1317
|
-
return typeof t == "string" && (t = Buffer.from(t, e2)), this[ee] ? (this.emit("error", new Error("write() after end()")), false) : this[m2] === void 0 || this[Rt] || this[Y2].length ? (this[Y2].push(t), this[
|
|
1317
|
+
return typeof t == "string" && (t = Buffer.from(t, e2)), this[ee] ? (this.emit("error", new Error("write() after end()")), false) : this[m2] === void 0 || this[Rt] || this[Y2].length ? (this[Y2].push(t), this[Fe2] = true, false) : (this[Rt] = true, this[ke](t), true);
|
|
1318
1318
|
}
|
|
1319
|
-
[
|
|
1319
|
+
[ke](t) {
|
|
1320
1320
|
import_fs.default.write(this[m2], t, 0, t.length, this[nt], (e2, i) => this[Pt](e2, i));
|
|
1321
1321
|
}
|
|
1322
1322
|
[Pt](t, e2) {
|
|
1323
|
-
t ? this[Ut](t) : (this[nt] !== void 0 && typeof e2 == "number" && (this[nt] += e2), this[Y2].length ? this[
|
|
1323
|
+
t ? this[Ut](t) : (this[nt] !== void 0 && typeof e2 == "number" && (this[nt] += e2), this[Y2].length ? this[Li]() : (this[Rt] = false, this[ee] && !this[xi] ? (this[xi] = true, this[H3](), this.emit("finish")) : this[Fe2] && (this[Fe2] = false, this.emit("drain"))));
|
|
1324
1324
|
}
|
|
1325
|
-
[
|
|
1325
|
+
[Li]() {
|
|
1326
1326
|
if (this[Y2].length === 0) this[ee] && this[Pt](null, 0);
|
|
1327
|
-
else if (this[Y2].length === 1) this[
|
|
1327
|
+
else if (this[Y2].length === 1) this[ke](this[Y2].pop());
|
|
1328
1328
|
else {
|
|
1329
1329
|
let t = this[Y2];
|
|
1330
|
-
this[Y2] = [],
|
|
1330
|
+
this[Y2] = [], Vr(this[m2], t, this[nt], (e2, i) => this[Pt](e2, i));
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
1333
|
[H3]() {
|
|
@@ -1340,7 +1340,7 @@ var tt = class extends import_events.default {
|
|
|
1340
1340
|
var Wt = class extends tt {
|
|
1341
1341
|
[ht]() {
|
|
1342
1342
|
let t;
|
|
1343
|
-
if (this[
|
|
1343
|
+
if (this[ve] && this[J3] === "r+") try {
|
|
1344
1344
|
t = import_fs.default.openSync(this[U3], this[J3], this[se]);
|
|
1345
1345
|
} catch (e2) {
|
|
1346
1346
|
if (e2?.code === "ENOENT") return this[J3] = "w", this[ht]();
|
|
@@ -1355,7 +1355,7 @@ var Wt = class extends tt {
|
|
|
1355
1355
|
this[m2] = void 0, import_fs.default.closeSync(t), this.emit("close");
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
[
|
|
1358
|
+
[ke](t) {
|
|
1359
1359
|
let e2 = true;
|
|
1360
1360
|
try {
|
|
1361
1361
|
this[Pt](null, import_fs.default.writeSync(this[m2], t, 0, t.length, this[nt])), e2 = false;
|
|
@@ -1367,49 +1367,50 @@ var Wt = class extends tt {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
|
-
var
|
|
1370
|
+
var $r = /* @__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"]]);
|
|
1371
1371
|
var As = (s3) => !!s3.sync && !!s3.file;
|
|
1372
|
-
var
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1375
|
-
var
|
|
1376
|
-
var
|
|
1377
|
-
let t =
|
|
1372
|
+
var Ds = (s3) => !s3.sync && !!s3.file;
|
|
1373
|
+
var Is = (s3) => !!s3.sync && !s3.file;
|
|
1374
|
+
var Cs = (s3) => !s3.sync && !s3.file;
|
|
1375
|
+
var Fs = (s3) => !!s3.file;
|
|
1376
|
+
var Xr = (s3) => {
|
|
1377
|
+
let t = $r.get(s3);
|
|
1378
1378
|
return t || s3;
|
|
1379
1379
|
};
|
|
1380
1380
|
var re = (s3 = {}) => {
|
|
1381
1381
|
if (!s3) return {};
|
|
1382
1382
|
let t = {};
|
|
1383
1383
|
for (let [e2, i] of Object.entries(s3)) {
|
|
1384
|
-
let r =
|
|
1384
|
+
let r = Xr(e2);
|
|
1385
1385
|
t[r] = i;
|
|
1386
1386
|
}
|
|
1387
1387
|
return t.chmod === void 0 && t.noChmod === false && (t.chmod = true), delete t.noChmod, t;
|
|
1388
1388
|
};
|
|
1389
1389
|
var K3 = (s3, t, e2, i, r) => Object.assign((n = [], o2, h3) => {
|
|
1390
|
-
Array.isArray(n) && (o2 = n, n = {}), typeof o2 == "function" && (h3 = o2, o2 = void 0), o2
|
|
1390
|
+
Array.isArray(n) && (o2 = n, n = {}), typeof o2 == "function" && (h3 = o2, o2 = void 0), o2 = o2 ? Array.from(o2) : [];
|
|
1391
1391
|
let a = re(n);
|
|
1392
1392
|
if (r?.(a, o2), As(a)) {
|
|
1393
1393
|
if (typeof h3 == "function") throw new TypeError("callback not supported for sync tar functions");
|
|
1394
1394
|
return s3(a, o2);
|
|
1395
|
+
} else if (Ds(a)) {
|
|
1396
|
+
let l = t(a, o2);
|
|
1397
|
+
return h3 ? l.then(() => h3(), h3) : l;
|
|
1395
1398
|
} else if (Is(a)) {
|
|
1396
|
-
let l = t(a, o2), c2 = h3 || void 0;
|
|
1397
|
-
return c2 ? l.then(() => c2(), c2) : l;
|
|
1398
|
-
} else if (Cs(a)) {
|
|
1399
1399
|
if (typeof h3 == "function") throw new TypeError("callback not supported for sync tar functions");
|
|
1400
1400
|
return e2(a, o2);
|
|
1401
|
-
} else if (
|
|
1401
|
+
} else if (Cs(a)) {
|
|
1402
1402
|
if (typeof h3 == "function") throw new TypeError("callback only supported with file option");
|
|
1403
1403
|
return i(a, o2);
|
|
1404
|
-
}
|
|
1404
|
+
}
|
|
1405
|
+
throw new Error("impossible options??");
|
|
1405
1406
|
}, { syncFile: s3, asyncFile: t, syncNoFile: e2, asyncNoFile: i, validate: r });
|
|
1406
|
-
var
|
|
1407
|
-
var M2 = 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 },
|
|
1408
|
-
var
|
|
1409
|
-
var
|
|
1410
|
-
var
|
|
1411
|
-
var
|
|
1412
|
-
import_buffer.Buffer.concat = s3 ?
|
|
1407
|
+
var jr = import_zlib.default.constants || { ZLIB_VERNUM: 4736 };
|
|
1408
|
+
var M2 = 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 }, jr));
|
|
1409
|
+
var Qr = import_buffer.Buffer.concat;
|
|
1410
|
+
var vs = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat");
|
|
1411
|
+
var Jr = (s3) => s3;
|
|
1412
|
+
var ki = vs?.writable === true || vs?.set !== void 0 ? (s3) => {
|
|
1413
|
+
import_buffer.Buffer.concat = s3 ? Jr : Qr;
|
|
1413
1414
|
} : (s3) => {
|
|
1414
1415
|
};
|
|
1415
1416
|
var Ot = /* @__PURE__ */ Symbol("_superWrite");
|
|
@@ -1423,8 +1424,8 @@ var Gt = class extends Error {
|
|
|
1423
1424
|
return "ZlibError";
|
|
1424
1425
|
}
|
|
1425
1426
|
};
|
|
1426
|
-
var
|
|
1427
|
-
var ne2 = class extends
|
|
1427
|
+
var vi = /* @__PURE__ */ Symbol("flushFlag");
|
|
1428
|
+
var ne2 = class extends D2 {
|
|
1428
1429
|
#t = false;
|
|
1429
1430
|
#i = false;
|
|
1430
1431
|
#s;
|
|
@@ -1443,9 +1444,9 @@ var ne2 = class extends A2 {
|
|
|
1443
1444
|
}
|
|
1444
1445
|
constructor(t, e2) {
|
|
1445
1446
|
if (!t || typeof t != "object") throw new TypeError("invalid options for ZlibBase constructor");
|
|
1446
|
-
if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof
|
|
1447
|
+
if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof ks[e2] != "function") throw new TypeError("Compression method not supported: " + e2);
|
|
1447
1448
|
try {
|
|
1448
|
-
this.#e = new
|
|
1449
|
+
this.#e = new ks[e2](t);
|
|
1449
1450
|
} catch (i) {
|
|
1450
1451
|
throw new Gt(i, this.constructor);
|
|
1451
1452
|
}
|
|
@@ -1460,7 +1461,7 @@ var ne2 = class extends A2 {
|
|
|
1460
1461
|
if (!this.#t) return (0, import_assert.default)(this.#e, "zlib binding closed"), this.#e.reset?.();
|
|
1461
1462
|
}
|
|
1462
1463
|
flush(t) {
|
|
1463
|
-
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(import_buffer.Buffer.alloc(0), { [
|
|
1464
|
+
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(import_buffer.Buffer.alloc(0), { [vi]: t })));
|
|
1464
1465
|
}
|
|
1465
1466
|
end(t, e2, i) {
|
|
1466
1467
|
return typeof t == "function" && (i = t, e2 = void 0, t = void 0), typeof e2 == "function" && (i = e2, e2 = void 0), t && (e2 ? this.write(t, e2) : this.write(t)), this.flush(this.#n), this.#i = true, super.end(i);
|
|
@@ -1479,13 +1480,13 @@ var ne2 = class extends A2 {
|
|
|
1479
1480
|
};
|
|
1480
1481
|
let o2 = this.#e.close;
|
|
1481
1482
|
this.#e.close = () => {
|
|
1482
|
-
},
|
|
1483
|
+
}, ki(true);
|
|
1483
1484
|
let h3;
|
|
1484
1485
|
try {
|
|
1485
|
-
let l = typeof t[
|
|
1486
|
-
h3 = this.#e._processChunk(t, l),
|
|
1486
|
+
let l = typeof t[vi] == "number" ? t[vi] : this.#s;
|
|
1487
|
+
h3 = this.#e._processChunk(t, l), ki(false);
|
|
1487
1488
|
} catch (l) {
|
|
1488
|
-
|
|
1489
|
+
ki(false), this.#o(new Gt(l, this.write));
|
|
1489
1490
|
} finally {
|
|
1490
1491
|
this.#e && (this.#e._handle = r, r.close = n, this.#e.close = o2, this.#e.removeAllListeners("error"));
|
|
1491
1492
|
}
|
|
@@ -1499,7 +1500,7 @@ var ne2 = class extends A2 {
|
|
|
1499
1500
|
return i && i(), a;
|
|
1500
1501
|
}
|
|
1501
1502
|
};
|
|
1502
|
-
var
|
|
1503
|
+
var Be = class extends ne2 {
|
|
1503
1504
|
#t;
|
|
1504
1505
|
#i;
|
|
1505
1506
|
constructor(t, e2) {
|
|
@@ -1525,7 +1526,7 @@ var Me = class extends ne2 {
|
|
|
1525
1526
|
}
|
|
1526
1527
|
}
|
|
1527
1528
|
};
|
|
1528
|
-
var
|
|
1529
|
+
var Pe2 = class extends Be {
|
|
1529
1530
|
#t;
|
|
1530
1531
|
constructor(t) {
|
|
1531
1532
|
super(t, "Gzip"), this.#t = t && !!t.portable;
|
|
@@ -1534,87 +1535,87 @@ var Be = class extends Me {
|
|
|
1534
1535
|
return this.#t ? (this.#t = false, t[9] = 255, super[Ot](t)) : super[Ot](t);
|
|
1535
1536
|
}
|
|
1536
1537
|
};
|
|
1537
|
-
var
|
|
1538
|
+
var ze = class extends Be {
|
|
1538
1539
|
constructor(t) {
|
|
1539
1540
|
super(t, "Unzip");
|
|
1540
1541
|
}
|
|
1541
1542
|
};
|
|
1542
|
-
var
|
|
1543
|
+
var Ue = class extends ne2 {
|
|
1543
1544
|
constructor(t, e2) {
|
|
1544
1545
|
t = t || {}, t.flush = t.flush || M2.BROTLI_OPERATION_PROCESS, t.finishFlush = t.finishFlush || M2.BROTLI_OPERATION_FINISH, t.fullFlushFlag = M2.BROTLI_OPERATION_FLUSH, super(t, e2);
|
|
1545
1546
|
}
|
|
1546
1547
|
};
|
|
1547
|
-
var
|
|
1548
|
+
var He = class extends Ue {
|
|
1548
1549
|
constructor(t) {
|
|
1549
1550
|
super(t, "BrotliCompress");
|
|
1550
1551
|
}
|
|
1551
1552
|
};
|
|
1552
|
-
var
|
|
1553
|
+
var We = class extends Ue {
|
|
1553
1554
|
constructor(t) {
|
|
1554
1555
|
super(t, "BrotliDecompress");
|
|
1555
1556
|
}
|
|
1556
1557
|
};
|
|
1557
|
-
var
|
|
1558
|
+
var Ge = class extends ne2 {
|
|
1558
1559
|
constructor(t, e2) {
|
|
1559
1560
|
t = t || {}, t.flush = t.flush || M2.ZSTD_e_continue, t.finishFlush = t.finishFlush || M2.ZSTD_e_end, t.fullFlushFlag = M2.ZSTD_e_flush, super(t, e2);
|
|
1560
1561
|
}
|
|
1561
1562
|
};
|
|
1562
|
-
var
|
|
1563
|
+
var Ze = class extends Ge {
|
|
1563
1564
|
constructor(t) {
|
|
1564
1565
|
super(t, "ZstdCompress");
|
|
1565
1566
|
}
|
|
1566
1567
|
};
|
|
1567
|
-
var
|
|
1568
|
+
var Ye = class extends Ge {
|
|
1568
1569
|
constructor(t) {
|
|
1569
1570
|
super(t, "ZstdDecompress");
|
|
1570
1571
|
}
|
|
1571
1572
|
};
|
|
1572
|
-
var
|
|
1573
|
-
if (Number.isSafeInteger(s3)) s3 < 0 ?
|
|
1573
|
+
var Ms = (s3, t) => {
|
|
1574
|
+
if (Number.isSafeInteger(s3)) s3 < 0 ? sn(s3, t) : en(s3, t);
|
|
1574
1575
|
else throw Error("cannot encode number outside of javascript safe integer range");
|
|
1575
1576
|
return t;
|
|
1576
1577
|
};
|
|
1577
|
-
var
|
|
1578
|
+
var en = (s3, t) => {
|
|
1578
1579
|
t[0] = 128;
|
|
1579
1580
|
for (var e2 = t.length; e2 > 1; e2--) t[e2 - 1] = s3 & 255, s3 = Math.floor(s3 / 256);
|
|
1580
1581
|
};
|
|
1581
|
-
var
|
|
1582
|
+
var sn = (s3, t) => {
|
|
1582
1583
|
t[0] = 255;
|
|
1583
1584
|
var e2 = false;
|
|
1584
1585
|
s3 = s3 * -1;
|
|
1585
1586
|
for (var i = t.length; i > 1; i--) {
|
|
1586
1587
|
var r = s3 & 255;
|
|
1587
|
-
s3 = Math.floor(s3 / 256), e2 ? t[i - 1] =
|
|
1588
|
+
s3 = Math.floor(s3 / 256), e2 ? t[i - 1] = Ps(r) : r === 0 ? t[i - 1] = 0 : (e2 = true, t[i - 1] = zs(r));
|
|
1588
1589
|
}
|
|
1589
1590
|
};
|
|
1590
|
-
var
|
|
1591
|
-
let t = s3[0], e2 = t === 128 ?
|
|
1591
|
+
var Bs = (s3) => {
|
|
1592
|
+
let t = s3[0], e2 = t === 128 ? nn(s3.subarray(1, s3.length)) : t === 255 ? rn(s3) : null;
|
|
1592
1593
|
if (e2 === null) throw Error("invalid base256 encoding");
|
|
1593
1594
|
if (!Number.isSafeInteger(e2)) throw Error("parsed number outside of javascript safe integer range");
|
|
1594
1595
|
return e2;
|
|
1595
1596
|
};
|
|
1596
|
-
var
|
|
1597
|
+
var rn = (s3) => {
|
|
1597
1598
|
for (var t = s3.length, e2 = 0, i = false, r = t - 1; r > -1; r--) {
|
|
1598
1599
|
var n = Number(s3[r]), o2;
|
|
1599
|
-
i ? o2 =
|
|
1600
|
+
i ? o2 = Ps(n) : n === 0 ? o2 = n : (i = true, o2 = zs(n)), o2 !== 0 && (e2 -= o2 * Math.pow(256, t - r - 1));
|
|
1600
1601
|
}
|
|
1601
1602
|
return e2;
|
|
1602
1603
|
};
|
|
1603
|
-
var
|
|
1604
|
+
var nn = (s3) => {
|
|
1604
1605
|
for (var t = s3.length, e2 = 0, i = t - 1; i > -1; i--) {
|
|
1605
1606
|
var r = Number(s3[i]);
|
|
1606
1607
|
r !== 0 && (e2 += r * Math.pow(256, t - i - 1));
|
|
1607
1608
|
}
|
|
1608
1609
|
return e2;
|
|
1609
1610
|
};
|
|
1610
|
-
var
|
|
1611
|
-
var
|
|
1612
|
-
var
|
|
1613
|
-
|
|
1611
|
+
var Ps = (s3) => (255 ^ s3) & 255;
|
|
1612
|
+
var zs = (s3) => (255 ^ s3) + 1 & 255;
|
|
1613
|
+
var Bi = {};
|
|
1614
|
+
vr(Bi, { code: () => Ke, isCode: () => oe2, isName: () => hn, name: () => he2 });
|
|
1614
1615
|
var oe2 = (s3) => he2.has(s3);
|
|
1615
|
-
var
|
|
1616
|
+
var hn = (s3) => Ke.has(s3);
|
|
1616
1617
|
var he2 = /* @__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"]]);
|
|
1617
|
-
var
|
|
1618
|
+
var Ke = new Map(Array.from(he2).map((s3) => [s3[1], s3[0]]));
|
|
1618
1619
|
var F2 = class {
|
|
1619
1620
|
cksumValid = false;
|
|
1620
1621
|
needPax = false;
|
|
@@ -1642,14 +1643,14 @@ var F2 = class {
|
|
|
1642
1643
|
}
|
|
1643
1644
|
decode(t, e2, i, r) {
|
|
1644
1645
|
if (e2 || (e2 = 0), !t || !(t.length >= e2 + 512)) throw new Error("need 512 bytes for header");
|
|
1645
|
-
this.path = i?.path ?? Tt(t, e2, 100), this.mode = i?.mode ?? r?.mode ?? at(t, e2 + 100, 8), this.uid = i?.uid ?? r?.uid ?? at(t, e2 + 108, 8), this.gid = i?.gid ?? r?.gid ?? at(t, e2 + 116, 8), this.size = i?.size ?? r?.size ?? at(t, e2 + 124, 12), this.mtime = i?.mtime ?? r?.mtime ??
|
|
1646
|
+
this.path = i?.path ?? Tt(t, e2, 100), this.mode = i?.mode ?? r?.mode ?? at(t, e2 + 100, 8), this.uid = i?.uid ?? r?.uid ?? at(t, e2 + 108, 8), this.gid = i?.gid ?? r?.gid ?? at(t, e2 + 116, 8), this.size = i?.size ?? r?.size ?? at(t, e2 + 124, 12), this.mtime = i?.mtime ?? r?.mtime ?? Pi(t, e2 + 136, 12), this.cksum = at(t, e2 + 148, 12), r && this.#i(r, true), i && this.#i(i);
|
|
1646
1647
|
let n = Tt(t, e2 + 156, 1);
|
|
1647
1648
|
if (oe2(n) && (this.#t = n || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = Tt(t, e2 + 157, 100), t.subarray(e2 + 257, e2 + 265).toString() === "ustar\x0000") if (this.uname = i?.uname ?? r?.uname ?? Tt(t, e2 + 265, 32), this.gname = i?.gname ?? r?.gname ?? Tt(t, e2 + 297, 32), this.devmaj = i?.devmaj ?? r?.devmaj ?? at(t, e2 + 329, 8) ?? 0, this.devmin = i?.devmin ?? r?.devmin ?? at(t, e2 + 337, 8) ?? 0, t[e2 + 475] !== 0) {
|
|
1648
1649
|
let h3 = Tt(t, e2 + 345, 155);
|
|
1649
1650
|
this.path = h3 + "/" + this.path;
|
|
1650
1651
|
} else {
|
|
1651
1652
|
let h3 = Tt(t, e2 + 345, 130);
|
|
1652
|
-
h3 && (this.path = h3 + "/" + this.path), this.atime = i?.atime ?? r?.atime ??
|
|
1653
|
+
h3 && (this.path = h3 + "/" + this.path), this.atime = i?.atime ?? r?.atime ?? Pi(t, e2 + 476, 12), this.ctime = i?.ctime ?? r?.ctime ?? Pi(t, e2 + 488, 12);
|
|
1653
1654
|
}
|
|
1654
1655
|
let o2 = 256;
|
|
1655
1656
|
for (let h3 = e2; h3 < e2 + 148; h3++) o2 += t[h3];
|
|
@@ -1661,8 +1662,8 @@ var F2 = class {
|
|
|
1661
1662
|
}
|
|
1662
1663
|
encode(t, e2 = 0) {
|
|
1663
1664
|
if (t || (t = this.block = Buffer.alloc(512)), this.#t === "Unsupported" && (this.#t = "0"), !(t.length >= e2 + 512)) throw new Error("need 512 bytes for header");
|
|
1664
|
-
let i = this.ctime || this.atime ? 130 : 155, r =
|
|
1665
|
-
this.needPax = !!r[2], this.needPax = xt(t, e2, 100, n) || this.needPax, this.needPax = lt(t, e2 + 100, 8, this.mode) || this.needPax, this.needPax = lt(t, e2 + 108, 8, this.uid) || this.needPax, this.needPax = lt(t, e2 + 116, 8, this.gid) || this.needPax, this.needPax = lt(t, e2 + 124, 12, this.size) || this.needPax, this.needPax =
|
|
1665
|
+
let i = this.ctime || this.atime ? 130 : 155, r = an(this.path || "", i), n = r[0], o2 = r[1];
|
|
1666
|
+
this.needPax = !!r[2], this.needPax = xt(t, e2, 100, n) || this.needPax, this.needPax = lt(t, e2 + 100, 8, this.mode) || this.needPax, this.needPax = lt(t, e2 + 108, 8, this.uid) || this.needPax, this.needPax = lt(t, e2 + 116, 8, this.gid) || this.needPax, this.needPax = lt(t, e2 + 124, 12, this.size) || this.needPax, this.needPax = zi(t, e2 + 136, 12, this.mtime) || this.needPax, t[e2 + 156] = Number(this.#t.codePointAt(0)), this.needPax = xt(t, e2 + 157, 100, this.linkpath) || this.needPax, t.write("ustar\x0000", e2 + 257, 8), this.needPax = xt(t, e2 + 265, 32, this.uname) || this.needPax, this.needPax = xt(t, e2 + 297, 32, this.gname) || this.needPax, this.needPax = lt(t, e2 + 329, 8, this.devmaj) || this.needPax, this.needPax = lt(t, e2 + 337, 8, this.devmin) || this.needPax, this.needPax = xt(t, e2 + 345, i, o2) || this.needPax, t[e2 + 475] !== 0 ? this.needPax = xt(t, e2 + 345, 155, o2) || this.needPax : (this.needPax = xt(t, e2 + 345, 130, o2) || this.needPax, this.needPax = zi(t, e2 + 476, 12, this.atime) || this.needPax, this.needPax = zi(t, e2 + 488, 12, this.ctime) || this.needPax);
|
|
1666
1667
|
let h3 = 256;
|
|
1667
1668
|
for (let a = e2; a < e2 + 148; a++) h3 += t[a];
|
|
1668
1669
|
for (let a = e2 + 156; a < e2 + 512; a++) h3 += t[a];
|
|
@@ -1675,13 +1676,13 @@ var F2 = class {
|
|
|
1675
1676
|
return this.#t;
|
|
1676
1677
|
}
|
|
1677
1678
|
set type(t) {
|
|
1678
|
-
let e2 = String(
|
|
1679
|
+
let e2 = String(Ke.get(t));
|
|
1679
1680
|
if (oe2(e2) || e2 === "Unsupported") this.#t = e2;
|
|
1680
1681
|
else if (oe2(t)) this.#t = t;
|
|
1681
1682
|
else throw new TypeError("invalid entry type: " + t);
|
|
1682
1683
|
}
|
|
1683
1684
|
};
|
|
1684
|
-
var
|
|
1685
|
+
var an = (s3, t) => {
|
|
1685
1686
|
let i = s3, r = "", n, o2 = import_node_path2.posix.parse(s3).root || ".";
|
|
1686
1687
|
if (Buffer.byteLength(i) < 100) n = [i, r, false];
|
|
1687
1688
|
else {
|
|
@@ -1694,19 +1695,19 @@ var sn = (s3, t) => {
|
|
|
1694
1695
|
return n;
|
|
1695
1696
|
};
|
|
1696
1697
|
var Tt = (s3, t, e2) => s3.subarray(t, t + e2).toString("utf8").replace(/\0.*/, "");
|
|
1697
|
-
var
|
|
1698
|
-
var
|
|
1699
|
-
var at = (s3, t, e2) => Number(s3[t]) & 128 ?
|
|
1700
|
-
var
|
|
1701
|
-
var
|
|
1702
|
-
var
|
|
1703
|
-
var lt = (s3, t, e2, i) => i === void 0 ? false : i >
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1707
|
-
var
|
|
1708
|
-
var
|
|
1709
|
-
var xt = (s3, t, e2, i) => i === void 0 ? false : (s3.write(i +
|
|
1698
|
+
var Pi = (s3, t, e2) => ln(at(s3, t, e2));
|
|
1699
|
+
var ln = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
|
|
1700
|
+
var at = (s3, t, e2) => Number(s3[t]) & 128 ? Bs(s3.subarray(t, t + e2)) : fn(s3, t, e2);
|
|
1701
|
+
var cn = (s3) => isNaN(s3) ? void 0 : s3;
|
|
1702
|
+
var fn = (s3, t, e2) => cn(parseInt(s3.subarray(t, t + e2).toString("utf8").replace(/\0.*$/, "").trim(), 8));
|
|
1703
|
+
var dn = { 12: 8589934591, 8: 2097151 };
|
|
1704
|
+
var lt = (s3, t, e2, i) => i === void 0 ? false : i > dn[e2] || i < 0 ? (Ms(i, s3.subarray(t, t + e2)), true) : (un(s3, t, e2, i), false);
|
|
1705
|
+
var un = (s3, t, e2, i) => s3.write(mn(i, e2), t, e2, "ascii");
|
|
1706
|
+
var mn = (s3, t) => pn(Math.floor(s3).toString(8), t);
|
|
1707
|
+
var pn = (s3, t) => (s3.length === t - 1 ? s3 : new Array(t - s3.length - 1).join("0") + s3 + " ") + "\0";
|
|
1708
|
+
var zi = (s3, t, e2, i) => i === void 0 ? false : lt(s3, t, e2, i.getTime() / 1e3);
|
|
1709
|
+
var En = new Array(156).join("\0");
|
|
1710
|
+
var xt = (s3, t, e2, i) => i === void 0 ? false : (s3.write(i + En, t, e2, "utf8"), i.length !== Buffer.byteLength(i) || i.length > e2);
|
|
1710
1711
|
var ct = class s {
|
|
1711
1712
|
atime;
|
|
1712
1713
|
mtime;
|
|
@@ -1747,13 +1748,13 @@ var ct = class s {
|
|
|
1747
1748
|
return n + o2 >= Math.pow(10, o2) && (o2 += 1), o2 + n + r;
|
|
1748
1749
|
}
|
|
1749
1750
|
static parse(t, e2, i = false) {
|
|
1750
|
-
return new s(
|
|
1751
|
+
return new s(Sn(yn(t), e2), i);
|
|
1751
1752
|
}
|
|
1752
1753
|
};
|
|
1753
|
-
var
|
|
1754
|
-
var
|
|
1755
|
-
`).reduce(
|
|
1756
|
-
var
|
|
1754
|
+
var Sn = (s3, t) => t ? Object.assign({}, t, s3) : s3;
|
|
1755
|
+
var yn = (s3) => s3.replace(/\n$/, "").split(`
|
|
1756
|
+
`).reduce(Rn, /* @__PURE__ */ Object.create(null));
|
|
1757
|
+
var Rn = (s3, t) => {
|
|
1757
1758
|
let e2 = parseInt(t, 10);
|
|
1758
1759
|
if (e2 !== Buffer.byteLength(t) + 1) return s3;
|
|
1759
1760
|
t = t.slice((e2 + " ").length);
|
|
@@ -1762,9 +1763,9 @@ var pn = (s3, t) => {
|
|
|
1762
1763
|
let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o2 = i.join("=");
|
|
1763
1764
|
return s3[n] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n) ? new Date(Number(o2) * 1e3) : /^[0-9]+$/.test(o2) ? +o2 : o2, s3;
|
|
1764
1765
|
};
|
|
1765
|
-
var
|
|
1766
|
-
var f3 =
|
|
1767
|
-
var Yt = class extends
|
|
1766
|
+
var bn = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
1767
|
+
var f3 = bn !== "win32" ? (s3) => s3 : (s3) => s3 && s3.replaceAll(/\\/g, "/");
|
|
1768
|
+
var Yt = class extends D2 {
|
|
1768
1769
|
extended;
|
|
1769
1770
|
globalExtended;
|
|
1770
1771
|
header;
|
|
@@ -1831,41 +1832,41 @@ var Yt = class extends A2 {
|
|
|
1831
1832
|
var Lt = (s3, t, e2, i = {}) => {
|
|
1832
1833
|
s3.file && (i.file = s3.file), s3.cwd && (i.cwd = s3.cwd), i.code = e2 instanceof Error && e2.code || t, i.tarCode = t, !s3.strict && i.recoverable !== false ? (e2 instanceof Error && (i = Object.assign(e2, i), e2 = e2.message), s3.emit("warn", t, e2, i)) : e2 instanceof Error ? s3.emit("error", Object.assign(e2, i)) : s3.emit("error", Object.assign(new Error(`${t}: ${e2}`), i));
|
|
1833
1834
|
};
|
|
1834
|
-
var
|
|
1835
|
-
var
|
|
1836
|
-
var
|
|
1837
|
-
var
|
|
1835
|
+
var gn = 1024 * 1024;
|
|
1836
|
+
var Zi = Buffer.from([31, 139]);
|
|
1837
|
+
var Yi = Buffer.from([40, 181, 47, 253]);
|
|
1838
|
+
var On = Math.max(Zi.length, Yi.length);
|
|
1838
1839
|
var B3 = /* @__PURE__ */ Symbol("state");
|
|
1839
1840
|
var Nt = /* @__PURE__ */ Symbol("writeEntry");
|
|
1840
1841
|
var et2 = /* @__PURE__ */ Symbol("readEntry");
|
|
1841
|
-
var
|
|
1842
|
-
var
|
|
1842
|
+
var Ui = /* @__PURE__ */ Symbol("nextEntry");
|
|
1843
|
+
var Us = /* @__PURE__ */ Symbol("processEntry");
|
|
1843
1844
|
var V2 = /* @__PURE__ */ Symbol("extendedHeader");
|
|
1844
1845
|
var ae2 = /* @__PURE__ */ Symbol("globalExtendedHeader");
|
|
1845
1846
|
var ft = /* @__PURE__ */ Symbol("meta");
|
|
1846
|
-
var
|
|
1847
|
+
var Hs = /* @__PURE__ */ Symbol("emitMeta");
|
|
1847
1848
|
var p3 = /* @__PURE__ */ Symbol("buffer");
|
|
1848
1849
|
var it = /* @__PURE__ */ Symbol("queue");
|
|
1849
1850
|
var dt = /* @__PURE__ */ Symbol("ended");
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1851
|
+
var Hi = /* @__PURE__ */ Symbol("emittedEnd");
|
|
1852
|
+
var At = /* @__PURE__ */ Symbol("emit");
|
|
1852
1853
|
var y2 = /* @__PURE__ */ Symbol("unzip");
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
1857
|
-
var
|
|
1854
|
+
var Ve = /* @__PURE__ */ Symbol("consumeChunk");
|
|
1855
|
+
var $e = /* @__PURE__ */ Symbol("consumeChunkSub");
|
|
1856
|
+
var Wi = /* @__PURE__ */ Symbol("consumeBody");
|
|
1857
|
+
var Ws = /* @__PURE__ */ Symbol("consumeMeta");
|
|
1858
|
+
var Gs = /* @__PURE__ */ Symbol("consumeHeader");
|
|
1858
1859
|
var le2 = /* @__PURE__ */ Symbol("consuming");
|
|
1859
|
-
var
|
|
1860
|
-
var
|
|
1860
|
+
var Gi = /* @__PURE__ */ Symbol("bufferConcat");
|
|
1861
|
+
var Xe = /* @__PURE__ */ Symbol("maybeEnd");
|
|
1861
1862
|
var Kt = /* @__PURE__ */ Symbol("writing");
|
|
1862
1863
|
var ut = /* @__PURE__ */ Symbol("aborted");
|
|
1863
|
-
var
|
|
1864
|
-
var
|
|
1865
|
-
var
|
|
1866
|
-
var
|
|
1867
|
-
var
|
|
1868
|
-
var
|
|
1864
|
+
var qe = /* @__PURE__ */ Symbol("onDone");
|
|
1865
|
+
var Dt = /* @__PURE__ */ Symbol("sawValidEntry");
|
|
1866
|
+
var je2 = /* @__PURE__ */ Symbol("sawNullBlock");
|
|
1867
|
+
var Qe = /* @__PURE__ */ Symbol("sawEOF");
|
|
1868
|
+
var Zs = /* @__PURE__ */ Symbol("closeStream");
|
|
1869
|
+
var Tn = () => true;
|
|
1869
1870
|
var st = class extends import_events2.EventEmitter {
|
|
1870
1871
|
file;
|
|
1871
1872
|
strict;
|
|
@@ -1886,36 +1887,36 @@ var st = class extends import_events2.EventEmitter {
|
|
|
1886
1887
|
[dt] = false;
|
|
1887
1888
|
[y2];
|
|
1888
1889
|
[ut] = false;
|
|
1889
|
-
[
|
|
1890
|
-
[qe] = false;
|
|
1890
|
+
[Dt];
|
|
1891
1891
|
[je2] = false;
|
|
1892
|
+
[Qe] = false;
|
|
1892
1893
|
[Kt] = false;
|
|
1893
1894
|
[le2] = false;
|
|
1894
|
-
[
|
|
1895
|
+
[Hi] = false;
|
|
1895
1896
|
constructor(t = {}) {
|
|
1896
|
-
super(), this.file = t.file || "", this.on(
|
|
1897
|
-
(this[B3] === "begin" || this[
|
|
1898
|
-
}), t.ondone ? this.on(
|
|
1897
|
+
super(), this.file = t.file || "", this.on(qe, () => {
|
|
1898
|
+
(this[B3] === "begin" || this[Dt] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
|
|
1899
|
+
}), t.ondone ? this.on(qe, t.ondone) : this.on(qe, () => {
|
|
1899
1900
|
this.emit("prefinish"), this.emit("finish"), this.emit("end");
|
|
1900
|
-
}), this.strict = !!t.strict, this.maxMetaEntrySize = t.maxMetaEntrySize ||
|
|
1901
|
+
}), this.strict = !!t.strict, this.maxMetaEntrySize = t.maxMetaEntrySize || gn, this.filter = typeof t.filter == "function" ? t.filter : Tn;
|
|
1901
1902
|
let e2 = t.file && (t.file.endsWith(".tar.br") || t.file.endsWith(".tbr"));
|
|
1902
1903
|
this.brotli = !(t.gzip || t.zstd) && t.brotli !== void 0 ? t.brotli : e2 ? void 0 : false;
|
|
1903
1904
|
let i = t.file && (t.file.endsWith(".tar.zst") || t.file.endsWith(".tzst"));
|
|
1904
|
-
this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[
|
|
1905
|
+
this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[Zs]()), typeof t.onwarn == "function" && this.on("warn", t.onwarn), typeof t.onReadEntry == "function" && this.on("entry", t.onReadEntry);
|
|
1905
1906
|
}
|
|
1906
1907
|
warn(t, e2, i = {}) {
|
|
1907
1908
|
Lt(this, t, e2, i);
|
|
1908
1909
|
}
|
|
1909
|
-
[
|
|
1910
|
-
this[
|
|
1910
|
+
[Gs](t, e2) {
|
|
1911
|
+
this[Dt] === void 0 && (this[Dt] = false);
|
|
1911
1912
|
let i;
|
|
1912
1913
|
try {
|
|
1913
1914
|
i = new F2(t, e2, this[V2], this[ae2]);
|
|
1914
1915
|
} catch (r) {
|
|
1915
1916
|
return this.warn("TAR_ENTRY_INVALID", r);
|
|
1916
1917
|
}
|
|
1917
|
-
if (i.nullBlock) this[
|
|
1918
|
-
else if (this[
|
|
1918
|
+
if (i.nullBlock) this[je2] ? (this[Qe] = true, this[B3] === "begin" && (this[B3] = "header"), this[At]("eof")) : (this[je2] = true, this[At]("nullBlock"));
|
|
1919
|
+
else if (this[je2] = false, !i.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: i });
|
|
1919
1920
|
else if (!i.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: i });
|
|
1920
1921
|
else {
|
|
1921
1922
|
let r = i.type;
|
|
@@ -1923,52 +1924,52 @@ var st = class extends import_events2.EventEmitter {
|
|
|
1923
1924
|
else if (!/^(Symbolic)?Link$/.test(r) && !/^(Global)?ExtendedHeader$/.test(r) && i.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: i });
|
|
1924
1925
|
else {
|
|
1925
1926
|
let n = this[Nt] = new Yt(i, this[V2], this[ae2]);
|
|
1926
|
-
if (!this[
|
|
1927
|
+
if (!this[Dt]) if (n.remain) {
|
|
1927
1928
|
let o2 = () => {
|
|
1928
|
-
n.invalid || (this[
|
|
1929
|
+
n.invalid || (this[Dt] = true);
|
|
1929
1930
|
};
|
|
1930
1931
|
n.on("end", o2);
|
|
1931
|
-
} else this[
|
|
1932
|
-
n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[
|
|
1932
|
+
} else this[Dt] = true;
|
|
1933
|
+
n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[At]("ignoredEntry", n), this[B3] = "ignore", n.resume()) : n.size > 0 && (this[ft] = "", n.on("data", (o2) => this[ft] += o2), this[B3] = "meta") : (this[V2] = void 0, n.ignore = n.ignore || !this.filter(n.path, n), n.ignore ? (this[At]("ignoredEntry", n), this[B3] = n.remain ? "ignore" : "header", n.resume()) : (n.remain ? this[B3] = "body" : (this[B3] = "header", n.end()), this[et2] ? this[it].push(n) : (this[it].push(n), this[Ui]())));
|
|
1933
1934
|
}
|
|
1934
1935
|
}
|
|
1935
1936
|
}
|
|
1936
|
-
[
|
|
1937
|
+
[Zs]() {
|
|
1937
1938
|
queueMicrotask(() => this.emit("close"));
|
|
1938
1939
|
}
|
|
1939
|
-
[
|
|
1940
|
+
[Us](t) {
|
|
1940
1941
|
let e2 = true;
|
|
1941
1942
|
if (!t) this[et2] = void 0, e2 = false;
|
|
1942
1943
|
else if (Array.isArray(t)) {
|
|
1943
1944
|
let [i, ...r] = t;
|
|
1944
1945
|
this.emit(i, ...r);
|
|
1945
|
-
} else this[et2] = t, this.emit("entry", t), t.emittedEnd || (t.on("end", () => this[
|
|
1946
|
+
} else this[et2] = t, this.emit("entry", t), t.emittedEnd || (t.on("end", () => this[Ui]()), e2 = false);
|
|
1946
1947
|
return e2;
|
|
1947
1948
|
}
|
|
1948
|
-
[
|
|
1949
|
+
[Ui]() {
|
|
1949
1950
|
do
|
|
1950
1951
|
;
|
|
1951
|
-
while (this[
|
|
1952
|
-
if (
|
|
1952
|
+
while (this[Us](this[it].shift()));
|
|
1953
|
+
if (this[it].length === 0) {
|
|
1953
1954
|
let t = this[et2];
|
|
1954
1955
|
!t || t.flowing || t.size === t.remain ? this[Kt] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
|
|
1955
1956
|
}
|
|
1956
1957
|
}
|
|
1957
|
-
[
|
|
1958
|
+
[Wi](t, e2) {
|
|
1958
1959
|
let i = this[Nt];
|
|
1959
1960
|
if (!i) throw new Error("attempt to consume body without entry??");
|
|
1960
1961
|
let r = i.blockRemain ?? 0, n = r >= t.length && e2 === 0 ? t : t.subarray(e2, e2 + r);
|
|
1961
1962
|
return i.write(n), i.blockRemain || (this[B3] = "header", this[Nt] = void 0, i.end()), n.length;
|
|
1962
1963
|
}
|
|
1963
|
-
[
|
|
1964
|
-
let i = this[Nt], r = this[
|
|
1965
|
-
return !this[Nt] && i && this[
|
|
1964
|
+
[Ws](t, e2) {
|
|
1965
|
+
let i = this[Nt], r = this[Wi](t, e2);
|
|
1966
|
+
return !this[Nt] && i && this[Hs](i), r;
|
|
1966
1967
|
}
|
|
1967
|
-
[
|
|
1968
|
-
|
|
1968
|
+
[At](t, e2, i) {
|
|
1969
|
+
this[it].length === 0 && !this[et2] ? this.emit(t, e2, i) : this[it].push([t, e2, i]);
|
|
1969
1970
|
}
|
|
1970
|
-
[
|
|
1971
|
-
switch (this[
|
|
1971
|
+
[Hs](t) {
|
|
1972
|
+
switch (this[At]("meta", this[ft]), t.type) {
|
|
1972
1973
|
case "ExtendedHeader":
|
|
1973
1974
|
case "OldExtendedHeader":
|
|
1974
1975
|
this[V2] = ct.parse(this[ft], this[V2], false);
|
|
@@ -1997,12 +1998,12 @@ var st = class extends import_events2.EventEmitter {
|
|
|
1997
1998
|
write(t, e2, i) {
|
|
1998
1999
|
if (typeof e2 == "function" && (i = e2, e2 = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e2 == "string" ? e2 : "utf8")), this[ut]) return i?.(), false;
|
|
1999
2000
|
if ((this[y2] === void 0 || this.brotli === void 0 && this[y2] === false) && t) {
|
|
2000
|
-
if (this[p3] && (t = Buffer.concat([this[p3], t]), this[p3] = void 0), t.length <
|
|
2001
|
-
for (let a = 0; this[y2] === void 0 && a <
|
|
2001
|
+
if (this[p3] && (t = Buffer.concat([this[p3], t]), this[p3] = void 0), t.length < On) return this[p3] = t, i?.(), true;
|
|
2002
|
+
for (let a = 0; this[y2] === void 0 && a < Zi.length; a++) t[a] !== Zi[a] && (this[y2] = false);
|
|
2002
2003
|
let o2 = false;
|
|
2003
2004
|
if (this[y2] === false && this.zstd !== false) {
|
|
2004
2005
|
o2 = true;
|
|
2005
|
-
for (let a = 0; a <
|
|
2006
|
+
for (let a = 0; a < Yi.length; a++) if (t[a] !== Yi[a]) {
|
|
2006
2007
|
o2 = false;
|
|
2007
2008
|
break;
|
|
2008
2009
|
}
|
|
@@ -2017,69 +2018,69 @@ var st = class extends import_events2.EventEmitter {
|
|
|
2017
2018
|
}
|
|
2018
2019
|
if (this[y2] === void 0 || this[y2] === false && (this.brotli || o2)) {
|
|
2019
2020
|
let a = this[dt];
|
|
2020
|
-
this[dt] = false, this[y2] = this[y2] === void 0 ? new
|
|
2021
|
-
this[dt] = true, this[
|
|
2021
|
+
this[dt] = false, this[y2] = this[y2] === void 0 ? new ze({}) : o2 ? new Ye({}) : new We({}), this[y2].on("data", (c2) => this[Ve](c2)), this[y2].on("error", (c2) => this.abort(c2)), this[y2].on("end", () => {
|
|
2022
|
+
this[dt] = true, this[Ve]();
|
|
2022
2023
|
}), this[Kt] = true;
|
|
2023
2024
|
let l = !!this[y2][a ? "end" : "write"](t);
|
|
2024
2025
|
return this[Kt] = false, i?.(), l;
|
|
2025
2026
|
}
|
|
2026
2027
|
}
|
|
2027
|
-
this[Kt] = true, this[y2] ? this[y2].write(t) : this[
|
|
2028
|
-
let n = this[it].length ? false : this[et2] ? this[et2].flowing : true;
|
|
2029
|
-
return !n &&
|
|
2028
|
+
this[Kt] = true, this[y2] ? this[y2].write(t) : this[Ve](t), this[Kt] = false;
|
|
2029
|
+
let n = this[it].length > 0 ? false : this[et2] ? this[et2].flowing : true;
|
|
2030
|
+
return !n && this[it].length === 0 && this[et2]?.once("drain", () => this.emit("drain")), i?.(), n;
|
|
2030
2031
|
}
|
|
2031
|
-
[
|
|
2032
|
+
[Gi](t) {
|
|
2032
2033
|
t && !this[ut] && (this[p3] = this[p3] ? Buffer.concat([this[p3], t]) : t);
|
|
2033
2034
|
}
|
|
2034
|
-
[
|
|
2035
|
-
if (this[dt] && !this[
|
|
2036
|
-
this[
|
|
2035
|
+
[Xe]() {
|
|
2036
|
+
if (this[dt] && !this[Hi] && !this[ut] && !this[le2]) {
|
|
2037
|
+
this[Hi] = true;
|
|
2037
2038
|
let t = this[Nt];
|
|
2038
2039
|
if (t && t.blockRemain) {
|
|
2039
2040
|
let e2 = this[p3] ? this[p3].length : 0;
|
|
2040
2041
|
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t.blockRemain} more bytes, only ${e2} available)`, { entry: t }), this[p3] && t.write(this[p3]), t.end();
|
|
2041
2042
|
}
|
|
2042
|
-
this[
|
|
2043
|
+
this[At](qe);
|
|
2043
2044
|
}
|
|
2044
2045
|
}
|
|
2045
|
-
[
|
|
2046
|
-
if (this[le2] && t) this[
|
|
2047
|
-
else if (!t && !this[p3]) this[
|
|
2046
|
+
[Ve](t) {
|
|
2047
|
+
if (this[le2] && t) this[Gi](t);
|
|
2048
|
+
else if (!t && !this[p3]) this[Xe]();
|
|
2048
2049
|
else if (t) {
|
|
2049
2050
|
if (this[le2] = true, this[p3]) {
|
|
2050
|
-
this[
|
|
2051
|
+
this[Gi](t);
|
|
2051
2052
|
let e2 = this[p3];
|
|
2052
|
-
this[p3] = void 0, this[
|
|
2053
|
-
} else this[
|
|
2054
|
-
for (; this[p3] && this[p3]?.length >= 512 && !this[ut] && !this[
|
|
2053
|
+
this[p3] = void 0, this[$e](e2);
|
|
2054
|
+
} else this[$e](t);
|
|
2055
|
+
for (; this[p3] && this[p3]?.length >= 512 && !this[ut] && !this[Qe]; ) {
|
|
2055
2056
|
let e2 = this[p3];
|
|
2056
|
-
this[p3] = void 0, this[
|
|
2057
|
+
this[p3] = void 0, this[$e](e2);
|
|
2057
2058
|
}
|
|
2058
2059
|
this[le2] = false;
|
|
2059
2060
|
}
|
|
2060
|
-
(!this[p3] || this[dt]) && this[
|
|
2061
|
+
(!this[p3] || this[dt]) && this[Xe]();
|
|
2061
2062
|
}
|
|
2062
|
-
[
|
|
2063
|
+
[$e](t) {
|
|
2063
2064
|
let e2 = 0, i = t.length;
|
|
2064
|
-
for (; e2 + 512 <= i && !this[ut] && !this[
|
|
2065
|
+
for (; e2 + 512 <= i && !this[ut] && !this[Qe]; ) switch (this[B3]) {
|
|
2065
2066
|
case "begin":
|
|
2066
2067
|
case "header":
|
|
2067
|
-
this[
|
|
2068
|
+
this[Gs](t, e2), e2 += 512;
|
|
2068
2069
|
break;
|
|
2069
2070
|
case "ignore":
|
|
2070
2071
|
case "body":
|
|
2071
|
-
e2 += this[
|
|
2072
|
+
e2 += this[Wi](t, e2);
|
|
2072
2073
|
break;
|
|
2073
2074
|
case "meta":
|
|
2074
|
-
e2 += this[
|
|
2075
|
+
e2 += this[Ws](t, e2);
|
|
2075
2076
|
break;
|
|
2076
2077
|
default:
|
|
2077
2078
|
throw new Error("invalid state: " + this[B3]);
|
|
2078
2079
|
}
|
|
2079
|
-
e2 < i && (this[p3]
|
|
2080
|
+
e2 < i && (this[p3] = this[p3] ? Buffer.concat([t.subarray(e2), this[p3]]) : t.subarray(e2));
|
|
2080
2081
|
}
|
|
2081
2082
|
end(t, e2, i) {
|
|
2082
|
-
return typeof t == "function" && (i = t, e2 = void 0, t = void 0), typeof e2 == "function" && (i = e2, e2 = void 0), typeof t == "string" && (t = Buffer.from(t, e2)), i && this.once("finish", i), this[ut] || (this[y2] ? (t && this[y2].write(t), this[y2].end()) : (this[dt] = true, (this.brotli === void 0 || this.zstd === void 0) && (t = t || Buffer.alloc(0)), t && this.write(t), this[
|
|
2083
|
+
return typeof t == "function" && (i = t, e2 = void 0, t = void 0), typeof e2 == "function" && (i = e2, e2 = void 0), typeof t == "string" && (t = Buffer.from(t, e2)), i && this.once("finish", i), this[ut] || (this[y2] ? (t && this[y2].write(t), this[y2].end()) : (this[dt] = true, (this.brotli === void 0 || this.zstd === void 0) && (t = t || Buffer.alloc(0)), t && this.write(t), this[Xe]())), this;
|
|
2083
2084
|
}
|
|
2084
2085
|
};
|
|
2085
2086
|
var mt = (s3) => {
|
|
@@ -2087,25 +2088,25 @@ var mt = (s3) => {
|
|
|
2087
2088
|
for (; t > -1 && s3.charAt(t) === "/"; ) e2 = t, t--;
|
|
2088
2089
|
return e2 === -1 ? s3 : s3.slice(0, e2);
|
|
2089
2090
|
};
|
|
2090
|
-
var
|
|
2091
|
+
var Nn = (s3) => {
|
|
2091
2092
|
let t = s3.onReadEntry;
|
|
2092
2093
|
s3.onReadEntry = t ? (e2) => {
|
|
2093
2094
|
t(e2), e2.resume();
|
|
2094
2095
|
} : (e2) => e2.resume();
|
|
2095
2096
|
};
|
|
2096
|
-
var
|
|
2097
|
+
var Ki = (s3, t) => {
|
|
2097
2098
|
let e2 = new Map(t.map((n) => [mt(n), true])), i = s3.filter, r = (n, o2 = "") => {
|
|
2098
2099
|
let h3 = o2 || (0, import_path.parse)(n).root || ".", a;
|
|
2099
2100
|
if (n === h3) a = false;
|
|
2100
2101
|
else {
|
|
2101
2102
|
let l = e2.get(n);
|
|
2102
|
-
l !== void 0 ?
|
|
2103
|
+
a = l !== void 0 ? l : r((0, import_path.dirname)(n), h3);
|
|
2103
2104
|
}
|
|
2104
2105
|
return e2.set(n, a), a;
|
|
2105
2106
|
};
|
|
2106
2107
|
s3.filter = i ? (n, o2) => i(n, o2) && r(mt(n)) : (n) => r(mt(n));
|
|
2107
2108
|
};
|
|
2108
|
-
var
|
|
2109
|
+
var An = (s3) => {
|
|
2109
2110
|
let t = new st(s3), e2 = s3.file, i;
|
|
2110
2111
|
try {
|
|
2111
2112
|
i = import_node_fs.default.openSync(e2, "r");
|
|
@@ -2129,58 +2130,58 @@ var On = (s3) => {
|
|
|
2129
2130
|
}
|
|
2130
2131
|
}
|
|
2131
2132
|
};
|
|
2132
|
-
var
|
|
2133
|
+
var Dn = (s3, t) => {
|
|
2133
2134
|
let e2 = new st(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
|
|
2134
2135
|
return new Promise((o2, h3) => {
|
|
2135
2136
|
e2.on("error", h3), e2.on("end", o2), import_node_fs.default.stat(r, (a, l) => {
|
|
2136
2137
|
if (a) h3(a);
|
|
2137
2138
|
else {
|
|
2138
|
-
let c2 = new
|
|
2139
|
+
let c2 = new _t(r, { readSize: i, size: l.size });
|
|
2139
2140
|
c2.on("error", h3), c2.pipe(e2);
|
|
2140
2141
|
}
|
|
2141
2142
|
});
|
|
2142
2143
|
});
|
|
2143
2144
|
};
|
|
2144
|
-
var It = K3(
|
|
2145
|
-
t?.length &&
|
|
2145
|
+
var It = K3(An, Dn, (s3) => new st(s3), (s3) => new st(s3), (s3, t) => {
|
|
2146
|
+
t?.length && Ki(s3, t), s3.noResume || Nn(s3);
|
|
2146
2147
|
});
|
|
2147
|
-
var
|
|
2148
|
-
var { isAbsolute:
|
|
2148
|
+
var Vi = (s3, t, e2) => (s3 &= 4095, e2 && (s3 = (s3 | 384) & -19), t && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
|
|
2149
|
+
var { isAbsolute: Cn, parse: Ys } = import_node_path4.win32;
|
|
2149
2150
|
var ce2 = (s3) => {
|
|
2150
|
-
let t = "", e2 =
|
|
2151
|
-
for (;
|
|
2151
|
+
let t = "", e2 = Ys(s3);
|
|
2152
|
+
for (; Cn(s3) || e2.root; ) {
|
|
2152
2153
|
let i = s3.charAt(0) === "/" && s3.slice(0, 4) !== "//?/" ? "/" : e2.root;
|
|
2153
|
-
s3 = s3.slice(i.length), t += i, e2 =
|
|
2154
|
+
s3 = s3.slice(i.length), t += i, e2 = Ys(s3);
|
|
2154
2155
|
}
|
|
2155
2156
|
return [t, s3];
|
|
2156
2157
|
};
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2159
|
-
var
|
|
2160
|
-
var
|
|
2161
|
-
var
|
|
2162
|
-
var
|
|
2163
|
-
var
|
|
2164
|
-
var
|
|
2165
|
-
var
|
|
2166
|
-
var
|
|
2167
|
-
var
|
|
2168
|
-
var
|
|
2169
|
-
var
|
|
2158
|
+
var Je = ["|", "<", ">", "?", ":"];
|
|
2159
|
+
var $i = Je.map((s3) => String.fromCodePoint(61440 + Number(s3.codePointAt(0))));
|
|
2160
|
+
var Fn = new Map(Je.map((s3, t) => [s3, $i[t]]));
|
|
2161
|
+
var kn = new Map($i.map((s3, t) => [s3, Je[t]]));
|
|
2162
|
+
var Xi = (s3) => Je.reduce((t, e2) => t.split(e2).join(Fn.get(e2)), s3);
|
|
2163
|
+
var Ks = (s3) => $i.reduce((t, e2) => t.split(e2).join(kn.get(e2)), s3);
|
|
2164
|
+
var Js = (s3, t) => t ? (s3 = f3(s3).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s3) : f3(s3);
|
|
2165
|
+
var vn = 16 * 1024 * 1024;
|
|
2166
|
+
var Xs = /* @__PURE__ */ Symbol("process");
|
|
2167
|
+
var qs = /* @__PURE__ */ Symbol("file");
|
|
2168
|
+
var js = /* @__PURE__ */ Symbol("directory");
|
|
2169
|
+
var ji = /* @__PURE__ */ Symbol("symlink");
|
|
2170
|
+
var Qs = /* @__PURE__ */ Symbol("hardlink");
|
|
2170
2171
|
var fe = /* @__PURE__ */ Symbol("header");
|
|
2171
|
-
var
|
|
2172
|
-
var
|
|
2173
|
-
var
|
|
2174
|
-
var
|
|
2175
|
-
var
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2172
|
+
var ti = /* @__PURE__ */ Symbol("read");
|
|
2173
|
+
var Qi = /* @__PURE__ */ Symbol("lstat");
|
|
2174
|
+
var ei = /* @__PURE__ */ Symbol("onlstat");
|
|
2175
|
+
var Ji = /* @__PURE__ */ Symbol("onread");
|
|
2176
|
+
var ts = /* @__PURE__ */ Symbol("onreadlink");
|
|
2177
|
+
var es = /* @__PURE__ */ Symbol("openfile");
|
|
2178
|
+
var is = /* @__PURE__ */ Symbol("onopenfile");
|
|
2178
2179
|
var pt = /* @__PURE__ */ Symbol("close");
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2181
|
-
var
|
|
2180
|
+
var ii = /* @__PURE__ */ Symbol("mode");
|
|
2181
|
+
var ss = /* @__PURE__ */ Symbol("awaitDrain");
|
|
2182
|
+
var qi = /* @__PURE__ */ Symbol("ondrain");
|
|
2182
2183
|
var X3 = /* @__PURE__ */ Symbol("prefix");
|
|
2183
|
-
var de2 = class extends
|
|
2184
|
+
var de2 = class extends D2 {
|
|
2184
2185
|
path;
|
|
2185
2186
|
portable;
|
|
2186
2187
|
myuid = process.getuid && process.getuid() || 0;
|
|
@@ -2213,15 +2214,15 @@ var de2 = class extends A2 {
|
|
|
2213
2214
|
#t = false;
|
|
2214
2215
|
constructor(t, e2 = {}) {
|
|
2215
2216
|
let i = re(e2);
|
|
2216
|
-
super(), this.path = f3(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize ||
|
|
2217
|
+
super(), this.path = f3(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize || vn, this.linkCache = i.linkCache || /* @__PURE__ */ new Map(), this.statCache = i.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i.preservePaths, this.cwd = f3(i.cwd || process.cwd()), this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.mtime = i.mtime, this.prefix = i.prefix ? f3(i.prefix) : void 0, this.onWriteEntry = i.onWriteEntry, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
|
|
2217
2218
|
let r = false;
|
|
2218
2219
|
if (!this.preservePaths) {
|
|
2219
2220
|
let [o2, h3] = ce2(this.path);
|
|
2220
2221
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
2221
2222
|
}
|
|
2222
|
-
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path =
|
|
2223
|
+
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f3(i.absolute || import_path2.default.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 });
|
|
2223
2224
|
let n = this.statCache.get(this.absolute);
|
|
2224
|
-
n ? this[
|
|
2225
|
+
n ? this[ei](n) : this[Qi]();
|
|
2225
2226
|
}
|
|
2226
2227
|
warn(t, e2, i = {}) {
|
|
2227
2228
|
return Lt(this, t, e2, i);
|
|
@@ -2229,93 +2230,93 @@ var de2 = class extends A2 {
|
|
|
2229
2230
|
emit(t, ...e2) {
|
|
2230
2231
|
return t === "error" && (this.#t = true), super.emit(t, ...e2);
|
|
2231
2232
|
}
|
|
2232
|
-
[
|
|
2233
|
+
[Qi]() {
|
|
2233
2234
|
import_fs3.default.lstat(this.absolute, (t, e2) => {
|
|
2234
2235
|
if (t) return this.emit("error", t);
|
|
2235
|
-
this[
|
|
2236
|
+
this[ei](e2);
|
|
2236
2237
|
});
|
|
2237
2238
|
}
|
|
2238
|
-
[
|
|
2239
|
-
this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type =
|
|
2239
|
+
[ei](t) {
|
|
2240
|
+
this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type = Mn(t), this.emit("stat", t), this[Xs]();
|
|
2240
2241
|
}
|
|
2241
|
-
[
|
|
2242
|
+
[Xs]() {
|
|
2242
2243
|
switch (this.type) {
|
|
2243
2244
|
case "File":
|
|
2244
|
-
return this[
|
|
2245
|
+
return this[qs]();
|
|
2245
2246
|
case "Directory":
|
|
2246
|
-
return this[
|
|
2247
|
+
return this[js]();
|
|
2247
2248
|
case "SymbolicLink":
|
|
2248
|
-
return this[
|
|
2249
|
+
return this[ji]();
|
|
2249
2250
|
default:
|
|
2250
2251
|
return this.end();
|
|
2251
2252
|
}
|
|
2252
2253
|
}
|
|
2253
|
-
[
|
|
2254
|
-
return
|
|
2254
|
+
[ii](t) {
|
|
2255
|
+
return Vi(t, this.type === "Directory", this.portable);
|
|
2255
2256
|
}
|
|
2256
2257
|
[X3](t) {
|
|
2257
|
-
return
|
|
2258
|
+
return Js(t, this.prefix);
|
|
2258
2259
|
}
|
|
2259
2260
|
[fe]() {
|
|
2260
2261
|
if (!this.stat) throw new Error("cannot write header before stat");
|
|
2261
|
-
this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F2({ path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, mode: this[
|
|
2262
|
+
this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F2({ path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, mode: this[ii](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 ct({ 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[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](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());
|
|
2262
2263
|
let t = this.header?.block;
|
|
2263
2264
|
if (!t) throw new Error("failed to encode header");
|
|
2264
2265
|
super.write(t);
|
|
2265
2266
|
}
|
|
2266
|
-
[
|
|
2267
|
+
[js]() {
|
|
2267
2268
|
if (!this.stat) throw new Error("cannot create directory entry without stat");
|
|
2268
2269
|
this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[fe](), this.end();
|
|
2269
2270
|
}
|
|
2270
|
-
[
|
|
2271
|
+
[ji]() {
|
|
2271
2272
|
import_fs3.default.readlink(this.absolute, (t, e2) => {
|
|
2272
2273
|
if (t) return this.emit("error", t);
|
|
2273
|
-
this[
|
|
2274
|
+
this[ts](e2);
|
|
2274
2275
|
});
|
|
2275
2276
|
}
|
|
2276
|
-
[
|
|
2277
|
+
[ts](t) {
|
|
2277
2278
|
this.linkpath = f3(t), this[fe](), this.end();
|
|
2278
2279
|
}
|
|
2279
|
-
[
|
|
2280
|
+
[Qs](t) {
|
|
2280
2281
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
2281
2282
|
this.type = "Link", this.linkpath = f3(import_path2.default.relative(this.cwd, t)), this.stat.size = 0, this[fe](), this.end();
|
|
2282
2283
|
}
|
|
2283
|
-
[
|
|
2284
|
+
[qs]() {
|
|
2284
2285
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
2285
2286
|
if (this.stat.nlink > 1) {
|
|
2286
2287
|
let t = `${this.stat.dev}:${this.stat.ino}`, e2 = this.linkCache.get(t);
|
|
2287
|
-
if (e2?.indexOf(this.cwd) === 0) return this[
|
|
2288
|
+
if (e2?.indexOf(this.cwd) === 0) return this[Qs](e2);
|
|
2288
2289
|
this.linkCache.set(t, this.absolute);
|
|
2289
2290
|
}
|
|
2290
2291
|
if (this[fe](), this.stat.size === 0) return this.end();
|
|
2291
|
-
this[
|
|
2292
|
+
this[es]();
|
|
2292
2293
|
}
|
|
2293
|
-
[
|
|
2294
|
+
[es]() {
|
|
2294
2295
|
import_fs3.default.open(this.absolute, "r", (t, e2) => {
|
|
2295
2296
|
if (t) return this.emit("error", t);
|
|
2296
|
-
this[
|
|
2297
|
+
this[is](e2);
|
|
2297
2298
|
});
|
|
2298
2299
|
}
|
|
2299
|
-
[
|
|
2300
|
+
[is](t) {
|
|
2300
2301
|
if (this.fd = t, this.#t) return this[pt]();
|
|
2301
2302
|
if (!this.stat) throw new Error("should stat before calling onopenfile");
|
|
2302
2303
|
this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
|
|
2303
2304
|
let e2 = Math.min(this.blockLen, this.maxReadSize);
|
|
2304
|
-
this.buf = Buffer.allocUnsafe(e2), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[
|
|
2305
|
+
this.buf = Buffer.allocUnsafe(e2), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[ti]();
|
|
2305
2306
|
}
|
|
2306
|
-
[
|
|
2307
|
+
[ti]() {
|
|
2307
2308
|
let { fd: t, buf: e2, offset: i, length: r, pos: n } = this;
|
|
2308
2309
|
if (t === void 0 || e2 === void 0) throw new Error("cannot read file without first opening");
|
|
2309
2310
|
import_fs3.default.read(t, e2, i, r, n, (o2, h3) => {
|
|
2310
2311
|
if (o2) return this[pt](() => this.emit("error", o2));
|
|
2311
|
-
this[
|
|
2312
|
+
this[Ji](h3);
|
|
2312
2313
|
});
|
|
2313
2314
|
}
|
|
2314
2315
|
[pt](t = () => {
|
|
2315
2316
|
}) {
|
|
2316
2317
|
this.fd !== void 0 && import_fs3.default.close(this.fd, t);
|
|
2317
2318
|
}
|
|
2318
|
-
[
|
|
2319
|
+
[Ji](t) {
|
|
2319
2320
|
if (t <= 0 && this.remain > 0) {
|
|
2320
2321
|
let r = Object.assign(new Error("encountered unexpected EOF"), { path: this.absolute, syscall: "read", code: "EOF" });
|
|
2321
2322
|
return this[pt](() => this.emit("error", r));
|
|
@@ -2327,9 +2328,9 @@ var de2 = class extends A2 {
|
|
|
2327
2328
|
if (!this.buf) throw new Error("should have created buffer prior to reading");
|
|
2328
2329
|
if (t === this.remain) for (let r = t; r < this.length && t < this.blockRemain; r++) this.buf[r + this.offset] = 0, t++, this.remain++;
|
|
2329
2330
|
let e2 = this.offset === 0 && t === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + t);
|
|
2330
|
-
this.write(e2) ? this[
|
|
2331
|
+
this.write(e2) ? this[qi]() : this[ss](() => this[qi]());
|
|
2331
2332
|
}
|
|
2332
|
-
[
|
|
2333
|
+
[ss](t) {
|
|
2333
2334
|
this.once("drain", t);
|
|
2334
2335
|
}
|
|
2335
2336
|
write(t, e2, i) {
|
|
@@ -2339,30 +2340,30 @@ var de2 = class extends A2 {
|
|
|
2339
2340
|
}
|
|
2340
2341
|
return this.remain -= t.length, this.blockRemain -= t.length, this.pos += t.length, this.offset += t.length, super.write(t, null, i);
|
|
2341
2342
|
}
|
|
2342
|
-
[
|
|
2343
|
+
[qi]() {
|
|
2343
2344
|
if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[pt]((t) => t ? this.emit("error", t) : this.end());
|
|
2344
2345
|
if (!this.buf) throw new Error("buffer lost somehow in ONDRAIN");
|
|
2345
|
-
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[
|
|
2346
|
+
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[ti]();
|
|
2346
2347
|
}
|
|
2347
2348
|
};
|
|
2348
|
-
var
|
|
2349
|
+
var si = class extends de2 {
|
|
2349
2350
|
sync = true;
|
|
2350
|
-
[
|
|
2351
|
-
this[
|
|
2351
|
+
[Qi]() {
|
|
2352
|
+
this[ei](import_fs3.default.lstatSync(this.absolute));
|
|
2352
2353
|
}
|
|
2353
|
-
[
|
|
2354
|
-
this[
|
|
2354
|
+
[ji]() {
|
|
2355
|
+
this[ts](import_fs3.default.readlinkSync(this.absolute));
|
|
2355
2356
|
}
|
|
2356
|
-
[
|
|
2357
|
-
this[
|
|
2357
|
+
[es]() {
|
|
2358
|
+
this[is](import_fs3.default.openSync(this.absolute, "r"));
|
|
2358
2359
|
}
|
|
2359
|
-
[
|
|
2360
|
+
[ti]() {
|
|
2360
2361
|
let t = true;
|
|
2361
2362
|
try {
|
|
2362
2363
|
let { fd: e2, buf: i, offset: r, length: n, pos: o2 } = this;
|
|
2363
2364
|
if (e2 === void 0 || i === void 0) throw new Error("fd and buf must be set in READ method");
|
|
2364
2365
|
let h3 = import_fs3.default.readSync(e2, i, r, n, o2);
|
|
2365
|
-
this[
|
|
2366
|
+
this[Ji](h3), t = false;
|
|
2366
2367
|
} finally {
|
|
2367
2368
|
if (t) try {
|
|
2368
2369
|
this[pt](() => {
|
|
@@ -2371,7 +2372,7 @@ var ii = class extends de2 {
|
|
|
2371
2372
|
}
|
|
2372
2373
|
}
|
|
2373
2374
|
}
|
|
2374
|
-
[
|
|
2375
|
+
[ss](t) {
|
|
2375
2376
|
t();
|
|
2376
2377
|
}
|
|
2377
2378
|
[pt](t = () => {
|
|
@@ -2379,7 +2380,7 @@ var ii = class extends de2 {
|
|
|
2379
2380
|
this.fd !== void 0 && import_fs3.default.closeSync(this.fd), t();
|
|
2380
2381
|
}
|
|
2381
2382
|
};
|
|
2382
|
-
var
|
|
2383
|
+
var ri = class extends D2 {
|
|
2383
2384
|
blockLen = 0;
|
|
2384
2385
|
blockRemain = 0;
|
|
2385
2386
|
buf = 0;
|
|
@@ -2415,7 +2416,7 @@ var si = class extends A2 {
|
|
|
2415
2416
|
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;
|
|
2416
2417
|
let { type: r } = t;
|
|
2417
2418
|
if (r === "Unsupported") throw new Error("writing entry that should be ignored");
|
|
2418
|
-
this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f3(t.path), this.mode = t.mode !== void 0 ? this[
|
|
2419
|
+
this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f3(t.path), this.mode = t.mode !== void 0 ? this[ii](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 ? f3(t.linkpath) : void 0, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
|
|
2419
2420
|
let n = false;
|
|
2420
2421
|
if (!this.preservePaths) {
|
|
2421
2422
|
let [h3, a] = ce2(this.path);
|
|
@@ -2427,10 +2428,10 @@ var si = class extends A2 {
|
|
|
2427
2428
|
super.write(o2), t.pipe(this);
|
|
2428
2429
|
}
|
|
2429
2430
|
[X3](t) {
|
|
2430
|
-
return
|
|
2431
|
+
return Js(t, this.prefix);
|
|
2431
2432
|
}
|
|
2432
|
-
[
|
|
2433
|
-
return
|
|
2433
|
+
[ii](t) {
|
|
2434
|
+
return Vi(t, this.type === "Directory", this.portable);
|
|
2434
2435
|
}
|
|
2435
2436
|
write(t, e2, i) {
|
|
2436
2437
|
typeof e2 == "function" && (i = e2, e2 = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e2 == "string" ? e2 : "utf8"));
|
|
@@ -2442,8 +2443,8 @@ var si = class extends A2 {
|
|
|
2442
2443
|
return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof t == "function" && (i = t, e2 = void 0, t = void 0), typeof e2 == "function" && (i = e2, e2 = void 0), typeof t == "string" && (t = Buffer.from(t, e2 ?? "utf8")), i && this.once("finish", i), t ? super.end(t, i) : super.end(i), this;
|
|
2443
2444
|
}
|
|
2444
2445
|
};
|
|
2445
|
-
var
|
|
2446
|
-
var
|
|
2446
|
+
var Mn = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
|
|
2447
|
+
var ni = class s2 {
|
|
2447
2448
|
tail;
|
|
2448
2449
|
head;
|
|
2449
2450
|
length = 0;
|
|
@@ -2474,11 +2475,11 @@ var ri = class s2 {
|
|
|
2474
2475
|
t.list = this, t.prev = e2, e2 && (e2.next = t), this.tail = t, this.head || (this.head = t), this.length++;
|
|
2475
2476
|
}
|
|
2476
2477
|
push(...t) {
|
|
2477
|
-
for (let e2 = 0, i = t.length; e2 < i; e2++)
|
|
2478
|
+
for (let e2 = 0, i = t.length; e2 < i; e2++) Pn(this, t[e2]);
|
|
2478
2479
|
return this.length;
|
|
2479
2480
|
}
|
|
2480
2481
|
unshift(...t) {
|
|
2481
|
-
for (var e2 = 0, i = t.length; e2 < i; e2++)
|
|
2482
|
+
for (var e2 = 0, i = t.length; e2 < i; e2++) zn(this, t[e2]);
|
|
2482
2483
|
return this.length;
|
|
2483
2484
|
}
|
|
2484
2485
|
pop() {
|
|
@@ -2574,7 +2575,7 @@ var ri = class s2 {
|
|
|
2574
2575
|
let n = [];
|
|
2575
2576
|
for (let o2 = 0; r && o2 < e2; o2++) n.push(r.value), r = this.removeNode(r);
|
|
2576
2577
|
r ? r !== this.tail && (r = r.prev) : r = this.tail;
|
|
2577
|
-
for (let o2 of i) r =
|
|
2578
|
+
for (let o2 of i) r = Bn(this, r, o2);
|
|
2578
2579
|
return n;
|
|
2579
2580
|
}
|
|
2580
2581
|
reverse() {
|
|
@@ -2586,14 +2587,14 @@ var ri = class s2 {
|
|
|
2586
2587
|
return this.head = e2, this.tail = t, this;
|
|
2587
2588
|
}
|
|
2588
2589
|
};
|
|
2589
|
-
function
|
|
2590
|
+
function Bn(s3, t, e2) {
|
|
2590
2591
|
let i = t, r = t ? t.next : s3.head, n = new ue2(e2, i, r, s3);
|
|
2591
2592
|
return n.next === void 0 && (s3.tail = n), n.prev === void 0 && (s3.head = n), s3.length++, n;
|
|
2592
2593
|
}
|
|
2593
|
-
function
|
|
2594
|
+
function Pn(s3, t) {
|
|
2594
2595
|
s3.tail = new ue2(t, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
|
|
2595
2596
|
}
|
|
2596
|
-
function
|
|
2597
|
+
function zn(s3, t) {
|
|
2597
2598
|
s3.head = new ue2(t, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
|
|
2598
2599
|
}
|
|
2599
2600
|
var ue2 = class {
|
|
@@ -2605,7 +2606,7 @@ var ue2 = class {
|
|
|
2605
2606
|
this.list = r, this.value = t, e2 ? (e2.next = this, this.prev = e2) : this.prev = void 0, i ? (i.prev = this, this.next = i) : this.next = void 0;
|
|
2606
2607
|
}
|
|
2607
2608
|
};
|
|
2608
|
-
var
|
|
2609
|
+
var di = class {
|
|
2609
2610
|
path;
|
|
2610
2611
|
absolute;
|
|
2611
2612
|
entry;
|
|
@@ -2618,28 +2619,28 @@ var fi = class {
|
|
|
2618
2619
|
this.path = t || "./", this.absolute = e2;
|
|
2619
2620
|
}
|
|
2620
2621
|
};
|
|
2621
|
-
var
|
|
2622
|
-
var
|
|
2622
|
+
var tr = Buffer.alloc(1024);
|
|
2623
|
+
var oi = /* @__PURE__ */ Symbol("onStat");
|
|
2623
2624
|
var me = /* @__PURE__ */ Symbol("ended");
|
|
2624
2625
|
var W2 = /* @__PURE__ */ Symbol("queue");
|
|
2625
2626
|
var Ct = /* @__PURE__ */ Symbol("current");
|
|
2626
2627
|
var Ft = /* @__PURE__ */ Symbol("process");
|
|
2627
2628
|
var pe = /* @__PURE__ */ Symbol("processing");
|
|
2628
|
-
var
|
|
2629
|
+
var rs = /* @__PURE__ */ Symbol("processJob");
|
|
2629
2630
|
var G3 = /* @__PURE__ */ Symbol("jobs");
|
|
2630
|
-
var
|
|
2631
|
-
var
|
|
2632
|
-
var
|
|
2633
|
-
var
|
|
2634
|
-
var
|
|
2635
|
-
var
|
|
2636
|
-
var
|
|
2637
|
-
var
|
|
2638
|
-
var
|
|
2639
|
-
var
|
|
2640
|
-
var
|
|
2641
|
-
var
|
|
2642
|
-
var Et = class extends
|
|
2631
|
+
var ns = /* @__PURE__ */ Symbol("jobDone");
|
|
2632
|
+
var hi = /* @__PURE__ */ Symbol("addFSEntry");
|
|
2633
|
+
var er = /* @__PURE__ */ Symbol("addTarEntry");
|
|
2634
|
+
var as = /* @__PURE__ */ Symbol("stat");
|
|
2635
|
+
var ls = /* @__PURE__ */ Symbol("readdir");
|
|
2636
|
+
var ai = /* @__PURE__ */ Symbol("onreaddir");
|
|
2637
|
+
var li = /* @__PURE__ */ Symbol("pipe");
|
|
2638
|
+
var ir = /* @__PURE__ */ Symbol("entry");
|
|
2639
|
+
var os = /* @__PURE__ */ Symbol("entryOpt");
|
|
2640
|
+
var ci = /* @__PURE__ */ Symbol("writeEntryClass");
|
|
2641
|
+
var rr = /* @__PURE__ */ Symbol("write");
|
|
2642
|
+
var hs = /* @__PURE__ */ Symbol("ondrain");
|
|
2643
|
+
var Et = class extends D2 {
|
|
2643
2644
|
sync = false;
|
|
2644
2645
|
opt;
|
|
2645
2646
|
cwd;
|
|
@@ -2660,22 +2661,22 @@ var Et = class extends A2 {
|
|
|
2660
2661
|
mtime;
|
|
2661
2662
|
filter;
|
|
2662
2663
|
jobs;
|
|
2663
|
-
[
|
|
2664
|
+
[ci];
|
|
2664
2665
|
onWriteEntry;
|
|
2665
2666
|
[W2];
|
|
2666
2667
|
[G3] = 0;
|
|
2667
2668
|
[pe] = false;
|
|
2668
2669
|
[me] = false;
|
|
2669
2670
|
constructor(t = {}) {
|
|
2670
|
-
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 = f3(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[
|
|
2671
|
+
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 = f3(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[ci] = de2, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
|
|
2671
2672
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
2672
|
-
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new
|
|
2673
|
+
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new Pe2(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new He(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ze(t.zstd)), !this.zip) throw new Error("impossible");
|
|
2673
2674
|
let e2 = this.zip;
|
|
2674
|
-
e2.on("data", (i) => super.write(i)), e2.on("end", () => super.end()), e2.on("drain", () => this[
|
|
2675
|
-
} else this.on("drain", this[
|
|
2676
|
-
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[W2] = new
|
|
2675
|
+
e2.on("data", (i) => super.write(i)), e2.on("end", () => super.end()), e2.on("drain", () => this[hs]()), this.on("resume", () => e2.resume());
|
|
2676
|
+
} else this.on("drain", this[hs]);
|
|
2677
|
+
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[W2] = new ni(), this[G3] = 0, this.jobs = Number(t.jobs) || 4, this[pe] = false, this[me] = false;
|
|
2677
2678
|
}
|
|
2678
|
-
[
|
|
2679
|
+
[rr](t) {
|
|
2679
2680
|
return super.write(t);
|
|
2680
2681
|
}
|
|
2681
2682
|
add(t) {
|
|
@@ -2686,97 +2687,97 @@ var Et = class extends A2 {
|
|
|
2686
2687
|
}
|
|
2687
2688
|
write(t) {
|
|
2688
2689
|
if (this[me]) throw new Error("write after end");
|
|
2689
|
-
return t instanceof Yt ? this[
|
|
2690
|
+
return t instanceof Yt ? this[er](t) : this[hi](t), this.flowing;
|
|
2690
2691
|
}
|
|
2691
|
-
[
|
|
2692
|
+
[er](t) {
|
|
2692
2693
|
let e2 = f3(import_path3.default.resolve(this.cwd, t.path));
|
|
2693
2694
|
if (!this.filter(t.path, t)) t.resume();
|
|
2694
2695
|
else {
|
|
2695
|
-
let i = new
|
|
2696
|
-
i.entry = new
|
|
2696
|
+
let i = new di(t.path, e2);
|
|
2697
|
+
i.entry = new ri(t, this[os](i)), i.entry.on("end", () => this[ns](i)), this[G3] += 1, this[W2].push(i);
|
|
2697
2698
|
}
|
|
2698
2699
|
this[Ft]();
|
|
2699
2700
|
}
|
|
2700
|
-
[
|
|
2701
|
+
[hi](t) {
|
|
2701
2702
|
let e2 = f3(import_path3.default.resolve(this.cwd, t));
|
|
2702
|
-
this[W2].push(new
|
|
2703
|
+
this[W2].push(new di(t, e2)), this[Ft]();
|
|
2703
2704
|
}
|
|
2704
|
-
[
|
|
2705
|
+
[as](t) {
|
|
2705
2706
|
t.pending = true, this[G3] += 1;
|
|
2706
2707
|
let e2 = this.follow ? "stat" : "lstat";
|
|
2707
2708
|
import_fs2.default[e2](t.absolute, (i, r) => {
|
|
2708
|
-
t.pending = false, this[G3] -= 1, i ? this.emit("error", i) : this[
|
|
2709
|
+
t.pending = false, this[G3] -= 1, i ? this.emit("error", i) : this[oi](t, r);
|
|
2709
2710
|
});
|
|
2710
2711
|
}
|
|
2711
|
-
[
|
|
2712
|
-
this.statCache.set(t.absolute, e2), t.stat = e2, this.filter(t.path, e2) ? e2.isFile() && e2.nlink > 1 && t === this[Ct] && !this.linkCache.get(`${e2.dev}:${e2.ino}`) && !this.sync && this[
|
|
2712
|
+
[oi](t, e2) {
|
|
2713
|
+
this.statCache.set(t.absolute, e2), t.stat = e2, this.filter(t.path, e2) ? e2.isFile() && e2.nlink > 1 && t === this[Ct] && !this.linkCache.get(`${e2.dev}:${e2.ino}`) && !this.sync && this[rs](t) : t.ignore = true, this[Ft]();
|
|
2713
2714
|
}
|
|
2714
|
-
[
|
|
2715
|
+
[ls](t) {
|
|
2715
2716
|
t.pending = true, this[G3] += 1, import_fs2.default.readdir(t.absolute, (e2, i) => {
|
|
2716
2717
|
if (t.pending = false, this[G3] -= 1, e2) return this.emit("error", e2);
|
|
2717
|
-
this[
|
|
2718
|
+
this[ai](t, i);
|
|
2718
2719
|
});
|
|
2719
2720
|
}
|
|
2720
|
-
[
|
|
2721
|
+
[ai](t, e2) {
|
|
2721
2722
|
this.readdirCache.set(t.absolute, e2), t.readdir = e2, this[Ft]();
|
|
2722
2723
|
}
|
|
2723
2724
|
[Ft]() {
|
|
2724
2725
|
if (!this[pe]) {
|
|
2725
2726
|
this[pe] = true;
|
|
2726
|
-
for (let t = this[W2].head; t && this[G3] < this.jobs; t = t.next) if (this[
|
|
2727
|
+
for (let t = this[W2].head; t && this[G3] < this.jobs; t = t.next) if (this[rs](t.value), t.value.ignore) {
|
|
2727
2728
|
let e2 = t.next;
|
|
2728
2729
|
this[W2].removeNode(t), t.next = e2;
|
|
2729
2730
|
}
|
|
2730
|
-
this[pe] = false, this[me] &&
|
|
2731
|
+
this[pe] = false, this[me] && this[W2].length === 0 && this[G3] === 0 && (this.zip ? this.zip.end(tr) : (super.write(tr), super.end()));
|
|
2731
2732
|
}
|
|
2732
2733
|
}
|
|
2733
2734
|
get [Ct]() {
|
|
2734
2735
|
return this[W2] && this[W2].head && this[W2].head.value;
|
|
2735
2736
|
}
|
|
2736
|
-
[
|
|
2737
|
+
[ns](t) {
|
|
2737
2738
|
this[W2].shift(), this[G3] -= 1, this[Ft]();
|
|
2738
2739
|
}
|
|
2739
|
-
[
|
|
2740
|
+
[rs](t) {
|
|
2740
2741
|
if (!t.pending) {
|
|
2741
2742
|
if (t.entry) {
|
|
2742
|
-
t === this[Ct] && !t.piped && this[
|
|
2743
|
+
t === this[Ct] && !t.piped && this[li](t);
|
|
2743
2744
|
return;
|
|
2744
2745
|
}
|
|
2745
2746
|
if (!t.stat) {
|
|
2746
2747
|
let e2 = this.statCache.get(t.absolute);
|
|
2747
|
-
e2 ? this[
|
|
2748
|
+
e2 ? this[oi](t, e2) : this[as](t);
|
|
2748
2749
|
}
|
|
2749
2750
|
if (t.stat && !t.ignore) {
|
|
2750
2751
|
if (!this.noDirRecurse && t.stat.isDirectory() && !t.readdir) {
|
|
2751
2752
|
let e2 = this.readdirCache.get(t.absolute);
|
|
2752
|
-
if (e2 ? this[
|
|
2753
|
+
if (e2 ? this[ai](t, e2) : this[ls](t), !t.readdir) return;
|
|
2753
2754
|
}
|
|
2754
|
-
if (t.entry = this[
|
|
2755
|
+
if (t.entry = this[ir](t), !t.entry) {
|
|
2755
2756
|
t.ignore = true;
|
|
2756
2757
|
return;
|
|
2757
2758
|
}
|
|
2758
|
-
t === this[Ct] && !t.piped && this[
|
|
2759
|
+
t === this[Ct] && !t.piped && this[li](t);
|
|
2759
2760
|
}
|
|
2760
2761
|
}
|
|
2761
2762
|
}
|
|
2762
|
-
[
|
|
2763
|
+
[os](t) {
|
|
2763
2764
|
return { onwarn: (e2, i, r) => this.warn(e2, 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 };
|
|
2764
2765
|
}
|
|
2765
|
-
[
|
|
2766
|
+
[ir](t) {
|
|
2766
2767
|
this[G3] += 1;
|
|
2767
2768
|
try {
|
|
2768
|
-
return new this[
|
|
2769
|
+
return new this[ci](t.path, this[os](t)).on("end", () => this[ns](t)).on("error", (i) => this.emit("error", i));
|
|
2769
2770
|
} catch (e2) {
|
|
2770
2771
|
this.emit("error", e2);
|
|
2771
2772
|
}
|
|
2772
2773
|
}
|
|
2773
|
-
[
|
|
2774
|
+
[hs]() {
|
|
2774
2775
|
this[Ct] && this[Ct].entry && this[Ct].entry.resume();
|
|
2775
2776
|
}
|
|
2776
|
-
[
|
|
2777
|
+
[li](t) {
|
|
2777
2778
|
t.piped = true, t.readdir && t.readdir.forEach((r) => {
|
|
2778
2779
|
let n = t.path, o2 = n === "./" ? "" : n.replace(/\/*$/, "/");
|
|
2779
|
-
this[
|
|
2780
|
+
this[hi](o2 + r);
|
|
2780
2781
|
});
|
|
2781
2782
|
let e2 = t.entry, i = this.zip;
|
|
2782
2783
|
if (!e2) throw new Error("cannot pipe without source");
|
|
@@ -2796,131 +2797,129 @@ var Et = class extends A2 {
|
|
|
2796
2797
|
var kt = class extends Et {
|
|
2797
2798
|
sync = true;
|
|
2798
2799
|
constructor(t) {
|
|
2799
|
-
super(t), this[
|
|
2800
|
+
super(t), this[ci] = si;
|
|
2800
2801
|
}
|
|
2801
2802
|
pause() {
|
|
2802
2803
|
}
|
|
2803
2804
|
resume() {
|
|
2804
2805
|
}
|
|
2805
|
-
[
|
|
2806
|
+
[as](t) {
|
|
2806
2807
|
let e2 = this.follow ? "statSync" : "lstatSync";
|
|
2807
|
-
this[
|
|
2808
|
+
this[oi](t, import_fs2.default[e2](t.absolute));
|
|
2808
2809
|
}
|
|
2809
|
-
[
|
|
2810
|
-
this[
|
|
2810
|
+
[ls](t) {
|
|
2811
|
+
this[ai](t, import_fs2.default.readdirSync(t.absolute));
|
|
2811
2812
|
}
|
|
2812
|
-
[
|
|
2813
|
+
[li](t) {
|
|
2813
2814
|
let e2 = t.entry, i = this.zip;
|
|
2814
2815
|
if (t.readdir && t.readdir.forEach((r) => {
|
|
2815
2816
|
let n = t.path, o2 = n === "./" ? "" : n.replace(/\/*$/, "/");
|
|
2816
|
-
this[
|
|
2817
|
+
this[hi](o2 + r);
|
|
2817
2818
|
}), !e2) throw new Error("Cannot pipe without source");
|
|
2818
2819
|
i ? e2.on("data", (r) => {
|
|
2819
2820
|
i.write(r);
|
|
2820
2821
|
}) : e2.on("data", (r) => {
|
|
2821
|
-
super[
|
|
2822
|
+
super[rr](r);
|
|
2822
2823
|
});
|
|
2823
2824
|
}
|
|
2824
2825
|
};
|
|
2825
|
-
var
|
|
2826
|
+
var Un = (s3, t) => {
|
|
2826
2827
|
let e2 = new kt(s3), i = new Wt(s3.file, { mode: s3.mode || 438 });
|
|
2827
|
-
e2.pipe(i),
|
|
2828
|
+
e2.pipe(i), or(e2, t);
|
|
2828
2829
|
};
|
|
2829
|
-
var
|
|
2830
|
+
var Hn = (s3, t) => {
|
|
2830
2831
|
let e2 = new Et(s3), i = new tt(s3.file, { mode: s3.mode || 438 });
|
|
2831
2832
|
e2.pipe(i);
|
|
2832
2833
|
let r = new Promise((n, o2) => {
|
|
2833
2834
|
i.on("error", o2), i.on("close", n), e2.on("error", o2);
|
|
2834
2835
|
});
|
|
2835
|
-
return
|
|
2836
|
+
return hr(e2, t).catch((n) => e2.emit("error", n)), r;
|
|
2836
2837
|
};
|
|
2837
|
-
var
|
|
2838
|
+
var or = (s3, t) => {
|
|
2838
2839
|
t.forEach((e2) => {
|
|
2839
2840
|
e2.charAt(0) === "@" ? It({ file: import_node_path.default.resolve(s3.cwd, e2.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e2);
|
|
2840
2841
|
}), s3.end();
|
|
2841
2842
|
};
|
|
2842
|
-
var
|
|
2843
|
-
for (let e2
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
s3.add(r);
|
|
2847
|
-
} }) : s3.add(i);
|
|
2848
|
-
}
|
|
2843
|
+
var hr = async (s3, t) => {
|
|
2844
|
+
for (let e2 of t) e2.charAt(0) === "@" ? await It({ file: import_node_path.default.resolve(String(s3.cwd), e2.slice(1)), noResume: true, onReadEntry: (i) => {
|
|
2845
|
+
s3.add(i);
|
|
2846
|
+
} }) : s3.add(e2);
|
|
2849
2847
|
s3.end();
|
|
2850
2848
|
};
|
|
2851
|
-
var
|
|
2849
|
+
var Wn = (s3, t) => {
|
|
2852
2850
|
let e2 = new kt(s3);
|
|
2853
|
-
return
|
|
2851
|
+
return or(e2, t), e2;
|
|
2854
2852
|
};
|
|
2855
|
-
var
|
|
2853
|
+
var Gn = (s3, t) => {
|
|
2856
2854
|
let e2 = new Et(s3);
|
|
2857
|
-
return
|
|
2855
|
+
return hr(e2, t).catch((i) => e2.emit("error", i)), e2;
|
|
2858
2856
|
};
|
|
2859
|
-
var
|
|
2857
|
+
var Zn = K3(Un, Hn, Wn, Gn, (s3, t) => {
|
|
2860
2858
|
if (!t?.length) throw new TypeError("no paths specified to add to archive");
|
|
2861
2859
|
});
|
|
2862
|
-
var
|
|
2863
|
-
var
|
|
2864
|
-
var { O_CREAT:
|
|
2865
|
-
var
|
|
2866
|
-
var
|
|
2867
|
-
var
|
|
2868
|
-
var
|
|
2869
|
-
var
|
|
2870
|
-
var cs = (s3
|
|
2860
|
+
var Yn = process.env.__FAKE_PLATFORM__ || process.platform;
|
|
2861
|
+
var fr = Yn === "win32";
|
|
2862
|
+
var { O_CREAT: dr, O_NOFOLLOW: ar, O_TRUNC: ur, O_WRONLY: mr } = import_fs4.default.constants;
|
|
2863
|
+
var pr = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs4.default.constants.UV_FS_O_FILEMAP || 0;
|
|
2864
|
+
var Kn = fr && !!pr;
|
|
2865
|
+
var Vn = 512 * 1024;
|
|
2866
|
+
var $n = pr | ur | dr | mr;
|
|
2867
|
+
var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
|
|
2868
|
+
var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
|
|
2869
|
+
var fs = (s3, t, e2) => {
|
|
2871
2870
|
try {
|
|
2872
2871
|
return import_node_fs4.default.lchownSync(s3, t, e2);
|
|
2873
2872
|
} catch (i) {
|
|
2874
2873
|
if (i?.code !== "ENOENT") throw i;
|
|
2875
2874
|
}
|
|
2876
2875
|
};
|
|
2877
|
-
var
|
|
2876
|
+
var ui = (s3, t, e2, i) => {
|
|
2878
2877
|
import_node_fs4.default.lchown(s3, t, e2, (r) => {
|
|
2879
2878
|
i(r && r?.code !== "ENOENT" ? r : null);
|
|
2880
2879
|
});
|
|
2881
2880
|
};
|
|
2882
|
-
var
|
|
2883
|
-
if (t.isDirectory())
|
|
2881
|
+
var Xn = (s3, t, e2, i, r) => {
|
|
2882
|
+
if (t.isDirectory()) ds(import_node_path6.default.resolve(s3, t.name), e2, i, (n) => {
|
|
2884
2883
|
if (n) return r(n);
|
|
2885
2884
|
let o2 = import_node_path6.default.resolve(s3, t.name);
|
|
2886
|
-
|
|
2885
|
+
ui(o2, e2, i, r);
|
|
2887
2886
|
});
|
|
2888
2887
|
else {
|
|
2889
2888
|
let n = import_node_path6.default.resolve(s3, t.name);
|
|
2890
|
-
|
|
2889
|
+
ui(n, e2, i, r);
|
|
2891
2890
|
}
|
|
2892
2891
|
};
|
|
2893
|
-
var
|
|
2892
|
+
var ds = (s3, t, e2, i) => {
|
|
2894
2893
|
import_node_fs4.default.readdir(s3, { withFileTypes: true }, (r, n) => {
|
|
2895
2894
|
if (r) {
|
|
2896
2895
|
if (r.code === "ENOENT") return i();
|
|
2897
2896
|
if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
|
|
2898
2897
|
}
|
|
2899
|
-
if (r || !n.length) return
|
|
2898
|
+
if (r || !n.length) return ui(s3, t, e2, i);
|
|
2900
2899
|
let o2 = n.length, h3 = null, a = (l) => {
|
|
2901
2900
|
if (!h3) {
|
|
2902
2901
|
if (l) return i(h3 = l);
|
|
2903
|
-
if (--o2 === 0) return
|
|
2902
|
+
if (--o2 === 0) return ui(s3, t, e2, i);
|
|
2904
2903
|
}
|
|
2905
2904
|
};
|
|
2906
|
-
for (let l of n)
|
|
2905
|
+
for (let l of n) Xn(s3, l, t, e2, a);
|
|
2907
2906
|
});
|
|
2908
2907
|
};
|
|
2909
|
-
var
|
|
2910
|
-
t.isDirectory() &&
|
|
2908
|
+
var qn = (s3, t, e2, i) => {
|
|
2909
|
+
t.isDirectory() && us(import_node_path6.default.resolve(s3, t.name), e2, i), fs(import_node_path6.default.resolve(s3, t.name), e2, i);
|
|
2911
2910
|
};
|
|
2912
|
-
var
|
|
2911
|
+
var us = (s3, t, e2) => {
|
|
2913
2912
|
let i;
|
|
2914
2913
|
try {
|
|
2915
2914
|
i = import_node_fs4.default.readdirSync(s3, { withFileTypes: true });
|
|
2916
2915
|
} catch (r) {
|
|
2917
2916
|
let n = r;
|
|
2918
2917
|
if (n?.code === "ENOENT") return;
|
|
2919
|
-
if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return
|
|
2918
|
+
if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return fs(s3, t, e2);
|
|
2920
2919
|
throw n;
|
|
2921
2920
|
}
|
|
2922
|
-
for (let r of i)
|
|
2923
|
-
return
|
|
2921
|
+
for (let r of i) qn(s3, r, t, e2);
|
|
2922
|
+
return fs(s3, t, e2);
|
|
2924
2923
|
};
|
|
2925
2924
|
var we = class extends Error {
|
|
2926
2925
|
path;
|
|
@@ -2945,41 +2944,41 @@ var wt = class extends Error {
|
|
|
2945
2944
|
return "SymlinkError";
|
|
2946
2945
|
}
|
|
2947
2946
|
};
|
|
2948
|
-
var
|
|
2947
|
+
var Qn = (s3, t) => {
|
|
2949
2948
|
import_node_fs5.default.stat(s3, (e2, i) => {
|
|
2950
2949
|
(e2 || !i.isDirectory()) && (e2 = new we(s3, e2?.code || "ENOTDIR")), t(e2);
|
|
2951
2950
|
});
|
|
2952
2951
|
};
|
|
2953
|
-
var
|
|
2952
|
+
var Er = (s3, t, e2) => {
|
|
2954
2953
|
s3 = f3(s3);
|
|
2955
2954
|
let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o2 = t.uid, h3 = t.gid, a = typeof o2 == "number" && typeof h3 == "number" && (o2 !== t.processUid || h3 !== t.processGid), l = t.preserve, c2 = t.unlink, d2 = f3(t.cwd), S2 = (E3, x3) => {
|
|
2956
|
-
E3 ? e2(E3) : x3 && a ?
|
|
2955
|
+
E3 ? e2(E3) : x3 && a ? ds(x3, o2, h3, (xe) => S2(xe)) : n ? import_node_fs5.default.chmod(s3, r, e2) : e2();
|
|
2957
2956
|
};
|
|
2958
|
-
if (s3 === d2) return
|
|
2957
|
+
if (s3 === d2) return Qn(s3, S2);
|
|
2959
2958
|
if (l) return import_promises.default.mkdir(s3, { mode: r, recursive: true }).then((E3) => S2(null, E3 ?? void 0), S2);
|
|
2960
2959
|
let N2 = f3(import_node_path7.default.relative(d2, s3)).split("/");
|
|
2961
|
-
|
|
2960
|
+
ms(d2, N2, r, c2, d2, void 0, S2);
|
|
2962
2961
|
};
|
|
2963
|
-
var
|
|
2964
|
-
if (
|
|
2962
|
+
var ms = (s3, t, e2, i, r, n, o2) => {
|
|
2963
|
+
if (t.length === 0) return o2(null, n);
|
|
2965
2964
|
let h3 = t.shift(), a = f3(import_node_path7.default.resolve(s3 + "/" + h3));
|
|
2966
|
-
import_node_fs5.default.mkdir(a, e2,
|
|
2965
|
+
import_node_fs5.default.mkdir(a, e2, wr(a, t, e2, i, r, n, o2));
|
|
2967
2966
|
};
|
|
2968
|
-
var
|
|
2967
|
+
var wr = (s3, t, e2, i, r, n, o2) => (h3) => {
|
|
2969
2968
|
h3 ? import_node_fs5.default.lstat(s3, (a, l) => {
|
|
2970
2969
|
if (a) a.path = a.path && f3(a.path), o2(a);
|
|
2971
|
-
else if (l.isDirectory())
|
|
2970
|
+
else if (l.isDirectory()) ms(s3, t, e2, i, r, n, o2);
|
|
2972
2971
|
else if (i) import_node_fs5.default.unlink(s3, (c2) => {
|
|
2973
2972
|
if (c2) return o2(c2);
|
|
2974
|
-
import_node_fs5.default.mkdir(s3, e2,
|
|
2973
|
+
import_node_fs5.default.mkdir(s3, e2, wr(s3, t, e2, i, r, n, o2));
|
|
2975
2974
|
});
|
|
2976
2975
|
else {
|
|
2977
2976
|
if (l.isSymbolicLink()) return o2(new wt(s3, s3 + "/" + t.join("/")));
|
|
2978
2977
|
o2(h3);
|
|
2979
2978
|
}
|
|
2980
|
-
}) : (n = n || s3,
|
|
2979
|
+
}) : (n = n || s3, ms(s3, t, e2, i, r, n, o2));
|
|
2981
2980
|
};
|
|
2982
|
-
var
|
|
2981
|
+
var Jn = (s3) => {
|
|
2983
2982
|
let t = false, e2;
|
|
2984
2983
|
try {
|
|
2985
2984
|
t = import_node_fs5.default.statSync(s3).isDirectory();
|
|
@@ -2989,12 +2988,12 @@ var Qn = (s3) => {
|
|
|
2989
2988
|
if (!t) throw new we(s3, e2 ?? "ENOTDIR");
|
|
2990
2989
|
}
|
|
2991
2990
|
};
|
|
2992
|
-
var
|
|
2991
|
+
var Sr = (s3, t) => {
|
|
2993
2992
|
s3 = f3(s3);
|
|
2994
2993
|
let e2 = t.umask ?? 18, i = t.mode | 448, r = (i & e2) !== 0, n = t.uid, o2 = t.gid, h3 = typeof n == "number" && typeof o2 == "number" && (n !== t.processUid || o2 !== t.processGid), a = t.preserve, l = t.unlink, c2 = f3(t.cwd), d2 = (E3) => {
|
|
2995
|
-
E3 && h3 &&
|
|
2994
|
+
E3 && h3 && us(E3, n, o2), r && import_node_fs5.default.chmodSync(s3, i);
|
|
2996
2995
|
};
|
|
2997
|
-
if (s3 === c2) return
|
|
2996
|
+
if (s3 === c2) return Jn(c2), d2();
|
|
2998
2997
|
if (a) return d2(import_node_fs5.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
|
|
2999
2998
|
let T3 = f3(import_node_path7.default.relative(c2, s3)).split("/"), N2;
|
|
3000
2999
|
for (let E3 = T3.shift(), x3 = c2; E3 && (x3 += "/" + E3); E3 = T3.shift()) {
|
|
@@ -3002,40 +3001,40 @@ var ur = (s3, t) => {
|
|
|
3002
3001
|
try {
|
|
3003
3002
|
import_node_fs5.default.mkdirSync(x3, i), N2 = N2 || x3;
|
|
3004
3003
|
} catch {
|
|
3005
|
-
let
|
|
3006
|
-
if (
|
|
3004
|
+
let xe = import_node_fs5.default.lstatSync(x3);
|
|
3005
|
+
if (xe.isDirectory()) continue;
|
|
3007
3006
|
if (l) {
|
|
3008
3007
|
import_node_fs5.default.unlinkSync(x3), import_node_fs5.default.mkdirSync(x3, i), N2 = N2 || x3;
|
|
3009
3008
|
continue;
|
|
3010
|
-
} else if (
|
|
3009
|
+
} else if (xe.isSymbolicLink()) return new wt(x3, x3 + "/" + T3.join("/"));
|
|
3011
3010
|
}
|
|
3012
3011
|
}
|
|
3013
3012
|
return d2(N2);
|
|
3014
3013
|
};
|
|
3015
|
-
var
|
|
3016
|
-
var
|
|
3014
|
+
var ps = /* @__PURE__ */ Object.create(null);
|
|
3015
|
+
var yr = 1e4;
|
|
3017
3016
|
var $t = /* @__PURE__ */ new Set();
|
|
3018
|
-
var
|
|
3019
|
-
$t.has(s3) ? $t.delete(s3) :
|
|
3020
|
-
let t =
|
|
3021
|
-
if (e2 >
|
|
3022
|
-
for (let i of $t) if ($t.delete(i), delete
|
|
3017
|
+
var Rr = (s3) => {
|
|
3018
|
+
$t.has(s3) ? $t.delete(s3) : ps[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), $t.add(s3);
|
|
3019
|
+
let t = ps[s3], e2 = $t.size - yr;
|
|
3020
|
+
if (e2 > yr / 10) {
|
|
3021
|
+
for (let i of $t) if ($t.delete(i), delete ps[i], --e2 <= 0) break;
|
|
3023
3022
|
}
|
|
3024
3023
|
return t;
|
|
3025
3024
|
};
|
|
3026
|
-
var
|
|
3027
|
-
var
|
|
3028
|
-
var
|
|
3029
|
-
let r = e2
|
|
3025
|
+
var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
3026
|
+
var eo = to === "win32";
|
|
3027
|
+
var io = (s3) => s3.split("/").slice(0, -1).reduce((e2, i) => {
|
|
3028
|
+
let r = e2.at(-1);
|
|
3030
3029
|
return r !== void 0 && (i = (0, import_node_path8.join)(r, i)), e2.push(i || "/"), e2;
|
|
3031
3030
|
}, []);
|
|
3032
|
-
var
|
|
3031
|
+
var Ei = class {
|
|
3033
3032
|
#t = /* @__PURE__ */ new Map();
|
|
3034
3033
|
#i = /* @__PURE__ */ new Map();
|
|
3035
3034
|
#s = /* @__PURE__ */ new Set();
|
|
3036
3035
|
reserve(t, e2) {
|
|
3037
|
-
t =
|
|
3038
|
-
let i = new Set(t.map((r) =>
|
|
3036
|
+
t = eo ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path8.join)(Rr(r))));
|
|
3037
|
+
let i = new Set(t.map((r) => io(r)).reduce((r, n) => r.concat(n)));
|
|
3039
3038
|
this.#i.set(e2, { dirs: i, paths: t });
|
|
3040
3039
|
for (let r of t) {
|
|
3041
3040
|
let n = this.#t.get(r);
|
|
@@ -3045,7 +3044,7 @@ var pi = class {
|
|
|
3045
3044
|
let n = this.#t.get(r);
|
|
3046
3045
|
if (!n) this.#t.set(r, [/* @__PURE__ */ new Set([e2])]);
|
|
3047
3046
|
else {
|
|
3048
|
-
let o2 = n
|
|
3047
|
+
let o2 = n.at(-1);
|
|
3049
3048
|
o2 instanceof Set ? o2.add(e2) : n.push(/* @__PURE__ */ new Set([e2]));
|
|
3050
3049
|
}
|
|
3051
3050
|
}
|
|
@@ -3093,37 +3092,37 @@ var pi = class {
|
|
|
3093
3092
|
return this.#s.delete(t), n.forEach((o2) => this.#r(o2)), true;
|
|
3094
3093
|
}
|
|
3095
3094
|
};
|
|
3096
|
-
var
|
|
3097
|
-
var
|
|
3098
|
-
var
|
|
3099
|
-
var
|
|
3100
|
-
var
|
|
3095
|
+
var _r = () => process.umask();
|
|
3096
|
+
var gr = /* @__PURE__ */ Symbol("onEntry");
|
|
3097
|
+
var ys = /* @__PURE__ */ Symbol("checkFs");
|
|
3098
|
+
var Or = /* @__PURE__ */ Symbol("checkFs2");
|
|
3099
|
+
var Rs = /* @__PURE__ */ Symbol("isReusable");
|
|
3101
3100
|
var P3 = /* @__PURE__ */ Symbol("makeFs");
|
|
3102
|
-
var
|
|
3103
|
-
var
|
|
3104
|
-
var
|
|
3105
|
-
var
|
|
3106
|
-
var
|
|
3101
|
+
var bs = /* @__PURE__ */ Symbol("file");
|
|
3102
|
+
var _s = /* @__PURE__ */ Symbol("directory");
|
|
3103
|
+
var Si = /* @__PURE__ */ Symbol("link");
|
|
3104
|
+
var Tr = /* @__PURE__ */ Symbol("symlink");
|
|
3105
|
+
var xr = /* @__PURE__ */ Symbol("hardlink");
|
|
3107
3106
|
var ye = /* @__PURE__ */ Symbol("ensureNoSymlink");
|
|
3108
|
-
var
|
|
3109
|
-
var
|
|
3110
|
-
var
|
|
3107
|
+
var Lr = /* @__PURE__ */ Symbol("unsupported");
|
|
3108
|
+
var Nr = /* @__PURE__ */ Symbol("checkPath");
|
|
3109
|
+
var Es = /* @__PURE__ */ Symbol("stripAbsolutePath");
|
|
3111
3110
|
var St = /* @__PURE__ */ Symbol("mkdir");
|
|
3112
3111
|
var O3 = /* @__PURE__ */ Symbol("onError");
|
|
3113
|
-
var
|
|
3114
|
-
var
|
|
3112
|
+
var wi = /* @__PURE__ */ Symbol("pending");
|
|
3113
|
+
var Ar = /* @__PURE__ */ Symbol("pend");
|
|
3115
3114
|
var Xt = /* @__PURE__ */ Symbol("unpend");
|
|
3116
|
-
var
|
|
3117
|
-
var
|
|
3115
|
+
var ws = /* @__PURE__ */ Symbol("ended");
|
|
3116
|
+
var Ss = /* @__PURE__ */ Symbol("maybeClose");
|
|
3118
3117
|
var gs = /* @__PURE__ */ Symbol("skip");
|
|
3119
3118
|
var Re = /* @__PURE__ */ Symbol("doChown");
|
|
3120
3119
|
var be = /* @__PURE__ */ Symbol("uid");
|
|
3121
|
-
var
|
|
3122
|
-
var
|
|
3123
|
-
var
|
|
3124
|
-
var Oe =
|
|
3125
|
-
var
|
|
3126
|
-
var
|
|
3120
|
+
var _e = /* @__PURE__ */ Symbol("gid");
|
|
3121
|
+
var ge = /* @__PURE__ */ Symbol("checkedCwd");
|
|
3122
|
+
var ro = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
3123
|
+
var Oe = ro === "win32";
|
|
3124
|
+
var no = 1024;
|
|
3125
|
+
var oo = (s3, t) => {
|
|
3127
3126
|
if (!Oe) return import_node_fs3.default.unlink(s3, t);
|
|
3128
3127
|
let e2 = s3 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex");
|
|
3129
3128
|
import_node_fs3.default.rename(s3, e2, (i) => {
|
|
@@ -3131,17 +3130,17 @@ var no = (s3, t) => {
|
|
|
3131
3130
|
import_node_fs3.default.unlink(e2, t);
|
|
3132
3131
|
});
|
|
3133
3132
|
};
|
|
3134
|
-
var
|
|
3133
|
+
var ho = (s3) => {
|
|
3135
3134
|
if (!Oe) return import_node_fs3.default.unlinkSync(s3);
|
|
3136
3135
|
let t = s3 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex");
|
|
3137
3136
|
import_node_fs3.default.renameSync(s3, t), import_node_fs3.default.unlinkSync(t);
|
|
3138
3137
|
};
|
|
3139
|
-
var
|
|
3138
|
+
var Dr = (s3, t, e2) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e2;
|
|
3140
3139
|
var qt = class extends st {
|
|
3141
|
-
[
|
|
3142
|
-
[
|
|
3143
|
-
[
|
|
3144
|
-
reservations = new
|
|
3140
|
+
[ws] = false;
|
|
3141
|
+
[ge] = false;
|
|
3142
|
+
[wi] = 0;
|
|
3143
|
+
reservations = new Ei();
|
|
3145
3144
|
transform;
|
|
3146
3145
|
writable = true;
|
|
3147
3146
|
readable = false;
|
|
@@ -3168,34 +3167,32 @@ var qt = class extends st {
|
|
|
3168
3167
|
chmod;
|
|
3169
3168
|
constructor(t = {}) {
|
|
3170
3169
|
if (t.ondone = () => {
|
|
3171
|
-
this[
|
|
3170
|
+
this[ws] = true, this[Ss]();
|
|
3172
3171
|
}, super(t), this.transform = t.transform, this.chmod = !!t.chmod, typeof t.uid == "number" || typeof t.gid == "number") {
|
|
3173
3172
|
if (typeof t.uid != "number" || typeof t.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
|
|
3174
3173
|
if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
3175
3174
|
this.uid = t.uid, this.gid = t.gid, this.setOwner = true;
|
|
3176
3175
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = false;
|
|
3177
|
-
t.preserveOwner === void 0 && typeof t.uid != "number" ?
|
|
3176
|
+
this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : no, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Oe, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f3(import_node_path5.default.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : _r() : 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", (e2) => this[gr](e2));
|
|
3178
3177
|
}
|
|
3179
3178
|
warn(t, e2, i = {}) {
|
|
3180
3179
|
return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = false), super.warn(t, e2, i);
|
|
3181
3180
|
}
|
|
3182
|
-
[
|
|
3183
|
-
this[
|
|
3181
|
+
[Ss]() {
|
|
3182
|
+
this[ws] && this[wi] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
|
|
3184
3183
|
}
|
|
3185
|
-
[
|
|
3184
|
+
[Es](t, e2) {
|
|
3186
3185
|
let i = t[e2], { type: r } = t;
|
|
3187
3186
|
if (!i || this.preservePaths) return true;
|
|
3188
|
-
let [n, o2] = ce2(i), h3 = o2.
|
|
3187
|
+
let [n, o2] = ce2(i), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
3189
3188
|
if (h3.includes("..") || Oe && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
3190
3189
|
if (e2 === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e2} contains '..'`, { entry: t, [e2]: i }), false;
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e2} escapes extraction directory`, { entry: t, [e2]: i }), false;
|
|
3194
|
-
}
|
|
3190
|
+
let a = import_node_path5.default.posix.dirname(t.path), l = import_node_path5.default.posix.normalize(import_node_path5.default.posix.join(a, h3.join("/")));
|
|
3191
|
+
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e2} escapes extraction directory`, { entry: t, [e2]: i }), false;
|
|
3195
3192
|
}
|
|
3196
3193
|
return n && (t[e2] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e2}`, { entry: t, [e2]: i })), true;
|
|
3197
3194
|
}
|
|
3198
|
-
[
|
|
3195
|
+
[Nr](t) {
|
|
3199
3196
|
let e2 = f3(t.path), i = e2.split("/");
|
|
3200
3197
|
if (this.strip) {
|
|
3201
3198
|
if (i.length < this.strip) return false;
|
|
@@ -3207,19 +3204,19 @@ var qt = class extends st {
|
|
|
3207
3204
|
i.splice(0, this.strip), t.path = i.join("/");
|
|
3208
3205
|
}
|
|
3209
3206
|
if (isFinite(this.maxDepth) && i.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t, path: e2, depth: i.length, maxDepth: this.maxDepth }), false;
|
|
3210
|
-
if (!this[
|
|
3211
|
-
if (import_node_path5.default.isAbsolute(t.path) ?
|
|
3207
|
+
if (!this[Es](t, "path") || !this[Es](t, "linkpath")) return false;
|
|
3208
|
+
if (t.absolute = import_node_path5.default.isAbsolute(t.path) ? f3(import_node_path5.default.resolve(t.path)) : f3(import_node_path5.default.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: f3(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
|
|
3212
3209
|
if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return false;
|
|
3213
3210
|
if (this.win32) {
|
|
3214
3211
|
let { root: r } = import_node_path5.default.win32.parse(String(t.absolute));
|
|
3215
|
-
t.absolute = r +
|
|
3212
|
+
t.absolute = r + Xi(String(t.absolute).slice(r.length));
|
|
3216
3213
|
let { root: n } = import_node_path5.default.win32.parse(t.path);
|
|
3217
|
-
t.path = n +
|
|
3214
|
+
t.path = n + Xi(t.path.slice(n.length));
|
|
3218
3215
|
}
|
|
3219
3216
|
return true;
|
|
3220
3217
|
}
|
|
3221
|
-
[
|
|
3222
|
-
if (!this[
|
|
3218
|
+
[gr](t) {
|
|
3219
|
+
if (!this[Nr](t)) return t.resume();
|
|
3223
3220
|
switch (import_node_assert.default.equal(typeof t.absolute, "string"), t.type) {
|
|
3224
3221
|
case "Directory":
|
|
3225
3222
|
case "GNUDumpDir":
|
|
@@ -3229,28 +3226,28 @@ var qt = class extends st {
|
|
|
3229
3226
|
case "ContiguousFile":
|
|
3230
3227
|
case "Link":
|
|
3231
3228
|
case "SymbolicLink":
|
|
3232
|
-
return this[
|
|
3229
|
+
return this[ys](t);
|
|
3233
3230
|
default:
|
|
3234
|
-
return this[
|
|
3231
|
+
return this[Lr](t);
|
|
3235
3232
|
}
|
|
3236
3233
|
}
|
|
3237
3234
|
[O3](t, e2) {
|
|
3238
3235
|
t.name === "CwdError" ? this.emit("error", t) : (this.warn("TAR_ENTRY_ERROR", t, { entry: e2 }), this[Xt](), e2.resume());
|
|
3239
3236
|
}
|
|
3240
3237
|
[St](t, e2, i) {
|
|
3241
|
-
|
|
3238
|
+
Er(f3(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: e2 }, i);
|
|
3242
3239
|
}
|
|
3243
3240
|
[Re](t) {
|
|
3244
3241
|
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;
|
|
3245
3242
|
}
|
|
3246
3243
|
[be](t) {
|
|
3247
|
-
return
|
|
3244
|
+
return Dr(this.uid, t.uid, this.processUid);
|
|
3248
3245
|
}
|
|
3249
|
-
[
|
|
3250
|
-
return
|
|
3246
|
+
[_e](t) {
|
|
3247
|
+
return Dr(this.gid, t.gid, this.processGid);
|
|
3251
3248
|
}
|
|
3252
|
-
[
|
|
3253
|
-
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new tt(String(t.absolute), { flags:
|
|
3249
|
+
[bs](t, e2) {
|
|
3250
|
+
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new tt(String(t.absolute), { flags: cs(t.size), mode: i, autoClose: false });
|
|
3254
3251
|
r.on("error", (a) => {
|
|
3255
3252
|
r.fd && import_node_fs3.default.close(r.fd, () => {
|
|
3256
3253
|
}), r.write = () => true, this[O3](a, t), e2();
|
|
@@ -3274,7 +3271,7 @@ var qt = class extends st {
|
|
|
3274
3271
|
}
|
|
3275
3272
|
if (typeof l == "number" && this[Re](t)) {
|
|
3276
3273
|
n++;
|
|
3277
|
-
let c2 = this[be](t), d2 = this[
|
|
3274
|
+
let c2 = this[be](t), d2 = this[_e](t);
|
|
3278
3275
|
typeof c2 == "number" && typeof d2 == "number" && import_node_fs3.default.fchown(l, c2, d2, (S2) => S2 ? import_node_fs3.default.chown(a, c2, d2, (T3) => o2(T3 && S2)) : o2());
|
|
3279
3276
|
}
|
|
3280
3277
|
o2();
|
|
@@ -3284,7 +3281,7 @@ var qt = class extends st {
|
|
|
3284
3281
|
this[O3](a, t), e2();
|
|
3285
3282
|
}), t.pipe(h3)), h3.pipe(r);
|
|
3286
3283
|
}
|
|
3287
|
-
[
|
|
3284
|
+
[_s](t, e2) {
|
|
3288
3285
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode;
|
|
3289
3286
|
this[St](String(t.absolute), i, (r) => {
|
|
3290
3287
|
if (r) {
|
|
@@ -3294,21 +3291,21 @@ var qt = class extends st {
|
|
|
3294
3291
|
let n = 1, o2 = () => {
|
|
3295
3292
|
--n === 0 && (e2(), this[Xt](), t.resume());
|
|
3296
3293
|
};
|
|
3297
|
-
t.mtime && !this.noMtime && (n++, import_node_fs3.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o2)), this[Re](t) && (n++, import_node_fs3.default.chown(String(t.absolute), Number(this[be](t)), Number(this[
|
|
3294
|
+
t.mtime && !this.noMtime && (n++, import_node_fs3.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o2)), this[Re](t) && (n++, import_node_fs3.default.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o2)), o2();
|
|
3298
3295
|
});
|
|
3299
3296
|
}
|
|
3300
|
-
[
|
|
3297
|
+
[Lr](t) {
|
|
3301
3298
|
t.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
|
|
3302
3299
|
}
|
|
3303
|
-
[
|
|
3300
|
+
[Tr](t, e2) {
|
|
3304
3301
|
let i = f3(import_node_path5.default.relative(this.cwd, import_node_path5.default.resolve(import_node_path5.default.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
|
|
3305
|
-
this[ye](t, this.cwd, i, () => this[
|
|
3302
|
+
this[ye](t, this.cwd, i, () => this[Si](t, String(t.linkpath), "symlink", e2), (r) => {
|
|
3306
3303
|
this[O3](r, t), e2();
|
|
3307
3304
|
});
|
|
3308
3305
|
}
|
|
3309
|
-
[
|
|
3306
|
+
[xr](t, e2) {
|
|
3310
3307
|
let i = f3(import_node_path5.default.resolve(this.cwd, String(t.linkpath))), r = f3(String(t.linkpath)).split("/");
|
|
3311
|
-
this[ye](t, this.cwd, r, () => this[
|
|
3308
|
+
this[ye](t, this.cwd, r, () => this[Si](t, i, "link", e2), (n) => {
|
|
3312
3309
|
this[O3](n, t), e2();
|
|
3313
3310
|
});
|
|
3314
3311
|
}
|
|
@@ -3322,24 +3319,24 @@ var qt = class extends st {
|
|
|
3322
3319
|
this[ye](t, h3, i, r, n);
|
|
3323
3320
|
});
|
|
3324
3321
|
}
|
|
3325
|
-
[
|
|
3326
|
-
this[
|
|
3322
|
+
[Ar]() {
|
|
3323
|
+
this[wi]++;
|
|
3327
3324
|
}
|
|
3328
3325
|
[Xt]() {
|
|
3329
|
-
this[
|
|
3326
|
+
this[wi]--, this[Ss]();
|
|
3330
3327
|
}
|
|
3331
3328
|
[gs](t) {
|
|
3332
3329
|
this[Xt](), t.resume();
|
|
3333
3330
|
}
|
|
3334
|
-
[
|
|
3331
|
+
[Rs](t, e2) {
|
|
3335
3332
|
return t.type === "File" && !this.unlink && e2.isFile() && e2.nlink <= 1 && !Oe;
|
|
3336
3333
|
}
|
|
3337
|
-
[
|
|
3338
|
-
this[
|
|
3334
|
+
[ys](t) {
|
|
3335
|
+
this[Ar]();
|
|
3339
3336
|
let e2 = [t.path];
|
|
3340
|
-
t.linkpath && e2.push(t.linkpath), this.reservations.reserve(e2, (i) => this[
|
|
3337
|
+
t.linkpath && e2.push(t.linkpath), this.reservations.reserve(e2, (i) => this[Or](t, i));
|
|
3341
3338
|
}
|
|
3342
|
-
[
|
|
3339
|
+
[Or](t, e2) {
|
|
3343
3340
|
let i = (h3) => {
|
|
3344
3341
|
e2(h3);
|
|
3345
3342
|
}, r = () => {
|
|
@@ -3348,7 +3345,7 @@ var qt = class extends st {
|
|
|
3348
3345
|
this[O3](h3, t), i();
|
|
3349
3346
|
return;
|
|
3350
3347
|
}
|
|
3351
|
-
this[
|
|
3348
|
+
this[ge] = true, n();
|
|
3352
3349
|
});
|
|
3353
3350
|
}, n = () => {
|
|
3354
3351
|
if (t.absolute !== this.cwd) {
|
|
@@ -3368,7 +3365,7 @@ var qt = class extends st {
|
|
|
3368
3365
|
this[gs](t), i();
|
|
3369
3366
|
return;
|
|
3370
3367
|
}
|
|
3371
|
-
if (h3 || this[
|
|
3368
|
+
if (h3 || this[Rs](t, a)) return this[P3](null, t, i);
|
|
3372
3369
|
if (a.isDirectory()) {
|
|
3373
3370
|
if (t.type === "Directory") {
|
|
3374
3371
|
let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c2 = (d2) => this[P3](d2 ?? null, t, i);
|
|
@@ -3377,10 +3374,10 @@ var qt = class extends st {
|
|
|
3377
3374
|
if (t.absolute !== this.cwd) return import_node_fs3.default.rmdir(String(t.absolute), (l) => this[P3](l ?? null, t, i));
|
|
3378
3375
|
}
|
|
3379
3376
|
if (t.absolute === this.cwd) return this[P3](null, t, i);
|
|
3380
|
-
|
|
3377
|
+
oo(String(t.absolute), (l) => this[P3](l ?? null, t, i));
|
|
3381
3378
|
});
|
|
3382
3379
|
};
|
|
3383
|
-
this[
|
|
3380
|
+
this[ge] ? n() : r();
|
|
3384
3381
|
}
|
|
3385
3382
|
[P3](t, e2, i) {
|
|
3386
3383
|
if (t) {
|
|
@@ -3391,17 +3388,17 @@ var qt = class extends st {
|
|
|
3391
3388
|
case "File":
|
|
3392
3389
|
case "OldFile":
|
|
3393
3390
|
case "ContiguousFile":
|
|
3394
|
-
return this[
|
|
3391
|
+
return this[bs](e2, i);
|
|
3395
3392
|
case "Link":
|
|
3396
|
-
return this[
|
|
3393
|
+
return this[xr](e2, i);
|
|
3397
3394
|
case "SymbolicLink":
|
|
3398
|
-
return this[
|
|
3395
|
+
return this[Tr](e2, i);
|
|
3399
3396
|
case "Directory":
|
|
3400
3397
|
case "GNUDumpDir":
|
|
3401
|
-
return this[
|
|
3398
|
+
return this[_s](e2, i);
|
|
3402
3399
|
}
|
|
3403
3400
|
}
|
|
3404
|
-
[
|
|
3401
|
+
[Si](t, e2, i, r) {
|
|
3405
3402
|
import_node_fs3.default[i](e2, String(t.absolute), (n) => {
|
|
3406
3403
|
n ? this[O3](n, t) : (this[Xt](), t.resume()), r();
|
|
3407
3404
|
});
|
|
@@ -3420,11 +3417,11 @@ var Te = class extends qt {
|
|
|
3420
3417
|
return super[P3](t, e2, () => {
|
|
3421
3418
|
});
|
|
3422
3419
|
}
|
|
3423
|
-
[
|
|
3424
|
-
if (!this[
|
|
3420
|
+
[ys](t) {
|
|
3421
|
+
if (!this[ge]) {
|
|
3425
3422
|
let n = this[St](this.cwd, this.dmode);
|
|
3426
3423
|
if (n) return this[O3](n, t);
|
|
3427
|
-
this[
|
|
3424
|
+
this[ge] = true;
|
|
3428
3425
|
}
|
|
3429
3426
|
if (t.absolute !== this.cwd) {
|
|
3430
3427
|
let n = f3(import_node_path5.default.dirname(String(t.absolute)));
|
|
@@ -3435,7 +3432,7 @@ var Te = class extends qt {
|
|
|
3435
3432
|
}
|
|
3436
3433
|
let [e2, i] = Se(() => import_node_fs3.default.lstatSync(String(t.absolute)));
|
|
3437
3434
|
if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[gs](t);
|
|
3438
|
-
if (e2 || this[
|
|
3435
|
+
if (e2 || this[Rs](t, i)) return this[P3](null, t);
|
|
3439
3436
|
if (i.isDirectory()) {
|
|
3440
3437
|
if (t.type === "Directory") {
|
|
3441
3438
|
let o2 = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [h3] = o2 ? Se(() => {
|
|
@@ -3446,10 +3443,10 @@ var Te = class extends qt {
|
|
|
3446
3443
|
let [n] = Se(() => import_node_fs3.default.rmdirSync(String(t.absolute)));
|
|
3447
3444
|
this[P3](n, t);
|
|
3448
3445
|
}
|
|
3449
|
-
let [r] = t.absolute === this.cwd ? [] : Se(() =>
|
|
3446
|
+
let [r] = t.absolute === this.cwd ? [] : Se(() => ho(String(t.absolute)));
|
|
3450
3447
|
this[P3](r, t);
|
|
3451
3448
|
}
|
|
3452
|
-
[
|
|
3449
|
+
[bs](t, e2) {
|
|
3453
3450
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h3) => {
|
|
3454
3451
|
let a;
|
|
3455
3452
|
try {
|
|
@@ -3460,7 +3457,7 @@ var Te = class extends qt {
|
|
|
3460
3457
|
(h3 || a) && this[O3](h3 || a, t), e2();
|
|
3461
3458
|
}, n;
|
|
3462
3459
|
try {
|
|
3463
|
-
n = import_node_fs3.default.openSync(String(t.absolute),
|
|
3460
|
+
n = import_node_fs3.default.openSync(String(t.absolute), cs(t.size), i);
|
|
3464
3461
|
} catch (h3) {
|
|
3465
3462
|
return r(h3);
|
|
3466
3463
|
}
|
|
@@ -3486,7 +3483,7 @@ var Te = class extends qt {
|
|
|
3486
3483
|
}
|
|
3487
3484
|
}
|
|
3488
3485
|
if (this[Re](t)) {
|
|
3489
|
-
let a = this[be](t), l = this[
|
|
3486
|
+
let a = this[be](t), l = this[_e](t);
|
|
3490
3487
|
try {
|
|
3491
3488
|
import_node_fs3.default.fchownSync(n, Number(a), Number(l));
|
|
3492
3489
|
} catch (c2) {
|
|
@@ -3500,7 +3497,7 @@ var Te = class extends qt {
|
|
|
3500
3497
|
r(h3);
|
|
3501
3498
|
});
|
|
3502
3499
|
}
|
|
3503
|
-
[
|
|
3500
|
+
[_s](t, e2) {
|
|
3504
3501
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode, r = this[St](String(t.absolute), i);
|
|
3505
3502
|
if (r) {
|
|
3506
3503
|
this[O3](r, t), e2();
|
|
@@ -3511,20 +3508,20 @@ var Te = class extends qt {
|
|
|
3511
3508
|
} catch {
|
|
3512
3509
|
}
|
|
3513
3510
|
if (this[Re](t)) try {
|
|
3514
|
-
import_node_fs3.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[
|
|
3511
|
+
import_node_fs3.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
|
|
3515
3512
|
} catch {
|
|
3516
3513
|
}
|
|
3517
3514
|
e2(), t.resume();
|
|
3518
3515
|
}
|
|
3519
3516
|
[St](t, e2) {
|
|
3520
3517
|
try {
|
|
3521
|
-
return
|
|
3518
|
+
return Sr(f3(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: e2 });
|
|
3522
3519
|
} catch (i) {
|
|
3523
3520
|
return i;
|
|
3524
3521
|
}
|
|
3525
3522
|
}
|
|
3526
3523
|
[ye](t, e2, i, r, n) {
|
|
3527
|
-
if (this.preservePaths ||
|
|
3524
|
+
if (this.preservePaths || i.length === 0) return r();
|
|
3528
3525
|
let o2 = e2;
|
|
3529
3526
|
for (let h3 of i) {
|
|
3530
3527
|
o2 = import_node_path5.default.resolve(o2, h3);
|
|
@@ -3534,7 +3531,7 @@ var Te = class extends qt {
|
|
|
3534
3531
|
}
|
|
3535
3532
|
r();
|
|
3536
3533
|
}
|
|
3537
|
-
[
|
|
3534
|
+
[Si](t, e2, i, r) {
|
|
3538
3535
|
let n = `${i}Sync`;
|
|
3539
3536
|
try {
|
|
3540
3537
|
import_node_fs3.default[n](e2, String(t.absolute)), r(), t.resume();
|
|
@@ -3543,26 +3540,26 @@ var Te = class extends qt {
|
|
|
3543
3540
|
}
|
|
3544
3541
|
}
|
|
3545
3542
|
};
|
|
3546
|
-
var
|
|
3543
|
+
var ao = (s3) => {
|
|
3547
3544
|
let t = new Te(s3), e2 = s3.file, i = import_node_fs2.default.statSync(e2), r = s3.maxReadSize || 16 * 1024 * 1024;
|
|
3548
|
-
new
|
|
3545
|
+
new Me(e2, { readSize: r, size: i.size }).pipe(t);
|
|
3549
3546
|
};
|
|
3550
|
-
var
|
|
3547
|
+
var lo = (s3, t) => {
|
|
3551
3548
|
let e2 = new qt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
|
|
3552
3549
|
return new Promise((o2, h3) => {
|
|
3553
3550
|
e2.on("error", h3), e2.on("close", o2), import_node_fs2.default.stat(r, (a, l) => {
|
|
3554
3551
|
if (a) h3(a);
|
|
3555
3552
|
else {
|
|
3556
|
-
let c2 = new
|
|
3553
|
+
let c2 = new _t(r, { readSize: i, size: l.size });
|
|
3557
3554
|
c2.on("error", h3), c2.pipe(e2);
|
|
3558
3555
|
}
|
|
3559
3556
|
});
|
|
3560
3557
|
});
|
|
3561
3558
|
};
|
|
3562
|
-
var
|
|
3563
|
-
t?.length &&
|
|
3559
|
+
var co = K3(ao, lo, (s3) => new Te(s3), (s3) => new qt(s3), (s3, t) => {
|
|
3560
|
+
t?.length && Ki(s3, t);
|
|
3564
3561
|
});
|
|
3565
|
-
var
|
|
3562
|
+
var fo = (s3, t) => {
|
|
3566
3563
|
let e2 = new kt(s3), i = true, r, n;
|
|
3567
3564
|
try {
|
|
3568
3565
|
try {
|
|
@@ -3583,7 +3580,7 @@ var co = (s3, t) => {
|
|
|
3583
3580
|
if (n + l + 512 > o2.size) break;
|
|
3584
3581
|
n += l, s3.mtimeCache && a.mtime && s3.mtimeCache.set(String(a.path), a.mtime);
|
|
3585
3582
|
}
|
|
3586
|
-
i = false,
|
|
3583
|
+
i = false, uo(s3, e2, n, r, t);
|
|
3587
3584
|
} finally {
|
|
3588
3585
|
if (i) try {
|
|
3589
3586
|
import_node_fs6.default.closeSync(r);
|
|
@@ -3591,11 +3588,11 @@ var co = (s3, t) => {
|
|
|
3591
3588
|
}
|
|
3592
3589
|
}
|
|
3593
3590
|
};
|
|
3594
|
-
var
|
|
3591
|
+
var uo = (s3, t, e2, i, r) => {
|
|
3595
3592
|
let n = new Wt(s3.file, { fd: i, start: e2 });
|
|
3596
|
-
t.pipe(n),
|
|
3593
|
+
t.pipe(n), po(t, r);
|
|
3597
3594
|
};
|
|
3598
|
-
var
|
|
3595
|
+
var mo = (s3, t) => {
|
|
3599
3596
|
t = Array.from(t);
|
|
3600
3597
|
let e2 = new Et(s3), i = (n, o2, h3) => {
|
|
3601
3598
|
let a = (T3, N2) => {
|
|
@@ -3603,7 +3600,7 @@ var uo = (s3, t) => {
|
|
|
3603
3600
|
}, l = 0;
|
|
3604
3601
|
if (o2 === 0) return a(null, 0);
|
|
3605
3602
|
let c2 = 0, d2 = Buffer.alloc(512), S2 = (T3, N2) => {
|
|
3606
|
-
if (T3 ||
|
|
3603
|
+
if (T3 || N2 === void 0) return a(T3);
|
|
3607
3604
|
if (c2 += N2, c2 < 512 && N2) return import_node_fs6.default.read(n, d2, c2, d2.length - c2, l + c2, S2);
|
|
3608
3605
|
if (l === 0 && d2[0] === 31 && d2[1] === 139) return a(new Error("cannot append to compressed archives"));
|
|
3609
3606
|
if (c2 < 512) return a(null, l);
|
|
@@ -3625,38 +3622,35 @@ var uo = (s3, t) => {
|
|
|
3625
3622
|
i(c2, S2.size, (T3, N2) => {
|
|
3626
3623
|
if (T3) return o2(T3);
|
|
3627
3624
|
let E3 = new tt(s3.file, { fd: c2, start: N2 });
|
|
3628
|
-
e2.pipe(E3), E3.on("error", o2), E3.on("close", n),
|
|
3625
|
+
e2.pipe(E3), E3.on("error", o2), E3.on("close", n), Eo(e2, t);
|
|
3629
3626
|
});
|
|
3630
3627
|
});
|
|
3631
3628
|
};
|
|
3632
3629
|
import_node_fs6.default.open(s3.file, h3, a);
|
|
3633
3630
|
});
|
|
3634
3631
|
};
|
|
3635
|
-
var
|
|
3632
|
+
var po = (s3, t) => {
|
|
3636
3633
|
t.forEach((e2) => {
|
|
3637
3634
|
e2.charAt(0) === "@" ? It({ file: import_node_path9.default.resolve(s3.cwd, e2.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e2);
|
|
3638
3635
|
}), s3.end();
|
|
3639
3636
|
};
|
|
3640
|
-
var
|
|
3641
|
-
for (let e2
|
|
3642
|
-
let i = String(t[e2]);
|
|
3643
|
-
i.charAt(0) === "@" ? await It({ file: import_node_path9.default.resolve(String(s3.cwd), i.slice(1)), noResume: true, onReadEntry: (r) => s3.add(r) }) : s3.add(i);
|
|
3644
|
-
}
|
|
3637
|
+
var Eo = async (s3, t) => {
|
|
3638
|
+
for (let e2 of t) e2.charAt(0) === "@" ? await It({ file: import_node_path9.default.resolve(String(s3.cwd), e2.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e2);
|
|
3645
3639
|
s3.end();
|
|
3646
3640
|
};
|
|
3647
|
-
var vt = K3(
|
|
3641
|
+
var vt = K3(fo, mo, () => {
|
|
3648
3642
|
throw new TypeError("file is required");
|
|
3649
3643
|
}, () => {
|
|
3650
3644
|
throw new TypeError("file is required");
|
|
3651
3645
|
}, (s3, t) => {
|
|
3652
|
-
if (!
|
|
3646
|
+
if (!Fs(s3)) throw new TypeError("file is required");
|
|
3653
3647
|
if (s3.gzip || s3.brotli || s3.zstd || s3.file.endsWith(".br") || s3.file.endsWith(".tbr")) throw new TypeError("cannot append to compressed archives");
|
|
3654
3648
|
if (!t?.length) throw new TypeError("no paths specified to add/replace");
|
|
3655
3649
|
});
|
|
3656
|
-
var
|
|
3657
|
-
vt.validate?.(s3, t),
|
|
3650
|
+
var wo = K3(vt.syncFile, vt.asyncFile, vt.syncNoFile, vt.asyncNoFile, (s3, t = []) => {
|
|
3651
|
+
vt.validate?.(s3, t), So(s3);
|
|
3658
3652
|
});
|
|
3659
|
-
var
|
|
3653
|
+
var So = (s3) => {
|
|
3660
3654
|
let t = s3.filter;
|
|
3661
3655
|
s3.mtimeCache || (s3.mtimeCache = /* @__PURE__ */ new Map()), s3.filter = t ? (e2, i) => t(e2, i) && !((s3.mtimeCache?.get(e2) ?? i.mtime ?? 0) > (i.mtime ?? 0)) : (e2, i) => !((s3.mtimeCache?.get(e2) ?? i.mtime ?? 0) > (i.mtime ?? 0));
|
|
3662
3656
|
};
|
|
@@ -4469,7 +4463,7 @@ async function downloadTemplate(template, targetDir) {
|
|
|
4469
4463
|
if (!tarResponse.body) {
|
|
4470
4464
|
throw new Error(`${url}: no body`);
|
|
4471
4465
|
}
|
|
4472
|
-
const extractor =
|
|
4466
|
+
const extractor = co({
|
|
4473
4467
|
cwd: targetDir,
|
|
4474
4468
|
strip: 1
|
|
4475
4469
|
});
|