@modern-js/upgrade 0.0.0-next-20221129091510 → 0.0.0-next-20221129100038
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +583 -331
- package/package.json +6 -6
package/dist/index.js
CHANGED
@@ -68650,6 +68650,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68650
68650
|
this._redirectable.emit(event, arg1, arg2, arg3);
|
68651
68651
|
};
|
68652
68652
|
});
|
68653
|
+
var InvalidUrlError = createErrorType("ERR_INVALID_URL", "Invalid URL", TypeError);
|
68653
68654
|
var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed");
|
68654
68655
|
var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded");
|
68655
68656
|
var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit");
|
@@ -68682,10 +68683,10 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68682
68683
|
if (this._ending) {
|
68683
68684
|
throw new WriteAfterEndError();
|
68684
68685
|
}
|
68685
|
-
if (!(
|
68686
|
+
if (!isString2(data) && !isBuffer(data)) {
|
68686
68687
|
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
68687
68688
|
}
|
68688
|
-
if (
|
68689
|
+
if (isFunction(encoding)) {
|
68689
68690
|
callback = encoding;
|
68690
68691
|
encoding = null;
|
68691
68692
|
}
|
@@ -68705,10 +68706,10 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68705
68706
|
}
|
68706
68707
|
};
|
68707
68708
|
RedirectableRequest.prototype.end = function(data, encoding, callback) {
|
68708
|
-
if (
|
68709
|
+
if (isFunction(data)) {
|
68709
68710
|
callback = data;
|
68710
68711
|
data = encoding = null;
|
68711
|
-
} else if (
|
68712
|
+
} else if (isFunction(encoding)) {
|
68712
68713
|
callback = encoding;
|
68713
68714
|
encoding = null;
|
68714
68715
|
}
|
@@ -68832,7 +68833,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68832
68833
|
for (var event of events) {
|
68833
68834
|
request.on(event, eventHandlers[event]);
|
68834
68835
|
}
|
68835
|
-
this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this.
|
68836
|
+
this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this._options.path;
|
68836
68837
|
if (this._isRedirect) {
|
68837
68838
|
var i = 0;
|
68838
68839
|
var self2 = this;
|
@@ -68897,7 +68898,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68897
68898
|
try {
|
68898
68899
|
redirectUrl = url.resolve(currentUrl, location);
|
68899
68900
|
} catch (cause) {
|
68900
|
-
this.emit("error", new RedirectionError(cause));
|
68901
|
+
this.emit("error", new RedirectionError({ cause }));
|
68901
68902
|
return;
|
68902
68903
|
}
|
68903
68904
|
debug("redirecting to", redirectUrl);
|
@@ -68907,7 +68908,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68907
68908
|
if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
|
68908
68909
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
68909
68910
|
}
|
68910
|
-
if (
|
68911
|
+
if (isFunction(beforeRedirect)) {
|
68911
68912
|
var responseDetails = {
|
68912
68913
|
headers: response.headers,
|
68913
68914
|
statusCode
|
@@ -68928,7 +68929,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68928
68929
|
try {
|
68929
68930
|
this._performRequest();
|
68930
68931
|
} catch (cause) {
|
68931
|
-
this.emit("error", new RedirectionError(cause));
|
68932
|
+
this.emit("error", new RedirectionError({ cause }));
|
68932
68933
|
}
|
68933
68934
|
};
|
68934
68935
|
function wrap(protocols) {
|
@@ -68942,13 +68943,17 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68942
68943
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
68943
68944
|
var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
|
68944
68945
|
function request(input, options3, callback) {
|
68945
|
-
if (
|
68946
|
-
var
|
68946
|
+
if (isString2(input)) {
|
68947
|
+
var parsed;
|
68947
68948
|
try {
|
68948
|
-
|
68949
|
+
parsed = urlToOptions(new URL(input));
|
68949
68950
|
} catch (err) {
|
68950
|
-
|
68951
|
+
parsed = url.parse(input);
|
68951
68952
|
}
|
68953
|
+
if (!isString2(parsed.protocol)) {
|
68954
|
+
throw new InvalidUrlError({ input });
|
68955
|
+
}
|
68956
|
+
input = parsed;
|
68952
68957
|
} else if (URL && input instanceof URL) {
|
68953
68958
|
input = urlToOptions(input);
|
68954
68959
|
} else {
|
@@ -68956,7 +68961,7 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68956
68961
|
options3 = input;
|
68957
68962
|
input = { protocol };
|
68958
68963
|
}
|
68959
|
-
if (
|
68964
|
+
if (isFunction(options3)) {
|
68960
68965
|
callback = options3;
|
68961
68966
|
options3 = null;
|
68962
68967
|
}
|
@@ -68965,6 +68970,9 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
68965
68970
|
maxBodyLength: exports2.maxBodyLength
|
68966
68971
|
}, input, options3);
|
68967
68972
|
options3.nativeProtocols = nativeProtocols;
|
68973
|
+
if (!isString2(options3.host) && !isString2(options3.hostname)) {
|
68974
|
+
options3.hostname = "::1";
|
68975
|
+
}
|
68968
68976
|
assert.equal(options3.protocol, protocol, "protocol mismatch");
|
68969
68977
|
debug("options", options3);
|
68970
68978
|
return new RedirectableRequest(options3, callback);
|
@@ -69008,20 +69016,16 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
69008
69016
|
}
|
69009
69017
|
return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
|
69010
69018
|
}
|
69011
|
-
function createErrorType(code,
|
69012
|
-
function CustomError(
|
69019
|
+
function createErrorType(code, message, baseClass) {
|
69020
|
+
function CustomError(properties) {
|
69013
69021
|
Error.captureStackTrace(this, this.constructor);
|
69014
|
-
|
69015
|
-
|
69016
|
-
|
69017
|
-
this.message = defaultMessage + ": " + cause.message;
|
69018
|
-
this.cause = cause;
|
69019
|
-
}
|
69022
|
+
Object.assign(this, properties || {});
|
69023
|
+
this.code = code;
|
69024
|
+
this.message = this.cause ? message + ": " + this.cause.message : message;
|
69020
69025
|
}
|
69021
|
-
CustomError.prototype = new Error();
|
69026
|
+
CustomError.prototype = new (baseClass || Error)();
|
69022
69027
|
CustomError.prototype.constructor = CustomError;
|
69023
69028
|
CustomError.prototype.name = "Error [" + code + "]";
|
69024
|
-
CustomError.prototype.code = code;
|
69025
69029
|
return CustomError;
|
69026
69030
|
}
|
69027
69031
|
function abortRequest(request) {
|
@@ -69032,9 +69036,19 @@ var require_follow_redirects = __commonJSMin((exports, module2) => {
|
|
69032
69036
|
request.abort();
|
69033
69037
|
}
|
69034
69038
|
function isSubdomain(subdomain, domain) {
|
69035
|
-
|
69039
|
+
assert(isString2(subdomain) && isString2(domain));
|
69040
|
+
var dot = subdomain.length - domain.length - 1;
|
69036
69041
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
69037
69042
|
}
|
69043
|
+
function isString2(value) {
|
69044
|
+
return typeof value === "string" || value instanceof String;
|
69045
|
+
}
|
69046
|
+
function isFunction(value) {
|
69047
|
+
return typeof value === "function";
|
69048
|
+
}
|
69049
|
+
function isBuffer(value) {
|
69050
|
+
return typeof value === "object" && "length" in value;
|
69051
|
+
}
|
69038
69052
|
module2.exports = wrap({ http, https });
|
69039
69053
|
module2.exports.wrap = wrap;
|
69040
69054
|
});
|
@@ -70864,8 +70878,9 @@ var require_read_entry = __commonJSMin((exports, module2) => {
|
|
70864
70878
|
}
|
70865
70879
|
this.path = normPath(header.path);
|
70866
70880
|
this.mode = header.mode;
|
70867
|
-
if (this.mode)
|
70881
|
+
if (this.mode) {
|
70868
70882
|
this.mode = this.mode & 4095;
|
70883
|
+
}
|
70869
70884
|
this.uid = header.uid;
|
70870
70885
|
this.gid = header.gid;
|
70871
70886
|
this.uname = header.uname;
|
@@ -70877,29 +70892,35 @@ var require_read_entry = __commonJSMin((exports, module2) => {
|
|
70877
70892
|
this.linkpath = normPath(header.linkpath);
|
70878
70893
|
this.uname = header.uname;
|
70879
70894
|
this.gname = header.gname;
|
70880
|
-
if (ex)
|
70895
|
+
if (ex) {
|
70881
70896
|
this[SLURP](ex);
|
70882
|
-
|
70897
|
+
}
|
70898
|
+
if (gex) {
|
70883
70899
|
this[SLURP](gex, true);
|
70900
|
+
}
|
70884
70901
|
}
|
70885
70902
|
write(data) {
|
70886
70903
|
const writeLen = data.length;
|
70887
|
-
if (writeLen > this.blockRemain)
|
70904
|
+
if (writeLen > this.blockRemain) {
|
70888
70905
|
throw new Error("writing more to entry than is appropriate");
|
70906
|
+
}
|
70889
70907
|
const r = this.remain;
|
70890
70908
|
const br = this.blockRemain;
|
70891
70909
|
this.remain = Math.max(0, r - writeLen);
|
70892
70910
|
this.blockRemain = Math.max(0, br - writeLen);
|
70893
|
-
if (this.ignore)
|
70911
|
+
if (this.ignore) {
|
70894
70912
|
return true;
|
70895
|
-
|
70913
|
+
}
|
70914
|
+
if (r >= writeLen) {
|
70896
70915
|
return super.write(data);
|
70916
|
+
}
|
70897
70917
|
return super.write(data.slice(0, r));
|
70898
70918
|
}
|
70899
70919
|
[SLURP](ex, global2) {
|
70900
70920
|
for (const k in ex) {
|
70901
|
-
if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path"))
|
70921
|
+
if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path")) {
|
70902
70922
|
this[k] = k === "path" || k === "linkpath" ? normPath(ex[k]) : ex[k];
|
70923
|
+
}
|
70903
70924
|
}
|
70904
70925
|
}
|
70905
70926
|
};
|
@@ -70934,12 +70955,13 @@ var require_types = __commonJSMin((exports) => {
|
|
70934
70955
|
var require_large_numbers = __commonJSMin((exports, module2) => {
|
70935
70956
|
"use strict";
|
70936
70957
|
var encode = (num, buf) => {
|
70937
|
-
if (!Number.isSafeInteger(num))
|
70958
|
+
if (!Number.isSafeInteger(num)) {
|
70938
70959
|
throw Error("cannot encode number outside of javascript safe integer range");
|
70939
|
-
else if (num < 0)
|
70960
|
+
} else if (num < 0) {
|
70940
70961
|
encodeNegative(num, buf);
|
70941
|
-
else
|
70962
|
+
} else {
|
70942
70963
|
encodePositive(num, buf);
|
70964
|
+
}
|
70943
70965
|
return buf;
|
70944
70966
|
};
|
70945
70967
|
var encodePositive = (num, buf) => {
|
@@ -70956,11 +70978,11 @@ var require_large_numbers = __commonJSMin((exports, module2) => {
|
|
70956
70978
|
for (var i = buf.length; i > 1; i--) {
|
70957
70979
|
var byte = num & 255;
|
70958
70980
|
num = Math.floor(num / 256);
|
70959
|
-
if (flipped)
|
70981
|
+
if (flipped) {
|
70960
70982
|
buf[i - 1] = onesComp(byte);
|
70961
|
-
else if (byte === 0)
|
70983
|
+
} else if (byte === 0) {
|
70962
70984
|
buf[i - 1] = 0;
|
70963
|
-
else {
|
70985
|
+
} else {
|
70964
70986
|
flipped = true;
|
70965
70987
|
buf[i - 1] = twosComp(byte);
|
70966
70988
|
}
|
@@ -70969,10 +70991,12 @@ var require_large_numbers = __commonJSMin((exports, module2) => {
|
|
70969
70991
|
var parse = (buf) => {
|
70970
70992
|
const pre = buf[0];
|
70971
70993
|
const value = pre === 128 ? pos(buf.slice(1, buf.length)) : pre === 255 ? twos(buf) : null;
|
70972
|
-
if (value === null)
|
70994
|
+
if (value === null) {
|
70973
70995
|
throw Error("invalid base256 encoding");
|
70974
|
-
|
70996
|
+
}
|
70997
|
+
if (!Number.isSafeInteger(value)) {
|
70975
70998
|
throw Error("parsed number outside of javascript safe integer range");
|
70999
|
+
}
|
70976
71000
|
return value;
|
70977
71001
|
};
|
70978
71002
|
var twos = (buf) => {
|
@@ -70982,16 +71006,17 @@ var require_large_numbers = __commonJSMin((exports, module2) => {
|
|
70982
71006
|
for (var i = len - 1; i > -1; i--) {
|
70983
71007
|
var byte = buf[i];
|
70984
71008
|
var f;
|
70985
|
-
if (flipped)
|
71009
|
+
if (flipped) {
|
70986
71010
|
f = onesComp(byte);
|
70987
|
-
else if (byte === 0)
|
71011
|
+
} else if (byte === 0) {
|
70988
71012
|
f = byte;
|
70989
|
-
else {
|
71013
|
+
} else {
|
70990
71014
|
flipped = true;
|
70991
71015
|
f = twosComp(byte);
|
70992
71016
|
}
|
70993
|
-
if (f !== 0)
|
71017
|
+
if (f !== 0) {
|
70994
71018
|
sum -= f * Math.pow(256, len - i - 1);
|
71019
|
+
}
|
70995
71020
|
}
|
70996
71021
|
return sum;
|
70997
71022
|
};
|
@@ -71000,8 +71025,9 @@ var require_large_numbers = __commonJSMin((exports, module2) => {
|
|
71000
71025
|
var sum = 0;
|
71001
71026
|
for (var i = len - 1; i > -1; i--) {
|
71002
71027
|
var byte = buf[i];
|
71003
|
-
if (byte !== 0)
|
71028
|
+
if (byte !== 0) {
|
71004
71029
|
sum += byte * Math.pow(256, len - i - 1);
|
71030
|
+
}
|
71005
71031
|
}
|
71006
71032
|
return sum;
|
71007
71033
|
};
|
@@ -71040,16 +71066,19 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71040
71066
|
this.devmin = 0;
|
71041
71067
|
this.atime = null;
|
71042
71068
|
this.ctime = null;
|
71043
|
-
if (Buffer.isBuffer(data))
|
71069
|
+
if (Buffer.isBuffer(data)) {
|
71044
71070
|
this.decode(data, off || 0, ex, gex);
|
71045
|
-
else if (data)
|
71071
|
+
} else if (data) {
|
71046
71072
|
this.set(data);
|
71073
|
+
}
|
71047
71074
|
}
|
71048
71075
|
decode(buf, off, ex, gex) {
|
71049
|
-
if (!off)
|
71076
|
+
if (!off) {
|
71050
71077
|
off = 0;
|
71051
|
-
|
71078
|
+
}
|
71079
|
+
if (!buf || !(buf.length >= off + 512)) {
|
71052
71080
|
throw new Error("need 512 bytes for header");
|
71081
|
+
}
|
71053
71082
|
this.path = decString(buf, off, 100);
|
71054
71083
|
this.mode = decNumber(buf, off + 100, 8);
|
71055
71084
|
this.uid = decNumber(buf, off + 108, 8);
|
@@ -71060,12 +71089,15 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71060
71089
|
this[SLURP](ex);
|
71061
71090
|
this[SLURP](gex, true);
|
71062
71091
|
this[TYPE] = decString(buf, off + 156, 1);
|
71063
|
-
if (this[TYPE] === "")
|
71092
|
+
if (this[TYPE] === "") {
|
71064
71093
|
this[TYPE] = "0";
|
71065
|
-
|
71094
|
+
}
|
71095
|
+
if (this[TYPE] === "0" && this.path.slice(-1) === "/") {
|
71066
71096
|
this[TYPE] = "5";
|
71067
|
-
|
71097
|
+
}
|
71098
|
+
if (this[TYPE] === "5") {
|
71068
71099
|
this.size = 0;
|
71100
|
+
}
|
71069
71101
|
this.linkpath = decString(buf, off + 157, 100);
|
71070
71102
|
if (buf.slice(off + 257, off + 265).toString() === "ustar\x0000") {
|
71071
71103
|
this.uname = decString(buf, off + 265, 32);
|
@@ -71077,25 +71109,30 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71077
71109
|
this.path = prefix + "/" + this.path;
|
71078
71110
|
} else {
|
71079
71111
|
const prefix = decString(buf, off + 345, 130);
|
71080
|
-
if (prefix)
|
71112
|
+
if (prefix) {
|
71081
71113
|
this.path = prefix + "/" + this.path;
|
71114
|
+
}
|
71082
71115
|
this.atime = decDate(buf, off + 476, 12);
|
71083
71116
|
this.ctime = decDate(buf, off + 488, 12);
|
71084
71117
|
}
|
71085
71118
|
}
|
71086
71119
|
let sum = 8 * 32;
|
71087
|
-
for (let i = off; i < off + 148; i++)
|
71120
|
+
for (let i = off; i < off + 148; i++) {
|
71088
71121
|
sum += buf[i];
|
71089
|
-
|
71122
|
+
}
|
71123
|
+
for (let i = off + 156; i < off + 512; i++) {
|
71090
71124
|
sum += buf[i];
|
71125
|
+
}
|
71091
71126
|
this.cksumValid = sum === this.cksum;
|
71092
|
-
if (this.cksum === null && sum === 8 * 32)
|
71127
|
+
if (this.cksum === null && sum === 8 * 32) {
|
71093
71128
|
this.nullBlock = true;
|
71129
|
+
}
|
71094
71130
|
}
|
71095
71131
|
[SLURP](ex, global2) {
|
71096
71132
|
for (const k in ex) {
|
71097
|
-
if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path"))
|
71133
|
+
if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path")) {
|
71098
71134
|
this[k] = ex[k];
|
71135
|
+
}
|
71099
71136
|
}
|
71100
71137
|
}
|
71101
71138
|
encode(buf, off) {
|
@@ -71103,10 +71140,12 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71103
71140
|
buf = this.block = Buffer.alloc(512);
|
71104
71141
|
off = 0;
|
71105
71142
|
}
|
71106
|
-
if (!off)
|
71143
|
+
if (!off) {
|
71107
71144
|
off = 0;
|
71108
|
-
|
71145
|
+
}
|
71146
|
+
if (!(buf.length >= off + 512)) {
|
71109
71147
|
throw new Error("need 512 bytes for header");
|
71148
|
+
}
|
71110
71149
|
const prefixSize = this.ctime || this.atime ? 130 : 155;
|
71111
71150
|
const split = splitPrefix(this.path || "", prefixSize);
|
71112
71151
|
const path = split[0];
|
@@ -71126,18 +71165,20 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71126
71165
|
this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
|
71127
71166
|
this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
|
71128
71167
|
this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax;
|
71129
|
-
if (buf[off + 475] !== 0)
|
71168
|
+
if (buf[off + 475] !== 0) {
|
71130
71169
|
this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax;
|
71131
|
-
else {
|
71170
|
+
} else {
|
71132
71171
|
this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax;
|
71133
71172
|
this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax;
|
71134
71173
|
this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax;
|
71135
71174
|
}
|
71136
71175
|
let sum = 8 * 32;
|
71137
|
-
for (let i = off; i < off + 148; i++)
|
71176
|
+
for (let i = off; i < off + 148; i++) {
|
71138
71177
|
sum += buf[i];
|
71139
|
-
|
71178
|
+
}
|
71179
|
+
for (let i = off + 156; i < off + 512; i++) {
|
71140
71180
|
sum += buf[i];
|
71181
|
+
}
|
71141
71182
|
this.cksum = sum;
|
71142
71183
|
encNumber(buf, off + 148, 8, this.cksum);
|
71143
71184
|
this.cksumValid = true;
|
@@ -71145,8 +71186,9 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71145
71186
|
}
|
71146
71187
|
set(data) {
|
71147
71188
|
for (const i in data) {
|
71148
|
-
if (data[i] !== null && data[i] !== void 0)
|
71189
|
+
if (data[i] !== null && data[i] !== void 0) {
|
71149
71190
|
this[i] = data[i];
|
71191
|
+
}
|
71150
71192
|
}
|
71151
71193
|
}
|
71152
71194
|
get type() {
|
@@ -71156,10 +71198,11 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71156
71198
|
return this[TYPE];
|
71157
71199
|
}
|
71158
71200
|
set type(type) {
|
71159
|
-
if (types.code.has(type))
|
71201
|
+
if (types.code.has(type)) {
|
71160
71202
|
this[TYPE] = types.code.get(type);
|
71161
|
-
else
|
71203
|
+
} else {
|
71162
71204
|
this[TYPE] = type;
|
71205
|
+
}
|
71163
71206
|
}
|
71164
71207
|
};
|
71165
71208
|
var splitPrefix = (p, prefixSize) => {
|
@@ -71168,23 +71211,24 @@ var require_header = __commonJSMin((exports, module2) => {
|
|
71168
71211
|
let prefix = "";
|
71169
71212
|
let ret;
|
71170
71213
|
const root = pathModule.parse(p).root || ".";
|
71171
|
-
if (Buffer.byteLength(pp) < pathSize)
|
71214
|
+
if (Buffer.byteLength(pp) < pathSize) {
|
71172
71215
|
ret = [pp, prefix, false];
|
71173
|
-
else {
|
71216
|
+
} else {
|
71174
71217
|
prefix = pathModule.dirname(pp);
|
71175
71218
|
pp = pathModule.basename(pp);
|
71176
71219
|
do {
|
71177
|
-
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize)
|
71220
|
+
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) {
|
71178
71221
|
ret = [pp, prefix, false];
|
71179
|
-
else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize)
|
71180
|
-
ret = [pp.
|
71181
|
-
else {
|
71222
|
+
} else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) {
|
71223
|
+
ret = [pp.slice(0, pathSize - 1), prefix, true];
|
71224
|
+
} else {
|
71182
71225
|
pp = pathModule.join(pathModule.basename(prefix), pp);
|
71183
71226
|
prefix = pathModule.dirname(prefix);
|
71184
71227
|
}
|
71185
71228
|
} while (prefix !== root && !ret);
|
71186
|
-
if (!ret)
|
71187
|
-
ret = [p.
|
71229
|
+
if (!ret) {
|
71230
|
+
ret = [p.slice(0, pathSize - 1), "", true];
|
71231
|
+
}
|
71188
71232
|
}
|
71189
71233
|
return ret;
|
71190
71234
|
};
|
@@ -71232,13 +71276,15 @@ var require_pax = __commonJSMin((exports, module2) => {
|
|
71232
71276
|
}
|
71233
71277
|
encode() {
|
71234
71278
|
const body = this.encodeBody();
|
71235
|
-
if (body === "")
|
71279
|
+
if (body === "") {
|
71236
71280
|
return null;
|
71281
|
+
}
|
71237
71282
|
const bodyLen = Buffer.byteLength(body);
|
71238
71283
|
const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
|
71239
71284
|
const buf = Buffer.allocUnsafe(bufLen);
|
71240
|
-
for (let i = 0; i < 512; i++)
|
71285
|
+
for (let i = 0; i < 512; i++) {
|
71241
71286
|
buf[i] = 0;
|
71287
|
+
}
|
71242
71288
|
new Header({
|
71243
71289
|
path: ("PaxHeader/" + path.basename(this.path)).slice(0, 99),
|
71244
71290
|
mode: this.mode || 420,
|
@@ -71256,22 +71302,25 @@ var require_pax = __commonJSMin((exports, module2) => {
|
|
71256
71302
|
ctime: this.ctime || null
|
71257
71303
|
}).encode(buf);
|
71258
71304
|
buf.write(body, 512, bodyLen, "utf8");
|
71259
|
-
for (let i = bodyLen + 512; i < buf.length; i++)
|
71305
|
+
for (let i = bodyLen + 512; i < buf.length; i++) {
|
71260
71306
|
buf[i] = 0;
|
71307
|
+
}
|
71261
71308
|
return buf;
|
71262
71309
|
}
|
71263
71310
|
encodeBody() {
|
71264
71311
|
return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname");
|
71265
71312
|
}
|
71266
71313
|
encodeField(field) {
|
71267
|
-
if (this[field] === null || this[field] === void 0)
|
71314
|
+
if (this[field] === null || this[field] === void 0) {
|
71268
71315
|
return "";
|
71316
|
+
}
|
71269
71317
|
const v = this[field] instanceof Date ? this[field].getTime() / 1e3 : this[field];
|
71270
71318
|
const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n";
|
71271
71319
|
const byteLen = Buffer.byteLength(s);
|
71272
71320
|
let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
|
71273
|
-
if (byteLen + digits >= Math.pow(10, digits))
|
71321
|
+
if (byteLen + digits >= Math.pow(10, digits)) {
|
71274
71322
|
digits += 1;
|
71323
|
+
}
|
71275
71324
|
const len = digits + byteLen;
|
71276
71325
|
return len + s;
|
71277
71326
|
}
|
@@ -71281,13 +71330,15 @@ var require_pax = __commonJSMin((exports, module2) => {
|
|
71281
71330
|
var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
|
71282
71331
|
var parseKVLine = (set, line) => {
|
71283
71332
|
const n = parseInt(line, 10);
|
71284
|
-
if (n !== Buffer.byteLength(line) + 1)
|
71333
|
+
if (n !== Buffer.byteLength(line) + 1) {
|
71285
71334
|
return set;
|
71286
|
-
|
71335
|
+
}
|
71336
|
+
line = line.slice((n + " ").length);
|
71287
71337
|
const kv = line.split("=");
|
71288
71338
|
const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
71289
|
-
if (!k)
|
71339
|
+
if (!k) {
|
71290
71340
|
return set;
|
71341
|
+
}
|
71291
71342
|
const v = kv.join("=");
|
71292
71343
|
set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1e3) : /^[0-9]+$/.test(v) ? +v : v;
|
71293
71344
|
return set;
|
@@ -71309,10 +71360,12 @@ var require_warn_mixin = __commonJSMin((exports, module2) => {
|
|
71309
71360
|
"use strict";
|
71310
71361
|
module2.exports = (Base) => class extends Base {
|
71311
71362
|
warn(code, message, data = {}) {
|
71312
|
-
if (this.file)
|
71363
|
+
if (this.file) {
|
71313
71364
|
data.file = this.file;
|
71314
|
-
|
71365
|
+
}
|
71366
|
+
if (this.cwd) {
|
71315
71367
|
data.cwd = this.cwd;
|
71368
|
+
}
|
71316
71369
|
data.code = message instanceof Error && message.code || code;
|
71317
71370
|
data.tarCode = code;
|
71318
71371
|
if (!this.strict && data.recoverable !== false) {
|
@@ -71321,10 +71374,11 @@ var require_warn_mixin = __commonJSMin((exports, module2) => {
|
|
71321
71374
|
message = message.message;
|
71322
71375
|
}
|
71323
71376
|
this.emit("warn", data.tarCode, message, data);
|
71324
|
-
} else if (message instanceof Error)
|
71377
|
+
} else if (message instanceof Error) {
|
71325
71378
|
this.emit("error", Object.assign(message, data));
|
71326
|
-
else
|
71379
|
+
} else {
|
71327
71380
|
this.emit("error", Object.assign(new Error(`${code}: ${message}`), data));
|
71381
|
+
}
|
71328
71382
|
}
|
71329
71383
|
};
|
71330
71384
|
});
|
@@ -71352,7 +71406,7 @@ var require_strip_absolute_path = __commonJSMin((exports, module2) => {
|
|
71352
71406
|
let parsed = parse(path);
|
71353
71407
|
while (isAbsolute(path) || parsed.root) {
|
71354
71408
|
const root = path.charAt(0) === "/" && path.slice(0, 4) !== "//?/" ? "/" : parsed.root;
|
71355
|
-
path = path.
|
71409
|
+
path = path.slice(root.length);
|
71356
71410
|
r += root;
|
71357
71411
|
parsed = parse(path);
|
71358
71412
|
}
|
@@ -71363,15 +71417,19 @@ var require_mode_fix = __commonJSMin((exports, module2) => {
|
|
71363
71417
|
"use strict";
|
71364
71418
|
module2.exports = (mode, isDir, portable) => {
|
71365
71419
|
mode &= 4095;
|
71366
|
-
if (portable)
|
71420
|
+
if (portable) {
|
71367
71421
|
mode = (mode | 384) & ~18;
|
71422
|
+
}
|
71368
71423
|
if (isDir) {
|
71369
|
-
if (mode & 256)
|
71424
|
+
if (mode & 256) {
|
71370
71425
|
mode |= 64;
|
71371
|
-
|
71426
|
+
}
|
71427
|
+
if (mode & 32) {
|
71372
71428
|
mode |= 8;
|
71373
|
-
|
71429
|
+
}
|
71430
|
+
if (mode & 4) {
|
71374
71431
|
mode |= 1;
|
71432
|
+
}
|
71375
71433
|
}
|
71376
71434
|
return mode;
|
71377
71435
|
};
|
@@ -71386,8 +71444,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71386
71444
|
var normPath = require_normalize_windows_path();
|
71387
71445
|
var stripSlash = require_strip_trailing_slashes();
|
71388
71446
|
var prefixPath = (path2, prefix) => {
|
71389
|
-
if (!prefix)
|
71447
|
+
if (!prefix) {
|
71390
71448
|
return normPath(path2);
|
71449
|
+
}
|
71391
71450
|
path2 = normPath(path2).replace(/^\.(\/|$)/, "");
|
71392
71451
|
return stripSlash(prefix) + "/" + path2;
|
71393
71452
|
};
|
@@ -71419,8 +71478,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71419
71478
|
constructor(p, opt) {
|
71420
71479
|
opt = opt || {};
|
71421
71480
|
super(opt);
|
71422
|
-
if (typeof p !== "string")
|
71481
|
+
if (typeof p !== "string") {
|
71423
71482
|
throw new TypeError("path is required");
|
71483
|
+
}
|
71424
71484
|
this.path = normPath(p);
|
71425
71485
|
this.portable = !!opt.portable;
|
71426
71486
|
this.myuid = process.getuid && process.getuid() || 0;
|
@@ -71443,8 +71503,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71443
71503
|
this.length = null;
|
71444
71504
|
this.pos = null;
|
71445
71505
|
this.remain = null;
|
71446
|
-
if (typeof opt.onwarn === "function")
|
71506
|
+
if (typeof opt.onwarn === "function") {
|
71447
71507
|
this.on("warn", opt.onwarn);
|
71508
|
+
}
|
71448
71509
|
let pathWarn = false;
|
71449
71510
|
if (!this.preservePaths) {
|
71450
71511
|
const [root, stripped] = stripAbsolutePath(this.path);
|
@@ -71459,36 +71520,41 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71459
71520
|
p = p.replace(/\\/g, "/");
|
71460
71521
|
}
|
71461
71522
|
this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p));
|
71462
|
-
if (this.path === "")
|
71523
|
+
if (this.path === "") {
|
71463
71524
|
this.path = "./";
|
71525
|
+
}
|
71464
71526
|
if (pathWarn) {
|
71465
71527
|
this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, {
|
71466
71528
|
entry: this,
|
71467
71529
|
path: pathWarn + this.path
|
71468
71530
|
});
|
71469
71531
|
}
|
71470
|
-
if (this.statCache.has(this.absolute))
|
71532
|
+
if (this.statCache.has(this.absolute)) {
|
71471
71533
|
this[ONLSTAT](this.statCache.get(this.absolute));
|
71472
|
-
else
|
71534
|
+
} else {
|
71473
71535
|
this[LSTAT]();
|
71536
|
+
}
|
71474
71537
|
}
|
71475
71538
|
emit(ev, ...data) {
|
71476
|
-
if (ev === "error")
|
71539
|
+
if (ev === "error") {
|
71477
71540
|
this[HAD_ERROR] = true;
|
71541
|
+
}
|
71478
71542
|
return super.emit(ev, ...data);
|
71479
71543
|
}
|
71480
71544
|
[LSTAT]() {
|
71481
71545
|
fs.lstat(this.absolute, (er, stat) => {
|
71482
|
-
if (er)
|
71546
|
+
if (er) {
|
71483
71547
|
return this.emit("error", er);
|
71548
|
+
}
|
71484
71549
|
this[ONLSTAT](stat);
|
71485
71550
|
});
|
71486
71551
|
}
|
71487
71552
|
[ONLSTAT](stat) {
|
71488
71553
|
this.statCache.set(this.absolute, stat);
|
71489
71554
|
this.stat = stat;
|
71490
|
-
if (!stat.isFile())
|
71555
|
+
if (!stat.isFile()) {
|
71491
71556
|
stat.size = 0;
|
71557
|
+
}
|
71492
71558
|
this.type = getType(stat);
|
71493
71559
|
this.emit("stat", stat);
|
71494
71560
|
this[PROCESS]();
|
@@ -71512,8 +71578,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71512
71578
|
return prefixPath(path2, this.prefix);
|
71513
71579
|
}
|
71514
71580
|
[HEADER]() {
|
71515
|
-
if (this.type === "Directory" && this.portable)
|
71581
|
+
if (this.type === "Directory" && this.portable) {
|
71516
71582
|
this.noMtime = true;
|
71583
|
+
}
|
71517
71584
|
this.header = new Header({
|
71518
71585
|
path: this[PREFIX](this.path),
|
71519
71586
|
linkpath: this.type === "Link" ? this[PREFIX](this.linkpath) : this.linkpath,
|
@@ -71546,16 +71613,18 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71546
71613
|
super.write(this.header.block);
|
71547
71614
|
}
|
71548
71615
|
[DIRECTORY]() {
|
71549
|
-
if (this.path.
|
71616
|
+
if (this.path.slice(-1) !== "/") {
|
71550
71617
|
this.path += "/";
|
71618
|
+
}
|
71551
71619
|
this.stat.size = 0;
|
71552
71620
|
this[HEADER]();
|
71553
71621
|
this.end();
|
71554
71622
|
}
|
71555
71623
|
[SYMLINK]() {
|
71556
71624
|
fs.readlink(this.absolute, (er, linkpath) => {
|
71557
|
-
if (er)
|
71625
|
+
if (er) {
|
71558
71626
|
return this.emit("error", er);
|
71627
|
+
}
|
71559
71628
|
this[ONREADLINK](linkpath);
|
71560
71629
|
});
|
71561
71630
|
}
|
@@ -71576,27 +71645,31 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71576
71645
|
const linkKey = this.stat.dev + ":" + this.stat.ino;
|
71577
71646
|
if (this.linkCache.has(linkKey)) {
|
71578
71647
|
const linkpath = this.linkCache.get(linkKey);
|
71579
|
-
if (linkpath.indexOf(this.cwd) === 0)
|
71648
|
+
if (linkpath.indexOf(this.cwd) === 0) {
|
71580
71649
|
return this[HARDLINK](linkpath);
|
71650
|
+
}
|
71581
71651
|
}
|
71582
71652
|
this.linkCache.set(linkKey, this.absolute);
|
71583
71653
|
}
|
71584
71654
|
this[HEADER]();
|
71585
|
-
if (this.stat.size === 0)
|
71655
|
+
if (this.stat.size === 0) {
|
71586
71656
|
return this.end();
|
71657
|
+
}
|
71587
71658
|
this[OPENFILE]();
|
71588
71659
|
}
|
71589
71660
|
[OPENFILE]() {
|
71590
71661
|
fs.open(this.absolute, "r", (er, fd) => {
|
71591
|
-
if (er)
|
71662
|
+
if (er) {
|
71592
71663
|
return this.emit("error", er);
|
71664
|
+
}
|
71593
71665
|
this[ONOPENFILE](fd);
|
71594
71666
|
});
|
71595
71667
|
}
|
71596
71668
|
[ONOPENFILE](fd) {
|
71597
71669
|
this.fd = fd;
|
71598
|
-
if (this[HAD_ERROR])
|
71670
|
+
if (this[HAD_ERROR]) {
|
71599
71671
|
return this[CLOSE]();
|
71672
|
+
}
|
71600
71673
|
this.blockLen = 512 * Math.ceil(this.stat.size / 512);
|
71601
71674
|
this.blockRemain = this.blockLen;
|
71602
71675
|
const bufLen = Math.min(this.blockLen, this.maxReadSize);
|
@@ -71643,10 +71716,11 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71643
71716
|
}
|
71644
71717
|
const writeBuf = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.slice(this.offset, this.offset + bytesRead);
|
71645
71718
|
const flushed = this.write(writeBuf);
|
71646
|
-
if (!flushed)
|
71719
|
+
if (!flushed) {
|
71647
71720
|
this[AWAITDRAIN](() => this[ONDRAIN]());
|
71648
|
-
else
|
71721
|
+
} else {
|
71649
71722
|
this[ONDRAIN]();
|
71723
|
+
}
|
71650
71724
|
}
|
71651
71725
|
[AWAITDRAIN](cb) {
|
71652
71726
|
this.once("drain", cb);
|
@@ -71665,8 +71739,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71665
71739
|
}
|
71666
71740
|
[ONDRAIN]() {
|
71667
71741
|
if (!this.remain) {
|
71668
|
-
if (this.blockRemain)
|
71742
|
+
if (this.blockRemain) {
|
71669
71743
|
super.write(Buffer.alloc(this.blockRemain));
|
71744
|
+
}
|
71670
71745
|
return this[CLOSE]((er) => er ? this.emit("error", er) : this.end());
|
71671
71746
|
}
|
71672
71747
|
if (this.offset >= this.length) {
|
@@ -71723,8 +71798,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71723
71798
|
this.noMtime = !!opt.noMtime;
|
71724
71799
|
this.readEntry = readEntry;
|
71725
71800
|
this.type = readEntry.type;
|
71726
|
-
if (this.type === "Directory" && this.portable)
|
71801
|
+
if (this.type === "Directory" && this.portable) {
|
71727
71802
|
this.noMtime = true;
|
71803
|
+
}
|
71728
71804
|
this.prefix = opt.prefix || null;
|
71729
71805
|
this.path = normPath(readEntry.path);
|
71730
71806
|
this.mode = this[MODE](readEntry.mode);
|
@@ -71737,8 +71813,9 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71737
71813
|
this.atime = this.portable ? null : readEntry.atime;
|
71738
71814
|
this.ctime = this.portable ? null : readEntry.ctime;
|
71739
71815
|
this.linkpath = normPath(readEntry.linkpath);
|
71740
|
-
if (typeof opt.onwarn === "function")
|
71816
|
+
if (typeof opt.onwarn === "function") {
|
71741
71817
|
this.on("warn", opt.onwarn);
|
71818
|
+
}
|
71742
71819
|
let pathWarn = false;
|
71743
71820
|
if (!this.preservePaths) {
|
71744
71821
|
const [root, stripped] = stripAbsolutePath(this.path);
|
@@ -71795,14 +71872,16 @@ var require_write_entry = __commonJSMin((exports, module2) => {
|
|
71795
71872
|
}
|
71796
71873
|
write(data) {
|
71797
71874
|
const writeLen = data.length;
|
71798
|
-
if (writeLen > this.blockRemain)
|
71875
|
+
if (writeLen > this.blockRemain) {
|
71799
71876
|
throw new Error("writing more to entry than is appropriate");
|
71877
|
+
}
|
71800
71878
|
this.blockRemain -= writeLen;
|
71801
71879
|
return super.write(data);
|
71802
71880
|
}
|
71803
71881
|
end() {
|
71804
|
-
if (this.blockRemain)
|
71882
|
+
if (this.blockRemain) {
|
71805
71883
|
super.write(Buffer.alloc(this.blockRemain));
|
71884
|
+
}
|
71806
71885
|
return super.end();
|
71807
71886
|
}
|
71808
71887
|
});
|
@@ -72248,22 +72327,26 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72248
72327
|
this.statCache = opt.statCache || /* @__PURE__ */ new Map();
|
72249
72328
|
this.readdirCache = opt.readdirCache || /* @__PURE__ */ new Map();
|
72250
72329
|
this[WRITEENTRYCLASS] = WriteEntry;
|
72251
|
-
if (typeof opt.onwarn === "function")
|
72330
|
+
if (typeof opt.onwarn === "function") {
|
72252
72331
|
this.on("warn", opt.onwarn);
|
72332
|
+
}
|
72253
72333
|
this.portable = !!opt.portable;
|
72254
72334
|
this.zip = null;
|
72255
72335
|
if (opt.gzip) {
|
72256
|
-
if (typeof opt.gzip !== "object")
|
72336
|
+
if (typeof opt.gzip !== "object") {
|
72257
72337
|
opt.gzip = {};
|
72258
|
-
|
72338
|
+
}
|
72339
|
+
if (this.portable) {
|
72259
72340
|
opt.gzip.portable = true;
|
72341
|
+
}
|
72260
72342
|
this.zip = new zlib.Gzip(opt.gzip);
|
72261
72343
|
this.zip.on("data", (chunk) => super.write(chunk));
|
72262
72344
|
this.zip.on("end", (_) => super.end());
|
72263
72345
|
this.zip.on("drain", (_) => this[ONDRAIN]());
|
72264
72346
|
this.on("resume", (_) => this.zip.resume());
|
72265
|
-
} else
|
72347
|
+
} else {
|
72266
72348
|
this.on("drain", this[ONDRAIN]);
|
72349
|
+
}
|
72267
72350
|
this.noDirRecurse = !!opt.noDirRecurse;
|
72268
72351
|
this.follow = !!opt.follow;
|
72269
72352
|
this.noMtime = !!opt.noMtime;
|
@@ -72283,26 +72366,29 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72283
72366
|
return this;
|
72284
72367
|
}
|
72285
72368
|
end(path2) {
|
72286
|
-
if (path2)
|
72369
|
+
if (path2) {
|
72287
72370
|
this.write(path2);
|
72371
|
+
}
|
72288
72372
|
this[ENDED] = true;
|
72289
72373
|
this[PROCESS]();
|
72290
72374
|
return this;
|
72291
72375
|
}
|
72292
72376
|
write(path2) {
|
72293
|
-
if (this[ENDED])
|
72377
|
+
if (this[ENDED]) {
|
72294
72378
|
throw new Error("write after end");
|
72295
|
-
|
72379
|
+
}
|
72380
|
+
if (path2 instanceof ReadEntry) {
|
72296
72381
|
this[ADDTARENTRY](path2);
|
72297
|
-
else
|
72382
|
+
} else {
|
72298
72383
|
this[ADDFSENTRY](path2);
|
72384
|
+
}
|
72299
72385
|
return this.flowing;
|
72300
72386
|
}
|
72301
72387
|
[ADDTARENTRY](p) {
|
72302
72388
|
const absolute = normPath(path.resolve(this.cwd, p.path));
|
72303
|
-
if (!this.filter(p.path, p))
|
72389
|
+
if (!this.filter(p.path, p)) {
|
72304
72390
|
p.resume();
|
72305
|
-
else {
|
72391
|
+
} else {
|
72306
72392
|
const job = new PackJob(p.path, absolute, false);
|
72307
72393
|
job.entry = new WriteEntryTar(p, this[ENTRYOPT](job));
|
72308
72394
|
job.entry.on("end", (_) => this[JOBDONE](job));
|
@@ -72323,17 +72409,19 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72323
72409
|
fs[stat](job.absolute, (er, stat2) => {
|
72324
72410
|
job.pending = false;
|
72325
72411
|
this[JOBS] -= 1;
|
72326
|
-
if (er)
|
72412
|
+
if (er) {
|
72327
72413
|
this.emit("error", er);
|
72328
|
-
else
|
72414
|
+
} else {
|
72329
72415
|
this[ONSTAT](job, stat2);
|
72416
|
+
}
|
72330
72417
|
});
|
72331
72418
|
}
|
72332
72419
|
[ONSTAT](job, stat) {
|
72333
72420
|
this.statCache.set(job.absolute, stat);
|
72334
72421
|
job.stat = stat;
|
72335
|
-
if (!this.filter(job.path, stat))
|
72422
|
+
if (!this.filter(job.path, stat)) {
|
72336
72423
|
job.ignore = true;
|
72424
|
+
}
|
72337
72425
|
this[PROCESS]();
|
72338
72426
|
}
|
72339
72427
|
[READDIR](job) {
|
@@ -72342,8 +72430,9 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72342
72430
|
fs.readdir(job.absolute, (er, entries) => {
|
72343
72431
|
job.pending = false;
|
72344
72432
|
this[JOBS] -= 1;
|
72345
|
-
if (er)
|
72433
|
+
if (er) {
|
72346
72434
|
return this.emit("error", er);
|
72435
|
+
}
|
72347
72436
|
this[ONREADDIR](job, entries);
|
72348
72437
|
});
|
72349
72438
|
}
|
@@ -72353,8 +72442,9 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72353
72442
|
this[PROCESS]();
|
72354
72443
|
}
|
72355
72444
|
[PROCESS]() {
|
72356
|
-
if (this[PROCESSING])
|
72445
|
+
if (this[PROCESSING]) {
|
72357
72446
|
return;
|
72447
|
+
}
|
72358
72448
|
this[PROCESSING] = true;
|
72359
72449
|
for (let w = this[QUEUE].head; w !== null && this[JOBS] < this.jobs; w = w.next) {
|
72360
72450
|
this[PROCESSJOB](w.value);
|
@@ -72366,9 +72456,9 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72366
72456
|
}
|
72367
72457
|
this[PROCESSING] = false;
|
72368
72458
|
if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {
|
72369
|
-
if (this.zip)
|
72459
|
+
if (this.zip) {
|
72370
72460
|
this.zip.end(EOF);
|
72371
|
-
else {
|
72461
|
+
} else {
|
72372
72462
|
super.write(EOF);
|
72373
72463
|
super.end();
|
72374
72464
|
}
|
@@ -72383,38 +72473,46 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72383
72473
|
this[PROCESS]();
|
72384
72474
|
}
|
72385
72475
|
[PROCESSJOB](job) {
|
72386
|
-
if (job.pending)
|
72476
|
+
if (job.pending) {
|
72387
72477
|
return;
|
72478
|
+
}
|
72388
72479
|
if (job.entry) {
|
72389
|
-
if (job === this[CURRENT] && !job.piped)
|
72480
|
+
if (job === this[CURRENT] && !job.piped) {
|
72390
72481
|
this[PIPE](job);
|
72482
|
+
}
|
72391
72483
|
return;
|
72392
72484
|
}
|
72393
72485
|
if (!job.stat) {
|
72394
|
-
if (this.statCache.has(job.absolute))
|
72486
|
+
if (this.statCache.has(job.absolute)) {
|
72395
72487
|
this[ONSTAT](job, this.statCache.get(job.absolute));
|
72396
|
-
else
|
72488
|
+
} else {
|
72397
72489
|
this[STAT](job);
|
72490
|
+
}
|
72398
72491
|
}
|
72399
|
-
if (!job.stat)
|
72492
|
+
if (!job.stat) {
|
72400
72493
|
return;
|
72401
|
-
|
72494
|
+
}
|
72495
|
+
if (job.ignore) {
|
72402
72496
|
return;
|
72497
|
+
}
|
72403
72498
|
if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {
|
72404
|
-
if (this.readdirCache.has(job.absolute))
|
72499
|
+
if (this.readdirCache.has(job.absolute)) {
|
72405
72500
|
this[ONREADDIR](job, this.readdirCache.get(job.absolute));
|
72406
|
-
else
|
72501
|
+
} else {
|
72407
72502
|
this[READDIR](job);
|
72408
|
-
|
72503
|
+
}
|
72504
|
+
if (!job.readdir) {
|
72409
72505
|
return;
|
72506
|
+
}
|
72410
72507
|
}
|
72411
72508
|
job.entry = this[ENTRY](job);
|
72412
72509
|
if (!job.entry) {
|
72413
72510
|
job.ignore = true;
|
72414
72511
|
return;
|
72415
72512
|
}
|
72416
|
-
if (job === this[CURRENT] && !job.piped)
|
72513
|
+
if (job === this[CURRENT] && !job.piped) {
|
72417
72514
|
this[PIPE](job);
|
72515
|
+
}
|
72418
72516
|
}
|
72419
72517
|
[ENTRYOPT](job) {
|
72420
72518
|
return {
|
@@ -72442,8 +72540,9 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72442
72540
|
}
|
72443
72541
|
}
|
72444
72542
|
[ONDRAIN]() {
|
72445
|
-
if (this[CURRENT] && this[CURRENT].entry)
|
72543
|
+
if (this[CURRENT] && this[CURRENT].entry) {
|
72446
72544
|
this[CURRENT].entry.resume();
|
72545
|
+
}
|
72447
72546
|
}
|
72448
72547
|
[PIPE](job) {
|
72449
72548
|
job.piped = true;
|
@@ -72458,19 +72557,22 @@ var require_pack = __commonJSMin((exports, module2) => {
|
|
72458
72557
|
const zip = this.zip;
|
72459
72558
|
if (zip) {
|
72460
72559
|
source.on("data", (chunk) => {
|
72461
|
-
if (!zip.write(chunk))
|
72560
|
+
if (!zip.write(chunk)) {
|
72462
72561
|
source.pause();
|
72562
|
+
}
|
72463
72563
|
});
|
72464
72564
|
} else {
|
72465
72565
|
source.on("data", (chunk) => {
|
72466
|
-
if (!super.write(chunk))
|
72566
|
+
if (!super.write(chunk)) {
|
72467
72567
|
source.pause();
|
72568
|
+
}
|
72468
72569
|
});
|
72469
72570
|
}
|
72470
72571
|
}
|
72471
72572
|
pause() {
|
72472
|
-
if (this.zip)
|
72573
|
+
if (this.zip) {
|
72473
72574
|
this.zip.pause();
|
72575
|
+
}
|
72474
72576
|
return super.pause();
|
72475
72577
|
}
|
72476
72578
|
});
|
@@ -72882,6 +72984,7 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72882
72984
|
var Entry = require_read_entry();
|
72883
72985
|
var Pax = require_pax();
|
72884
72986
|
var zlib = require_minizlib();
|
72987
|
+
var { nextTick } = __require("process");
|
72885
72988
|
var gzipHeader = Buffer.from([31, 139]);
|
72886
72989
|
var STATE = Symbol("state");
|
72887
72990
|
var WRITEENTRY = Symbol("writeEntry");
|
@@ -72912,6 +73015,7 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72912
73015
|
var SAW_VALID_ENTRY = Symbol("sawValidEntry");
|
72913
73016
|
var SAW_NULL_BLOCK = Symbol("sawNullBlock");
|
72914
73017
|
var SAW_EOF = Symbol("sawEOF");
|
73018
|
+
var CLOSESTREAM = Symbol("closeStream");
|
72915
73019
|
var noop = (_) => true;
|
72916
73020
|
module2.exports = warner(class Parser extends EE {
|
72917
73021
|
constructor(opt) {
|
@@ -72924,14 +73028,13 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72924
73028
|
this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
|
72925
73029
|
}
|
72926
73030
|
});
|
72927
|
-
if (opt.ondone)
|
73031
|
+
if (opt.ondone) {
|
72928
73032
|
this.on(DONE, opt.ondone);
|
72929
|
-
else {
|
73033
|
+
} else {
|
72930
73034
|
this.on(DONE, (_) => {
|
72931
73035
|
this.emit("prefinish");
|
72932
73036
|
this.emit("finish");
|
72933
73037
|
this.emit("end");
|
72934
|
-
this.emit("close");
|
72935
73038
|
});
|
72936
73039
|
}
|
72937
73040
|
this.strict = !!opt.strict;
|
@@ -72952,14 +73055,18 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72952
73055
|
this[ABORTED] = false;
|
72953
73056
|
this[SAW_NULL_BLOCK] = false;
|
72954
73057
|
this[SAW_EOF] = false;
|
72955
|
-
|
73058
|
+
this.on("end", () => this[CLOSESTREAM]());
|
73059
|
+
if (typeof opt.onwarn === "function") {
|
72956
73060
|
this.on("warn", opt.onwarn);
|
72957
|
-
|
73061
|
+
}
|
73062
|
+
if (typeof opt.onentry === "function") {
|
72958
73063
|
this.on("entry", opt.onentry);
|
73064
|
+
}
|
72959
73065
|
}
|
72960
73066
|
[CONSUMEHEADER](chunk, position) {
|
72961
|
-
if (this[SAW_VALID_ENTRY] === null)
|
73067
|
+
if (this[SAW_VALID_ENTRY] === null) {
|
72962
73068
|
this[SAW_VALID_ENTRY] = false;
|
73069
|
+
}
|
72963
73070
|
let header;
|
72964
73071
|
try {
|
72965
73072
|
header = new Header(chunk, position, this[EX], this[GEX]);
|
@@ -72969,8 +73076,9 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72969
73076
|
if (header.nullBlock) {
|
72970
73077
|
if (this[SAW_NULL_BLOCK]) {
|
72971
73078
|
this[SAW_EOF] = true;
|
72972
|
-
if (this[STATE] === "begin")
|
73079
|
+
if (this[STATE] === "begin") {
|
72973
73080
|
this[STATE] = "header";
|
73081
|
+
}
|
72974
73082
|
this[EMIT]("eof");
|
72975
73083
|
} else {
|
72976
73084
|
this[SAW_NULL_BLOCK] = true;
|
@@ -72978,27 +73086,29 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
72978
73086
|
}
|
72979
73087
|
} else {
|
72980
73088
|
this[SAW_NULL_BLOCK] = false;
|
72981
|
-
if (!header.cksumValid)
|
73089
|
+
if (!header.cksumValid) {
|
72982
73090
|
this.warn("TAR_ENTRY_INVALID", "checksum failure", { header });
|
72983
|
-
else if (!header.path)
|
73091
|
+
} else if (!header.path) {
|
72984
73092
|
this.warn("TAR_ENTRY_INVALID", "path is required", { header });
|
72985
|
-
else {
|
73093
|
+
} else {
|
72986
73094
|
const type = header.type;
|
72987
|
-
if (/^(Symbolic)?Link$/.test(type) && !header.linkpath)
|
73095
|
+
if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) {
|
72988
73096
|
this.warn("TAR_ENTRY_INVALID", "linkpath required", { header });
|
72989
|
-
else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath)
|
73097
|
+
} else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) {
|
72990
73098
|
this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header });
|
72991
|
-
else {
|
73099
|
+
} else {
|
72992
73100
|
const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]);
|
72993
73101
|
if (!this[SAW_VALID_ENTRY]) {
|
72994
73102
|
if (entry.remain) {
|
72995
73103
|
const onend = () => {
|
72996
|
-
if (!entry.invalid)
|
73104
|
+
if (!entry.invalid) {
|
72997
73105
|
this[SAW_VALID_ENTRY] = true;
|
73106
|
+
}
|
72998
73107
|
};
|
72999
73108
|
entry.on("end", onend);
|
73000
|
-
} else
|
73109
|
+
} else {
|
73001
73110
|
this[SAW_VALID_ENTRY] = true;
|
73111
|
+
}
|
73002
73112
|
}
|
73003
73113
|
if (entry.meta) {
|
73004
73114
|
if (entry.size > this.maxMetaEntrySize) {
|
@@ -73019,31 +73129,35 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73019
73129
|
this[STATE] = entry.remain ? "ignore" : "header";
|
73020
73130
|
entry.resume();
|
73021
73131
|
} else {
|
73022
|
-
if (entry.remain)
|
73132
|
+
if (entry.remain) {
|
73023
73133
|
this[STATE] = "body";
|
73024
|
-
else {
|
73134
|
+
} else {
|
73025
73135
|
this[STATE] = "header";
|
73026
73136
|
entry.end();
|
73027
73137
|
}
|
73028
73138
|
if (!this[READENTRY]) {
|
73029
73139
|
this[QUEUE].push(entry);
|
73030
73140
|
this[NEXTENTRY]();
|
73031
|
-
} else
|
73141
|
+
} else {
|
73032
73142
|
this[QUEUE].push(entry);
|
73143
|
+
}
|
73033
73144
|
}
|
73034
73145
|
}
|
73035
73146
|
}
|
73036
73147
|
}
|
73037
73148
|
}
|
73038
73149
|
}
|
73150
|
+
[CLOSESTREAM]() {
|
73151
|
+
nextTick(() => this.emit("close"));
|
73152
|
+
}
|
73039
73153
|
[PROCESSENTRY](entry) {
|
73040
73154
|
let go = true;
|
73041
73155
|
if (!entry) {
|
73042
73156
|
this[READENTRY] = null;
|
73043
73157
|
go = false;
|
73044
|
-
} else if (Array.isArray(entry))
|
73158
|
+
} else if (Array.isArray(entry)) {
|
73045
73159
|
this.emit.apply(this, entry);
|
73046
|
-
else {
|
73160
|
+
} else {
|
73047
73161
|
this[READENTRY] = entry;
|
73048
73162
|
this.emit("entry", entry);
|
73049
73163
|
if (!entry.emittedEnd) {
|
@@ -73060,10 +73174,12 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73060
73174
|
const re = this[READENTRY];
|
73061
73175
|
const drainNow = !re || re.flowing || re.size === re.remain;
|
73062
73176
|
if (drainNow) {
|
73063
|
-
if (!this[WRITING])
|
73177
|
+
if (!this[WRITING]) {
|
73064
73178
|
this.emit("drain");
|
73065
|
-
|
73179
|
+
}
|
73180
|
+
} else {
|
73066
73181
|
re.once("drain", (_) => this.emit("drain"));
|
73182
|
+
}
|
73067
73183
|
}
|
73068
73184
|
}
|
73069
73185
|
[CONSUMEBODY](chunk, position) {
|
@@ -73081,15 +73197,17 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73081
73197
|
[CONSUMEMETA](chunk, position) {
|
73082
73198
|
const entry = this[WRITEENTRY];
|
73083
73199
|
const ret = this[CONSUMEBODY](chunk, position);
|
73084
|
-
if (!this[WRITEENTRY])
|
73200
|
+
if (!this[WRITEENTRY]) {
|
73085
73201
|
this[EMITMETA](entry);
|
73202
|
+
}
|
73086
73203
|
return ret;
|
73087
73204
|
}
|
73088
73205
|
[EMIT](ev, data, extra) {
|
73089
|
-
if (!this[QUEUE].length && !this[READENTRY])
|
73206
|
+
if (!this[QUEUE].length && !this[READENTRY]) {
|
73090
73207
|
this.emit(ev, data, extra);
|
73091
|
-
else
|
73208
|
+
} else {
|
73092
73209
|
this[QUEUE].push([ev, data, extra]);
|
73210
|
+
}
|
73093
73211
|
}
|
73094
73212
|
[EMITMETA](entry) {
|
73095
73213
|
this[EMIT]("meta", this[META]);
|
@@ -73120,8 +73238,9 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73120
73238
|
this.warn("TAR_ABORT", error, { recoverable: false });
|
73121
73239
|
}
|
73122
73240
|
write(chunk) {
|
73123
|
-
if (this[ABORTED])
|
73241
|
+
if (this[ABORTED]) {
|
73124
73242
|
return;
|
73243
|
+
}
|
73125
73244
|
if (this[UNZIP] === null && chunk) {
|
73126
73245
|
if (this[BUFFER]) {
|
73127
73246
|
chunk = Buffer.concat([this[BUFFER], chunk]);
|
@@ -73132,8 +73251,9 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73132
73251
|
return true;
|
73133
73252
|
}
|
73134
73253
|
for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {
|
73135
|
-
if (chunk[i] !== gzipHeader[i])
|
73254
|
+
if (chunk[i] !== gzipHeader[i]) {
|
73136
73255
|
this[UNZIP] = false;
|
73256
|
+
}
|
73137
73257
|
}
|
73138
73258
|
if (this[UNZIP] === null) {
|
73139
73259
|
const ended = this[ENDED];
|
@@ -73152,19 +73272,22 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73152
73272
|
}
|
73153
73273
|
}
|
73154
73274
|
this[WRITING] = true;
|
73155
|
-
if (this[UNZIP])
|
73275
|
+
if (this[UNZIP]) {
|
73156
73276
|
this[UNZIP].write(chunk);
|
73157
|
-
else
|
73277
|
+
} else {
|
73158
73278
|
this[CONSUMECHUNK](chunk);
|
73279
|
+
}
|
73159
73280
|
this[WRITING] = false;
|
73160
73281
|
const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true;
|
73161
|
-
if (!ret && !this[QUEUE].length)
|
73282
|
+
if (!ret && !this[QUEUE].length) {
|
73162
73283
|
this[READENTRY].once("drain", (_) => this.emit("drain"));
|
73284
|
+
}
|
73163
73285
|
return ret;
|
73164
73286
|
}
|
73165
73287
|
[BUFFERCONCAT](c) {
|
73166
|
-
if (c && !this[ABORTED])
|
73288
|
+
if (c && !this[ABORTED]) {
|
73167
73289
|
this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c;
|
73290
|
+
}
|
73168
73291
|
}
|
73169
73292
|
[MAYBEEND]() {
|
73170
73293
|
if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) {
|
@@ -73173,27 +73296,29 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73173
73296
|
if (entry && entry.blockRemain) {
|
73174
73297
|
const have = this[BUFFER] ? this[BUFFER].length : 0;
|
73175
73298
|
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry });
|
73176
|
-
if (this[BUFFER])
|
73299
|
+
if (this[BUFFER]) {
|
73177
73300
|
entry.write(this[BUFFER]);
|
73301
|
+
}
|
73178
73302
|
entry.end();
|
73179
73303
|
}
|
73180
73304
|
this[EMIT](DONE);
|
73181
73305
|
}
|
73182
73306
|
}
|
73183
73307
|
[CONSUMECHUNK](chunk) {
|
73184
|
-
if (this[CONSUMING])
|
73308
|
+
if (this[CONSUMING]) {
|
73185
73309
|
this[BUFFERCONCAT](chunk);
|
73186
|
-
else if (!chunk && !this[BUFFER])
|
73310
|
+
} else if (!chunk && !this[BUFFER]) {
|
73187
73311
|
this[MAYBEEND]();
|
73188
|
-
else {
|
73312
|
+
} else {
|
73189
73313
|
this[CONSUMING] = true;
|
73190
73314
|
if (this[BUFFER]) {
|
73191
73315
|
this[BUFFERCONCAT](chunk);
|
73192
73316
|
const c = this[BUFFER];
|
73193
73317
|
this[BUFFER] = null;
|
73194
73318
|
this[CONSUMECHUNKSUB](c);
|
73195
|
-
} else
|
73319
|
+
} else {
|
73196
73320
|
this[CONSUMECHUNKSUB](chunk);
|
73321
|
+
}
|
73197
73322
|
while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) {
|
73198
73323
|
const c = this[BUFFER];
|
73199
73324
|
this[BUFFER] = null;
|
@@ -73201,8 +73326,9 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73201
73326
|
}
|
73202
73327
|
this[CONSUMING] = false;
|
73203
73328
|
}
|
73204
|
-
if (!this[BUFFER] || this[ENDED])
|
73329
|
+
if (!this[BUFFER] || this[ENDED]) {
|
73205
73330
|
this[MAYBEEND]();
|
73331
|
+
}
|
73206
73332
|
}
|
73207
73333
|
[CONSUMECHUNKSUB](chunk) {
|
73208
73334
|
let position = 0;
|
@@ -73226,17 +73352,18 @@ var require_parse = __commonJSMin((exports, module2) => {
|
|
73226
73352
|
}
|
73227
73353
|
}
|
73228
73354
|
if (position < length) {
|
73229
|
-
if (this[BUFFER])
|
73355
|
+
if (this[BUFFER]) {
|
73230
73356
|
this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]);
|
73231
|
-
else
|
73357
|
+
} else {
|
73232
73358
|
this[BUFFER] = chunk.slice(position);
|
73359
|
+
}
|
73233
73360
|
}
|
73234
73361
|
}
|
73235
73362
|
end(chunk) {
|
73236
73363
|
if (!this[ABORTED]) {
|
73237
|
-
if (this[UNZIP])
|
73364
|
+
if (this[UNZIP]) {
|
73238
73365
|
this[UNZIP].end(chunk);
|
73239
|
-
else {
|
73366
|
+
} else {
|
73240
73367
|
this[ENDED] = true;
|
73241
73368
|
this.write(chunk);
|
73242
73369
|
}
|
@@ -73253,25 +73380,32 @@ var require_list = __commonJSMin((exports, module2) => {
|
|
73253
73380
|
var path = __require("path");
|
73254
73381
|
var stripSlash = require_strip_trailing_slashes();
|
73255
73382
|
module2.exports = (opt_, files, cb) => {
|
73256
|
-
if (typeof opt_ === "function")
|
73383
|
+
if (typeof opt_ === "function") {
|
73257
73384
|
cb = opt_, files = null, opt_ = {};
|
73258
|
-
else if (Array.isArray(opt_))
|
73385
|
+
} else if (Array.isArray(opt_)) {
|
73259
73386
|
files = opt_, opt_ = {};
|
73260
|
-
|
73387
|
+
}
|
73388
|
+
if (typeof files === "function") {
|
73261
73389
|
cb = files, files = null;
|
73262
|
-
|
73390
|
+
}
|
73391
|
+
if (!files) {
|
73263
73392
|
files = [];
|
73264
|
-
else
|
73393
|
+
} else {
|
73265
73394
|
files = Array.from(files);
|
73395
|
+
}
|
73266
73396
|
const opt = hlo(opt_);
|
73267
|
-
if (opt.sync && typeof cb === "function")
|
73397
|
+
if (opt.sync && typeof cb === "function") {
|
73268
73398
|
throw new TypeError("callback not supported for sync tar functions");
|
73269
|
-
|
73399
|
+
}
|
73400
|
+
if (!opt.file && typeof cb === "function") {
|
73270
73401
|
throw new TypeError("callback only supported with file option");
|
73271
|
-
|
73402
|
+
}
|
73403
|
+
if (files.length) {
|
73272
73404
|
filesFilter(opt, files);
|
73273
|
-
|
73405
|
+
}
|
73406
|
+
if (!opt.noResume) {
|
73274
73407
|
onentryFunction(opt);
|
73408
|
+
}
|
73275
73409
|
return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt);
|
73276
73410
|
};
|
73277
73411
|
var onentryFunction = (opt) => {
|
@@ -73300,9 +73434,9 @@ var require_list = __commonJSMin((exports, module2) => {
|
|
73300
73434
|
try {
|
73301
73435
|
const stat = fs.statSync(file);
|
73302
73436
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
73303
|
-
if (stat.size < readSize)
|
73437
|
+
if (stat.size < readSize) {
|
73304
73438
|
p.end(fs.readFileSync(file));
|
73305
|
-
else {
|
73439
|
+
} else {
|
73306
73440
|
let pos = 0;
|
73307
73441
|
const buf = Buffer.allocUnsafe(readSize);
|
73308
73442
|
fd = fs.openSync(file, "r");
|
@@ -73331,9 +73465,9 @@ var require_list = __commonJSMin((exports, module2) => {
|
|
73331
73465
|
parse.on("error", reject);
|
73332
73466
|
parse.on("end", resolve);
|
73333
73467
|
fs.stat(file, (er, stat) => {
|
73334
|
-
if (er)
|
73468
|
+
if (er) {
|
73335
73469
|
reject(er);
|
73336
|
-
else {
|
73470
|
+
} else {
|
73337
73471
|
const stream = new fsm.ReadStream(file, {
|
73338
73472
|
readSize,
|
73339
73473
|
size: stat.size
|
@@ -73355,18 +73489,23 @@ var require_create = __commonJSMin((exports, module2) => {
|
|
73355
73489
|
var t = require_list();
|
73356
73490
|
var path = __require("path");
|
73357
73491
|
module2.exports = (opt_, files, cb) => {
|
73358
|
-
if (typeof files === "function")
|
73492
|
+
if (typeof files === "function") {
|
73359
73493
|
cb = files;
|
73360
|
-
|
73494
|
+
}
|
73495
|
+
if (Array.isArray(opt_)) {
|
73361
73496
|
files = opt_, opt_ = {};
|
73362
|
-
|
73497
|
+
}
|
73498
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
73363
73499
|
throw new TypeError("no files or directories specified");
|
73500
|
+
}
|
73364
73501
|
files = Array.from(files);
|
73365
73502
|
const opt = hlo(opt_);
|
73366
|
-
if (opt.sync && typeof cb === "function")
|
73503
|
+
if (opt.sync && typeof cb === "function") {
|
73367
73504
|
throw new TypeError("callback not supported for sync tar functions");
|
73368
|
-
|
73505
|
+
}
|
73506
|
+
if (!opt.file && typeof cb === "function") {
|
73369
73507
|
throw new TypeError("callback only supported with file option");
|
73508
|
+
}
|
73370
73509
|
return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files);
|
73371
73510
|
};
|
73372
73511
|
var createFileSync = (opt, files) => {
|
@@ -73395,13 +73534,14 @@ var require_create = __commonJSMin((exports, module2) => {
|
|
73395
73534
|
files.forEach((file) => {
|
73396
73535
|
if (file.charAt(0) === "@") {
|
73397
73536
|
t({
|
73398
|
-
file: path.resolve(p.cwd, file.
|
73537
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
73399
73538
|
sync: true,
|
73400
73539
|
noResume: true,
|
73401
73540
|
onentry: (entry) => p.add(entry)
|
73402
73541
|
});
|
73403
|
-
} else
|
73542
|
+
} else {
|
73404
73543
|
p.add(file);
|
73544
|
+
}
|
73405
73545
|
});
|
73406
73546
|
p.end();
|
73407
73547
|
};
|
@@ -73410,12 +73550,13 @@ var require_create = __commonJSMin((exports, module2) => {
|
|
73410
73550
|
const file = files.shift();
|
73411
73551
|
if (file.charAt(0) === "@") {
|
73412
73552
|
return t({
|
73413
|
-
file: path.resolve(p.cwd, file.
|
73553
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
73414
73554
|
noResume: true,
|
73415
73555
|
onentry: (entry) => p.add(entry)
|
73416
73556
|
}).then((_) => addFilesAsync(p, files));
|
73417
|
-
} else
|
73557
|
+
} else {
|
73418
73558
|
p.add(file);
|
73559
|
+
}
|
73419
73560
|
}
|
73420
73561
|
p.end();
|
73421
73562
|
};
|
@@ -73441,12 +73582,15 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73441
73582
|
var Header = require_header();
|
73442
73583
|
module2.exports = (opt_, files, cb) => {
|
73443
73584
|
const opt = hlo(opt_);
|
73444
|
-
if (!opt.file)
|
73585
|
+
if (!opt.file) {
|
73445
73586
|
throw new TypeError("file is required");
|
73446
|
-
|
73587
|
+
}
|
73588
|
+
if (opt.gzip) {
|
73447
73589
|
throw new TypeError("cannot append to compressed archives");
|
73448
|
-
|
73590
|
+
}
|
73591
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
73449
73592
|
throw new TypeError("no files or directories specified");
|
73593
|
+
}
|
73450
73594
|
files = Array.from(files);
|
73451
73595
|
return opt.sync ? replaceSync(opt, files) : replace(opt, files, cb);
|
73452
73596
|
};
|
@@ -73459,10 +73603,11 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73459
73603
|
try {
|
73460
73604
|
fd = fs.openSync(opt.file, "r+");
|
73461
73605
|
} catch (er) {
|
73462
|
-
if (er.code === "ENOENT")
|
73606
|
+
if (er.code === "ENOENT") {
|
73463
73607
|
fd = fs.openSync(opt.file, "w+");
|
73464
|
-
else
|
73608
|
+
} else {
|
73465
73609
|
throw er;
|
73610
|
+
}
|
73466
73611
|
}
|
73467
73612
|
const st = fs.fstatSync(fd);
|
73468
73613
|
const headBuf = Buffer.alloc(512);
|
@@ -73470,20 +73615,25 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73470
73615
|
for (position = 0; position < st.size; position += 512) {
|
73471
73616
|
for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
|
73472
73617
|
bytes = fs.readSync(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos);
|
73473
|
-
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139)
|
73618
|
+
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) {
|
73474
73619
|
throw new Error("cannot append to compressed archives");
|
73475
|
-
|
73620
|
+
}
|
73621
|
+
if (!bytes) {
|
73476
73622
|
break POSITION;
|
73623
|
+
}
|
73477
73624
|
}
|
73478
73625
|
const h = new Header(headBuf);
|
73479
|
-
if (!h.cksumValid)
|
73626
|
+
if (!h.cksumValid) {
|
73480
73627
|
break;
|
73628
|
+
}
|
73481
73629
|
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
73482
|
-
if (position + entryBlockSize + 512 > st.size)
|
73630
|
+
if (position + entryBlockSize + 512 > st.size) {
|
73483
73631
|
break;
|
73632
|
+
}
|
73484
73633
|
position += entryBlockSize;
|
73485
|
-
if (opt.mtimeCache)
|
73634
|
+
if (opt.mtimeCache) {
|
73486
73635
|
opt.mtimeCache.set(h.path, h.mtime);
|
73636
|
+
}
|
73487
73637
|
}
|
73488
73638
|
threw = false;
|
73489
73639
|
streamSync(opt, p, position, fd, files);
|
@@ -73509,38 +73659,47 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73509
73659
|
const p = new Pack(opt);
|
73510
73660
|
const getPos = (fd, size, cb_) => {
|
73511
73661
|
const cb2 = (er, pos) => {
|
73512
|
-
if (er)
|
73662
|
+
if (er) {
|
73513
73663
|
fs.close(fd, (_) => cb_(er));
|
73514
|
-
else
|
73664
|
+
} else {
|
73515
73665
|
cb_(null, pos);
|
73666
|
+
}
|
73516
73667
|
};
|
73517
73668
|
let position = 0;
|
73518
|
-
if (size === 0)
|
73669
|
+
if (size === 0) {
|
73519
73670
|
return cb2(null, 0);
|
73671
|
+
}
|
73520
73672
|
let bufPos = 0;
|
73521
73673
|
const headBuf = Buffer.alloc(512);
|
73522
73674
|
const onread = (er, bytes) => {
|
73523
|
-
if (er)
|
73675
|
+
if (er) {
|
73524
73676
|
return cb2(er);
|
73677
|
+
}
|
73525
73678
|
bufPos += bytes;
|
73526
73679
|
if (bufPos < 512 && bytes) {
|
73527
73680
|
return fs.read(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread);
|
73528
73681
|
}
|
73529
|
-
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139)
|
73682
|
+
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) {
|
73530
73683
|
return cb2(new Error("cannot append to compressed archives"));
|
73531
|
-
|
73684
|
+
}
|
73685
|
+
if (bufPos < 512) {
|
73532
73686
|
return cb2(null, position);
|
73687
|
+
}
|
73533
73688
|
const h = new Header(headBuf);
|
73534
|
-
if (!h.cksumValid)
|
73689
|
+
if (!h.cksumValid) {
|
73535
73690
|
return cb2(null, position);
|
73691
|
+
}
|
73536
73692
|
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
73537
|
-
if (position + entryBlockSize + 512 > size)
|
73693
|
+
if (position + entryBlockSize + 512 > size) {
|
73538
73694
|
return cb2(null, position);
|
73695
|
+
}
|
73539
73696
|
position += entryBlockSize + 512;
|
73540
|
-
if (position >= size)
|
73697
|
+
if (position >= size) {
|
73541
73698
|
return cb2(null, position);
|
73542
|
-
|
73699
|
+
}
|
73700
|
+
if (opt.mtimeCache) {
|
73543
73701
|
opt.mtimeCache.set(h.path, h.mtime);
|
73702
|
+
}
|
73544
73703
|
bufPos = 0;
|
73545
73704
|
fs.read(fd, headBuf, 0, 512, position, onread);
|
73546
73705
|
};
|
@@ -73554,14 +73713,17 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73554
73713
|
flag = "w+";
|
73555
73714
|
return fs.open(opt.file, flag, onopen);
|
73556
73715
|
}
|
73557
|
-
if (er)
|
73716
|
+
if (er) {
|
73558
73717
|
return reject(er);
|
73718
|
+
}
|
73559
73719
|
fs.fstat(fd, (er2, st) => {
|
73560
|
-
if (er2)
|
73720
|
+
if (er2) {
|
73561
73721
|
return fs.close(fd, () => reject(er2));
|
73722
|
+
}
|
73562
73723
|
getPos(fd, st.size, (er3, position) => {
|
73563
|
-
if (er3)
|
73724
|
+
if (er3) {
|
73564
73725
|
return reject(er3);
|
73726
|
+
}
|
73565
73727
|
const stream = new fsm.WriteStream(opt.file, {
|
73566
73728
|
fd,
|
73567
73729
|
start: position
|
@@ -73581,13 +73743,14 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73581
73743
|
files.forEach((file) => {
|
73582
73744
|
if (file.charAt(0) === "@") {
|
73583
73745
|
t({
|
73584
|
-
file: path.resolve(p.cwd, file.
|
73746
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
73585
73747
|
sync: true,
|
73586
73748
|
noResume: true,
|
73587
73749
|
onentry: (entry) => p.add(entry)
|
73588
73750
|
});
|
73589
|
-
} else
|
73751
|
+
} else {
|
73590
73752
|
p.add(file);
|
73753
|
+
}
|
73591
73754
|
});
|
73592
73755
|
p.end();
|
73593
73756
|
};
|
@@ -73596,12 +73759,13 @@ var require_replace = __commonJSMin((exports, module2) => {
|
|
73596
73759
|
const file = files.shift();
|
73597
73760
|
if (file.charAt(0) === "@") {
|
73598
73761
|
return t({
|
73599
|
-
file: path.resolve(p.cwd, file.
|
73762
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
73600
73763
|
noResume: true,
|
73601
73764
|
onentry: (entry) => p.add(entry)
|
73602
73765
|
}).then((_) => addFilesAsync(p, files));
|
73603
|
-
} else
|
73766
|
+
} else {
|
73604
73767
|
p.add(file);
|
73768
|
+
}
|
73605
73769
|
}
|
73606
73770
|
p.end();
|
73607
73771
|
};
|
@@ -73612,20 +73776,24 @@ var require_update = __commonJSMin((exports, module2) => {
|
|
73612
73776
|
var r = require_replace();
|
73613
73777
|
module2.exports = (opt_, files, cb) => {
|
73614
73778
|
const opt = hlo(opt_);
|
73615
|
-
if (!opt.file)
|
73779
|
+
if (!opt.file) {
|
73616
73780
|
throw new TypeError("file is required");
|
73617
|
-
|
73781
|
+
}
|
73782
|
+
if (opt.gzip) {
|
73618
73783
|
throw new TypeError("cannot append to compressed archives");
|
73619
|
-
|
73784
|
+
}
|
73785
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
73620
73786
|
throw new TypeError("no files or directories specified");
|
73787
|
+
}
|
73621
73788
|
files = Array.from(files);
|
73622
73789
|
mtimeFilter(opt);
|
73623
73790
|
return r(opt, files, cb);
|
73624
73791
|
};
|
73625
73792
|
var mtimeFilter = (opt) => {
|
73626
73793
|
const filter = opt.filter;
|
73627
|
-
if (!opt.mtimeCache)
|
73794
|
+
if (!opt.mtimeCache) {
|
73628
73795
|
opt.mtimeCache = /* @__PURE__ */ new Map();
|
73796
|
+
}
|
73629
73797
|
opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime);
|
73630
73798
|
};
|
73631
73799
|
});
|
@@ -73977,8 +74145,9 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
73977
74145
|
var cSet = (cache, key, val) => cache.set(normPath(key), val);
|
73978
74146
|
var checkCwd = (dir, cb) => {
|
73979
74147
|
fs.stat(dir, (er, st) => {
|
73980
|
-
if (er || !st.isDirectory())
|
74148
|
+
if (er || !st.isDirectory()) {
|
73981
74149
|
er = new CwdError(dir, er && er.code || "ENOTDIR");
|
74150
|
+
}
|
73982
74151
|
cb(er);
|
73983
74152
|
});
|
73984
74153
|
};
|
@@ -73995,35 +74164,41 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
73995
74164
|
const cache = opt.cache;
|
73996
74165
|
const cwd = normPath(opt.cwd);
|
73997
74166
|
const done = (er, created) => {
|
73998
|
-
if (er)
|
74167
|
+
if (er) {
|
73999
74168
|
cb(er);
|
74000
|
-
else {
|
74169
|
+
} else {
|
74001
74170
|
cSet(cache, dir, true);
|
74002
|
-
if (created && doChown)
|
74171
|
+
if (created && doChown) {
|
74003
74172
|
chownr(created, uid, gid, (er2) => done(er2));
|
74004
|
-
else if (needChmod)
|
74173
|
+
} else if (needChmod) {
|
74005
74174
|
fs.chmod(dir, mode, cb);
|
74006
|
-
else
|
74175
|
+
} else {
|
74007
74176
|
cb();
|
74177
|
+
}
|
74008
74178
|
}
|
74009
74179
|
};
|
74010
|
-
if (cache && cGet(cache, dir) === true)
|
74180
|
+
if (cache && cGet(cache, dir) === true) {
|
74011
74181
|
return done();
|
74012
|
-
|
74182
|
+
}
|
74183
|
+
if (dir === cwd) {
|
74013
74184
|
return checkCwd(dir, done);
|
74014
|
-
|
74185
|
+
}
|
74186
|
+
if (preserve) {
|
74015
74187
|
return mkdirp(dir, { mode }).then((made) => done(null, made), done);
|
74188
|
+
}
|
74016
74189
|
const sub = normPath(path.relative(cwd, dir));
|
74017
74190
|
const parts = sub.split("/");
|
74018
74191
|
mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done);
|
74019
74192
|
};
|
74020
74193
|
var mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {
|
74021
|
-
if (!parts.length)
|
74194
|
+
if (!parts.length) {
|
74022
74195
|
return cb(null, created);
|
74196
|
+
}
|
74023
74197
|
const p = parts.shift();
|
74024
74198
|
const part = normPath(path.resolve(base + "/" + p));
|
74025
|
-
if (cGet(cache, part))
|
74199
|
+
if (cGet(cache, part)) {
|
74026
74200
|
return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb);
|
74201
|
+
}
|
74027
74202
|
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb));
|
74028
74203
|
};
|
74029
74204
|
var onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => (er) => {
|
@@ -74032,18 +74207,20 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
74032
74207
|
if (statEr) {
|
74033
74208
|
statEr.path = statEr.path && normPath(statEr.path);
|
74034
74209
|
cb(statEr);
|
74035
|
-
} else if (st.isDirectory())
|
74210
|
+
} else if (st.isDirectory()) {
|
74036
74211
|
mkdir_(part, parts, mode, cache, unlink, cwd, created, cb);
|
74037
|
-
else if (unlink) {
|
74212
|
+
} else if (unlink) {
|
74038
74213
|
fs.unlink(part, (er2) => {
|
74039
|
-
if (er2)
|
74214
|
+
if (er2) {
|
74040
74215
|
return cb(er2);
|
74216
|
+
}
|
74041
74217
|
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb));
|
74042
74218
|
});
|
74043
|
-
} else if (st.isSymbolicLink())
|
74219
|
+
} else if (st.isSymbolicLink()) {
|
74044
74220
|
return cb(new SymlinkError(part, part + "/" + parts.join("/")));
|
74045
|
-
else
|
74221
|
+
} else {
|
74046
74222
|
cb(er);
|
74223
|
+
}
|
74047
74224
|
});
|
74048
74225
|
} else {
|
74049
74226
|
created = created || part;
|
@@ -74058,8 +74235,9 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
74058
74235
|
} catch (er) {
|
74059
74236
|
code = er.code;
|
74060
74237
|
} finally {
|
74061
|
-
if (!ok)
|
74238
|
+
if (!ok) {
|
74062
74239
|
throw new CwdError(dir, code);
|
74240
|
+
}
|
74063
74241
|
}
|
74064
74242
|
};
|
74065
74243
|
module2.exports.sync = (dir, opt) => {
|
@@ -74076,26 +74254,31 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
74076
74254
|
const cwd = normPath(opt.cwd);
|
74077
74255
|
const done = (created2) => {
|
74078
74256
|
cSet(cache, dir, true);
|
74079
|
-
if (created2 && doChown)
|
74257
|
+
if (created2 && doChown) {
|
74080
74258
|
chownr.sync(created2, uid, gid);
|
74081
|
-
|
74259
|
+
}
|
74260
|
+
if (needChmod) {
|
74082
74261
|
fs.chmodSync(dir, mode);
|
74262
|
+
}
|
74083
74263
|
};
|
74084
|
-
if (cache && cGet(cache, dir) === true)
|
74264
|
+
if (cache && cGet(cache, dir) === true) {
|
74085
74265
|
return done();
|
74266
|
+
}
|
74086
74267
|
if (dir === cwd) {
|
74087
74268
|
checkCwdSync(cwd);
|
74088
74269
|
return done();
|
74089
74270
|
}
|
74090
|
-
if (preserve)
|
74271
|
+
if (preserve) {
|
74091
74272
|
return done(mkdirp.sync(dir, mode));
|
74273
|
+
}
|
74092
74274
|
const sub = normPath(path.relative(cwd, dir));
|
74093
74275
|
const parts = sub.split("/");
|
74094
74276
|
let created = null;
|
74095
74277
|
for (let p = parts.shift(), part = cwd; p && (part += "/" + p); p = parts.shift()) {
|
74096
74278
|
part = normPath(path.resolve(part));
|
74097
|
-
if (cGet(cache, part))
|
74279
|
+
if (cGet(cache, part)) {
|
74098
74280
|
continue;
|
74281
|
+
}
|
74099
74282
|
try {
|
74100
74283
|
fs.mkdirSync(part, mode);
|
74101
74284
|
created = created || part;
|
@@ -74111,8 +74294,9 @@ var require_mkdir = __commonJSMin((exports, module2) => {
|
|
74111
74294
|
created = created || part;
|
74112
74295
|
cSet(cache, part, true);
|
74113
74296
|
continue;
|
74114
|
-
} else if (st.isSymbolicLink())
|
74297
|
+
} else if (st.isSymbolicLink()) {
|
74115
74298
|
return new SymlinkError(part, part + "/" + parts.join("/"));
|
74299
|
+
}
|
74116
74300
|
}
|
74117
74301
|
}
|
74118
74302
|
return done(created);
|
@@ -74122,8 +74306,9 @@ var require_normalize_unicode = __commonJSMin((exports, module2) => {
|
|
74122
74306
|
var normalizeCache = /* @__PURE__ */ Object.create(null);
|
74123
74307
|
var { hasOwnProperty } = Object.prototype;
|
74124
74308
|
module2.exports = (s) => {
|
74125
|
-
if (!hasOwnProperty.call(normalizeCache, s))
|
74309
|
+
if (!hasOwnProperty.call(normalizeCache, s)) {
|
74126
74310
|
normalizeCache[s] = s.normalize("NFKD");
|
74311
|
+
}
|
74127
74312
|
return normalizeCache[s];
|
74128
74313
|
};
|
74129
74314
|
});
|
@@ -74139,8 +74324,9 @@ var require_path_reservations = __commonJSMin((exports, module2) => {
|
|
74139
74324
|
const reservations = /* @__PURE__ */ new Map();
|
74140
74325
|
const getDirs = (path) => {
|
74141
74326
|
const dirs = path.split("/").slice(0, -1).reduce((set, path2) => {
|
74142
|
-
if (set.length)
|
74327
|
+
if (set.length) {
|
74143
74328
|
path2 = join(set[set.length - 1], path2);
|
74329
|
+
}
|
74144
74330
|
set.push(path2 || "/");
|
74145
74331
|
return set;
|
74146
74332
|
}, []);
|
@@ -74149,8 +74335,9 @@ var require_path_reservations = __commonJSMin((exports, module2) => {
|
|
74149
74335
|
const running = /* @__PURE__ */ new Set();
|
74150
74336
|
const getQueues = (fn) => {
|
74151
74337
|
const res = reservations.get(fn);
|
74152
|
-
if (!res)
|
74338
|
+
if (!res) {
|
74153
74339
|
throw new Error("function does not have any path reservations");
|
74340
|
+
}
|
74154
74341
|
return {
|
74155
74342
|
paths: res.paths.map((path) => queues.get(path)),
|
74156
74343
|
dirs: [...res.dirs].map((path) => queues.get(path))
|
@@ -74161,40 +74348,44 @@ var require_path_reservations = __commonJSMin((exports, module2) => {
|
|
74161
74348
|
return paths.every((q) => q[0] === fn) && dirs.every((q) => q[0] instanceof Set && q[0].has(fn));
|
74162
74349
|
};
|
74163
74350
|
const run = (fn) => {
|
74164
|
-
if (running.has(fn) || !check(fn))
|
74351
|
+
if (running.has(fn) || !check(fn)) {
|
74165
74352
|
return false;
|
74353
|
+
}
|
74166
74354
|
running.add(fn);
|
74167
74355
|
fn(() => clear(fn));
|
74168
74356
|
return true;
|
74169
74357
|
};
|
74170
74358
|
const clear = (fn) => {
|
74171
|
-
if (!running.has(fn))
|
74359
|
+
if (!running.has(fn)) {
|
74172
74360
|
return false;
|
74361
|
+
}
|
74173
74362
|
const { paths, dirs } = reservations.get(fn);
|
74174
74363
|
const next = /* @__PURE__ */ new Set();
|
74175
74364
|
paths.forEach((path) => {
|
74176
74365
|
const q = queues.get(path);
|
74177
74366
|
assert.equal(q[0], fn);
|
74178
|
-
if (q.length === 1)
|
74367
|
+
if (q.length === 1) {
|
74179
74368
|
queues.delete(path);
|
74180
|
-
else {
|
74369
|
+
} else {
|
74181
74370
|
q.shift();
|
74182
|
-
if (typeof q[0] === "function")
|
74371
|
+
if (typeof q[0] === "function") {
|
74183
74372
|
next.add(q[0]);
|
74184
|
-
else
|
74373
|
+
} else {
|
74185
74374
|
q[0].forEach((fn2) => next.add(fn2));
|
74375
|
+
}
|
74186
74376
|
}
|
74187
74377
|
});
|
74188
74378
|
dirs.forEach((dir) => {
|
74189
74379
|
const q = queues.get(dir);
|
74190
74380
|
assert(q[0] instanceof Set);
|
74191
|
-
if (q[0].size === 1 && q.length === 1)
|
74381
|
+
if (q[0].size === 1 && q.length === 1) {
|
74192
74382
|
queues.delete(dir);
|
74193
|
-
else if (q[0].size === 1) {
|
74383
|
+
} else if (q[0].size === 1) {
|
74194
74384
|
q.shift();
|
74195
74385
|
next.add(q[0]);
|
74196
|
-
} else
|
74386
|
+
} else {
|
74197
74387
|
q[0].delete(fn);
|
74388
|
+
}
|
74198
74389
|
});
|
74199
74390
|
running.delete(fn);
|
74200
74391
|
next.forEach((fn2) => run(fn2));
|
@@ -74208,19 +74399,21 @@ var require_path_reservations = __commonJSMin((exports, module2) => {
|
|
74208
74399
|
reservations.set(fn, { dirs, paths });
|
74209
74400
|
paths.forEach((path) => {
|
74210
74401
|
const q = queues.get(path);
|
74211
|
-
if (!q)
|
74402
|
+
if (!q) {
|
74212
74403
|
queues.set(path, [fn]);
|
74213
|
-
else
|
74404
|
+
} else {
|
74214
74405
|
q.push(fn);
|
74406
|
+
}
|
74215
74407
|
});
|
74216
74408
|
dirs.forEach((dir) => {
|
74217
74409
|
const q = queues.get(dir);
|
74218
|
-
if (!q)
|
74410
|
+
if (!q) {
|
74219
74411
|
queues.set(dir, [/* @__PURE__ */ new Set([fn])]);
|
74220
|
-
else if (q[q.length - 1] instanceof Set)
|
74412
|
+
} else if (q[q.length - 1] instanceof Set) {
|
74221
74413
|
q[q.length - 1].add(fn);
|
74222
|
-
else
|
74414
|
+
} else {
|
74223
74415
|
q.push(/* @__PURE__ */ new Set([fn]));
|
74416
|
+
}
|
74224
74417
|
});
|
74225
74418
|
return run(fn);
|
74226
74419
|
};
|
@@ -74281,18 +74474,21 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74281
74474
|
var platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
74282
74475
|
var isWindows = platform === "win32";
|
74283
74476
|
var unlinkFile = (path2, cb) => {
|
74284
|
-
if (!isWindows)
|
74477
|
+
if (!isWindows) {
|
74285
74478
|
return fs.unlink(path2, cb);
|
74479
|
+
}
|
74286
74480
|
const name4 = path2 + ".DELETE." + crypto.randomBytes(16).toString("hex");
|
74287
74481
|
fs.rename(path2, name4, (er) => {
|
74288
|
-
if (er)
|
74482
|
+
if (er) {
|
74289
74483
|
return cb(er);
|
74484
|
+
}
|
74290
74485
|
fs.unlink(name4, cb);
|
74291
74486
|
});
|
74292
74487
|
};
|
74293
74488
|
var unlinkFileSync = (path2) => {
|
74294
|
-
if (!isWindows)
|
74489
|
+
if (!isWindows) {
|
74295
74490
|
return fs.unlinkSync(path2);
|
74491
|
+
}
|
74296
74492
|
const name4 = path2 + ".DELETE." + crypto.randomBytes(16).toString("hex");
|
74297
74493
|
fs.renameSync(path2, name4);
|
74298
74494
|
fs.unlinkSync(name4);
|
@@ -74303,18 +74499,21 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74303
74499
|
abs = cacheKeyNormalize(abs);
|
74304
74500
|
for (const path2 of cache.keys()) {
|
74305
74501
|
const pnorm = cacheKeyNormalize(path2);
|
74306
|
-
if (pnorm === abs || pnorm.indexOf(abs + "/") === 0)
|
74502
|
+
if (pnorm === abs || pnorm.indexOf(abs + "/") === 0) {
|
74307
74503
|
cache.delete(path2);
|
74504
|
+
}
|
74308
74505
|
}
|
74309
74506
|
};
|
74310
74507
|
var dropCache = (cache) => {
|
74311
|
-
for (const key of cache.keys())
|
74508
|
+
for (const key of cache.keys()) {
|
74312
74509
|
cache.delete(key);
|
74510
|
+
}
|
74313
74511
|
};
|
74314
74512
|
var Unpack = class extends Parser {
|
74315
74513
|
constructor(opt) {
|
74316
|
-
if (!opt)
|
74514
|
+
if (!opt) {
|
74317
74515
|
opt = {};
|
74516
|
+
}
|
74318
74517
|
opt.ondone = (_) => {
|
74319
74518
|
this[ENDED] = true;
|
74320
74519
|
this[MAYBECLOSE]();
|
@@ -74329,8 +74528,9 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74329
74528
|
this[ENDED] = false;
|
74330
74529
|
this.dirCache = opt.dirCache || /* @__PURE__ */ new Map();
|
74331
74530
|
if (typeof opt.uid === "number" || typeof opt.gid === "number") {
|
74332
|
-
if (typeof opt.uid !== "number" || typeof opt.gid !== "number")
|
74531
|
+
if (typeof opt.uid !== "number" || typeof opt.gid !== "number") {
|
74333
74532
|
throw new TypeError("cannot set owner without number uid and gid");
|
74533
|
+
}
|
74334
74534
|
if (opt.preserveOwner) {
|
74335
74535
|
throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
74336
74536
|
}
|
@@ -74342,10 +74542,11 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74342
74542
|
this.gid = null;
|
74343
74543
|
this.setOwner = false;
|
74344
74544
|
}
|
74345
|
-
if (opt.preserveOwner === void 0 && typeof opt.uid !== "number")
|
74545
|
+
if (opt.preserveOwner === void 0 && typeof opt.uid !== "number") {
|
74346
74546
|
this.preserveOwner = process.getuid && process.getuid() === 0;
|
74347
|
-
else
|
74547
|
+
} else {
|
74348
74548
|
this.preserveOwner = !!opt.preserveOwner;
|
74549
|
+
}
|
74349
74550
|
this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null;
|
74350
74551
|
this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null;
|
74351
74552
|
this.forceChown = opt.forceChown === true;
|
@@ -74364,8 +74565,9 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74364
74565
|
this.on("entry", (entry) => this[ONENTRY](entry));
|
74365
74566
|
}
|
74366
74567
|
warn(code, msg, data = {}) {
|
74367
|
-
if (code === "TAR_BAD_ARCHIVE" || code === "TAR_ABORT")
|
74568
|
+
if (code === "TAR_BAD_ARCHIVE" || code === "TAR_ABORT") {
|
74368
74569
|
data.recoverable = false;
|
74570
|
+
}
|
74369
74571
|
return super.warn(code, msg, data);
|
74370
74572
|
}
|
74371
74573
|
[MAYBECLOSE]() {
|
@@ -74373,21 +74575,22 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74373
74575
|
this.emit("prefinish");
|
74374
74576
|
this.emit("finish");
|
74375
74577
|
this.emit("end");
|
74376
|
-
this.emit("close");
|
74377
74578
|
}
|
74378
74579
|
}
|
74379
74580
|
[CHECKPATH](entry) {
|
74380
74581
|
if (this.strip) {
|
74381
74582
|
const parts = normPath(entry.path).split("/");
|
74382
|
-
if (parts.length < this.strip)
|
74583
|
+
if (parts.length < this.strip) {
|
74383
74584
|
return false;
|
74585
|
+
}
|
74384
74586
|
entry.path = parts.slice(this.strip).join("/");
|
74385
74587
|
if (entry.type === "Link") {
|
74386
74588
|
const linkparts = normPath(entry.linkpath).split("/");
|
74387
|
-
if (linkparts.length >= this.strip)
|
74589
|
+
if (linkparts.length >= this.strip) {
|
74388
74590
|
entry.linkpath = linkparts.slice(this.strip).join("/");
|
74389
|
-
else
|
74591
|
+
} else {
|
74390
74592
|
return false;
|
74593
|
+
}
|
74391
74594
|
}
|
74392
74595
|
}
|
74393
74596
|
if (!this.preservePaths) {
|
@@ -74409,10 +74612,11 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74409
74612
|
});
|
74410
74613
|
}
|
74411
74614
|
}
|
74412
|
-
if (path.isAbsolute(entry.path))
|
74615
|
+
if (path.isAbsolute(entry.path)) {
|
74413
74616
|
entry.absolute = normPath(path.resolve(entry.path));
|
74414
|
-
else
|
74617
|
+
} else {
|
74415
74618
|
entry.absolute = normPath(path.resolve(this.cwd, entry.path));
|
74619
|
+
}
|
74416
74620
|
if (!this.preservePaths && entry.absolute.indexOf(this.cwd + "/") !== 0 && entry.absolute !== this.cwd) {
|
74417
74621
|
this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", {
|
74418
74622
|
entry,
|
@@ -74422,25 +74626,28 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74422
74626
|
});
|
74423
74627
|
return false;
|
74424
74628
|
}
|
74425
|
-
if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir")
|
74629
|
+
if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir") {
|
74426
74630
|
return false;
|
74631
|
+
}
|
74427
74632
|
if (this.win32) {
|
74428
74633
|
const { root: aRoot } = path.win32.parse(entry.absolute);
|
74429
|
-
entry.absolute = aRoot + wc.encode(entry.absolute.
|
74634
|
+
entry.absolute = aRoot + wc.encode(entry.absolute.slice(aRoot.length));
|
74430
74635
|
const { root: pRoot } = path.win32.parse(entry.path);
|
74431
|
-
entry.path = pRoot + wc.encode(entry.path.
|
74636
|
+
entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length));
|
74432
74637
|
}
|
74433
74638
|
return true;
|
74434
74639
|
}
|
74435
74640
|
[ONENTRY](entry) {
|
74436
|
-
if (!this[CHECKPATH](entry))
|
74641
|
+
if (!this[CHECKPATH](entry)) {
|
74437
74642
|
return entry.resume();
|
74643
|
+
}
|
74438
74644
|
assert.equal(typeof entry.absolute, "string");
|
74439
74645
|
switch (entry.type) {
|
74440
74646
|
case "Directory":
|
74441
74647
|
case "GNUDumpDir":
|
74442
|
-
if (entry.mode)
|
74648
|
+
if (entry.mode) {
|
74443
74649
|
entry.mode = entry.mode | 448;
|
74650
|
+
}
|
74444
74651
|
case "File":
|
74445
74652
|
case "OldFile":
|
74446
74653
|
case "ContiguousFile":
|
@@ -74455,9 +74662,9 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74455
74662
|
}
|
74456
74663
|
}
|
74457
74664
|
[ONERROR](er, entry) {
|
74458
|
-
if (er.name === "CwdError")
|
74665
|
+
if (er.name === "CwdError") {
|
74459
74666
|
this.emit("error", er);
|
74460
|
-
else {
|
74667
|
+
} else {
|
74461
74668
|
this.warn("TAR_ENTRY_ERROR", er, { entry });
|
74462
74669
|
this[UNPEND]();
|
74463
74670
|
entry.resume();
|
@@ -74495,9 +74702,10 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74495
74702
|
autoClose: false
|
74496
74703
|
});
|
74497
74704
|
stream.on("error", (er) => {
|
74498
|
-
if (stream.fd)
|
74705
|
+
if (stream.fd) {
|
74499
74706
|
fs.close(stream.fd, () => {
|
74500
74707
|
});
|
74708
|
+
}
|
74501
74709
|
stream.write = () => true;
|
74502
74710
|
this[ONERROR](er, entry);
|
74503
74711
|
fullyDone();
|
@@ -74505,19 +74713,21 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74505
74713
|
let actions = 1;
|
74506
74714
|
const done = (er) => {
|
74507
74715
|
if (er) {
|
74508
|
-
if (stream.fd)
|
74716
|
+
if (stream.fd) {
|
74509
74717
|
fs.close(stream.fd, () => {
|
74510
74718
|
});
|
74719
|
+
}
|
74511
74720
|
this[ONERROR](er, entry);
|
74512
74721
|
fullyDone();
|
74513
74722
|
return;
|
74514
74723
|
}
|
74515
74724
|
if (--actions === 0) {
|
74516
74725
|
fs.close(stream.fd, (er2) => {
|
74517
|
-
if (er2)
|
74726
|
+
if (er2) {
|
74518
74727
|
this[ONERROR](er2, entry);
|
74519
|
-
else
|
74728
|
+
} else {
|
74520
74729
|
this[UNPEND]();
|
74730
|
+
}
|
74521
74731
|
fullyDone();
|
74522
74732
|
});
|
74523
74733
|
}
|
@@ -74605,15 +74815,17 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74605
74815
|
[CHECKFS](entry) {
|
74606
74816
|
this[PEND]();
|
74607
74817
|
const paths = [entry.path];
|
74608
|
-
if (entry.linkpath)
|
74818
|
+
if (entry.linkpath) {
|
74609
74819
|
paths.push(entry.linkpath);
|
74820
|
+
}
|
74610
74821
|
this.reservations.reserve(paths, (done) => this[CHECKFS2](entry, done));
|
74611
74822
|
}
|
74612
74823
|
[PRUNECACHE](entry) {
|
74613
|
-
if (entry.type === "SymbolicLink")
|
74824
|
+
if (entry.type === "SymbolicLink") {
|
74614
74825
|
dropCache(this.dirCache);
|
74615
|
-
else if (entry.type !== "Directory")
|
74826
|
+
} else if (entry.type !== "Directory") {
|
74616
74827
|
pruneCache(this.dirCache, entry.absolute);
|
74828
|
+
}
|
74617
74829
|
}
|
74618
74830
|
[CHECKFS2](entry, fullyDone) {
|
74619
74831
|
this[PRUNECACHE](entry);
|
@@ -74655,29 +74867,33 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74655
74867
|
done();
|
74656
74868
|
return;
|
74657
74869
|
}
|
74658
|
-
if (lstatEr || this[ISREUSABLE](entry, st))
|
74870
|
+
if (lstatEr || this[ISREUSABLE](entry, st)) {
|
74659
74871
|
return this[MAKEFS](null, entry, done);
|
74872
|
+
}
|
74660
74873
|
if (st.isDirectory()) {
|
74661
74874
|
if (entry.type === "Directory") {
|
74662
74875
|
const needChmod = !this.noChmod && entry.mode && (st.mode & 4095) !== entry.mode;
|
74663
74876
|
const afterChmod = (er) => this[MAKEFS](er, entry, done);
|
74664
|
-
if (!needChmod)
|
74877
|
+
if (!needChmod) {
|
74665
74878
|
return afterChmod();
|
74879
|
+
}
|
74666
74880
|
return fs.chmod(entry.absolute, entry.mode, afterChmod);
|
74667
74881
|
}
|
74668
74882
|
if (entry.absolute !== this.cwd) {
|
74669
74883
|
return fs.rmdir(entry.absolute, (er) => this[MAKEFS](er, entry, done));
|
74670
74884
|
}
|
74671
74885
|
}
|
74672
|
-
if (entry.absolute === this.cwd)
|
74886
|
+
if (entry.absolute === this.cwd) {
|
74673
74887
|
return this[MAKEFS](null, entry, done);
|
74888
|
+
}
|
74674
74889
|
unlinkFile(entry.absolute, (er) => this[MAKEFS](er, entry, done));
|
74675
74890
|
});
|
74676
74891
|
};
|
74677
|
-
if (this[CHECKED_CWD])
|
74892
|
+
if (this[CHECKED_CWD]) {
|
74678
74893
|
start();
|
74679
|
-
else
|
74894
|
+
} else {
|
74680
74895
|
checkCwd();
|
74896
|
+
}
|
74681
74897
|
}
|
74682
74898
|
[MAKEFS](er, entry, done) {
|
74683
74899
|
if (er) {
|
@@ -74701,9 +74917,9 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74701
74917
|
}
|
74702
74918
|
[LINK](entry, linkpath, link, done) {
|
74703
74919
|
fs[link](linkpath, entry.absolute, (er) => {
|
74704
|
-
if (er)
|
74920
|
+
if (er) {
|
74705
74921
|
this[ONERROR](er, entry);
|
74706
|
-
else {
|
74922
|
+
} else {
|
74707
74923
|
this[UNPEND]();
|
74708
74924
|
entry.resume();
|
74709
74925
|
}
|
@@ -74727,23 +74943,27 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74727
74943
|
this[PRUNECACHE](entry);
|
74728
74944
|
if (!this[CHECKED_CWD]) {
|
74729
74945
|
const er2 = this[MKDIR](this.cwd, this.dmode);
|
74730
|
-
if (er2)
|
74946
|
+
if (er2) {
|
74731
74947
|
return this[ONERROR](er2, entry);
|
74948
|
+
}
|
74732
74949
|
this[CHECKED_CWD] = true;
|
74733
74950
|
}
|
74734
74951
|
if (entry.absolute !== this.cwd) {
|
74735
74952
|
const parent = normPath(path.dirname(entry.absolute));
|
74736
74953
|
if (parent !== this.cwd) {
|
74737
74954
|
const mkParent = this[MKDIR](parent, this.dmode);
|
74738
|
-
if (mkParent)
|
74955
|
+
if (mkParent) {
|
74739
74956
|
return this[ONERROR](mkParent, entry);
|
74957
|
+
}
|
74740
74958
|
}
|
74741
74959
|
}
|
74742
74960
|
const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute));
|
74743
|
-
if (st && (this.keep || this.newer && st.mtime > entry.mtime))
|
74961
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
|
74744
74962
|
return this[SKIP](entry);
|
74745
|
-
|
74963
|
+
}
|
74964
|
+
if (lstatEr || this[ISREUSABLE](entry, st)) {
|
74746
74965
|
return this[MAKEFS](null, entry);
|
74966
|
+
}
|
74747
74967
|
if (st.isDirectory()) {
|
74748
74968
|
if (entry.type === "Directory") {
|
74749
74969
|
const needChmod = !this.noChmod && entry.mode && (st.mode & 4095) !== entry.mode;
|
@@ -74767,8 +74987,9 @@ var require_unpack = __commonJSMin((exports, module2) => {
|
|
74767
74987
|
} catch (e) {
|
74768
74988
|
closeError = e;
|
74769
74989
|
}
|
74770
|
-
if (er || closeError)
|
74990
|
+
if (er || closeError) {
|
74771
74991
|
this[ONERROR](er || closeError, entry);
|
74992
|
+
}
|
74772
74993
|
done();
|
74773
74994
|
};
|
74774
74995
|
let fd;
|
@@ -74883,23 +75104,29 @@ var require_extract = __commonJSMin((exports, module2) => {
|
|
74883
75104
|
var path = __require("path");
|
74884
75105
|
var stripSlash = require_strip_trailing_slashes();
|
74885
75106
|
module2.exports = (opt_, files, cb) => {
|
74886
|
-
if (typeof opt_ === "function")
|
75107
|
+
if (typeof opt_ === "function") {
|
74887
75108
|
cb = opt_, files = null, opt_ = {};
|
74888
|
-
else if (Array.isArray(opt_))
|
75109
|
+
} else if (Array.isArray(opt_)) {
|
74889
75110
|
files = opt_, opt_ = {};
|
74890
|
-
|
75111
|
+
}
|
75112
|
+
if (typeof files === "function") {
|
74891
75113
|
cb = files, files = null;
|
74892
|
-
|
75114
|
+
}
|
75115
|
+
if (!files) {
|
74893
75116
|
files = [];
|
74894
|
-
else
|
75117
|
+
} else {
|
74895
75118
|
files = Array.from(files);
|
75119
|
+
}
|
74896
75120
|
const opt = hlo(opt_);
|
74897
|
-
if (opt.sync && typeof cb === "function")
|
75121
|
+
if (opt.sync && typeof cb === "function") {
|
74898
75122
|
throw new TypeError("callback not supported for sync tar functions");
|
74899
|
-
|
75123
|
+
}
|
75124
|
+
if (!opt.file && typeof cb === "function") {
|
74900
75125
|
throw new TypeError("callback only supported with file option");
|
74901
|
-
|
75126
|
+
}
|
75127
|
+
if (files.length) {
|
74902
75128
|
filesFilter(opt, files);
|
75129
|
+
}
|
74903
75130
|
return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt);
|
74904
75131
|
};
|
74905
75132
|
var filesFilter = (opt, files) => {
|
@@ -74932,9 +75159,9 @@ var require_extract = __commonJSMin((exports, module2) => {
|
|
74932
75159
|
u.on("error", reject);
|
74933
75160
|
u.on("close", resolve);
|
74934
75161
|
fs.stat(file, (er, stat) => {
|
74935
|
-
if (er)
|
75162
|
+
if (er) {
|
74936
75163
|
reject(er);
|
74937
|
-
else {
|
75164
|
+
} else {
|
74938
75165
|
const stream = new fsm.ReadStream(file, {
|
74939
75166
|
readSize,
|
74940
75167
|
size: stat.size
|
@@ -75491,6 +75718,30 @@ function _classCallCheck(instance, Constructor) {
|
|
75491
75718
|
throw new TypeError("Cannot call a class as a function");
|
75492
75719
|
}
|
75493
75720
|
}
|
75721
|
+
function _typeof(obj) {
|
75722
|
+
"@babel/helpers - typeof";
|
75723
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
75724
|
+
return typeof obj2;
|
75725
|
+
} : function(obj2) {
|
75726
|
+
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
75727
|
+
}, _typeof(obj);
|
75728
|
+
}
|
75729
|
+
function _toPrimitive(input, hint) {
|
75730
|
+
if (_typeof(input) !== "object" || input === null)
|
75731
|
+
return input;
|
75732
|
+
var prim = input[Symbol.toPrimitive];
|
75733
|
+
if (prim !== void 0) {
|
75734
|
+
var res = prim.call(input, hint || "default");
|
75735
|
+
if (_typeof(res) !== "object")
|
75736
|
+
return res;
|
75737
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
75738
|
+
}
|
75739
|
+
return (hint === "string" ? String : Number)(input);
|
75740
|
+
}
|
75741
|
+
function _toPropertyKey(arg) {
|
75742
|
+
var key = _toPrimitive(arg, "string");
|
75743
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
75744
|
+
}
|
75494
75745
|
function _defineProperties(target, props) {
|
75495
75746
|
for (var i = 0; i < props.length; i++) {
|
75496
75747
|
var descriptor = props[i];
|
@@ -75498,7 +75749,7 @@ function _defineProperties(target, props) {
|
|
75498
75749
|
descriptor.configurable = true;
|
75499
75750
|
if ("value" in descriptor)
|
75500
75751
|
descriptor.writable = true;
|
75501
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
75752
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
75502
75753
|
}
|
75503
75754
|
}
|
75504
75755
|
function _createClass(Constructor, protoProps, staticProps) {
|
@@ -75512,6 +75763,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
75512
75763
|
return Constructor;
|
75513
75764
|
}
|
75514
75765
|
function _defineProperty(obj, key, value) {
|
75766
|
+
key = _toPropertyKey(key);
|
75515
75767
|
if (key in obj) {
|
75516
75768
|
Object.defineProperty(obj, key, {
|
75517
75769
|
value,
|