@jsii/runtime 1.69.0 → 1.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/host.js +4 -1
- package/package.json +8 -8
- package/webpack/bin/jsii-runtime.js +81 -41
- package/webpack/lib/program.js +831 -263
package/webpack/lib/program.js
CHANGED
|
@@ -2621,13 +2621,23 @@ var __webpack_modules__ = {
|
|
|
2621
2621
|
const t = __webpack_require__(1090);
|
|
2622
2622
|
const path = __webpack_require__(4822);
|
|
2623
2623
|
module.exports = (opt_, files, cb) => {
|
|
2624
|
-
if (typeof files === "function")
|
|
2625
|
-
|
|
2626
|
-
|
|
2624
|
+
if (typeof files === "function") {
|
|
2625
|
+
cb = files;
|
|
2626
|
+
}
|
|
2627
|
+
if (Array.isArray(opt_)) {
|
|
2628
|
+
files = opt_, opt_ = {};
|
|
2629
|
+
}
|
|
2630
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
|
2631
|
+
throw new TypeError("no files or directories specified");
|
|
2632
|
+
}
|
|
2627
2633
|
files = Array.from(files);
|
|
2628
2634
|
const opt = hlo(opt_);
|
|
2629
|
-
if (opt.sync && typeof cb === "function")
|
|
2630
|
-
|
|
2635
|
+
if (opt.sync && typeof cb === "function") {
|
|
2636
|
+
throw new TypeError("callback not supported for sync tar functions");
|
|
2637
|
+
}
|
|
2638
|
+
if (!opt.file && typeof cb === "function") {
|
|
2639
|
+
throw new TypeError("callback only supported with file option");
|
|
2640
|
+
}
|
|
2631
2641
|
return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files);
|
|
2632
2642
|
};
|
|
2633
2643
|
const createFileSync = (opt, files) => {
|
|
@@ -2656,12 +2666,14 @@ var __webpack_modules__ = {
|
|
|
2656
2666
|
files.forEach((file => {
|
|
2657
2667
|
if (file.charAt(0) === "@") {
|
|
2658
2668
|
t({
|
|
2659
|
-
file: path.resolve(p.cwd, file.
|
|
2669
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
2660
2670
|
sync: true,
|
|
2661
2671
|
noResume: true,
|
|
2662
2672
|
onentry: entry => p.add(entry)
|
|
2663
2673
|
});
|
|
2664
|
-
} else
|
|
2674
|
+
} else {
|
|
2675
|
+
p.add(file);
|
|
2676
|
+
}
|
|
2665
2677
|
}));
|
|
2666
2678
|
p.end();
|
|
2667
2679
|
};
|
|
@@ -2670,11 +2682,13 @@ var __webpack_modules__ = {
|
|
|
2670
2682
|
const file = files.shift();
|
|
2671
2683
|
if (file.charAt(0) === "@") {
|
|
2672
2684
|
return t({
|
|
2673
|
-
file: path.resolve(p.cwd, file.
|
|
2685
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
2674
2686
|
noResume: true,
|
|
2675
2687
|
onentry: entry => p.add(entry)
|
|
2676
2688
|
}).then((_ => addFilesAsync(p, files)));
|
|
2677
|
-
} else
|
|
2689
|
+
} else {
|
|
2690
|
+
p.add(file);
|
|
2691
|
+
}
|
|
2678
2692
|
}
|
|
2679
2693
|
p.end();
|
|
2680
2694
|
};
|
|
@@ -2698,14 +2712,29 @@ var __webpack_modules__ = {
|
|
|
2698
2712
|
const path = __webpack_require__(4822);
|
|
2699
2713
|
const stripSlash = __webpack_require__(6401);
|
|
2700
2714
|
module.exports = (opt_, files, cb) => {
|
|
2701
|
-
if (typeof opt_ === "function")
|
|
2702
|
-
|
|
2703
|
-
if (
|
|
2704
|
-
|
|
2715
|
+
if (typeof opt_ === "function") {
|
|
2716
|
+
cb = opt_, files = null, opt_ = {};
|
|
2717
|
+
} else if (Array.isArray(opt_)) {
|
|
2718
|
+
files = opt_, opt_ = {};
|
|
2719
|
+
}
|
|
2720
|
+
if (typeof files === "function") {
|
|
2721
|
+
cb = files, files = null;
|
|
2722
|
+
}
|
|
2723
|
+
if (!files) {
|
|
2724
|
+
files = [];
|
|
2725
|
+
} else {
|
|
2726
|
+
files = Array.from(files);
|
|
2727
|
+
}
|
|
2705
2728
|
const opt = hlo(opt_);
|
|
2706
|
-
if (opt.sync && typeof cb === "function")
|
|
2707
|
-
|
|
2708
|
-
|
|
2729
|
+
if (opt.sync && typeof cb === "function") {
|
|
2730
|
+
throw new TypeError("callback not supported for sync tar functions");
|
|
2731
|
+
}
|
|
2732
|
+
if (!opt.file && typeof cb === "function") {
|
|
2733
|
+
throw new TypeError("callback only supported with file option");
|
|
2734
|
+
}
|
|
2735
|
+
if (files.length) {
|
|
2736
|
+
filesFilter(opt, files);
|
|
2737
|
+
}
|
|
2709
2738
|
return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt);
|
|
2710
2739
|
};
|
|
2711
2740
|
const filesFilter = (opt, files) => {
|
|
@@ -2738,7 +2767,9 @@ var __webpack_modules__ = {
|
|
|
2738
2767
|
u.on("error", reject);
|
|
2739
2768
|
u.on("close", resolve);
|
|
2740
2769
|
fs.stat(file, ((er, stat) => {
|
|
2741
|
-
if (er)
|
|
2770
|
+
if (er) {
|
|
2771
|
+
reject(er);
|
|
2772
|
+
} else {
|
|
2742
2773
|
const stream = new fsm.ReadStream(file, {
|
|
2743
2774
|
readSize,
|
|
2744
2775
|
size: stat.size
|
|
@@ -2791,11 +2822,19 @@ var __webpack_modules__ = {
|
|
|
2791
2822
|
this.devmin = 0;
|
|
2792
2823
|
this.atime = null;
|
|
2793
2824
|
this.ctime = null;
|
|
2794
|
-
if (Buffer.isBuffer(data))
|
|
2825
|
+
if (Buffer.isBuffer(data)) {
|
|
2826
|
+
this.decode(data, off || 0, ex, gex);
|
|
2827
|
+
} else if (data) {
|
|
2828
|
+
this.set(data);
|
|
2829
|
+
}
|
|
2795
2830
|
}
|
|
2796
2831
|
decode(buf, off, ex, gex) {
|
|
2797
|
-
if (!off)
|
|
2798
|
-
|
|
2832
|
+
if (!off) {
|
|
2833
|
+
off = 0;
|
|
2834
|
+
}
|
|
2835
|
+
if (!buf || !(buf.length >= off + 512)) {
|
|
2836
|
+
throw new Error("need 512 bytes for header");
|
|
2837
|
+
}
|
|
2799
2838
|
this.path = decString(buf, off, 100);
|
|
2800
2839
|
this.mode = decNumber(buf, off + 100, 8);
|
|
2801
2840
|
this.uid = decNumber(buf, off + 108, 8);
|
|
@@ -2806,9 +2845,15 @@ var __webpack_modules__ = {
|
|
|
2806
2845
|
this[SLURP](ex);
|
|
2807
2846
|
this[SLURP](gex, true);
|
|
2808
2847
|
this[TYPE] = decString(buf, off + 156, 1);
|
|
2809
|
-
if (this[TYPE] === "")
|
|
2810
|
-
|
|
2811
|
-
|
|
2848
|
+
if (this[TYPE] === "") {
|
|
2849
|
+
this[TYPE] = "0";
|
|
2850
|
+
}
|
|
2851
|
+
if (this[TYPE] === "0" && this.path.slice(-1) === "/") {
|
|
2852
|
+
this[TYPE] = "5";
|
|
2853
|
+
}
|
|
2854
|
+
if (this[TYPE] === "5") {
|
|
2855
|
+
this.size = 0;
|
|
2856
|
+
}
|
|
2812
2857
|
this.linkpath = decString(buf, off + 157, 100);
|
|
2813
2858
|
if (buf.slice(off + 257, off + 265).toString() === "ustar\x0000") {
|
|
2814
2859
|
this.uname = decString(buf, off + 265, 32);
|
|
@@ -2820,20 +2865,30 @@ var __webpack_modules__ = {
|
|
|
2820
2865
|
this.path = prefix + "/" + this.path;
|
|
2821
2866
|
} else {
|
|
2822
2867
|
const prefix = decString(buf, off + 345, 130);
|
|
2823
|
-
if (prefix)
|
|
2868
|
+
if (prefix) {
|
|
2869
|
+
this.path = prefix + "/" + this.path;
|
|
2870
|
+
}
|
|
2824
2871
|
this.atime = decDate(buf, off + 476, 12);
|
|
2825
2872
|
this.ctime = decDate(buf, off + 488, 12);
|
|
2826
2873
|
}
|
|
2827
2874
|
}
|
|
2828
2875
|
let sum = 8 * 32;
|
|
2829
|
-
for (let i = off; i < off + 148; i++)
|
|
2830
|
-
|
|
2876
|
+
for (let i = off; i < off + 148; i++) {
|
|
2877
|
+
sum += buf[i];
|
|
2878
|
+
}
|
|
2879
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
2880
|
+
sum += buf[i];
|
|
2881
|
+
}
|
|
2831
2882
|
this.cksumValid = sum === this.cksum;
|
|
2832
|
-
if (this.cksum === null && sum === 8 * 32)
|
|
2883
|
+
if (this.cksum === null && sum === 8 * 32) {
|
|
2884
|
+
this.nullBlock = true;
|
|
2885
|
+
}
|
|
2833
2886
|
}
|
|
2834
2887
|
[SLURP](ex, global) {
|
|
2835
2888
|
for (const k in ex) {
|
|
2836
|
-
if (ex[k] !== null && ex[k] !== undefined && !(global && k === "path"))
|
|
2889
|
+
if (ex[k] !== null && ex[k] !== undefined && !(global && k === "path")) {
|
|
2890
|
+
this[k] = ex[k];
|
|
2891
|
+
}
|
|
2837
2892
|
}
|
|
2838
2893
|
}
|
|
2839
2894
|
encode(buf, off) {
|
|
@@ -2841,8 +2896,12 @@ var __webpack_modules__ = {
|
|
|
2841
2896
|
buf = this.block = Buffer.alloc(512);
|
|
2842
2897
|
off = 0;
|
|
2843
2898
|
}
|
|
2844
|
-
if (!off)
|
|
2845
|
-
|
|
2899
|
+
if (!off) {
|
|
2900
|
+
off = 0;
|
|
2901
|
+
}
|
|
2902
|
+
if (!(buf.length >= off + 512)) {
|
|
2903
|
+
throw new Error("need 512 bytes for header");
|
|
2904
|
+
}
|
|
2846
2905
|
const prefixSize = this.ctime || this.atime ? 130 : 155;
|
|
2847
2906
|
const split = splitPrefix(this.path || "", prefixSize);
|
|
2848
2907
|
const path = split[0];
|
|
@@ -2862,14 +2921,20 @@ var __webpack_modules__ = {
|
|
|
2862
2921
|
this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
|
|
2863
2922
|
this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
|
|
2864
2923
|
this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax;
|
|
2865
|
-
if (buf[off + 475] !== 0)
|
|
2924
|
+
if (buf[off + 475] !== 0) {
|
|
2925
|
+
this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax;
|
|
2926
|
+
} else {
|
|
2866
2927
|
this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax;
|
|
2867
2928
|
this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax;
|
|
2868
2929
|
this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax;
|
|
2869
2930
|
}
|
|
2870
2931
|
let sum = 8 * 32;
|
|
2871
|
-
for (let i = off; i < off + 148; i++)
|
|
2872
|
-
|
|
2932
|
+
for (let i = off; i < off + 148; i++) {
|
|
2933
|
+
sum += buf[i];
|
|
2934
|
+
}
|
|
2935
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
2936
|
+
sum += buf[i];
|
|
2937
|
+
}
|
|
2873
2938
|
this.cksum = sum;
|
|
2874
2939
|
encNumber(buf, off + 148, 8, this.cksum);
|
|
2875
2940
|
this.cksumValid = true;
|
|
@@ -2877,7 +2942,9 @@ var __webpack_modules__ = {
|
|
|
2877
2942
|
}
|
|
2878
2943
|
set(data) {
|
|
2879
2944
|
for (const i in data) {
|
|
2880
|
-
if (data[i] !== null && data[i] !== undefined)
|
|
2945
|
+
if (data[i] !== null && data[i] !== undefined) {
|
|
2946
|
+
this[i] = data[i];
|
|
2947
|
+
}
|
|
2881
2948
|
}
|
|
2882
2949
|
}
|
|
2883
2950
|
get type() {
|
|
@@ -2887,7 +2954,11 @@ var __webpack_modules__ = {
|
|
|
2887
2954
|
return this[TYPE];
|
|
2888
2955
|
}
|
|
2889
2956
|
set type(type) {
|
|
2890
|
-
if (types.code.has(type))
|
|
2957
|
+
if (types.code.has(type)) {
|
|
2958
|
+
this[TYPE] = types.code.get(type);
|
|
2959
|
+
} else {
|
|
2960
|
+
this[TYPE] = type;
|
|
2961
|
+
}
|
|
2891
2962
|
}
|
|
2892
2963
|
}
|
|
2893
2964
|
const splitPrefix = (p, prefixSize) => {
|
|
@@ -2896,16 +2967,24 @@ var __webpack_modules__ = {
|
|
|
2896
2967
|
let prefix = "";
|
|
2897
2968
|
let ret;
|
|
2898
2969
|
const root = pathModule.parse(p).root || ".";
|
|
2899
|
-
if (Buffer.byteLength(pp) < pathSize)
|
|
2970
|
+
if (Buffer.byteLength(pp) < pathSize) {
|
|
2971
|
+
ret = [ pp, prefix, false ];
|
|
2972
|
+
} else {
|
|
2900
2973
|
prefix = pathModule.dirname(pp);
|
|
2901
2974
|
pp = pathModule.basename(pp);
|
|
2902
2975
|
do {
|
|
2903
|
-
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize)
|
|
2976
|
+
if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) {
|
|
2977
|
+
ret = [ pp, prefix, false ];
|
|
2978
|
+
} else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) {
|
|
2979
|
+
ret = [ pp.slice(0, pathSize - 1), prefix, true ];
|
|
2980
|
+
} else {
|
|
2904
2981
|
pp = pathModule.join(pathModule.basename(prefix), pp);
|
|
2905
2982
|
prefix = pathModule.dirname(prefix);
|
|
2906
2983
|
}
|
|
2907
2984
|
} while (prefix !== root && !ret);
|
|
2908
|
-
if (!ret)
|
|
2985
|
+
if (!ret) {
|
|
2986
|
+
ret = [ p.slice(0, pathSize - 1), "", true ];
|
|
2987
|
+
}
|
|
2909
2988
|
}
|
|
2910
2989
|
return ret;
|
|
2911
2990
|
};
|
|
@@ -2939,7 +3018,13 @@ var __webpack_modules__ = {
|
|
|
2939
3018
|
2795: module => {
|
|
2940
3019
|
"use strict";
|
|
2941
3020
|
const encode = (num, buf) => {
|
|
2942
|
-
if (!Number.isSafeInteger(num))
|
|
3021
|
+
if (!Number.isSafeInteger(num)) {
|
|
3022
|
+
throw Error("cannot encode number outside of javascript safe integer range");
|
|
3023
|
+
} else if (num < 0) {
|
|
3024
|
+
encodeNegative(num, buf);
|
|
3025
|
+
} else {
|
|
3026
|
+
encodePositive(num, buf);
|
|
3027
|
+
}
|
|
2943
3028
|
return buf;
|
|
2944
3029
|
};
|
|
2945
3030
|
const encodePositive = (num, buf) => {
|
|
@@ -2956,7 +3041,11 @@ var __webpack_modules__ = {
|
|
|
2956
3041
|
for (var i = buf.length; i > 1; i--) {
|
|
2957
3042
|
var byte = num & 255;
|
|
2958
3043
|
num = Math.floor(num / 256);
|
|
2959
|
-
if (flipped)
|
|
3044
|
+
if (flipped) {
|
|
3045
|
+
buf[i - 1] = onesComp(byte);
|
|
3046
|
+
} else if (byte === 0) {
|
|
3047
|
+
buf[i - 1] = 0;
|
|
3048
|
+
} else {
|
|
2960
3049
|
flipped = true;
|
|
2961
3050
|
buf[i - 1] = twosComp(byte);
|
|
2962
3051
|
}
|
|
@@ -2965,8 +3054,12 @@ var __webpack_modules__ = {
|
|
|
2965
3054
|
const parse = buf => {
|
|
2966
3055
|
const pre = buf[0];
|
|
2967
3056
|
const value = pre === 128 ? pos(buf.slice(1, buf.length)) : pre === 255 ? twos(buf) : null;
|
|
2968
|
-
if (value === null)
|
|
2969
|
-
|
|
3057
|
+
if (value === null) {
|
|
3058
|
+
throw Error("invalid base256 encoding");
|
|
3059
|
+
}
|
|
3060
|
+
if (!Number.isSafeInteger(value)) {
|
|
3061
|
+
throw Error("parsed number outside of javascript safe integer range");
|
|
3062
|
+
}
|
|
2970
3063
|
return value;
|
|
2971
3064
|
};
|
|
2972
3065
|
const twos = buf => {
|
|
@@ -2976,11 +3069,17 @@ var __webpack_modules__ = {
|
|
|
2976
3069
|
for (var i = len - 1; i > -1; i--) {
|
|
2977
3070
|
var byte = buf[i];
|
|
2978
3071
|
var f;
|
|
2979
|
-
if (flipped)
|
|
3072
|
+
if (flipped) {
|
|
3073
|
+
f = onesComp(byte);
|
|
3074
|
+
} else if (byte === 0) {
|
|
3075
|
+
f = byte;
|
|
3076
|
+
} else {
|
|
2980
3077
|
flipped = true;
|
|
2981
3078
|
f = twosComp(byte);
|
|
2982
3079
|
}
|
|
2983
|
-
if (f !== 0)
|
|
3080
|
+
if (f !== 0) {
|
|
3081
|
+
sum -= f * Math.pow(256, len - i - 1);
|
|
3082
|
+
}
|
|
2984
3083
|
}
|
|
2985
3084
|
return sum;
|
|
2986
3085
|
};
|
|
@@ -2989,7 +3088,9 @@ var __webpack_modules__ = {
|
|
|
2989
3088
|
var sum = 0;
|
|
2990
3089
|
for (var i = len - 1; i > -1; i--) {
|
|
2991
3090
|
var byte = buf[i];
|
|
2992
|
-
if (byte !== 0)
|
|
3091
|
+
if (byte !== 0) {
|
|
3092
|
+
sum += byte * Math.pow(256, len - i - 1);
|
|
3093
|
+
}
|
|
2993
3094
|
}
|
|
2994
3095
|
return sum;
|
|
2995
3096
|
};
|
|
@@ -3009,15 +3110,32 @@ var __webpack_modules__ = {
|
|
|
3009
3110
|
const path = __webpack_require__(4822);
|
|
3010
3111
|
const stripSlash = __webpack_require__(6401);
|
|
3011
3112
|
module.exports = (opt_, files, cb) => {
|
|
3012
|
-
if (typeof opt_ === "function")
|
|
3013
|
-
|
|
3014
|
-
if (
|
|
3015
|
-
|
|
3113
|
+
if (typeof opt_ === "function") {
|
|
3114
|
+
cb = opt_, files = null, opt_ = {};
|
|
3115
|
+
} else if (Array.isArray(opt_)) {
|
|
3116
|
+
files = opt_, opt_ = {};
|
|
3117
|
+
}
|
|
3118
|
+
if (typeof files === "function") {
|
|
3119
|
+
cb = files, files = null;
|
|
3120
|
+
}
|
|
3121
|
+
if (!files) {
|
|
3122
|
+
files = [];
|
|
3123
|
+
} else {
|
|
3124
|
+
files = Array.from(files);
|
|
3125
|
+
}
|
|
3016
3126
|
const opt = hlo(opt_);
|
|
3017
|
-
if (opt.sync && typeof cb === "function")
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
if (!opt.
|
|
3127
|
+
if (opt.sync && typeof cb === "function") {
|
|
3128
|
+
throw new TypeError("callback not supported for sync tar functions");
|
|
3129
|
+
}
|
|
3130
|
+
if (!opt.file && typeof cb === "function") {
|
|
3131
|
+
throw new TypeError("callback only supported with file option");
|
|
3132
|
+
}
|
|
3133
|
+
if (files.length) {
|
|
3134
|
+
filesFilter(opt, files);
|
|
3135
|
+
}
|
|
3136
|
+
if (!opt.noResume) {
|
|
3137
|
+
onentryFunction(opt);
|
|
3138
|
+
}
|
|
3021
3139
|
return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt);
|
|
3022
3140
|
};
|
|
3023
3141
|
const onentryFunction = opt => {
|
|
@@ -3046,7 +3164,9 @@ var __webpack_modules__ = {
|
|
|
3046
3164
|
try {
|
|
3047
3165
|
const stat = fs.statSync(file);
|
|
3048
3166
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
3049
|
-
if (stat.size < readSize)
|
|
3167
|
+
if (stat.size < readSize) {
|
|
3168
|
+
p.end(fs.readFileSync(file));
|
|
3169
|
+
} else {
|
|
3050
3170
|
let pos = 0;
|
|
3051
3171
|
const buf = Buffer.allocUnsafe(readSize);
|
|
3052
3172
|
fd = fs.openSync(file, "r");
|
|
@@ -3074,7 +3194,9 @@ var __webpack_modules__ = {
|
|
|
3074
3194
|
parse.on("error", reject);
|
|
3075
3195
|
parse.on("end", resolve);
|
|
3076
3196
|
fs.stat(file, ((er, stat) => {
|
|
3077
|
-
if (er)
|
|
3197
|
+
if (er) {
|
|
3198
|
+
reject(er);
|
|
3199
|
+
} else {
|
|
3078
3200
|
const stream = new fsm.ReadStream(file, {
|
|
3079
3201
|
readSize,
|
|
3080
3202
|
size: stat.size
|
|
@@ -3119,7 +3241,9 @@ var __webpack_modules__ = {
|
|
|
3119
3241
|
const cSet = (cache, key, val) => cache.set(normPath(key), val);
|
|
3120
3242
|
const checkCwd = (dir, cb) => {
|
|
3121
3243
|
fs.stat(dir, ((er, st) => {
|
|
3122
|
-
if (er || !st.isDirectory())
|
|
3244
|
+
if (er || !st.isDirectory()) {
|
|
3245
|
+
er = new CwdError(dir, er && er.code || "ENOTDIR");
|
|
3246
|
+
}
|
|
3123
3247
|
cb(er);
|
|
3124
3248
|
}));
|
|
3125
3249
|
};
|
|
@@ -3136,25 +3260,43 @@ var __webpack_modules__ = {
|
|
|
3136
3260
|
const cache = opt.cache;
|
|
3137
3261
|
const cwd = normPath(opt.cwd);
|
|
3138
3262
|
const done = (er, created) => {
|
|
3139
|
-
if (er)
|
|
3263
|
+
if (er) {
|
|
3264
|
+
cb(er);
|
|
3265
|
+
} else {
|
|
3140
3266
|
cSet(cache, dir, true);
|
|
3141
|
-
if (created && doChown)
|
|
3267
|
+
if (created && doChown) {
|
|
3268
|
+
chownr(created, uid, gid, (er => done(er)));
|
|
3269
|
+
} else if (needChmod) {
|
|
3270
|
+
fs.chmod(dir, mode, cb);
|
|
3271
|
+
} else {
|
|
3272
|
+
cb();
|
|
3273
|
+
}
|
|
3142
3274
|
}
|
|
3143
3275
|
};
|
|
3144
|
-
if (cache && cGet(cache, dir) === true)
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3276
|
+
if (cache && cGet(cache, dir) === true) {
|
|
3277
|
+
return done();
|
|
3278
|
+
}
|
|
3279
|
+
if (dir === cwd) {
|
|
3280
|
+
return checkCwd(dir, done);
|
|
3281
|
+
}
|
|
3282
|
+
if (preserve) {
|
|
3283
|
+
return mkdirp(dir, {
|
|
3284
|
+
mode
|
|
3285
|
+
}).then((made => done(null, made)), done);
|
|
3286
|
+
}
|
|
3149
3287
|
const sub = normPath(path.relative(cwd, dir));
|
|
3150
3288
|
const parts = sub.split("/");
|
|
3151
3289
|
mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done);
|
|
3152
3290
|
};
|
|
3153
3291
|
const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {
|
|
3154
|
-
if (!parts.length)
|
|
3292
|
+
if (!parts.length) {
|
|
3293
|
+
return cb(null, created);
|
|
3294
|
+
}
|
|
3155
3295
|
const p = parts.shift();
|
|
3156
3296
|
const part = normPath(path.resolve(base + "/" + p));
|
|
3157
|
-
if (cGet(cache, part))
|
|
3297
|
+
if (cGet(cache, part)) {
|
|
3298
|
+
return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb);
|
|
3299
|
+
}
|
|
3158
3300
|
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb));
|
|
3159
3301
|
};
|
|
3160
3302
|
const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {
|
|
@@ -3163,12 +3305,20 @@ var __webpack_modules__ = {
|
|
|
3163
3305
|
if (statEr) {
|
|
3164
3306
|
statEr.path = statEr.path && normPath(statEr.path);
|
|
3165
3307
|
cb(statEr);
|
|
3166
|
-
} else if (st.isDirectory())
|
|
3308
|
+
} else if (st.isDirectory()) {
|
|
3309
|
+
mkdir_(part, parts, mode, cache, unlink, cwd, created, cb);
|
|
3310
|
+
} else if (unlink) {
|
|
3167
3311
|
fs.unlink(part, (er => {
|
|
3168
|
-
if (er)
|
|
3312
|
+
if (er) {
|
|
3313
|
+
return cb(er);
|
|
3314
|
+
}
|
|
3169
3315
|
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb));
|
|
3170
3316
|
}));
|
|
3171
|
-
} else if (st.isSymbolicLink())
|
|
3317
|
+
} else if (st.isSymbolicLink()) {
|
|
3318
|
+
return cb(new SymlinkError(part, part + "/" + parts.join("/")));
|
|
3319
|
+
} else {
|
|
3320
|
+
cb(er);
|
|
3321
|
+
}
|
|
3172
3322
|
}));
|
|
3173
3323
|
} else {
|
|
3174
3324
|
created = created || part;
|
|
@@ -3183,7 +3333,9 @@ var __webpack_modules__ = {
|
|
|
3183
3333
|
} catch (er) {
|
|
3184
3334
|
code = er.code;
|
|
3185
3335
|
} finally {
|
|
3186
|
-
if (!ok)
|
|
3336
|
+
if (!ok) {
|
|
3337
|
+
throw new CwdError(dir, code);
|
|
3338
|
+
}
|
|
3187
3339
|
}
|
|
3188
3340
|
};
|
|
3189
3341
|
module.exports.sync = (dir, opt) => {
|
|
@@ -3200,21 +3352,31 @@ var __webpack_modules__ = {
|
|
|
3200
3352
|
const cwd = normPath(opt.cwd);
|
|
3201
3353
|
const done = created => {
|
|
3202
3354
|
cSet(cache, dir, true);
|
|
3203
|
-
if (created && doChown)
|
|
3204
|
-
|
|
3355
|
+
if (created && doChown) {
|
|
3356
|
+
chownr.sync(created, uid, gid);
|
|
3357
|
+
}
|
|
3358
|
+
if (needChmod) {
|
|
3359
|
+
fs.chmodSync(dir, mode);
|
|
3360
|
+
}
|
|
3205
3361
|
};
|
|
3206
|
-
if (cache && cGet(cache, dir) === true)
|
|
3362
|
+
if (cache && cGet(cache, dir) === true) {
|
|
3363
|
+
return done();
|
|
3364
|
+
}
|
|
3207
3365
|
if (dir === cwd) {
|
|
3208
3366
|
checkCwdSync(cwd);
|
|
3209
3367
|
return done();
|
|
3210
3368
|
}
|
|
3211
|
-
if (preserve)
|
|
3369
|
+
if (preserve) {
|
|
3370
|
+
return done(mkdirp.sync(dir, mode));
|
|
3371
|
+
}
|
|
3212
3372
|
const sub = normPath(path.relative(cwd, dir));
|
|
3213
3373
|
const parts = sub.split("/");
|
|
3214
3374
|
let created = null;
|
|
3215
3375
|
for (let p = parts.shift(), part = cwd; p && (part += "/" + p); p = parts.shift()) {
|
|
3216
3376
|
part = normPath(path.resolve(part));
|
|
3217
|
-
if (cGet(cache, part))
|
|
3377
|
+
if (cGet(cache, part)) {
|
|
3378
|
+
continue;
|
|
3379
|
+
}
|
|
3218
3380
|
try {
|
|
3219
3381
|
fs.mkdirSync(part, mode);
|
|
3220
3382
|
created = created || part;
|
|
@@ -3230,7 +3392,9 @@ var __webpack_modules__ = {
|
|
|
3230
3392
|
created = created || part;
|
|
3231
3393
|
cSet(cache, part, true);
|
|
3232
3394
|
continue;
|
|
3233
|
-
} else if (st.isSymbolicLink())
|
|
3395
|
+
} else if (st.isSymbolicLink()) {
|
|
3396
|
+
return new SymlinkError(part, part + "/" + parts.join("/"));
|
|
3397
|
+
}
|
|
3234
3398
|
}
|
|
3235
3399
|
}
|
|
3236
3400
|
return done(created);
|
|
@@ -3240,11 +3404,19 @@ var __webpack_modules__ = {
|
|
|
3240
3404
|
"use strict";
|
|
3241
3405
|
module.exports = (mode, isDir, portable) => {
|
|
3242
3406
|
mode &= 4095;
|
|
3243
|
-
if (portable)
|
|
3407
|
+
if (portable) {
|
|
3408
|
+
mode = (mode | 384) & ~18;
|
|
3409
|
+
}
|
|
3244
3410
|
if (isDir) {
|
|
3245
|
-
if (mode & 256)
|
|
3246
|
-
|
|
3247
|
-
|
|
3411
|
+
if (mode & 256) {
|
|
3412
|
+
mode |= 64;
|
|
3413
|
+
}
|
|
3414
|
+
if (mode & 32) {
|
|
3415
|
+
mode |= 8;
|
|
3416
|
+
}
|
|
3417
|
+
if (mode & 4) {
|
|
3418
|
+
mode |= 1;
|
|
3419
|
+
}
|
|
3248
3420
|
}
|
|
3249
3421
|
return mode;
|
|
3250
3422
|
};
|
|
@@ -3253,7 +3425,9 @@ var __webpack_modules__ = {
|
|
|
3253
3425
|
const normalizeCache = Object.create(null);
|
|
3254
3426
|
const {hasOwnProperty} = Object.prototype;
|
|
3255
3427
|
module.exports = s => {
|
|
3256
|
-
if (!hasOwnProperty.call(normalizeCache, s))
|
|
3428
|
+
if (!hasOwnProperty.call(normalizeCache, s)) {
|
|
3429
|
+
normalizeCache[s] = s.normalize("NFKD");
|
|
3430
|
+
}
|
|
3257
3431
|
return normalizeCache[s];
|
|
3258
3432
|
};
|
|
3259
3433
|
},
|
|
@@ -3323,18 +3497,26 @@ var __webpack_modules__ = {
|
|
|
3323
3497
|
this.statCache = opt.statCache || new Map;
|
|
3324
3498
|
this.readdirCache = opt.readdirCache || new Map;
|
|
3325
3499
|
this[WRITEENTRYCLASS] = WriteEntry;
|
|
3326
|
-
if (typeof opt.onwarn === "function")
|
|
3500
|
+
if (typeof opt.onwarn === "function") {
|
|
3501
|
+
this.on("warn", opt.onwarn);
|
|
3502
|
+
}
|
|
3327
3503
|
this.portable = !!opt.portable;
|
|
3328
3504
|
this.zip = null;
|
|
3329
3505
|
if (opt.gzip) {
|
|
3330
|
-
if (typeof opt.gzip !== "object")
|
|
3331
|
-
|
|
3506
|
+
if (typeof opt.gzip !== "object") {
|
|
3507
|
+
opt.gzip = {};
|
|
3508
|
+
}
|
|
3509
|
+
if (this.portable) {
|
|
3510
|
+
opt.gzip.portable = true;
|
|
3511
|
+
}
|
|
3332
3512
|
this.zip = new zlib.Gzip(opt.gzip);
|
|
3333
3513
|
this.zip.on("data", (chunk => super.write(chunk)));
|
|
3334
3514
|
this.zip.on("end", (_ => super.end()));
|
|
3335
3515
|
this.zip.on("drain", (_ => this[ONDRAIN]()));
|
|
3336
3516
|
this.on("resume", (_ => this.zip.resume()));
|
|
3337
|
-
} else
|
|
3517
|
+
} else {
|
|
3518
|
+
this.on("drain", this[ONDRAIN]);
|
|
3519
|
+
}
|
|
3338
3520
|
this.noDirRecurse = !!opt.noDirRecurse;
|
|
3339
3521
|
this.follow = !!opt.follow;
|
|
3340
3522
|
this.noMtime = !!opt.noMtime;
|
|
@@ -3354,19 +3536,29 @@ var __webpack_modules__ = {
|
|
|
3354
3536
|
return this;
|
|
3355
3537
|
}
|
|
3356
3538
|
end(path) {
|
|
3357
|
-
if (path)
|
|
3539
|
+
if (path) {
|
|
3540
|
+
this.write(path);
|
|
3541
|
+
}
|
|
3358
3542
|
this[ENDED] = true;
|
|
3359
3543
|
this[PROCESS]();
|
|
3360
3544
|
return this;
|
|
3361
3545
|
}
|
|
3362
3546
|
write(path) {
|
|
3363
|
-
if (this[ENDED])
|
|
3364
|
-
|
|
3547
|
+
if (this[ENDED]) {
|
|
3548
|
+
throw new Error("write after end");
|
|
3549
|
+
}
|
|
3550
|
+
if (path instanceof ReadEntry) {
|
|
3551
|
+
this[ADDTARENTRY](path);
|
|
3552
|
+
} else {
|
|
3553
|
+
this[ADDFSENTRY](path);
|
|
3554
|
+
}
|
|
3365
3555
|
return this.flowing;
|
|
3366
3556
|
}
|
|
3367
3557
|
[ADDTARENTRY](p) {
|
|
3368
3558
|
const absolute = normPath(path.resolve(this.cwd, p.path));
|
|
3369
|
-
if (!this.filter(p.path, p))
|
|
3559
|
+
if (!this.filter(p.path, p)) {
|
|
3560
|
+
p.resume();
|
|
3561
|
+
} else {
|
|
3370
3562
|
const job = new PackJob(p.path, absolute, false);
|
|
3371
3563
|
job.entry = new WriteEntryTar(p, this[ENTRYOPT](job));
|
|
3372
3564
|
job.entry.on("end", (_ => this[JOBDONE](job)));
|
|
@@ -3387,13 +3579,19 @@ var __webpack_modules__ = {
|
|
|
3387
3579
|
fs[stat](job.absolute, ((er, stat) => {
|
|
3388
3580
|
job.pending = false;
|
|
3389
3581
|
this[JOBS] -= 1;
|
|
3390
|
-
if (er)
|
|
3582
|
+
if (er) {
|
|
3583
|
+
this.emit("error", er);
|
|
3584
|
+
} else {
|
|
3585
|
+
this[ONSTAT](job, stat);
|
|
3586
|
+
}
|
|
3391
3587
|
}));
|
|
3392
3588
|
}
|
|
3393
3589
|
[ONSTAT](job, stat) {
|
|
3394
3590
|
this.statCache.set(job.absolute, stat);
|
|
3395
3591
|
job.stat = stat;
|
|
3396
|
-
if (!this.filter(job.path, stat))
|
|
3592
|
+
if (!this.filter(job.path, stat)) {
|
|
3593
|
+
job.ignore = true;
|
|
3594
|
+
}
|
|
3397
3595
|
this[PROCESS]();
|
|
3398
3596
|
}
|
|
3399
3597
|
[READDIR](job) {
|
|
@@ -3402,7 +3600,9 @@ var __webpack_modules__ = {
|
|
|
3402
3600
|
fs.readdir(job.absolute, ((er, entries) => {
|
|
3403
3601
|
job.pending = false;
|
|
3404
3602
|
this[JOBS] -= 1;
|
|
3405
|
-
if (er)
|
|
3603
|
+
if (er) {
|
|
3604
|
+
return this.emit("error", er);
|
|
3605
|
+
}
|
|
3406
3606
|
this[ONREADDIR](job, entries);
|
|
3407
3607
|
}));
|
|
3408
3608
|
}
|
|
@@ -3412,7 +3612,9 @@ var __webpack_modules__ = {
|
|
|
3412
3612
|
this[PROCESS]();
|
|
3413
3613
|
}
|
|
3414
3614
|
[PROCESS]() {
|
|
3415
|
-
if (this[PROCESSING])
|
|
3615
|
+
if (this[PROCESSING]) {
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3416
3618
|
this[PROCESSING] = true;
|
|
3417
3619
|
for (let w = this[QUEUE].head; w !== null && this[JOBS] < this.jobs; w = w.next) {
|
|
3418
3620
|
this[PROCESSJOB](w.value);
|
|
@@ -3424,7 +3626,9 @@ var __webpack_modules__ = {
|
|
|
3424
3626
|
}
|
|
3425
3627
|
this[PROCESSING] = false;
|
|
3426
3628
|
if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {
|
|
3427
|
-
if (this.zip)
|
|
3629
|
+
if (this.zip) {
|
|
3630
|
+
this.zip.end(EOF);
|
|
3631
|
+
} else {
|
|
3428
3632
|
super.write(EOF);
|
|
3429
3633
|
super.end();
|
|
3430
3634
|
}
|
|
@@ -3439,26 +3643,46 @@ var __webpack_modules__ = {
|
|
|
3439
3643
|
this[PROCESS]();
|
|
3440
3644
|
}
|
|
3441
3645
|
[PROCESSJOB](job) {
|
|
3442
|
-
if (job.pending)
|
|
3646
|
+
if (job.pending) {
|
|
3647
|
+
return;
|
|
3648
|
+
}
|
|
3443
3649
|
if (job.entry) {
|
|
3444
|
-
if (job === this[CURRENT] && !job.piped)
|
|
3650
|
+
if (job === this[CURRENT] && !job.piped) {
|
|
3651
|
+
this[PIPE](job);
|
|
3652
|
+
}
|
|
3445
3653
|
return;
|
|
3446
3654
|
}
|
|
3447
3655
|
if (!job.stat) {
|
|
3448
|
-
if (this.statCache.has(job.absolute))
|
|
3656
|
+
if (this.statCache.has(job.absolute)) {
|
|
3657
|
+
this[ONSTAT](job, this.statCache.get(job.absolute));
|
|
3658
|
+
} else {
|
|
3659
|
+
this[STAT](job);
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
if (!job.stat) {
|
|
3663
|
+
return;
|
|
3664
|
+
}
|
|
3665
|
+
if (job.ignore) {
|
|
3666
|
+
return;
|
|
3449
3667
|
}
|
|
3450
|
-
if (!job.stat) return;
|
|
3451
|
-
if (job.ignore) return;
|
|
3452
3668
|
if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {
|
|
3453
|
-
if (this.readdirCache.has(job.absolute))
|
|
3454
|
-
|
|
3669
|
+
if (this.readdirCache.has(job.absolute)) {
|
|
3670
|
+
this[ONREADDIR](job, this.readdirCache.get(job.absolute));
|
|
3671
|
+
} else {
|
|
3672
|
+
this[READDIR](job);
|
|
3673
|
+
}
|
|
3674
|
+
if (!job.readdir) {
|
|
3675
|
+
return;
|
|
3676
|
+
}
|
|
3455
3677
|
}
|
|
3456
3678
|
job.entry = this[ENTRY](job);
|
|
3457
3679
|
if (!job.entry) {
|
|
3458
3680
|
job.ignore = true;
|
|
3459
3681
|
return;
|
|
3460
3682
|
}
|
|
3461
|
-
if (job === this[CURRENT] && !job.piped)
|
|
3683
|
+
if (job === this[CURRENT] && !job.piped) {
|
|
3684
|
+
this[PIPE](job);
|
|
3685
|
+
}
|
|
3462
3686
|
}
|
|
3463
3687
|
[ENTRYOPT](job) {
|
|
3464
3688
|
return {
|
|
@@ -3486,7 +3710,9 @@ var __webpack_modules__ = {
|
|
|
3486
3710
|
}
|
|
3487
3711
|
}
|
|
3488
3712
|
[ONDRAIN]() {
|
|
3489
|
-
if (this[CURRENT] && this[CURRENT].entry)
|
|
3713
|
+
if (this[CURRENT] && this[CURRENT].entry) {
|
|
3714
|
+
this[CURRENT].entry.resume();
|
|
3715
|
+
}
|
|
3490
3716
|
}
|
|
3491
3717
|
[PIPE](job) {
|
|
3492
3718
|
job.piped = true;
|
|
@@ -3501,16 +3727,22 @@ var __webpack_modules__ = {
|
|
|
3501
3727
|
const zip = this.zip;
|
|
3502
3728
|
if (zip) {
|
|
3503
3729
|
source.on("data", (chunk => {
|
|
3504
|
-
if (!zip.write(chunk))
|
|
3730
|
+
if (!zip.write(chunk)) {
|
|
3731
|
+
source.pause();
|
|
3732
|
+
}
|
|
3505
3733
|
}));
|
|
3506
3734
|
} else {
|
|
3507
3735
|
source.on("data", (chunk => {
|
|
3508
|
-
if (!super.write(chunk))
|
|
3736
|
+
if (!super.write(chunk)) {
|
|
3737
|
+
source.pause();
|
|
3738
|
+
}
|
|
3509
3739
|
}));
|
|
3510
3740
|
}
|
|
3511
3741
|
}
|
|
3512
3742
|
pause() {
|
|
3513
|
-
if (this.zip)
|
|
3743
|
+
if (this.zip) {
|
|
3744
|
+
this.zip.pause();
|
|
3745
|
+
}
|
|
3514
3746
|
return super.pause();
|
|
3515
3747
|
}
|
|
3516
3748
|
});
|
|
@@ -3562,6 +3794,7 @@ var __webpack_modules__ = {
|
|
|
3562
3794
|
const Entry = __webpack_require__(7847);
|
|
3563
3795
|
const Pax = __webpack_require__(9154);
|
|
3564
3796
|
const zlib = __webpack_require__(3704);
|
|
3797
|
+
const {nextTick} = __webpack_require__(7282);
|
|
3565
3798
|
const gzipHeader = Buffer.from([ 31, 139 ]);
|
|
3566
3799
|
const STATE = Symbol("state");
|
|
3567
3800
|
const WRITEENTRY = Symbol("writeEntry");
|
|
@@ -3592,6 +3825,7 @@ var __webpack_modules__ = {
|
|
|
3592
3825
|
const SAW_VALID_ENTRY = Symbol("sawValidEntry");
|
|
3593
3826
|
const SAW_NULL_BLOCK = Symbol("sawNullBlock");
|
|
3594
3827
|
const SAW_EOF = Symbol("sawEOF");
|
|
3828
|
+
const CLOSESTREAM = Symbol("closeStream");
|
|
3595
3829
|
const noop = _ => true;
|
|
3596
3830
|
module.exports = warner(class Parser extends EE {
|
|
3597
3831
|
constructor(opt) {
|
|
@@ -3604,12 +3838,13 @@ var __webpack_modules__ = {
|
|
|
3604
3838
|
this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
|
|
3605
3839
|
}
|
|
3606
3840
|
}));
|
|
3607
|
-
if (opt.ondone)
|
|
3841
|
+
if (opt.ondone) {
|
|
3842
|
+
this.on(DONE, opt.ondone);
|
|
3843
|
+
} else {
|
|
3608
3844
|
this.on(DONE, (_ => {
|
|
3609
3845
|
this.emit("prefinish");
|
|
3610
3846
|
this.emit("finish");
|
|
3611
3847
|
this.emit("end");
|
|
3612
|
-
this.emit("close");
|
|
3613
3848
|
}));
|
|
3614
3849
|
}
|
|
3615
3850
|
this.strict = !!opt.strict;
|
|
@@ -3630,11 +3865,18 @@ var __webpack_modules__ = {
|
|
|
3630
3865
|
this[ABORTED] = false;
|
|
3631
3866
|
this[SAW_NULL_BLOCK] = false;
|
|
3632
3867
|
this[SAW_EOF] = false;
|
|
3633
|
-
|
|
3634
|
-
if (typeof opt.
|
|
3868
|
+
this.on("end", (() => this[CLOSESTREAM]()));
|
|
3869
|
+
if (typeof opt.onwarn === "function") {
|
|
3870
|
+
this.on("warn", opt.onwarn);
|
|
3871
|
+
}
|
|
3872
|
+
if (typeof opt.onentry === "function") {
|
|
3873
|
+
this.on("entry", opt.onentry);
|
|
3874
|
+
}
|
|
3635
3875
|
}
|
|
3636
3876
|
[CONSUMEHEADER](chunk, position) {
|
|
3637
|
-
if (this[SAW_VALID_ENTRY] === null)
|
|
3877
|
+
if (this[SAW_VALID_ENTRY] === null) {
|
|
3878
|
+
this[SAW_VALID_ENTRY] = false;
|
|
3879
|
+
}
|
|
3638
3880
|
let header;
|
|
3639
3881
|
try {
|
|
3640
3882
|
header = new Header(chunk, position, this[EX], this[GEX]);
|
|
@@ -3644,7 +3886,9 @@ var __webpack_modules__ = {
|
|
|
3644
3886
|
if (header.nullBlock) {
|
|
3645
3887
|
if (this[SAW_NULL_BLOCK]) {
|
|
3646
3888
|
this[SAW_EOF] = true;
|
|
3647
|
-
if (this[STATE] === "begin")
|
|
3889
|
+
if (this[STATE] === "begin") {
|
|
3890
|
+
this[STATE] = "header";
|
|
3891
|
+
}
|
|
3648
3892
|
this[EMIT]("eof");
|
|
3649
3893
|
} else {
|
|
3650
3894
|
this[SAW_NULL_BLOCK] = true;
|
|
@@ -3652,25 +3896,37 @@ var __webpack_modules__ = {
|
|
|
3652
3896
|
}
|
|
3653
3897
|
} else {
|
|
3654
3898
|
this[SAW_NULL_BLOCK] = false;
|
|
3655
|
-
if (!header.cksumValid)
|
|
3656
|
-
|
|
3657
|
-
}); else if (!header.path) this.warn("TAR_ENTRY_INVALID", "path is required", {
|
|
3658
|
-
header
|
|
3659
|
-
}); else {
|
|
3660
|
-
const type = header.type;
|
|
3661
|
-
if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", {
|
|
3899
|
+
if (!header.cksumValid) {
|
|
3900
|
+
this.warn("TAR_ENTRY_INVALID", "checksum failure", {
|
|
3662
3901
|
header
|
|
3663
|
-
});
|
|
3902
|
+
});
|
|
3903
|
+
} else if (!header.path) {
|
|
3904
|
+
this.warn("TAR_ENTRY_INVALID", "path is required", {
|
|
3664
3905
|
header
|
|
3665
|
-
});
|
|
3906
|
+
});
|
|
3907
|
+
} else {
|
|
3908
|
+
const type = header.type;
|
|
3909
|
+
if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) {
|
|
3910
|
+
this.warn("TAR_ENTRY_INVALID", "linkpath required", {
|
|
3911
|
+
header
|
|
3912
|
+
});
|
|
3913
|
+
} else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) {
|
|
3914
|
+
this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", {
|
|
3915
|
+
header
|
|
3916
|
+
});
|
|
3917
|
+
} else {
|
|
3666
3918
|
const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]);
|
|
3667
3919
|
if (!this[SAW_VALID_ENTRY]) {
|
|
3668
3920
|
if (entry.remain) {
|
|
3669
3921
|
const onend = () => {
|
|
3670
|
-
if (!entry.invalid)
|
|
3922
|
+
if (!entry.invalid) {
|
|
3923
|
+
this[SAW_VALID_ENTRY] = true;
|
|
3924
|
+
}
|
|
3671
3925
|
};
|
|
3672
3926
|
entry.on("end", onend);
|
|
3673
|
-
} else
|
|
3927
|
+
} else {
|
|
3928
|
+
this[SAW_VALID_ENTRY] = true;
|
|
3929
|
+
}
|
|
3674
3930
|
}
|
|
3675
3931
|
if (entry.meta) {
|
|
3676
3932
|
if (entry.size > this.maxMetaEntrySize) {
|
|
@@ -3691,26 +3947,35 @@ var __webpack_modules__ = {
|
|
|
3691
3947
|
this[STATE] = entry.remain ? "ignore" : "header";
|
|
3692
3948
|
entry.resume();
|
|
3693
3949
|
} else {
|
|
3694
|
-
if (entry.remain)
|
|
3950
|
+
if (entry.remain) {
|
|
3951
|
+
this[STATE] = "body";
|
|
3952
|
+
} else {
|
|
3695
3953
|
this[STATE] = "header";
|
|
3696
3954
|
entry.end();
|
|
3697
3955
|
}
|
|
3698
3956
|
if (!this[READENTRY]) {
|
|
3699
3957
|
this[QUEUE].push(entry);
|
|
3700
3958
|
this[NEXTENTRY]();
|
|
3701
|
-
} else
|
|
3959
|
+
} else {
|
|
3960
|
+
this[QUEUE].push(entry);
|
|
3961
|
+
}
|
|
3702
3962
|
}
|
|
3703
3963
|
}
|
|
3704
3964
|
}
|
|
3705
3965
|
}
|
|
3706
3966
|
}
|
|
3707
3967
|
}
|
|
3968
|
+
[CLOSESTREAM]() {
|
|
3969
|
+
nextTick((() => this.emit("close")));
|
|
3970
|
+
}
|
|
3708
3971
|
[PROCESSENTRY](entry) {
|
|
3709
3972
|
let go = true;
|
|
3710
3973
|
if (!entry) {
|
|
3711
3974
|
this[READENTRY] = null;
|
|
3712
3975
|
go = false;
|
|
3713
|
-
} else if (Array.isArray(entry))
|
|
3976
|
+
} else if (Array.isArray(entry)) {
|
|
3977
|
+
this.emit.apply(this, entry);
|
|
3978
|
+
} else {
|
|
3714
3979
|
this[READENTRY] = entry;
|
|
3715
3980
|
this.emit("entry", entry);
|
|
3716
3981
|
if (!entry.emittedEnd) {
|
|
@@ -3726,8 +3991,12 @@ var __webpack_modules__ = {
|
|
|
3726
3991
|
const re = this[READENTRY];
|
|
3727
3992
|
const drainNow = !re || re.flowing || re.size === re.remain;
|
|
3728
3993
|
if (drainNow) {
|
|
3729
|
-
if (!this[WRITING])
|
|
3730
|
-
|
|
3994
|
+
if (!this[WRITING]) {
|
|
3995
|
+
this.emit("drain");
|
|
3996
|
+
}
|
|
3997
|
+
} else {
|
|
3998
|
+
re.once("drain", (_ => this.emit("drain")));
|
|
3999
|
+
}
|
|
3731
4000
|
}
|
|
3732
4001
|
}
|
|
3733
4002
|
[CONSUMEBODY](chunk, position) {
|
|
@@ -3745,11 +4014,17 @@ var __webpack_modules__ = {
|
|
|
3745
4014
|
[CONSUMEMETA](chunk, position) {
|
|
3746
4015
|
const entry = this[WRITEENTRY];
|
|
3747
4016
|
const ret = this[CONSUMEBODY](chunk, position);
|
|
3748
|
-
if (!this[WRITEENTRY])
|
|
4017
|
+
if (!this[WRITEENTRY]) {
|
|
4018
|
+
this[EMITMETA](entry);
|
|
4019
|
+
}
|
|
3749
4020
|
return ret;
|
|
3750
4021
|
}
|
|
3751
4022
|
[EMIT](ev, data, extra) {
|
|
3752
|
-
if (!this[QUEUE].length && !this[READENTRY])
|
|
4023
|
+
if (!this[QUEUE].length && !this[READENTRY]) {
|
|
4024
|
+
this.emit(ev, data, extra);
|
|
4025
|
+
} else {
|
|
4026
|
+
this[QUEUE].push([ ev, data, extra ]);
|
|
4027
|
+
}
|
|
3753
4028
|
}
|
|
3754
4029
|
[EMITMETA](entry) {
|
|
3755
4030
|
this[EMIT]("meta", this[META]);
|
|
@@ -3786,7 +4061,9 @@ var __webpack_modules__ = {
|
|
|
3786
4061
|
});
|
|
3787
4062
|
}
|
|
3788
4063
|
write(chunk) {
|
|
3789
|
-
if (this[ABORTED])
|
|
4064
|
+
if (this[ABORTED]) {
|
|
4065
|
+
return;
|
|
4066
|
+
}
|
|
3790
4067
|
if (this[UNZIP] === null && chunk) {
|
|
3791
4068
|
if (this[BUFFER]) {
|
|
3792
4069
|
chunk = Buffer.concat([ this[BUFFER], chunk ]);
|
|
@@ -3797,7 +4074,9 @@ var __webpack_modules__ = {
|
|
|
3797
4074
|
return true;
|
|
3798
4075
|
}
|
|
3799
4076
|
for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {
|
|
3800
|
-
if (chunk[i] !== gzipHeader[i])
|
|
4077
|
+
if (chunk[i] !== gzipHeader[i]) {
|
|
4078
|
+
this[UNZIP] = false;
|
|
4079
|
+
}
|
|
3801
4080
|
}
|
|
3802
4081
|
if (this[UNZIP] === null) {
|
|
3803
4082
|
const ended = this[ENDED];
|
|
@@ -3816,14 +4095,22 @@ var __webpack_modules__ = {
|
|
|
3816
4095
|
}
|
|
3817
4096
|
}
|
|
3818
4097
|
this[WRITING] = true;
|
|
3819
|
-
if (this[UNZIP])
|
|
4098
|
+
if (this[UNZIP]) {
|
|
4099
|
+
this[UNZIP].write(chunk);
|
|
4100
|
+
} else {
|
|
4101
|
+
this[CONSUMECHUNK](chunk);
|
|
4102
|
+
}
|
|
3820
4103
|
this[WRITING] = false;
|
|
3821
4104
|
const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true;
|
|
3822
|
-
if (!ret && !this[QUEUE].length)
|
|
4105
|
+
if (!ret && !this[QUEUE].length) {
|
|
4106
|
+
this[READENTRY].once("drain", (_ => this.emit("drain")));
|
|
4107
|
+
}
|
|
3823
4108
|
return ret;
|
|
3824
4109
|
}
|
|
3825
4110
|
[BUFFERCONCAT](c) {
|
|
3826
|
-
if (c && !this[ABORTED])
|
|
4111
|
+
if (c && !this[ABORTED]) {
|
|
4112
|
+
this[BUFFER] = this[BUFFER] ? Buffer.concat([ this[BUFFER], c ]) : c;
|
|
4113
|
+
}
|
|
3827
4114
|
}
|
|
3828
4115
|
[MAYBEEND]() {
|
|
3829
4116
|
if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) {
|
|
@@ -3834,21 +4121,29 @@ var __webpack_modules__ = {
|
|
|
3834
4121
|
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, {
|
|
3835
4122
|
entry
|
|
3836
4123
|
});
|
|
3837
|
-
if (this[BUFFER])
|
|
4124
|
+
if (this[BUFFER]) {
|
|
4125
|
+
entry.write(this[BUFFER]);
|
|
4126
|
+
}
|
|
3838
4127
|
entry.end();
|
|
3839
4128
|
}
|
|
3840
4129
|
this[EMIT](DONE);
|
|
3841
4130
|
}
|
|
3842
4131
|
}
|
|
3843
4132
|
[CONSUMECHUNK](chunk) {
|
|
3844
|
-
if (this[CONSUMING])
|
|
4133
|
+
if (this[CONSUMING]) {
|
|
4134
|
+
this[BUFFERCONCAT](chunk);
|
|
4135
|
+
} else if (!chunk && !this[BUFFER]) {
|
|
4136
|
+
this[MAYBEEND]();
|
|
4137
|
+
} else {
|
|
3845
4138
|
this[CONSUMING] = true;
|
|
3846
4139
|
if (this[BUFFER]) {
|
|
3847
4140
|
this[BUFFERCONCAT](chunk);
|
|
3848
4141
|
const c = this[BUFFER];
|
|
3849
4142
|
this[BUFFER] = null;
|
|
3850
4143
|
this[CONSUMECHUNKSUB](c);
|
|
3851
|
-
} else
|
|
4144
|
+
} else {
|
|
4145
|
+
this[CONSUMECHUNKSUB](chunk);
|
|
4146
|
+
}
|
|
3852
4147
|
while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) {
|
|
3853
4148
|
const c = this[BUFFER];
|
|
3854
4149
|
this[BUFFER] = null;
|
|
@@ -3856,7 +4151,9 @@ var __webpack_modules__ = {
|
|
|
3856
4151
|
}
|
|
3857
4152
|
this[CONSUMING] = false;
|
|
3858
4153
|
}
|
|
3859
|
-
if (!this[BUFFER] || this[ENDED])
|
|
4154
|
+
if (!this[BUFFER] || this[ENDED]) {
|
|
4155
|
+
this[MAYBEEND]();
|
|
4156
|
+
}
|
|
3860
4157
|
}
|
|
3861
4158
|
[CONSUMECHUNKSUB](chunk) {
|
|
3862
4159
|
let position = 0;
|
|
@@ -3883,12 +4180,18 @@ var __webpack_modules__ = {
|
|
|
3883
4180
|
}
|
|
3884
4181
|
}
|
|
3885
4182
|
if (position < length) {
|
|
3886
|
-
if (this[BUFFER])
|
|
4183
|
+
if (this[BUFFER]) {
|
|
4184
|
+
this[BUFFER] = Buffer.concat([ chunk.slice(position), this[BUFFER] ]);
|
|
4185
|
+
} else {
|
|
4186
|
+
this[BUFFER] = chunk.slice(position);
|
|
4187
|
+
}
|
|
3887
4188
|
}
|
|
3888
4189
|
}
|
|
3889
4190
|
end(chunk) {
|
|
3890
4191
|
if (!this[ABORTED]) {
|
|
3891
|
-
if (this[UNZIP])
|
|
4192
|
+
if (this[UNZIP]) {
|
|
4193
|
+
this[UNZIP].end(chunk);
|
|
4194
|
+
} else {
|
|
3892
4195
|
this[ENDED] = true;
|
|
3893
4196
|
this.write(chunk);
|
|
3894
4197
|
}
|
|
@@ -3908,7 +4211,9 @@ var __webpack_modules__ = {
|
|
|
3908
4211
|
const reservations = new Map;
|
|
3909
4212
|
const getDirs = path => {
|
|
3910
4213
|
const dirs = path.split("/").slice(0, -1).reduce(((set, path) => {
|
|
3911
|
-
if (set.length)
|
|
4214
|
+
if (set.length) {
|
|
4215
|
+
path = join(set[set.length - 1], path);
|
|
4216
|
+
}
|
|
3912
4217
|
set.push(path || "/");
|
|
3913
4218
|
return set;
|
|
3914
4219
|
}), []);
|
|
@@ -3917,7 +4222,9 @@ var __webpack_modules__ = {
|
|
|
3917
4222
|
const running = new Set;
|
|
3918
4223
|
const getQueues = fn => {
|
|
3919
4224
|
const res = reservations.get(fn);
|
|
3920
|
-
if (!res)
|
|
4225
|
+
if (!res) {
|
|
4226
|
+
throw new Error("function does not have any path reservations");
|
|
4227
|
+
}
|
|
3921
4228
|
return {
|
|
3922
4229
|
paths: res.paths.map((path => queues.get(path))),
|
|
3923
4230
|
dirs: [ ...res.dirs ].map((path => queues.get(path)))
|
|
@@ -3928,30 +4235,44 @@ var __webpack_modules__ = {
|
|
|
3928
4235
|
return paths.every((q => q[0] === fn)) && dirs.every((q => q[0] instanceof Set && q[0].has(fn)));
|
|
3929
4236
|
};
|
|
3930
4237
|
const run = fn => {
|
|
3931
|
-
if (running.has(fn) || !check(fn))
|
|
4238
|
+
if (running.has(fn) || !check(fn)) {
|
|
4239
|
+
return false;
|
|
4240
|
+
}
|
|
3932
4241
|
running.add(fn);
|
|
3933
4242
|
fn((() => clear(fn)));
|
|
3934
4243
|
return true;
|
|
3935
4244
|
};
|
|
3936
4245
|
const clear = fn => {
|
|
3937
|
-
if (!running.has(fn))
|
|
4246
|
+
if (!running.has(fn)) {
|
|
4247
|
+
return false;
|
|
4248
|
+
}
|
|
3938
4249
|
const {paths, dirs} = reservations.get(fn);
|
|
3939
4250
|
const next = new Set;
|
|
3940
4251
|
paths.forEach((path => {
|
|
3941
4252
|
const q = queues.get(path);
|
|
3942
4253
|
assert.equal(q[0], fn);
|
|
3943
|
-
if (q.length === 1)
|
|
4254
|
+
if (q.length === 1) {
|
|
4255
|
+
queues.delete(path);
|
|
4256
|
+
} else {
|
|
3944
4257
|
q.shift();
|
|
3945
|
-
if (typeof q[0] === "function")
|
|
4258
|
+
if (typeof q[0] === "function") {
|
|
4259
|
+
next.add(q[0]);
|
|
4260
|
+
} else {
|
|
4261
|
+
q[0].forEach((fn => next.add(fn)));
|
|
4262
|
+
}
|
|
3946
4263
|
}
|
|
3947
4264
|
}));
|
|
3948
4265
|
dirs.forEach((dir => {
|
|
3949
4266
|
const q = queues.get(dir);
|
|
3950
4267
|
assert(q[0] instanceof Set);
|
|
3951
|
-
if (q[0].size === 1 && q.length === 1)
|
|
4268
|
+
if (q[0].size === 1 && q.length === 1) {
|
|
4269
|
+
queues.delete(dir);
|
|
4270
|
+
} else if (q[0].size === 1) {
|
|
3952
4271
|
q.shift();
|
|
3953
4272
|
next.add(q[0]);
|
|
3954
|
-
} else
|
|
4273
|
+
} else {
|
|
4274
|
+
q[0].delete(fn);
|
|
4275
|
+
}
|
|
3955
4276
|
}));
|
|
3956
4277
|
running.delete(fn);
|
|
3957
4278
|
next.forEach((fn => run(fn)));
|
|
@@ -3966,11 +4287,21 @@ var __webpack_modules__ = {
|
|
|
3966
4287
|
});
|
|
3967
4288
|
paths.forEach((path => {
|
|
3968
4289
|
const q = queues.get(path);
|
|
3969
|
-
if (!q)
|
|
4290
|
+
if (!q) {
|
|
4291
|
+
queues.set(path, [ fn ]);
|
|
4292
|
+
} else {
|
|
4293
|
+
q.push(fn);
|
|
4294
|
+
}
|
|
3970
4295
|
}));
|
|
3971
4296
|
dirs.forEach((dir => {
|
|
3972
4297
|
const q = queues.get(dir);
|
|
3973
|
-
if (!q)
|
|
4298
|
+
if (!q) {
|
|
4299
|
+
queues.set(dir, [ new Set([ fn ]) ]);
|
|
4300
|
+
} else if (q[q.length - 1] instanceof Set) {
|
|
4301
|
+
q[q.length - 1].add(fn);
|
|
4302
|
+
} else {
|
|
4303
|
+
q.push(new Set([ fn ]));
|
|
4304
|
+
}
|
|
3974
4305
|
}));
|
|
3975
4306
|
return run(fn);
|
|
3976
4307
|
};
|
|
@@ -4005,11 +4336,15 @@ var __webpack_modules__ = {
|
|
|
4005
4336
|
}
|
|
4006
4337
|
encode() {
|
|
4007
4338
|
const body = this.encodeBody();
|
|
4008
|
-
if (body === "")
|
|
4339
|
+
if (body === "") {
|
|
4340
|
+
return null;
|
|
4341
|
+
}
|
|
4009
4342
|
const bodyLen = Buffer.byteLength(body);
|
|
4010
4343
|
const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
|
|
4011
4344
|
const buf = Buffer.allocUnsafe(bufLen);
|
|
4012
|
-
for (let i = 0; i < 512; i++)
|
|
4345
|
+
for (let i = 0; i < 512; i++) {
|
|
4346
|
+
buf[i] = 0;
|
|
4347
|
+
}
|
|
4013
4348
|
new Header({
|
|
4014
4349
|
path: ("PaxHeader/" + path.basename(this.path)).slice(0, 99),
|
|
4015
4350
|
mode: this.mode || 420,
|
|
@@ -4027,19 +4362,25 @@ var __webpack_modules__ = {
|
|
|
4027
4362
|
ctime: this.ctime || null
|
|
4028
4363
|
}).encode(buf);
|
|
4029
4364
|
buf.write(body, 512, bodyLen, "utf8");
|
|
4030
|
-
for (let i = bodyLen + 512; i < buf.length; i++)
|
|
4365
|
+
for (let i = bodyLen + 512; i < buf.length; i++) {
|
|
4366
|
+
buf[i] = 0;
|
|
4367
|
+
}
|
|
4031
4368
|
return buf;
|
|
4032
4369
|
}
|
|
4033
4370
|
encodeBody() {
|
|
4034
4371
|
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");
|
|
4035
4372
|
}
|
|
4036
4373
|
encodeField(field) {
|
|
4037
|
-
if (this[field] === null || this[field] === undefined)
|
|
4374
|
+
if (this[field] === null || this[field] === undefined) {
|
|
4375
|
+
return "";
|
|
4376
|
+
}
|
|
4038
4377
|
const v = this[field] instanceof Date ? this[field].getTime() / 1e3 : this[field];
|
|
4039
4378
|
const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n";
|
|
4040
4379
|
const byteLen = Buffer.byteLength(s);
|
|
4041
4380
|
let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
|
|
4042
|
-
if (byteLen + digits >= Math.pow(10, digits))
|
|
4381
|
+
if (byteLen + digits >= Math.pow(10, digits)) {
|
|
4382
|
+
digits += 1;
|
|
4383
|
+
}
|
|
4043
4384
|
const len = digits + byteLen;
|
|
4044
4385
|
return len + s;
|
|
4045
4386
|
}
|
|
@@ -4049,11 +4390,15 @@ var __webpack_modules__ = {
|
|
|
4049
4390
|
const parseKV = string => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, Object.create(null));
|
|
4050
4391
|
const parseKVLine = (set, line) => {
|
|
4051
4392
|
const n = parseInt(line, 10);
|
|
4052
|
-
if (n !== Buffer.byteLength(line) + 1)
|
|
4053
|
-
|
|
4393
|
+
if (n !== Buffer.byteLength(line) + 1) {
|
|
4394
|
+
return set;
|
|
4395
|
+
}
|
|
4396
|
+
line = line.slice((n + " ").length);
|
|
4054
4397
|
const kv = line.split("=");
|
|
4055
4398
|
const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
|
4056
|
-
if (!k)
|
|
4399
|
+
if (!k) {
|
|
4400
|
+
return set;
|
|
4401
|
+
}
|
|
4057
4402
|
const v = kv.join("=");
|
|
4058
4403
|
set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1e3) : /^[0-9]+$/.test(v) ? +v : v;
|
|
4059
4404
|
return set;
|
|
@@ -4105,7 +4450,9 @@ var __webpack_modules__ = {
|
|
|
4105
4450
|
}
|
|
4106
4451
|
this.path = normPath(header.path);
|
|
4107
4452
|
this.mode = header.mode;
|
|
4108
|
-
if (this.mode)
|
|
4453
|
+
if (this.mode) {
|
|
4454
|
+
this.mode = this.mode & 4095;
|
|
4455
|
+
}
|
|
4109
4456
|
this.uid = header.uid;
|
|
4110
4457
|
this.gid = header.gid;
|
|
4111
4458
|
this.uname = header.uname;
|
|
@@ -4117,23 +4464,35 @@ var __webpack_modules__ = {
|
|
|
4117
4464
|
this.linkpath = normPath(header.linkpath);
|
|
4118
4465
|
this.uname = header.uname;
|
|
4119
4466
|
this.gname = header.gname;
|
|
4120
|
-
if (ex)
|
|
4121
|
-
|
|
4467
|
+
if (ex) {
|
|
4468
|
+
this[SLURP](ex);
|
|
4469
|
+
}
|
|
4470
|
+
if (gex) {
|
|
4471
|
+
this[SLURP](gex, true);
|
|
4472
|
+
}
|
|
4122
4473
|
}
|
|
4123
4474
|
write(data) {
|
|
4124
4475
|
const writeLen = data.length;
|
|
4125
|
-
if (writeLen > this.blockRemain)
|
|
4476
|
+
if (writeLen > this.blockRemain) {
|
|
4477
|
+
throw new Error("writing more to entry than is appropriate");
|
|
4478
|
+
}
|
|
4126
4479
|
const r = this.remain;
|
|
4127
4480
|
const br = this.blockRemain;
|
|
4128
4481
|
this.remain = Math.max(0, r - writeLen);
|
|
4129
4482
|
this.blockRemain = Math.max(0, br - writeLen);
|
|
4130
|
-
if (this.ignore)
|
|
4131
|
-
|
|
4483
|
+
if (this.ignore) {
|
|
4484
|
+
return true;
|
|
4485
|
+
}
|
|
4486
|
+
if (r >= writeLen) {
|
|
4487
|
+
return super.write(data);
|
|
4488
|
+
}
|
|
4132
4489
|
return super.write(data.slice(0, r));
|
|
4133
4490
|
}
|
|
4134
4491
|
[SLURP](ex, global) {
|
|
4135
4492
|
for (const k in ex) {
|
|
4136
|
-
if (ex[k] !== null && ex[k] !== undefined && !(global && k === "path"))
|
|
4493
|
+
if (ex[k] !== null && ex[k] !== undefined && !(global && k === "path")) {
|
|
4494
|
+
this[k] = k === "path" || k === "linkpath" ? normPath(ex[k]) : ex[k];
|
|
4495
|
+
}
|
|
4137
4496
|
}
|
|
4138
4497
|
}
|
|
4139
4498
|
};
|
|
@@ -4149,9 +4508,15 @@ var __webpack_modules__ = {
|
|
|
4149
4508
|
const Header = __webpack_require__(5017);
|
|
4150
4509
|
module.exports = (opt_, files, cb) => {
|
|
4151
4510
|
const opt = hlo(opt_);
|
|
4152
|
-
if (!opt.file)
|
|
4153
|
-
|
|
4154
|
-
|
|
4511
|
+
if (!opt.file) {
|
|
4512
|
+
throw new TypeError("file is required");
|
|
4513
|
+
}
|
|
4514
|
+
if (opt.gzip) {
|
|
4515
|
+
throw new TypeError("cannot append to compressed archives");
|
|
4516
|
+
}
|
|
4517
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
|
4518
|
+
throw new TypeError("no files or directories specified");
|
|
4519
|
+
}
|
|
4155
4520
|
files = Array.from(files);
|
|
4156
4521
|
return opt.sync ? replaceSync(opt, files) : replace(opt, files, cb);
|
|
4157
4522
|
};
|
|
@@ -4164,22 +4529,36 @@ var __webpack_modules__ = {
|
|
|
4164
4529
|
try {
|
|
4165
4530
|
fd = fs.openSync(opt.file, "r+");
|
|
4166
4531
|
} catch (er) {
|
|
4167
|
-
if (er.code === "ENOENT")
|
|
4532
|
+
if (er.code === "ENOENT") {
|
|
4533
|
+
fd = fs.openSync(opt.file, "w+");
|
|
4534
|
+
} else {
|
|
4535
|
+
throw er;
|
|
4536
|
+
}
|
|
4168
4537
|
}
|
|
4169
4538
|
const st = fs.fstatSync(fd);
|
|
4170
4539
|
const headBuf = Buffer.alloc(512);
|
|
4171
4540
|
POSITION: for (position = 0; position < st.size; position += 512) {
|
|
4172
4541
|
for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
|
|
4173
4542
|
bytes = fs.readSync(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos);
|
|
4174
|
-
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139)
|
|
4175
|
-
|
|
4543
|
+
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) {
|
|
4544
|
+
throw new Error("cannot append to compressed archives");
|
|
4545
|
+
}
|
|
4546
|
+
if (!bytes) {
|
|
4547
|
+
break POSITION;
|
|
4548
|
+
}
|
|
4176
4549
|
}
|
|
4177
4550
|
const h = new Header(headBuf);
|
|
4178
|
-
if (!h.cksumValid)
|
|
4551
|
+
if (!h.cksumValid) {
|
|
4552
|
+
break;
|
|
4553
|
+
}
|
|
4179
4554
|
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
|
4180
|
-
if (position + entryBlockSize + 512 > st.size)
|
|
4555
|
+
if (position + entryBlockSize + 512 > st.size) {
|
|
4556
|
+
break;
|
|
4557
|
+
}
|
|
4181
4558
|
position += entryBlockSize;
|
|
4182
|
-
if (opt.mtimeCache)
|
|
4559
|
+
if (opt.mtimeCache) {
|
|
4560
|
+
opt.mtimeCache.set(h.path, h.mtime);
|
|
4561
|
+
}
|
|
4183
4562
|
}
|
|
4184
4563
|
threw = false;
|
|
4185
4564
|
streamSync(opt, p, position, fd, files);
|
|
@@ -4204,27 +4583,47 @@ var __webpack_modules__ = {
|
|
|
4204
4583
|
const p = new Pack(opt);
|
|
4205
4584
|
const getPos = (fd, size, cb_) => {
|
|
4206
4585
|
const cb = (er, pos) => {
|
|
4207
|
-
if (er)
|
|
4586
|
+
if (er) {
|
|
4587
|
+
fs.close(fd, (_ => cb_(er)));
|
|
4588
|
+
} else {
|
|
4589
|
+
cb_(null, pos);
|
|
4590
|
+
}
|
|
4208
4591
|
};
|
|
4209
4592
|
let position = 0;
|
|
4210
|
-
if (size === 0)
|
|
4593
|
+
if (size === 0) {
|
|
4594
|
+
return cb(null, 0);
|
|
4595
|
+
}
|
|
4211
4596
|
let bufPos = 0;
|
|
4212
4597
|
const headBuf = Buffer.alloc(512);
|
|
4213
4598
|
const onread = (er, bytes) => {
|
|
4214
|
-
if (er)
|
|
4599
|
+
if (er) {
|
|
4600
|
+
return cb(er);
|
|
4601
|
+
}
|
|
4215
4602
|
bufPos += bytes;
|
|
4216
4603
|
if (bufPos < 512 && bytes) {
|
|
4217
4604
|
return fs.read(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread);
|
|
4218
4605
|
}
|
|
4219
|
-
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139)
|
|
4220
|
-
|
|
4606
|
+
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) {
|
|
4607
|
+
return cb(new Error("cannot append to compressed archives"));
|
|
4608
|
+
}
|
|
4609
|
+
if (bufPos < 512) {
|
|
4610
|
+
return cb(null, position);
|
|
4611
|
+
}
|
|
4221
4612
|
const h = new Header(headBuf);
|
|
4222
|
-
if (!h.cksumValid)
|
|
4613
|
+
if (!h.cksumValid) {
|
|
4614
|
+
return cb(null, position);
|
|
4615
|
+
}
|
|
4223
4616
|
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
|
4224
|
-
if (position + entryBlockSize + 512 > size)
|
|
4617
|
+
if (position + entryBlockSize + 512 > size) {
|
|
4618
|
+
return cb(null, position);
|
|
4619
|
+
}
|
|
4225
4620
|
position += entryBlockSize + 512;
|
|
4226
|
-
if (position >= size)
|
|
4227
|
-
|
|
4621
|
+
if (position >= size) {
|
|
4622
|
+
return cb(null, position);
|
|
4623
|
+
}
|
|
4624
|
+
if (opt.mtimeCache) {
|
|
4625
|
+
opt.mtimeCache.set(h.path, h.mtime);
|
|
4626
|
+
}
|
|
4228
4627
|
bufPos = 0;
|
|
4229
4628
|
fs.read(fd, headBuf, 0, 512, position, onread);
|
|
4230
4629
|
};
|
|
@@ -4238,11 +4637,17 @@ var __webpack_modules__ = {
|
|
|
4238
4637
|
flag = "w+";
|
|
4239
4638
|
return fs.open(opt.file, flag, onopen);
|
|
4240
4639
|
}
|
|
4241
|
-
if (er)
|
|
4640
|
+
if (er) {
|
|
4641
|
+
return reject(er);
|
|
4642
|
+
}
|
|
4242
4643
|
fs.fstat(fd, ((er, st) => {
|
|
4243
|
-
if (er)
|
|
4644
|
+
if (er) {
|
|
4645
|
+
return fs.close(fd, (() => reject(er)));
|
|
4646
|
+
}
|
|
4244
4647
|
getPos(fd, st.size, ((er, position) => {
|
|
4245
|
-
if (er)
|
|
4648
|
+
if (er) {
|
|
4649
|
+
return reject(er);
|
|
4650
|
+
}
|
|
4246
4651
|
const stream = new fsm.WriteStream(opt.file, {
|
|
4247
4652
|
fd,
|
|
4248
4653
|
start: position
|
|
@@ -4262,12 +4667,14 @@ var __webpack_modules__ = {
|
|
|
4262
4667
|
files.forEach((file => {
|
|
4263
4668
|
if (file.charAt(0) === "@") {
|
|
4264
4669
|
t({
|
|
4265
|
-
file: path.resolve(p.cwd, file.
|
|
4670
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
4266
4671
|
sync: true,
|
|
4267
4672
|
noResume: true,
|
|
4268
4673
|
onentry: entry => p.add(entry)
|
|
4269
4674
|
});
|
|
4270
|
-
} else
|
|
4675
|
+
} else {
|
|
4676
|
+
p.add(file);
|
|
4677
|
+
}
|
|
4271
4678
|
}));
|
|
4272
4679
|
p.end();
|
|
4273
4680
|
};
|
|
@@ -4276,11 +4683,13 @@ var __webpack_modules__ = {
|
|
|
4276
4683
|
const file = files.shift();
|
|
4277
4684
|
if (file.charAt(0) === "@") {
|
|
4278
4685
|
return t({
|
|
4279
|
-
file: path.resolve(p.cwd, file.
|
|
4686
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
4280
4687
|
noResume: true,
|
|
4281
4688
|
onentry: entry => p.add(entry)
|
|
4282
4689
|
}).then((_ => addFilesAsync(p, files)));
|
|
4283
|
-
} else
|
|
4690
|
+
} else {
|
|
4691
|
+
p.add(file);
|
|
4692
|
+
}
|
|
4284
4693
|
}
|
|
4285
4694
|
p.end();
|
|
4286
4695
|
};
|
|
@@ -4292,7 +4701,7 @@ var __webpack_modules__ = {
|
|
|
4292
4701
|
let parsed = parse(path);
|
|
4293
4702
|
while (isAbsolute(path) || parsed.root) {
|
|
4294
4703
|
const root = path.charAt(0) === "/" && path.slice(0, 4) !== "//?/" ? "/" : parsed.root;
|
|
4295
|
-
path = path.
|
|
4704
|
+
path = path.slice(root.length);
|
|
4296
4705
|
r += root;
|
|
4297
4706
|
parsed = parse(path);
|
|
4298
4707
|
}
|
|
@@ -4359,15 +4768,21 @@ var __webpack_modules__ = {
|
|
|
4359
4768
|
const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
4360
4769
|
const isWindows = platform === "win32";
|
|
4361
4770
|
const unlinkFile = (path, cb) => {
|
|
4362
|
-
if (!isWindows)
|
|
4771
|
+
if (!isWindows) {
|
|
4772
|
+
return fs.unlink(path, cb);
|
|
4773
|
+
}
|
|
4363
4774
|
const name = path + ".DELETE." + crypto.randomBytes(16).toString("hex");
|
|
4364
4775
|
fs.rename(path, name, (er => {
|
|
4365
|
-
if (er)
|
|
4776
|
+
if (er) {
|
|
4777
|
+
return cb(er);
|
|
4778
|
+
}
|
|
4366
4779
|
fs.unlink(name, cb);
|
|
4367
4780
|
}));
|
|
4368
4781
|
};
|
|
4369
4782
|
const unlinkFileSync = path => {
|
|
4370
|
-
if (!isWindows)
|
|
4783
|
+
if (!isWindows) {
|
|
4784
|
+
return fs.unlinkSync(path);
|
|
4785
|
+
}
|
|
4371
4786
|
const name = path + ".DELETE." + crypto.randomBytes(16).toString("hex");
|
|
4372
4787
|
fs.renameSync(path, name);
|
|
4373
4788
|
fs.unlinkSync(name);
|
|
@@ -4378,15 +4793,21 @@ var __webpack_modules__ = {
|
|
|
4378
4793
|
abs = cacheKeyNormalize(abs);
|
|
4379
4794
|
for (const path of cache.keys()) {
|
|
4380
4795
|
const pnorm = cacheKeyNormalize(path);
|
|
4381
|
-
if (pnorm === abs || pnorm.indexOf(abs + "/") === 0)
|
|
4796
|
+
if (pnorm === abs || pnorm.indexOf(abs + "/") === 0) {
|
|
4797
|
+
cache.delete(path);
|
|
4798
|
+
}
|
|
4382
4799
|
}
|
|
4383
4800
|
};
|
|
4384
4801
|
const dropCache = cache => {
|
|
4385
|
-
for (const key of cache.keys())
|
|
4802
|
+
for (const key of cache.keys()) {
|
|
4803
|
+
cache.delete(key);
|
|
4804
|
+
}
|
|
4386
4805
|
};
|
|
4387
4806
|
class Unpack extends Parser {
|
|
4388
4807
|
constructor(opt) {
|
|
4389
|
-
if (!opt)
|
|
4808
|
+
if (!opt) {
|
|
4809
|
+
opt = {};
|
|
4810
|
+
}
|
|
4390
4811
|
opt.ondone = _ => {
|
|
4391
4812
|
this[ENDED] = true;
|
|
4392
4813
|
this[MAYBECLOSE]();
|
|
@@ -4401,7 +4822,9 @@ var __webpack_modules__ = {
|
|
|
4401
4822
|
this[ENDED] = false;
|
|
4402
4823
|
this.dirCache = opt.dirCache || new Map;
|
|
4403
4824
|
if (typeof opt.uid === "number" || typeof opt.gid === "number") {
|
|
4404
|
-
if (typeof opt.uid !== "number" || typeof opt.gid !== "number")
|
|
4825
|
+
if (typeof opt.uid !== "number" || typeof opt.gid !== "number") {
|
|
4826
|
+
throw new TypeError("cannot set owner without number uid and gid");
|
|
4827
|
+
}
|
|
4405
4828
|
if (opt.preserveOwner) {
|
|
4406
4829
|
throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
4407
4830
|
}
|
|
@@ -4413,7 +4836,11 @@ var __webpack_modules__ = {
|
|
|
4413
4836
|
this.gid = null;
|
|
4414
4837
|
this.setOwner = false;
|
|
4415
4838
|
}
|
|
4416
|
-
if (opt.preserveOwner === undefined && typeof opt.uid !== "number")
|
|
4839
|
+
if (opt.preserveOwner === undefined && typeof opt.uid !== "number") {
|
|
4840
|
+
this.preserveOwner = process.getuid && process.getuid() === 0;
|
|
4841
|
+
} else {
|
|
4842
|
+
this.preserveOwner = !!opt.preserveOwner;
|
|
4843
|
+
}
|
|
4417
4844
|
this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null;
|
|
4418
4845
|
this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null;
|
|
4419
4846
|
this.forceChown = opt.forceChown === true;
|
|
@@ -4432,7 +4859,9 @@ var __webpack_modules__ = {
|
|
|
4432
4859
|
this.on("entry", (entry => this[ONENTRY](entry)));
|
|
4433
4860
|
}
|
|
4434
4861
|
warn(code, msg, data = {}) {
|
|
4435
|
-
if (code === "TAR_BAD_ARCHIVE" || code === "TAR_ABORT")
|
|
4862
|
+
if (code === "TAR_BAD_ARCHIVE" || code === "TAR_ABORT") {
|
|
4863
|
+
data.recoverable = false;
|
|
4864
|
+
}
|
|
4436
4865
|
return super.warn(code, msg, data);
|
|
4437
4866
|
}
|
|
4438
4867
|
[MAYBECLOSE]() {
|
|
@@ -4440,17 +4869,22 @@ var __webpack_modules__ = {
|
|
|
4440
4869
|
this.emit("prefinish");
|
|
4441
4870
|
this.emit("finish");
|
|
4442
4871
|
this.emit("end");
|
|
4443
|
-
this.emit("close");
|
|
4444
4872
|
}
|
|
4445
4873
|
}
|
|
4446
4874
|
[CHECKPATH](entry) {
|
|
4447
4875
|
if (this.strip) {
|
|
4448
4876
|
const parts = normPath(entry.path).split("/");
|
|
4449
|
-
if (parts.length < this.strip)
|
|
4877
|
+
if (parts.length < this.strip) {
|
|
4878
|
+
return false;
|
|
4879
|
+
}
|
|
4450
4880
|
entry.path = parts.slice(this.strip).join("/");
|
|
4451
4881
|
if (entry.type === "Link") {
|
|
4452
4882
|
const linkparts = normPath(entry.linkpath).split("/");
|
|
4453
|
-
if (linkparts.length >= this.strip)
|
|
4883
|
+
if (linkparts.length >= this.strip) {
|
|
4884
|
+
entry.linkpath = linkparts.slice(this.strip).join("/");
|
|
4885
|
+
} else {
|
|
4886
|
+
return false;
|
|
4887
|
+
}
|
|
4454
4888
|
}
|
|
4455
4889
|
}
|
|
4456
4890
|
if (!this.preservePaths) {
|
|
@@ -4472,7 +4906,11 @@ var __webpack_modules__ = {
|
|
|
4472
4906
|
});
|
|
4473
4907
|
}
|
|
4474
4908
|
}
|
|
4475
|
-
if (path.isAbsolute(entry.path))
|
|
4909
|
+
if (path.isAbsolute(entry.path)) {
|
|
4910
|
+
entry.absolute = normPath(path.resolve(entry.path));
|
|
4911
|
+
} else {
|
|
4912
|
+
entry.absolute = normPath(path.resolve(this.cwd, entry.path));
|
|
4913
|
+
}
|
|
4476
4914
|
if (!this.preservePaths && entry.absolute.indexOf(this.cwd + "/") !== 0 && entry.absolute !== this.cwd) {
|
|
4477
4915
|
this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", {
|
|
4478
4916
|
entry,
|
|
@@ -4482,22 +4920,28 @@ var __webpack_modules__ = {
|
|
|
4482
4920
|
});
|
|
4483
4921
|
return false;
|
|
4484
4922
|
}
|
|
4485
|
-
if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir")
|
|
4923
|
+
if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir") {
|
|
4924
|
+
return false;
|
|
4925
|
+
}
|
|
4486
4926
|
if (this.win32) {
|
|
4487
4927
|
const {root: aRoot} = path.win32.parse(entry.absolute);
|
|
4488
|
-
entry.absolute = aRoot + wc.encode(entry.absolute.
|
|
4928
|
+
entry.absolute = aRoot + wc.encode(entry.absolute.slice(aRoot.length));
|
|
4489
4929
|
const {root: pRoot} = path.win32.parse(entry.path);
|
|
4490
|
-
entry.path = pRoot + wc.encode(entry.path.
|
|
4930
|
+
entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length));
|
|
4491
4931
|
}
|
|
4492
4932
|
return true;
|
|
4493
4933
|
}
|
|
4494
4934
|
[ONENTRY](entry) {
|
|
4495
|
-
if (!this[CHECKPATH](entry))
|
|
4935
|
+
if (!this[CHECKPATH](entry)) {
|
|
4936
|
+
return entry.resume();
|
|
4937
|
+
}
|
|
4496
4938
|
assert.equal(typeof entry.absolute, "string");
|
|
4497
4939
|
switch (entry.type) {
|
|
4498
4940
|
case "Directory":
|
|
4499
4941
|
case "GNUDumpDir":
|
|
4500
|
-
if (entry.mode)
|
|
4942
|
+
if (entry.mode) {
|
|
4943
|
+
entry.mode = entry.mode | 448;
|
|
4944
|
+
}
|
|
4501
4945
|
|
|
4502
4946
|
case "File":
|
|
4503
4947
|
case "OldFile":
|
|
@@ -4514,7 +4958,9 @@ var __webpack_modules__ = {
|
|
|
4514
4958
|
}
|
|
4515
4959
|
}
|
|
4516
4960
|
[ONERROR](er, entry) {
|
|
4517
|
-
if (er.name === "CwdError")
|
|
4961
|
+
if (er.name === "CwdError") {
|
|
4962
|
+
this.emit("error", er);
|
|
4963
|
+
} else {
|
|
4518
4964
|
this.warn("TAR_ENTRY_ERROR", er, {
|
|
4519
4965
|
entry
|
|
4520
4966
|
});
|
|
@@ -4554,7 +5000,9 @@ var __webpack_modules__ = {
|
|
|
4554
5000
|
autoClose: false
|
|
4555
5001
|
});
|
|
4556
5002
|
stream.on("error", (er => {
|
|
4557
|
-
if (stream.fd)
|
|
5003
|
+
if (stream.fd) {
|
|
5004
|
+
fs.close(stream.fd, (() => {}));
|
|
5005
|
+
}
|
|
4558
5006
|
stream.write = () => true;
|
|
4559
5007
|
this[ONERROR](er, entry);
|
|
4560
5008
|
fullyDone();
|
|
@@ -4562,14 +5010,20 @@ var __webpack_modules__ = {
|
|
|
4562
5010
|
let actions = 1;
|
|
4563
5011
|
const done = er => {
|
|
4564
5012
|
if (er) {
|
|
4565
|
-
if (stream.fd)
|
|
5013
|
+
if (stream.fd) {
|
|
5014
|
+
fs.close(stream.fd, (() => {}));
|
|
5015
|
+
}
|
|
4566
5016
|
this[ONERROR](er, entry);
|
|
4567
5017
|
fullyDone();
|
|
4568
5018
|
return;
|
|
4569
5019
|
}
|
|
4570
5020
|
if (--actions === 0) {
|
|
4571
5021
|
fs.close(stream.fd, (er => {
|
|
4572
|
-
if (er)
|
|
5022
|
+
if (er) {
|
|
5023
|
+
this[ONERROR](er, entry);
|
|
5024
|
+
} else {
|
|
5025
|
+
this[UNPEND]();
|
|
5026
|
+
}
|
|
4573
5027
|
fullyDone();
|
|
4574
5028
|
}));
|
|
4575
5029
|
}
|
|
@@ -4659,11 +5113,17 @@ var __webpack_modules__ = {
|
|
|
4659
5113
|
[CHECKFS](entry) {
|
|
4660
5114
|
this[PEND]();
|
|
4661
5115
|
const paths = [ entry.path ];
|
|
4662
|
-
if (entry.linkpath)
|
|
5116
|
+
if (entry.linkpath) {
|
|
5117
|
+
paths.push(entry.linkpath);
|
|
5118
|
+
}
|
|
4663
5119
|
this.reservations.reserve(paths, (done => this[CHECKFS2](entry, done)));
|
|
4664
5120
|
}
|
|
4665
5121
|
[PRUNECACHE](entry) {
|
|
4666
|
-
if (entry.type === "SymbolicLink")
|
|
5122
|
+
if (entry.type === "SymbolicLink") {
|
|
5123
|
+
dropCache(this.dirCache);
|
|
5124
|
+
} else if (entry.type !== "Directory") {
|
|
5125
|
+
pruneCache(this.dirCache, entry.absolute);
|
|
5126
|
+
}
|
|
4667
5127
|
}
|
|
4668
5128
|
[CHECKFS2](entry, fullyDone) {
|
|
4669
5129
|
this[PRUNECACHE](entry);
|
|
@@ -4705,23 +5165,33 @@ var __webpack_modules__ = {
|
|
|
4705
5165
|
done();
|
|
4706
5166
|
return;
|
|
4707
5167
|
}
|
|
4708
|
-
if (lstatEr || this[ISREUSABLE](entry, st))
|
|
5168
|
+
if (lstatEr || this[ISREUSABLE](entry, st)) {
|
|
5169
|
+
return this[MAKEFS](null, entry, done);
|
|
5170
|
+
}
|
|
4709
5171
|
if (st.isDirectory()) {
|
|
4710
5172
|
if (entry.type === "Directory") {
|
|
4711
5173
|
const needChmod = !this.noChmod && entry.mode && (st.mode & 4095) !== entry.mode;
|
|
4712
5174
|
const afterChmod = er => this[MAKEFS](er, entry, done);
|
|
4713
|
-
if (!needChmod)
|
|
5175
|
+
if (!needChmod) {
|
|
5176
|
+
return afterChmod();
|
|
5177
|
+
}
|
|
4714
5178
|
return fs.chmod(entry.absolute, entry.mode, afterChmod);
|
|
4715
5179
|
}
|
|
4716
5180
|
if (entry.absolute !== this.cwd) {
|
|
4717
5181
|
return fs.rmdir(entry.absolute, (er => this[MAKEFS](er, entry, done)));
|
|
4718
5182
|
}
|
|
4719
5183
|
}
|
|
4720
|
-
if (entry.absolute === this.cwd)
|
|
5184
|
+
if (entry.absolute === this.cwd) {
|
|
5185
|
+
return this[MAKEFS](null, entry, done);
|
|
5186
|
+
}
|
|
4721
5187
|
unlinkFile(entry.absolute, (er => this[MAKEFS](er, entry, done)));
|
|
4722
5188
|
}));
|
|
4723
5189
|
};
|
|
4724
|
-
if (this[CHECKED_CWD])
|
|
5190
|
+
if (this[CHECKED_CWD]) {
|
|
5191
|
+
start();
|
|
5192
|
+
} else {
|
|
5193
|
+
checkCwd();
|
|
5194
|
+
}
|
|
4725
5195
|
}
|
|
4726
5196
|
[MAKEFS](er, entry, done) {
|
|
4727
5197
|
if (er) {
|
|
@@ -4748,7 +5218,9 @@ var __webpack_modules__ = {
|
|
|
4748
5218
|
}
|
|
4749
5219
|
[LINK](entry, linkpath, link, done) {
|
|
4750
5220
|
fs[link](linkpath, entry.absolute, (er => {
|
|
4751
|
-
if (er)
|
|
5221
|
+
if (er) {
|
|
5222
|
+
this[ONERROR](er, entry);
|
|
5223
|
+
} else {
|
|
4752
5224
|
this[UNPEND]();
|
|
4753
5225
|
entry.resume();
|
|
4754
5226
|
}
|
|
@@ -4771,19 +5243,27 @@ var __webpack_modules__ = {
|
|
|
4771
5243
|
this[PRUNECACHE](entry);
|
|
4772
5244
|
if (!this[CHECKED_CWD]) {
|
|
4773
5245
|
const er = this[MKDIR](this.cwd, this.dmode);
|
|
4774
|
-
if (er)
|
|
5246
|
+
if (er) {
|
|
5247
|
+
return this[ONERROR](er, entry);
|
|
5248
|
+
}
|
|
4775
5249
|
this[CHECKED_CWD] = true;
|
|
4776
5250
|
}
|
|
4777
5251
|
if (entry.absolute !== this.cwd) {
|
|
4778
5252
|
const parent = normPath(path.dirname(entry.absolute));
|
|
4779
5253
|
if (parent !== this.cwd) {
|
|
4780
5254
|
const mkParent = this[MKDIR](parent, this.dmode);
|
|
4781
|
-
if (mkParent)
|
|
5255
|
+
if (mkParent) {
|
|
5256
|
+
return this[ONERROR](mkParent, entry);
|
|
5257
|
+
}
|
|
4782
5258
|
}
|
|
4783
5259
|
}
|
|
4784
5260
|
const [lstatEr, st] = callSync((() => fs.lstatSync(entry.absolute)));
|
|
4785
|
-
if (st && (this.keep || this.newer && st.mtime > entry.mtime))
|
|
4786
|
-
|
|
5261
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
|
|
5262
|
+
return this[SKIP](entry);
|
|
5263
|
+
}
|
|
5264
|
+
if (lstatEr || this[ISREUSABLE](entry, st)) {
|
|
5265
|
+
return this[MAKEFS](null, entry);
|
|
5266
|
+
}
|
|
4787
5267
|
if (st.isDirectory()) {
|
|
4788
5268
|
if (entry.type === "Directory") {
|
|
4789
5269
|
const needChmod = !this.noChmod && entry.mode && (st.mode & 4095) !== entry.mode;
|
|
@@ -4807,7 +5287,9 @@ var __webpack_modules__ = {
|
|
|
4807
5287
|
} catch (e) {
|
|
4808
5288
|
closeError = e;
|
|
4809
5289
|
}
|
|
4810
|
-
if (er || closeError)
|
|
5290
|
+
if (er || closeError) {
|
|
5291
|
+
this[ONERROR](er || closeError, entry);
|
|
5292
|
+
}
|
|
4811
5293
|
done();
|
|
4812
5294
|
};
|
|
4813
5295
|
let fd;
|
|
@@ -4917,16 +5399,24 @@ var __webpack_modules__ = {
|
|
|
4917
5399
|
const r = __webpack_require__(3666);
|
|
4918
5400
|
module.exports = (opt_, files, cb) => {
|
|
4919
5401
|
const opt = hlo(opt_);
|
|
4920
|
-
if (!opt.file)
|
|
4921
|
-
|
|
4922
|
-
|
|
5402
|
+
if (!opt.file) {
|
|
5403
|
+
throw new TypeError("file is required");
|
|
5404
|
+
}
|
|
5405
|
+
if (opt.gzip) {
|
|
5406
|
+
throw new TypeError("cannot append to compressed archives");
|
|
5407
|
+
}
|
|
5408
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
|
5409
|
+
throw new TypeError("no files or directories specified");
|
|
5410
|
+
}
|
|
4923
5411
|
files = Array.from(files);
|
|
4924
5412
|
mtimeFilter(opt);
|
|
4925
5413
|
return r(opt, files, cb);
|
|
4926
5414
|
};
|
|
4927
5415
|
const mtimeFilter = opt => {
|
|
4928
5416
|
const filter = opt.filter;
|
|
4929
|
-
if (!opt.mtimeCache)
|
|
5417
|
+
if (!opt.mtimeCache) {
|
|
5418
|
+
opt.mtimeCache = new Map;
|
|
5419
|
+
}
|
|
4930
5420
|
opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime);
|
|
4931
5421
|
};
|
|
4932
5422
|
},
|
|
@@ -4934,8 +5424,12 @@ var __webpack_modules__ = {
|
|
|
4934
5424
|
"use strict";
|
|
4935
5425
|
module.exports = Base => class extends Base {
|
|
4936
5426
|
warn(code, message, data = {}) {
|
|
4937
|
-
if (this.file)
|
|
4938
|
-
|
|
5427
|
+
if (this.file) {
|
|
5428
|
+
data.file = this.file;
|
|
5429
|
+
}
|
|
5430
|
+
if (this.cwd) {
|
|
5431
|
+
data.cwd = this.cwd;
|
|
5432
|
+
}
|
|
4939
5433
|
data.code = message instanceof Error && message.code || code;
|
|
4940
5434
|
data.tarCode = code;
|
|
4941
5435
|
if (!this.strict && data.recoverable !== false) {
|
|
@@ -4944,7 +5438,11 @@ var __webpack_modules__ = {
|
|
|
4944
5438
|
message = message.message;
|
|
4945
5439
|
}
|
|
4946
5440
|
this.emit("warn", data.tarCode, message, data);
|
|
4947
|
-
} else if (message instanceof Error)
|
|
5441
|
+
} else if (message instanceof Error) {
|
|
5442
|
+
this.emit("error", Object.assign(message, data));
|
|
5443
|
+
} else {
|
|
5444
|
+
this.emit("error", Object.assign(new Error(`${code}: ${message}`), data));
|
|
5445
|
+
}
|
|
4948
5446
|
}
|
|
4949
5447
|
};
|
|
4950
5448
|
},
|
|
@@ -4969,7 +5467,9 @@ var __webpack_modules__ = {
|
|
|
4969
5467
|
const normPath = __webpack_require__(4240);
|
|
4970
5468
|
const stripSlash = __webpack_require__(6401);
|
|
4971
5469
|
const prefixPath = (path, prefix) => {
|
|
4972
|
-
if (!prefix)
|
|
5470
|
+
if (!prefix) {
|
|
5471
|
+
return normPath(path);
|
|
5472
|
+
}
|
|
4973
5473
|
path = normPath(path).replace(/^\.(\/|$)/, "");
|
|
4974
5474
|
return stripSlash(prefix) + "/" + path;
|
|
4975
5475
|
};
|
|
@@ -5001,7 +5501,9 @@ var __webpack_modules__ = {
|
|
|
5001
5501
|
constructor(p, opt) {
|
|
5002
5502
|
opt = opt || {};
|
|
5003
5503
|
super(opt);
|
|
5004
|
-
if (typeof p !== "string")
|
|
5504
|
+
if (typeof p !== "string") {
|
|
5505
|
+
throw new TypeError("path is required");
|
|
5506
|
+
}
|
|
5005
5507
|
this.path = normPath(p);
|
|
5006
5508
|
this.portable = !!opt.portable;
|
|
5007
5509
|
this.myuid = process.getuid && process.getuid() || 0;
|
|
@@ -5024,7 +5526,9 @@ var __webpack_modules__ = {
|
|
|
5024
5526
|
this.length = null;
|
|
5025
5527
|
this.pos = null;
|
|
5026
5528
|
this.remain = null;
|
|
5027
|
-
if (typeof opt.onwarn === "function")
|
|
5529
|
+
if (typeof opt.onwarn === "function") {
|
|
5530
|
+
this.on("warn", opt.onwarn);
|
|
5531
|
+
}
|
|
5028
5532
|
let pathWarn = false;
|
|
5029
5533
|
if (!this.preservePaths) {
|
|
5030
5534
|
const [root, stripped] = stripAbsolutePath(this.path);
|
|
@@ -5039,29 +5543,41 @@ var __webpack_modules__ = {
|
|
|
5039
5543
|
p = p.replace(/\\/g, "/");
|
|
5040
5544
|
}
|
|
5041
5545
|
this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p));
|
|
5042
|
-
if (this.path === "")
|
|
5546
|
+
if (this.path === "") {
|
|
5547
|
+
this.path = "./";
|
|
5548
|
+
}
|
|
5043
5549
|
if (pathWarn) {
|
|
5044
5550
|
this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, {
|
|
5045
5551
|
entry: this,
|
|
5046
5552
|
path: pathWarn + this.path
|
|
5047
5553
|
});
|
|
5048
5554
|
}
|
|
5049
|
-
if (this.statCache.has(this.absolute))
|
|
5555
|
+
if (this.statCache.has(this.absolute)) {
|
|
5556
|
+
this[ONLSTAT](this.statCache.get(this.absolute));
|
|
5557
|
+
} else {
|
|
5558
|
+
this[LSTAT]();
|
|
5559
|
+
}
|
|
5050
5560
|
}
|
|
5051
5561
|
emit(ev, ...data) {
|
|
5052
|
-
if (ev === "error")
|
|
5562
|
+
if (ev === "error") {
|
|
5563
|
+
this[HAD_ERROR] = true;
|
|
5564
|
+
}
|
|
5053
5565
|
return super.emit(ev, ...data);
|
|
5054
5566
|
}
|
|
5055
5567
|
[LSTAT]() {
|
|
5056
5568
|
fs.lstat(this.absolute, ((er, stat) => {
|
|
5057
|
-
if (er)
|
|
5569
|
+
if (er) {
|
|
5570
|
+
return this.emit("error", er);
|
|
5571
|
+
}
|
|
5058
5572
|
this[ONLSTAT](stat);
|
|
5059
5573
|
}));
|
|
5060
5574
|
}
|
|
5061
5575
|
[ONLSTAT](stat) {
|
|
5062
5576
|
this.statCache.set(this.absolute, stat);
|
|
5063
5577
|
this.stat = stat;
|
|
5064
|
-
if (!stat.isFile())
|
|
5578
|
+
if (!stat.isFile()) {
|
|
5579
|
+
stat.size = 0;
|
|
5580
|
+
}
|
|
5065
5581
|
this.type = getType(stat);
|
|
5066
5582
|
this.emit("stat", stat);
|
|
5067
5583
|
this[PROCESS]();
|
|
@@ -5088,7 +5604,9 @@ var __webpack_modules__ = {
|
|
|
5088
5604
|
return prefixPath(path, this.prefix);
|
|
5089
5605
|
}
|
|
5090
5606
|
[HEADER]() {
|
|
5091
|
-
if (this.type === "Directory" && this.portable)
|
|
5607
|
+
if (this.type === "Directory" && this.portable) {
|
|
5608
|
+
this.noMtime = true;
|
|
5609
|
+
}
|
|
5092
5610
|
this.header = new Header({
|
|
5093
5611
|
path: this[PREFIX](this.path),
|
|
5094
5612
|
linkpath: this.type === "Link" ? this[PREFIX](this.linkpath) : this.linkpath,
|
|
@@ -5121,14 +5639,18 @@ var __webpack_modules__ = {
|
|
|
5121
5639
|
super.write(this.header.block);
|
|
5122
5640
|
}
|
|
5123
5641
|
[DIRECTORY]() {
|
|
5124
|
-
if (this.path.
|
|
5642
|
+
if (this.path.slice(-1) !== "/") {
|
|
5643
|
+
this.path += "/";
|
|
5644
|
+
}
|
|
5125
5645
|
this.stat.size = 0;
|
|
5126
5646
|
this[HEADER]();
|
|
5127
5647
|
this.end();
|
|
5128
5648
|
}
|
|
5129
5649
|
[SYMLINK]() {
|
|
5130
5650
|
fs.readlink(this.absolute, ((er, linkpath) => {
|
|
5131
|
-
if (er)
|
|
5651
|
+
if (er) {
|
|
5652
|
+
return this.emit("error", er);
|
|
5653
|
+
}
|
|
5132
5654
|
this[ONREADLINK](linkpath);
|
|
5133
5655
|
}));
|
|
5134
5656
|
}
|
|
@@ -5149,23 +5671,31 @@ var __webpack_modules__ = {
|
|
|
5149
5671
|
const linkKey = this.stat.dev + ":" + this.stat.ino;
|
|
5150
5672
|
if (this.linkCache.has(linkKey)) {
|
|
5151
5673
|
const linkpath = this.linkCache.get(linkKey);
|
|
5152
|
-
if (linkpath.indexOf(this.cwd) === 0)
|
|
5674
|
+
if (linkpath.indexOf(this.cwd) === 0) {
|
|
5675
|
+
return this[HARDLINK](linkpath);
|
|
5676
|
+
}
|
|
5153
5677
|
}
|
|
5154
5678
|
this.linkCache.set(linkKey, this.absolute);
|
|
5155
5679
|
}
|
|
5156
5680
|
this[HEADER]();
|
|
5157
|
-
if (this.stat.size === 0)
|
|
5681
|
+
if (this.stat.size === 0) {
|
|
5682
|
+
return this.end();
|
|
5683
|
+
}
|
|
5158
5684
|
this[OPENFILE]();
|
|
5159
5685
|
}
|
|
5160
5686
|
[OPENFILE]() {
|
|
5161
5687
|
fs.open(this.absolute, "r", ((er, fd) => {
|
|
5162
|
-
if (er)
|
|
5688
|
+
if (er) {
|
|
5689
|
+
return this.emit("error", er);
|
|
5690
|
+
}
|
|
5163
5691
|
this[ONOPENFILE](fd);
|
|
5164
5692
|
}));
|
|
5165
5693
|
}
|
|
5166
5694
|
[ONOPENFILE](fd) {
|
|
5167
5695
|
this.fd = fd;
|
|
5168
|
-
if (this[HAD_ERROR])
|
|
5696
|
+
if (this[HAD_ERROR]) {
|
|
5697
|
+
return this[CLOSE]();
|
|
5698
|
+
}
|
|
5169
5699
|
this.blockLen = 512 * Math.ceil(this.stat.size / 512);
|
|
5170
5700
|
this.blockRemain = this.blockLen;
|
|
5171
5701
|
const bufLen = Math.min(this.blockLen, this.maxReadSize);
|
|
@@ -5212,7 +5742,11 @@ var __webpack_modules__ = {
|
|
|
5212
5742
|
}
|
|
5213
5743
|
const writeBuf = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.slice(this.offset, this.offset + bytesRead);
|
|
5214
5744
|
const flushed = this.write(writeBuf);
|
|
5215
|
-
if (!flushed)
|
|
5745
|
+
if (!flushed) {
|
|
5746
|
+
this[AWAITDRAIN]((() => this[ONDRAIN]()));
|
|
5747
|
+
} else {
|
|
5748
|
+
this[ONDRAIN]();
|
|
5749
|
+
}
|
|
5216
5750
|
}
|
|
5217
5751
|
[AWAITDRAIN](cb) {
|
|
5218
5752
|
this.once("drain", cb);
|
|
@@ -5231,7 +5765,9 @@ var __webpack_modules__ = {
|
|
|
5231
5765
|
}
|
|
5232
5766
|
[ONDRAIN]() {
|
|
5233
5767
|
if (!this.remain) {
|
|
5234
|
-
if (this.blockRemain)
|
|
5768
|
+
if (this.blockRemain) {
|
|
5769
|
+
super.write(Buffer.alloc(this.blockRemain));
|
|
5770
|
+
}
|
|
5235
5771
|
return this[CLOSE]((er => er ? this.emit("error", er) : this.end()));
|
|
5236
5772
|
}
|
|
5237
5773
|
if (this.offset >= this.length) {
|
|
@@ -5286,7 +5822,9 @@ var __webpack_modules__ = {
|
|
|
5286
5822
|
this.noMtime = !!opt.noMtime;
|
|
5287
5823
|
this.readEntry = readEntry;
|
|
5288
5824
|
this.type = readEntry.type;
|
|
5289
|
-
if (this.type === "Directory" && this.portable)
|
|
5825
|
+
if (this.type === "Directory" && this.portable) {
|
|
5826
|
+
this.noMtime = true;
|
|
5827
|
+
}
|
|
5290
5828
|
this.prefix = opt.prefix || null;
|
|
5291
5829
|
this.path = normPath(readEntry.path);
|
|
5292
5830
|
this.mode = this[MODE](readEntry.mode);
|
|
@@ -5299,7 +5837,9 @@ var __webpack_modules__ = {
|
|
|
5299
5837
|
this.atime = this.portable ? null : readEntry.atime;
|
|
5300
5838
|
this.ctime = this.portable ? null : readEntry.ctime;
|
|
5301
5839
|
this.linkpath = normPath(readEntry.linkpath);
|
|
5302
|
-
if (typeof opt.onwarn === "function")
|
|
5840
|
+
if (typeof opt.onwarn === "function") {
|
|
5841
|
+
this.on("warn", opt.onwarn);
|
|
5842
|
+
}
|
|
5303
5843
|
let pathWarn = false;
|
|
5304
5844
|
if (!this.preservePaths) {
|
|
5305
5845
|
const [root, stripped] = stripAbsolutePath(this.path);
|
|
@@ -5356,12 +5896,16 @@ var __webpack_modules__ = {
|
|
|
5356
5896
|
}
|
|
5357
5897
|
write(data) {
|
|
5358
5898
|
const writeLen = data.length;
|
|
5359
|
-
if (writeLen > this.blockRemain)
|
|
5899
|
+
if (writeLen > this.blockRemain) {
|
|
5900
|
+
throw new Error("writing more to entry than is appropriate");
|
|
5901
|
+
}
|
|
5360
5902
|
this.blockRemain -= writeLen;
|
|
5361
5903
|
return super.write(data);
|
|
5362
5904
|
}
|
|
5363
5905
|
end() {
|
|
5364
|
-
if (this.blockRemain)
|
|
5906
|
+
if (this.blockRemain) {
|
|
5907
|
+
super.write(Buffer.alloc(this.blockRemain));
|
|
5908
|
+
}
|
|
5365
5909
|
return super.end();
|
|
5366
5910
|
}
|
|
5367
5911
|
});
|
|
@@ -7359,7 +7903,10 @@ var __webpack_modules__ = {
|
|
|
7359
7903
|
this._debug("promise result:", result);
|
|
7360
7904
|
} catch (e) {
|
|
7361
7905
|
this._debug("promise error:", e);
|
|
7362
|
-
|
|
7906
|
+
if (e.name === "@jsii/kernel.Fault") {
|
|
7907
|
+
throw new JsiiFault(e.message);
|
|
7908
|
+
}
|
|
7909
|
+
throw new RuntimeError(e);
|
|
7363
7910
|
}
|
|
7364
7911
|
return {
|
|
7365
7912
|
result: this._fromSandbox(result, (_a = method.returns) !== null && _a !== void 0 ? _a : "void", `returned by async method ${method.name}`)
|
|
@@ -7387,7 +7934,7 @@ var __webpack_modules__ = {
|
|
|
7387
7934
|
}
|
|
7388
7935
|
complete(req) {
|
|
7389
7936
|
var _a;
|
|
7390
|
-
const {cbid, err, result} = req;
|
|
7937
|
+
const {cbid, err, result, name} = req;
|
|
7391
7938
|
this._debug("complete", cbid, err, result);
|
|
7392
7939
|
const cb = this.waiting.get(cbid);
|
|
7393
7940
|
if (!cb) {
|
|
@@ -7395,7 +7942,7 @@ var __webpack_modules__ = {
|
|
|
7395
7942
|
}
|
|
7396
7943
|
if (err) {
|
|
7397
7944
|
this._debug("completed with error:", err);
|
|
7398
|
-
cb.fail(new
|
|
7945
|
+
cb.fail(name === "@jsii/kernel.Fault" ? new JsiiFault(err) : new RuntimeError(err));
|
|
7399
7946
|
} else {
|
|
7400
7947
|
const sandoxResult = this._toSandbox(result, (_a = cb.expectedReturnType) !== null && _a !== void 0 ? _a : "void", `returned by callback ${cb.toString()}`);
|
|
7401
7948
|
this._debug("completed with result:", sandoxResult);
|
|
@@ -10447,7 +10994,10 @@ var __webpack_modules__ = {
|
|
|
10447
10994
|
const completeReq = req;
|
|
10448
10995
|
if ("complete" in completeReq && completeReq.complete.cbid === callback.cbid) {
|
|
10449
10996
|
if (completeReq.complete.err) {
|
|
10450
|
-
|
|
10997
|
+
if (completeReq.complete.name === "@jsii/kernel.Fault") {
|
|
10998
|
+
throw new kernel_1.JsiiFault(completeReq.complete.err);
|
|
10999
|
+
}
|
|
11000
|
+
throw new kernel_1.RuntimeError(completeReq.complete.err);
|
|
10451
11001
|
}
|
|
10452
11002
|
return completeReq.complete.result;
|
|
10453
11003
|
}
|
|
@@ -10688,7 +11238,11 @@ var __webpack_modules__ = {
|
|
|
10688
11238
|
exports.loadAssemblyFromPath = loadAssemblyFromPath;
|
|
10689
11239
|
function loadAssemblyFromFile(pathToFile, validate = true) {
|
|
10690
11240
|
const data = fs.readFileSync(pathToFile);
|
|
10691
|
-
|
|
11241
|
+
try {
|
|
11242
|
+
return loadAssemblyFromBuffer(data, (filename => fs.readFileSync(path.resolve(pathToFile, "..", filename))), validate);
|
|
11243
|
+
} catch (e) {
|
|
11244
|
+
throw new Error(`Error loading assembly from file ${pathToFile}:\n${e}`);
|
|
11245
|
+
}
|
|
10692
11246
|
}
|
|
10693
11247
|
exports.loadAssemblyFromFile = loadAssemblyFromFile;
|
|
10694
11248
|
function followRedirect(assemblyRedirect, readFile) {
|
|
@@ -10904,11 +11458,16 @@ var __webpack_modules__ = {
|
|
|
10904
11458
|
}
|
|
10905
11459
|
exports.isAssemblyRedirect = isAssemblyRedirect;
|
|
10906
11460
|
function validateAssemblyRedirect(obj) {
|
|
10907
|
-
const ajv = new ajv_1.default
|
|
11461
|
+
const ajv = new ajv_1.default({
|
|
11462
|
+
allErrors: true
|
|
11463
|
+
});
|
|
10908
11464
|
const validate = ajv.compile(exports.assemblyRedirectSchema);
|
|
10909
11465
|
validate(obj);
|
|
10910
11466
|
if (validate.errors) {
|
|
10911
|
-
throw new Error(`Invalid assembly redirect:\n
|
|
11467
|
+
throw new Error(`Invalid assembly redirect:\n * ${ajv.errorsText(validate.errors, {
|
|
11468
|
+
separator: "\n * ",
|
|
11469
|
+
dataVar: "redirect"
|
|
11470
|
+
})}`);
|
|
10912
11471
|
}
|
|
10913
11472
|
return obj;
|
|
10914
11473
|
}
|
|
@@ -10923,11 +11482,20 @@ var __webpack_modules__ = {
|
|
|
10923
11482
|
const ajv_1 = __webpack_require__(2785);
|
|
10924
11483
|
exports.schema = __webpack_require__(9402);
|
|
10925
11484
|
function validateAssembly(obj) {
|
|
10926
|
-
const ajv = new ajv_1.default
|
|
11485
|
+
const ajv = new ajv_1.default({
|
|
11486
|
+
allErrors: true
|
|
11487
|
+
});
|
|
10927
11488
|
const validate = ajv.compile(exports.schema);
|
|
10928
11489
|
validate(obj);
|
|
10929
11490
|
if (validate.errors) {
|
|
10930
|
-
|
|
11491
|
+
let descr = "";
|
|
11492
|
+
if (typeof obj.name === "string" && obj.name !== "") {
|
|
11493
|
+
descr = typeof obj.version === "string" ? ` ${obj.name}@${obj.version}` : ` ${obj.name}`;
|
|
11494
|
+
}
|
|
11495
|
+
throw new Error(`Invalid assembly${descr}:\n * ${ajv.errorsText(validate.errors, {
|
|
11496
|
+
separator: "\n * ",
|
|
11497
|
+
dataVar: "assembly"
|
|
11498
|
+
})}`);
|
|
10931
11499
|
}
|
|
10932
11500
|
return obj;
|
|
10933
11501
|
}
|
|
@@ -16196,7 +16764,7 @@ var __webpack_modules__ = {
|
|
|
16196
16764
|
},
|
|
16197
16765
|
4147: module => {
|
|
16198
16766
|
"use strict";
|
|
16199
|
-
module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.
|
|
16767
|
+
module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.71.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 14.6.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.71.0","@jsii/check-node":"1.71.0","@jsii/spec":"^1.71.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.71.0","@scope/jsii-calc-lib":"^1.71.0","jsii-build-tools":"^1.71.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.1","webpack":"^5.74.0","webpack-cli":"^4.10.0"}}');
|
|
16200
16768
|
},
|
|
16201
16769
|
5277: module => {
|
|
16202
16770
|
"use strict";
|