npm-pkg-lint 3.5.1 → 3.5.3
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 +834 -2949
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,12 +8,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
8
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __typeError = (msg) => {
|
|
12
|
+
throw TypeError(msg);
|
|
13
|
+
};
|
|
11
14
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
15
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
16
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
14
17
|
}) : x)(function(x) {
|
|
15
|
-
if (typeof require !== "undefined")
|
|
16
|
-
return require.apply(this, arguments);
|
|
18
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
17
19
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
18
20
|
});
|
|
19
21
|
var __commonJS = (cb, mod) => function __require2() {
|
|
@@ -35,28 +37,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
37
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
36
38
|
mod
|
|
37
39
|
));
|
|
38
|
-
var __publicField = (obj, key, value) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
throw TypeError("Cannot " + msg);
|
|
45
|
-
};
|
|
46
|
-
var __privateGet = (obj, member, getter) => {
|
|
47
|
-
__accessCheck(obj, member, "read from private field");
|
|
48
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
49
|
-
};
|
|
50
|
-
var __privateAdd = (obj, member, value) => {
|
|
51
|
-
if (member.has(obj))
|
|
52
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
53
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
54
|
-
};
|
|
55
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
56
|
-
__accessCheck(obj, member, "write to private field");
|
|
57
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
58
|
-
return value;
|
|
59
|
-
};
|
|
40
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
41
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
42
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
43
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
44
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
45
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
60
46
|
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
61
47
|
set _(value) {
|
|
62
48
|
__privateSet(obj, member, value, setter);
|
|
@@ -65,10 +51,6 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
65
51
|
return __privateGet(obj, member, getter);
|
|
66
52
|
}
|
|
67
53
|
});
|
|
68
|
-
var __privateMethod = (obj, member, method) => {
|
|
69
|
-
__accessCheck(obj, member, "access private method");
|
|
70
|
-
return method;
|
|
71
|
-
};
|
|
72
54
|
|
|
73
55
|
// node_modules/argparse/lib/sub.js
|
|
74
56
|
var require_sub = __commonJS({
|
|
@@ -78,27 +60,21 @@ var require_sub = __commonJS({
|
|
|
78
60
|
module.exports = function sub(pattern, ...values) {
|
|
79
61
|
let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g;
|
|
80
62
|
let result = pattern.replace(regex, function(_, is_literal, is_left_align, is_padded, name2, format) {
|
|
81
|
-
if (is_literal)
|
|
82
|
-
return "%";
|
|
63
|
+
if (is_literal) return "%";
|
|
83
64
|
let padded_count = 0;
|
|
84
65
|
if (is_padded) {
|
|
85
|
-
if (values.length === 0)
|
|
86
|
-
throw new TypeError("not enough arguments for format string");
|
|
66
|
+
if (values.length === 0) throw new TypeError("not enough arguments for format string");
|
|
87
67
|
padded_count = values.shift();
|
|
88
|
-
if (!Number.isInteger(padded_count))
|
|
89
|
-
throw new TypeError("* wants int");
|
|
68
|
+
if (!Number.isInteger(padded_count)) throw new TypeError("* wants int");
|
|
90
69
|
}
|
|
91
70
|
let str;
|
|
92
71
|
if (name2 !== void 0) {
|
|
93
72
|
let dict = values[0];
|
|
94
|
-
if (typeof dict !== "object" || dict === null)
|
|
95
|
-
|
|
96
|
-
if (!(name2 in dict))
|
|
97
|
-
throw new TypeError(`no such key: '${name2}'`);
|
|
73
|
+
if (typeof dict !== "object" || dict === null) throw new TypeError("format requires a mapping");
|
|
74
|
+
if (!(name2 in dict)) throw new TypeError(`no such key: '${name2}'`);
|
|
98
75
|
str = dict[name2];
|
|
99
76
|
} else {
|
|
100
|
-
if (values.length === 0)
|
|
101
|
-
throw new TypeError("not enough arguments for format string");
|
|
77
|
+
if (values.length === 0) throw new TypeError("not enough arguments for format string");
|
|
102
78
|
str = values.shift();
|
|
103
79
|
}
|
|
104
80
|
switch (format) {
|
|
@@ -413,28 +389,23 @@ var require_argparse = __commonJS({
|
|
|
413
389
|
object[name2] = value;
|
|
414
390
|
}
|
|
415
391
|
function setdefault(object, name2, value) {
|
|
416
|
-
if (!hasattr(object, name2))
|
|
417
|
-
object[name2] = value;
|
|
392
|
+
if (!hasattr(object, name2)) object[name2] = value;
|
|
418
393
|
return object[name2];
|
|
419
394
|
}
|
|
420
395
|
function delattr(object, name2) {
|
|
421
396
|
delete object[name2];
|
|
422
397
|
}
|
|
423
398
|
function range(from, to, step = 1) {
|
|
424
|
-
if (arguments.length === 1)
|
|
425
|
-
[to, from] = [from, 0];
|
|
399
|
+
if (arguments.length === 1) [to, from] = [from, 0];
|
|
426
400
|
if (typeof from !== "number" || typeof to !== "number" || typeof step !== "number") {
|
|
427
401
|
throw new TypeError("argument cannot be interpreted as an integer");
|
|
428
402
|
}
|
|
429
|
-
if (step === 0)
|
|
430
|
-
throw new TypeError("range() arg 3 must not be zero");
|
|
403
|
+
if (step === 0) throw new TypeError("range() arg 3 must not be zero");
|
|
431
404
|
let result = [];
|
|
432
405
|
if (step > 0) {
|
|
433
|
-
for (let i = from; i < to; i += step)
|
|
434
|
-
result.push(i);
|
|
406
|
+
for (let i = from; i < to; i += step) result.push(i);
|
|
435
407
|
} else {
|
|
436
|
-
for (let i = from; i > to; i += step)
|
|
437
|
-
result.push(i);
|
|
408
|
+
for (let i = from; i > to; i += step) result.push(i);
|
|
438
409
|
}
|
|
439
410
|
return result;
|
|
440
411
|
}
|
|
@@ -449,14 +420,12 @@ var require_argparse = __commonJS({
|
|
|
449
420
|
result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : ""));
|
|
450
421
|
}
|
|
451
422
|
}
|
|
452
|
-
if (!result[result.length - 1])
|
|
453
|
-
result.pop();
|
|
423
|
+
if (!result[result.length - 1]) result.pop();
|
|
454
424
|
return result;
|
|
455
425
|
}
|
|
456
426
|
function _string_lstrip(string, prefix_chars) {
|
|
457
427
|
let idx = 0;
|
|
458
|
-
while (idx < string.length && prefix_chars.includes(string[idx]))
|
|
459
|
-
idx++;
|
|
428
|
+
while (idx < string.length && prefix_chars.includes(string[idx])) idx++;
|
|
460
429
|
return idx ? string.slice(idx) : string;
|
|
461
430
|
}
|
|
462
431
|
function _string_split(string, sep, maxsplit) {
|
|
@@ -467,18 +436,15 @@ var require_argparse = __commonJS({
|
|
|
467
436
|
return result;
|
|
468
437
|
}
|
|
469
438
|
function _array_equal(array1, array2) {
|
|
470
|
-
if (array1.length !== array2.length)
|
|
471
|
-
return false;
|
|
439
|
+
if (array1.length !== array2.length) return false;
|
|
472
440
|
for (let i = 0; i < array1.length; i++) {
|
|
473
|
-
if (array1[i] !== array2[i])
|
|
474
|
-
return false;
|
|
441
|
+
if (array1[i] !== array2[i]) return false;
|
|
475
442
|
}
|
|
476
443
|
return true;
|
|
477
444
|
}
|
|
478
445
|
function _array_remove(array, item) {
|
|
479
446
|
let idx = array.indexOf(item);
|
|
480
|
-
if (idx === -1)
|
|
481
|
-
throw new TypeError(sub("%r not in list", item));
|
|
447
|
+
if (idx === -1) throw new TypeError(sub("%r not in list", item));
|
|
482
448
|
array.splice(idx, 1);
|
|
483
449
|
}
|
|
484
450
|
function _choices_to_array(choices) {
|
|
@@ -525,24 +491,19 @@ var require_argparse = __commonJS({
|
|
|
525
491
|
function _camelcase_alias(_class) {
|
|
526
492
|
for (let name2 of Object.getOwnPropertyNames(_class.prototype)) {
|
|
527
493
|
let camelcase = name2.replace(/\w_[a-z]/g, (s) => s[0] + s[2].toUpperCase());
|
|
528
|
-
if (camelcase !== name2)
|
|
529
|
-
_alias(_class.prototype, camelcase, name2);
|
|
494
|
+
if (camelcase !== name2) _alias(_class.prototype, camelcase, name2);
|
|
530
495
|
}
|
|
531
496
|
return _class;
|
|
532
497
|
}
|
|
533
498
|
function _to_legacy_name(key) {
|
|
534
499
|
key = key.replace(/\w_[a-z]/g, (s) => s[0] + s[2].toUpperCase());
|
|
535
|
-
if (key === "default")
|
|
536
|
-
|
|
537
|
-
if (key === "const")
|
|
538
|
-
key = "constant";
|
|
500
|
+
if (key === "default") key = "defaultValue";
|
|
501
|
+
if (key === "const") key = "constant";
|
|
539
502
|
return key;
|
|
540
503
|
}
|
|
541
504
|
function _to_new_name(key) {
|
|
542
|
-
if (key === "defaultValue")
|
|
543
|
-
|
|
544
|
-
if (key === "constant")
|
|
545
|
-
key = "const";
|
|
505
|
+
if (key === "defaultValue") key = "default";
|
|
506
|
+
if (key === "constant") key = "const";
|
|
546
507
|
key = key.replace(/[A-Z]/g, (c) => "_" + c.toLowerCase());
|
|
547
508
|
return key;
|
|
548
509
|
}
|
|
@@ -550,10 +511,8 @@ var require_argparse = __commonJS({
|
|
|
550
511
|
function _parse_opts(args, descriptor) {
|
|
551
512
|
function get_name() {
|
|
552
513
|
let stack = new Error().stack.split("\n").map((x) => x.match(/^ at (.*) \(.*\)$/)).filter(Boolean).map((m) => m[1]).map((fn) => fn.match(/[^ .]*$/)[0]);
|
|
553
|
-
if (stack.length && stack[0] === get_name.name)
|
|
554
|
-
|
|
555
|
-
if (stack.length && stack[0] === _parse_opts.name)
|
|
556
|
-
stack.shift();
|
|
514
|
+
if (stack.length && stack[0] === get_name.name) stack.shift();
|
|
515
|
+
if (stack.length && stack[0] === _parse_opts.name) stack.shift();
|
|
557
516
|
return stack.length ? stack[0] : "";
|
|
558
517
|
}
|
|
559
518
|
args = Array.from(args);
|
|
@@ -648,8 +607,7 @@ var require_argparse = __commonJS({
|
|
|
648
607
|
}
|
|
649
608
|
if (missing_positionals.length) {
|
|
650
609
|
let strs = missing_positionals.map(repr);
|
|
651
|
-
if (strs.length > 1)
|
|
652
|
-
strs[strs.length - 1] = "and " + strs[strs.length - 1];
|
|
610
|
+
if (strs.length > 1) strs[strs.length - 1] = "and " + strs[strs.length - 1];
|
|
653
611
|
let str_joined = strs.join(strs.length === 2 ? "" : ", ");
|
|
654
612
|
throw new TypeError(sub(
|
|
655
613
|
"%s() missing %i required positional argument%s: %s",
|
|
@@ -1924,22 +1882,14 @@ var require_argparse = __commonJS({
|
|
|
1924
1882
|
});
|
|
1925
1883
|
this._flags = flags;
|
|
1926
1884
|
this._options = {};
|
|
1927
|
-
if (encoding !== void 0)
|
|
1928
|
-
|
|
1929
|
-
if (
|
|
1930
|
-
|
|
1931
|
-
if (
|
|
1932
|
-
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1935
|
-
if (start !== void 0)
|
|
1936
|
-
this._options.start = start;
|
|
1937
|
-
if (end !== void 0)
|
|
1938
|
-
this._options.end = end;
|
|
1939
|
-
if (highWaterMark !== void 0)
|
|
1940
|
-
this._options.highWaterMark = highWaterMark;
|
|
1941
|
-
if (fs14 !== void 0)
|
|
1942
|
-
this._options.fs = fs14;
|
|
1885
|
+
if (encoding !== void 0) this._options.encoding = encoding;
|
|
1886
|
+
if (mode !== void 0) this._options.mode = mode;
|
|
1887
|
+
if (autoClose !== void 0) this._options.autoClose = autoClose;
|
|
1888
|
+
if (emitClose !== void 0) this._options.emitClose = emitClose;
|
|
1889
|
+
if (start !== void 0) this._options.start = start;
|
|
1890
|
+
if (end !== void 0) this._options.end = end;
|
|
1891
|
+
if (highWaterMark !== void 0) this._options.highWaterMark = highWaterMark;
|
|
1892
|
+
if (fs14 !== void 0) this._options.fs = fs14;
|
|
1943
1893
|
}
|
|
1944
1894
|
call(string) {
|
|
1945
1895
|
if (string === "-") {
|
|
@@ -1973,10 +1923,9 @@ var require_argparse = __commonJS({
|
|
|
1973
1923
|
[util.inspect.custom]() {
|
|
1974
1924
|
let args = [this._flags];
|
|
1975
1925
|
let kwargs = Object.entries(this._options).map(([k, v]) => {
|
|
1976
|
-
if (k === "mode")
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
} };
|
|
1926
|
+
if (k === "mode") v = { value: v, [util.inspect.custom]() {
|
|
1927
|
+
return "0o" + this.value.toString(8);
|
|
1928
|
+
} };
|
|
1980
1929
|
return [k, v];
|
|
1981
1930
|
});
|
|
1982
1931
|
let args_str = [].concat(args.filter((arg) => arg !== -1).map(repr)).concat(kwargs.filter(([, arg]) => arg !== void 0).map(([kw, arg]) => sub("%s=%r", kw, arg))).join(", ");
|
|
@@ -3194,19 +3143,16 @@ var require_argparse = __commonJS({
|
|
|
3194
3143
|
// Help-printing methods
|
|
3195
3144
|
// =====================
|
|
3196
3145
|
print_usage(file = void 0) {
|
|
3197
|
-
if (file === void 0)
|
|
3198
|
-
file = process.stdout;
|
|
3146
|
+
if (file === void 0) file = process.stdout;
|
|
3199
3147
|
this._print_message(this.format_usage(), file);
|
|
3200
3148
|
}
|
|
3201
3149
|
print_help(file = void 0) {
|
|
3202
|
-
if (file === void 0)
|
|
3203
|
-
file = process.stdout;
|
|
3150
|
+
if (file === void 0) file = process.stdout;
|
|
3204
3151
|
this._print_message(this.format_help(), file);
|
|
3205
3152
|
}
|
|
3206
3153
|
_print_message(message, file = void 0) {
|
|
3207
3154
|
if (message) {
|
|
3208
|
-
if (file === void 0)
|
|
3209
|
-
file = process.stderr;
|
|
3155
|
+
if (file === void 0) file = process.stderr;
|
|
3210
3156
|
file.write(message);
|
|
3211
3157
|
}
|
|
3212
3158
|
}
|
|
@@ -3220,8 +3166,7 @@ var require_argparse = __commonJS({
|
|
|
3220
3166
|
process.exit(status);
|
|
3221
3167
|
}
|
|
3222
3168
|
error(message) {
|
|
3223
|
-
if (this.debug === true)
|
|
3224
|
-
throw new Error(message);
|
|
3169
|
+
if (this.debug === true) throw new Error(message);
|
|
3225
3170
|
this.print_usage(process.stderr);
|
|
3226
3171
|
let args = { prog: this.prog, message };
|
|
3227
3172
|
this.exit(2, sub("%(prog)s: error: %(message)s\n", args));
|
|
@@ -3313,8 +3258,7 @@ var require_tmp = __commonJS({
|
|
|
3313
3258
|
const name2 = _generateTmpName(opts);
|
|
3314
3259
|
fs13.stat(name2, function(err) {
|
|
3315
3260
|
if (!err) {
|
|
3316
|
-
if (tries-- > 0)
|
|
3317
|
-
return _getUniqueName();
|
|
3261
|
+
if (tries-- > 0) return _getUniqueName();
|
|
3318
3262
|
return cb(new Error("Could not get a unique tmp filename, max tries reached " + name2));
|
|
3319
3263
|
}
|
|
3320
3264
|
cb(null, name2);
|
|
@@ -3341,11 +3285,9 @@ var require_tmp = __commonJS({
|
|
|
3341
3285
|
function file(options, callback) {
|
|
3342
3286
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
3343
3287
|
tmpName(opts, function _tmpNameCreated(err, name2) {
|
|
3344
|
-
if (err)
|
|
3345
|
-
return cb(err);
|
|
3288
|
+
if (err) return cb(err);
|
|
3346
3289
|
fs13.open(name2, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
3347
|
-
if (err2)
|
|
3348
|
-
return cb(err2);
|
|
3290
|
+
if (err2) return cb(err2);
|
|
3349
3291
|
if (opts.discardDescriptor) {
|
|
3350
3292
|
return fs13.close(fd, function _discardCallback(possibleErr) {
|
|
3351
3293
|
return cb(possibleErr, name2, void 0, _prepareTmpFileRemoveCallback(name2, -1, opts, false));
|
|
@@ -3375,11 +3317,9 @@ var require_tmp = __commonJS({
|
|
|
3375
3317
|
function dir(options, callback) {
|
|
3376
3318
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
3377
3319
|
tmpName(opts, function _tmpNameCreated(err, name2) {
|
|
3378
|
-
if (err)
|
|
3379
|
-
return cb(err);
|
|
3320
|
+
if (err) return cb(err);
|
|
3380
3321
|
fs13.mkdir(name2, opts.mode || DIR_MODE, function _dirCreated(err2) {
|
|
3381
|
-
if (err2)
|
|
3382
|
-
return cb(err2);
|
|
3322
|
+
if (err2) return cb(err2);
|
|
3383
3323
|
cb(null, name2, _prepareTmpDirRemoveCallback(name2, opts, false));
|
|
3384
3324
|
});
|
|
3385
3325
|
});
|
|
@@ -3404,23 +3344,19 @@ var require_tmp = __commonJS({
|
|
|
3404
3344
|
fs13.close(fdPath[0], function() {
|
|
3405
3345
|
fs13.unlink(fdPath[1], _handler);
|
|
3406
3346
|
});
|
|
3407
|
-
else
|
|
3408
|
-
fs13.unlink(fdPath[1], _handler);
|
|
3347
|
+
else fs13.unlink(fdPath[1], _handler);
|
|
3409
3348
|
}
|
|
3410
3349
|
function _removeFileSync(fdPath) {
|
|
3411
3350
|
let rethrownException = null;
|
|
3412
3351
|
try {
|
|
3413
|
-
if (0 <= fdPath[0])
|
|
3414
|
-
fs13.closeSync(fdPath[0]);
|
|
3352
|
+
if (0 <= fdPath[0]) fs13.closeSync(fdPath[0]);
|
|
3415
3353
|
} catch (e) {
|
|
3416
|
-
if (!_isEBADF(e) && !_isENOENT(e))
|
|
3417
|
-
throw e;
|
|
3354
|
+
if (!_isEBADF(e) && !_isENOENT(e)) throw e;
|
|
3418
3355
|
} finally {
|
|
3419
3356
|
try {
|
|
3420
3357
|
fs13.unlinkSync(fdPath[1]);
|
|
3421
3358
|
} catch (e) {
|
|
3422
|
-
if (!_isENOENT(e))
|
|
3423
|
-
rethrownException = e;
|
|
3359
|
+
if (!_isENOENT(e)) rethrownException = e;
|
|
3424
3360
|
}
|
|
3425
3361
|
}
|
|
3426
3362
|
if (rethrownException !== null) {
|
|
@@ -3430,8 +3366,7 @@ var require_tmp = __commonJS({
|
|
|
3430
3366
|
function _prepareTmpFileRemoveCallback(name2, fd, opts, sync) {
|
|
3431
3367
|
const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name2], sync);
|
|
3432
3368
|
const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name2], sync, removeCallbackSync);
|
|
3433
|
-
if (!opts.keep)
|
|
3434
|
-
_removeObjects.unshift(removeCallbackSync);
|
|
3369
|
+
if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
|
|
3435
3370
|
return sync ? removeCallbackSync : removeCallback;
|
|
3436
3371
|
}
|
|
3437
3372
|
function _prepareTmpDirRemoveCallback(name2, opts, sync) {
|
|
@@ -3439,8 +3374,7 @@ var require_tmp = __commonJS({
|
|
|
3439
3374
|
const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
|
|
3440
3375
|
const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name2, sync);
|
|
3441
3376
|
const removeCallback = _prepareRemoveCallback(removeFunction, name2, sync, removeCallbackSync);
|
|
3442
|
-
if (!opts.keep)
|
|
3443
|
-
_removeObjects.unshift(removeCallbackSync);
|
|
3377
|
+
if (!opts.keep) _removeObjects.unshift(removeCallbackSync);
|
|
3444
3378
|
return sync ? removeCallbackSync : removeCallback;
|
|
3445
3379
|
}
|
|
3446
3380
|
function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
|
|
@@ -3449,8 +3383,7 @@ var require_tmp = __commonJS({
|
|
|
3449
3383
|
if (!called) {
|
|
3450
3384
|
const toRemove = cleanupCallbackSync || _cleanupCallback;
|
|
3451
3385
|
const index = _removeObjects.indexOf(toRemove);
|
|
3452
|
-
if (index >= 0)
|
|
3453
|
-
_removeObjects.splice(index, 1);
|
|
3386
|
+
if (index >= 0) _removeObjects.splice(index, 1);
|
|
3454
3387
|
called = true;
|
|
3455
3388
|
if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
|
|
3456
3389
|
return removeFunction(fileOrDirName);
|
|
@@ -3462,8 +3395,7 @@ var require_tmp = __commonJS({
|
|
|
3462
3395
|
};
|
|
3463
3396
|
}
|
|
3464
3397
|
function _garbageCollector() {
|
|
3465
|
-
if (!_gracefulCleanup)
|
|
3466
|
-
return;
|
|
3398
|
+
if (!_gracefulCleanup) return;
|
|
3467
3399
|
while (_removeObjects.length) {
|
|
3468
3400
|
try {
|
|
3469
3401
|
_removeObjects[0]();
|
|
@@ -3892,7 +3824,7 @@ var require_semver = __commonJS({
|
|
|
3892
3824
|
do {
|
|
3893
3825
|
const a = this.build[i];
|
|
3894
3826
|
const b = other.build[i];
|
|
3895
|
-
debug("
|
|
3827
|
+
debug("build compare", i, a, b);
|
|
3896
3828
|
if (a === void 0 && b === void 0) {
|
|
3897
3829
|
return 0;
|
|
3898
3830
|
} else if (b === void 0) {
|
|
@@ -4363,655 +4295,39 @@ var require_coerce = __commonJS({
|
|
|
4363
4295
|
}
|
|
4364
4296
|
});
|
|
4365
4297
|
|
|
4366
|
-
// node_modules/
|
|
4367
|
-
var
|
|
4368
|
-
"node_modules/
|
|
4369
|
-
"use strict";
|
|
4370
|
-
module.exports = function(Yallist2) {
|
|
4371
|
-
Yallist2.prototype[Symbol.iterator] = function* () {
|
|
4372
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
|
4373
|
-
yield walker.value;
|
|
4374
|
-
}
|
|
4375
|
-
};
|
|
4376
|
-
};
|
|
4377
|
-
}
|
|
4378
|
-
});
|
|
4379
|
-
|
|
4380
|
-
// node_modules/yallist/yallist.js
|
|
4381
|
-
var require_yallist = __commonJS({
|
|
4382
|
-
"node_modules/yallist/yallist.js"(exports, module) {
|
|
4383
|
-
"use strict";
|
|
4384
|
-
module.exports = Yallist2;
|
|
4385
|
-
Yallist2.Node = Node3;
|
|
4386
|
-
Yallist2.create = Yallist2;
|
|
4387
|
-
function Yallist2(list2) {
|
|
4388
|
-
var self = this;
|
|
4389
|
-
if (!(self instanceof Yallist2)) {
|
|
4390
|
-
self = new Yallist2();
|
|
4391
|
-
}
|
|
4392
|
-
self.tail = null;
|
|
4393
|
-
self.head = null;
|
|
4394
|
-
self.length = 0;
|
|
4395
|
-
if (list2 && typeof list2.forEach === "function") {
|
|
4396
|
-
list2.forEach(function(item) {
|
|
4397
|
-
self.push(item);
|
|
4398
|
-
});
|
|
4399
|
-
} else if (arguments.length > 0) {
|
|
4400
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
4401
|
-
self.push(arguments[i]);
|
|
4402
|
-
}
|
|
4403
|
-
}
|
|
4404
|
-
return self;
|
|
4405
|
-
}
|
|
4406
|
-
Yallist2.prototype.removeNode = function(node) {
|
|
4407
|
-
if (node.list !== this) {
|
|
4408
|
-
throw new Error("removing node which does not belong to this list");
|
|
4409
|
-
}
|
|
4410
|
-
var next = node.next;
|
|
4411
|
-
var prev = node.prev;
|
|
4412
|
-
if (next) {
|
|
4413
|
-
next.prev = prev;
|
|
4414
|
-
}
|
|
4415
|
-
if (prev) {
|
|
4416
|
-
prev.next = next;
|
|
4417
|
-
}
|
|
4418
|
-
if (node === this.head) {
|
|
4419
|
-
this.head = next;
|
|
4420
|
-
}
|
|
4421
|
-
if (node === this.tail) {
|
|
4422
|
-
this.tail = prev;
|
|
4423
|
-
}
|
|
4424
|
-
node.list.length--;
|
|
4425
|
-
node.next = null;
|
|
4426
|
-
node.prev = null;
|
|
4427
|
-
node.list = null;
|
|
4428
|
-
return next;
|
|
4429
|
-
};
|
|
4430
|
-
Yallist2.prototype.unshiftNode = function(node) {
|
|
4431
|
-
if (node === this.head) {
|
|
4432
|
-
return;
|
|
4433
|
-
}
|
|
4434
|
-
if (node.list) {
|
|
4435
|
-
node.list.removeNode(node);
|
|
4436
|
-
}
|
|
4437
|
-
var head = this.head;
|
|
4438
|
-
node.list = this;
|
|
4439
|
-
node.next = head;
|
|
4440
|
-
if (head) {
|
|
4441
|
-
head.prev = node;
|
|
4442
|
-
}
|
|
4443
|
-
this.head = node;
|
|
4444
|
-
if (!this.tail) {
|
|
4445
|
-
this.tail = node;
|
|
4446
|
-
}
|
|
4447
|
-
this.length++;
|
|
4448
|
-
};
|
|
4449
|
-
Yallist2.prototype.pushNode = function(node) {
|
|
4450
|
-
if (node === this.tail) {
|
|
4451
|
-
return;
|
|
4452
|
-
}
|
|
4453
|
-
if (node.list) {
|
|
4454
|
-
node.list.removeNode(node);
|
|
4455
|
-
}
|
|
4456
|
-
var tail = this.tail;
|
|
4457
|
-
node.list = this;
|
|
4458
|
-
node.prev = tail;
|
|
4459
|
-
if (tail) {
|
|
4460
|
-
tail.next = node;
|
|
4461
|
-
}
|
|
4462
|
-
this.tail = node;
|
|
4463
|
-
if (!this.head) {
|
|
4464
|
-
this.head = node;
|
|
4465
|
-
}
|
|
4466
|
-
this.length++;
|
|
4467
|
-
};
|
|
4468
|
-
Yallist2.prototype.push = function() {
|
|
4469
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
4470
|
-
push2(this, arguments[i]);
|
|
4471
|
-
}
|
|
4472
|
-
return this.length;
|
|
4473
|
-
};
|
|
4474
|
-
Yallist2.prototype.unshift = function() {
|
|
4475
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
4476
|
-
unshift2(this, arguments[i]);
|
|
4477
|
-
}
|
|
4478
|
-
return this.length;
|
|
4479
|
-
};
|
|
4480
|
-
Yallist2.prototype.pop = function() {
|
|
4481
|
-
if (!this.tail) {
|
|
4482
|
-
return void 0;
|
|
4483
|
-
}
|
|
4484
|
-
var res = this.tail.value;
|
|
4485
|
-
this.tail = this.tail.prev;
|
|
4486
|
-
if (this.tail) {
|
|
4487
|
-
this.tail.next = null;
|
|
4488
|
-
} else {
|
|
4489
|
-
this.head = null;
|
|
4490
|
-
}
|
|
4491
|
-
this.length--;
|
|
4492
|
-
return res;
|
|
4493
|
-
};
|
|
4494
|
-
Yallist2.prototype.shift = function() {
|
|
4495
|
-
if (!this.head) {
|
|
4496
|
-
return void 0;
|
|
4497
|
-
}
|
|
4498
|
-
var res = this.head.value;
|
|
4499
|
-
this.head = this.head.next;
|
|
4500
|
-
if (this.head) {
|
|
4501
|
-
this.head.prev = null;
|
|
4502
|
-
} else {
|
|
4503
|
-
this.tail = null;
|
|
4504
|
-
}
|
|
4505
|
-
this.length--;
|
|
4506
|
-
return res;
|
|
4507
|
-
};
|
|
4508
|
-
Yallist2.prototype.forEach = function(fn, thisp) {
|
|
4509
|
-
thisp = thisp || this;
|
|
4510
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
4511
|
-
fn.call(thisp, walker.value, i, this);
|
|
4512
|
-
walker = walker.next;
|
|
4513
|
-
}
|
|
4514
|
-
};
|
|
4515
|
-
Yallist2.prototype.forEachReverse = function(fn, thisp) {
|
|
4516
|
-
thisp = thisp || this;
|
|
4517
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
4518
|
-
fn.call(thisp, walker.value, i, this);
|
|
4519
|
-
walker = walker.prev;
|
|
4520
|
-
}
|
|
4521
|
-
};
|
|
4522
|
-
Yallist2.prototype.get = function(n) {
|
|
4523
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
4524
|
-
walker = walker.next;
|
|
4525
|
-
}
|
|
4526
|
-
if (i === n && walker !== null) {
|
|
4527
|
-
return walker.value;
|
|
4528
|
-
}
|
|
4529
|
-
};
|
|
4530
|
-
Yallist2.prototype.getReverse = function(n) {
|
|
4531
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
4532
|
-
walker = walker.prev;
|
|
4533
|
-
}
|
|
4534
|
-
if (i === n && walker !== null) {
|
|
4535
|
-
return walker.value;
|
|
4536
|
-
}
|
|
4537
|
-
};
|
|
4538
|
-
Yallist2.prototype.map = function(fn, thisp) {
|
|
4539
|
-
thisp = thisp || this;
|
|
4540
|
-
var res = new Yallist2();
|
|
4541
|
-
for (var walker = this.head; walker !== null; ) {
|
|
4542
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
4543
|
-
walker = walker.next;
|
|
4544
|
-
}
|
|
4545
|
-
return res;
|
|
4546
|
-
};
|
|
4547
|
-
Yallist2.prototype.mapReverse = function(fn, thisp) {
|
|
4548
|
-
thisp = thisp || this;
|
|
4549
|
-
var res = new Yallist2();
|
|
4550
|
-
for (var walker = this.tail; walker !== null; ) {
|
|
4551
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
4552
|
-
walker = walker.prev;
|
|
4553
|
-
}
|
|
4554
|
-
return res;
|
|
4555
|
-
};
|
|
4556
|
-
Yallist2.prototype.reduce = function(fn, initial) {
|
|
4557
|
-
var acc;
|
|
4558
|
-
var walker = this.head;
|
|
4559
|
-
if (arguments.length > 1) {
|
|
4560
|
-
acc = initial;
|
|
4561
|
-
} else if (this.head) {
|
|
4562
|
-
walker = this.head.next;
|
|
4563
|
-
acc = this.head.value;
|
|
4564
|
-
} else {
|
|
4565
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
4566
|
-
}
|
|
4567
|
-
for (var i = 0; walker !== null; i++) {
|
|
4568
|
-
acc = fn(acc, walker.value, i);
|
|
4569
|
-
walker = walker.next;
|
|
4570
|
-
}
|
|
4571
|
-
return acc;
|
|
4572
|
-
};
|
|
4573
|
-
Yallist2.prototype.reduceReverse = function(fn, initial) {
|
|
4574
|
-
var acc;
|
|
4575
|
-
var walker = this.tail;
|
|
4576
|
-
if (arguments.length > 1) {
|
|
4577
|
-
acc = initial;
|
|
4578
|
-
} else if (this.tail) {
|
|
4579
|
-
walker = this.tail.prev;
|
|
4580
|
-
acc = this.tail.value;
|
|
4581
|
-
} else {
|
|
4582
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
4583
|
-
}
|
|
4584
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
|
4585
|
-
acc = fn(acc, walker.value, i);
|
|
4586
|
-
walker = walker.prev;
|
|
4587
|
-
}
|
|
4588
|
-
return acc;
|
|
4589
|
-
};
|
|
4590
|
-
Yallist2.prototype.toArray = function() {
|
|
4591
|
-
var arr = new Array(this.length);
|
|
4592
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
4593
|
-
arr[i] = walker.value;
|
|
4594
|
-
walker = walker.next;
|
|
4595
|
-
}
|
|
4596
|
-
return arr;
|
|
4597
|
-
};
|
|
4598
|
-
Yallist2.prototype.toArrayReverse = function() {
|
|
4599
|
-
var arr = new Array(this.length);
|
|
4600
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
4601
|
-
arr[i] = walker.value;
|
|
4602
|
-
walker = walker.prev;
|
|
4603
|
-
}
|
|
4604
|
-
return arr;
|
|
4605
|
-
};
|
|
4606
|
-
Yallist2.prototype.slice = function(from, to) {
|
|
4607
|
-
to = to || this.length;
|
|
4608
|
-
if (to < 0) {
|
|
4609
|
-
to += this.length;
|
|
4610
|
-
}
|
|
4611
|
-
from = from || 0;
|
|
4612
|
-
if (from < 0) {
|
|
4613
|
-
from += this.length;
|
|
4614
|
-
}
|
|
4615
|
-
var ret = new Yallist2();
|
|
4616
|
-
if (to < from || to < 0) {
|
|
4617
|
-
return ret;
|
|
4618
|
-
}
|
|
4619
|
-
if (from < 0) {
|
|
4620
|
-
from = 0;
|
|
4621
|
-
}
|
|
4622
|
-
if (to > this.length) {
|
|
4623
|
-
to = this.length;
|
|
4624
|
-
}
|
|
4625
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
4626
|
-
walker = walker.next;
|
|
4627
|
-
}
|
|
4628
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
4629
|
-
ret.push(walker.value);
|
|
4630
|
-
}
|
|
4631
|
-
return ret;
|
|
4632
|
-
};
|
|
4633
|
-
Yallist2.prototype.sliceReverse = function(from, to) {
|
|
4634
|
-
to = to || this.length;
|
|
4635
|
-
if (to < 0) {
|
|
4636
|
-
to += this.length;
|
|
4637
|
-
}
|
|
4638
|
-
from = from || 0;
|
|
4639
|
-
if (from < 0) {
|
|
4640
|
-
from += this.length;
|
|
4641
|
-
}
|
|
4642
|
-
var ret = new Yallist2();
|
|
4643
|
-
if (to < from || to < 0) {
|
|
4644
|
-
return ret;
|
|
4645
|
-
}
|
|
4646
|
-
if (from < 0) {
|
|
4647
|
-
from = 0;
|
|
4648
|
-
}
|
|
4649
|
-
if (to > this.length) {
|
|
4650
|
-
to = this.length;
|
|
4651
|
-
}
|
|
4652
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
4653
|
-
walker = walker.prev;
|
|
4654
|
-
}
|
|
4655
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
4656
|
-
ret.push(walker.value);
|
|
4657
|
-
}
|
|
4658
|
-
return ret;
|
|
4659
|
-
};
|
|
4660
|
-
Yallist2.prototype.splice = function(start, deleteCount, ...nodes) {
|
|
4661
|
-
if (start > this.length) {
|
|
4662
|
-
start = this.length - 1;
|
|
4663
|
-
}
|
|
4664
|
-
if (start < 0) {
|
|
4665
|
-
start = this.length + start;
|
|
4666
|
-
}
|
|
4667
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
4668
|
-
walker = walker.next;
|
|
4669
|
-
}
|
|
4670
|
-
var ret = [];
|
|
4671
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
|
4672
|
-
ret.push(walker.value);
|
|
4673
|
-
walker = this.removeNode(walker);
|
|
4674
|
-
}
|
|
4675
|
-
if (walker === null) {
|
|
4676
|
-
walker = this.tail;
|
|
4677
|
-
}
|
|
4678
|
-
if (walker !== this.head && walker !== this.tail) {
|
|
4679
|
-
walker = walker.prev;
|
|
4680
|
-
}
|
|
4681
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
4682
|
-
walker = insert(this, walker, nodes[i]);
|
|
4683
|
-
}
|
|
4684
|
-
return ret;
|
|
4685
|
-
};
|
|
4686
|
-
Yallist2.prototype.reverse = function() {
|
|
4687
|
-
var head = this.head;
|
|
4688
|
-
var tail = this.tail;
|
|
4689
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
4690
|
-
var p = walker.prev;
|
|
4691
|
-
walker.prev = walker.next;
|
|
4692
|
-
walker.next = p;
|
|
4693
|
-
}
|
|
4694
|
-
this.head = tail;
|
|
4695
|
-
this.tail = head;
|
|
4696
|
-
return this;
|
|
4697
|
-
};
|
|
4698
|
-
function insert(self, node, value) {
|
|
4699
|
-
var inserted = node === self.head ? new Node3(value, null, node, self) : new Node3(value, node, node.next, self);
|
|
4700
|
-
if (inserted.next === null) {
|
|
4701
|
-
self.tail = inserted;
|
|
4702
|
-
}
|
|
4703
|
-
if (inserted.prev === null) {
|
|
4704
|
-
self.head = inserted;
|
|
4705
|
-
}
|
|
4706
|
-
self.length++;
|
|
4707
|
-
return inserted;
|
|
4708
|
-
}
|
|
4709
|
-
function push2(self, item) {
|
|
4710
|
-
self.tail = new Node3(item, self.tail, null, self);
|
|
4711
|
-
if (!self.head) {
|
|
4712
|
-
self.head = self.tail;
|
|
4713
|
-
}
|
|
4714
|
-
self.length++;
|
|
4715
|
-
}
|
|
4716
|
-
function unshift2(self, item) {
|
|
4717
|
-
self.head = new Node3(item, null, self.head, self);
|
|
4718
|
-
if (!self.tail) {
|
|
4719
|
-
self.tail = self.head;
|
|
4720
|
-
}
|
|
4721
|
-
self.length++;
|
|
4722
|
-
}
|
|
4723
|
-
function Node3(value, prev, next, list2) {
|
|
4724
|
-
if (!(this instanceof Node3)) {
|
|
4725
|
-
return new Node3(value, prev, next, list2);
|
|
4726
|
-
}
|
|
4727
|
-
this.list = list2;
|
|
4728
|
-
this.value = value;
|
|
4729
|
-
if (prev) {
|
|
4730
|
-
prev.next = this;
|
|
4731
|
-
this.prev = prev;
|
|
4732
|
-
} else {
|
|
4733
|
-
this.prev = null;
|
|
4734
|
-
}
|
|
4735
|
-
if (next) {
|
|
4736
|
-
next.prev = this;
|
|
4737
|
-
this.next = next;
|
|
4738
|
-
} else {
|
|
4739
|
-
this.next = null;
|
|
4740
|
-
}
|
|
4741
|
-
}
|
|
4742
|
-
try {
|
|
4743
|
-
require_iterator()(Yallist2);
|
|
4744
|
-
} catch (er) {
|
|
4745
|
-
}
|
|
4746
|
-
}
|
|
4747
|
-
});
|
|
4748
|
-
|
|
4749
|
-
// node_modules/lru-cache/index.js
|
|
4750
|
-
var require_lru_cache = __commonJS({
|
|
4751
|
-
"node_modules/lru-cache/index.js"(exports, module) {
|
|
4752
|
-
"use strict";
|
|
4753
|
-
var Yallist2 = require_yallist();
|
|
4754
|
-
var MAX = Symbol("max");
|
|
4755
|
-
var LENGTH = Symbol("length");
|
|
4756
|
-
var LENGTH_CALCULATOR = Symbol("lengthCalculator");
|
|
4757
|
-
var ALLOW_STALE = Symbol("allowStale");
|
|
4758
|
-
var MAX_AGE = Symbol("maxAge");
|
|
4759
|
-
var DISPOSE = Symbol("dispose");
|
|
4760
|
-
var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
|
|
4761
|
-
var LRU_LIST = Symbol("lruList");
|
|
4762
|
-
var CACHE = Symbol("cache");
|
|
4763
|
-
var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
|
|
4764
|
-
var naiveLength = () => 1;
|
|
4298
|
+
// node_modules/semver/internal/lrucache.js
|
|
4299
|
+
var require_lrucache = __commonJS({
|
|
4300
|
+
"node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
4765
4301
|
var LRUCache = class {
|
|
4766
|
-
constructor(
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
if (!options)
|
|
4770
|
-
options = {};
|
|
4771
|
-
if (options.max && (typeof options.max !== "number" || options.max < 0))
|
|
4772
|
-
throw new TypeError("max must be a non-negative number");
|
|
4773
|
-
const max = this[MAX] = options.max || Infinity;
|
|
4774
|
-
const lc = options.length || naiveLength;
|
|
4775
|
-
this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
|
|
4776
|
-
this[ALLOW_STALE] = options.stale || false;
|
|
4777
|
-
if (options.maxAge && typeof options.maxAge !== "number")
|
|
4778
|
-
throw new TypeError("maxAge must be a number");
|
|
4779
|
-
this[MAX_AGE] = options.maxAge || 0;
|
|
4780
|
-
this[DISPOSE] = options.dispose;
|
|
4781
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
4782
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
4783
|
-
this.reset();
|
|
4784
|
-
}
|
|
4785
|
-
// resize the cache when the max changes.
|
|
4786
|
-
set max(mL) {
|
|
4787
|
-
if (typeof mL !== "number" || mL < 0)
|
|
4788
|
-
throw new TypeError("max must be a non-negative number");
|
|
4789
|
-
this[MAX] = mL || Infinity;
|
|
4790
|
-
trim(this);
|
|
4791
|
-
}
|
|
4792
|
-
get max() {
|
|
4793
|
-
return this[MAX];
|
|
4794
|
-
}
|
|
4795
|
-
set allowStale(allowStale) {
|
|
4796
|
-
this[ALLOW_STALE] = !!allowStale;
|
|
4797
|
-
}
|
|
4798
|
-
get allowStale() {
|
|
4799
|
-
return this[ALLOW_STALE];
|
|
4800
|
-
}
|
|
4801
|
-
set maxAge(mA) {
|
|
4802
|
-
if (typeof mA !== "number")
|
|
4803
|
-
throw new TypeError("maxAge must be a non-negative number");
|
|
4804
|
-
this[MAX_AGE] = mA;
|
|
4805
|
-
trim(this);
|
|
4806
|
-
}
|
|
4807
|
-
get maxAge() {
|
|
4808
|
-
return this[MAX_AGE];
|
|
4809
|
-
}
|
|
4810
|
-
// resize the cache when the lengthCalculator changes.
|
|
4811
|
-
set lengthCalculator(lC) {
|
|
4812
|
-
if (typeof lC !== "function")
|
|
4813
|
-
lC = naiveLength;
|
|
4814
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
4815
|
-
this[LENGTH_CALCULATOR] = lC;
|
|
4816
|
-
this[LENGTH] = 0;
|
|
4817
|
-
this[LRU_LIST].forEach((hit) => {
|
|
4818
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
4819
|
-
this[LENGTH] += hit.length;
|
|
4820
|
-
});
|
|
4821
|
-
}
|
|
4822
|
-
trim(this);
|
|
4823
|
-
}
|
|
4824
|
-
get lengthCalculator() {
|
|
4825
|
-
return this[LENGTH_CALCULATOR];
|
|
4826
|
-
}
|
|
4827
|
-
get length() {
|
|
4828
|
-
return this[LENGTH];
|
|
4829
|
-
}
|
|
4830
|
-
get itemCount() {
|
|
4831
|
-
return this[LRU_LIST].length;
|
|
4832
|
-
}
|
|
4833
|
-
rforEach(fn, thisp) {
|
|
4834
|
-
thisp = thisp || this;
|
|
4835
|
-
for (let walker = this[LRU_LIST].tail; walker !== null; ) {
|
|
4836
|
-
const prev = walker.prev;
|
|
4837
|
-
forEachStep(this, fn, walker, thisp);
|
|
4838
|
-
walker = prev;
|
|
4839
|
-
}
|
|
4840
|
-
}
|
|
4841
|
-
forEach(fn, thisp) {
|
|
4842
|
-
thisp = thisp || this;
|
|
4843
|
-
for (let walker = this[LRU_LIST].head; walker !== null; ) {
|
|
4844
|
-
const next = walker.next;
|
|
4845
|
-
forEachStep(this, fn, walker, thisp);
|
|
4846
|
-
walker = next;
|
|
4847
|
-
}
|
|
4848
|
-
}
|
|
4849
|
-
keys() {
|
|
4850
|
-
return this[LRU_LIST].toArray().map((k) => k.key);
|
|
4851
|
-
}
|
|
4852
|
-
values() {
|
|
4853
|
-
return this[LRU_LIST].toArray().map((k) => k.value);
|
|
4854
|
-
}
|
|
4855
|
-
reset() {
|
|
4856
|
-
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
4857
|
-
this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
|
|
4858
|
-
}
|
|
4859
|
-
this[CACHE] = /* @__PURE__ */ new Map();
|
|
4860
|
-
this[LRU_LIST] = new Yallist2();
|
|
4861
|
-
this[LENGTH] = 0;
|
|
4862
|
-
}
|
|
4863
|
-
dump() {
|
|
4864
|
-
return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
|
|
4865
|
-
k: hit.key,
|
|
4866
|
-
v: hit.value,
|
|
4867
|
-
e: hit.now + (hit.maxAge || 0)
|
|
4868
|
-
}).toArray().filter((h) => h);
|
|
4869
|
-
}
|
|
4870
|
-
dumpLru() {
|
|
4871
|
-
return this[LRU_LIST];
|
|
4872
|
-
}
|
|
4873
|
-
set(key, value, maxAge) {
|
|
4874
|
-
maxAge = maxAge || this[MAX_AGE];
|
|
4875
|
-
if (maxAge && typeof maxAge !== "number")
|
|
4876
|
-
throw new TypeError("maxAge must be a number");
|
|
4877
|
-
const now = maxAge ? Date.now() : 0;
|
|
4878
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
|
4879
|
-
if (this[CACHE].has(key)) {
|
|
4880
|
-
if (len > this[MAX]) {
|
|
4881
|
-
del(this, this[CACHE].get(key));
|
|
4882
|
-
return false;
|
|
4883
|
-
}
|
|
4884
|
-
const node = this[CACHE].get(key);
|
|
4885
|
-
const item = node.value;
|
|
4886
|
-
if (this[DISPOSE]) {
|
|
4887
|
-
if (!this[NO_DISPOSE_ON_SET])
|
|
4888
|
-
this[DISPOSE](key, item.value);
|
|
4889
|
-
}
|
|
4890
|
-
item.now = now;
|
|
4891
|
-
item.maxAge = maxAge;
|
|
4892
|
-
item.value = value;
|
|
4893
|
-
this[LENGTH] += len - item.length;
|
|
4894
|
-
item.length = len;
|
|
4895
|
-
this.get(key);
|
|
4896
|
-
trim(this);
|
|
4897
|
-
return true;
|
|
4898
|
-
}
|
|
4899
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
|
4900
|
-
if (hit.length > this[MAX]) {
|
|
4901
|
-
if (this[DISPOSE])
|
|
4902
|
-
this[DISPOSE](key, value);
|
|
4903
|
-
return false;
|
|
4904
|
-
}
|
|
4905
|
-
this[LENGTH] += hit.length;
|
|
4906
|
-
this[LRU_LIST].unshift(hit);
|
|
4907
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
|
4908
|
-
trim(this);
|
|
4909
|
-
return true;
|
|
4910
|
-
}
|
|
4911
|
-
has(key) {
|
|
4912
|
-
if (!this[CACHE].has(key))
|
|
4913
|
-
return false;
|
|
4914
|
-
const hit = this[CACHE].get(key).value;
|
|
4915
|
-
return !isStale(this, hit);
|
|
4302
|
+
constructor() {
|
|
4303
|
+
this.max = 1e3;
|
|
4304
|
+
this.map = /* @__PURE__ */ new Map();
|
|
4916
4305
|
}
|
|
4917
4306
|
get(key) {
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
if (!node)
|
|
4926
|
-
return null;
|
|
4927
|
-
del(this, node);
|
|
4928
|
-
return node.value;
|
|
4929
|
-
}
|
|
4930
|
-
del(key) {
|
|
4931
|
-
del(this, this[CACHE].get(key));
|
|
4932
|
-
}
|
|
4933
|
-
load(arr) {
|
|
4934
|
-
this.reset();
|
|
4935
|
-
const now = Date.now();
|
|
4936
|
-
for (let l = arr.length - 1; l >= 0; l--) {
|
|
4937
|
-
const hit = arr[l];
|
|
4938
|
-
const expiresAt = hit.e || 0;
|
|
4939
|
-
if (expiresAt === 0)
|
|
4940
|
-
this.set(hit.k, hit.v);
|
|
4941
|
-
else {
|
|
4942
|
-
const maxAge = expiresAt - now;
|
|
4943
|
-
if (maxAge > 0) {
|
|
4944
|
-
this.set(hit.k, hit.v, maxAge);
|
|
4945
|
-
}
|
|
4946
|
-
}
|
|
4307
|
+
const value = this.map.get(key);
|
|
4308
|
+
if (value === void 0) {
|
|
4309
|
+
return void 0;
|
|
4310
|
+
} else {
|
|
4311
|
+
this.map.delete(key);
|
|
4312
|
+
this.map.set(key, value);
|
|
4313
|
+
return value;
|
|
4947
4314
|
}
|
|
4948
4315
|
}
|
|
4949
|
-
|
|
4950
|
-
this
|
|
4316
|
+
delete(key) {
|
|
4317
|
+
return this.map.delete(key);
|
|
4951
4318
|
}
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
del(self, node);
|
|
4959
|
-
if (!self[ALLOW_STALE])
|
|
4960
|
-
return void 0;
|
|
4961
|
-
} else {
|
|
4962
|
-
if (doUse) {
|
|
4963
|
-
if (self[UPDATE_AGE_ON_GET])
|
|
4964
|
-
node.value.now = Date.now();
|
|
4965
|
-
self[LRU_LIST].unshiftNode(node);
|
|
4319
|
+
set(key, value) {
|
|
4320
|
+
const deleted = this.delete(key);
|
|
4321
|
+
if (!deleted && value !== void 0) {
|
|
4322
|
+
if (this.map.size >= this.max) {
|
|
4323
|
+
const firstKey = this.map.keys().next().value;
|
|
4324
|
+
this.delete(firstKey);
|
|
4966
4325
|
}
|
|
4326
|
+
this.map.set(key, value);
|
|
4967
4327
|
}
|
|
4968
|
-
return
|
|
4969
|
-
}
|
|
4970
|
-
};
|
|
4971
|
-
var isStale = (self, hit) => {
|
|
4972
|
-
if (!hit || !hit.maxAge && !self[MAX_AGE])
|
|
4973
|
-
return false;
|
|
4974
|
-
const diff = Date.now() - hit.now;
|
|
4975
|
-
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
|
|
4976
|
-
};
|
|
4977
|
-
var trim = (self) => {
|
|
4978
|
-
if (self[LENGTH] > self[MAX]) {
|
|
4979
|
-
for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
|
|
4980
|
-
const prev = walker.prev;
|
|
4981
|
-
del(self, walker);
|
|
4982
|
-
walker = prev;
|
|
4983
|
-
}
|
|
4984
|
-
}
|
|
4985
|
-
};
|
|
4986
|
-
var del = (self, node) => {
|
|
4987
|
-
if (node) {
|
|
4988
|
-
const hit = node.value;
|
|
4989
|
-
if (self[DISPOSE])
|
|
4990
|
-
self[DISPOSE](hit.key, hit.value);
|
|
4991
|
-
self[LENGTH] -= hit.length;
|
|
4992
|
-
self[CACHE].delete(hit.key);
|
|
4993
|
-
self[LRU_LIST].removeNode(node);
|
|
4994
|
-
}
|
|
4995
|
-
};
|
|
4996
|
-
var Entry = class {
|
|
4997
|
-
constructor(key, value, length, now, maxAge) {
|
|
4998
|
-
this.key = key;
|
|
4999
|
-
this.value = value;
|
|
5000
|
-
this.length = length;
|
|
5001
|
-
this.now = now;
|
|
5002
|
-
this.maxAge = maxAge || 0;
|
|
4328
|
+
return this;
|
|
5003
4329
|
}
|
|
5004
4330
|
};
|
|
5005
|
-
var forEachStep = (self, fn, node, thisp) => {
|
|
5006
|
-
let hit = node.value;
|
|
5007
|
-
if (isStale(self, hit)) {
|
|
5008
|
-
del(self, node);
|
|
5009
|
-
if (!self[ALLOW_STALE])
|
|
5010
|
-
hit = void 0;
|
|
5011
|
-
}
|
|
5012
|
-
if (hit)
|
|
5013
|
-
fn.call(thisp, hit.value, hit.key, self);
|
|
5014
|
-
};
|
|
5015
4331
|
module.exports = LRUCache;
|
|
5016
4332
|
}
|
|
5017
4333
|
});
|
|
@@ -5141,8 +4457,8 @@ var require_range = __commonJS({
|
|
|
5141
4457
|
}
|
|
5142
4458
|
};
|
|
5143
4459
|
module.exports = Range;
|
|
5144
|
-
var LRU =
|
|
5145
|
-
var cache2 = new LRU(
|
|
4460
|
+
var LRU = require_lrucache();
|
|
4461
|
+
var cache2 = new LRU();
|
|
5146
4462
|
var parseOptions = require_parse_options();
|
|
5147
4463
|
var Comparator = require_comparator();
|
|
5148
4464
|
var debug = require_debug();
|
|
@@ -5320,7 +4636,7 @@ var require_range = __commonJS({
|
|
|
5320
4636
|
debug("replaceGTE0", comp, options);
|
|
5321
4637
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
5322
4638
|
};
|
|
5323
|
-
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr
|
|
4639
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
5324
4640
|
if (isX(fM)) {
|
|
5325
4641
|
from = "";
|
|
5326
4642
|
} else if (isX(fm)) {
|
|
@@ -5800,19 +5116,18 @@ var require_subset = __commonJS({
|
|
|
5800
5116
|
sub = new Range(sub, options);
|
|
5801
5117
|
dom = new Range(dom, options);
|
|
5802
5118
|
let sawNonNull = false;
|
|
5803
|
-
OUTER:
|
|
5804
|
-
for (const
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
continue OUTER;
|
|
5810
|
-
}
|
|
5811
|
-
}
|
|
5812
|
-
if (sawNonNull) {
|
|
5813
|
-
return false;
|
|
5119
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
5120
|
+
for (const simpleDom of dom.set) {
|
|
5121
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
5122
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
5123
|
+
if (isSub) {
|
|
5124
|
+
continue OUTER;
|
|
5814
5125
|
}
|
|
5815
5126
|
}
|
|
5127
|
+
if (sawNonNull) {
|
|
5128
|
+
return false;
|
|
5129
|
+
}
|
|
5130
|
+
}
|
|
5816
5131
|
return true;
|
|
5817
5132
|
};
|
|
5818
5133
|
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
@@ -6604,9 +5919,9 @@ var Node = class {
|
|
|
6604
5919
|
var _head, _tail, _size;
|
|
6605
5920
|
var Queue = class {
|
|
6606
5921
|
constructor() {
|
|
6607
|
-
__privateAdd(this, _head
|
|
6608
|
-
__privateAdd(this, _tail
|
|
6609
|
-
__privateAdd(this, _size
|
|
5922
|
+
__privateAdd(this, _head);
|
|
5923
|
+
__privateAdd(this, _tail);
|
|
5924
|
+
__privateAdd(this, _size);
|
|
6610
5925
|
this.clear();
|
|
6611
5926
|
}
|
|
6612
5927
|
enqueue(value) {
|
|
@@ -6830,8 +6145,7 @@ function init(x, y) {
|
|
|
6830
6145
|
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
|
6831
6146
|
let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
|
|
6832
6147
|
return function(txt) {
|
|
6833
|
-
if (!$.enabled || txt == null)
|
|
6834
|
-
return txt;
|
|
6148
|
+
if (!$.enabled || txt == null) return txt;
|
|
6835
6149
|
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
|
6836
6150
|
};
|
|
6837
6151
|
}
|
|
@@ -7355,7 +6669,7 @@ var dealias = (opt = {}) => {
|
|
|
7355
6669
|
import EE from "events";
|
|
7356
6670
|
import fs2 from "fs";
|
|
7357
6671
|
|
|
7358
|
-
// node_modules
|
|
6672
|
+
// node_modules/minipass/dist/esm/index.js
|
|
7359
6673
|
import { EventEmitter } from "events";
|
|
7360
6674
|
import Stream from "stream";
|
|
7361
6675
|
import { StringDecoder } from "string_decoder";
|
|
@@ -8620,894 +7934,12 @@ import fs3 from "fs";
|
|
|
8620
7934
|
import { dirname, parse as parse2 } from "path";
|
|
8621
7935
|
|
|
8622
7936
|
// node_modules/tar/dist/esm/parse.js
|
|
8623
|
-
import { EventEmitter as
|
|
7937
|
+
import { EventEmitter as EE2 } from "events";
|
|
8624
7938
|
|
|
8625
7939
|
// node_modules/minizlib/dist/esm/index.js
|
|
8626
7940
|
import assert from "assert";
|
|
8627
7941
|
import { Buffer as Buffer2 } from "buffer";
|
|
8628
|
-
|
|
8629
|
-
// node_modules/minizlib/node_modules/minipass/dist/esm/index.js
|
|
8630
|
-
import { EventEmitter as EventEmitter2 } from "events";
|
|
8631
|
-
import Stream2 from "stream";
|
|
8632
|
-
import { StringDecoder as StringDecoder2 } from "string_decoder";
|
|
8633
|
-
var proc2 = typeof process === "object" && process ? process : {
|
|
8634
|
-
stdout: null,
|
|
8635
|
-
stderr: null
|
|
8636
|
-
};
|
|
8637
|
-
var isStream2 = (s) => !!s && typeof s === "object" && (s instanceof Minipass2 || s instanceof Stream2 || isReadable2(s) || isWritable2(s));
|
|
8638
|
-
var isReadable2 = (s) => !!s && typeof s === "object" && s instanceof EventEmitter2 && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws
|
|
8639
|
-
s.pipe !== Stream2.Writable.prototype.pipe;
|
|
8640
|
-
var isWritable2 = (s) => !!s && typeof s === "object" && s instanceof EventEmitter2 && typeof s.write === "function" && typeof s.end === "function";
|
|
8641
|
-
var EOF2 = Symbol("EOF");
|
|
8642
|
-
var MAYBE_EMIT_END2 = Symbol("maybeEmitEnd");
|
|
8643
|
-
var EMITTED_END2 = Symbol("emittedEnd");
|
|
8644
|
-
var EMITTING_END2 = Symbol("emittingEnd");
|
|
8645
|
-
var EMITTED_ERROR2 = Symbol("emittedError");
|
|
8646
|
-
var CLOSED2 = Symbol("closed");
|
|
8647
|
-
var READ2 = Symbol("read");
|
|
8648
|
-
var FLUSH2 = Symbol("flush");
|
|
8649
|
-
var FLUSHCHUNK2 = Symbol("flushChunk");
|
|
8650
|
-
var ENCODING2 = Symbol("encoding");
|
|
8651
|
-
var DECODER2 = Symbol("decoder");
|
|
8652
|
-
var FLOWING2 = Symbol("flowing");
|
|
8653
|
-
var PAUSED2 = Symbol("paused");
|
|
8654
|
-
var RESUME2 = Symbol("resume");
|
|
8655
|
-
var BUFFER2 = Symbol("buffer");
|
|
8656
|
-
var PIPES2 = Symbol("pipes");
|
|
8657
|
-
var BUFFERLENGTH2 = Symbol("bufferLength");
|
|
8658
|
-
var BUFFERPUSH2 = Symbol("bufferPush");
|
|
8659
|
-
var BUFFERSHIFT2 = Symbol("bufferShift");
|
|
8660
|
-
var OBJECTMODE2 = Symbol("objectMode");
|
|
8661
|
-
var DESTROYED2 = Symbol("destroyed");
|
|
8662
|
-
var ERROR2 = Symbol("error");
|
|
8663
|
-
var EMITDATA2 = Symbol("emitData");
|
|
8664
|
-
var EMITEND3 = Symbol("emitEnd");
|
|
8665
|
-
var EMITEND22 = Symbol("emitEnd2");
|
|
8666
|
-
var ASYNC2 = Symbol("async");
|
|
8667
|
-
var ABORT2 = Symbol("abort");
|
|
8668
|
-
var ABORTED2 = Symbol("aborted");
|
|
8669
|
-
var SIGNAL2 = Symbol("signal");
|
|
8670
|
-
var DATALISTENERS2 = Symbol("dataListeners");
|
|
8671
|
-
var DISCARDED2 = Symbol("discarded");
|
|
8672
|
-
var defer2 = (fn) => Promise.resolve().then(fn);
|
|
8673
|
-
var nodefer2 = (fn) => fn();
|
|
8674
|
-
var isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish";
|
|
8675
|
-
var isArrayBufferLike2 = (b) => b instanceof ArrayBuffer || !!b && typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0;
|
|
8676
|
-
var isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
8677
|
-
var Pipe2 = class {
|
|
8678
|
-
src;
|
|
8679
|
-
dest;
|
|
8680
|
-
opts;
|
|
8681
|
-
ondrain;
|
|
8682
|
-
constructor(src, dest, opts) {
|
|
8683
|
-
this.src = src;
|
|
8684
|
-
this.dest = dest;
|
|
8685
|
-
this.opts = opts;
|
|
8686
|
-
this.ondrain = () => src[RESUME2]();
|
|
8687
|
-
this.dest.on("drain", this.ondrain);
|
|
8688
|
-
}
|
|
8689
|
-
unpipe() {
|
|
8690
|
-
this.dest.removeListener("drain", this.ondrain);
|
|
8691
|
-
}
|
|
8692
|
-
// only here for the prototype
|
|
8693
|
-
/* c8 ignore start */
|
|
8694
|
-
proxyErrors(_er) {
|
|
8695
|
-
}
|
|
8696
|
-
/* c8 ignore stop */
|
|
8697
|
-
end() {
|
|
8698
|
-
this.unpipe();
|
|
8699
|
-
if (this.opts.end)
|
|
8700
|
-
this.dest.end();
|
|
8701
|
-
}
|
|
8702
|
-
};
|
|
8703
|
-
var PipeProxyErrors2 = class extends Pipe2 {
|
|
8704
|
-
unpipe() {
|
|
8705
|
-
this.src.removeListener("error", this.proxyErrors);
|
|
8706
|
-
super.unpipe();
|
|
8707
|
-
}
|
|
8708
|
-
constructor(src, dest, opts) {
|
|
8709
|
-
super(src, dest, opts);
|
|
8710
|
-
this.proxyErrors = (er) => dest.emit("error", er);
|
|
8711
|
-
src.on("error", this.proxyErrors);
|
|
8712
|
-
}
|
|
8713
|
-
};
|
|
8714
|
-
var isObjectModeOptions2 = (o) => !!o.objectMode;
|
|
8715
|
-
var isEncodingOptions2 = (o) => !o.objectMode && !!o.encoding && o.encoding !== "buffer";
|
|
8716
|
-
var Minipass2 = class extends EventEmitter2 {
|
|
8717
|
-
[FLOWING2] = false;
|
|
8718
|
-
[PAUSED2] = false;
|
|
8719
|
-
[PIPES2] = [];
|
|
8720
|
-
[BUFFER2] = [];
|
|
8721
|
-
[OBJECTMODE2];
|
|
8722
|
-
[ENCODING2];
|
|
8723
|
-
[ASYNC2];
|
|
8724
|
-
[DECODER2];
|
|
8725
|
-
[EOF2] = false;
|
|
8726
|
-
[EMITTED_END2] = false;
|
|
8727
|
-
[EMITTING_END2] = false;
|
|
8728
|
-
[CLOSED2] = false;
|
|
8729
|
-
[EMITTED_ERROR2] = null;
|
|
8730
|
-
[BUFFERLENGTH2] = 0;
|
|
8731
|
-
[DESTROYED2] = false;
|
|
8732
|
-
[SIGNAL2];
|
|
8733
|
-
[ABORTED2] = false;
|
|
8734
|
-
[DATALISTENERS2] = 0;
|
|
8735
|
-
[DISCARDED2] = false;
|
|
8736
|
-
/**
|
|
8737
|
-
* true if the stream can be written
|
|
8738
|
-
*/
|
|
8739
|
-
writable = true;
|
|
8740
|
-
/**
|
|
8741
|
-
* true if the stream can be read
|
|
8742
|
-
*/
|
|
8743
|
-
readable = true;
|
|
8744
|
-
/**
|
|
8745
|
-
* If `RType` is Buffer, then options do not need to be provided.
|
|
8746
|
-
* Otherwise, an options object must be provided to specify either
|
|
8747
|
-
* {@link Minipass.SharedOptions.objectMode} or
|
|
8748
|
-
* {@link Minipass.SharedOptions.encoding}, as appropriate.
|
|
8749
|
-
*/
|
|
8750
|
-
constructor(...args) {
|
|
8751
|
-
const options = args[0] || {};
|
|
8752
|
-
super();
|
|
8753
|
-
if (options.objectMode && typeof options.encoding === "string") {
|
|
8754
|
-
throw new TypeError("Encoding and objectMode may not be used together");
|
|
8755
|
-
}
|
|
8756
|
-
if (isObjectModeOptions2(options)) {
|
|
8757
|
-
this[OBJECTMODE2] = true;
|
|
8758
|
-
this[ENCODING2] = null;
|
|
8759
|
-
} else if (isEncodingOptions2(options)) {
|
|
8760
|
-
this[ENCODING2] = options.encoding;
|
|
8761
|
-
this[OBJECTMODE2] = false;
|
|
8762
|
-
} else {
|
|
8763
|
-
this[OBJECTMODE2] = false;
|
|
8764
|
-
this[ENCODING2] = null;
|
|
8765
|
-
}
|
|
8766
|
-
this[ASYNC2] = !!options.async;
|
|
8767
|
-
this[DECODER2] = this[ENCODING2] ? new StringDecoder2(this[ENCODING2]) : null;
|
|
8768
|
-
if (options && options.debugExposeBuffer === true) {
|
|
8769
|
-
Object.defineProperty(this, "buffer", { get: () => this[BUFFER2] });
|
|
8770
|
-
}
|
|
8771
|
-
if (options && options.debugExposePipes === true) {
|
|
8772
|
-
Object.defineProperty(this, "pipes", { get: () => this[PIPES2] });
|
|
8773
|
-
}
|
|
8774
|
-
const { signal } = options;
|
|
8775
|
-
if (signal) {
|
|
8776
|
-
this[SIGNAL2] = signal;
|
|
8777
|
-
if (signal.aborted) {
|
|
8778
|
-
this[ABORT2]();
|
|
8779
|
-
} else {
|
|
8780
|
-
signal.addEventListener("abort", () => this[ABORT2]());
|
|
8781
|
-
}
|
|
8782
|
-
}
|
|
8783
|
-
}
|
|
8784
|
-
/**
|
|
8785
|
-
* The amount of data stored in the buffer waiting to be read.
|
|
8786
|
-
*
|
|
8787
|
-
* For Buffer strings, this will be the total byte length.
|
|
8788
|
-
* For string encoding streams, this will be the string character length,
|
|
8789
|
-
* according to JavaScript's `string.length` logic.
|
|
8790
|
-
* For objectMode streams, this is a count of the items waiting to be
|
|
8791
|
-
* emitted.
|
|
8792
|
-
*/
|
|
8793
|
-
get bufferLength() {
|
|
8794
|
-
return this[BUFFERLENGTH2];
|
|
8795
|
-
}
|
|
8796
|
-
/**
|
|
8797
|
-
* The `BufferEncoding` currently in use, or `null`
|
|
8798
|
-
*/
|
|
8799
|
-
get encoding() {
|
|
8800
|
-
return this[ENCODING2];
|
|
8801
|
-
}
|
|
8802
|
-
/**
|
|
8803
|
-
* @deprecated - This is a read only property
|
|
8804
|
-
*/
|
|
8805
|
-
set encoding(_enc) {
|
|
8806
|
-
throw new Error("Encoding must be set at instantiation time");
|
|
8807
|
-
}
|
|
8808
|
-
/**
|
|
8809
|
-
* @deprecated - Encoding may only be set at instantiation time
|
|
8810
|
-
*/
|
|
8811
|
-
setEncoding(_enc) {
|
|
8812
|
-
throw new Error("Encoding must be set at instantiation time");
|
|
8813
|
-
}
|
|
8814
|
-
/**
|
|
8815
|
-
* True if this is an objectMode stream
|
|
8816
|
-
*/
|
|
8817
|
-
get objectMode() {
|
|
8818
|
-
return this[OBJECTMODE2];
|
|
8819
|
-
}
|
|
8820
|
-
/**
|
|
8821
|
-
* @deprecated - This is a read-only property
|
|
8822
|
-
*/
|
|
8823
|
-
set objectMode(_om) {
|
|
8824
|
-
throw new Error("objectMode must be set at instantiation time");
|
|
8825
|
-
}
|
|
8826
|
-
/**
|
|
8827
|
-
* true if this is an async stream
|
|
8828
|
-
*/
|
|
8829
|
-
get ["async"]() {
|
|
8830
|
-
return this[ASYNC2];
|
|
8831
|
-
}
|
|
8832
|
-
/**
|
|
8833
|
-
* Set to true to make this stream async.
|
|
8834
|
-
*
|
|
8835
|
-
* Once set, it cannot be unset, as this would potentially cause incorrect
|
|
8836
|
-
* behavior. Ie, a sync stream can be made async, but an async stream
|
|
8837
|
-
* cannot be safely made sync.
|
|
8838
|
-
*/
|
|
8839
|
-
set ["async"](a) {
|
|
8840
|
-
this[ASYNC2] = this[ASYNC2] || !!a;
|
|
8841
|
-
}
|
|
8842
|
-
// drop everything and get out of the flow completely
|
|
8843
|
-
[ABORT2]() {
|
|
8844
|
-
var _a, _b;
|
|
8845
|
-
this[ABORTED2] = true;
|
|
8846
|
-
this.emit("abort", (_a = this[SIGNAL2]) == null ? void 0 : _a.reason);
|
|
8847
|
-
this.destroy((_b = this[SIGNAL2]) == null ? void 0 : _b.reason);
|
|
8848
|
-
}
|
|
8849
|
-
/**
|
|
8850
|
-
* True if the stream has been aborted.
|
|
8851
|
-
*/
|
|
8852
|
-
get aborted() {
|
|
8853
|
-
return this[ABORTED2];
|
|
8854
|
-
}
|
|
8855
|
-
/**
|
|
8856
|
-
* No-op setter. Stream aborted status is set via the AbortSignal provided
|
|
8857
|
-
* in the constructor options.
|
|
8858
|
-
*/
|
|
8859
|
-
set aborted(_) {
|
|
8860
|
-
}
|
|
8861
|
-
write(chunk, encoding, cb) {
|
|
8862
|
-
var _a;
|
|
8863
|
-
if (this[ABORTED2])
|
|
8864
|
-
return false;
|
|
8865
|
-
if (this[EOF2])
|
|
8866
|
-
throw new Error("write after end");
|
|
8867
|
-
if (this[DESTROYED2]) {
|
|
8868
|
-
this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" }));
|
|
8869
|
-
return true;
|
|
8870
|
-
}
|
|
8871
|
-
if (typeof encoding === "function") {
|
|
8872
|
-
cb = encoding;
|
|
8873
|
-
encoding = "utf8";
|
|
8874
|
-
}
|
|
8875
|
-
if (!encoding)
|
|
8876
|
-
encoding = "utf8";
|
|
8877
|
-
const fn = this[ASYNC2] ? defer2 : nodefer2;
|
|
8878
|
-
if (!this[OBJECTMODE2] && !Buffer.isBuffer(chunk)) {
|
|
8879
|
-
if (isArrayBufferView2(chunk)) {
|
|
8880
|
-
chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
8881
|
-
} else if (isArrayBufferLike2(chunk)) {
|
|
8882
|
-
chunk = Buffer.from(chunk);
|
|
8883
|
-
} else if (typeof chunk !== "string") {
|
|
8884
|
-
throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
8885
|
-
}
|
|
8886
|
-
}
|
|
8887
|
-
if (this[OBJECTMODE2]) {
|
|
8888
|
-
if (this[FLOWING2] && this[BUFFERLENGTH2] !== 0)
|
|
8889
|
-
this[FLUSH2](true);
|
|
8890
|
-
if (this[FLOWING2])
|
|
8891
|
-
this.emit("data", chunk);
|
|
8892
|
-
else
|
|
8893
|
-
this[BUFFERPUSH2](chunk);
|
|
8894
|
-
if (this[BUFFERLENGTH2] !== 0)
|
|
8895
|
-
this.emit("readable");
|
|
8896
|
-
if (cb)
|
|
8897
|
-
fn(cb);
|
|
8898
|
-
return this[FLOWING2];
|
|
8899
|
-
}
|
|
8900
|
-
if (!chunk.length) {
|
|
8901
|
-
if (this[BUFFERLENGTH2] !== 0)
|
|
8902
|
-
this.emit("readable");
|
|
8903
|
-
if (cb)
|
|
8904
|
-
fn(cb);
|
|
8905
|
-
return this[FLOWING2];
|
|
8906
|
-
}
|
|
8907
|
-
if (typeof chunk === "string" && // unless it is a string already ready for us to use
|
|
8908
|
-
!(encoding === this[ENCODING2] && !((_a = this[DECODER2]) == null ? void 0 : _a.lastNeed))) {
|
|
8909
|
-
chunk = Buffer.from(chunk, encoding);
|
|
8910
|
-
}
|
|
8911
|
-
if (Buffer.isBuffer(chunk) && this[ENCODING2]) {
|
|
8912
|
-
chunk = this[DECODER2].write(chunk);
|
|
8913
|
-
}
|
|
8914
|
-
if (this[FLOWING2] && this[BUFFERLENGTH2] !== 0)
|
|
8915
|
-
this[FLUSH2](true);
|
|
8916
|
-
if (this[FLOWING2])
|
|
8917
|
-
this.emit("data", chunk);
|
|
8918
|
-
else
|
|
8919
|
-
this[BUFFERPUSH2](chunk);
|
|
8920
|
-
if (this[BUFFERLENGTH2] !== 0)
|
|
8921
|
-
this.emit("readable");
|
|
8922
|
-
if (cb)
|
|
8923
|
-
fn(cb);
|
|
8924
|
-
return this[FLOWING2];
|
|
8925
|
-
}
|
|
8926
|
-
/**
|
|
8927
|
-
* Low-level explicit read method.
|
|
8928
|
-
*
|
|
8929
|
-
* In objectMode, the argument is ignored, and one item is returned if
|
|
8930
|
-
* available.
|
|
8931
|
-
*
|
|
8932
|
-
* `n` is the number of bytes (or in the case of encoding streams,
|
|
8933
|
-
* characters) to consume. If `n` is not provided, then the entire buffer
|
|
8934
|
-
* is returned, or `null` is returned if no data is available.
|
|
8935
|
-
*
|
|
8936
|
-
* If `n` is greater that the amount of data in the internal buffer,
|
|
8937
|
-
* then `null` is returned.
|
|
8938
|
-
*/
|
|
8939
|
-
read(n) {
|
|
8940
|
-
if (this[DESTROYED2])
|
|
8941
|
-
return null;
|
|
8942
|
-
this[DISCARDED2] = false;
|
|
8943
|
-
if (this[BUFFERLENGTH2] === 0 || n === 0 || n && n > this[BUFFERLENGTH2]) {
|
|
8944
|
-
this[MAYBE_EMIT_END2]();
|
|
8945
|
-
return null;
|
|
8946
|
-
}
|
|
8947
|
-
if (this[OBJECTMODE2])
|
|
8948
|
-
n = null;
|
|
8949
|
-
if (this[BUFFER2].length > 1 && !this[OBJECTMODE2]) {
|
|
8950
|
-
this[BUFFER2] = [
|
|
8951
|
-
this[ENCODING2] ? this[BUFFER2].join("") : Buffer.concat(this[BUFFER2], this[BUFFERLENGTH2])
|
|
8952
|
-
];
|
|
8953
|
-
}
|
|
8954
|
-
const ret = this[READ2](n || null, this[BUFFER2][0]);
|
|
8955
|
-
this[MAYBE_EMIT_END2]();
|
|
8956
|
-
return ret;
|
|
8957
|
-
}
|
|
8958
|
-
[READ2](n, chunk) {
|
|
8959
|
-
if (this[OBJECTMODE2])
|
|
8960
|
-
this[BUFFERSHIFT2]();
|
|
8961
|
-
else {
|
|
8962
|
-
const c = chunk;
|
|
8963
|
-
if (n === c.length || n === null)
|
|
8964
|
-
this[BUFFERSHIFT2]();
|
|
8965
|
-
else if (typeof c === "string") {
|
|
8966
|
-
this[BUFFER2][0] = c.slice(n);
|
|
8967
|
-
chunk = c.slice(0, n);
|
|
8968
|
-
this[BUFFERLENGTH2] -= n;
|
|
8969
|
-
} else {
|
|
8970
|
-
this[BUFFER2][0] = c.subarray(n);
|
|
8971
|
-
chunk = c.subarray(0, n);
|
|
8972
|
-
this[BUFFERLENGTH2] -= n;
|
|
8973
|
-
}
|
|
8974
|
-
}
|
|
8975
|
-
this.emit("data", chunk);
|
|
8976
|
-
if (!this[BUFFER2].length && !this[EOF2])
|
|
8977
|
-
this.emit("drain");
|
|
8978
|
-
return chunk;
|
|
8979
|
-
}
|
|
8980
|
-
end(chunk, encoding, cb) {
|
|
8981
|
-
if (typeof chunk === "function") {
|
|
8982
|
-
cb = chunk;
|
|
8983
|
-
chunk = void 0;
|
|
8984
|
-
}
|
|
8985
|
-
if (typeof encoding === "function") {
|
|
8986
|
-
cb = encoding;
|
|
8987
|
-
encoding = "utf8";
|
|
8988
|
-
}
|
|
8989
|
-
if (chunk !== void 0)
|
|
8990
|
-
this.write(chunk, encoding);
|
|
8991
|
-
if (cb)
|
|
8992
|
-
this.once("end", cb);
|
|
8993
|
-
this[EOF2] = true;
|
|
8994
|
-
this.writable = false;
|
|
8995
|
-
if (this[FLOWING2] || !this[PAUSED2])
|
|
8996
|
-
this[MAYBE_EMIT_END2]();
|
|
8997
|
-
return this;
|
|
8998
|
-
}
|
|
8999
|
-
// don't let the internal resume be overwritten
|
|
9000
|
-
[RESUME2]() {
|
|
9001
|
-
if (this[DESTROYED2])
|
|
9002
|
-
return;
|
|
9003
|
-
if (!this[DATALISTENERS2] && !this[PIPES2].length) {
|
|
9004
|
-
this[DISCARDED2] = true;
|
|
9005
|
-
}
|
|
9006
|
-
this[PAUSED2] = false;
|
|
9007
|
-
this[FLOWING2] = true;
|
|
9008
|
-
this.emit("resume");
|
|
9009
|
-
if (this[BUFFER2].length)
|
|
9010
|
-
this[FLUSH2]();
|
|
9011
|
-
else if (this[EOF2])
|
|
9012
|
-
this[MAYBE_EMIT_END2]();
|
|
9013
|
-
else
|
|
9014
|
-
this.emit("drain");
|
|
9015
|
-
}
|
|
9016
|
-
/**
|
|
9017
|
-
* Resume the stream if it is currently in a paused state
|
|
9018
|
-
*
|
|
9019
|
-
* If called when there are no pipe destinations or `data` event listeners,
|
|
9020
|
-
* this will place the stream in a "discarded" state, where all data will
|
|
9021
|
-
* be thrown away. The discarded state is removed if a pipe destination or
|
|
9022
|
-
* data handler is added, if pause() is called, or if any synchronous or
|
|
9023
|
-
* asynchronous iteration is started.
|
|
9024
|
-
*/
|
|
9025
|
-
resume() {
|
|
9026
|
-
return this[RESUME2]();
|
|
9027
|
-
}
|
|
9028
|
-
/**
|
|
9029
|
-
* Pause the stream
|
|
9030
|
-
*/
|
|
9031
|
-
pause() {
|
|
9032
|
-
this[FLOWING2] = false;
|
|
9033
|
-
this[PAUSED2] = true;
|
|
9034
|
-
this[DISCARDED2] = false;
|
|
9035
|
-
}
|
|
9036
|
-
/**
|
|
9037
|
-
* true if the stream has been forcibly destroyed
|
|
9038
|
-
*/
|
|
9039
|
-
get destroyed() {
|
|
9040
|
-
return this[DESTROYED2];
|
|
9041
|
-
}
|
|
9042
|
-
/**
|
|
9043
|
-
* true if the stream is currently in a flowing state, meaning that
|
|
9044
|
-
* any writes will be immediately emitted.
|
|
9045
|
-
*/
|
|
9046
|
-
get flowing() {
|
|
9047
|
-
return this[FLOWING2];
|
|
9048
|
-
}
|
|
9049
|
-
/**
|
|
9050
|
-
* true if the stream is currently in a paused state
|
|
9051
|
-
*/
|
|
9052
|
-
get paused() {
|
|
9053
|
-
return this[PAUSED2];
|
|
9054
|
-
}
|
|
9055
|
-
[BUFFERPUSH2](chunk) {
|
|
9056
|
-
if (this[OBJECTMODE2])
|
|
9057
|
-
this[BUFFERLENGTH2] += 1;
|
|
9058
|
-
else
|
|
9059
|
-
this[BUFFERLENGTH2] += chunk.length;
|
|
9060
|
-
this[BUFFER2].push(chunk);
|
|
9061
|
-
}
|
|
9062
|
-
[BUFFERSHIFT2]() {
|
|
9063
|
-
if (this[OBJECTMODE2])
|
|
9064
|
-
this[BUFFERLENGTH2] -= 1;
|
|
9065
|
-
else
|
|
9066
|
-
this[BUFFERLENGTH2] -= this[BUFFER2][0].length;
|
|
9067
|
-
return this[BUFFER2].shift();
|
|
9068
|
-
}
|
|
9069
|
-
[FLUSH2](noDrain = false) {
|
|
9070
|
-
do {
|
|
9071
|
-
} while (this[FLUSHCHUNK2](this[BUFFERSHIFT2]()) && this[BUFFER2].length);
|
|
9072
|
-
if (!noDrain && !this[BUFFER2].length && !this[EOF2])
|
|
9073
|
-
this.emit("drain");
|
|
9074
|
-
}
|
|
9075
|
-
[FLUSHCHUNK2](chunk) {
|
|
9076
|
-
this.emit("data", chunk);
|
|
9077
|
-
return this[FLOWING2];
|
|
9078
|
-
}
|
|
9079
|
-
/**
|
|
9080
|
-
* Pipe all data emitted by this stream into the destination provided.
|
|
9081
|
-
*
|
|
9082
|
-
* Triggers the flow of data.
|
|
9083
|
-
*/
|
|
9084
|
-
pipe(dest, opts) {
|
|
9085
|
-
if (this[DESTROYED2])
|
|
9086
|
-
return dest;
|
|
9087
|
-
this[DISCARDED2] = false;
|
|
9088
|
-
const ended = this[EMITTED_END2];
|
|
9089
|
-
opts = opts || {};
|
|
9090
|
-
if (dest === proc2.stdout || dest === proc2.stderr)
|
|
9091
|
-
opts.end = false;
|
|
9092
|
-
else
|
|
9093
|
-
opts.end = opts.end !== false;
|
|
9094
|
-
opts.proxyErrors = !!opts.proxyErrors;
|
|
9095
|
-
if (ended) {
|
|
9096
|
-
if (opts.end)
|
|
9097
|
-
dest.end();
|
|
9098
|
-
} else {
|
|
9099
|
-
this[PIPES2].push(!opts.proxyErrors ? new Pipe2(this, dest, opts) : new PipeProxyErrors2(this, dest, opts));
|
|
9100
|
-
if (this[ASYNC2])
|
|
9101
|
-
defer2(() => this[RESUME2]());
|
|
9102
|
-
else
|
|
9103
|
-
this[RESUME2]();
|
|
9104
|
-
}
|
|
9105
|
-
return dest;
|
|
9106
|
-
}
|
|
9107
|
-
/**
|
|
9108
|
-
* Fully unhook a piped destination stream.
|
|
9109
|
-
*
|
|
9110
|
-
* If the destination stream was the only consumer of this stream (ie,
|
|
9111
|
-
* there are no other piped destinations or `'data'` event listeners)
|
|
9112
|
-
* then the flow of data will stop until there is another consumer or
|
|
9113
|
-
* {@link Minipass#resume} is explicitly called.
|
|
9114
|
-
*/
|
|
9115
|
-
unpipe(dest) {
|
|
9116
|
-
const p = this[PIPES2].find((p2) => p2.dest === dest);
|
|
9117
|
-
if (p) {
|
|
9118
|
-
if (this[PIPES2].length === 1) {
|
|
9119
|
-
if (this[FLOWING2] && this[DATALISTENERS2] === 0) {
|
|
9120
|
-
this[FLOWING2] = false;
|
|
9121
|
-
}
|
|
9122
|
-
this[PIPES2] = [];
|
|
9123
|
-
} else
|
|
9124
|
-
this[PIPES2].splice(this[PIPES2].indexOf(p), 1);
|
|
9125
|
-
p.unpipe();
|
|
9126
|
-
}
|
|
9127
|
-
}
|
|
9128
|
-
/**
|
|
9129
|
-
* Alias for {@link Minipass#on}
|
|
9130
|
-
*/
|
|
9131
|
-
addListener(ev, handler) {
|
|
9132
|
-
return this.on(ev, handler);
|
|
9133
|
-
}
|
|
9134
|
-
/**
|
|
9135
|
-
* Mostly identical to `EventEmitter.on`, with the following
|
|
9136
|
-
* behavior differences to prevent data loss and unnecessary hangs:
|
|
9137
|
-
*
|
|
9138
|
-
* - Adding a 'data' event handler will trigger the flow of data
|
|
9139
|
-
*
|
|
9140
|
-
* - Adding a 'readable' event handler when there is data waiting to be read
|
|
9141
|
-
* will cause 'readable' to be emitted immediately.
|
|
9142
|
-
*
|
|
9143
|
-
* - Adding an 'endish' event handler ('end', 'finish', etc.) which has
|
|
9144
|
-
* already passed will cause the event to be emitted immediately and all
|
|
9145
|
-
* handlers removed.
|
|
9146
|
-
*
|
|
9147
|
-
* - Adding an 'error' event handler after an error has been emitted will
|
|
9148
|
-
* cause the event to be re-emitted immediately with the error previously
|
|
9149
|
-
* raised.
|
|
9150
|
-
*/
|
|
9151
|
-
on(ev, handler) {
|
|
9152
|
-
const ret = super.on(ev, handler);
|
|
9153
|
-
if (ev === "data") {
|
|
9154
|
-
this[DISCARDED2] = false;
|
|
9155
|
-
this[DATALISTENERS2]++;
|
|
9156
|
-
if (!this[PIPES2].length && !this[FLOWING2]) {
|
|
9157
|
-
this[RESUME2]();
|
|
9158
|
-
}
|
|
9159
|
-
} else if (ev === "readable" && this[BUFFERLENGTH2] !== 0) {
|
|
9160
|
-
super.emit("readable");
|
|
9161
|
-
} else if (isEndish2(ev) && this[EMITTED_END2]) {
|
|
9162
|
-
super.emit(ev);
|
|
9163
|
-
this.removeAllListeners(ev);
|
|
9164
|
-
} else if (ev === "error" && this[EMITTED_ERROR2]) {
|
|
9165
|
-
const h = handler;
|
|
9166
|
-
if (this[ASYNC2])
|
|
9167
|
-
defer2(() => h.call(this, this[EMITTED_ERROR2]));
|
|
9168
|
-
else
|
|
9169
|
-
h.call(this, this[EMITTED_ERROR2]);
|
|
9170
|
-
}
|
|
9171
|
-
return ret;
|
|
9172
|
-
}
|
|
9173
|
-
/**
|
|
9174
|
-
* Alias for {@link Minipass#off}
|
|
9175
|
-
*/
|
|
9176
|
-
removeListener(ev, handler) {
|
|
9177
|
-
return this.off(ev, handler);
|
|
9178
|
-
}
|
|
9179
|
-
/**
|
|
9180
|
-
* Mostly identical to `EventEmitter.off`
|
|
9181
|
-
*
|
|
9182
|
-
* If a 'data' event handler is removed, and it was the last consumer
|
|
9183
|
-
* (ie, there are no pipe destinations or other 'data' event listeners),
|
|
9184
|
-
* then the flow of data will stop until there is another consumer or
|
|
9185
|
-
* {@link Minipass#resume} is explicitly called.
|
|
9186
|
-
*/
|
|
9187
|
-
off(ev, handler) {
|
|
9188
|
-
const ret = super.off(ev, handler);
|
|
9189
|
-
if (ev === "data") {
|
|
9190
|
-
this[DATALISTENERS2] = this.listeners("data").length;
|
|
9191
|
-
if (this[DATALISTENERS2] === 0 && !this[DISCARDED2] && !this[PIPES2].length) {
|
|
9192
|
-
this[FLOWING2] = false;
|
|
9193
|
-
}
|
|
9194
|
-
}
|
|
9195
|
-
return ret;
|
|
9196
|
-
}
|
|
9197
|
-
/**
|
|
9198
|
-
* Mostly identical to `EventEmitter.removeAllListeners`
|
|
9199
|
-
*
|
|
9200
|
-
* If all 'data' event handlers are removed, and they were the last consumer
|
|
9201
|
-
* (ie, there are no pipe destinations), then the flow of data will stop
|
|
9202
|
-
* until there is another consumer or {@link Minipass#resume} is explicitly
|
|
9203
|
-
* called.
|
|
9204
|
-
*/
|
|
9205
|
-
removeAllListeners(ev) {
|
|
9206
|
-
const ret = super.removeAllListeners(ev);
|
|
9207
|
-
if (ev === "data" || ev === void 0) {
|
|
9208
|
-
this[DATALISTENERS2] = 0;
|
|
9209
|
-
if (!this[DISCARDED2] && !this[PIPES2].length) {
|
|
9210
|
-
this[FLOWING2] = false;
|
|
9211
|
-
}
|
|
9212
|
-
}
|
|
9213
|
-
return ret;
|
|
9214
|
-
}
|
|
9215
|
-
/**
|
|
9216
|
-
* true if the 'end' event has been emitted
|
|
9217
|
-
*/
|
|
9218
|
-
get emittedEnd() {
|
|
9219
|
-
return this[EMITTED_END2];
|
|
9220
|
-
}
|
|
9221
|
-
[MAYBE_EMIT_END2]() {
|
|
9222
|
-
if (!this[EMITTING_END2] && !this[EMITTED_END2] && !this[DESTROYED2] && this[BUFFER2].length === 0 && this[EOF2]) {
|
|
9223
|
-
this[EMITTING_END2] = true;
|
|
9224
|
-
this.emit("end");
|
|
9225
|
-
this.emit("prefinish");
|
|
9226
|
-
this.emit("finish");
|
|
9227
|
-
if (this[CLOSED2])
|
|
9228
|
-
this.emit("close");
|
|
9229
|
-
this[EMITTING_END2] = false;
|
|
9230
|
-
}
|
|
9231
|
-
}
|
|
9232
|
-
/**
|
|
9233
|
-
* Mostly identical to `EventEmitter.emit`, with the following
|
|
9234
|
-
* behavior differences to prevent data loss and unnecessary hangs:
|
|
9235
|
-
*
|
|
9236
|
-
* If the stream has been destroyed, and the event is something other
|
|
9237
|
-
* than 'close' or 'error', then `false` is returned and no handlers
|
|
9238
|
-
* are called.
|
|
9239
|
-
*
|
|
9240
|
-
* If the event is 'end', and has already been emitted, then the event
|
|
9241
|
-
* is ignored. If the stream is in a paused or non-flowing state, then
|
|
9242
|
-
* the event will be deferred until data flow resumes. If the stream is
|
|
9243
|
-
* async, then handlers will be called on the next tick rather than
|
|
9244
|
-
* immediately.
|
|
9245
|
-
*
|
|
9246
|
-
* If the event is 'close', and 'end' has not yet been emitted, then
|
|
9247
|
-
* the event will be deferred until after 'end' is emitted.
|
|
9248
|
-
*
|
|
9249
|
-
* If the event is 'error', and an AbortSignal was provided for the stream,
|
|
9250
|
-
* and there are no listeners, then the event is ignored, matching the
|
|
9251
|
-
* behavior of node core streams in the presense of an AbortSignal.
|
|
9252
|
-
*
|
|
9253
|
-
* If the event is 'finish' or 'prefinish', then all listeners will be
|
|
9254
|
-
* removed after emitting the event, to prevent double-firing.
|
|
9255
|
-
*/
|
|
9256
|
-
emit(ev, ...args) {
|
|
9257
|
-
const data = args[0];
|
|
9258
|
-
if (ev !== "error" && ev !== "close" && ev !== DESTROYED2 && this[DESTROYED2]) {
|
|
9259
|
-
return false;
|
|
9260
|
-
} else if (ev === "data") {
|
|
9261
|
-
return !this[OBJECTMODE2] && !data ? false : this[ASYNC2] ? (defer2(() => this[EMITDATA2](data)), true) : this[EMITDATA2](data);
|
|
9262
|
-
} else if (ev === "end") {
|
|
9263
|
-
return this[EMITEND3]();
|
|
9264
|
-
} else if (ev === "close") {
|
|
9265
|
-
this[CLOSED2] = true;
|
|
9266
|
-
if (!this[EMITTED_END2] && !this[DESTROYED2])
|
|
9267
|
-
return false;
|
|
9268
|
-
const ret2 = super.emit("close");
|
|
9269
|
-
this.removeAllListeners("close");
|
|
9270
|
-
return ret2;
|
|
9271
|
-
} else if (ev === "error") {
|
|
9272
|
-
this[EMITTED_ERROR2] = data;
|
|
9273
|
-
super.emit(ERROR2, data);
|
|
9274
|
-
const ret2 = !this[SIGNAL2] || this.listeners("error").length ? super.emit("error", data) : false;
|
|
9275
|
-
this[MAYBE_EMIT_END2]();
|
|
9276
|
-
return ret2;
|
|
9277
|
-
} else if (ev === "resume") {
|
|
9278
|
-
const ret2 = super.emit("resume");
|
|
9279
|
-
this[MAYBE_EMIT_END2]();
|
|
9280
|
-
return ret2;
|
|
9281
|
-
} else if (ev === "finish" || ev === "prefinish") {
|
|
9282
|
-
const ret2 = super.emit(ev);
|
|
9283
|
-
this.removeAllListeners(ev);
|
|
9284
|
-
return ret2;
|
|
9285
|
-
}
|
|
9286
|
-
const ret = super.emit(ev, ...args);
|
|
9287
|
-
this[MAYBE_EMIT_END2]();
|
|
9288
|
-
return ret;
|
|
9289
|
-
}
|
|
9290
|
-
[EMITDATA2](data) {
|
|
9291
|
-
for (const p of this[PIPES2]) {
|
|
9292
|
-
if (p.dest.write(data) === false)
|
|
9293
|
-
this.pause();
|
|
9294
|
-
}
|
|
9295
|
-
const ret = this[DISCARDED2] ? false : super.emit("data", data);
|
|
9296
|
-
this[MAYBE_EMIT_END2]();
|
|
9297
|
-
return ret;
|
|
9298
|
-
}
|
|
9299
|
-
[EMITEND3]() {
|
|
9300
|
-
if (this[EMITTED_END2])
|
|
9301
|
-
return false;
|
|
9302
|
-
this[EMITTED_END2] = true;
|
|
9303
|
-
this.readable = false;
|
|
9304
|
-
return this[ASYNC2] ? (defer2(() => this[EMITEND22]()), true) : this[EMITEND22]();
|
|
9305
|
-
}
|
|
9306
|
-
[EMITEND22]() {
|
|
9307
|
-
if (this[DECODER2]) {
|
|
9308
|
-
const data = this[DECODER2].end();
|
|
9309
|
-
if (data) {
|
|
9310
|
-
for (const p of this[PIPES2]) {
|
|
9311
|
-
p.dest.write(data);
|
|
9312
|
-
}
|
|
9313
|
-
if (!this[DISCARDED2])
|
|
9314
|
-
super.emit("data", data);
|
|
9315
|
-
}
|
|
9316
|
-
}
|
|
9317
|
-
for (const p of this[PIPES2]) {
|
|
9318
|
-
p.end();
|
|
9319
|
-
}
|
|
9320
|
-
const ret = super.emit("end");
|
|
9321
|
-
this.removeAllListeners("end");
|
|
9322
|
-
return ret;
|
|
9323
|
-
}
|
|
9324
|
-
/**
|
|
9325
|
-
* Return a Promise that resolves to an array of all emitted data once
|
|
9326
|
-
* the stream ends.
|
|
9327
|
-
*/
|
|
9328
|
-
async collect() {
|
|
9329
|
-
const buf = Object.assign([], {
|
|
9330
|
-
dataLength: 0
|
|
9331
|
-
});
|
|
9332
|
-
if (!this[OBJECTMODE2])
|
|
9333
|
-
buf.dataLength = 0;
|
|
9334
|
-
const p = this.promise();
|
|
9335
|
-
this.on("data", (c) => {
|
|
9336
|
-
buf.push(c);
|
|
9337
|
-
if (!this[OBJECTMODE2])
|
|
9338
|
-
buf.dataLength += c.length;
|
|
9339
|
-
});
|
|
9340
|
-
await p;
|
|
9341
|
-
return buf;
|
|
9342
|
-
}
|
|
9343
|
-
/**
|
|
9344
|
-
* Return a Promise that resolves to the concatenation of all emitted data
|
|
9345
|
-
* once the stream ends.
|
|
9346
|
-
*
|
|
9347
|
-
* Not allowed on objectMode streams.
|
|
9348
|
-
*/
|
|
9349
|
-
async concat() {
|
|
9350
|
-
if (this[OBJECTMODE2]) {
|
|
9351
|
-
throw new Error("cannot concat in objectMode");
|
|
9352
|
-
}
|
|
9353
|
-
const buf = await this.collect();
|
|
9354
|
-
return this[ENCODING2] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
9355
|
-
}
|
|
9356
|
-
/**
|
|
9357
|
-
* Return a void Promise that resolves once the stream ends.
|
|
9358
|
-
*/
|
|
9359
|
-
async promise() {
|
|
9360
|
-
return new Promise((resolve2, reject) => {
|
|
9361
|
-
this.on(DESTROYED2, () => reject(new Error("stream destroyed")));
|
|
9362
|
-
this.on("error", (er) => reject(er));
|
|
9363
|
-
this.on("end", () => resolve2());
|
|
9364
|
-
});
|
|
9365
|
-
}
|
|
9366
|
-
/**
|
|
9367
|
-
* Asynchronous `for await of` iteration.
|
|
9368
|
-
*
|
|
9369
|
-
* This will continue emitting all chunks until the stream terminates.
|
|
9370
|
-
*/
|
|
9371
|
-
[Symbol.asyncIterator]() {
|
|
9372
|
-
this[DISCARDED2] = false;
|
|
9373
|
-
let stopped = false;
|
|
9374
|
-
const stop = async () => {
|
|
9375
|
-
this.pause();
|
|
9376
|
-
stopped = true;
|
|
9377
|
-
return { value: void 0, done: true };
|
|
9378
|
-
};
|
|
9379
|
-
const next = () => {
|
|
9380
|
-
if (stopped)
|
|
9381
|
-
return stop();
|
|
9382
|
-
const res = this.read();
|
|
9383
|
-
if (res !== null)
|
|
9384
|
-
return Promise.resolve({ done: false, value: res });
|
|
9385
|
-
if (this[EOF2])
|
|
9386
|
-
return stop();
|
|
9387
|
-
let resolve2;
|
|
9388
|
-
let reject;
|
|
9389
|
-
const onerr = (er) => {
|
|
9390
|
-
this.off("data", ondata);
|
|
9391
|
-
this.off("end", onend);
|
|
9392
|
-
this.off(DESTROYED2, ondestroy);
|
|
9393
|
-
stop();
|
|
9394
|
-
reject(er);
|
|
9395
|
-
};
|
|
9396
|
-
const ondata = (value) => {
|
|
9397
|
-
this.off("error", onerr);
|
|
9398
|
-
this.off("end", onend);
|
|
9399
|
-
this.off(DESTROYED2, ondestroy);
|
|
9400
|
-
this.pause();
|
|
9401
|
-
resolve2({ value, done: !!this[EOF2] });
|
|
9402
|
-
};
|
|
9403
|
-
const onend = () => {
|
|
9404
|
-
this.off("error", onerr);
|
|
9405
|
-
this.off("data", ondata);
|
|
9406
|
-
this.off(DESTROYED2, ondestroy);
|
|
9407
|
-
stop();
|
|
9408
|
-
resolve2({ done: true, value: void 0 });
|
|
9409
|
-
};
|
|
9410
|
-
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
9411
|
-
return new Promise((res2, rej) => {
|
|
9412
|
-
reject = rej;
|
|
9413
|
-
resolve2 = res2;
|
|
9414
|
-
this.once(DESTROYED2, ondestroy);
|
|
9415
|
-
this.once("error", onerr);
|
|
9416
|
-
this.once("end", onend);
|
|
9417
|
-
this.once("data", ondata);
|
|
9418
|
-
});
|
|
9419
|
-
};
|
|
9420
|
-
return {
|
|
9421
|
-
next,
|
|
9422
|
-
throw: stop,
|
|
9423
|
-
return: stop,
|
|
9424
|
-
[Symbol.asyncIterator]() {
|
|
9425
|
-
return this;
|
|
9426
|
-
}
|
|
9427
|
-
};
|
|
9428
|
-
}
|
|
9429
|
-
/**
|
|
9430
|
-
* Synchronous `for of` iteration.
|
|
9431
|
-
*
|
|
9432
|
-
* The iteration will terminate when the internal buffer runs out, even
|
|
9433
|
-
* if the stream has not yet terminated.
|
|
9434
|
-
*/
|
|
9435
|
-
[Symbol.iterator]() {
|
|
9436
|
-
this[DISCARDED2] = false;
|
|
9437
|
-
let stopped = false;
|
|
9438
|
-
const stop = () => {
|
|
9439
|
-
this.pause();
|
|
9440
|
-
this.off(ERROR2, stop);
|
|
9441
|
-
this.off(DESTROYED2, stop);
|
|
9442
|
-
this.off("end", stop);
|
|
9443
|
-
stopped = true;
|
|
9444
|
-
return { done: true, value: void 0 };
|
|
9445
|
-
};
|
|
9446
|
-
const next = () => {
|
|
9447
|
-
if (stopped)
|
|
9448
|
-
return stop();
|
|
9449
|
-
const value = this.read();
|
|
9450
|
-
return value === null ? stop() : { done: false, value };
|
|
9451
|
-
};
|
|
9452
|
-
this.once("end", stop);
|
|
9453
|
-
this.once(ERROR2, stop);
|
|
9454
|
-
this.once(DESTROYED2, stop);
|
|
9455
|
-
return {
|
|
9456
|
-
next,
|
|
9457
|
-
throw: stop,
|
|
9458
|
-
return: stop,
|
|
9459
|
-
[Symbol.iterator]() {
|
|
9460
|
-
return this;
|
|
9461
|
-
}
|
|
9462
|
-
};
|
|
9463
|
-
}
|
|
9464
|
-
/**
|
|
9465
|
-
* Destroy a stream, preventing it from being used for any further purpose.
|
|
9466
|
-
*
|
|
9467
|
-
* If the stream has a `close()` method, then it will be called on
|
|
9468
|
-
* destruction.
|
|
9469
|
-
*
|
|
9470
|
-
* After destruction, any attempt to write data, read data, or emit most
|
|
9471
|
-
* events will be ignored.
|
|
9472
|
-
*
|
|
9473
|
-
* If an error argument is provided, then it will be emitted in an
|
|
9474
|
-
* 'error' event.
|
|
9475
|
-
*/
|
|
9476
|
-
destroy(er) {
|
|
9477
|
-
if (this[DESTROYED2]) {
|
|
9478
|
-
if (er)
|
|
9479
|
-
this.emit("error", er);
|
|
9480
|
-
else
|
|
9481
|
-
this.emit(DESTROYED2);
|
|
9482
|
-
return this;
|
|
9483
|
-
}
|
|
9484
|
-
this[DESTROYED2] = true;
|
|
9485
|
-
this[DISCARDED2] = true;
|
|
9486
|
-
this[BUFFER2].length = 0;
|
|
9487
|
-
this[BUFFERLENGTH2] = 0;
|
|
9488
|
-
const wc = this;
|
|
9489
|
-
if (typeof wc.close === "function" && !this[CLOSED2])
|
|
9490
|
-
wc.close();
|
|
9491
|
-
if (er)
|
|
9492
|
-
this.emit("error", er);
|
|
9493
|
-
else
|
|
9494
|
-
this.emit(DESTROYED2);
|
|
9495
|
-
return this;
|
|
9496
|
-
}
|
|
9497
|
-
/**
|
|
9498
|
-
* Alias for {@link isStream}
|
|
9499
|
-
*
|
|
9500
|
-
* Former export location, maintained for backwards compatibility.
|
|
9501
|
-
*
|
|
9502
|
-
* @deprecated
|
|
9503
|
-
*/
|
|
9504
|
-
static get isStream() {
|
|
9505
|
-
return isStream2;
|
|
9506
|
-
}
|
|
9507
|
-
};
|
|
9508
|
-
|
|
9509
|
-
// node_modules/minizlib/dist/esm/index.js
|
|
9510
|
-
import realZlib2 from "zlib";
|
|
7942
|
+
import realZlib2 from "zlib";
|
|
9511
7943
|
|
|
9512
7944
|
// node_modules/minizlib/dist/esm/constants.js
|
|
9513
7945
|
import realZlib from "zlib";
|
|
@@ -9642,7 +8074,7 @@ var ZlibError = class extends Error {
|
|
|
9642
8074
|
};
|
|
9643
8075
|
var _flushFlag = Symbol("flushFlag");
|
|
9644
8076
|
var _sawError, _ended2, _flushFlag2, _finishFlushFlag, _fullFlushFlag, _handle, _onError;
|
|
9645
|
-
var ZlibBase = class extends
|
|
8077
|
+
var ZlibBase = class extends Minipass {
|
|
9646
8078
|
/* c8 ignore stop */
|
|
9647
8079
|
constructor(opts, mode) {
|
|
9648
8080
|
var _a;
|
|
@@ -9651,11 +8083,11 @@ var ZlibBase = class extends Minipass2 {
|
|
|
9651
8083
|
super(opts);
|
|
9652
8084
|
__privateAdd(this, _sawError, false);
|
|
9653
8085
|
__privateAdd(this, _ended2, false);
|
|
9654
|
-
__privateAdd(this, _flushFlag2
|
|
9655
|
-
__privateAdd(this, _finishFlushFlag
|
|
9656
|
-
__privateAdd(this, _fullFlushFlag
|
|
9657
|
-
__privateAdd(this, _handle
|
|
9658
|
-
__privateAdd(this, _onError
|
|
8086
|
+
__privateAdd(this, _flushFlag2);
|
|
8087
|
+
__privateAdd(this, _finishFlushFlag);
|
|
8088
|
+
__privateAdd(this, _fullFlushFlag);
|
|
8089
|
+
__privateAdd(this, _handle);
|
|
8090
|
+
__privateAdd(this, _onError);
|
|
9659
8091
|
__privateSet(this, _flushFlag2, opts.flush ?? 0);
|
|
9660
8092
|
__privateSet(this, _finishFlushFlag, opts.finishFlush ?? 0);
|
|
9661
8093
|
__privateSet(this, _fullFlushFlag, opts.fullFlushFlag ?? 0);
|
|
@@ -9799,8 +8231,8 @@ var Zlib = class extends ZlibBase {
|
|
|
9799
8231
|
opts.finishFlush = opts.finishFlush || constants.Z_FINISH;
|
|
9800
8232
|
opts.fullFlushFlag = constants.Z_FULL_FLUSH;
|
|
9801
8233
|
super(opts, mode);
|
|
9802
|
-
__privateAdd(this, _level
|
|
9803
|
-
__privateAdd(this, _strategy
|
|
8234
|
+
__privateAdd(this, _level);
|
|
8235
|
+
__privateAdd(this, _strategy);
|
|
9804
8236
|
__privateSet(this, _level, opts.level);
|
|
9805
8237
|
__privateSet(this, _strategy, opts.strategy);
|
|
9806
8238
|
}
|
|
@@ -9842,7 +8274,7 @@ var _portable;
|
|
|
9842
8274
|
var Gzip = class extends Zlib {
|
|
9843
8275
|
constructor(opts) {
|
|
9844
8276
|
super(opts, "Gzip");
|
|
9845
|
-
__privateAdd(this, _portable
|
|
8277
|
+
__privateAdd(this, _portable);
|
|
9846
8278
|
__privateSet(this, _portable, opts && !!opts.portable);
|
|
9847
8279
|
}
|
|
9848
8280
|
[_superWrite](data) {
|
|
@@ -10046,1258 +8478,657 @@ var Yallist = class _Yallist {
|
|
|
10046
8478
|
}
|
|
10047
8479
|
return res;
|
|
10048
8480
|
}
|
|
10049
|
-
mapReverse(fn, thisp) {
|
|
10050
|
-
thisp = thisp || this;
|
|
10051
|
-
var res = new _Yallist();
|
|
10052
|
-
for (let walker = this.tail; !!walker; ) {
|
|
10053
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
10054
|
-
walker = walker.prev;
|
|
10055
|
-
}
|
|
10056
|
-
return res;
|
|
10057
|
-
}
|
|
10058
|
-
reduce(fn, initial) {
|
|
10059
|
-
let acc;
|
|
10060
|
-
let walker = this.head;
|
|
10061
|
-
if (arguments.length > 1) {
|
|
10062
|
-
acc = initial;
|
|
10063
|
-
} else if (this.head) {
|
|
10064
|
-
walker = this.head.next;
|
|
10065
|
-
acc = this.head.value;
|
|
10066
|
-
} else {
|
|
10067
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
10068
|
-
}
|
|
10069
|
-
for (var i = 0; !!walker; i++) {
|
|
10070
|
-
acc = fn(acc, walker.value, i);
|
|
10071
|
-
walker = walker.next;
|
|
10072
|
-
}
|
|
10073
|
-
return acc;
|
|
10074
|
-
}
|
|
10075
|
-
reduceReverse(fn, initial) {
|
|
10076
|
-
let acc;
|
|
10077
|
-
let walker = this.tail;
|
|
10078
|
-
if (arguments.length > 1) {
|
|
10079
|
-
acc = initial;
|
|
10080
|
-
} else if (this.tail) {
|
|
10081
|
-
walker = this.tail.prev;
|
|
10082
|
-
acc = this.tail.value;
|
|
10083
|
-
} else {
|
|
10084
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
10085
|
-
}
|
|
10086
|
-
for (let i = this.length - 1; !!walker; i--) {
|
|
10087
|
-
acc = fn(acc, walker.value, i);
|
|
10088
|
-
walker = walker.prev;
|
|
10089
|
-
}
|
|
10090
|
-
return acc;
|
|
10091
|
-
}
|
|
10092
|
-
toArray() {
|
|
10093
|
-
const arr = new Array(this.length);
|
|
10094
|
-
for (let i = 0, walker = this.head; !!walker; i++) {
|
|
10095
|
-
arr[i] = walker.value;
|
|
10096
|
-
walker = walker.next;
|
|
10097
|
-
}
|
|
10098
|
-
return arr;
|
|
10099
|
-
}
|
|
10100
|
-
toArrayReverse() {
|
|
10101
|
-
const arr = new Array(this.length);
|
|
10102
|
-
for (let i = 0, walker = this.tail; !!walker; i++) {
|
|
10103
|
-
arr[i] = walker.value;
|
|
10104
|
-
walker = walker.prev;
|
|
10105
|
-
}
|
|
10106
|
-
return arr;
|
|
10107
|
-
}
|
|
10108
|
-
slice(from = 0, to = this.length) {
|
|
10109
|
-
if (to < 0) {
|
|
10110
|
-
to += this.length;
|
|
10111
|
-
}
|
|
10112
|
-
if (from < 0) {
|
|
10113
|
-
from += this.length;
|
|
10114
|
-
}
|
|
10115
|
-
const ret = new _Yallist();
|
|
10116
|
-
if (to < from || to < 0) {
|
|
10117
|
-
return ret;
|
|
10118
|
-
}
|
|
10119
|
-
if (from < 0) {
|
|
10120
|
-
from = 0;
|
|
10121
|
-
}
|
|
10122
|
-
if (to > this.length) {
|
|
10123
|
-
to = this.length;
|
|
10124
|
-
}
|
|
10125
|
-
let walker = this.head;
|
|
10126
|
-
let i = 0;
|
|
10127
|
-
for (i = 0; !!walker && i < from; i++) {
|
|
10128
|
-
walker = walker.next;
|
|
10129
|
-
}
|
|
10130
|
-
for (; !!walker && i < to; i++, walker = walker.next) {
|
|
10131
|
-
ret.push(walker.value);
|
|
10132
|
-
}
|
|
10133
|
-
return ret;
|
|
10134
|
-
}
|
|
10135
|
-
sliceReverse(from = 0, to = this.length) {
|
|
10136
|
-
if (to < 0) {
|
|
10137
|
-
to += this.length;
|
|
10138
|
-
}
|
|
10139
|
-
if (from < 0) {
|
|
10140
|
-
from += this.length;
|
|
10141
|
-
}
|
|
10142
|
-
const ret = new _Yallist();
|
|
10143
|
-
if (to < from || to < 0) {
|
|
10144
|
-
return ret;
|
|
10145
|
-
}
|
|
10146
|
-
if (from < 0) {
|
|
10147
|
-
from = 0;
|
|
10148
|
-
}
|
|
10149
|
-
if (to > this.length) {
|
|
10150
|
-
to = this.length;
|
|
10151
|
-
}
|
|
10152
|
-
let i = this.length;
|
|
10153
|
-
let walker = this.tail;
|
|
10154
|
-
for (; !!walker && i > to; i--) {
|
|
10155
|
-
walker = walker.prev;
|
|
10156
|
-
}
|
|
10157
|
-
for (; !!walker && i > from; i--, walker = walker.prev) {
|
|
10158
|
-
ret.push(walker.value);
|
|
10159
|
-
}
|
|
10160
|
-
return ret;
|
|
10161
|
-
}
|
|
10162
|
-
splice(start, deleteCount = 0, ...nodes) {
|
|
10163
|
-
if (start > this.length) {
|
|
10164
|
-
start = this.length - 1;
|
|
10165
|
-
}
|
|
10166
|
-
if (start < 0) {
|
|
10167
|
-
start = this.length + start;
|
|
10168
|
-
}
|
|
10169
|
-
let walker = this.head;
|
|
10170
|
-
for (let i = 0; !!walker && i < start; i++) {
|
|
10171
|
-
walker = walker.next;
|
|
10172
|
-
}
|
|
10173
|
-
const ret = [];
|
|
10174
|
-
for (let i = 0; !!walker && i < deleteCount; i++) {
|
|
10175
|
-
ret.push(walker.value);
|
|
10176
|
-
walker = this.removeNode(walker);
|
|
10177
|
-
}
|
|
10178
|
-
if (!walker) {
|
|
10179
|
-
walker = this.tail;
|
|
10180
|
-
} else if (walker !== this.tail) {
|
|
10181
|
-
walker = walker.prev;
|
|
10182
|
-
}
|
|
10183
|
-
for (const v of nodes) {
|
|
10184
|
-
walker = insertAfter(this, walker, v);
|
|
10185
|
-
}
|
|
10186
|
-
return ret;
|
|
10187
|
-
}
|
|
10188
|
-
reverse() {
|
|
10189
|
-
const head = this.head;
|
|
10190
|
-
const tail = this.tail;
|
|
10191
|
-
for (let walker = head; !!walker; walker = walker.prev) {
|
|
10192
|
-
const p = walker.prev;
|
|
10193
|
-
walker.prev = walker.next;
|
|
10194
|
-
walker.next = p;
|
|
10195
|
-
}
|
|
10196
|
-
this.head = tail;
|
|
10197
|
-
this.tail = head;
|
|
10198
|
-
return this;
|
|
10199
|
-
}
|
|
10200
|
-
};
|
|
10201
|
-
function insertAfter(self, node, value) {
|
|
10202
|
-
const prev = node;
|
|
10203
|
-
const next = node ? node.next : self.head;
|
|
10204
|
-
const inserted = new Node2(value, prev, next, self);
|
|
10205
|
-
if (inserted.next === void 0) {
|
|
10206
|
-
self.tail = inserted;
|
|
10207
|
-
}
|
|
10208
|
-
if (inserted.prev === void 0) {
|
|
10209
|
-
self.head = inserted;
|
|
10210
|
-
}
|
|
10211
|
-
self.length++;
|
|
10212
|
-
return inserted;
|
|
10213
|
-
}
|
|
10214
|
-
function push(self, item) {
|
|
10215
|
-
self.tail = new Node2(item, self.tail, void 0, self);
|
|
10216
|
-
if (!self.head) {
|
|
10217
|
-
self.head = self.tail;
|
|
10218
|
-
}
|
|
10219
|
-
self.length++;
|
|
10220
|
-
}
|
|
10221
|
-
function unshift(self, item) {
|
|
10222
|
-
self.head = new Node2(item, void 0, self.head, self);
|
|
10223
|
-
if (!self.tail) {
|
|
10224
|
-
self.tail = self.head;
|
|
10225
|
-
}
|
|
10226
|
-
self.length++;
|
|
10227
|
-
}
|
|
10228
|
-
var Node2 = class {
|
|
10229
|
-
list;
|
|
10230
|
-
next;
|
|
10231
|
-
prev;
|
|
10232
|
-
value;
|
|
10233
|
-
constructor(value, prev, next, list2) {
|
|
10234
|
-
this.list = list2;
|
|
10235
|
-
this.value = value;
|
|
10236
|
-
if (prev) {
|
|
10237
|
-
prev.next = this;
|
|
10238
|
-
this.prev = prev;
|
|
10239
|
-
} else {
|
|
10240
|
-
this.prev = void 0;
|
|
10241
|
-
}
|
|
10242
|
-
if (next) {
|
|
10243
|
-
next.prev = this;
|
|
10244
|
-
this.next = next;
|
|
10245
|
-
} else {
|
|
10246
|
-
this.next = void 0;
|
|
10247
|
-
}
|
|
10248
|
-
}
|
|
10249
|
-
};
|
|
10250
|
-
|
|
10251
|
-
// node_modules/tar/dist/esm/header.js
|
|
10252
|
-
import { posix as pathModule } from "path";
|
|
10253
|
-
|
|
10254
|
-
// node_modules/tar/dist/esm/large-numbers.js
|
|
10255
|
-
var encode = (num, buf) => {
|
|
10256
|
-
if (!Number.isSafeInteger(num)) {
|
|
10257
|
-
throw Error("cannot encode number outside of javascript safe integer range");
|
|
10258
|
-
} else if (num < 0) {
|
|
10259
|
-
encodeNegative(num, buf);
|
|
10260
|
-
} else {
|
|
10261
|
-
encodePositive(num, buf);
|
|
10262
|
-
}
|
|
10263
|
-
return buf;
|
|
10264
|
-
};
|
|
10265
|
-
var encodePositive = (num, buf) => {
|
|
10266
|
-
buf[0] = 128;
|
|
10267
|
-
for (var i = buf.length; i > 1; i--) {
|
|
10268
|
-
buf[i - 1] = num & 255;
|
|
10269
|
-
num = Math.floor(num / 256);
|
|
8481
|
+
mapReverse(fn, thisp) {
|
|
8482
|
+
thisp = thisp || this;
|
|
8483
|
+
var res = new _Yallist();
|
|
8484
|
+
for (let walker = this.tail; !!walker; ) {
|
|
8485
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
8486
|
+
walker = walker.prev;
|
|
8487
|
+
}
|
|
8488
|
+
return res;
|
|
10270
8489
|
}
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
if (flipped) {
|
|
10280
|
-
buf[i - 1] = onesComp(byte);
|
|
10281
|
-
} else if (byte === 0) {
|
|
10282
|
-
buf[i - 1] = 0;
|
|
8490
|
+
reduce(fn, initial) {
|
|
8491
|
+
let acc;
|
|
8492
|
+
let walker = this.head;
|
|
8493
|
+
if (arguments.length > 1) {
|
|
8494
|
+
acc = initial;
|
|
8495
|
+
} else if (this.head) {
|
|
8496
|
+
walker = this.head.next;
|
|
8497
|
+
acc = this.head.value;
|
|
10283
8498
|
} else {
|
|
10284
|
-
|
|
10285
|
-
buf[i - 1] = twosComp(byte);
|
|
8499
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
10286
8500
|
}
|
|
8501
|
+
for (var i = 0; !!walker; i++) {
|
|
8502
|
+
acc = fn(acc, walker.value, i);
|
|
8503
|
+
walker = walker.next;
|
|
8504
|
+
}
|
|
8505
|
+
return acc;
|
|
10287
8506
|
}
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
throw Error("parsed number outside of javascript safe integer range");
|
|
10297
|
-
}
|
|
10298
|
-
return value;
|
|
10299
|
-
};
|
|
10300
|
-
var twos = (buf) => {
|
|
10301
|
-
var len = buf.length;
|
|
10302
|
-
var sum = 0;
|
|
10303
|
-
var flipped = false;
|
|
10304
|
-
for (var i = len - 1; i > -1; i--) {
|
|
10305
|
-
var byte = Number(buf[i]);
|
|
10306
|
-
var f;
|
|
10307
|
-
if (flipped) {
|
|
10308
|
-
f = onesComp(byte);
|
|
10309
|
-
} else if (byte === 0) {
|
|
10310
|
-
f = byte;
|
|
8507
|
+
reduceReverse(fn, initial) {
|
|
8508
|
+
let acc;
|
|
8509
|
+
let walker = this.tail;
|
|
8510
|
+
if (arguments.length > 1) {
|
|
8511
|
+
acc = initial;
|
|
8512
|
+
} else if (this.tail) {
|
|
8513
|
+
walker = this.tail.prev;
|
|
8514
|
+
acc = this.tail.value;
|
|
10311
8515
|
} else {
|
|
10312
|
-
|
|
10313
|
-
f = twosComp(byte);
|
|
8516
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
10314
8517
|
}
|
|
10315
|
-
|
|
10316
|
-
|
|
8518
|
+
for (let i = this.length - 1; !!walker; i--) {
|
|
8519
|
+
acc = fn(acc, walker.value, i);
|
|
8520
|
+
walker = walker.prev;
|
|
10317
8521
|
}
|
|
8522
|
+
return acc;
|
|
10318
8523
|
}
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
for (var i = len - 1; i > -1; i--) {
|
|
10325
|
-
var byte = Number(buf[i]);
|
|
10326
|
-
if (byte !== 0) {
|
|
10327
|
-
sum += byte * Math.pow(256, len - i - 1);
|
|
8524
|
+
toArray() {
|
|
8525
|
+
const arr = new Array(this.length);
|
|
8526
|
+
for (let i = 0, walker = this.head; !!walker; i++) {
|
|
8527
|
+
arr[i] = walker.value;
|
|
8528
|
+
walker = walker.next;
|
|
10328
8529
|
}
|
|
8530
|
+
return arr;
|
|
10329
8531
|
}
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
// node_modules/tar/dist/esm/types.js
|
|
10336
|
-
var isCode = (c) => name.has(c);
|
|
10337
|
-
var name = /* @__PURE__ */ new Map([
|
|
10338
|
-
["0", "File"],
|
|
10339
|
-
// same as File
|
|
10340
|
-
["", "OldFile"],
|
|
10341
|
-
["1", "Link"],
|
|
10342
|
-
["2", "SymbolicLink"],
|
|
10343
|
-
// Devices and FIFOs aren't fully supported
|
|
10344
|
-
// they are parsed, but skipped when unpacking
|
|
10345
|
-
["3", "CharacterDevice"],
|
|
10346
|
-
["4", "BlockDevice"],
|
|
10347
|
-
["5", "Directory"],
|
|
10348
|
-
["6", "FIFO"],
|
|
10349
|
-
// same as File
|
|
10350
|
-
["7", "ContiguousFile"],
|
|
10351
|
-
// pax headers
|
|
10352
|
-
["g", "GlobalExtendedHeader"],
|
|
10353
|
-
["x", "ExtendedHeader"],
|
|
10354
|
-
// vendor-specific stuff
|
|
10355
|
-
// skip
|
|
10356
|
-
["A", "SolarisACL"],
|
|
10357
|
-
// like 5, but with data, which should be skipped
|
|
10358
|
-
["D", "GNUDumpDir"],
|
|
10359
|
-
// metadata only, skip
|
|
10360
|
-
["I", "Inode"],
|
|
10361
|
-
// data = link path of next file
|
|
10362
|
-
["K", "NextFileHasLongLinkpath"],
|
|
10363
|
-
// data = path of next file
|
|
10364
|
-
["L", "NextFileHasLongPath"],
|
|
10365
|
-
// skip
|
|
10366
|
-
["M", "ContinuationFile"],
|
|
10367
|
-
// like L
|
|
10368
|
-
["N", "OldGnuLongPath"],
|
|
10369
|
-
// skip
|
|
10370
|
-
["S", "SparseFile"],
|
|
10371
|
-
// skip
|
|
10372
|
-
["V", "TapeVolumeHeader"],
|
|
10373
|
-
// like x
|
|
10374
|
-
["X", "OldExtendedHeader"]
|
|
10375
|
-
]);
|
|
10376
|
-
var code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]]));
|
|
10377
|
-
|
|
10378
|
-
// node_modules/tar/dist/esm/header.js
|
|
10379
|
-
var _type, _slurp, slurp_fn;
|
|
10380
|
-
var Header = class {
|
|
10381
|
-
constructor(data, off = 0, ex, gex) {
|
|
10382
|
-
__privateAdd(this, _slurp);
|
|
10383
|
-
__publicField(this, "cksumValid", false);
|
|
10384
|
-
__publicField(this, "needPax", false);
|
|
10385
|
-
__publicField(this, "nullBlock", false);
|
|
10386
|
-
__publicField(this, "block");
|
|
10387
|
-
__publicField(this, "path");
|
|
10388
|
-
__publicField(this, "mode");
|
|
10389
|
-
__publicField(this, "uid");
|
|
10390
|
-
__publicField(this, "gid");
|
|
10391
|
-
__publicField(this, "size");
|
|
10392
|
-
__publicField(this, "cksum");
|
|
10393
|
-
__privateAdd(this, _type, "Unsupported");
|
|
10394
|
-
__publicField(this, "linkpath");
|
|
10395
|
-
__publicField(this, "uname");
|
|
10396
|
-
__publicField(this, "gname");
|
|
10397
|
-
__publicField(this, "devmaj", 0);
|
|
10398
|
-
__publicField(this, "devmin", 0);
|
|
10399
|
-
__publicField(this, "atime");
|
|
10400
|
-
__publicField(this, "ctime");
|
|
10401
|
-
__publicField(this, "mtime");
|
|
10402
|
-
__publicField(this, "charset");
|
|
10403
|
-
__publicField(this, "comment");
|
|
10404
|
-
if (Buffer.isBuffer(data)) {
|
|
10405
|
-
this.decode(data, off || 0, ex, gex);
|
|
10406
|
-
} else if (data) {
|
|
10407
|
-
__privateMethod(this, _slurp, slurp_fn).call(this, data);
|
|
8532
|
+
toArrayReverse() {
|
|
8533
|
+
const arr = new Array(this.length);
|
|
8534
|
+
for (let i = 0, walker = this.tail; !!walker; i++) {
|
|
8535
|
+
arr[i] = walker.value;
|
|
8536
|
+
walker = walker.prev;
|
|
10408
8537
|
}
|
|
8538
|
+
return arr;
|
|
10409
8539
|
}
|
|
10410
|
-
|
|
10411
|
-
if (
|
|
10412
|
-
|
|
8540
|
+
slice(from = 0, to = this.length) {
|
|
8541
|
+
if (to < 0) {
|
|
8542
|
+
to += this.length;
|
|
10413
8543
|
}
|
|
10414
|
-
if (
|
|
10415
|
-
|
|
8544
|
+
if (from < 0) {
|
|
8545
|
+
from += this.length;
|
|
10416
8546
|
}
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
this.gid = decNumber(buf, off + 116, 8);
|
|
10421
|
-
this.size = decNumber(buf, off + 124, 12);
|
|
10422
|
-
this.mtime = decDate(buf, off + 136, 12);
|
|
10423
|
-
this.cksum = decNumber(buf, off + 148, 12);
|
|
10424
|
-
if (gex)
|
|
10425
|
-
__privateMethod(this, _slurp, slurp_fn).call(this, gex, true);
|
|
10426
|
-
if (ex)
|
|
10427
|
-
__privateMethod(this, _slurp, slurp_fn).call(this, ex);
|
|
10428
|
-
const t = decString(buf, off + 156, 1);
|
|
10429
|
-
if (isCode(t)) {
|
|
10430
|
-
__privateSet(this, _type, t || "0");
|
|
8547
|
+
const ret = new _Yallist();
|
|
8548
|
+
if (to < from || to < 0) {
|
|
8549
|
+
return ret;
|
|
10431
8550
|
}
|
|
10432
|
-
if (
|
|
10433
|
-
|
|
8551
|
+
if (from < 0) {
|
|
8552
|
+
from = 0;
|
|
10434
8553
|
}
|
|
10435
|
-
if (
|
|
10436
|
-
|
|
8554
|
+
if (to > this.length) {
|
|
8555
|
+
to = this.length;
|
|
10437
8556
|
}
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
this.devmaj = decNumber(buf, off + 329, 8) ?? 0;
|
|
10443
|
-
this.devmin = decNumber(buf, off + 337, 8) ?? 0;
|
|
10444
|
-
if (buf[off + 475] !== 0) {
|
|
10445
|
-
const prefix2 = decString(buf, off + 345, 155);
|
|
10446
|
-
this.path = prefix2 + "/" + this.path;
|
|
10447
|
-
} else {
|
|
10448
|
-
const prefix2 = decString(buf, off + 345, 130);
|
|
10449
|
-
if (prefix2) {
|
|
10450
|
-
this.path = prefix2 + "/" + this.path;
|
|
10451
|
-
}
|
|
10452
|
-
this.atime = decDate(buf, off + 476, 12);
|
|
10453
|
-
this.ctime = decDate(buf, off + 488, 12);
|
|
10454
|
-
}
|
|
8557
|
+
let walker = this.head;
|
|
8558
|
+
let i = 0;
|
|
8559
|
+
for (i = 0; !!walker && i < from; i++) {
|
|
8560
|
+
walker = walker.next;
|
|
10455
8561
|
}
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
8562
|
+
for (; !!walker && i < to; i++, walker = walker.next) {
|
|
8563
|
+
ret.push(walker.value);
|
|
8564
|
+
}
|
|
8565
|
+
return ret;
|
|
8566
|
+
}
|
|
8567
|
+
sliceReverse(from = 0, to = this.length) {
|
|
8568
|
+
if (to < 0) {
|
|
8569
|
+
to += this.length;
|
|
8570
|
+
}
|
|
8571
|
+
if (from < 0) {
|
|
8572
|
+
from += this.length;
|
|
8573
|
+
}
|
|
8574
|
+
const ret = new _Yallist();
|
|
8575
|
+
if (to < from || to < 0) {
|
|
8576
|
+
return ret;
|
|
8577
|
+
}
|
|
8578
|
+
if (from < 0) {
|
|
8579
|
+
from = 0;
|
|
8580
|
+
}
|
|
8581
|
+
if (to > this.length) {
|
|
8582
|
+
to = this.length;
|
|
10459
8583
|
}
|
|
10460
|
-
|
|
10461
|
-
|
|
8584
|
+
let i = this.length;
|
|
8585
|
+
let walker = this.tail;
|
|
8586
|
+
for (; !!walker && i > to; i--) {
|
|
8587
|
+
walker = walker.prev;
|
|
10462
8588
|
}
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
this.nullBlock = true;
|
|
8589
|
+
for (; !!walker && i > from; i--, walker = walker.prev) {
|
|
8590
|
+
ret.push(walker.value);
|
|
10466
8591
|
}
|
|
8592
|
+
return ret;
|
|
10467
8593
|
}
|
|
10468
|
-
|
|
10469
|
-
if (
|
|
10470
|
-
|
|
10471
|
-
}
|
|
10472
|
-
if (__privateGet(this, _type) === "Unsupported") {
|
|
10473
|
-
__privateSet(this, _type, "0");
|
|
8594
|
+
splice(start, deleteCount = 0, ...nodes) {
|
|
8595
|
+
if (start > this.length) {
|
|
8596
|
+
start = this.length - 1;
|
|
10474
8597
|
}
|
|
10475
|
-
if (
|
|
10476
|
-
|
|
8598
|
+
if (start < 0) {
|
|
8599
|
+
start = this.length + start;
|
|
10477
8600
|
}
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
const prefix2 = split[1];
|
|
10482
|
-
this.needPax = !!split[2];
|
|
10483
|
-
this.needPax = encString(buf, off, 100, path13) || this.needPax;
|
|
10484
|
-
this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
|
|
10485
|
-
this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
|
|
10486
|
-
this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
|
|
10487
|
-
this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
|
|
10488
|
-
this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
|
|
10489
|
-
buf[off + 156] = __privateGet(this, _type).charCodeAt(0);
|
|
10490
|
-
this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax;
|
|
10491
|
-
buf.write("ustar\x0000", off + 257, 8);
|
|
10492
|
-
this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax;
|
|
10493
|
-
this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax;
|
|
10494
|
-
this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
|
|
10495
|
-
this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
|
|
10496
|
-
this.needPax = encString(buf, off + 345, prefixSize, prefix2) || this.needPax;
|
|
10497
|
-
if (buf[off + 475] !== 0) {
|
|
10498
|
-
this.needPax = encString(buf, off + 345, 155, prefix2) || this.needPax;
|
|
10499
|
-
} else {
|
|
10500
|
-
this.needPax = encString(buf, off + 345, 130, prefix2) || this.needPax;
|
|
10501
|
-
this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax;
|
|
10502
|
-
this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax;
|
|
8601
|
+
let walker = this.head;
|
|
8602
|
+
for (let i = 0; !!walker && i < start; i++) {
|
|
8603
|
+
walker = walker.next;
|
|
10503
8604
|
}
|
|
10504
|
-
|
|
10505
|
-
for (let i =
|
|
10506
|
-
|
|
8605
|
+
const ret = [];
|
|
8606
|
+
for (let i = 0; !!walker && i < deleteCount; i++) {
|
|
8607
|
+
ret.push(walker.value);
|
|
8608
|
+
walker = this.removeNode(walker);
|
|
10507
8609
|
}
|
|
10508
|
-
|
|
10509
|
-
|
|
8610
|
+
if (!walker) {
|
|
8611
|
+
walker = this.tail;
|
|
8612
|
+
} else if (walker !== this.tail) {
|
|
8613
|
+
walker = walker.prev;
|
|
10510
8614
|
}
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
this.cksumValid = true;
|
|
10514
|
-
return this.needPax;
|
|
10515
|
-
}
|
|
10516
|
-
get type() {
|
|
10517
|
-
return __privateGet(this, _type) === "Unsupported" ? __privateGet(this, _type) : name.get(__privateGet(this, _type));
|
|
10518
|
-
}
|
|
10519
|
-
get typeKey() {
|
|
10520
|
-
return __privateGet(this, _type);
|
|
10521
|
-
}
|
|
10522
|
-
set type(type) {
|
|
10523
|
-
const c = String(code.get(type));
|
|
10524
|
-
if (isCode(c) || c === "Unsupported") {
|
|
10525
|
-
__privateSet(this, _type, c);
|
|
10526
|
-
} else if (isCode(type)) {
|
|
10527
|
-
__privateSet(this, _type, type);
|
|
10528
|
-
} else {
|
|
10529
|
-
throw new TypeError("invalid entry type: " + type);
|
|
8615
|
+
for (const v of nodes) {
|
|
8616
|
+
walker = insertAfter(this, walker, v);
|
|
10530
8617
|
}
|
|
8618
|
+
return ret;
|
|
10531
8619
|
}
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
};
|
|
10540
|
-
var splitPrefix = (p, prefixSize) => {
|
|
10541
|
-
const pathSize = 100;
|
|
10542
|
-
let pp = p;
|
|
10543
|
-
let prefix2 = "";
|
|
10544
|
-
let ret = void 0;
|
|
10545
|
-
const root = pathModule.parse(p).root || ".";
|
|
10546
|
-
if (Buffer.byteLength(pp) < pathSize) {
|
|
10547
|
-
ret = [pp, prefix2, false];
|
|
10548
|
-
} else {
|
|
10549
|
-
prefix2 = pathModule.dirname(pp);
|
|
10550
|
-
pp = pathModule.basename(pp);
|
|
10551
|
-
do {
|
|
10552
|
-
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix2) <= prefixSize) {
|
|
10553
|
-
ret = [pp, prefix2, false];
|
|
10554
|
-
} else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix2) <= prefixSize) {
|
|
10555
|
-
ret = [pp.slice(0, pathSize - 1), prefix2, true];
|
|
10556
|
-
} else {
|
|
10557
|
-
pp = pathModule.join(pathModule.basename(prefix2), pp);
|
|
10558
|
-
prefix2 = pathModule.dirname(prefix2);
|
|
10559
|
-
}
|
|
10560
|
-
} while (prefix2 !== root && ret === void 0);
|
|
10561
|
-
if (!ret) {
|
|
10562
|
-
ret = [p.slice(0, pathSize - 1), "", true];
|
|
8620
|
+
reverse() {
|
|
8621
|
+
const head = this.head;
|
|
8622
|
+
const tail = this.tail;
|
|
8623
|
+
for (let walker = head; !!walker; walker = walker.prev) {
|
|
8624
|
+
const p = walker.prev;
|
|
8625
|
+
walker.prev = walker.next;
|
|
8626
|
+
walker.next = p;
|
|
10563
8627
|
}
|
|
8628
|
+
this.head = tail;
|
|
8629
|
+
this.tail = head;
|
|
8630
|
+
return this;
|
|
10564
8631
|
}
|
|
10565
|
-
return ret;
|
|
10566
|
-
};
|
|
10567
|
-
var decString = (buf, off, size) => buf.subarray(off, off + size).toString("utf8").replace(/\0.*/, "");
|
|
10568
|
-
var decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
|
|
10569
|
-
var numToDate = (num) => num === void 0 ? void 0 : new Date(num * 1e3);
|
|
10570
|
-
var decNumber = (buf, off, size) => Number(buf[off]) & 128 ? parse(buf.subarray(off, off + size)) : decSmallNumber(buf, off, size);
|
|
10571
|
-
var nanUndef = (value) => isNaN(value) ? void 0 : value;
|
|
10572
|
-
var decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf.subarray(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), 8));
|
|
10573
|
-
var MAXNUM = {
|
|
10574
|
-
12: 8589934591,
|
|
10575
|
-
8: 2097151
|
|
10576
8632
|
};
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
var encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size);
|
|
10584
|
-
|
|
10585
|
-
// node_modules/tar/dist/esm/pax.js
|
|
10586
|
-
import { basename } from "path";
|
|
10587
|
-
var Pax = class _Pax {
|
|
10588
|
-
atime;
|
|
10589
|
-
mtime;
|
|
10590
|
-
ctime;
|
|
10591
|
-
charset;
|
|
10592
|
-
comment;
|
|
10593
|
-
gid;
|
|
10594
|
-
uid;
|
|
10595
|
-
gname;
|
|
10596
|
-
uname;
|
|
10597
|
-
linkpath;
|
|
10598
|
-
dev;
|
|
10599
|
-
ino;
|
|
10600
|
-
nlink;
|
|
10601
|
-
path;
|
|
10602
|
-
size;
|
|
10603
|
-
mode;
|
|
10604
|
-
global;
|
|
10605
|
-
constructor(obj, global3 = false) {
|
|
10606
|
-
this.atime = obj.atime;
|
|
10607
|
-
this.charset = obj.charset;
|
|
10608
|
-
this.comment = obj.comment;
|
|
10609
|
-
this.ctime = obj.ctime;
|
|
10610
|
-
this.dev = obj.dev;
|
|
10611
|
-
this.gid = obj.gid;
|
|
10612
|
-
this.global = global3;
|
|
10613
|
-
this.gname = obj.gname;
|
|
10614
|
-
this.ino = obj.ino;
|
|
10615
|
-
this.linkpath = obj.linkpath;
|
|
10616
|
-
this.mtime = obj.mtime;
|
|
10617
|
-
this.nlink = obj.nlink;
|
|
10618
|
-
this.path = obj.path;
|
|
10619
|
-
this.size = obj.size;
|
|
10620
|
-
this.uid = obj.uid;
|
|
10621
|
-
this.uname = obj.uname;
|
|
10622
|
-
}
|
|
10623
|
-
encode() {
|
|
10624
|
-
const body = this.encodeBody();
|
|
10625
|
-
if (body === "") {
|
|
10626
|
-
return Buffer.allocUnsafe(0);
|
|
10627
|
-
}
|
|
10628
|
-
const bodyLen = Buffer.byteLength(body);
|
|
10629
|
-
const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
|
|
10630
|
-
const buf = Buffer.allocUnsafe(bufLen);
|
|
10631
|
-
for (let i = 0; i < 512; i++) {
|
|
10632
|
-
buf[i] = 0;
|
|
10633
|
-
}
|
|
10634
|
-
new Header({
|
|
10635
|
-
// XXX split the path
|
|
10636
|
-
// then the path should be PaxHeader + basename, but less than 99,
|
|
10637
|
-
// prepend with the dirname
|
|
10638
|
-
/* c8 ignore start */
|
|
10639
|
-
path: ("PaxHeader/" + basename(this.path ?? "")).slice(0, 99),
|
|
10640
|
-
/* c8 ignore stop */
|
|
10641
|
-
mode: this.mode || 420,
|
|
10642
|
-
uid: this.uid,
|
|
10643
|
-
gid: this.gid,
|
|
10644
|
-
size: bodyLen,
|
|
10645
|
-
mtime: this.mtime,
|
|
10646
|
-
type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader",
|
|
10647
|
-
linkpath: "",
|
|
10648
|
-
uname: this.uname || "",
|
|
10649
|
-
gname: this.gname || "",
|
|
10650
|
-
devmaj: 0,
|
|
10651
|
-
devmin: 0,
|
|
10652
|
-
atime: this.atime,
|
|
10653
|
-
ctime: this.ctime
|
|
10654
|
-
}).encode(buf);
|
|
10655
|
-
buf.write(body, 512, bodyLen, "utf8");
|
|
10656
|
-
for (let i = bodyLen + 512; i < buf.length; i++) {
|
|
10657
|
-
buf[i] = 0;
|
|
10658
|
-
}
|
|
10659
|
-
return buf;
|
|
10660
|
-
}
|
|
10661
|
-
encodeBody() {
|
|
10662
|
-
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");
|
|
8633
|
+
function insertAfter(self, node, value) {
|
|
8634
|
+
const prev = node;
|
|
8635
|
+
const next = node ? node.next : self.head;
|
|
8636
|
+
const inserted = new Node2(value, prev, next, self);
|
|
8637
|
+
if (inserted.next === void 0) {
|
|
8638
|
+
self.tail = inserted;
|
|
10663
8639
|
}
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
return "";
|
|
10667
|
-
}
|
|
10668
|
-
const r = this[field];
|
|
10669
|
-
const v = r instanceof Date ? r.getTime() / 1e3 : r;
|
|
10670
|
-
const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n";
|
|
10671
|
-
const byteLen = Buffer.byteLength(s);
|
|
10672
|
-
let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
|
|
10673
|
-
if (byteLen + digits >= Math.pow(10, digits)) {
|
|
10674
|
-
digits += 1;
|
|
10675
|
-
}
|
|
10676
|
-
const len = digits + byteLen;
|
|
10677
|
-
return len + s;
|
|
8640
|
+
if (inserted.prev === void 0) {
|
|
8641
|
+
self.head = inserted;
|
|
10678
8642
|
}
|
|
10679
|
-
|
|
10680
|
-
|
|
8643
|
+
self.length++;
|
|
8644
|
+
return inserted;
|
|
8645
|
+
}
|
|
8646
|
+
function push(self, item) {
|
|
8647
|
+
self.tail = new Node2(item, self.tail, void 0, self);
|
|
8648
|
+
if (!self.head) {
|
|
8649
|
+
self.head = self.tail;
|
|
10681
8650
|
}
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
return set;
|
|
8651
|
+
self.length++;
|
|
8652
|
+
}
|
|
8653
|
+
function unshift(self, item) {
|
|
8654
|
+
self.head = new Node2(item, void 0, self.head, self);
|
|
8655
|
+
if (!self.tail) {
|
|
8656
|
+
self.tail = self.head;
|
|
10689
8657
|
}
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
8658
|
+
self.length++;
|
|
8659
|
+
}
|
|
8660
|
+
var Node2 = class {
|
|
8661
|
+
list;
|
|
8662
|
+
next;
|
|
8663
|
+
prev;
|
|
8664
|
+
value;
|
|
8665
|
+
constructor(value, prev, next, list2) {
|
|
8666
|
+
this.list = list2;
|
|
8667
|
+
this.value = value;
|
|
8668
|
+
if (prev) {
|
|
8669
|
+
prev.next = this;
|
|
8670
|
+
this.prev = prev;
|
|
8671
|
+
} else {
|
|
8672
|
+
this.prev = void 0;
|
|
8673
|
+
}
|
|
8674
|
+
if (next) {
|
|
8675
|
+
next.prev = this;
|
|
8676
|
+
this.next = next;
|
|
8677
|
+
} else {
|
|
8678
|
+
this.next = void 0;
|
|
8679
|
+
}
|
|
10695
8680
|
}
|
|
10696
|
-
const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
|
10697
|
-
const v = kv.join("=");
|
|
10698
|
-
set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(Number(v) * 1e3) : /^[0-9]+$/.test(v) ? +v : v;
|
|
10699
|
-
return set;
|
|
10700
8681
|
};
|
|
10701
8682
|
|
|
10702
|
-
// node_modules/
|
|
10703
|
-
import
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
var
|
|
10707
|
-
|
|
10708
|
-
|
|
8683
|
+
// node_modules/tar/dist/esm/header.js
|
|
8684
|
+
import { posix as pathModule } from "path";
|
|
8685
|
+
|
|
8686
|
+
// node_modules/tar/dist/esm/large-numbers.js
|
|
8687
|
+
var encode = (num, buf) => {
|
|
8688
|
+
if (!Number.isSafeInteger(num)) {
|
|
8689
|
+
throw Error("cannot encode number outside of javascript safe integer range");
|
|
8690
|
+
} else if (num < 0) {
|
|
8691
|
+
encodeNegative(num, buf);
|
|
8692
|
+
} else {
|
|
8693
|
+
encodePositive(num, buf);
|
|
8694
|
+
}
|
|
8695
|
+
return buf;
|
|
10709
8696
|
};
|
|
10710
|
-
var
|
|
10711
|
-
|
|
10712
|
-
var
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
var EMITTED_ERROR3 = Symbol("emittedError");
|
|
10716
|
-
var CLOSED3 = Symbol("closed");
|
|
10717
|
-
var READ3 = Symbol("read");
|
|
10718
|
-
var FLUSH3 = Symbol("flush");
|
|
10719
|
-
var FLUSHCHUNK3 = Symbol("flushChunk");
|
|
10720
|
-
var ENCODING3 = Symbol("encoding");
|
|
10721
|
-
var DECODER3 = Symbol("decoder");
|
|
10722
|
-
var FLOWING3 = Symbol("flowing");
|
|
10723
|
-
var PAUSED3 = Symbol("paused");
|
|
10724
|
-
var RESUME3 = Symbol("resume");
|
|
10725
|
-
var BUFFER3 = Symbol("buffer");
|
|
10726
|
-
var PIPES3 = Symbol("pipes");
|
|
10727
|
-
var BUFFERLENGTH3 = Symbol("bufferLength");
|
|
10728
|
-
var BUFFERPUSH3 = Symbol("bufferPush");
|
|
10729
|
-
var BUFFERSHIFT3 = Symbol("bufferShift");
|
|
10730
|
-
var OBJECTMODE3 = Symbol("objectMode");
|
|
10731
|
-
var DESTROYED3 = Symbol("destroyed");
|
|
10732
|
-
var ERROR3 = Symbol("error");
|
|
10733
|
-
var EMITDATA3 = Symbol("emitData");
|
|
10734
|
-
var EMITEND4 = Symbol("emitEnd");
|
|
10735
|
-
var EMITEND23 = Symbol("emitEnd2");
|
|
10736
|
-
var ASYNC3 = Symbol("async");
|
|
10737
|
-
var ABORT3 = Symbol("abort");
|
|
10738
|
-
var ABORTED3 = Symbol("aborted");
|
|
10739
|
-
var SIGNAL3 = Symbol("signal");
|
|
10740
|
-
var defer3 = (fn) => Promise.resolve().then(fn);
|
|
10741
|
-
var doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== "1";
|
|
10742
|
-
var ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented");
|
|
10743
|
-
var ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented");
|
|
10744
|
-
var isEndish3 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish";
|
|
10745
|
-
var isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0;
|
|
10746
|
-
var isArrayBufferView3 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
10747
|
-
var Pipe3 = class {
|
|
10748
|
-
constructor(src, dest, opts) {
|
|
10749
|
-
this.src = src;
|
|
10750
|
-
this.dest = dest;
|
|
10751
|
-
this.opts = opts;
|
|
10752
|
-
this.ondrain = () => src[RESUME3]();
|
|
10753
|
-
dest.on("drain", this.ondrain);
|
|
8697
|
+
var encodePositive = (num, buf) => {
|
|
8698
|
+
buf[0] = 128;
|
|
8699
|
+
for (var i = buf.length; i > 1; i--) {
|
|
8700
|
+
buf[i - 1] = num & 255;
|
|
8701
|
+
num = Math.floor(num / 256);
|
|
10754
8702
|
}
|
|
10755
|
-
|
|
10756
|
-
|
|
8703
|
+
};
|
|
8704
|
+
var encodeNegative = (num, buf) => {
|
|
8705
|
+
buf[0] = 255;
|
|
8706
|
+
var flipped = false;
|
|
8707
|
+
num = num * -1;
|
|
8708
|
+
for (var i = buf.length; i > 1; i--) {
|
|
8709
|
+
var byte = num & 255;
|
|
8710
|
+
num = Math.floor(num / 256);
|
|
8711
|
+
if (flipped) {
|
|
8712
|
+
buf[i - 1] = onesComp(byte);
|
|
8713
|
+
} else if (byte === 0) {
|
|
8714
|
+
buf[i - 1] = 0;
|
|
8715
|
+
} else {
|
|
8716
|
+
flipped = true;
|
|
8717
|
+
buf[i - 1] = twosComp(byte);
|
|
8718
|
+
}
|
|
10757
8719
|
}
|
|
10758
|
-
|
|
10759
|
-
|
|
8720
|
+
};
|
|
8721
|
+
var parse = (buf) => {
|
|
8722
|
+
const pre = buf[0];
|
|
8723
|
+
const value = pre === 128 ? pos(buf.subarray(1, buf.length)) : pre === 255 ? twos(buf) : null;
|
|
8724
|
+
if (value === null) {
|
|
8725
|
+
throw Error("invalid base256 encoding");
|
|
10760
8726
|
}
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
if (this.opts.end)
|
|
10764
|
-
this.dest.end();
|
|
8727
|
+
if (!Number.isSafeInteger(value)) {
|
|
8728
|
+
throw Error("parsed number outside of javascript safe integer range");
|
|
10765
8729
|
}
|
|
8730
|
+
return value;
|
|
10766
8731
|
};
|
|
10767
|
-
var
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
8732
|
+
var twos = (buf) => {
|
|
8733
|
+
var len = buf.length;
|
|
8734
|
+
var sum = 0;
|
|
8735
|
+
var flipped = false;
|
|
8736
|
+
for (var i = len - 1; i > -1; i--) {
|
|
8737
|
+
var byte = Number(buf[i]);
|
|
8738
|
+
var f;
|
|
8739
|
+
if (flipped) {
|
|
8740
|
+
f = onesComp(byte);
|
|
8741
|
+
} else if (byte === 0) {
|
|
8742
|
+
f = byte;
|
|
8743
|
+
} else {
|
|
8744
|
+
flipped = true;
|
|
8745
|
+
f = twosComp(byte);
|
|
8746
|
+
}
|
|
8747
|
+
if (f !== 0) {
|
|
8748
|
+
sum -= f * Math.pow(256, len - i - 1);
|
|
8749
|
+
}
|
|
10771
8750
|
}
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
8751
|
+
return sum;
|
|
8752
|
+
};
|
|
8753
|
+
var pos = (buf) => {
|
|
8754
|
+
var len = buf.length;
|
|
8755
|
+
var sum = 0;
|
|
8756
|
+
for (var i = len - 1; i > -1; i--) {
|
|
8757
|
+
var byte = Number(buf[i]);
|
|
8758
|
+
if (byte !== 0) {
|
|
8759
|
+
sum += byte * Math.pow(256, len - i - 1);
|
|
8760
|
+
}
|
|
10776
8761
|
}
|
|
8762
|
+
return sum;
|
|
10777
8763
|
};
|
|
10778
|
-
var
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
8764
|
+
var onesComp = (byte) => (255 ^ byte) & 255;
|
|
8765
|
+
var twosComp = (byte) => (255 ^ byte) + 1 & 255;
|
|
8766
|
+
|
|
8767
|
+
// node_modules/tar/dist/esm/types.js
|
|
8768
|
+
var isCode = (c) => name.has(c);
|
|
8769
|
+
var name = /* @__PURE__ */ new Map([
|
|
8770
|
+
["0", "File"],
|
|
8771
|
+
// same as File
|
|
8772
|
+
["", "OldFile"],
|
|
8773
|
+
["1", "Link"],
|
|
8774
|
+
["2", "SymbolicLink"],
|
|
8775
|
+
// Devices and FIFOs aren't fully supported
|
|
8776
|
+
// they are parsed, but skipped when unpacking
|
|
8777
|
+
["3", "CharacterDevice"],
|
|
8778
|
+
["4", "BlockDevice"],
|
|
8779
|
+
["5", "Directory"],
|
|
8780
|
+
["6", "FIFO"],
|
|
8781
|
+
// same as File
|
|
8782
|
+
["7", "ContiguousFile"],
|
|
8783
|
+
// pax headers
|
|
8784
|
+
["g", "GlobalExtendedHeader"],
|
|
8785
|
+
["x", "ExtendedHeader"],
|
|
8786
|
+
// vendor-specific stuff
|
|
8787
|
+
// skip
|
|
8788
|
+
["A", "SolarisACL"],
|
|
8789
|
+
// like 5, but with data, which should be skipped
|
|
8790
|
+
["D", "GNUDumpDir"],
|
|
8791
|
+
// metadata only, skip
|
|
8792
|
+
["I", "Inode"],
|
|
8793
|
+
// data = link path of next file
|
|
8794
|
+
["K", "NextFileHasLongLinkpath"],
|
|
8795
|
+
// data = path of next file
|
|
8796
|
+
["L", "NextFileHasLongPath"],
|
|
8797
|
+
// skip
|
|
8798
|
+
["M", "ContinuationFile"],
|
|
8799
|
+
// like L
|
|
8800
|
+
["N", "OldGnuLongPath"],
|
|
8801
|
+
// skip
|
|
8802
|
+
["S", "SparseFile"],
|
|
8803
|
+
// skip
|
|
8804
|
+
["V", "TapeVolumeHeader"],
|
|
8805
|
+
// like x
|
|
8806
|
+
["X", "OldExtendedHeader"]
|
|
8807
|
+
]);
|
|
8808
|
+
var code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]]));
|
|
8809
|
+
|
|
8810
|
+
// node_modules/tar/dist/esm/header.js
|
|
8811
|
+
var _type, _Header_instances, slurp_fn;
|
|
8812
|
+
var Header = class {
|
|
8813
|
+
constructor(data, off = 0, ex, gex) {
|
|
8814
|
+
__privateAdd(this, _Header_instances);
|
|
8815
|
+
__publicField(this, "cksumValid", false);
|
|
8816
|
+
__publicField(this, "needPax", false);
|
|
8817
|
+
__publicField(this, "nullBlock", false);
|
|
8818
|
+
__publicField(this, "block");
|
|
8819
|
+
__publicField(this, "path");
|
|
8820
|
+
__publicField(this, "mode");
|
|
8821
|
+
__publicField(this, "uid");
|
|
8822
|
+
__publicField(this, "gid");
|
|
8823
|
+
__publicField(this, "size");
|
|
8824
|
+
__publicField(this, "cksum");
|
|
8825
|
+
__privateAdd(this, _type, "Unsupported");
|
|
8826
|
+
__publicField(this, "linkpath");
|
|
8827
|
+
__publicField(this, "uname");
|
|
8828
|
+
__publicField(this, "gname");
|
|
8829
|
+
__publicField(this, "devmaj", 0);
|
|
8830
|
+
__publicField(this, "devmin", 0);
|
|
8831
|
+
__publicField(this, "atime");
|
|
8832
|
+
__publicField(this, "ctime");
|
|
8833
|
+
__publicField(this, "mtime");
|
|
8834
|
+
__publicField(this, "charset");
|
|
8835
|
+
__publicField(this, "comment");
|
|
8836
|
+
if (Buffer.isBuffer(data)) {
|
|
8837
|
+
this.decode(data, off || 0, ex, gex);
|
|
8838
|
+
} else if (data) {
|
|
8839
|
+
__privateMethod(this, _Header_instances, slurp_fn).call(this, data);
|
|
10805
8840
|
}
|
|
10806
|
-
|
|
10807
|
-
|
|
8841
|
+
}
|
|
8842
|
+
decode(buf, off, ex, gex) {
|
|
8843
|
+
if (!off) {
|
|
8844
|
+
off = 0;
|
|
8845
|
+
}
|
|
8846
|
+
if (!buf || !(buf.length >= off + 512)) {
|
|
8847
|
+
throw new Error("need 512 bytes for header");
|
|
8848
|
+
}
|
|
8849
|
+
this.path = decString(buf, off, 100);
|
|
8850
|
+
this.mode = decNumber(buf, off + 100, 8);
|
|
8851
|
+
this.uid = decNumber(buf, off + 108, 8);
|
|
8852
|
+
this.gid = decNumber(buf, off + 116, 8);
|
|
8853
|
+
this.size = decNumber(buf, off + 124, 12);
|
|
8854
|
+
this.mtime = decDate(buf, off + 136, 12);
|
|
8855
|
+
this.cksum = decNumber(buf, off + 148, 12);
|
|
8856
|
+
if (gex)
|
|
8857
|
+
__privateMethod(this, _Header_instances, slurp_fn).call(this, gex, true);
|
|
8858
|
+
if (ex)
|
|
8859
|
+
__privateMethod(this, _Header_instances, slurp_fn).call(this, ex);
|
|
8860
|
+
const t = decString(buf, off + 156, 1);
|
|
8861
|
+
if (isCode(t)) {
|
|
8862
|
+
__privateSet(this, _type, t || "0");
|
|
8863
|
+
}
|
|
8864
|
+
if (__privateGet(this, _type) === "0" && this.path.slice(-1) === "/") {
|
|
8865
|
+
__privateSet(this, _type, "5");
|
|
8866
|
+
}
|
|
8867
|
+
if (__privateGet(this, _type) === "5") {
|
|
8868
|
+
this.size = 0;
|
|
10808
8869
|
}
|
|
10809
|
-
this
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
this
|
|
10813
|
-
|
|
10814
|
-
|
|
8870
|
+
this.linkpath = decString(buf, off + 157, 100);
|
|
8871
|
+
if (buf.subarray(off + 257, off + 265).toString() === "ustar\x0000") {
|
|
8872
|
+
this.uname = decString(buf, off + 265, 32);
|
|
8873
|
+
this.gname = decString(buf, off + 297, 32);
|
|
8874
|
+
this.devmaj = decNumber(buf, off + 329, 8) ?? 0;
|
|
8875
|
+
this.devmin = decNumber(buf, off + 337, 8) ?? 0;
|
|
8876
|
+
if (buf[off + 475] !== 0) {
|
|
8877
|
+
const prefix2 = decString(buf, off + 345, 155);
|
|
8878
|
+
this.path = prefix2 + "/" + this.path;
|
|
8879
|
+
} else {
|
|
8880
|
+
const prefix2 = decString(buf, off + 345, 130);
|
|
8881
|
+
if (prefix2) {
|
|
8882
|
+
this.path = prefix2 + "/" + this.path;
|
|
8883
|
+
}
|
|
8884
|
+
this.atime = decDate(buf, off + 476, 12);
|
|
8885
|
+
this.ctime = decDate(buf, off + 488, 12);
|
|
10815
8886
|
}
|
|
10816
8887
|
}
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
}
|
|
10821
|
-
get encoding() {
|
|
10822
|
-
return this[ENCODING3];
|
|
10823
|
-
}
|
|
10824
|
-
set encoding(enc) {
|
|
10825
|
-
if (this[OBJECTMODE3])
|
|
10826
|
-
throw new Error("cannot set encoding in objectMode");
|
|
10827
|
-
if (this[ENCODING3] && enc !== this[ENCODING3] && (this[DECODER3] && this[DECODER3].lastNeed || this[BUFFERLENGTH3]))
|
|
10828
|
-
throw new Error("cannot change encoding");
|
|
10829
|
-
if (this[ENCODING3] !== enc) {
|
|
10830
|
-
this[DECODER3] = enc ? new SD(enc) : null;
|
|
10831
|
-
if (this[BUFFER3].length)
|
|
10832
|
-
this[BUFFER3] = this[BUFFER3].map((chunk) => this[DECODER3].write(chunk));
|
|
8888
|
+
let sum = 8 * 32;
|
|
8889
|
+
for (let i = off; i < off + 148; i++) {
|
|
8890
|
+
sum += buf[i];
|
|
10833
8891
|
}
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
setEncoding(enc) {
|
|
10837
|
-
this.encoding = enc;
|
|
10838
|
-
}
|
|
10839
|
-
get objectMode() {
|
|
10840
|
-
return this[OBJECTMODE3];
|
|
10841
|
-
}
|
|
10842
|
-
set objectMode(om) {
|
|
10843
|
-
this[OBJECTMODE3] = this[OBJECTMODE3] || !!om;
|
|
10844
|
-
}
|
|
10845
|
-
get ["async"]() {
|
|
10846
|
-
return this[ASYNC3];
|
|
10847
|
-
}
|
|
10848
|
-
set ["async"](a) {
|
|
10849
|
-
this[ASYNC3] = this[ASYNC3] || !!a;
|
|
10850
|
-
}
|
|
10851
|
-
// drop everything and get out of the flow completely
|
|
10852
|
-
[ABORT3]() {
|
|
10853
|
-
this[ABORTED3] = true;
|
|
10854
|
-
this.emit("abort", this[SIGNAL3].reason);
|
|
10855
|
-
this.destroy(this[SIGNAL3].reason);
|
|
10856
|
-
}
|
|
10857
|
-
get aborted() {
|
|
10858
|
-
return this[ABORTED3];
|
|
10859
|
-
}
|
|
10860
|
-
set aborted(_) {
|
|
10861
|
-
}
|
|
10862
|
-
write(chunk, encoding, cb) {
|
|
10863
|
-
if (this[ABORTED3])
|
|
10864
|
-
return false;
|
|
10865
|
-
if (this[EOF3])
|
|
10866
|
-
throw new Error("write after end");
|
|
10867
|
-
if (this[DESTROYED3]) {
|
|
10868
|
-
this.emit(
|
|
10869
|
-
"error",
|
|
10870
|
-
Object.assign(
|
|
10871
|
-
new Error("Cannot call write after a stream was destroyed"),
|
|
10872
|
-
{ code: "ERR_STREAM_DESTROYED" }
|
|
10873
|
-
)
|
|
10874
|
-
);
|
|
10875
|
-
return true;
|
|
8892
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
8893
|
+
sum += buf[i];
|
|
10876
8894
|
}
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
encoding = "utf8";
|
|
10881
|
-
const fn = this[ASYNC3] ? defer3 : (f) => f();
|
|
10882
|
-
if (!this[OBJECTMODE3] && !Buffer.isBuffer(chunk)) {
|
|
10883
|
-
if (isArrayBufferView3(chunk))
|
|
10884
|
-
chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
10885
|
-
else if (isArrayBuffer(chunk))
|
|
10886
|
-
chunk = Buffer.from(chunk);
|
|
10887
|
-
else if (typeof chunk !== "string")
|
|
10888
|
-
this.objectMode = true;
|
|
8895
|
+
this.cksumValid = sum === this.cksum;
|
|
8896
|
+
if (this.cksum === void 0 && sum === 8 * 32) {
|
|
8897
|
+
this.nullBlock = true;
|
|
10889
8898
|
}
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
this.emit("data", chunk);
|
|
10895
|
-
else
|
|
10896
|
-
this[BUFFERPUSH3](chunk);
|
|
10897
|
-
if (this[BUFFERLENGTH3] !== 0)
|
|
10898
|
-
this.emit("readable");
|
|
10899
|
-
if (cb)
|
|
10900
|
-
fn(cb);
|
|
10901
|
-
return this.flowing;
|
|
8899
|
+
}
|
|
8900
|
+
encode(buf, off = 0) {
|
|
8901
|
+
if (!buf) {
|
|
8902
|
+
buf = this.block = Buffer.alloc(512);
|
|
10902
8903
|
}
|
|
10903
|
-
if (
|
|
10904
|
-
|
|
10905
|
-
this.emit("readable");
|
|
10906
|
-
if (cb)
|
|
10907
|
-
fn(cb);
|
|
10908
|
-
return this.flowing;
|
|
8904
|
+
if (__privateGet(this, _type) === "Unsupported") {
|
|
8905
|
+
__privateSet(this, _type, "0");
|
|
10909
8906
|
}
|
|
10910
|
-
if (
|
|
10911
|
-
|
|
10912
|
-
chunk = Buffer.from(chunk, encoding);
|
|
8907
|
+
if (!(buf.length >= off + 512)) {
|
|
8908
|
+
throw new Error("need 512 bytes for header");
|
|
10913
8909
|
}
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
8910
|
+
const prefixSize = this.ctime || this.atime ? 130 : 155;
|
|
8911
|
+
const split = splitPrefix(this.path || "", prefixSize);
|
|
8912
|
+
const path13 = split[0];
|
|
8913
|
+
const prefix2 = split[1];
|
|
8914
|
+
this.needPax = !!split[2];
|
|
8915
|
+
this.needPax = encString(buf, off, 100, path13) || this.needPax;
|
|
8916
|
+
this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
|
|
8917
|
+
this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
|
|
8918
|
+
this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
|
|
8919
|
+
this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
|
|
8920
|
+
this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
|
|
8921
|
+
buf[off + 156] = __privateGet(this, _type).charCodeAt(0);
|
|
8922
|
+
this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax;
|
|
8923
|
+
buf.write("ustar\x0000", off + 257, 8);
|
|
8924
|
+
this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax;
|
|
8925
|
+
this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax;
|
|
8926
|
+
this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
|
|
8927
|
+
this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
|
|
8928
|
+
this.needPax = encString(buf, off + 345, prefixSize, prefix2) || this.needPax;
|
|
8929
|
+
if (buf[off + 475] !== 0) {
|
|
8930
|
+
this.needPax = encString(buf, off + 345, 155, prefix2) || this.needPax;
|
|
8931
|
+
} else {
|
|
8932
|
+
this.needPax = encString(buf, off + 345, 130, prefix2) || this.needPax;
|
|
8933
|
+
this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax;
|
|
8934
|
+
this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax;
|
|
10934
8935
|
}
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
if (this.encoding)
|
|
10939
|
-
this[BUFFER3] = [this[BUFFER3].join("")];
|
|
10940
|
-
else
|
|
10941
|
-
this[BUFFER3] = [Buffer.concat(this[BUFFER3], this[BUFFERLENGTH3])];
|
|
8936
|
+
let sum = 8 * 32;
|
|
8937
|
+
for (let i = off; i < off + 148; i++) {
|
|
8938
|
+
sum += buf[i];
|
|
10942
8939
|
}
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
return ret;
|
|
10946
|
-
}
|
|
10947
|
-
[READ3](n, chunk) {
|
|
10948
|
-
if (n === chunk.length || n === null)
|
|
10949
|
-
this[BUFFERSHIFT3]();
|
|
10950
|
-
else {
|
|
10951
|
-
this[BUFFER3][0] = chunk.slice(n);
|
|
10952
|
-
chunk = chunk.slice(0, n);
|
|
10953
|
-
this[BUFFERLENGTH3] -= n;
|
|
8940
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
8941
|
+
sum += buf[i];
|
|
10954
8942
|
}
|
|
10955
|
-
this.
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
return
|
|
10959
|
-
}
|
|
10960
|
-
end(chunk, encoding, cb) {
|
|
10961
|
-
if (typeof chunk === "function")
|
|
10962
|
-
cb = chunk, chunk = null;
|
|
10963
|
-
if (typeof encoding === "function")
|
|
10964
|
-
cb = encoding, encoding = "utf8";
|
|
10965
|
-
if (chunk)
|
|
10966
|
-
this.write(chunk, encoding);
|
|
10967
|
-
if (cb)
|
|
10968
|
-
this.once("end", cb);
|
|
10969
|
-
this[EOF3] = true;
|
|
10970
|
-
this.writable = false;
|
|
10971
|
-
if (this.flowing || !this[PAUSED3])
|
|
10972
|
-
this[MAYBE_EMIT_END3]();
|
|
10973
|
-
return this;
|
|
10974
|
-
}
|
|
10975
|
-
// don't let the internal resume be overwritten
|
|
10976
|
-
[RESUME3]() {
|
|
10977
|
-
if (this[DESTROYED3])
|
|
10978
|
-
return;
|
|
10979
|
-
this[PAUSED3] = false;
|
|
10980
|
-
this[FLOWING3] = true;
|
|
10981
|
-
this.emit("resume");
|
|
10982
|
-
if (this[BUFFER3].length)
|
|
10983
|
-
this[FLUSH3]();
|
|
10984
|
-
else if (this[EOF3])
|
|
10985
|
-
this[MAYBE_EMIT_END3]();
|
|
10986
|
-
else
|
|
10987
|
-
this.emit("drain");
|
|
10988
|
-
}
|
|
10989
|
-
resume() {
|
|
10990
|
-
return this[RESUME3]();
|
|
10991
|
-
}
|
|
10992
|
-
pause() {
|
|
10993
|
-
this[FLOWING3] = false;
|
|
10994
|
-
this[PAUSED3] = true;
|
|
10995
|
-
}
|
|
10996
|
-
get destroyed() {
|
|
10997
|
-
return this[DESTROYED3];
|
|
10998
|
-
}
|
|
10999
|
-
get flowing() {
|
|
11000
|
-
return this[FLOWING3];
|
|
11001
|
-
}
|
|
11002
|
-
get paused() {
|
|
11003
|
-
return this[PAUSED3];
|
|
11004
|
-
}
|
|
11005
|
-
[BUFFERPUSH3](chunk) {
|
|
11006
|
-
if (this[OBJECTMODE3])
|
|
11007
|
-
this[BUFFERLENGTH3] += 1;
|
|
11008
|
-
else
|
|
11009
|
-
this[BUFFERLENGTH3] += chunk.length;
|
|
11010
|
-
this[BUFFER3].push(chunk);
|
|
11011
|
-
}
|
|
11012
|
-
[BUFFERSHIFT3]() {
|
|
11013
|
-
if (this[OBJECTMODE3])
|
|
11014
|
-
this[BUFFERLENGTH3] -= 1;
|
|
11015
|
-
else
|
|
11016
|
-
this[BUFFERLENGTH3] -= this[BUFFER3][0].length;
|
|
11017
|
-
return this[BUFFER3].shift();
|
|
8943
|
+
this.cksum = sum;
|
|
8944
|
+
encNumber(buf, off + 148, 8, this.cksum);
|
|
8945
|
+
this.cksumValid = true;
|
|
8946
|
+
return this.needPax;
|
|
11018
8947
|
}
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
} while (this[FLUSHCHUNK3](this[BUFFERSHIFT3]()) && this[BUFFER3].length);
|
|
11022
|
-
if (!noDrain && !this[BUFFER3].length && !this[EOF3])
|
|
11023
|
-
this.emit("drain");
|
|
8948
|
+
get type() {
|
|
8949
|
+
return __privateGet(this, _type) === "Unsupported" ? __privateGet(this, _type) : name.get(__privateGet(this, _type));
|
|
11024
8950
|
}
|
|
11025
|
-
|
|
11026
|
-
this
|
|
11027
|
-
return this.flowing;
|
|
8951
|
+
get typeKey() {
|
|
8952
|
+
return __privateGet(this, _type);
|
|
11028
8953
|
}
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
opts.end = false;
|
|
11036
|
-
else
|
|
11037
|
-
opts.end = opts.end !== false;
|
|
11038
|
-
opts.proxyErrors = !!opts.proxyErrors;
|
|
11039
|
-
if (ended) {
|
|
11040
|
-
if (opts.end)
|
|
11041
|
-
dest.end();
|
|
8954
|
+
set type(type) {
|
|
8955
|
+
const c = String(code.get(type));
|
|
8956
|
+
if (isCode(c) || c === "Unsupported") {
|
|
8957
|
+
__privateSet(this, _type, c);
|
|
8958
|
+
} else if (isCode(type)) {
|
|
8959
|
+
__privateSet(this, _type, type);
|
|
11042
8960
|
} else {
|
|
11043
|
-
|
|
11044
|
-
!opts.proxyErrors ? new Pipe3(this, dest, opts) : new PipeProxyErrors3(this, dest, opts)
|
|
11045
|
-
);
|
|
11046
|
-
if (this[ASYNC3])
|
|
11047
|
-
defer3(() => this[RESUME3]());
|
|
11048
|
-
else
|
|
11049
|
-
this[RESUME3]();
|
|
11050
|
-
}
|
|
11051
|
-
return dest;
|
|
11052
|
-
}
|
|
11053
|
-
unpipe(dest) {
|
|
11054
|
-
const p = this[PIPES3].find((p2) => p2.dest === dest);
|
|
11055
|
-
if (p) {
|
|
11056
|
-
this[PIPES3].splice(this[PIPES3].indexOf(p), 1);
|
|
11057
|
-
p.unpipe();
|
|
8961
|
+
throw new TypeError("invalid entry type: " + type);
|
|
11058
8962
|
}
|
|
11059
8963
|
}
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
8964
|
+
};
|
|
8965
|
+
_type = new WeakMap();
|
|
8966
|
+
_Header_instances = new WeakSet();
|
|
8967
|
+
slurp_fn = function(ex, gex = false) {
|
|
8968
|
+
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
|
|
8969
|
+
return !(v === null || v === void 0 || k === "path" && gex || k === "linkpath" && gex || k === "global");
|
|
8970
|
+
})));
|
|
8971
|
+
};
|
|
8972
|
+
var splitPrefix = (p, prefixSize) => {
|
|
8973
|
+
const pathSize = 100;
|
|
8974
|
+
let pp = p;
|
|
8975
|
+
let prefix2 = "";
|
|
8976
|
+
let ret = void 0;
|
|
8977
|
+
const root = pathModule.parse(p).root || ".";
|
|
8978
|
+
if (Buffer.byteLength(pp) < pathSize) {
|
|
8979
|
+
ret = [pp, prefix2, false];
|
|
8980
|
+
} else {
|
|
8981
|
+
prefix2 = pathModule.dirname(pp);
|
|
8982
|
+
pp = pathModule.basename(pp);
|
|
8983
|
+
do {
|
|
8984
|
+
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix2) <= prefixSize) {
|
|
8985
|
+
ret = [pp, prefix2, false];
|
|
8986
|
+
} else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix2) <= prefixSize) {
|
|
8987
|
+
ret = [pp.slice(0, pathSize - 1), prefix2, true];
|
|
8988
|
+
} else {
|
|
8989
|
+
pp = pathModule.join(pathModule.basename(prefix2), pp);
|
|
8990
|
+
prefix2 = pathModule.dirname(prefix2);
|
|
8991
|
+
}
|
|
8992
|
+
} while (prefix2 !== root && ret === void 0);
|
|
8993
|
+
if (!ret) {
|
|
8994
|
+
ret = [p.slice(0, pathSize - 1), "", true];
|
|
11077
8995
|
}
|
|
11078
|
-
return ret;
|
|
11079
8996
|
}
|
|
11080
|
-
|
|
11081
|
-
|
|
8997
|
+
return ret;
|
|
8998
|
+
};
|
|
8999
|
+
var decString = (buf, off, size) => buf.subarray(off, off + size).toString("utf8").replace(/\0.*/, "");
|
|
9000
|
+
var decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
|
|
9001
|
+
var numToDate = (num) => num === void 0 ? void 0 : new Date(num * 1e3);
|
|
9002
|
+
var decNumber = (buf, off, size) => Number(buf[off]) & 128 ? parse(buf.subarray(off, off + size)) : decSmallNumber(buf, off, size);
|
|
9003
|
+
var nanUndef = (value) => isNaN(value) ? void 0 : value;
|
|
9004
|
+
var decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf.subarray(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), 8));
|
|
9005
|
+
var MAXNUM = {
|
|
9006
|
+
12: 8589934591,
|
|
9007
|
+
8: 2097151
|
|
9008
|
+
};
|
|
9009
|
+
var encNumber = (buf, off, size, num) => num === void 0 ? false : num > MAXNUM[size] || num < 0 ? (encode(num, buf.subarray(off, off + size)), true) : (encSmallNumber(buf, off, size, num), false);
|
|
9010
|
+
var encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, "ascii");
|
|
9011
|
+
var octalString = (num, size) => padOctal(Math.floor(num).toString(8), size);
|
|
9012
|
+
var padOctal = (str, size) => (str.length === size - 1 ? str : new Array(size - str.length - 1).join("0") + str + " ") + "\0";
|
|
9013
|
+
var encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf, off, size, date.getTime() / 1e3);
|
|
9014
|
+
var NULLS = new Array(156).join("\0");
|
|
9015
|
+
var encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size);
|
|
9016
|
+
|
|
9017
|
+
// node_modules/tar/dist/esm/pax.js
|
|
9018
|
+
import { basename } from "path";
|
|
9019
|
+
var Pax = class _Pax {
|
|
9020
|
+
atime;
|
|
9021
|
+
mtime;
|
|
9022
|
+
ctime;
|
|
9023
|
+
charset;
|
|
9024
|
+
comment;
|
|
9025
|
+
gid;
|
|
9026
|
+
uid;
|
|
9027
|
+
gname;
|
|
9028
|
+
uname;
|
|
9029
|
+
linkpath;
|
|
9030
|
+
dev;
|
|
9031
|
+
ino;
|
|
9032
|
+
nlink;
|
|
9033
|
+
path;
|
|
9034
|
+
size;
|
|
9035
|
+
mode;
|
|
9036
|
+
global;
|
|
9037
|
+
constructor(obj, global3 = false) {
|
|
9038
|
+
this.atime = obj.atime;
|
|
9039
|
+
this.charset = obj.charset;
|
|
9040
|
+
this.comment = obj.comment;
|
|
9041
|
+
this.ctime = obj.ctime;
|
|
9042
|
+
this.dev = obj.dev;
|
|
9043
|
+
this.gid = obj.gid;
|
|
9044
|
+
this.global = global3;
|
|
9045
|
+
this.gname = obj.gname;
|
|
9046
|
+
this.ino = obj.ino;
|
|
9047
|
+
this.linkpath = obj.linkpath;
|
|
9048
|
+
this.mtime = obj.mtime;
|
|
9049
|
+
this.nlink = obj.nlink;
|
|
9050
|
+
this.path = obj.path;
|
|
9051
|
+
this.size = obj.size;
|
|
9052
|
+
this.uid = obj.uid;
|
|
9053
|
+
this.uname = obj.uname;
|
|
11082
9054
|
}
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
this.emit("prefinish");
|
|
11088
|
-
this.emit("finish");
|
|
11089
|
-
if (this[CLOSED3])
|
|
11090
|
-
this.emit("close");
|
|
11091
|
-
this[EMITTING_END3] = false;
|
|
9055
|
+
encode() {
|
|
9056
|
+
const body = this.encodeBody();
|
|
9057
|
+
if (body === "") {
|
|
9058
|
+
return Buffer.allocUnsafe(0);
|
|
11092
9059
|
}
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
return !this[OBJECTMODE3] && !data ? false : this[ASYNC3] ? defer3(() => this[EMITDATA3](data)) : this[EMITDATA3](data);
|
|
11099
|
-
} else if (ev === "end") {
|
|
11100
|
-
return this[EMITEND4]();
|
|
11101
|
-
} else if (ev === "close") {
|
|
11102
|
-
this[CLOSED3] = true;
|
|
11103
|
-
if (!this[EMITTED_END3] && !this[DESTROYED3])
|
|
11104
|
-
return;
|
|
11105
|
-
const ret2 = super.emit("close");
|
|
11106
|
-
this.removeAllListeners("close");
|
|
11107
|
-
return ret2;
|
|
11108
|
-
} else if (ev === "error") {
|
|
11109
|
-
this[EMITTED_ERROR3] = data;
|
|
11110
|
-
super.emit(ERROR3, data);
|
|
11111
|
-
const ret2 = !this[SIGNAL3] || this.listeners("error").length ? super.emit("error", data) : false;
|
|
11112
|
-
this[MAYBE_EMIT_END3]();
|
|
11113
|
-
return ret2;
|
|
11114
|
-
} else if (ev === "resume") {
|
|
11115
|
-
const ret2 = super.emit("resume");
|
|
11116
|
-
this[MAYBE_EMIT_END3]();
|
|
11117
|
-
return ret2;
|
|
11118
|
-
} else if (ev === "finish" || ev === "prefinish") {
|
|
11119
|
-
const ret2 = super.emit(ev);
|
|
11120
|
-
this.removeAllListeners(ev);
|
|
11121
|
-
return ret2;
|
|
9060
|
+
const bodyLen = Buffer.byteLength(body);
|
|
9061
|
+
const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
|
|
9062
|
+
const buf = Buffer.allocUnsafe(bufLen);
|
|
9063
|
+
for (let i = 0; i < 512; i++) {
|
|
9064
|
+
buf[i] = 0;
|
|
11122
9065
|
}
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
9066
|
+
new Header({
|
|
9067
|
+
// XXX split the path
|
|
9068
|
+
// then the path should be PaxHeader + basename, but less than 99,
|
|
9069
|
+
// prepend with the dirname
|
|
9070
|
+
/* c8 ignore start */
|
|
9071
|
+
path: ("PaxHeader/" + basename(this.path ?? "")).slice(0, 99),
|
|
9072
|
+
/* c8 ignore stop */
|
|
9073
|
+
mode: this.mode || 420,
|
|
9074
|
+
uid: this.uid,
|
|
9075
|
+
gid: this.gid,
|
|
9076
|
+
size: bodyLen,
|
|
9077
|
+
mtime: this.mtime,
|
|
9078
|
+
type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader",
|
|
9079
|
+
linkpath: "",
|
|
9080
|
+
uname: this.uname || "",
|
|
9081
|
+
gname: this.gname || "",
|
|
9082
|
+
devmaj: 0,
|
|
9083
|
+
devmin: 0,
|
|
9084
|
+
atime: this.atime,
|
|
9085
|
+
ctime: this.ctime
|
|
9086
|
+
}).encode(buf);
|
|
9087
|
+
buf.write(body, 512, bodyLen, "utf8");
|
|
9088
|
+
for (let i = bodyLen + 512; i < buf.length; i++) {
|
|
9089
|
+
buf[i] = 0;
|
|
11131
9090
|
}
|
|
11132
|
-
|
|
11133
|
-
this[MAYBE_EMIT_END3]();
|
|
11134
|
-
return ret;
|
|
9091
|
+
return buf;
|
|
11135
9092
|
}
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
return;
|
|
11139
|
-
this[EMITTED_END3] = true;
|
|
11140
|
-
this.readable = false;
|
|
11141
|
-
if (this[ASYNC3])
|
|
11142
|
-
defer3(() => this[EMITEND23]());
|
|
11143
|
-
else
|
|
11144
|
-
this[EMITEND23]();
|
|
9093
|
+
encodeBody() {
|
|
9094
|
+
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");
|
|
11145
9095
|
}
|
|
11146
|
-
|
|
11147
|
-
if (this[
|
|
11148
|
-
|
|
11149
|
-
if (data) {
|
|
11150
|
-
for (const p of this[PIPES3]) {
|
|
11151
|
-
p.dest.write(data);
|
|
11152
|
-
}
|
|
11153
|
-
super.emit("data", data);
|
|
11154
|
-
}
|
|
9096
|
+
encodeField(field) {
|
|
9097
|
+
if (this[field] === void 0) {
|
|
9098
|
+
return "";
|
|
11155
9099
|
}
|
|
11156
|
-
|
|
11157
|
-
|
|
9100
|
+
const r = this[field];
|
|
9101
|
+
const v = r instanceof Date ? r.getTime() / 1e3 : r;
|
|
9102
|
+
const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n";
|
|
9103
|
+
const byteLen = Buffer.byteLength(s);
|
|
9104
|
+
let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
|
|
9105
|
+
if (byteLen + digits >= Math.pow(10, digits)) {
|
|
9106
|
+
digits += 1;
|
|
11158
9107
|
}
|
|
11159
|
-
const
|
|
11160
|
-
|
|
11161
|
-
return ret;
|
|
11162
|
-
}
|
|
11163
|
-
// const all = await stream.collect()
|
|
11164
|
-
collect() {
|
|
11165
|
-
const buf = [];
|
|
11166
|
-
if (!this[OBJECTMODE3])
|
|
11167
|
-
buf.dataLength = 0;
|
|
11168
|
-
const p = this.promise();
|
|
11169
|
-
this.on("data", (c) => {
|
|
11170
|
-
buf.push(c);
|
|
11171
|
-
if (!this[OBJECTMODE3])
|
|
11172
|
-
buf.dataLength += c.length;
|
|
11173
|
-
});
|
|
11174
|
-
return p.then(() => buf);
|
|
11175
|
-
}
|
|
11176
|
-
// const data = await stream.concat()
|
|
11177
|
-
concat() {
|
|
11178
|
-
return this[OBJECTMODE3] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then(
|
|
11179
|
-
(buf) => this[OBJECTMODE3] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING3] ? buf.join("") : Buffer.concat(buf, buf.dataLength)
|
|
11180
|
-
);
|
|
11181
|
-
}
|
|
11182
|
-
// stream.promise().then(() => done, er => emitted error)
|
|
11183
|
-
promise() {
|
|
11184
|
-
return new Promise((resolve2, reject) => {
|
|
11185
|
-
this.on(DESTROYED3, () => reject(new Error("stream destroyed")));
|
|
11186
|
-
this.on("error", (er) => reject(er));
|
|
11187
|
-
this.on("end", () => resolve2());
|
|
11188
|
-
});
|
|
11189
|
-
}
|
|
11190
|
-
// for await (let chunk of stream)
|
|
11191
|
-
[ASYNCITERATOR]() {
|
|
11192
|
-
let stopped = false;
|
|
11193
|
-
const stop = () => {
|
|
11194
|
-
this.pause();
|
|
11195
|
-
stopped = true;
|
|
11196
|
-
return Promise.resolve({ done: true });
|
|
11197
|
-
};
|
|
11198
|
-
const next = () => {
|
|
11199
|
-
if (stopped)
|
|
11200
|
-
return stop();
|
|
11201
|
-
const res = this.read();
|
|
11202
|
-
if (res !== null)
|
|
11203
|
-
return Promise.resolve({ done: false, value: res });
|
|
11204
|
-
if (this[EOF3])
|
|
11205
|
-
return stop();
|
|
11206
|
-
let resolve2 = null;
|
|
11207
|
-
let reject = null;
|
|
11208
|
-
const onerr = (er) => {
|
|
11209
|
-
this.removeListener("data", ondata);
|
|
11210
|
-
this.removeListener("end", onend);
|
|
11211
|
-
this.removeListener(DESTROYED3, ondestroy);
|
|
11212
|
-
stop();
|
|
11213
|
-
reject(er);
|
|
11214
|
-
};
|
|
11215
|
-
const ondata = (value) => {
|
|
11216
|
-
this.removeListener("error", onerr);
|
|
11217
|
-
this.removeListener("end", onend);
|
|
11218
|
-
this.removeListener(DESTROYED3, ondestroy);
|
|
11219
|
-
this.pause();
|
|
11220
|
-
resolve2({ value, done: !!this[EOF3] });
|
|
11221
|
-
};
|
|
11222
|
-
const onend = () => {
|
|
11223
|
-
this.removeListener("error", onerr);
|
|
11224
|
-
this.removeListener("data", ondata);
|
|
11225
|
-
this.removeListener(DESTROYED3, ondestroy);
|
|
11226
|
-
stop();
|
|
11227
|
-
resolve2({ done: true });
|
|
11228
|
-
};
|
|
11229
|
-
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
11230
|
-
return new Promise((res2, rej) => {
|
|
11231
|
-
reject = rej;
|
|
11232
|
-
resolve2 = res2;
|
|
11233
|
-
this.once(DESTROYED3, ondestroy);
|
|
11234
|
-
this.once("error", onerr);
|
|
11235
|
-
this.once("end", onend);
|
|
11236
|
-
this.once("data", ondata);
|
|
11237
|
-
});
|
|
11238
|
-
};
|
|
11239
|
-
return {
|
|
11240
|
-
next,
|
|
11241
|
-
throw: stop,
|
|
11242
|
-
return: stop,
|
|
11243
|
-
[ASYNCITERATOR]() {
|
|
11244
|
-
return this;
|
|
11245
|
-
}
|
|
11246
|
-
};
|
|
9108
|
+
const len = digits + byteLen;
|
|
9109
|
+
return len + s;
|
|
11247
9110
|
}
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
let stopped = false;
|
|
11251
|
-
const stop = () => {
|
|
11252
|
-
this.pause();
|
|
11253
|
-
this.removeListener(ERROR3, stop);
|
|
11254
|
-
this.removeListener(DESTROYED3, stop);
|
|
11255
|
-
this.removeListener("end", stop);
|
|
11256
|
-
stopped = true;
|
|
11257
|
-
return { done: true };
|
|
11258
|
-
};
|
|
11259
|
-
const next = () => {
|
|
11260
|
-
if (stopped)
|
|
11261
|
-
return stop();
|
|
11262
|
-
const value = this.read();
|
|
11263
|
-
return value === null ? stop() : { value };
|
|
11264
|
-
};
|
|
11265
|
-
this.once("end", stop);
|
|
11266
|
-
this.once(ERROR3, stop);
|
|
11267
|
-
this.once(DESTROYED3, stop);
|
|
11268
|
-
return {
|
|
11269
|
-
next,
|
|
11270
|
-
throw: stop,
|
|
11271
|
-
return: stop,
|
|
11272
|
-
[ITERATOR]() {
|
|
11273
|
-
return this;
|
|
11274
|
-
}
|
|
11275
|
-
};
|
|
9111
|
+
static parse(str, ex, g = false) {
|
|
9112
|
+
return new _Pax(merge(parseKV(str), ex), g);
|
|
11276
9113
|
}
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
}
|
|
11285
|
-
this[DESTROYED3] = true;
|
|
11286
|
-
this[BUFFER3].length = 0;
|
|
11287
|
-
this[BUFFERLENGTH3] = 0;
|
|
11288
|
-
if (typeof this.close === "function" && !this[CLOSED3])
|
|
11289
|
-
this.close();
|
|
11290
|
-
if (er)
|
|
11291
|
-
this.emit("error", er);
|
|
11292
|
-
else
|
|
11293
|
-
this.emit(DESTROYED3);
|
|
11294
|
-
return this;
|
|
9114
|
+
};
|
|
9115
|
+
var merge = (a, b) => b ? Object.assign({}, b, a) : a;
|
|
9116
|
+
var parseKV = (str) => str.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
|
|
9117
|
+
var parseKVLine = (set, line) => {
|
|
9118
|
+
const n = parseInt(line, 10);
|
|
9119
|
+
if (n !== Buffer.byteLength(line) + 1) {
|
|
9120
|
+
return set;
|
|
11295
9121
|
}
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
9122
|
+
line = line.slice((n + " ").length);
|
|
9123
|
+
const kv = line.split("=");
|
|
9124
|
+
const r = kv.shift();
|
|
9125
|
+
if (!r) {
|
|
9126
|
+
return set;
|
|
11300
9127
|
}
|
|
9128
|
+
const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
|
9129
|
+
const v = kv.join("=");
|
|
9130
|
+
set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(Number(v) * 1e3) : /^[0-9]+$/.test(v) ? +v : v;
|
|
9131
|
+
return set;
|
|
11301
9132
|
};
|
|
11302
9133
|
|
|
11303
9134
|
// node_modules/tar/dist/esm/normalize-windows-path.js
|
|
@@ -11305,11 +9136,11 @@ var platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
|
11305
9136
|
var normalizeWindowsPath = platform !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/");
|
|
11306
9137
|
|
|
11307
9138
|
// node_modules/tar/dist/esm/read-entry.js
|
|
11308
|
-
var
|
|
11309
|
-
var ReadEntry = class extends
|
|
9139
|
+
var _ReadEntry_instances, slurp_fn2;
|
|
9140
|
+
var ReadEntry = class extends Minipass {
|
|
11310
9141
|
constructor(header, ex, gex) {
|
|
11311
9142
|
super({});
|
|
11312
|
-
__privateAdd(this,
|
|
9143
|
+
__privateAdd(this, _ReadEntry_instances);
|
|
11313
9144
|
__publicField(this, "extended");
|
|
11314
9145
|
__publicField(this, "globalExtended");
|
|
11315
9146
|
__publicField(this, "header");
|
|
@@ -11387,10 +9218,10 @@ var ReadEntry = class extends Minipass3 {
|
|
|
11387
9218
|
this.uname = header.uname;
|
|
11388
9219
|
this.gname = header.gname;
|
|
11389
9220
|
if (ex) {
|
|
11390
|
-
__privateMethod(this,
|
|
9221
|
+
__privateMethod(this, _ReadEntry_instances, slurp_fn2).call(this, ex);
|
|
11391
9222
|
}
|
|
11392
9223
|
if (gex) {
|
|
11393
|
-
__privateMethod(this,
|
|
9224
|
+
__privateMethod(this, _ReadEntry_instances, slurp_fn2).call(this, gex, true);
|
|
11394
9225
|
}
|
|
11395
9226
|
}
|
|
11396
9227
|
write(data) {
|
|
@@ -11411,7 +9242,7 @@ var ReadEntry = class extends Minipass3 {
|
|
|
11411
9242
|
return super.write(data.subarray(0, r));
|
|
11412
9243
|
}
|
|
11413
9244
|
};
|
|
11414
|
-
|
|
9245
|
+
_ReadEntry_instances = new WeakSet();
|
|
11415
9246
|
slurp_fn2 = function(ex, gex = false) {
|
|
11416
9247
|
if (ex.path)
|
|
11417
9248
|
ex.path = normalizeWindowsPath(ex.path);
|
|
@@ -11457,7 +9288,7 @@ var EX = Symbol("extendedHeader");
|
|
|
11457
9288
|
var GEX = Symbol("globalExtendedHeader");
|
|
11458
9289
|
var META = Symbol("meta");
|
|
11459
9290
|
var EMITMETA = Symbol("emitMeta");
|
|
11460
|
-
var
|
|
9291
|
+
var BUFFER2 = Symbol("buffer");
|
|
11461
9292
|
var QUEUE = Symbol("queue");
|
|
11462
9293
|
var ENDED = Symbol("ended");
|
|
11463
9294
|
var EMITTEDEND = Symbol("emittedEnd");
|
|
@@ -11472,14 +9303,14 @@ var CONSUMING = Symbol("consuming");
|
|
|
11472
9303
|
var BUFFERCONCAT = Symbol("bufferConcat");
|
|
11473
9304
|
var MAYBEEND = Symbol("maybeEnd");
|
|
11474
9305
|
var WRITING = Symbol("writing");
|
|
11475
|
-
var
|
|
9306
|
+
var ABORTED2 = Symbol("aborted");
|
|
11476
9307
|
var DONE = Symbol("onDone");
|
|
11477
9308
|
var SAW_VALID_ENTRY = Symbol("sawValidEntry");
|
|
11478
9309
|
var SAW_NULL_BLOCK = Symbol("sawNullBlock");
|
|
11479
9310
|
var SAW_EOF = Symbol("sawEOF");
|
|
11480
9311
|
var CLOSESTREAM = Symbol("closeStream");
|
|
11481
9312
|
var noop = () => true;
|
|
11482
|
-
var Parser = class extends
|
|
9313
|
+
var Parser = class extends EE2 {
|
|
11483
9314
|
file;
|
|
11484
9315
|
strict;
|
|
11485
9316
|
maxMetaEntrySize;
|
|
@@ -11488,7 +9319,7 @@ var Parser = class extends EE3 {
|
|
|
11488
9319
|
writable = true;
|
|
11489
9320
|
readable = false;
|
|
11490
9321
|
[QUEUE] = new Yallist();
|
|
11491
|
-
[
|
|
9322
|
+
[BUFFER2];
|
|
11492
9323
|
[READENTRY];
|
|
11493
9324
|
[WRITEENTRY];
|
|
11494
9325
|
[STATE] = "begin";
|
|
@@ -11497,7 +9328,7 @@ var Parser = class extends EE3 {
|
|
|
11497
9328
|
[GEX];
|
|
11498
9329
|
[ENDED] = false;
|
|
11499
9330
|
[UNZIP];
|
|
11500
|
-
[
|
|
9331
|
+
[ABORTED2] = false;
|
|
11501
9332
|
[SAW_VALID_ENTRY];
|
|
11502
9333
|
[SAW_NULL_BLOCK] = false;
|
|
11503
9334
|
[SAW_EOF] = false;
|
|
@@ -11719,23 +9550,36 @@ var Parser = class extends EE3 {
|
|
|
11719
9550
|
}
|
|
11720
9551
|
}
|
|
11721
9552
|
abort(error) {
|
|
11722
|
-
this[
|
|
9553
|
+
this[ABORTED2] = true;
|
|
11723
9554
|
this.emit("abort", error);
|
|
11724
9555
|
this.warn("TAR_ABORT", error, { recoverable: false });
|
|
11725
9556
|
}
|
|
11726
|
-
write(chunk) {
|
|
9557
|
+
write(chunk, encoding, cb) {
|
|
11727
9558
|
var _a;
|
|
11728
|
-
if (
|
|
11729
|
-
|
|
9559
|
+
if (typeof encoding === "function") {
|
|
9560
|
+
cb = encoding;
|
|
9561
|
+
encoding = void 0;
|
|
9562
|
+
}
|
|
9563
|
+
if (typeof chunk === "string") {
|
|
9564
|
+
chunk = Buffer.from(
|
|
9565
|
+
chunk,
|
|
9566
|
+
/* c8 ignore next */
|
|
9567
|
+
typeof encoding === "string" ? encoding : "utf8"
|
|
9568
|
+
);
|
|
9569
|
+
}
|
|
9570
|
+
if (this[ABORTED2]) {
|
|
9571
|
+
cb == null ? void 0 : cb();
|
|
9572
|
+
return false;
|
|
11730
9573
|
}
|
|
11731
9574
|
const needSniff = this[UNZIP] === void 0 || this.brotli === void 0 && this[UNZIP] === false;
|
|
11732
9575
|
if (needSniff && chunk) {
|
|
11733
|
-
if (this[
|
|
11734
|
-
chunk = Buffer.concat([this[
|
|
11735
|
-
this[
|
|
9576
|
+
if (this[BUFFER2]) {
|
|
9577
|
+
chunk = Buffer.concat([this[BUFFER2], chunk]);
|
|
9578
|
+
this[BUFFER2] = void 0;
|
|
11736
9579
|
}
|
|
11737
9580
|
if (chunk.length < gzipHeader.length) {
|
|
11738
|
-
this[
|
|
9581
|
+
this[BUFFER2] = chunk;
|
|
9582
|
+
cb == null ? void 0 : cb();
|
|
11739
9583
|
return true;
|
|
11740
9584
|
}
|
|
11741
9585
|
for (let i = 0; this[UNZIP] === void 0 && i < gzipHeader.length; i++) {
|
|
@@ -11749,7 +9593,8 @@ var Parser = class extends EE3 {
|
|
|
11749
9593
|
if (this[ENDED]) {
|
|
11750
9594
|
this.brotli = true;
|
|
11751
9595
|
} else {
|
|
11752
|
-
this[
|
|
9596
|
+
this[BUFFER2] = chunk;
|
|
9597
|
+
cb == null ? void 0 : cb();
|
|
11753
9598
|
return true;
|
|
11754
9599
|
}
|
|
11755
9600
|
} else {
|
|
@@ -11772,8 +9617,9 @@ var Parser = class extends EE3 {
|
|
|
11772
9617
|
this[CONSUMECHUNK]();
|
|
11773
9618
|
});
|
|
11774
9619
|
this[WRITING] = true;
|
|
11775
|
-
const ret2 = this[UNZIP][ended ? "end" : "write"](chunk);
|
|
9620
|
+
const ret2 = !!this[UNZIP][ended ? "end" : "write"](chunk);
|
|
11776
9621
|
this[WRITING] = false;
|
|
9622
|
+
cb == null ? void 0 : cb();
|
|
11777
9623
|
return ret2;
|
|
11778
9624
|
}
|
|
11779
9625
|
}
|
|
@@ -11788,22 +9634,23 @@ var Parser = class extends EE3 {
|
|
|
11788
9634
|
if (!ret && !this[QUEUE].length) {
|
|
11789
9635
|
(_a = this[READENTRY]) == null ? void 0 : _a.once("drain", () => this.emit("drain"));
|
|
11790
9636
|
}
|
|
9637
|
+
cb == null ? void 0 : cb();
|
|
11791
9638
|
return ret;
|
|
11792
9639
|
}
|
|
11793
9640
|
[BUFFERCONCAT](c) {
|
|
11794
|
-
if (c && !this[
|
|
11795
|
-
this[
|
|
9641
|
+
if (c && !this[ABORTED2]) {
|
|
9642
|
+
this[BUFFER2] = this[BUFFER2] ? Buffer.concat([this[BUFFER2], c]) : c;
|
|
11796
9643
|
}
|
|
11797
9644
|
}
|
|
11798
9645
|
[MAYBEEND]() {
|
|
11799
|
-
if (this[ENDED] && !this[EMITTEDEND] && !this[
|
|
9646
|
+
if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED2] && !this[CONSUMING]) {
|
|
11800
9647
|
this[EMITTEDEND] = true;
|
|
11801
9648
|
const entry = this[WRITEENTRY];
|
|
11802
9649
|
if (entry && entry.blockRemain) {
|
|
11803
|
-
const have = this[
|
|
9650
|
+
const have = this[BUFFER2] ? this[BUFFER2].length : 0;
|
|
11804
9651
|
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry });
|
|
11805
|
-
if (this[
|
|
11806
|
-
entry.write(this[
|
|
9652
|
+
if (this[BUFFER2]) {
|
|
9653
|
+
entry.write(this[BUFFER2]);
|
|
11807
9654
|
}
|
|
11808
9655
|
entry.end();
|
|
11809
9656
|
}
|
|
@@ -11814,33 +9661,33 @@ var Parser = class extends EE3 {
|
|
|
11814
9661
|
var _a;
|
|
11815
9662
|
if (this[CONSUMING] && chunk) {
|
|
11816
9663
|
this[BUFFERCONCAT](chunk);
|
|
11817
|
-
} else if (!chunk && !this[
|
|
9664
|
+
} else if (!chunk && !this[BUFFER2]) {
|
|
11818
9665
|
this[MAYBEEND]();
|
|
11819
9666
|
} else if (chunk) {
|
|
11820
9667
|
this[CONSUMING] = true;
|
|
11821
|
-
if (this[
|
|
9668
|
+
if (this[BUFFER2]) {
|
|
11822
9669
|
this[BUFFERCONCAT](chunk);
|
|
11823
|
-
const c = this[
|
|
11824
|
-
this[
|
|
9670
|
+
const c = this[BUFFER2];
|
|
9671
|
+
this[BUFFER2] = void 0;
|
|
11825
9672
|
this[CONSUMECHUNKSUB](c);
|
|
11826
9673
|
} else {
|
|
11827
9674
|
this[CONSUMECHUNKSUB](chunk);
|
|
11828
9675
|
}
|
|
11829
|
-
while (this[
|
|
11830
|
-
const c = this[
|
|
11831
|
-
this[
|
|
9676
|
+
while (this[BUFFER2] && ((_a = this[BUFFER2]) == null ? void 0 : _a.length) >= 512 && !this[ABORTED2] && !this[SAW_EOF]) {
|
|
9677
|
+
const c = this[BUFFER2];
|
|
9678
|
+
this[BUFFER2] = void 0;
|
|
11832
9679
|
this[CONSUMECHUNKSUB](c);
|
|
11833
9680
|
}
|
|
11834
9681
|
this[CONSUMING] = false;
|
|
11835
9682
|
}
|
|
11836
|
-
if (!this[
|
|
9683
|
+
if (!this[BUFFER2] || this[ENDED]) {
|
|
11837
9684
|
this[MAYBEEND]();
|
|
11838
9685
|
}
|
|
11839
9686
|
}
|
|
11840
9687
|
[CONSUMECHUNKSUB](chunk) {
|
|
11841
9688
|
let position = 0;
|
|
11842
9689
|
const length = chunk.length;
|
|
11843
|
-
while (position + 512 <= length && !this[
|
|
9690
|
+
while (position + 512 <= length && !this[ABORTED2] && !this[SAW_EOF]) {
|
|
11844
9691
|
switch (this[STATE]) {
|
|
11845
9692
|
case "begin":
|
|
11846
9693
|
case "header":
|
|
@@ -11859,18 +9706,32 @@ var Parser = class extends EE3 {
|
|
|
11859
9706
|
}
|
|
11860
9707
|
}
|
|
11861
9708
|
if (position < length) {
|
|
11862
|
-
if (this[
|
|
11863
|
-
this[
|
|
9709
|
+
if (this[BUFFER2]) {
|
|
9710
|
+
this[BUFFER2] = Buffer.concat([
|
|
11864
9711
|
chunk.subarray(position),
|
|
11865
|
-
this[
|
|
9712
|
+
this[BUFFER2]
|
|
11866
9713
|
]);
|
|
11867
9714
|
} else {
|
|
11868
|
-
this[
|
|
9715
|
+
this[BUFFER2] = chunk.subarray(position);
|
|
11869
9716
|
}
|
|
11870
9717
|
}
|
|
11871
9718
|
}
|
|
11872
|
-
end(chunk) {
|
|
11873
|
-
if (
|
|
9719
|
+
end(chunk, encoding, cb) {
|
|
9720
|
+
if (typeof chunk === "function") {
|
|
9721
|
+
cb = chunk;
|
|
9722
|
+
encoding = void 0;
|
|
9723
|
+
chunk = void 0;
|
|
9724
|
+
}
|
|
9725
|
+
if (typeof encoding === "function") {
|
|
9726
|
+
cb = encoding;
|
|
9727
|
+
encoding = void 0;
|
|
9728
|
+
}
|
|
9729
|
+
if (typeof chunk === "string") {
|
|
9730
|
+
chunk = Buffer.from(chunk, encoding);
|
|
9731
|
+
}
|
|
9732
|
+
if (cb)
|
|
9733
|
+
this.once("finish", cb);
|
|
9734
|
+
if (!this[ABORTED2]) {
|
|
11874
9735
|
if (this[UNZIP]) {
|
|
11875
9736
|
if (chunk)
|
|
11876
9737
|
this[UNZIP].write(chunk);
|
|
@@ -11884,6 +9745,7 @@ var Parser = class extends EE3 {
|
|
|
11884
9745
|
this[MAYBEEND]();
|
|
11885
9746
|
}
|
|
11886
9747
|
}
|
|
9748
|
+
return this;
|
|
11887
9749
|
}
|
|
11888
9750
|
};
|
|
11889
9751
|
|
|
@@ -12077,7 +9939,7 @@ var DIRECTORY = Symbol("directory");
|
|
|
12077
9939
|
var SYMLINK = Symbol("symlink");
|
|
12078
9940
|
var HARDLINK = Symbol("hardlink");
|
|
12079
9941
|
var HEADER = Symbol("header");
|
|
12080
|
-
var
|
|
9942
|
+
var READ2 = Symbol("read");
|
|
12081
9943
|
var LSTAT = Symbol("lstat");
|
|
12082
9944
|
var ONLSTAT = Symbol("onlstat");
|
|
12083
9945
|
var ONREAD = Symbol("onread");
|
|
@@ -12090,7 +9952,7 @@ var AWAITDRAIN = Symbol("awaitDrain");
|
|
|
12090
9952
|
var ONDRAIN = Symbol("ondrain");
|
|
12091
9953
|
var PREFIX = Symbol("prefix");
|
|
12092
9954
|
var _hadError;
|
|
12093
|
-
var WriteEntry = class extends
|
|
9955
|
+
var WriteEntry = class extends Minipass {
|
|
12094
9956
|
constructor(p, opt_ = {}) {
|
|
12095
9957
|
const opt = dealias(opt_);
|
|
12096
9958
|
super();
|
|
@@ -12338,9 +10200,9 @@ var WriteEntry = class extends Minipass3 {
|
|
|
12338
10200
|
this.pos = 0;
|
|
12339
10201
|
this.remain = this.stat.size;
|
|
12340
10202
|
this.length = this.buf.length;
|
|
12341
|
-
this[
|
|
10203
|
+
this[READ2]();
|
|
12342
10204
|
}
|
|
12343
|
-
[
|
|
10205
|
+
[READ2]() {
|
|
12344
10206
|
const { fd, buf, offset, length, pos: pos2 } = this;
|
|
12345
10207
|
if (fd === void 0 || buf === void 0) {
|
|
12346
10208
|
throw new Error("cannot read file without first opening");
|
|
@@ -12385,8 +10247,8 @@ var WriteEntry = class extends Minipass3 {
|
|
|
12385
10247
|
this.remain++;
|
|
12386
10248
|
}
|
|
12387
10249
|
}
|
|
12388
|
-
const
|
|
12389
|
-
const flushed = this.write(
|
|
10250
|
+
const chunk = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + bytesRead);
|
|
10251
|
+
const flushed = this.write(chunk);
|
|
12390
10252
|
if (!flushed) {
|
|
12391
10253
|
this[AWAITDRAIN](() => this[ONDRAIN]());
|
|
12392
10254
|
} else {
|
|
@@ -12396,18 +10258,25 @@ var WriteEntry = class extends Minipass3 {
|
|
|
12396
10258
|
[AWAITDRAIN](cb) {
|
|
12397
10259
|
this.once("drain", cb);
|
|
12398
10260
|
}
|
|
12399
|
-
write(
|
|
12400
|
-
if (
|
|
10261
|
+
write(chunk, encoding, cb) {
|
|
10262
|
+
if (typeof encoding === "function") {
|
|
10263
|
+
cb = encoding;
|
|
10264
|
+
encoding = void 0;
|
|
10265
|
+
}
|
|
10266
|
+
if (typeof chunk === "string") {
|
|
10267
|
+
chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8");
|
|
10268
|
+
}
|
|
10269
|
+
if (this.blockRemain < chunk.length) {
|
|
12401
10270
|
const er = Object.assign(new Error("writing more data than expected"), {
|
|
12402
10271
|
path: this.absolute
|
|
12403
10272
|
});
|
|
12404
10273
|
return this.emit("error", er);
|
|
12405
10274
|
}
|
|
12406
|
-
this.remain -=
|
|
12407
|
-
this.blockRemain -=
|
|
12408
|
-
this.pos +=
|
|
12409
|
-
this.offset +=
|
|
12410
|
-
return super.write(
|
|
10275
|
+
this.remain -= chunk.length;
|
|
10276
|
+
this.blockRemain -= chunk.length;
|
|
10277
|
+
this.pos += chunk.length;
|
|
10278
|
+
this.offset += chunk.length;
|
|
10279
|
+
return super.write(chunk, null, cb);
|
|
12411
10280
|
}
|
|
12412
10281
|
[ONDRAIN]() {
|
|
12413
10282
|
if (!this.remain) {
|
|
@@ -12424,7 +10293,7 @@ var WriteEntry = class extends Minipass3 {
|
|
|
12424
10293
|
this.offset = 0;
|
|
12425
10294
|
}
|
|
12426
10295
|
this.length = this.buf.length - this.offset;
|
|
12427
|
-
this[
|
|
10296
|
+
this[READ2]();
|
|
12428
10297
|
}
|
|
12429
10298
|
};
|
|
12430
10299
|
_hadError = new WeakMap();
|
|
@@ -12438,7 +10307,7 @@ var WriteEntrySync = class extends WriteEntry {
|
|
|
12438
10307
|
[OPENFILE]() {
|
|
12439
10308
|
this[ONOPENFILE](fs4.openSync(this.absolute, "r"));
|
|
12440
10309
|
}
|
|
12441
|
-
[
|
|
10310
|
+
[READ2]() {
|
|
12442
10311
|
let threw = true;
|
|
12443
10312
|
try {
|
|
12444
10313
|
const { fd, buf, offset, length, pos: pos2 } = this;
|
|
@@ -12469,7 +10338,7 @@ var WriteEntrySync = class extends WriteEntry {
|
|
|
12469
10338
|
cb();
|
|
12470
10339
|
}
|
|
12471
10340
|
};
|
|
12472
|
-
var WriteEntryTar = class extends
|
|
10341
|
+
var WriteEntryTar = class extends Minipass {
|
|
12473
10342
|
blockLen = 0;
|
|
12474
10343
|
blockRemain = 0;
|
|
12475
10344
|
buf = 0;
|
|
@@ -12591,19 +10460,41 @@ var WriteEntryTar = class extends Minipass3 {
|
|
|
12591
10460
|
[MODE](mode) {
|
|
12592
10461
|
return modeFix(mode, this.type === "Directory", this.portable);
|
|
12593
10462
|
}
|
|
12594
|
-
write(
|
|
12595
|
-
|
|
10463
|
+
write(chunk, encoding, cb) {
|
|
10464
|
+
if (typeof encoding === "function") {
|
|
10465
|
+
cb = encoding;
|
|
10466
|
+
encoding = void 0;
|
|
10467
|
+
}
|
|
10468
|
+
if (typeof chunk === "string") {
|
|
10469
|
+
chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8");
|
|
10470
|
+
}
|
|
10471
|
+
const writeLen = chunk.length;
|
|
12596
10472
|
if (writeLen > this.blockRemain) {
|
|
12597
10473
|
throw new Error("writing more to entry than is appropriate");
|
|
12598
10474
|
}
|
|
12599
10475
|
this.blockRemain -= writeLen;
|
|
12600
|
-
return super.write(
|
|
10476
|
+
return super.write(chunk, cb);
|
|
12601
10477
|
}
|
|
12602
|
-
end() {
|
|
10478
|
+
end(chunk, encoding, cb) {
|
|
12603
10479
|
if (this.blockRemain) {
|
|
12604
10480
|
super.write(Buffer.alloc(this.blockRemain));
|
|
12605
10481
|
}
|
|
12606
|
-
|
|
10482
|
+
if (typeof chunk === "function") {
|
|
10483
|
+
cb = chunk;
|
|
10484
|
+
encoding = void 0;
|
|
10485
|
+
chunk = void 0;
|
|
10486
|
+
}
|
|
10487
|
+
if (typeof encoding === "function") {
|
|
10488
|
+
cb = encoding;
|
|
10489
|
+
encoding = void 0;
|
|
10490
|
+
}
|
|
10491
|
+
if (typeof chunk === "string") {
|
|
10492
|
+
chunk = Buffer.from(chunk, encoding ?? "utf8");
|
|
10493
|
+
}
|
|
10494
|
+
if (cb)
|
|
10495
|
+
this.once("finish", cb);
|
|
10496
|
+
chunk ? super.end(chunk, cb) : super.end(cb);
|
|
10497
|
+
return this;
|
|
12607
10498
|
}
|
|
12608
10499
|
};
|
|
12609
10500
|
var getType = (stat2) => stat2.isFile() ? "File" : stat2.isDirectory() ? "Directory" : stat2.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
|
|
@@ -12624,7 +10515,7 @@ var PackJob = class {
|
|
|
12624
10515
|
this.absolute = absolute;
|
|
12625
10516
|
}
|
|
12626
10517
|
};
|
|
12627
|
-
var
|
|
10518
|
+
var EOF2 = Buffer.alloc(1024);
|
|
12628
10519
|
var ONSTAT = Symbol("onStat");
|
|
12629
10520
|
var ENDED2 = Symbol("ended");
|
|
12630
10521
|
var QUEUE2 = Symbol("queue");
|
|
@@ -12645,7 +10536,7 @@ var ENTRYOPT = Symbol("entryOpt");
|
|
|
12645
10536
|
var WRITEENTRYCLASS = Symbol("writeEntryClass");
|
|
12646
10537
|
var WRITE = Symbol("write");
|
|
12647
10538
|
var ONDRAIN2 = Symbol("ondrain");
|
|
12648
|
-
var Pack = class extends
|
|
10539
|
+
var Pack = class extends Minipass {
|
|
12649
10540
|
opt;
|
|
12650
10541
|
cwd;
|
|
12651
10542
|
maxReadSize;
|
|
@@ -12830,9 +10721,9 @@ var Pack = class extends Minipass3 {
|
|
|
12830
10721
|
this[PROCESSING] = false;
|
|
12831
10722
|
if (this[ENDED2] && !this[QUEUE2].length && this[JOBS] === 0) {
|
|
12832
10723
|
if (this.zip) {
|
|
12833
|
-
this.zip.end(
|
|
10724
|
+
this.zip.end(EOF2);
|
|
12834
10725
|
} else {
|
|
12835
|
-
super.write(
|
|
10726
|
+
super.write(EOF2);
|
|
12836
10727
|
super.end();
|
|
12837
10728
|
}
|
|
12838
10729
|
}
|
|
@@ -13545,15 +11436,10 @@ var getDirs = (path13) => {
|
|
|
13545
11436
|
}, []);
|
|
13546
11437
|
return dirs;
|
|
13547
11438
|
};
|
|
13548
|
-
var _queues, _reservations, _running,
|
|
11439
|
+
var _queues, _reservations, _running, _PathReservations_instances, getQueues_fn, run_fn, clear_fn;
|
|
13549
11440
|
var PathReservations = class {
|
|
13550
11441
|
constructor() {
|
|
13551
|
-
|
|
13552
|
-
// fn => {paths, dirs}
|
|
13553
|
-
__privateAdd(this, _getQueues);
|
|
13554
|
-
// run the function if it's first in line and not already running
|
|
13555
|
-
__privateAdd(this, _run);
|
|
13556
|
-
__privateAdd(this, _clear);
|
|
11442
|
+
__privateAdd(this, _PathReservations_instances);
|
|
13557
11443
|
// path => [function or Set]
|
|
13558
11444
|
// A Set object means a directory reservation
|
|
13559
11445
|
// A fn is a direct reservation on that path
|
|
@@ -13590,19 +11476,21 @@ var PathReservations = class {
|
|
|
13590
11476
|
}
|
|
13591
11477
|
}
|
|
13592
11478
|
}
|
|
13593
|
-
return __privateMethod(this,
|
|
11479
|
+
return __privateMethod(this, _PathReservations_instances, run_fn).call(this, fn);
|
|
13594
11480
|
}
|
|
13595
11481
|
// check if fn is first in line for all its paths, and is
|
|
13596
11482
|
// included in the first set for all its dir queues
|
|
13597
11483
|
check(fn) {
|
|
13598
|
-
const { paths, dirs } = __privateMethod(this,
|
|
11484
|
+
const { paths, dirs } = __privateMethod(this, _PathReservations_instances, getQueues_fn).call(this, fn);
|
|
13599
11485
|
return paths.every((q) => q && q[0] === fn) && dirs.every((q) => q && q[0] instanceof Set && q[0].has(fn));
|
|
13600
11486
|
}
|
|
13601
11487
|
};
|
|
13602
11488
|
_queues = new WeakMap();
|
|
13603
11489
|
_reservations = new WeakMap();
|
|
13604
11490
|
_running = new WeakMap();
|
|
13605
|
-
|
|
11491
|
+
_PathReservations_instances = new WeakSet();
|
|
11492
|
+
// return the queues for each path the function cares about
|
|
11493
|
+
// fn => {paths, dirs}
|
|
13606
11494
|
getQueues_fn = function(fn) {
|
|
13607
11495
|
const res = __privateGet(this, _reservations).get(fn);
|
|
13608
11496
|
if (!res) {
|
|
@@ -13613,16 +11501,15 @@ getQueues_fn = function(fn) {
|
|
|
13613
11501
|
dirs: [...res.dirs].map((path13) => __privateGet(this, _queues).get(path13))
|
|
13614
11502
|
};
|
|
13615
11503
|
};
|
|
13616
|
-
|
|
11504
|
+
// run the function if it's first in line and not already running
|
|
13617
11505
|
run_fn = function(fn) {
|
|
13618
11506
|
if (__privateGet(this, _running).has(fn) || !this.check(fn)) {
|
|
13619
11507
|
return false;
|
|
13620
11508
|
}
|
|
13621
11509
|
__privateGet(this, _running).add(fn);
|
|
13622
|
-
fn(() => __privateMethod(this,
|
|
11510
|
+
fn(() => __privateMethod(this, _PathReservations_instances, clear_fn).call(this, fn));
|
|
13623
11511
|
return true;
|
|
13624
11512
|
};
|
|
13625
|
-
_clear = new WeakSet();
|
|
13626
11513
|
clear_fn = function(fn) {
|
|
13627
11514
|
if (!__privateGet(this, _running).has(fn)) {
|
|
13628
11515
|
return false;
|
|
@@ -13671,7 +11558,7 @@ clear_fn = function(fn) {
|
|
|
13671
11558
|
}
|
|
13672
11559
|
}
|
|
13673
11560
|
__privateGet(this, _running).delete(fn);
|
|
13674
|
-
next.forEach((fn2) => __privateMethod(this,
|
|
11561
|
+
next.forEach((fn2) => __privateMethod(this, _PathReservations_instances, run_fn).call(this, fn2));
|
|
13675
11562
|
return true;
|
|
13676
11563
|
};
|
|
13677
11564
|
|
|
@@ -15392,21 +13279,20 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
15392
13279
|
unload() {
|
|
15393
13280
|
}
|
|
15394
13281
|
};
|
|
15395
|
-
var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded,
|
|
13282
|
+
var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
|
|
15396
13283
|
var SignalExit = class extends SignalExitBase {
|
|
15397
13284
|
constructor(process8) {
|
|
15398
13285
|
super();
|
|
15399
|
-
__privateAdd(this,
|
|
15400
|
-
__privateAdd(this, _processEmit);
|
|
13286
|
+
__privateAdd(this, _SignalExit_instances);
|
|
15401
13287
|
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
15402
13288
|
// so use a supported signal instead
|
|
15403
13289
|
/* c8 ignore start */
|
|
15404
13290
|
__privateAdd(this, _hupSig, process5.platform === "win32" ? "SIGINT" : "SIGHUP");
|
|
15405
13291
|
/* c8 ignore stop */
|
|
15406
13292
|
__privateAdd(this, _emitter, new Emitter());
|
|
15407
|
-
__privateAdd(this, _process
|
|
15408
|
-
__privateAdd(this, _originalProcessEmit
|
|
15409
|
-
__privateAdd(this, _originalProcessReallyExit
|
|
13293
|
+
__privateAdd(this, _process);
|
|
13294
|
+
__privateAdd(this, _originalProcessEmit);
|
|
13295
|
+
__privateAdd(this, _originalProcessReallyExit);
|
|
15410
13296
|
__privateAdd(this, _sigListeners, {});
|
|
15411
13297
|
__privateAdd(this, _loaded, false);
|
|
15412
13298
|
__privateSet(this, _process, process8);
|
|
@@ -15463,10 +13349,10 @@ var SignalExit = class extends SignalExitBase {
|
|
|
15463
13349
|
}
|
|
15464
13350
|
}
|
|
15465
13351
|
__privateGet(this, _process).emit = (ev, ...a) => {
|
|
15466
|
-
return __privateMethod(this,
|
|
13352
|
+
return __privateMethod(this, _SignalExit_instances, processEmit_fn).call(this, ev, ...a);
|
|
15467
13353
|
};
|
|
15468
13354
|
__privateGet(this, _process).reallyExit = (code2) => {
|
|
15469
|
-
return __privateMethod(this,
|
|
13355
|
+
return __privateMethod(this, _SignalExit_instances, processReallyExit_fn).call(this, code2);
|
|
15470
13356
|
};
|
|
15471
13357
|
}
|
|
15472
13358
|
unload() {
|
|
@@ -15496,7 +13382,7 @@ _originalProcessEmit = new WeakMap();
|
|
|
15496
13382
|
_originalProcessReallyExit = new WeakMap();
|
|
15497
13383
|
_sigListeners = new WeakMap();
|
|
15498
13384
|
_loaded = new WeakMap();
|
|
15499
|
-
|
|
13385
|
+
_SignalExit_instances = new WeakSet();
|
|
15500
13386
|
processReallyExit_fn = function(code2) {
|
|
15501
13387
|
if (!processOk(__privateGet(this, _process))) {
|
|
15502
13388
|
return 0;
|
|
@@ -15505,7 +13391,6 @@ processReallyExit_fn = function(code2) {
|
|
|
15505
13391
|
__privateGet(this, _emitter).emit("exit", __privateGet(this, _process).exitCode, null);
|
|
15506
13392
|
return __privateGet(this, _originalProcessReallyExit).call(__privateGet(this, _process), __privateGet(this, _process).exitCode);
|
|
15507
13393
|
};
|
|
15508
|
-
_processEmit = new WeakSet();
|
|
15509
13394
|
processEmit_fn = function(ev, ...args) {
|
|
15510
13395
|
const og = __privateGet(this, _originalProcessEmit);
|
|
15511
13396
|
if (ev === "exit" && processOk(__privateGet(this, _process))) {
|
|
@@ -15626,11 +13511,11 @@ import { createWriteStream } from "fs";
|
|
|
15626
13511
|
import { ChildProcess } from "child_process";
|
|
15627
13512
|
|
|
15628
13513
|
// node_modules/execa/node_modules/is-stream/index.js
|
|
15629
|
-
function
|
|
13514
|
+
function isStream2(stream) {
|
|
15630
13515
|
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
15631
13516
|
}
|
|
15632
13517
|
function isWritableStream(stream) {
|
|
15633
|
-
return
|
|
13518
|
+
return isStream2(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
15634
13519
|
}
|
|
15635
13520
|
|
|
15636
13521
|
// node_modules/execa/lib/pipe.js
|
|
@@ -15868,7 +13753,7 @@ var getInputSync = ({ input, inputFile }) => {
|
|
|
15868
13753
|
};
|
|
15869
13754
|
var handleInputSync = (options) => {
|
|
15870
13755
|
const input = getInputSync(options);
|
|
15871
|
-
if (
|
|
13756
|
+
if (isStream2(input)) {
|
|
15872
13757
|
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
15873
13758
|
}
|
|
15874
13759
|
return input;
|
|
@@ -15885,7 +13770,7 @@ var handleInput = (spawned, options) => {
|
|
|
15885
13770
|
if (input === void 0) {
|
|
15886
13771
|
return;
|
|
15887
13772
|
}
|
|
15888
|
-
if (
|
|
13773
|
+
if (isStream2(input)) {
|
|
15889
13774
|
input.pipe(spawned.stdin);
|
|
15890
13775
|
} else {
|
|
15891
13776
|
spawned.stdin.end(input);
|