@telia-ace/alliance-utilities 1.0.0-beta.5 → 1.0.0-beta.7
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/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +944 -1408
- package/dist/index.js.map +1 -1
- package/dist/vite-plugin-css-import.d.ts +2 -2
- package/package.json +33 -33
- package/prettier-config.json +10 -10
- package/typescript-config.json +21 -21
package/dist/index.js
CHANGED
|
@@ -1,255 +1,256 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { pipeline as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
if (typeof
|
|
8
|
-
var
|
|
9
|
-
return
|
|
1
|
+
import yn from "fs";
|
|
2
|
+
import L from "path";
|
|
3
|
+
import { pipeline as tt } from "stream/promises";
|
|
4
|
+
var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5
|
+
function rt(e) {
|
|
6
|
+
var n = e.default;
|
|
7
|
+
if (typeof n == "function") {
|
|
8
|
+
var t = function() {
|
|
9
|
+
return n.apply(this, arguments);
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
t.prototype = n.prototype;
|
|
12
12
|
} else
|
|
13
|
-
|
|
14
|
-
return Object.defineProperty(
|
|
13
|
+
t = {};
|
|
14
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
|
15
15
|
var i = Object.getOwnPropertyDescriptor(e, r);
|
|
16
|
-
Object.defineProperty(
|
|
16
|
+
Object.defineProperty(t, r, i.get ? i : {
|
|
17
17
|
enumerable: !0,
|
|
18
18
|
get: function() {
|
|
19
19
|
return e[r];
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
}),
|
|
22
|
+
}), t;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
return Object.defineProperty(function(...
|
|
27
|
-
if (typeof
|
|
28
|
-
e.apply(this,
|
|
24
|
+
var Q = {}, M = {};
|
|
25
|
+
M.fromCallback = function(e) {
|
|
26
|
+
return Object.defineProperty(function(...n) {
|
|
27
|
+
if (typeof n[n.length - 1] == "function")
|
|
28
|
+
e.apply(this, n);
|
|
29
29
|
else
|
|
30
|
-
return new Promise((
|
|
30
|
+
return new Promise((t, r) => {
|
|
31
31
|
e.call(
|
|
32
32
|
this,
|
|
33
|
-
...
|
|
34
|
-
(i, o) => i != null ? r(i) :
|
|
33
|
+
...n,
|
|
34
|
+
(i, o) => i != null ? r(i) : t(o)
|
|
35
35
|
);
|
|
36
36
|
});
|
|
37
37
|
}, "name", { value: e.name });
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
return Object.defineProperty(function(...
|
|
41
|
-
const
|
|
42
|
-
if (typeof
|
|
43
|
-
return e.apply(this,
|
|
44
|
-
e.apply(this,
|
|
39
|
+
M.fromPromise = function(e) {
|
|
40
|
+
return Object.defineProperty(function(...n) {
|
|
41
|
+
const t = n[n.length - 1];
|
|
42
|
+
if (typeof t != "function")
|
|
43
|
+
return e.apply(this, n);
|
|
44
|
+
e.apply(this, n.slice(0, -1)).then((r) => t(null, r), t);
|
|
45
45
|
}, "name", { value: e.name });
|
|
46
46
|
};
|
|
47
|
-
const
|
|
47
|
+
const it = {}, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48
48
|
__proto__: null,
|
|
49
|
-
default:
|
|
50
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
51
|
-
var
|
|
49
|
+
default: it
|
|
50
|
+
}, Symbol.toStringTag, { value: "Module" })), ee = /* @__PURE__ */ rt(ot);
|
|
51
|
+
var Y = ee, ct = process.cwd, he = null, ut = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
52
52
|
process.cwd = function() {
|
|
53
|
-
return
|
|
53
|
+
return he || (he = ct.call(process)), he;
|
|
54
54
|
};
|
|
55
55
|
try {
|
|
56
56
|
process.cwd();
|
|
57
57
|
} catch {
|
|
58
58
|
}
|
|
59
59
|
if (typeof process.chdir == "function") {
|
|
60
|
-
var
|
|
60
|
+
var Ue = process.chdir;
|
|
61
61
|
process.chdir = function(e) {
|
|
62
|
-
|
|
63
|
-
}, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir,
|
|
62
|
+
he = null, Ue.call(process, e);
|
|
63
|
+
}, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, Ue);
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
var at = ft;
|
|
66
|
+
function ft(e) {
|
|
67
|
+
Y.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && n(e), e.lutimes || t(e), e.chown = o(e.chown), e.fchown = o(e.fchown), e.lchown = o(e.lchown), e.chmod = r(e.chmod), e.fchmod = r(e.fchmod), e.lchmod = r(e.lchmod), e.chownSync = c(e.chownSync), e.fchownSync = c(e.fchownSync), e.lchownSync = c(e.lchownSync), e.chmodSync = i(e.chmodSync), e.fchmodSync = i(e.fchmodSync), e.lchmodSync = i(e.lchmodSync), e.stat = a(e.stat), e.fstat = a(e.fstat), e.lstat = a(e.lstat), e.statSync = f(e.statSync), e.fstatSync = f(e.fstatSync), e.lstatSync = f(e.lstatSync), e.chmod && !e.lchmod && (e.lchmod = function(u, s, y) {
|
|
68
|
+
y && process.nextTick(y);
|
|
69
69
|
}, e.lchmodSync = function() {
|
|
70
|
-
}), e.lchown
|
|
71
|
-
|
|
70
|
+
}), e.chown && !e.lchown && (e.lchown = function(u, s, y, l) {
|
|
71
|
+
l && process.nextTick(l);
|
|
72
72
|
}, e.lchownSync = function() {
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
if (
|
|
73
|
+
}), ut === "win32" && (e.rename = typeof e.rename != "function" ? e.rename : function(u) {
|
|
74
|
+
function s(y, l, m) {
|
|
75
|
+
var $ = Date.now(), v = 0;
|
|
76
|
+
u(y, l, function g(J) {
|
|
77
|
+
if (J && (J.code === "EACCES" || J.code === "EPERM") && Date.now() - $ < 6e4) {
|
|
78
78
|
setTimeout(function() {
|
|
79
|
-
e.stat(
|
|
80
|
-
|
|
79
|
+
e.stat(l, function(I, te) {
|
|
80
|
+
I && I.code === "ENOENT" ? u(y, l, g) : m(J);
|
|
81
81
|
});
|
|
82
|
-
},
|
|
82
|
+
}, v), v < 100 && (v += 10);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
m && m(J);
|
|
86
86
|
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
}
|
|
88
|
+
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
89
|
+
}(e.rename)), e.read = typeof e.read != "function" ? e.read : function(u) {
|
|
90
|
+
function s(y, l, m, $, v, g) {
|
|
91
|
+
var J;
|
|
92
|
+
if (g && typeof g == "function") {
|
|
93
|
+
var I = 0;
|
|
94
|
+
J = function(te, qe, Ye) {
|
|
95
|
+
if (te && te.code === "EAGAIN" && I < 10)
|
|
96
|
+
return I++, u.call(e, y, l, m, $, v, J);
|
|
97
|
+
g.apply(this, arguments);
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
|
-
return
|
|
100
|
+
return u.call(e, y, l, m, $, v, J);
|
|
100
101
|
}
|
|
101
|
-
return Object.setPrototypeOf && Object.setPrototypeOf(
|
|
102
|
-
}(e.read), e.readSync = function(
|
|
103
|
-
return function(
|
|
104
|
-
for (var
|
|
102
|
+
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
103
|
+
}(e.read), e.readSync = typeof e.readSync != "function" ? e.readSync : function(u) {
|
|
104
|
+
return function(s, y, l, m, $) {
|
|
105
|
+
for (var v = 0; ; )
|
|
105
106
|
try {
|
|
106
|
-
return
|
|
107
|
-
} catch (
|
|
108
|
-
if (
|
|
109
|
-
|
|
107
|
+
return u.call(e, s, y, l, m, $);
|
|
108
|
+
} catch (g) {
|
|
109
|
+
if (g.code === "EAGAIN" && v < 10) {
|
|
110
|
+
v++;
|
|
110
111
|
continue;
|
|
111
112
|
}
|
|
112
|
-
throw
|
|
113
|
+
throw g;
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
116
|
}(e.readSync);
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
function(
|
|
123
|
-
if (
|
|
124
|
-
|
|
117
|
+
function n(u) {
|
|
118
|
+
u.lchmod = function(s, y, l) {
|
|
119
|
+
u.open(
|
|
120
|
+
s,
|
|
121
|
+
Y.O_WRONLY | Y.O_SYMLINK,
|
|
122
|
+
y,
|
|
123
|
+
function(m, $) {
|
|
124
|
+
if (m) {
|
|
125
|
+
l && l(m);
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
u.fchmod($, y, function(v) {
|
|
129
|
+
u.close($, function(g) {
|
|
130
|
+
l && l(v || g);
|
|
130
131
|
});
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
);
|
|
134
|
-
},
|
|
135
|
-
var
|
|
135
|
+
}, u.lchmodSync = function(s, y) {
|
|
136
|
+
var l = u.openSync(s, Y.O_WRONLY | Y.O_SYMLINK, y), m = !0, $;
|
|
136
137
|
try {
|
|
137
|
-
|
|
138
|
+
$ = u.fchmodSync(l, y), m = !1;
|
|
138
139
|
} finally {
|
|
139
|
-
if (
|
|
140
|
+
if (m)
|
|
140
141
|
try {
|
|
141
|
-
|
|
142
|
+
u.closeSync(l);
|
|
142
143
|
} catch {
|
|
143
144
|
}
|
|
144
145
|
else
|
|
145
|
-
|
|
146
|
+
u.closeSync(l);
|
|
146
147
|
}
|
|
147
|
-
return
|
|
148
|
+
return $;
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (
|
|
154
|
-
|
|
151
|
+
function t(u) {
|
|
152
|
+
Y.hasOwnProperty("O_SYMLINK") && u.futimes ? (u.lutimes = function(s, y, l, m) {
|
|
153
|
+
u.open(s, Y.O_SYMLINK, function($, v) {
|
|
154
|
+
if ($) {
|
|
155
|
+
m && m($);
|
|
155
156
|
return;
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
u.futimes(v, y, l, function(g) {
|
|
159
|
+
u.close(v, function(J) {
|
|
160
|
+
m && m(g || J);
|
|
160
161
|
});
|
|
161
162
|
});
|
|
162
163
|
});
|
|
163
|
-
},
|
|
164
|
-
var
|
|
164
|
+
}, u.lutimesSync = function(s, y, l) {
|
|
165
|
+
var m = u.openSync(s, Y.O_SYMLINK), $, v = !0;
|
|
165
166
|
try {
|
|
166
|
-
|
|
167
|
+
$ = u.futimesSync(m, y, l), v = !1;
|
|
167
168
|
} finally {
|
|
168
|
-
if (
|
|
169
|
+
if (v)
|
|
169
170
|
try {
|
|
170
|
-
|
|
171
|
+
u.closeSync(m);
|
|
171
172
|
} catch {
|
|
172
173
|
}
|
|
173
174
|
else
|
|
174
|
-
|
|
175
|
+
u.closeSync(m);
|
|
175
176
|
}
|
|
176
|
-
return
|
|
177
|
-
}) : (
|
|
178
|
-
|
|
179
|
-
},
|
|
177
|
+
return $;
|
|
178
|
+
}) : u.futimes && (u.lutimes = function(s, y, l, m) {
|
|
179
|
+
m && process.nextTick(m);
|
|
180
|
+
}, u.lutimesSync = function() {
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
|
-
function r(
|
|
183
|
-
return
|
|
184
|
-
return
|
|
185
|
-
|
|
183
|
+
function r(u) {
|
|
184
|
+
return u && function(s, y, l) {
|
|
185
|
+
return u.call(e, s, y, function(m) {
|
|
186
|
+
h(m) && (m = null), l && l.apply(this, arguments);
|
|
186
187
|
});
|
|
187
188
|
};
|
|
188
189
|
}
|
|
189
|
-
function i(
|
|
190
|
-
return
|
|
190
|
+
function i(u) {
|
|
191
|
+
return u && function(s, y) {
|
|
191
192
|
try {
|
|
192
|
-
return
|
|
193
|
-
} catch (
|
|
194
|
-
if (!
|
|
195
|
-
throw
|
|
193
|
+
return u.call(e, s, y);
|
|
194
|
+
} catch (l) {
|
|
195
|
+
if (!h(l))
|
|
196
|
+
throw l;
|
|
196
197
|
}
|
|
197
198
|
};
|
|
198
199
|
}
|
|
199
|
-
function o(
|
|
200
|
-
return
|
|
201
|
-
return
|
|
202
|
-
|
|
200
|
+
function o(u) {
|
|
201
|
+
return u && function(s, y, l, m) {
|
|
202
|
+
return u.call(e, s, y, l, function($) {
|
|
203
|
+
h($) && ($ = null), m && m.apply(this, arguments);
|
|
203
204
|
});
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
function c(
|
|
207
|
-
return
|
|
207
|
+
function c(u) {
|
|
208
|
+
return u && function(s, y, l) {
|
|
208
209
|
try {
|
|
209
|
-
return
|
|
210
|
-
} catch (
|
|
211
|
-
if (!
|
|
212
|
-
throw
|
|
210
|
+
return u.call(e, s, y, l);
|
|
211
|
+
} catch (m) {
|
|
212
|
+
if (!h(m))
|
|
213
|
+
throw m;
|
|
213
214
|
}
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
|
-
function a(
|
|
217
|
-
return
|
|
218
|
-
typeof
|
|
219
|
-
function
|
|
220
|
-
|
|
217
|
+
function a(u) {
|
|
218
|
+
return u && function(s, y, l) {
|
|
219
|
+
typeof y == "function" && (l = y, y = null);
|
|
220
|
+
function m($, v) {
|
|
221
|
+
v && (v.uid < 0 && (v.uid += 4294967296), v.gid < 0 && (v.gid += 4294967296)), l && l.apply(this, arguments);
|
|
221
222
|
}
|
|
222
|
-
return
|
|
223
|
+
return y ? u.call(e, s, y, m) : u.call(e, s, m);
|
|
223
224
|
};
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
227
|
-
var
|
|
228
|
-
return
|
|
226
|
+
function f(u) {
|
|
227
|
+
return u && function(s, y) {
|
|
228
|
+
var l = y ? u.call(e, s, y) : u.call(e, s);
|
|
229
|
+
return l && (l.uid < 0 && (l.uid += 4294967296), l.gid < 0 && (l.gid += 4294967296)), l;
|
|
229
230
|
};
|
|
230
231
|
}
|
|
231
|
-
function
|
|
232
|
-
if (!
|
|
232
|
+
function h(u) {
|
|
233
|
+
if (!u || u.code === "ENOSYS")
|
|
233
234
|
return !0;
|
|
234
|
-
var
|
|
235
|
-
return !!(
|
|
235
|
+
var s = !process.getuid || process.getuid() !== 0;
|
|
236
|
+
return !!(s && (u.code === "EINVAL" || u.code === "EPERM"));
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
|
-
var
|
|
239
|
-
function
|
|
239
|
+
var Ge = ee.Stream, st = lt;
|
|
240
|
+
function lt(e) {
|
|
240
241
|
return {
|
|
241
|
-
ReadStream:
|
|
242
|
-
WriteStream:
|
|
242
|
+
ReadStream: n,
|
|
243
|
+
WriteStream: t
|
|
243
244
|
};
|
|
244
|
-
function
|
|
245
|
-
if (!(this instanceof
|
|
246
|
-
return new
|
|
247
|
-
|
|
245
|
+
function n(r, i) {
|
|
246
|
+
if (!(this instanceof n))
|
|
247
|
+
return new n(r, i);
|
|
248
|
+
Ge.call(this);
|
|
248
249
|
var o = this;
|
|
249
250
|
this.path = r, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, i = i || {};
|
|
250
|
-
for (var c = Object.keys(i), a = 0,
|
|
251
|
-
var
|
|
252
|
-
this[
|
|
251
|
+
for (var c = Object.keys(i), a = 0, f = c.length; a < f; a++) {
|
|
252
|
+
var h = c[a];
|
|
253
|
+
this[h] = i[h];
|
|
253
254
|
}
|
|
254
255
|
if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
|
|
255
256
|
if (typeof this.start != "number")
|
|
@@ -268,21 +269,21 @@ function jn(e) {
|
|
|
268
269
|
});
|
|
269
270
|
return;
|
|
270
271
|
}
|
|
271
|
-
e.open(this.path, this.flags, this.mode, function(
|
|
272
|
-
if (
|
|
273
|
-
o.emit("error",
|
|
272
|
+
e.open(this.path, this.flags, this.mode, function(u, s) {
|
|
273
|
+
if (u) {
|
|
274
|
+
o.emit("error", u), o.readable = !1;
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
|
-
o.fd =
|
|
277
|
+
o.fd = s, o.emit("open", s), o._read();
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
if (!(this instanceof
|
|
281
|
-
return new
|
|
282
|
-
|
|
280
|
+
function t(r, i) {
|
|
281
|
+
if (!(this instanceof t))
|
|
282
|
+
return new t(r, i);
|
|
283
|
+
Ge.call(this), this.path = r, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, i = i || {};
|
|
283
284
|
for (var o = Object.keys(i), c = 0, a = o.length; c < a; c++) {
|
|
284
|
-
var
|
|
285
|
-
this[
|
|
285
|
+
var f = o[c];
|
|
286
|
+
this[f] = i[f];
|
|
286
287
|
}
|
|
287
288
|
if (this.start !== void 0) {
|
|
288
289
|
if (typeof this.start != "number")
|
|
@@ -294,225 +295,248 @@ function jn(e) {
|
|
|
294
295
|
this.busy = !1, this._queue = [], this.fd === null && (this._open = e.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
|
-
var
|
|
298
|
+
var yt = dt, mt = Object.getPrototypeOf || function(e) {
|
|
298
299
|
return e.__proto__;
|
|
299
300
|
};
|
|
300
|
-
function
|
|
301
|
+
function dt(e) {
|
|
301
302
|
if (e === null || typeof e != "object")
|
|
302
303
|
return e;
|
|
303
304
|
if (e instanceof Object)
|
|
304
|
-
var
|
|
305
|
+
var n = { __proto__: mt(e) };
|
|
305
306
|
else
|
|
306
|
-
var
|
|
307
|
-
return Object.getOwnPropertyNames(e).forEach(function(
|
|
308
|
-
Object.defineProperty(
|
|
309
|
-
}),
|
|
307
|
+
var n = /* @__PURE__ */ Object.create(null);
|
|
308
|
+
return Object.getOwnPropertyNames(e).forEach(function(t) {
|
|
309
|
+
Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(e, t));
|
|
310
|
+
}), n;
|
|
310
311
|
}
|
|
311
|
-
var
|
|
312
|
-
typeof Symbol == "function" && typeof Symbol.for == "function" ? (
|
|
313
|
-
function
|
|
312
|
+
var P = yn, ht = at, St = st, wt = yt, le = ee, x, ve;
|
|
313
|
+
typeof Symbol == "function" && typeof Symbol.for == "function" ? (x = Symbol.for("graceful-fs.queue"), ve = Symbol.for("graceful-fs.previous")) : (x = "___graceful-fs.queue", ve = "___graceful-fs.previous");
|
|
314
|
+
function vt() {
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
-
Object.defineProperty(e,
|
|
316
|
+
function mn(e, n) {
|
|
317
|
+
Object.defineProperty(e, x, {
|
|
317
318
|
get: function() {
|
|
318
|
-
return
|
|
319
|
+
return n;
|
|
319
320
|
}
|
|
320
321
|
});
|
|
321
322
|
}
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
var e =
|
|
323
|
+
var V = vt;
|
|
324
|
+
le.debuglog ? V = le.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (V = function() {
|
|
325
|
+
var e = le.format.apply(le, arguments);
|
|
325
326
|
e = "GFS4: " + e.split(/\n/).join(`
|
|
326
327
|
GFS4: `), console.error(e);
|
|
327
328
|
});
|
|
328
|
-
if (!
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
function t
|
|
332
|
-
return e.call(
|
|
333
|
-
i ||
|
|
329
|
+
if (!P[x]) {
|
|
330
|
+
var Et = _e[x] || [];
|
|
331
|
+
mn(P, Et), P.close = function(e) {
|
|
332
|
+
function n(t, r) {
|
|
333
|
+
return e.call(P, t, function(i) {
|
|
334
|
+
i || Ke(), typeof r == "function" && r.apply(this, arguments);
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
|
-
return Object.defineProperty(
|
|
337
|
+
return Object.defineProperty(n, ve, {
|
|
337
338
|
value: e
|
|
338
|
-
}),
|
|
339
|
-
}(
|
|
340
|
-
function t
|
|
341
|
-
e.apply(
|
|
339
|
+
}), n;
|
|
340
|
+
}(P.close), P.closeSync = function(e) {
|
|
341
|
+
function n(t) {
|
|
342
|
+
e.apply(P, arguments), Ke();
|
|
342
343
|
}
|
|
343
|
-
return Object.defineProperty(
|
|
344
|
+
return Object.defineProperty(n, ve, {
|
|
344
345
|
value: e
|
|
345
|
-
}),
|
|
346
|
-
}(
|
|
347
|
-
|
|
346
|
+
}), n;
|
|
347
|
+
}(P.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
|
|
348
|
+
V(P[x]), ee.equal(P[x].length, 0);
|
|
348
349
|
});
|
|
349
350
|
}
|
|
350
|
-
|
|
351
|
-
var
|
|
352
|
-
process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
353
|
-
function
|
|
354
|
-
|
|
355
|
-
var
|
|
356
|
-
e.readFile =
|
|
357
|
-
function
|
|
358
|
-
return typeof
|
|
359
|
-
function
|
|
360
|
-
return
|
|
361
|
-
|
|
351
|
+
_e[x] || mn(_e, P[x]);
|
|
352
|
+
var W = je(wt(P));
|
|
353
|
+
process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !P.__patched && (W = je(P), P.__patched = !0);
|
|
354
|
+
function je(e) {
|
|
355
|
+
ht(e), e.gracefulify = je, e.createReadStream = qe, e.createWriteStream = Ye;
|
|
356
|
+
var n = e.readFile;
|
|
357
|
+
e.readFile = t;
|
|
358
|
+
function t(d, w, S) {
|
|
359
|
+
return typeof w == "function" && (S = w, w = null), T(d, w, S);
|
|
360
|
+
function T(_, D, F, O) {
|
|
361
|
+
return n(_, D, function(p) {
|
|
362
|
+
p && (p.code === "EMFILE" || p.code === "ENFILE") ? z([T, [_, D, F], p, O || Date.now(), Date.now()]) : typeof F == "function" && F.apply(this, arguments);
|
|
362
363
|
});
|
|
363
364
|
}
|
|
364
365
|
}
|
|
365
366
|
var r = e.writeFile;
|
|
366
367
|
e.writeFile = i;
|
|
367
|
-
function i(
|
|
368
|
-
return typeof
|
|
369
|
-
function
|
|
370
|
-
return r(
|
|
371
|
-
|
|
368
|
+
function i(d, w, S, T) {
|
|
369
|
+
return typeof S == "function" && (T = S, S = null), _(d, w, S, T);
|
|
370
|
+
function _(D, F, O, p, C) {
|
|
371
|
+
return r(D, F, O, function(k) {
|
|
372
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? z([_, [D, F, O, p], k, C || Date.now(), Date.now()]) : typeof p == "function" && p.apply(this, arguments);
|
|
372
373
|
});
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
var o = e.appendFile;
|
|
376
377
|
o && (e.appendFile = c);
|
|
377
|
-
function c(
|
|
378
|
-
return typeof
|
|
379
|
-
function
|
|
380
|
-
return o(
|
|
381
|
-
|
|
378
|
+
function c(d, w, S, T) {
|
|
379
|
+
return typeof S == "function" && (T = S, S = null), _(d, w, S, T);
|
|
380
|
+
function _(D, F, O, p, C) {
|
|
381
|
+
return o(D, F, O, function(k) {
|
|
382
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? z([_, [D, F, O, p], k, C || Date.now(), Date.now()]) : typeof p == "function" && p.apply(this, arguments);
|
|
382
383
|
});
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
386
|
var a = e.copyFile;
|
|
386
|
-
a && (e.copyFile =
|
|
387
|
-
function
|
|
388
|
-
return typeof
|
|
389
|
-
function
|
|
390
|
-
return a(
|
|
391
|
-
|
|
387
|
+
a && (e.copyFile = f);
|
|
388
|
+
function f(d, w, S, T) {
|
|
389
|
+
return typeof S == "function" && (T = S, S = 0), _(d, w, S, T);
|
|
390
|
+
function _(D, F, O, p, C) {
|
|
391
|
+
return a(D, F, O, function(k) {
|
|
392
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? z([_, [D, F, O, p], k, C || Date.now(), Date.now()]) : typeof p == "function" && p.apply(this, arguments);
|
|
392
393
|
});
|
|
393
394
|
}
|
|
394
395
|
}
|
|
395
|
-
var
|
|
396
|
-
e.readdir =
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
396
|
+
var h = e.readdir;
|
|
397
|
+
e.readdir = s;
|
|
398
|
+
var u = /^v[0-5]\./;
|
|
399
|
+
function s(d, w, S) {
|
|
400
|
+
typeof w == "function" && (S = w, w = null);
|
|
401
|
+
var T = u.test(process.version) ? function(F, O, p, C) {
|
|
402
|
+
return h(F, _(
|
|
403
|
+
F,
|
|
404
|
+
O,
|
|
405
|
+
p,
|
|
406
|
+
C
|
|
407
|
+
));
|
|
408
|
+
} : function(F, O, p, C) {
|
|
409
|
+
return h(F, O, _(
|
|
410
|
+
F,
|
|
411
|
+
O,
|
|
412
|
+
p,
|
|
413
|
+
C
|
|
414
|
+
));
|
|
415
|
+
};
|
|
416
|
+
return T(d, w, S);
|
|
417
|
+
function _(D, F, O, p) {
|
|
418
|
+
return function(C, k) {
|
|
419
|
+
C && (C.code === "EMFILE" || C.code === "ENFILE") ? z([
|
|
420
|
+
T,
|
|
421
|
+
[D, F, O],
|
|
422
|
+
C,
|
|
423
|
+
p || Date.now(),
|
|
424
|
+
Date.now()
|
|
425
|
+
]) : (k && k.sort && k.sort(), typeof O == "function" && O.call(this, C, k));
|
|
426
|
+
};
|
|
403
427
|
}
|
|
404
428
|
}
|
|
405
429
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
406
|
-
var
|
|
407
|
-
|
|
430
|
+
var y = St(e);
|
|
431
|
+
g = y.ReadStream, I = y.WriteStream;
|
|
408
432
|
}
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
var
|
|
412
|
-
|
|
433
|
+
var l = e.ReadStream;
|
|
434
|
+
l && (g.prototype = Object.create(l.prototype), g.prototype.open = J);
|
|
435
|
+
var m = e.WriteStream;
|
|
436
|
+
m && (I.prototype = Object.create(m.prototype), I.prototype.open = te), Object.defineProperty(e, "ReadStream", {
|
|
413
437
|
get: function() {
|
|
414
|
-
return
|
|
438
|
+
return g;
|
|
415
439
|
},
|
|
416
|
-
set: function(
|
|
417
|
-
|
|
440
|
+
set: function(d) {
|
|
441
|
+
g = d;
|
|
418
442
|
},
|
|
419
443
|
enumerable: !0,
|
|
420
444
|
configurable: !0
|
|
421
445
|
}), Object.defineProperty(e, "WriteStream", {
|
|
422
446
|
get: function() {
|
|
423
|
-
return
|
|
447
|
+
return I;
|
|
424
448
|
},
|
|
425
|
-
set: function(
|
|
426
|
-
|
|
449
|
+
set: function(d) {
|
|
450
|
+
I = d;
|
|
427
451
|
},
|
|
428
452
|
enumerable: !0,
|
|
429
453
|
configurable: !0
|
|
430
454
|
});
|
|
431
|
-
var
|
|
455
|
+
var $ = g;
|
|
432
456
|
Object.defineProperty(e, "FileReadStream", {
|
|
433
457
|
get: function() {
|
|
434
|
-
return
|
|
458
|
+
return $;
|
|
435
459
|
},
|
|
436
|
-
set: function(
|
|
437
|
-
|
|
460
|
+
set: function(d) {
|
|
461
|
+
$ = d;
|
|
438
462
|
},
|
|
439
463
|
enumerable: !0,
|
|
440
464
|
configurable: !0
|
|
441
465
|
});
|
|
442
|
-
var
|
|
466
|
+
var v = I;
|
|
443
467
|
Object.defineProperty(e, "FileWriteStream", {
|
|
444
468
|
get: function() {
|
|
445
|
-
return
|
|
469
|
+
return v;
|
|
446
470
|
},
|
|
447
|
-
set: function(
|
|
448
|
-
|
|
471
|
+
set: function(d) {
|
|
472
|
+
v = d;
|
|
449
473
|
},
|
|
450
474
|
enumerable: !0,
|
|
451
475
|
configurable: !0
|
|
452
476
|
});
|
|
453
|
-
function
|
|
454
|
-
return this instanceof
|
|
477
|
+
function g(d, w) {
|
|
478
|
+
return this instanceof g ? (l.apply(this, arguments), this) : g.apply(Object.create(g.prototype), arguments);
|
|
455
479
|
}
|
|
456
|
-
function
|
|
457
|
-
var
|
|
458
|
-
|
|
459
|
-
|
|
480
|
+
function J() {
|
|
481
|
+
var d = this;
|
|
482
|
+
Pe(d.path, d.flags, d.mode, function(w, S) {
|
|
483
|
+
w ? (d.autoClose && d.destroy(), d.emit("error", w)) : (d.fd = S, d.emit("open", S), d.read());
|
|
460
484
|
});
|
|
461
485
|
}
|
|
462
|
-
function
|
|
463
|
-
return this instanceof
|
|
486
|
+
function I(d, w) {
|
|
487
|
+
return this instanceof I ? (m.apply(this, arguments), this) : I.apply(Object.create(I.prototype), arguments);
|
|
464
488
|
}
|
|
465
|
-
function
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
|
|
489
|
+
function te() {
|
|
490
|
+
var d = this;
|
|
491
|
+
Pe(d.path, d.flags, d.mode, function(w, S) {
|
|
492
|
+
w ? (d.destroy(), d.emit("error", w)) : (d.fd = S, d.emit("open", S));
|
|
469
493
|
});
|
|
470
494
|
}
|
|
471
|
-
function
|
|
472
|
-
return new e.ReadStream(
|
|
495
|
+
function qe(d, w) {
|
|
496
|
+
return new e.ReadStream(d, w);
|
|
473
497
|
}
|
|
474
|
-
function
|
|
475
|
-
return new e.WriteStream(
|
|
498
|
+
function Ye(d, w) {
|
|
499
|
+
return new e.WriteStream(d, w);
|
|
476
500
|
}
|
|
477
|
-
var
|
|
478
|
-
e.open =
|
|
479
|
-
function
|
|
480
|
-
return typeof
|
|
481
|
-
function
|
|
482
|
-
return D
|
|
483
|
-
|
|
501
|
+
var nt = e.open;
|
|
502
|
+
e.open = Pe;
|
|
503
|
+
function Pe(d, w, S, T) {
|
|
504
|
+
return typeof S == "function" && (T = S, S = null), _(d, w, S, T);
|
|
505
|
+
function _(D, F, O, p, C) {
|
|
506
|
+
return nt(D, F, O, function(k, Wi) {
|
|
507
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? z([_, [D, F, O, p], k, C || Date.now(), Date.now()]) : typeof p == "function" && p.apply(this, arguments);
|
|
484
508
|
});
|
|
485
509
|
}
|
|
486
510
|
}
|
|
487
511
|
return e;
|
|
488
512
|
}
|
|
489
|
-
function
|
|
490
|
-
|
|
513
|
+
function z(e) {
|
|
514
|
+
V("ENQUEUE", e[0].name, e[1]), P[x].push(e), Ie();
|
|
491
515
|
}
|
|
492
|
-
var
|
|
493
|
-
function
|
|
494
|
-
for (var e = Date.now(),
|
|
495
|
-
|
|
496
|
-
|
|
516
|
+
var ye;
|
|
517
|
+
function Ke() {
|
|
518
|
+
for (var e = Date.now(), n = 0; n < P[x].length; ++n)
|
|
519
|
+
P[x][n].length > 2 && (P[x][n][3] = e, P[x][n][4] = e);
|
|
520
|
+
Ie();
|
|
497
521
|
}
|
|
498
|
-
function
|
|
499
|
-
if (clearTimeout(
|
|
500
|
-
var e =
|
|
522
|
+
function Ie() {
|
|
523
|
+
if (clearTimeout(ye), ye = void 0, P[x].length !== 0) {
|
|
524
|
+
var e = P[x].shift(), n = e[0], t = e[1], r = e[2], i = e[3], o = e[4];
|
|
501
525
|
if (i === void 0)
|
|
502
|
-
|
|
526
|
+
V("RETRY", n.name, t), n.apply(null, t);
|
|
503
527
|
else if (Date.now() - i >= 6e4) {
|
|
504
|
-
|
|
505
|
-
var c =
|
|
528
|
+
V("TIMEOUT", n.name, t);
|
|
529
|
+
var c = t.pop();
|
|
506
530
|
typeof c == "function" && c.call(null, r);
|
|
507
531
|
} else {
|
|
508
|
-
var a = Date.now() - o,
|
|
509
|
-
a >=
|
|
532
|
+
var a = Date.now() - o, f = Math.max(o - i, 1), h = Math.min(f * 1.2, 100);
|
|
533
|
+
a >= h ? (V("RETRY", n.name, t), n.apply(null, t.concat([i]))) : P[x].push(e);
|
|
510
534
|
}
|
|
511
|
-
|
|
535
|
+
ye === void 0 && (ye = setTimeout(Ie, 0));
|
|
512
536
|
}
|
|
513
537
|
}
|
|
514
538
|
(function(e) {
|
|
515
|
-
const
|
|
539
|
+
const n = M.fromCallback, t = W, r = [
|
|
516
540
|
"access",
|
|
517
541
|
"appendFile",
|
|
518
542
|
"chmod",
|
|
@@ -547,115 +571,115 @@ function Ze() {
|
|
|
547
571
|
"unlink",
|
|
548
572
|
"utimes",
|
|
549
573
|
"writeFile"
|
|
550
|
-
].filter((i) => typeof
|
|
551
|
-
Object.assign(e,
|
|
552
|
-
e[i] = t
|
|
574
|
+
].filter((i) => typeof t[i] == "function");
|
|
575
|
+
Object.assign(e, t), r.forEach((i) => {
|
|
576
|
+
e[i] = n(t[i]);
|
|
553
577
|
}), e.exists = function(i, o) {
|
|
554
|
-
return typeof o == "function" ?
|
|
555
|
-
}, e.read = function(i, o, c, a,
|
|
556
|
-
return typeof
|
|
557
|
-
|
|
558
|
-
if (
|
|
559
|
-
return
|
|
560
|
-
|
|
578
|
+
return typeof o == "function" ? t.exists(i, o) : new Promise((c) => t.exists(i, c));
|
|
579
|
+
}, e.read = function(i, o, c, a, f, h) {
|
|
580
|
+
return typeof h == "function" ? t.read(i, o, c, a, f, h) : new Promise((u, s) => {
|
|
581
|
+
t.read(i, o, c, a, f, (y, l, m) => {
|
|
582
|
+
if (y)
|
|
583
|
+
return s(y);
|
|
584
|
+
u({ bytesRead: l, buffer: m });
|
|
561
585
|
});
|
|
562
586
|
});
|
|
563
587
|
}, e.write = function(i, o, ...c) {
|
|
564
|
-
return typeof c[c.length - 1] == "function" ?
|
|
565
|
-
|
|
566
|
-
if (
|
|
567
|
-
return
|
|
568
|
-
a({ bytesWritten:
|
|
588
|
+
return typeof c[c.length - 1] == "function" ? t.write(i, o, ...c) : new Promise((a, f) => {
|
|
589
|
+
t.write(i, o, ...c, (h, u, s) => {
|
|
590
|
+
if (h)
|
|
591
|
+
return f(h);
|
|
592
|
+
a({ bytesWritten: u, buffer: s });
|
|
569
593
|
});
|
|
570
594
|
});
|
|
571
|
-
}, typeof
|
|
572
|
-
return typeof c[c.length - 1] == "function" ?
|
|
573
|
-
|
|
574
|
-
if (
|
|
575
|
-
return
|
|
576
|
-
a({ bytesWritten:
|
|
595
|
+
}, typeof t.writev == "function" && (e.writev = function(i, o, ...c) {
|
|
596
|
+
return typeof c[c.length - 1] == "function" ? t.writev(i, o, ...c) : new Promise((a, f) => {
|
|
597
|
+
t.writev(i, o, ...c, (h, u, s) => {
|
|
598
|
+
if (h)
|
|
599
|
+
return f(h);
|
|
600
|
+
a({ bytesWritten: u, buffers: s });
|
|
577
601
|
});
|
|
578
602
|
});
|
|
579
|
-
}), typeof
|
|
603
|
+
}), typeof t.realpath.native == "function" ? e.realpath.native = n(t.realpath.native) : process.emitWarning(
|
|
580
604
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
581
605
|
"Warning",
|
|
582
606
|
"fs-extra-WARN0003"
|
|
583
607
|
);
|
|
584
|
-
})(
|
|
585
|
-
var
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
if (process.platform === "win32" && /[<>:"|?*]/.test(
|
|
589
|
-
const r = new Error(`Path contains invalid characters: ${
|
|
608
|
+
})(Q);
|
|
609
|
+
var Le = {}, dn = {};
|
|
610
|
+
const pt = L;
|
|
611
|
+
dn.checkPath = function(n) {
|
|
612
|
+
if (process.platform === "win32" && /[<>:"|?*]/.test(n.replace(pt.parse(n).root, ""))) {
|
|
613
|
+
const r = new Error(`Path contains invalid characters: ${n}`);
|
|
590
614
|
throw r.code = "EINVAL", r;
|
|
591
615
|
}
|
|
592
616
|
};
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
return typeof e == "number" ? e : { ...
|
|
617
|
+
const hn = Q, { checkPath: Sn } = dn, wn = (e) => {
|
|
618
|
+
const n = { mode: 511 };
|
|
619
|
+
return typeof e == "number" ? e : { ...n, ...e }.mode;
|
|
596
620
|
};
|
|
597
|
-
|
|
598
|
-
mode:
|
|
621
|
+
Le.makeDir = async (e, n) => (Sn(e), hn.mkdir(e, {
|
|
622
|
+
mode: wn(n),
|
|
599
623
|
recursive: !0
|
|
600
624
|
}));
|
|
601
|
-
|
|
602
|
-
mode:
|
|
625
|
+
Le.makeDirSync = (e, n) => (Sn(e), hn.mkdirSync(e, {
|
|
626
|
+
mode: wn(n),
|
|
603
627
|
recursive: !0
|
|
604
628
|
}));
|
|
605
|
-
const
|
|
606
|
-
var
|
|
607
|
-
mkdirs:
|
|
608
|
-
mkdirsSync:
|
|
609
|
-
mkdirp:
|
|
610
|
-
mkdirpSync:
|
|
611
|
-
ensureDir:
|
|
612
|
-
ensureDirSync:
|
|
629
|
+
const $t = M.fromPromise, { makeDir: kt, makeDirSync: Oe } = Le, De = $t(kt);
|
|
630
|
+
var q = {
|
|
631
|
+
mkdirs: De,
|
|
632
|
+
mkdirsSync: Oe,
|
|
633
|
+
mkdirp: De,
|
|
634
|
+
mkdirpSync: Oe,
|
|
635
|
+
ensureDir: De,
|
|
636
|
+
ensureDirSync: Oe
|
|
613
637
|
};
|
|
614
|
-
const
|
|
615
|
-
function
|
|
616
|
-
return
|
|
638
|
+
const gt = M.fromPromise, vn = Q;
|
|
639
|
+
function Ft(e) {
|
|
640
|
+
return vn.access(e).then(() => !0).catch(() => !1);
|
|
617
641
|
}
|
|
618
|
-
var
|
|
619
|
-
pathExists:
|
|
620
|
-
pathExistsSync:
|
|
642
|
+
var X = {
|
|
643
|
+
pathExists: gt(Ft),
|
|
644
|
+
pathExistsSync: vn.existsSync
|
|
621
645
|
};
|
|
622
|
-
const
|
|
623
|
-
function
|
|
624
|
-
|
|
646
|
+
const H = W;
|
|
647
|
+
function Pt(e, n, t, r) {
|
|
648
|
+
H.open(e, "r+", (i, o) => {
|
|
625
649
|
if (i)
|
|
626
650
|
return r(i);
|
|
627
|
-
|
|
628
|
-
|
|
651
|
+
H.futimes(o, n, t, (c) => {
|
|
652
|
+
H.close(o, (a) => {
|
|
629
653
|
r && r(c || a);
|
|
630
654
|
});
|
|
631
655
|
});
|
|
632
656
|
});
|
|
633
657
|
}
|
|
634
|
-
function
|
|
635
|
-
const r =
|
|
636
|
-
return
|
|
658
|
+
function Ot(e, n, t) {
|
|
659
|
+
const r = H.openSync(e, "r+");
|
|
660
|
+
return H.futimesSync(r, n, t), H.closeSync(r);
|
|
637
661
|
}
|
|
638
|
-
var
|
|
639
|
-
utimesMillis:
|
|
640
|
-
utimesMillisSync:
|
|
662
|
+
var En = {
|
|
663
|
+
utimesMillis: Pt,
|
|
664
|
+
utimesMillisSync: Ot
|
|
641
665
|
};
|
|
642
|
-
const
|
|
643
|
-
function
|
|
644
|
-
const r =
|
|
666
|
+
const b = Q, N = L, Dt = ee;
|
|
667
|
+
function Nt(e, n, t) {
|
|
668
|
+
const r = t.dereference ? (i) => b.stat(i, { bigint: !0 }) : (i) => b.lstat(i, { bigint: !0 });
|
|
645
669
|
return Promise.all([
|
|
646
670
|
r(e),
|
|
647
|
-
r(
|
|
671
|
+
r(n).catch((i) => {
|
|
648
672
|
if (i.code === "ENOENT")
|
|
649
673
|
return null;
|
|
650
674
|
throw i;
|
|
651
675
|
})
|
|
652
676
|
]).then(([i, o]) => ({ srcStat: i, destStat: o }));
|
|
653
677
|
}
|
|
654
|
-
function
|
|
678
|
+
function Tt(e, n, t) {
|
|
655
679
|
let r;
|
|
656
|
-
const i =
|
|
680
|
+
const i = t.dereference ? (c) => b.statSync(c, { bigint: !0 }) : (c) => b.lstatSync(c, { bigint: !0 }), o = i(e);
|
|
657
681
|
try {
|
|
658
|
-
r = i(
|
|
682
|
+
r = i(n);
|
|
659
683
|
} catch (c) {
|
|
660
684
|
if (c.code === "ENOENT")
|
|
661
685
|
return { srcStat: o, destStat: null };
|
|
@@ -663,290 +687,290 @@ function Xn(e, t, n) {
|
|
|
663
687
|
}
|
|
664
688
|
return { srcStat: o, destStat: r };
|
|
665
689
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
690
|
+
function _t(e, n, t, r, i) {
|
|
691
|
+
Dt.callbackify(Nt)(e, n, r, (o, c) => {
|
|
668
692
|
if (o)
|
|
669
693
|
return i(o);
|
|
670
|
-
const { srcStat: a, destStat:
|
|
671
|
-
if (
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
return
|
|
694
|
+
const { srcStat: a, destStat: f } = c;
|
|
695
|
+
if (f) {
|
|
696
|
+
if (se(a, f)) {
|
|
697
|
+
const h = N.basename(e), u = N.basename(n);
|
|
698
|
+
return t === "move" && h !== u && h.toLowerCase() === u.toLowerCase() ? i(null, { srcStat: a, destStat: f, isChangingCase: !0 }) : i(new Error("Source and destination must not be the same."));
|
|
675
699
|
}
|
|
676
|
-
if (a.isDirectory() && !
|
|
677
|
-
return i(new Error(`Cannot overwrite non-directory '${
|
|
678
|
-
if (!a.isDirectory() &&
|
|
679
|
-
return i(new Error(`Cannot overwrite directory '${
|
|
700
|
+
if (a.isDirectory() && !f.isDirectory())
|
|
701
|
+
return i(new Error(`Cannot overwrite non-directory '${n}' with directory '${e}'.`));
|
|
702
|
+
if (!a.isDirectory() && f.isDirectory())
|
|
703
|
+
return i(new Error(`Cannot overwrite directory '${n}' with non-directory '${e}'.`));
|
|
680
704
|
}
|
|
681
|
-
return a.isDirectory() &&
|
|
705
|
+
return a.isDirectory() && Re(e, n) ? i(new Error($e(e, n, t))) : i(null, { srcStat: a, destStat: f });
|
|
682
706
|
});
|
|
683
707
|
}
|
|
684
|
-
function
|
|
685
|
-
const { srcStat: i, destStat: o } =
|
|
708
|
+
function Ct(e, n, t, r) {
|
|
709
|
+
const { srcStat: i, destStat: o } = Tt(e, n, r);
|
|
686
710
|
if (o) {
|
|
687
|
-
if (
|
|
688
|
-
const c =
|
|
689
|
-
if (
|
|
711
|
+
if (se(i, o)) {
|
|
712
|
+
const c = N.basename(e), a = N.basename(n);
|
|
713
|
+
if (t === "move" && c !== a && c.toLowerCase() === a.toLowerCase())
|
|
690
714
|
return { srcStat: i, destStat: o, isChangingCase: !0 };
|
|
691
715
|
throw new Error("Source and destination must not be the same.");
|
|
692
716
|
}
|
|
693
717
|
if (i.isDirectory() && !o.isDirectory())
|
|
694
|
-
throw new Error(`Cannot overwrite non-directory '${
|
|
718
|
+
throw new Error(`Cannot overwrite non-directory '${n}' with directory '${e}'.`);
|
|
695
719
|
if (!i.isDirectory() && o.isDirectory())
|
|
696
|
-
throw new Error(`Cannot overwrite directory '${
|
|
720
|
+
throw new Error(`Cannot overwrite directory '${n}' with non-directory '${e}'.`);
|
|
697
721
|
}
|
|
698
|
-
if (i.isDirectory() &&
|
|
699
|
-
throw new Error(
|
|
722
|
+
if (i.isDirectory() && Re(e, n))
|
|
723
|
+
throw new Error($e(e, n, t));
|
|
700
724
|
return { srcStat: i, destStat: o };
|
|
701
725
|
}
|
|
702
|
-
function
|
|
703
|
-
const o =
|
|
704
|
-
if (c === o || c ===
|
|
726
|
+
function pn(e, n, t, r, i) {
|
|
727
|
+
const o = N.resolve(N.dirname(e)), c = N.resolve(N.dirname(t));
|
|
728
|
+
if (c === o || c === N.parse(c).root)
|
|
705
729
|
return i();
|
|
706
|
-
|
|
730
|
+
b.stat(c, { bigint: !0 }, (a, f) => a ? a.code === "ENOENT" ? i() : i(a) : se(n, f) ? i(new Error($e(e, t, r))) : pn(e, n, c, r, i));
|
|
707
731
|
}
|
|
708
|
-
function
|
|
709
|
-
const i =
|
|
710
|
-
if (o === i || o ===
|
|
732
|
+
function $n(e, n, t, r) {
|
|
733
|
+
const i = N.resolve(N.dirname(e)), o = N.resolve(N.dirname(t));
|
|
734
|
+
if (o === i || o === N.parse(o).root)
|
|
711
735
|
return;
|
|
712
736
|
let c;
|
|
713
737
|
try {
|
|
714
|
-
c =
|
|
738
|
+
c = b.statSync(o, { bigint: !0 });
|
|
715
739
|
} catch (a) {
|
|
716
740
|
if (a.code === "ENOENT")
|
|
717
741
|
return;
|
|
718
742
|
throw a;
|
|
719
743
|
}
|
|
720
|
-
if (
|
|
721
|
-
throw new Error(
|
|
722
|
-
return
|
|
723
|
-
}
|
|
724
|
-
function
|
|
725
|
-
return
|
|
726
|
-
}
|
|
727
|
-
function
|
|
728
|
-
const
|
|
729
|
-
return
|
|
730
|
-
}
|
|
731
|
-
function
|
|
732
|
-
return `Cannot ${
|
|
733
|
-
}
|
|
734
|
-
var
|
|
735
|
-
checkPaths:
|
|
736
|
-
checkPathsSync:
|
|
737
|
-
checkParentPaths:
|
|
738
|
-
checkParentPathsSync:
|
|
739
|
-
isSrcSubdir:
|
|
740
|
-
areIdentical:
|
|
744
|
+
if (se(n, c))
|
|
745
|
+
throw new Error($e(e, t, r));
|
|
746
|
+
return $n(e, n, o, r);
|
|
747
|
+
}
|
|
748
|
+
function se(e, n) {
|
|
749
|
+
return n.ino && n.dev && n.ino === e.ino && n.dev === e.dev;
|
|
750
|
+
}
|
|
751
|
+
function Re(e, n) {
|
|
752
|
+
const t = N.resolve(e).split(N.sep).filter((i) => i), r = N.resolve(n).split(N.sep).filter((i) => i);
|
|
753
|
+
return t.reduce((i, o, c) => i && r[c] === o, !0);
|
|
754
|
+
}
|
|
755
|
+
function $e(e, n, t) {
|
|
756
|
+
return `Cannot ${t} '${e}' to a subdirectory of itself, '${n}'.`;
|
|
757
|
+
}
|
|
758
|
+
var ne = {
|
|
759
|
+
checkPaths: _t,
|
|
760
|
+
checkPathsSync: Ct,
|
|
761
|
+
checkParentPaths: pn,
|
|
762
|
+
checkParentPathsSync: $n,
|
|
763
|
+
isSrcSubdir: Re,
|
|
764
|
+
areIdentical: se
|
|
741
765
|
};
|
|
742
|
-
const
|
|
743
|
-
function
|
|
744
|
-
typeof
|
|
745
|
-
},
|
|
766
|
+
const A = W, oe = L, xt = q.mkdirs, jt = X.pathExists, It = En.utimesMillis, ce = ne;
|
|
767
|
+
function Lt(e, n, t, r) {
|
|
768
|
+
typeof t == "function" && !r ? (r = t, t = {}) : typeof t == "function" && (t = { filter: t }), r = r || function() {
|
|
769
|
+
}, t = t || {}, t.clobber = "clobber" in t ? !!t.clobber : !0, t.overwrite = "overwrite" in t ? !!t.overwrite : t.clobber, t.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
|
|
746
770
|
`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
747
771
|
|
|
748
772
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,
|
|
749
773
|
"Warning",
|
|
750
774
|
"fs-extra-WARN0001"
|
|
751
|
-
),
|
|
775
|
+
), ce.checkPaths(e, n, "copy", t, (i, o) => {
|
|
752
776
|
if (i)
|
|
753
777
|
return r(i);
|
|
754
778
|
const { srcStat: c, destStat: a } = o;
|
|
755
|
-
|
|
779
|
+
ce.checkParentPaths(e, c, n, "copy", (f) => f ? r(f) : t.filter ? kn(Ve, a, e, n, t, r) : Ve(a, e, n, t, r));
|
|
756
780
|
});
|
|
757
781
|
}
|
|
758
|
-
function
|
|
759
|
-
const o =
|
|
760
|
-
|
|
782
|
+
function Ve(e, n, t, r, i) {
|
|
783
|
+
const o = oe.dirname(t);
|
|
784
|
+
jt(o, (c, a) => {
|
|
761
785
|
if (c)
|
|
762
786
|
return i(c);
|
|
763
787
|
if (a)
|
|
764
|
-
return
|
|
765
|
-
|
|
788
|
+
return Ee(e, n, t, r, i);
|
|
789
|
+
xt(o, (f) => f ? i(f) : Ee(e, n, t, r, i));
|
|
766
790
|
});
|
|
767
791
|
}
|
|
768
|
-
function
|
|
769
|
-
Promise.resolve(i.filter(
|
|
792
|
+
function kn(e, n, t, r, i, o) {
|
|
793
|
+
Promise.resolve(i.filter(t, r)).then((c) => c ? e(n, t, r, i, o) : o(), (c) => o(c));
|
|
770
794
|
}
|
|
771
|
-
function
|
|
772
|
-
return r.filter ?
|
|
795
|
+
function Rt(e, n, t, r, i) {
|
|
796
|
+
return r.filter ? kn(Ee, e, n, t, r, i) : Ee(e, n, t, r, i);
|
|
773
797
|
}
|
|
774
|
-
function
|
|
775
|
-
(r.dereference ?
|
|
798
|
+
function Ee(e, n, t, r, i) {
|
|
799
|
+
(r.dereference ? A.stat : A.lstat)(n, (c, a) => c ? i(c) : a.isDirectory() ? Yt(a, e, n, t, r, i) : a.isFile() || a.isCharacterDevice() || a.isBlockDevice() ? Mt(a, e, n, t, r, i) : a.isSymbolicLink() ? Kt(e, n, t, r, i) : a.isSocket() ? i(new Error(`Cannot copy a socket file: ${n}`)) : a.isFIFO() ? i(new Error(`Cannot copy a FIFO pipe: ${n}`)) : i(new Error(`Unknown file: ${n}`)));
|
|
776
800
|
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
801
|
+
function Mt(e, n, t, r, i, o) {
|
|
802
|
+
return n ? Wt(e, t, r, i, o) : gn(e, t, r, i, o);
|
|
779
803
|
}
|
|
780
|
-
function
|
|
804
|
+
function Wt(e, n, t, r, i) {
|
|
781
805
|
if (r.overwrite)
|
|
782
|
-
|
|
806
|
+
A.unlink(t, (o) => o ? i(o) : gn(e, n, t, r, i));
|
|
783
807
|
else
|
|
784
|
-
return r.errorOnExist ? i(new Error(`'${
|
|
808
|
+
return r.errorOnExist ? i(new Error(`'${t}' already exists`)) : i();
|
|
785
809
|
}
|
|
786
|
-
function
|
|
787
|
-
|
|
810
|
+
function gn(e, n, t, r, i) {
|
|
811
|
+
A.copyFile(n, t, (o) => o ? i(o) : r.preserveTimestamps ? At(e.mode, n, t, i) : ke(t, e.mode, i));
|
|
788
812
|
}
|
|
789
|
-
function
|
|
790
|
-
return
|
|
813
|
+
function At(e, n, t, r) {
|
|
814
|
+
return Jt(e) ? Bt(t, e, (i) => i ? r(i) : Qe(e, n, t, r)) : Qe(e, n, t, r);
|
|
791
815
|
}
|
|
792
|
-
function
|
|
816
|
+
function Jt(e) {
|
|
793
817
|
return (e & 128) === 0;
|
|
794
818
|
}
|
|
795
|
-
function
|
|
796
|
-
return
|
|
819
|
+
function Bt(e, n, t) {
|
|
820
|
+
return ke(e, n | 128, t);
|
|
797
821
|
}
|
|
798
|
-
function
|
|
799
|
-
|
|
822
|
+
function Qe(e, n, t, r) {
|
|
823
|
+
qt(n, t, (i) => i ? r(i) : ke(t, e, r));
|
|
800
824
|
}
|
|
801
|
-
function
|
|
802
|
-
return
|
|
825
|
+
function ke(e, n, t) {
|
|
826
|
+
return A.chmod(e, n, t);
|
|
803
827
|
}
|
|
804
|
-
function
|
|
805
|
-
|
|
828
|
+
function qt(e, n, t) {
|
|
829
|
+
A.stat(e, (r, i) => r ? t(r) : It(n, i.atime, i.mtime, t));
|
|
806
830
|
}
|
|
807
|
-
function
|
|
808
|
-
return
|
|
831
|
+
function Yt(e, n, t, r, i, o) {
|
|
832
|
+
return n ? Fn(t, r, i, o) : Ut(e.mode, t, r, i, o);
|
|
809
833
|
}
|
|
810
|
-
function
|
|
811
|
-
|
|
834
|
+
function Ut(e, n, t, r, i) {
|
|
835
|
+
A.mkdir(t, (o) => {
|
|
812
836
|
if (o)
|
|
813
837
|
return i(o);
|
|
814
|
-
|
|
838
|
+
Fn(n, t, r, (c) => c ? i(c) : ke(t, e, i));
|
|
815
839
|
});
|
|
816
840
|
}
|
|
817
|
-
function
|
|
818
|
-
|
|
841
|
+
function Fn(e, n, t, r) {
|
|
842
|
+
A.readdir(e, (i, o) => i ? r(i) : Pn(o, e, n, t, r));
|
|
819
843
|
}
|
|
820
|
-
function
|
|
844
|
+
function Pn(e, n, t, r, i) {
|
|
821
845
|
const o = e.pop();
|
|
822
|
-
return o ?
|
|
823
|
-
}
|
|
824
|
-
function
|
|
825
|
-
const c =
|
|
826
|
-
|
|
827
|
-
if (
|
|
828
|
-
return o(
|
|
829
|
-
const { destStat:
|
|
830
|
-
|
|
846
|
+
return o ? Gt(e, o, n, t, r, i) : i();
|
|
847
|
+
}
|
|
848
|
+
function Gt(e, n, t, r, i, o) {
|
|
849
|
+
const c = oe.join(t, n), a = oe.join(r, n);
|
|
850
|
+
ce.checkPaths(c, a, "copy", i, (f, h) => {
|
|
851
|
+
if (f)
|
|
852
|
+
return o(f);
|
|
853
|
+
const { destStat: u } = h;
|
|
854
|
+
Rt(u, c, a, i, (s) => s ? o(s) : Pn(e, t, r, i, o));
|
|
831
855
|
});
|
|
832
856
|
}
|
|
833
|
-
function
|
|
834
|
-
|
|
857
|
+
function Kt(e, n, t, r, i) {
|
|
858
|
+
A.readlink(n, (o, c) => {
|
|
835
859
|
if (o)
|
|
836
860
|
return i(o);
|
|
837
|
-
if (r.dereference && (c =
|
|
838
|
-
|
|
861
|
+
if (r.dereference && (c = oe.resolve(process.cwd(), c)), e)
|
|
862
|
+
A.readlink(t, (a, f) => a ? a.code === "EINVAL" || a.code === "UNKNOWN" ? A.symlink(c, t, i) : i(a) : (r.dereference && (f = oe.resolve(process.cwd(), f)), ce.isSrcSubdir(c, f) ? i(new Error(`Cannot copy '${c}' to a subdirectory of itself, '${f}'.`)) : e.isDirectory() && ce.isSrcSubdir(f, c) ? i(new Error(`Cannot overwrite '${f}' with '${c}'.`)) : Vt(c, t, i)));
|
|
839
863
|
else
|
|
840
|
-
return
|
|
864
|
+
return A.symlink(c, t, i);
|
|
841
865
|
});
|
|
842
866
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
867
|
+
function Vt(e, n, t) {
|
|
868
|
+
A.unlink(n, (r) => r ? t(r) : A.symlink(e, n, t));
|
|
845
869
|
}
|
|
846
|
-
var
|
|
847
|
-
const
|
|
848
|
-
function
|
|
849
|
-
typeof
|
|
870
|
+
var Qt = Lt;
|
|
871
|
+
const j = W, ue = L, Xt = q.mkdirsSync, zt = En.utimesMillisSync, ae = ne;
|
|
872
|
+
function Ht(e, n, t) {
|
|
873
|
+
typeof t == "function" && (t = { filter: t }), t = t || {}, t.clobber = "clobber" in t ? !!t.clobber : !0, t.overwrite = "overwrite" in t ? !!t.overwrite : t.clobber, t.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
|
|
850
874
|
`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
851
875
|
|
|
852
876
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,
|
|
853
877
|
"Warning",
|
|
854
878
|
"fs-extra-WARN0002"
|
|
855
879
|
);
|
|
856
|
-
const { srcStat: r, destStat: i } =
|
|
857
|
-
return
|
|
880
|
+
const { srcStat: r, destStat: i } = ae.checkPathsSync(e, n, "copy", t);
|
|
881
|
+
return ae.checkParentPathsSync(e, r, n, "copy"), bt(i, e, n, t);
|
|
858
882
|
}
|
|
859
|
-
function
|
|
860
|
-
if (r.filter && !r.filter(
|
|
883
|
+
function bt(e, n, t, r) {
|
|
884
|
+
if (r.filter && !r.filter(n, t))
|
|
861
885
|
return;
|
|
862
|
-
const i =
|
|
863
|
-
return
|
|
886
|
+
const i = ue.dirname(t);
|
|
887
|
+
return j.existsSync(i) || Xt(i), On(e, n, t, r);
|
|
864
888
|
}
|
|
865
|
-
function
|
|
866
|
-
if (!(r.filter && !r.filter(
|
|
867
|
-
return
|
|
889
|
+
function Zt(e, n, t, r) {
|
|
890
|
+
if (!(r.filter && !r.filter(n, t)))
|
|
891
|
+
return On(e, n, t, r);
|
|
868
892
|
}
|
|
869
|
-
function
|
|
870
|
-
const o = (r.dereference ?
|
|
893
|
+
function On(e, n, t, r) {
|
|
894
|
+
const o = (r.dereference ? j.statSync : j.lstatSync)(n);
|
|
871
895
|
if (o.isDirectory())
|
|
872
|
-
return
|
|
896
|
+
return cr(o, e, n, t, r);
|
|
873
897
|
if (o.isFile() || o.isCharacterDevice() || o.isBlockDevice())
|
|
874
|
-
return
|
|
898
|
+
return er(o, e, n, t, r);
|
|
875
899
|
if (o.isSymbolicLink())
|
|
876
|
-
return
|
|
877
|
-
throw o.isSocket() ? new Error(`Cannot copy a socket file: ${
|
|
900
|
+
return fr(e, n, t, r);
|
|
901
|
+
throw o.isSocket() ? new Error(`Cannot copy a socket file: ${n}`) : o.isFIFO() ? new Error(`Cannot copy a FIFO pipe: ${n}`) : new Error(`Unknown file: ${n}`);
|
|
878
902
|
}
|
|
879
|
-
function
|
|
880
|
-
return
|
|
903
|
+
function er(e, n, t, r, i) {
|
|
904
|
+
return n ? nr(e, t, r, i) : Dn(e, t, r, i);
|
|
881
905
|
}
|
|
882
|
-
function
|
|
906
|
+
function nr(e, n, t, r) {
|
|
883
907
|
if (r.overwrite)
|
|
884
|
-
return
|
|
908
|
+
return j.unlinkSync(t), Dn(e, n, t, r);
|
|
885
909
|
if (r.errorOnExist)
|
|
886
|
-
throw new Error(`'${
|
|
910
|
+
throw new Error(`'${t}' already exists`);
|
|
887
911
|
}
|
|
888
|
-
function
|
|
889
|
-
return
|
|
912
|
+
function Dn(e, n, t, r) {
|
|
913
|
+
return j.copyFileSync(n, t), r.preserveTimestamps && tr(e.mode, n, t), Me(t, e.mode);
|
|
890
914
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
915
|
+
function tr(e, n, t) {
|
|
916
|
+
return rr(e) && ir(t, e), or(n, t);
|
|
893
917
|
}
|
|
894
|
-
function
|
|
918
|
+
function rr(e) {
|
|
895
919
|
return (e & 128) === 0;
|
|
896
920
|
}
|
|
897
|
-
function
|
|
898
|
-
return
|
|
921
|
+
function ir(e, n) {
|
|
922
|
+
return Me(e, n | 128);
|
|
899
923
|
}
|
|
900
|
-
function
|
|
901
|
-
return
|
|
924
|
+
function Me(e, n) {
|
|
925
|
+
return j.chmodSync(e, n);
|
|
902
926
|
}
|
|
903
|
-
function
|
|
904
|
-
const
|
|
905
|
-
return
|
|
927
|
+
function or(e, n) {
|
|
928
|
+
const t = j.statSync(e);
|
|
929
|
+
return zt(n, t.atime, t.mtime);
|
|
906
930
|
}
|
|
907
|
-
function
|
|
908
|
-
return
|
|
931
|
+
function cr(e, n, t, r, i) {
|
|
932
|
+
return n ? Nn(t, r, i) : ur(e.mode, t, r, i);
|
|
909
933
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
934
|
+
function ur(e, n, t, r) {
|
|
935
|
+
return j.mkdirSync(t), Nn(n, t, r), Me(t, e);
|
|
912
936
|
}
|
|
913
|
-
function
|
|
914
|
-
|
|
937
|
+
function Nn(e, n, t) {
|
|
938
|
+
j.readdirSync(e).forEach((r) => ar(r, e, n, t));
|
|
915
939
|
}
|
|
916
|
-
function
|
|
917
|
-
const i =
|
|
918
|
-
return
|
|
940
|
+
function ar(e, n, t, r) {
|
|
941
|
+
const i = ue.join(n, e), o = ue.join(t, e), { destStat: c } = ae.checkPathsSync(i, o, "copy", r);
|
|
942
|
+
return Zt(c, i, o, r);
|
|
919
943
|
}
|
|
920
|
-
function
|
|
921
|
-
let i =
|
|
922
|
-
if (r.dereference && (i =
|
|
944
|
+
function fr(e, n, t, r) {
|
|
945
|
+
let i = j.readlinkSync(n);
|
|
946
|
+
if (r.dereference && (i = ue.resolve(process.cwd(), i)), e) {
|
|
923
947
|
let o;
|
|
924
948
|
try {
|
|
925
|
-
o =
|
|
949
|
+
o = j.readlinkSync(t);
|
|
926
950
|
} catch (c) {
|
|
927
951
|
if (c.code === "EINVAL" || c.code === "UNKNOWN")
|
|
928
|
-
return
|
|
952
|
+
return j.symlinkSync(i, t);
|
|
929
953
|
throw c;
|
|
930
954
|
}
|
|
931
|
-
if (r.dereference && (o =
|
|
955
|
+
if (r.dereference && (o = ue.resolve(process.cwd(), o)), ae.isSrcSubdir(i, o))
|
|
932
956
|
throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);
|
|
933
|
-
if (
|
|
957
|
+
if (j.statSync(t).isDirectory() && ae.isSrcSubdir(o, i))
|
|
934
958
|
throw new Error(`Cannot overwrite '${o}' with '${i}'.`);
|
|
935
|
-
return
|
|
959
|
+
return sr(i, t);
|
|
936
960
|
} else
|
|
937
|
-
return
|
|
961
|
+
return j.symlinkSync(i, t);
|
|
938
962
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
963
|
+
function sr(e, n) {
|
|
964
|
+
return j.unlinkSync(n), j.symlinkSync(e, n);
|
|
941
965
|
}
|
|
942
|
-
var
|
|
943
|
-
const
|
|
944
|
-
var
|
|
945
|
-
copy:
|
|
946
|
-
copySync:
|
|
966
|
+
var lr = Ht;
|
|
967
|
+
const yr = M.fromCallback;
|
|
968
|
+
var We = {
|
|
969
|
+
copy: yr(Qt),
|
|
970
|
+
copySync: lr
|
|
947
971
|
};
|
|
948
|
-
const
|
|
949
|
-
function
|
|
972
|
+
const Xe = W, Tn = L, E = ee, fe = process.platform === "win32";
|
|
973
|
+
function _n(e) {
|
|
950
974
|
[
|
|
951
975
|
"unlink",
|
|
952
976
|
"chmod",
|
|
@@ -954,937 +978,449 @@ function zt(e) {
|
|
|
954
978
|
"lstat",
|
|
955
979
|
"rmdir",
|
|
956
980
|
"readdir"
|
|
957
|
-
].forEach((
|
|
958
|
-
e[
|
|
981
|
+
].forEach((t) => {
|
|
982
|
+
e[t] = e[t] || Xe[t], t = t + "Sync", e[t] = e[t] || Xe[t];
|
|
959
983
|
}), e.maxBusyTries = e.maxBusyTries || 3;
|
|
960
984
|
}
|
|
961
|
-
function
|
|
985
|
+
function Ae(e, n, t) {
|
|
962
986
|
let r = 0;
|
|
963
|
-
typeof
|
|
987
|
+
typeof n == "function" && (t = n, n = {}), E(e, "rimraf: missing path"), E.strictEqual(typeof e, "string", "rimraf: path should be a string"), E.strictEqual(typeof t, "function", "rimraf: callback function required"), E(n, "rimraf: invalid options argument provided"), E.strictEqual(typeof n, "object", "rimraf: options should be object"), _n(n), ze(e, n, function i(o) {
|
|
964
988
|
if (o) {
|
|
965
|
-
if ((o.code === "EBUSY" || o.code === "ENOTEMPTY" || o.code === "EPERM") && r <
|
|
989
|
+
if ((o.code === "EBUSY" || o.code === "ENOTEMPTY" || o.code === "EPERM") && r < n.maxBusyTries) {
|
|
966
990
|
r++;
|
|
967
991
|
const c = r * 100;
|
|
968
|
-
return setTimeout(() =>
|
|
992
|
+
return setTimeout(() => ze(e, n, i), c);
|
|
969
993
|
}
|
|
970
994
|
o.code === "ENOENT" && (o = null);
|
|
971
995
|
}
|
|
972
|
-
|
|
996
|
+
t(o);
|
|
973
997
|
});
|
|
974
998
|
}
|
|
975
|
-
function
|
|
976
|
-
|
|
999
|
+
function ze(e, n, t) {
|
|
1000
|
+
E(e), E(n), E(typeof t == "function"), n.lstat(e, (r, i) => {
|
|
977
1001
|
if (r && r.code === "ENOENT")
|
|
978
|
-
return
|
|
979
|
-
if (r && r.code === "EPERM" &&
|
|
980
|
-
return
|
|
1002
|
+
return t(null);
|
|
1003
|
+
if (r && r.code === "EPERM" && fe)
|
|
1004
|
+
return He(e, n, r, t);
|
|
981
1005
|
if (i && i.isDirectory())
|
|
982
|
-
return
|
|
983
|
-
|
|
1006
|
+
return Se(e, n, r, t);
|
|
1007
|
+
n.unlink(e, (o) => {
|
|
984
1008
|
if (o) {
|
|
985
1009
|
if (o.code === "ENOENT")
|
|
986
|
-
return
|
|
1010
|
+
return t(null);
|
|
987
1011
|
if (o.code === "EPERM")
|
|
988
|
-
return
|
|
1012
|
+
return fe ? He(e, n, o, t) : Se(e, n, o, t);
|
|
989
1013
|
if (o.code === "EISDIR")
|
|
990
|
-
return
|
|
1014
|
+
return Se(e, n, o, t);
|
|
991
1015
|
}
|
|
992
|
-
return
|
|
1016
|
+
return t(o);
|
|
993
1017
|
});
|
|
994
1018
|
});
|
|
995
1019
|
}
|
|
996
|
-
function
|
|
997
|
-
|
|
998
|
-
i ? r(i.code === "ENOENT" ? null :
|
|
999
|
-
o ? r(o.code === "ENOENT" ? null :
|
|
1020
|
+
function He(e, n, t, r) {
|
|
1021
|
+
E(e), E(n), E(typeof r == "function"), n.chmod(e, 438, (i) => {
|
|
1022
|
+
i ? r(i.code === "ENOENT" ? null : t) : n.stat(e, (o, c) => {
|
|
1023
|
+
o ? r(o.code === "ENOENT" ? null : t) : c.isDirectory() ? Se(e, n, t, r) : n.unlink(e, r);
|
|
1000
1024
|
});
|
|
1001
1025
|
});
|
|
1002
1026
|
}
|
|
1003
|
-
function
|
|
1027
|
+
function be(e, n, t) {
|
|
1004
1028
|
let r;
|
|
1005
|
-
|
|
1029
|
+
E(e), E(n);
|
|
1006
1030
|
try {
|
|
1007
|
-
|
|
1031
|
+
n.chmodSync(e, 438);
|
|
1008
1032
|
} catch (i) {
|
|
1009
1033
|
if (i.code === "ENOENT")
|
|
1010
1034
|
return;
|
|
1011
|
-
throw
|
|
1035
|
+
throw t;
|
|
1012
1036
|
}
|
|
1013
1037
|
try {
|
|
1014
|
-
r =
|
|
1038
|
+
r = n.statSync(e);
|
|
1015
1039
|
} catch (i) {
|
|
1016
1040
|
if (i.code === "ENOENT")
|
|
1017
1041
|
return;
|
|
1018
|
-
throw
|
|
1042
|
+
throw t;
|
|
1019
1043
|
}
|
|
1020
|
-
r.isDirectory() ?
|
|
1044
|
+
r.isDirectory() ? we(e, n, t) : n.unlinkSync(e);
|
|
1021
1045
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
-
i && (i.code === "ENOTEMPTY" || i.code === "EEXIST" || i.code === "EPERM") ?
|
|
1046
|
+
function Se(e, n, t, r) {
|
|
1047
|
+
E(e), E(n), E(typeof r == "function"), n.rmdir(e, (i) => {
|
|
1048
|
+
i && (i.code === "ENOTEMPTY" || i.code === "EEXIST" || i.code === "EPERM") ? mr(e, n, r) : i && i.code === "ENOTDIR" ? r(t) : r(i);
|
|
1025
1049
|
});
|
|
1026
1050
|
}
|
|
1027
|
-
function
|
|
1028
|
-
|
|
1051
|
+
function mr(e, n, t) {
|
|
1052
|
+
E(e), E(n), E(typeof t == "function"), n.readdir(e, (r, i) => {
|
|
1029
1053
|
if (r)
|
|
1030
|
-
return
|
|
1054
|
+
return t(r);
|
|
1031
1055
|
let o = i.length, c;
|
|
1032
1056
|
if (o === 0)
|
|
1033
|
-
return
|
|
1057
|
+
return n.rmdir(e, t);
|
|
1034
1058
|
i.forEach((a) => {
|
|
1035
|
-
|
|
1059
|
+
Ae(Tn.join(e, a), n, (f) => {
|
|
1036
1060
|
if (!c) {
|
|
1037
|
-
if (
|
|
1038
|
-
return
|
|
1039
|
-
--o === 0 &&
|
|
1061
|
+
if (f)
|
|
1062
|
+
return t(c = f);
|
|
1063
|
+
--o === 0 && n.rmdir(e, t);
|
|
1040
1064
|
}
|
|
1041
1065
|
});
|
|
1042
1066
|
});
|
|
1043
1067
|
});
|
|
1044
1068
|
}
|
|
1045
|
-
function
|
|
1046
|
-
let
|
|
1047
|
-
|
|
1069
|
+
function Cn(e, n) {
|
|
1070
|
+
let t;
|
|
1071
|
+
n = n || {}, _n(n), E(e, "rimraf: missing path"), E.strictEqual(typeof e, "string", "rimraf: path should be a string"), E(n, "rimraf: missing options"), E.strictEqual(typeof n, "object", "rimraf: options should be object");
|
|
1048
1072
|
try {
|
|
1049
|
-
|
|
1073
|
+
t = n.lstatSync(e);
|
|
1050
1074
|
} catch (r) {
|
|
1051
1075
|
if (r.code === "ENOENT")
|
|
1052
1076
|
return;
|
|
1053
|
-
r.code === "EPERM" &&
|
|
1077
|
+
r.code === "EPERM" && fe && be(e, n, r);
|
|
1054
1078
|
}
|
|
1055
1079
|
try {
|
|
1056
|
-
|
|
1080
|
+
t && t.isDirectory() ? we(e, n, null) : n.unlinkSync(e);
|
|
1057
1081
|
} catch (r) {
|
|
1058
1082
|
if (r.code === "ENOENT")
|
|
1059
1083
|
return;
|
|
1060
1084
|
if (r.code === "EPERM")
|
|
1061
|
-
return
|
|
1085
|
+
return fe ? be(e, n, r) : we(e, n, r);
|
|
1062
1086
|
if (r.code !== "EISDIR")
|
|
1063
1087
|
throw r;
|
|
1064
|
-
|
|
1088
|
+
we(e, n, r);
|
|
1065
1089
|
}
|
|
1066
1090
|
}
|
|
1067
|
-
function
|
|
1068
|
-
|
|
1091
|
+
function we(e, n, t) {
|
|
1092
|
+
E(e), E(n);
|
|
1069
1093
|
try {
|
|
1070
|
-
|
|
1094
|
+
n.rmdirSync(e);
|
|
1071
1095
|
} catch (r) {
|
|
1072
1096
|
if (r.code === "ENOTDIR")
|
|
1073
|
-
throw
|
|
1097
|
+
throw t;
|
|
1074
1098
|
if (r.code === "ENOTEMPTY" || r.code === "EEXIST" || r.code === "EPERM")
|
|
1075
|
-
|
|
1099
|
+
dr(e, n);
|
|
1076
1100
|
else if (r.code !== "ENOENT")
|
|
1077
1101
|
throw r;
|
|
1078
1102
|
}
|
|
1079
1103
|
}
|
|
1080
|
-
function
|
|
1081
|
-
if (
|
|
1082
|
-
const
|
|
1104
|
+
function dr(e, n) {
|
|
1105
|
+
if (E(e), E(n), n.readdirSync(e).forEach((t) => Cn(Tn.join(e, t), n)), fe) {
|
|
1106
|
+
const t = Date.now();
|
|
1083
1107
|
do
|
|
1084
1108
|
try {
|
|
1085
|
-
return
|
|
1109
|
+
return n.rmdirSync(e, n);
|
|
1086
1110
|
} catch {
|
|
1087
1111
|
}
|
|
1088
|
-
while (Date.now() -
|
|
1112
|
+
while (Date.now() - t < 500);
|
|
1089
1113
|
} else
|
|
1090
|
-
return
|
|
1091
|
-
}
|
|
1092
|
-
var
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
function
|
|
1096
|
-
if (
|
|
1097
|
-
return
|
|
1098
|
-
|
|
1099
|
-
}
|
|
1100
|
-
function
|
|
1101
|
-
if (
|
|
1102
|
-
return
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
var
|
|
1106
|
-
remove:
|
|
1107
|
-
removeSync:
|
|
1114
|
+
return n.rmdirSync(e, n);
|
|
1115
|
+
}
|
|
1116
|
+
var hr = Ae;
|
|
1117
|
+
Ae.sync = Cn;
|
|
1118
|
+
const pe = W, Sr = M.fromCallback, xn = hr;
|
|
1119
|
+
function wr(e, n) {
|
|
1120
|
+
if (pe.rm)
|
|
1121
|
+
return pe.rm(e, { recursive: !0, force: !0 }, n);
|
|
1122
|
+
xn(e, n);
|
|
1123
|
+
}
|
|
1124
|
+
function vr(e) {
|
|
1125
|
+
if (pe.rmSync)
|
|
1126
|
+
return pe.rmSync(e, { recursive: !0, force: !0 });
|
|
1127
|
+
xn.sync(e);
|
|
1128
|
+
}
|
|
1129
|
+
var ge = {
|
|
1130
|
+
remove: Sr(wr),
|
|
1131
|
+
removeSync: vr
|
|
1108
1132
|
};
|
|
1109
|
-
const
|
|
1110
|
-
let
|
|
1133
|
+
const Er = M.fromPromise, jn = Q, In = L, Ln = q, Rn = ge, Ze = Er(async function(n) {
|
|
1134
|
+
let t;
|
|
1111
1135
|
try {
|
|
1112
|
-
|
|
1136
|
+
t = await jn.readdir(n);
|
|
1113
1137
|
} catch {
|
|
1114
|
-
return
|
|
1138
|
+
return Ln.mkdirs(n);
|
|
1115
1139
|
}
|
|
1116
|
-
return Promise.all(
|
|
1140
|
+
return Promise.all(t.map((r) => Rn.remove(In.join(n, r))));
|
|
1117
1141
|
});
|
|
1118
|
-
function
|
|
1119
|
-
let
|
|
1142
|
+
function en(e) {
|
|
1143
|
+
let n;
|
|
1120
1144
|
try {
|
|
1121
|
-
|
|
1145
|
+
n = jn.readdirSync(e);
|
|
1122
1146
|
} catch {
|
|
1123
|
-
return
|
|
1147
|
+
return Ln.mkdirsSync(e);
|
|
1124
1148
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1149
|
+
n.forEach((t) => {
|
|
1150
|
+
t = In.join(e, t), Rn.removeSync(t);
|
|
1127
1151
|
});
|
|
1128
1152
|
}
|
|
1129
|
-
var
|
|
1130
|
-
emptyDirSync:
|
|
1131
|
-
emptydirSync:
|
|
1132
|
-
emptyDir:
|
|
1133
|
-
emptydir:
|
|
1153
|
+
var pr = {
|
|
1154
|
+
emptyDirSync: en,
|
|
1155
|
+
emptydirSync: en,
|
|
1156
|
+
emptyDir: Ze,
|
|
1157
|
+
emptydir: Ze
|
|
1134
1158
|
};
|
|
1135
|
-
const
|
|
1136
|
-
function
|
|
1137
|
-
function
|
|
1138
|
-
|
|
1159
|
+
const $r = M.fromCallback, Mn = L, G = W, Wn = q;
|
|
1160
|
+
function kr(e, n) {
|
|
1161
|
+
function t() {
|
|
1162
|
+
G.writeFile(e, "", (r) => {
|
|
1139
1163
|
if (r)
|
|
1140
|
-
return
|
|
1141
|
-
|
|
1164
|
+
return n(r);
|
|
1165
|
+
n();
|
|
1142
1166
|
});
|
|
1143
1167
|
}
|
|
1144
|
-
|
|
1168
|
+
G.stat(e, (r, i) => {
|
|
1145
1169
|
if (!r && i.isFile())
|
|
1146
|
-
return
|
|
1147
|
-
const o =
|
|
1148
|
-
|
|
1170
|
+
return n();
|
|
1171
|
+
const o = Mn.dirname(e);
|
|
1172
|
+
G.stat(o, (c, a) => {
|
|
1149
1173
|
if (c)
|
|
1150
|
-
return c.code === "ENOENT" ?
|
|
1151
|
-
if (
|
|
1152
|
-
return
|
|
1153
|
-
|
|
1154
|
-
}) :
|
|
1155
|
-
a.isDirectory() ?
|
|
1156
|
-
if (
|
|
1157
|
-
return
|
|
1174
|
+
return c.code === "ENOENT" ? Wn.mkdirs(o, (f) => {
|
|
1175
|
+
if (f)
|
|
1176
|
+
return n(f);
|
|
1177
|
+
t();
|
|
1178
|
+
}) : n(c);
|
|
1179
|
+
a.isDirectory() ? t() : G.readdir(o, (f) => {
|
|
1180
|
+
if (f)
|
|
1181
|
+
return n(f);
|
|
1158
1182
|
});
|
|
1159
1183
|
});
|
|
1160
1184
|
});
|
|
1161
1185
|
}
|
|
1162
|
-
function
|
|
1163
|
-
let
|
|
1186
|
+
function gr(e) {
|
|
1187
|
+
let n;
|
|
1164
1188
|
try {
|
|
1165
|
-
|
|
1189
|
+
n = G.statSync(e);
|
|
1166
1190
|
} catch {
|
|
1167
1191
|
}
|
|
1168
|
-
if (
|
|
1192
|
+
if (n && n.isFile())
|
|
1169
1193
|
return;
|
|
1170
|
-
const
|
|
1194
|
+
const t = Mn.dirname(e);
|
|
1171
1195
|
try {
|
|
1172
|
-
|
|
1196
|
+
G.statSync(t).isDirectory() || G.readdirSync(t);
|
|
1173
1197
|
} catch (r) {
|
|
1174
1198
|
if (r && r.code === "ENOENT")
|
|
1175
|
-
|
|
1199
|
+
Wn.mkdirsSync(t);
|
|
1176
1200
|
else
|
|
1177
1201
|
throw r;
|
|
1178
1202
|
}
|
|
1179
|
-
|
|
1203
|
+
G.writeFileSync(e, "");
|
|
1180
1204
|
}
|
|
1181
|
-
var
|
|
1182
|
-
createFile:
|
|
1183
|
-
createFileSync:
|
|
1205
|
+
var Fr = {
|
|
1206
|
+
createFile: $r(kr),
|
|
1207
|
+
createFileSync: gr
|
|
1184
1208
|
};
|
|
1185
|
-
const
|
|
1186
|
-
function
|
|
1209
|
+
const Pr = M.fromCallback, An = L, U = W, Jn = q, Or = X.pathExists, { areIdentical: Bn } = ne;
|
|
1210
|
+
function Dr(e, n, t) {
|
|
1187
1211
|
function r(i, o) {
|
|
1188
|
-
|
|
1212
|
+
U.link(i, o, (c) => {
|
|
1189
1213
|
if (c)
|
|
1190
|
-
return
|
|
1191
|
-
|
|
1214
|
+
return t(c);
|
|
1215
|
+
t(null);
|
|
1192
1216
|
});
|
|
1193
1217
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1218
|
+
U.lstat(n, (i, o) => {
|
|
1219
|
+
U.lstat(e, (c, a) => {
|
|
1196
1220
|
if (c)
|
|
1197
|
-
return c.message = c.message.replace("lstat", "ensureLink"),
|
|
1198
|
-
if (o &&
|
|
1199
|
-
return
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1202
|
-
if (
|
|
1203
|
-
return
|
|
1204
|
-
if (
|
|
1205
|
-
return r(e,
|
|
1206
|
-
|
|
1207
|
-
if (
|
|
1208
|
-
return
|
|
1209
|
-
r(e,
|
|
1221
|
+
return c.message = c.message.replace("lstat", "ensureLink"), t(c);
|
|
1222
|
+
if (o && Bn(a, o))
|
|
1223
|
+
return t(null);
|
|
1224
|
+
const f = An.dirname(n);
|
|
1225
|
+
Or(f, (h, u) => {
|
|
1226
|
+
if (h)
|
|
1227
|
+
return t(h);
|
|
1228
|
+
if (u)
|
|
1229
|
+
return r(e, n);
|
|
1230
|
+
Jn.mkdirs(f, (s) => {
|
|
1231
|
+
if (s)
|
|
1232
|
+
return t(s);
|
|
1233
|
+
r(e, n);
|
|
1210
1234
|
});
|
|
1211
1235
|
});
|
|
1212
1236
|
});
|
|
1213
1237
|
});
|
|
1214
1238
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let
|
|
1239
|
+
function Nr(e, n) {
|
|
1240
|
+
let t;
|
|
1217
1241
|
try {
|
|
1218
|
-
|
|
1242
|
+
t = U.lstatSync(n);
|
|
1219
1243
|
} catch {
|
|
1220
1244
|
}
|
|
1221
1245
|
try {
|
|
1222
|
-
const o =
|
|
1223
|
-
if (
|
|
1246
|
+
const o = U.lstatSync(e);
|
|
1247
|
+
if (t && Bn(o, t))
|
|
1224
1248
|
return;
|
|
1225
1249
|
} catch (o) {
|
|
1226
1250
|
throw o.message = o.message.replace("lstat", "ensureLink"), o;
|
|
1227
1251
|
}
|
|
1228
|
-
const r =
|
|
1229
|
-
return
|
|
1252
|
+
const r = An.dirname(n);
|
|
1253
|
+
return U.existsSync(r) || Jn.mkdirsSync(r), U.linkSync(e, n);
|
|
1230
1254
|
}
|
|
1231
|
-
var
|
|
1232
|
-
createLink:
|
|
1233
|
-
createLinkSync:
|
|
1255
|
+
var Tr = {
|
|
1256
|
+
createLink: Pr(Dr),
|
|
1257
|
+
createLinkSync: Nr
|
|
1234
1258
|
};
|
|
1235
|
-
const
|
|
1236
|
-
function
|
|
1237
|
-
if (
|
|
1238
|
-
return
|
|
1259
|
+
const K = L, re = W, _r = X.pathExists;
|
|
1260
|
+
function Cr(e, n, t) {
|
|
1261
|
+
if (K.isAbsolute(e))
|
|
1262
|
+
return re.lstat(e, (r) => r ? (r.message = r.message.replace("lstat", "ensureSymlink"), t(r)) : t(null, {
|
|
1239
1263
|
toCwd: e,
|
|
1240
1264
|
toDst: e
|
|
1241
1265
|
}));
|
|
1242
1266
|
{
|
|
1243
|
-
const r =
|
|
1244
|
-
return
|
|
1267
|
+
const r = K.dirname(n), i = K.join(r, e);
|
|
1268
|
+
return _r(i, (o, c) => o ? t(o) : c ? t(null, {
|
|
1245
1269
|
toCwd: i,
|
|
1246
1270
|
toDst: e
|
|
1247
|
-
}) :
|
|
1271
|
+
}) : re.lstat(e, (a) => a ? (a.message = a.message.replace("lstat", "ensureSymlink"), t(a)) : t(null, {
|
|
1248
1272
|
toCwd: e,
|
|
1249
|
-
toDst:
|
|
1273
|
+
toDst: K.relative(r, e)
|
|
1250
1274
|
})));
|
|
1251
1275
|
}
|
|
1252
1276
|
}
|
|
1253
|
-
function
|
|
1254
|
-
let
|
|
1255
|
-
if (
|
|
1256
|
-
if (
|
|
1277
|
+
function xr(e, n) {
|
|
1278
|
+
let t;
|
|
1279
|
+
if (K.isAbsolute(e)) {
|
|
1280
|
+
if (t = re.existsSync(e), !t)
|
|
1257
1281
|
throw new Error("absolute srcpath does not exist");
|
|
1258
1282
|
return {
|
|
1259
1283
|
toCwd: e,
|
|
1260
1284
|
toDst: e
|
|
1261
1285
|
};
|
|
1262
1286
|
} else {
|
|
1263
|
-
const r =
|
|
1264
|
-
if (
|
|
1287
|
+
const r = K.dirname(n), i = K.join(r, e);
|
|
1288
|
+
if (t = re.existsSync(i), t)
|
|
1265
1289
|
return {
|
|
1266
1290
|
toCwd: i,
|
|
1267
1291
|
toDst: e
|
|
1268
1292
|
};
|
|
1269
|
-
if (
|
|
1293
|
+
if (t = re.existsSync(e), !t)
|
|
1270
1294
|
throw new Error("relative srcpath does not exist");
|
|
1271
1295
|
return {
|
|
1272
1296
|
toCwd: e,
|
|
1273
|
-
toDst:
|
|
1297
|
+
toDst: K.relative(r, e)
|
|
1274
1298
|
};
|
|
1275
1299
|
}
|
|
1276
1300
|
}
|
|
1277
|
-
var
|
|
1278
|
-
symlinkPaths:
|
|
1279
|
-
symlinkPathsSync:
|
|
1301
|
+
var jr = {
|
|
1302
|
+
symlinkPaths: Cr,
|
|
1303
|
+
symlinkPathsSync: xr
|
|
1280
1304
|
};
|
|
1281
|
-
const
|
|
1282
|
-
function
|
|
1283
|
-
if (
|
|
1284
|
-
return
|
|
1285
|
-
|
|
1305
|
+
const qn = W;
|
|
1306
|
+
function Ir(e, n, t) {
|
|
1307
|
+
if (t = typeof n == "function" ? n : t, n = typeof n == "function" ? !1 : n, n)
|
|
1308
|
+
return t(null, n);
|
|
1309
|
+
qn.lstat(e, (r, i) => {
|
|
1286
1310
|
if (r)
|
|
1287
|
-
return
|
|
1288
|
-
|
|
1311
|
+
return t(null, "file");
|
|
1312
|
+
n = i && i.isDirectory() ? "dir" : "file", t(null, n);
|
|
1289
1313
|
});
|
|
1290
1314
|
}
|
|
1291
|
-
function
|
|
1292
|
-
let
|
|
1293
|
-
if (
|
|
1294
|
-
return
|
|
1315
|
+
function Lr(e, n) {
|
|
1316
|
+
let t;
|
|
1317
|
+
if (n)
|
|
1318
|
+
return n;
|
|
1295
1319
|
try {
|
|
1296
|
-
|
|
1320
|
+
t = qn.lstatSync(e);
|
|
1297
1321
|
} catch {
|
|
1298
1322
|
return "file";
|
|
1299
1323
|
}
|
|
1300
|
-
return
|
|
1324
|
+
return t && t.isDirectory() ? "dir" : "file";
|
|
1301
1325
|
}
|
|
1302
|
-
var
|
|
1303
|
-
symlinkType:
|
|
1304
|
-
symlinkTypeSync:
|
|
1326
|
+
var Rr = {
|
|
1327
|
+
symlinkType: Ir,
|
|
1328
|
+
symlinkTypeSync: Lr
|
|
1305
1329
|
};
|
|
1306
|
-
const
|
|
1307
|
-
function
|
|
1308
|
-
r = typeof
|
|
1330
|
+
const Mr = M.fromCallback, Yn = L, B = Q, Un = q, Wr = Un.mkdirs, Ar = Un.mkdirsSync, Gn = jr, Jr = Gn.symlinkPaths, Br = Gn.symlinkPathsSync, Kn = Rr, qr = Kn.symlinkType, Yr = Kn.symlinkTypeSync, Ur = X.pathExists, { areIdentical: Vn } = ne;
|
|
1331
|
+
function Gr(e, n, t, r) {
|
|
1332
|
+
r = typeof t == "function" ? t : r, t = typeof t == "function" ? !1 : t, B.lstat(n, (i, o) => {
|
|
1309
1333
|
!i && o.isSymbolicLink() ? Promise.all([
|
|
1310
|
-
|
|
1311
|
-
|
|
1334
|
+
B.stat(e),
|
|
1335
|
+
B.stat(n)
|
|
1312
1336
|
]).then(([c, a]) => {
|
|
1313
|
-
if (
|
|
1337
|
+
if (Vn(c, a))
|
|
1314
1338
|
return r(null);
|
|
1315
|
-
|
|
1316
|
-
}) :
|
|
1339
|
+
nn(e, n, t, r);
|
|
1340
|
+
}) : nn(e, n, t, r);
|
|
1317
1341
|
});
|
|
1318
1342
|
}
|
|
1319
|
-
function
|
|
1320
|
-
|
|
1343
|
+
function nn(e, n, t, r) {
|
|
1344
|
+
Jr(e, n, (i, o) => {
|
|
1321
1345
|
if (i)
|
|
1322
1346
|
return r(i);
|
|
1323
|
-
e = o.toDst,
|
|
1347
|
+
e = o.toDst, qr(o.toCwd, t, (c, a) => {
|
|
1324
1348
|
if (c)
|
|
1325
1349
|
return r(c);
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
if (
|
|
1329
|
-
return r(
|
|
1330
|
-
if (
|
|
1331
|
-
return
|
|
1332
|
-
|
|
1333
|
-
if (
|
|
1334
|
-
return r(
|
|
1335
|
-
|
|
1350
|
+
const f = Yn.dirname(n);
|
|
1351
|
+
Ur(f, (h, u) => {
|
|
1352
|
+
if (h)
|
|
1353
|
+
return r(h);
|
|
1354
|
+
if (u)
|
|
1355
|
+
return B.symlink(e, n, a, r);
|
|
1356
|
+
Wr(f, (s) => {
|
|
1357
|
+
if (s)
|
|
1358
|
+
return r(s);
|
|
1359
|
+
B.symlink(e, n, a, r);
|
|
1336
1360
|
});
|
|
1337
1361
|
});
|
|
1338
1362
|
});
|
|
1339
1363
|
});
|
|
1340
1364
|
}
|
|
1341
|
-
function
|
|
1365
|
+
function Kr(e, n, t) {
|
|
1342
1366
|
let r;
|
|
1343
1367
|
try {
|
|
1344
|
-
r =
|
|
1368
|
+
r = B.lstatSync(n);
|
|
1345
1369
|
} catch {
|
|
1346
1370
|
}
|
|
1347
1371
|
if (r && r.isSymbolicLink()) {
|
|
1348
|
-
const a =
|
|
1349
|
-
if (
|
|
1372
|
+
const a = B.statSync(e), f = B.statSync(n);
|
|
1373
|
+
if (Vn(a, f))
|
|
1350
1374
|
return;
|
|
1351
1375
|
}
|
|
1352
|
-
const i =
|
|
1353
|
-
e = i.toDst,
|
|
1354
|
-
const o =
|
|
1355
|
-
return
|
|
1356
|
-
}
|
|
1357
|
-
var
|
|
1358
|
-
createSymlink:
|
|
1359
|
-
createSymlinkSync:
|
|
1376
|
+
const i = Br(e, n);
|
|
1377
|
+
e = i.toDst, t = Yr(i.toCwd, t);
|
|
1378
|
+
const o = Yn.dirname(n);
|
|
1379
|
+
return B.existsSync(o) || Ar(o), B.symlinkSync(e, n, t);
|
|
1380
|
+
}
|
|
1381
|
+
var Vr = {
|
|
1382
|
+
createSymlink: Mr(Gr),
|
|
1383
|
+
createSymlinkSync: Kr
|
|
1360
1384
|
};
|
|
1361
|
-
const { createFile:
|
|
1362
|
-
var
|
|
1363
|
-
createFile:
|
|
1364
|
-
createFileSync:
|
|
1365
|
-
ensureFile:
|
|
1366
|
-
ensureFileSync:
|
|
1367
|
-
createLink:
|
|
1368
|
-
createLinkSync:
|
|
1369
|
-
ensureLink:
|
|
1370
|
-
ensureLinkSync:
|
|
1371
|
-
createSymlink:
|
|
1372
|
-
createSymlinkSync:
|
|
1373
|
-
ensureSymlink:
|
|
1374
|
-
ensureSymlinkSync:
|
|
1375
|
-
}
|
|
1376
|
-
function
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
var e = re, t = process.cwd, n = null, r = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
1381
|
-
process.cwd = function() {
|
|
1382
|
-
return n || (n = t.call(process)), n;
|
|
1383
|
-
};
|
|
1384
|
-
try {
|
|
1385
|
-
process.cwd();
|
|
1386
|
-
} catch {
|
|
1387
|
-
}
|
|
1388
|
-
if (typeof process.chdir == "function") {
|
|
1389
|
-
var i = process.chdir;
|
|
1390
|
-
process.chdir = function(c) {
|
|
1391
|
-
n = null, i.call(process, c);
|
|
1392
|
-
}, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, i);
|
|
1393
|
-
}
|
|
1394
|
-
be = o;
|
|
1395
|
-
function o(c) {
|
|
1396
|
-
e.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && a(c), c.lutimes || s(c), c.chown = m(c.chown), c.fchown = m(c.fchown), c.lchown = m(c.lchown), c.chmod = v(c.chmod), c.fchmod = v(c.fchmod), c.lchmod = v(c.lchmod), c.chownSync = h(c.chownSync), c.fchownSync = h(c.fchownSync), c.lchownSync = h(c.lchownSync), c.chmodSync = f(c.chmodSync), c.fchmodSync = f(c.fchmodSync), c.lchmodSync = f(c.lchmodSync), c.stat = d(c.stat), c.fstat = d(c.fstat), c.lstat = d(c.lstat), c.statSync = E(c.statSync), c.fstatSync = E(c.fstatSync), c.lstatSync = E(c.lstatSync), c.lchmod || (c.lchmod = function(u, l, y) {
|
|
1397
|
-
y && process.nextTick(y);
|
|
1398
|
-
}, c.lchmodSync = function() {
|
|
1399
|
-
}), c.lchown || (c.lchown = function(u, l, y, S) {
|
|
1400
|
-
S && process.nextTick(S);
|
|
1401
|
-
}, c.lchownSync = function() {
|
|
1402
|
-
}), r === "win32" && (c.rename = function(u) {
|
|
1403
|
-
return function(l, y, S) {
|
|
1404
|
-
var w = Date.now(), P = 0;
|
|
1405
|
-
u(l, y, function D(I) {
|
|
1406
|
-
if (I && (I.code === "EACCES" || I.code === "EPERM") && Date.now() - w < 6e4) {
|
|
1407
|
-
setTimeout(function() {
|
|
1408
|
-
c.stat(y, function(p, g) {
|
|
1409
|
-
p && p.code === "ENOENT" ? u(l, y, D) : S(I);
|
|
1410
|
-
});
|
|
1411
|
-
}, P), P < 100 && (P += 10);
|
|
1412
|
-
return;
|
|
1413
|
-
}
|
|
1414
|
-
S && S(I);
|
|
1415
|
-
});
|
|
1416
|
-
};
|
|
1417
|
-
}(c.rename)), c.read = function(u) {
|
|
1418
|
-
function l(y, S, w, P, D, I) {
|
|
1419
|
-
var p;
|
|
1420
|
-
if (I && typeof I == "function") {
|
|
1421
|
-
var g = 0;
|
|
1422
|
-
p = function(O, M, x) {
|
|
1423
|
-
if (O && O.code === "EAGAIN" && g < 10)
|
|
1424
|
-
return g++, u.call(c, y, S, w, P, D, p);
|
|
1425
|
-
I.apply(this, arguments);
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
return u.call(c, y, S, w, P, D, p);
|
|
1429
|
-
}
|
|
1430
|
-
return Object.setPrototypeOf && Object.setPrototypeOf(l, u), l;
|
|
1431
|
-
}(c.read), c.readSync = function(u) {
|
|
1432
|
-
return function(l, y, S, w, P) {
|
|
1433
|
-
for (var D = 0; ; )
|
|
1434
|
-
try {
|
|
1435
|
-
return u.call(c, l, y, S, w, P);
|
|
1436
|
-
} catch (I) {
|
|
1437
|
-
if (I.code === "EAGAIN" && D < 10) {
|
|
1438
|
-
D++;
|
|
1439
|
-
continue;
|
|
1440
|
-
}
|
|
1441
|
-
throw I;
|
|
1442
|
-
}
|
|
1443
|
-
};
|
|
1444
|
-
}(c.readSync);
|
|
1445
|
-
function a(u) {
|
|
1446
|
-
u.lchmod = function(l, y, S) {
|
|
1447
|
-
u.open(
|
|
1448
|
-
l,
|
|
1449
|
-
e.O_WRONLY | e.O_SYMLINK,
|
|
1450
|
-
y,
|
|
1451
|
-
function(w, P) {
|
|
1452
|
-
if (w) {
|
|
1453
|
-
S && S(w);
|
|
1454
|
-
return;
|
|
1455
|
-
}
|
|
1456
|
-
u.fchmod(P, y, function(D) {
|
|
1457
|
-
u.close(P, function(I) {
|
|
1458
|
-
S && S(D || I);
|
|
1459
|
-
});
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
);
|
|
1463
|
-
}, u.lchmodSync = function(l, y) {
|
|
1464
|
-
var S = u.openSync(l, e.O_WRONLY | e.O_SYMLINK, y), w = !0, P;
|
|
1465
|
-
try {
|
|
1466
|
-
P = u.fchmodSync(S, y), w = !1;
|
|
1467
|
-
} finally {
|
|
1468
|
-
if (w)
|
|
1469
|
-
try {
|
|
1470
|
-
u.closeSync(S);
|
|
1471
|
-
} catch {
|
|
1472
|
-
}
|
|
1473
|
-
else
|
|
1474
|
-
u.closeSync(S);
|
|
1475
|
-
}
|
|
1476
|
-
return P;
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
function s(u) {
|
|
1480
|
-
e.hasOwnProperty("O_SYMLINK") ? (u.lutimes = function(l, y, S, w) {
|
|
1481
|
-
u.open(l, e.O_SYMLINK, function(P, D) {
|
|
1482
|
-
if (P) {
|
|
1483
|
-
w && w(P);
|
|
1484
|
-
return;
|
|
1485
|
-
}
|
|
1486
|
-
u.futimes(D, y, S, function(I) {
|
|
1487
|
-
u.close(D, function(p) {
|
|
1488
|
-
w && w(I || p);
|
|
1489
|
-
});
|
|
1490
|
-
});
|
|
1491
|
-
});
|
|
1492
|
-
}, u.lutimesSync = function(l, y, S) {
|
|
1493
|
-
var w = u.openSync(l, e.O_SYMLINK), P, D = !0;
|
|
1494
|
-
try {
|
|
1495
|
-
P = u.futimesSync(w, y, S), D = !1;
|
|
1496
|
-
} finally {
|
|
1497
|
-
if (D)
|
|
1498
|
-
try {
|
|
1499
|
-
u.closeSync(w);
|
|
1500
|
-
} catch {
|
|
1501
|
-
}
|
|
1502
|
-
else
|
|
1503
|
-
u.closeSync(w);
|
|
1504
|
-
}
|
|
1505
|
-
return P;
|
|
1506
|
-
}) : (u.lutimes = function(l, y, S, w) {
|
|
1507
|
-
w && process.nextTick(w);
|
|
1508
|
-
}, u.lutimesSync = function() {
|
|
1509
|
-
});
|
|
1510
|
-
}
|
|
1511
|
-
function v(u) {
|
|
1512
|
-
return u && function(l, y, S) {
|
|
1513
|
-
return u.call(c, l, y, function(w) {
|
|
1514
|
-
F(w) && (w = null), S && S.apply(this, arguments);
|
|
1515
|
-
});
|
|
1516
|
-
};
|
|
1517
|
-
}
|
|
1518
|
-
function f(u) {
|
|
1519
|
-
return u && function(l, y) {
|
|
1520
|
-
try {
|
|
1521
|
-
return u.call(c, l, y);
|
|
1522
|
-
} catch (S) {
|
|
1523
|
-
if (!F(S))
|
|
1524
|
-
throw S;
|
|
1525
|
-
}
|
|
1526
|
-
};
|
|
1527
|
-
}
|
|
1528
|
-
function m(u) {
|
|
1529
|
-
return u && function(l, y, S, w) {
|
|
1530
|
-
return u.call(c, l, y, S, function(P) {
|
|
1531
|
-
F(P) && (P = null), w && w.apply(this, arguments);
|
|
1532
|
-
});
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
function h(u) {
|
|
1536
|
-
return u && function(l, y, S) {
|
|
1537
|
-
try {
|
|
1538
|
-
return u.call(c, l, y, S);
|
|
1539
|
-
} catch (w) {
|
|
1540
|
-
if (!F(w))
|
|
1541
|
-
throw w;
|
|
1542
|
-
}
|
|
1543
|
-
};
|
|
1544
|
-
}
|
|
1545
|
-
function d(u) {
|
|
1546
|
-
return u && function(l, y, S) {
|
|
1547
|
-
typeof y == "function" && (S = y, y = null);
|
|
1548
|
-
function w(P, D) {
|
|
1549
|
-
D && (D.uid < 0 && (D.uid += 4294967296), D.gid < 0 && (D.gid += 4294967296)), S && S.apply(this, arguments);
|
|
1550
|
-
}
|
|
1551
|
-
return y ? u.call(c, l, y, w) : u.call(c, l, w);
|
|
1552
|
-
};
|
|
1553
|
-
}
|
|
1554
|
-
function E(u) {
|
|
1555
|
-
return u && function(l, y) {
|
|
1556
|
-
var S = y ? u.call(c, l, y) : u.call(c, l);
|
|
1557
|
-
return S && (S.uid < 0 && (S.uid += 4294967296), S.gid < 0 && (S.gid += 4294967296)), S;
|
|
1558
|
-
};
|
|
1559
|
-
}
|
|
1560
|
-
function F(u) {
|
|
1561
|
-
if (!u || u.code === "ENOSYS")
|
|
1562
|
-
return !0;
|
|
1563
|
-
var l = !process.getuid || process.getuid() !== 0;
|
|
1564
|
-
return !!(l && (u.code === "EINVAL" || u.code === "EPERM"));
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
return be;
|
|
1568
|
-
}
|
|
1569
|
-
var Ge, _t;
|
|
1570
|
-
function wi() {
|
|
1571
|
-
if (_t)
|
|
1572
|
-
return Ge;
|
|
1573
|
-
_t = 1;
|
|
1574
|
-
var e = re.Stream;
|
|
1575
|
-
Ge = t;
|
|
1576
|
-
function t(n) {
|
|
1577
|
-
return {
|
|
1578
|
-
ReadStream: r,
|
|
1579
|
-
WriteStream: i
|
|
1580
|
-
};
|
|
1581
|
-
function r(o, c) {
|
|
1582
|
-
if (!(this instanceof r))
|
|
1583
|
-
return new r(o, c);
|
|
1584
|
-
e.call(this);
|
|
1585
|
-
var a = this;
|
|
1586
|
-
this.path = o, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, c = c || {};
|
|
1587
|
-
for (var s = Object.keys(c), v = 0, f = s.length; v < f; v++) {
|
|
1588
|
-
var m = s[v];
|
|
1589
|
-
this[m] = c[m];
|
|
1590
|
-
}
|
|
1591
|
-
if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
|
|
1592
|
-
if (typeof this.start != "number")
|
|
1593
|
-
throw TypeError("start must be a Number");
|
|
1594
|
-
if (this.end === void 0)
|
|
1595
|
-
this.end = 1 / 0;
|
|
1596
|
-
else if (typeof this.end != "number")
|
|
1597
|
-
throw TypeError("end must be a Number");
|
|
1598
|
-
if (this.start > this.end)
|
|
1599
|
-
throw new Error("start must be <= end");
|
|
1600
|
-
this.pos = this.start;
|
|
1601
|
-
}
|
|
1602
|
-
if (this.fd !== null) {
|
|
1603
|
-
process.nextTick(function() {
|
|
1604
|
-
a._read();
|
|
1605
|
-
});
|
|
1606
|
-
return;
|
|
1607
|
-
}
|
|
1608
|
-
n.open(this.path, this.flags, this.mode, function(h, d) {
|
|
1609
|
-
if (h) {
|
|
1610
|
-
a.emit("error", h), a.readable = !1;
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
a.fd = d, a.emit("open", d), a._read();
|
|
1614
|
-
});
|
|
1615
|
-
}
|
|
1616
|
-
function i(o, c) {
|
|
1617
|
-
if (!(this instanceof i))
|
|
1618
|
-
return new i(o, c);
|
|
1619
|
-
e.call(this), this.path = o, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, c = c || {};
|
|
1620
|
-
for (var a = Object.keys(c), s = 0, v = a.length; s < v; s++) {
|
|
1621
|
-
var f = a[s];
|
|
1622
|
-
this[f] = c[f];
|
|
1623
|
-
}
|
|
1624
|
-
if (this.start !== void 0) {
|
|
1625
|
-
if (typeof this.start != "number")
|
|
1626
|
-
throw TypeError("start must be a Number");
|
|
1627
|
-
if (this.start < 0)
|
|
1628
|
-
throw new Error("start must be >= zero");
|
|
1629
|
-
this.pos = this.start;
|
|
1630
|
-
}
|
|
1631
|
-
this.busy = !1, this._queue = [], this.fd === null && (this._open = n.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
return Ge;
|
|
1635
|
-
}
|
|
1636
|
-
var Ue, Dt;
|
|
1637
|
-
function Ei() {
|
|
1638
|
-
if (Dt)
|
|
1639
|
-
return Ue;
|
|
1640
|
-
Dt = 1, Ue = t;
|
|
1641
|
-
var e = Object.getPrototypeOf || function(n) {
|
|
1642
|
-
return n.__proto__;
|
|
1643
|
-
};
|
|
1644
|
-
function t(n) {
|
|
1645
|
-
if (n === null || typeof n != "object")
|
|
1646
|
-
return n;
|
|
1647
|
-
if (n instanceof Object)
|
|
1648
|
-
var r = { __proto__: e(n) };
|
|
1649
|
-
else
|
|
1650
|
-
var r = /* @__PURE__ */ Object.create(null);
|
|
1651
|
-
return Object.getOwnPropertyNames(n).forEach(function(i) {
|
|
1652
|
-
Object.defineProperty(r, i, Object.getOwnPropertyDescriptor(n, i));
|
|
1653
|
-
}), r;
|
|
1654
|
-
}
|
|
1655
|
-
return Ue;
|
|
1656
|
-
}
|
|
1657
|
-
var De, Nt;
|
|
1658
|
-
function $i() {
|
|
1659
|
-
if (Nt)
|
|
1660
|
-
return De;
|
|
1661
|
-
Nt = 1;
|
|
1662
|
-
var e = He, t = vi(), n = wi(), r = Ei(), i = re, o, c;
|
|
1663
|
-
typeof Symbol == "function" && typeof Symbol.for == "function" ? (o = Symbol.for("graceful-fs.queue"), c = Symbol.for("graceful-fs.previous")) : (o = "___graceful-fs.queue", c = "___graceful-fs.previous");
|
|
1664
|
-
function a() {
|
|
1665
|
-
}
|
|
1666
|
-
function s(u, l) {
|
|
1667
|
-
Object.defineProperty(u, o, {
|
|
1668
|
-
get: function() {
|
|
1669
|
-
return l;
|
|
1670
|
-
}
|
|
1671
|
-
});
|
|
1672
|
-
}
|
|
1673
|
-
var v = a;
|
|
1674
|
-
if (i.debuglog ? v = i.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (v = function() {
|
|
1675
|
-
var u = i.format.apply(i, arguments);
|
|
1676
|
-
u = "GFS4: " + u.split(/\n/).join(`
|
|
1677
|
-
GFS4: `), console.error(u);
|
|
1678
|
-
}), !e[o]) {
|
|
1679
|
-
var f = me[o] || [];
|
|
1680
|
-
s(e, f), e.close = function(u) {
|
|
1681
|
-
function l(y, S) {
|
|
1682
|
-
return u.call(e, y, function(w) {
|
|
1683
|
-
w || E(), typeof S == "function" && S.apply(this, arguments);
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
return Object.defineProperty(l, c, {
|
|
1687
|
-
value: u
|
|
1688
|
-
}), l;
|
|
1689
|
-
}(e.close), e.closeSync = function(u) {
|
|
1690
|
-
function l(y) {
|
|
1691
|
-
u.apply(e, arguments), E();
|
|
1692
|
-
}
|
|
1693
|
-
return Object.defineProperty(l, c, {
|
|
1694
|
-
value: u
|
|
1695
|
-
}), l;
|
|
1696
|
-
}(e.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
|
|
1697
|
-
v(e[o]), re.equal(e[o].length, 0);
|
|
1698
|
-
});
|
|
1699
|
-
}
|
|
1700
|
-
me[o] || s(me, e[o]), De = m(r(e)), process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !e.__patched && (De = m(e), e.__patched = !0);
|
|
1701
|
-
function m(u) {
|
|
1702
|
-
t(u), u.gracefulify = m, u.createReadStream = gn, u.createWriteStream = Fn;
|
|
1703
|
-
var l = u.readFile;
|
|
1704
|
-
u.readFile = y;
|
|
1705
|
-
function y($, T, _) {
|
|
1706
|
-
return typeof T == "function" && (_ = T, T = null), J($, T, _);
|
|
1707
|
-
function J(b, G, A, Q) {
|
|
1708
|
-
return l(b, G, function(C) {
|
|
1709
|
-
C && (C.code === "EMFILE" || C.code === "ENFILE") ? h([J, [b, G, A], C, Q || Date.now(), Date.now()]) : typeof A == "function" && A.apply(this, arguments);
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
var S = u.writeFile;
|
|
1714
|
-
u.writeFile = w;
|
|
1715
|
-
function w($, T, _, J) {
|
|
1716
|
-
return typeof _ == "function" && (J = _, _ = null), b($, T, _, J);
|
|
1717
|
-
function b(G, A, Q, C, te) {
|
|
1718
|
-
return S(G, A, Q, function(q) {
|
|
1719
|
-
q && (q.code === "EMFILE" || q.code === "ENFILE") ? h([b, [G, A, Q, C], q, te || Date.now(), Date.now()]) : typeof C == "function" && C.apply(this, arguments);
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
var P = u.appendFile;
|
|
1724
|
-
P && (u.appendFile = D);
|
|
1725
|
-
function D($, T, _, J) {
|
|
1726
|
-
return typeof _ == "function" && (J = _, _ = null), b($, T, _, J);
|
|
1727
|
-
function b(G, A, Q, C, te) {
|
|
1728
|
-
return P(G, A, Q, function(q) {
|
|
1729
|
-
q && (q.code === "EMFILE" || q.code === "ENFILE") ? h([b, [G, A, Q, C], q, te || Date.now(), Date.now()]) : typeof C == "function" && C.apply(this, arguments);
|
|
1730
|
-
});
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
var I = u.copyFile;
|
|
1734
|
-
I && (u.copyFile = p);
|
|
1735
|
-
function p($, T, _, J) {
|
|
1736
|
-
return typeof _ == "function" && (J = _, _ = 0), b($, T, _, J);
|
|
1737
|
-
function b(G, A, Q, C, te) {
|
|
1738
|
-
return I(G, A, Q, function(q) {
|
|
1739
|
-
q && (q.code === "EMFILE" || q.code === "ENFILE") ? h([b, [G, A, Q, C], q, te || Date.now(), Date.now()]) : typeof C == "function" && C.apply(this, arguments);
|
|
1740
|
-
});
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
var g = u.readdir;
|
|
1744
|
-
u.readdir = O;
|
|
1745
|
-
function O($, T, _) {
|
|
1746
|
-
return typeof T == "function" && (_ = T, T = null), J($, T, _);
|
|
1747
|
-
function J(b, G, A, Q) {
|
|
1748
|
-
return g(b, G, function(C, te) {
|
|
1749
|
-
C && (C.code === "EMFILE" || C.code === "ENFILE") ? h([J, [b, G, A], C, Q || Date.now(), Date.now()]) : (te && te.sort && te.sort(), typeof A == "function" && A.call(this, C, te));
|
|
1750
|
-
});
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
1754
|
-
var M = n(u);
|
|
1755
|
-
k = M.ReadStream, N = M.WriteStream;
|
|
1756
|
-
}
|
|
1757
|
-
var x = u.ReadStream;
|
|
1758
|
-
x && (k.prototype = Object.create(x.prototype), k.prototype.open = X);
|
|
1759
|
-
var W = u.WriteStream;
|
|
1760
|
-
W && (N.prototype = Object.create(W.prototype), N.prototype.open = ut), Object.defineProperty(u, "ReadStream", {
|
|
1761
|
-
get: function() {
|
|
1762
|
-
return k;
|
|
1763
|
-
},
|
|
1764
|
-
set: function($) {
|
|
1765
|
-
k = $;
|
|
1766
|
-
},
|
|
1767
|
-
enumerable: !0,
|
|
1768
|
-
configurable: !0
|
|
1769
|
-
}), Object.defineProperty(u, "WriteStream", {
|
|
1770
|
-
get: function() {
|
|
1771
|
-
return N;
|
|
1772
|
-
},
|
|
1773
|
-
set: function($) {
|
|
1774
|
-
N = $;
|
|
1775
|
-
},
|
|
1776
|
-
enumerable: !0,
|
|
1777
|
-
configurable: !0
|
|
1778
|
-
});
|
|
1779
|
-
var R = k;
|
|
1780
|
-
Object.defineProperty(u, "FileReadStream", {
|
|
1781
|
-
get: function() {
|
|
1782
|
-
return R;
|
|
1783
|
-
},
|
|
1784
|
-
set: function($) {
|
|
1785
|
-
R = $;
|
|
1786
|
-
},
|
|
1787
|
-
enumerable: !0,
|
|
1788
|
-
configurable: !0
|
|
1789
|
-
});
|
|
1790
|
-
var B = N;
|
|
1791
|
-
Object.defineProperty(u, "FileWriteStream", {
|
|
1792
|
-
get: function() {
|
|
1793
|
-
return B;
|
|
1794
|
-
},
|
|
1795
|
-
set: function($) {
|
|
1796
|
-
B = $;
|
|
1797
|
-
},
|
|
1798
|
-
enumerable: !0,
|
|
1799
|
-
configurable: !0
|
|
1800
|
-
});
|
|
1801
|
-
function k($, T) {
|
|
1802
|
-
return this instanceof k ? (x.apply(this, arguments), this) : k.apply(Object.create(k.prototype), arguments);
|
|
1803
|
-
}
|
|
1804
|
-
function X() {
|
|
1805
|
-
var $ = this;
|
|
1806
|
-
Be($.path, $.flags, $.mode, function(T, _) {
|
|
1807
|
-
T ? ($.autoClose && $.destroy(), $.emit("error", T)) : ($.fd = _, $.emit("open", _), $.read());
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
function N($, T) {
|
|
1811
|
-
return this instanceof N ? (W.apply(this, arguments), this) : N.apply(Object.create(N.prototype), arguments);
|
|
1812
|
-
}
|
|
1813
|
-
function ut() {
|
|
1814
|
-
var $ = this;
|
|
1815
|
-
Be($.path, $.flags, $.mode, function(T, _) {
|
|
1816
|
-
T ? ($.destroy(), $.emit("error", T)) : ($.fd = _, $.emit("open", _));
|
|
1817
|
-
});
|
|
1818
|
-
}
|
|
1819
|
-
function gn($, T) {
|
|
1820
|
-
return new u.ReadStream($, T);
|
|
1821
|
-
}
|
|
1822
|
-
function Fn($, T) {
|
|
1823
|
-
return new u.WriteStream($, T);
|
|
1824
|
-
}
|
|
1825
|
-
var On = u.open;
|
|
1826
|
-
u.open = Be;
|
|
1827
|
-
function Be($, T, _, J) {
|
|
1828
|
-
return typeof _ == "function" && (J = _, _ = null), b($, T, _, J);
|
|
1829
|
-
function b(G, A, Q, C, te) {
|
|
1830
|
-
return On(G, A, Q, function(q, lo) {
|
|
1831
|
-
q && (q.code === "EMFILE" || q.code === "ENFILE") ? h([b, [G, A, Q, C], q, te || Date.now(), Date.now()]) : typeof C == "function" && C.apply(this, arguments);
|
|
1832
|
-
});
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
return u;
|
|
1836
|
-
}
|
|
1837
|
-
function h(u) {
|
|
1838
|
-
v("ENQUEUE", u[0].name, u[1]), e[o].push(u), F();
|
|
1839
|
-
}
|
|
1840
|
-
var d;
|
|
1841
|
-
function E() {
|
|
1842
|
-
for (var u = Date.now(), l = 0; l < e[o].length; ++l)
|
|
1843
|
-
e[o][l].length > 2 && (e[o][l][3] = u, e[o][l][4] = u);
|
|
1844
|
-
F();
|
|
1845
|
-
}
|
|
1846
|
-
function F() {
|
|
1847
|
-
if (clearTimeout(d), d = void 0, e[o].length !== 0) {
|
|
1848
|
-
var u = e[o].shift(), l = u[0], y = u[1], S = u[2], w = u[3], P = u[4];
|
|
1849
|
-
if (w === void 0)
|
|
1850
|
-
v("RETRY", l.name, y), l.apply(null, y);
|
|
1851
|
-
else if (Date.now() - w >= 6e4) {
|
|
1852
|
-
v("TIMEOUT", l.name, y);
|
|
1853
|
-
var D = y.pop();
|
|
1854
|
-
typeof D == "function" && D.call(null, S);
|
|
1855
|
-
} else {
|
|
1856
|
-
var I = Date.now() - P, p = Math.max(P - w, 1), g = Math.min(p * 1.2, 100);
|
|
1857
|
-
I >= g ? (v("RETRY", l.name, y), l.apply(null, y.concat([w]))) : e[o].push(u);
|
|
1858
|
-
}
|
|
1859
|
-
d === void 0 && (d = setTimeout(F, 0));
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
return De;
|
|
1863
|
-
}
|
|
1864
|
-
function gi(e, { EOL: t = `
|
|
1865
|
-
`, finalEOL: n = !0, replacer: r = null, spaces: i } = {}) {
|
|
1866
|
-
const o = n ? t : "";
|
|
1867
|
-
return JSON.stringify(e, r, i).replace(/\n/g, t) + o;
|
|
1385
|
+
const { createFile: tn, createFileSync: rn } = Fr, { createLink: on, createLinkSync: cn } = Tr, { createSymlink: un, createSymlinkSync: an } = Vr;
|
|
1386
|
+
var Qr = {
|
|
1387
|
+
createFile: tn,
|
|
1388
|
+
createFileSync: rn,
|
|
1389
|
+
ensureFile: tn,
|
|
1390
|
+
ensureFileSync: rn,
|
|
1391
|
+
createLink: on,
|
|
1392
|
+
createLinkSync: cn,
|
|
1393
|
+
ensureLink: on,
|
|
1394
|
+
ensureLinkSync: cn,
|
|
1395
|
+
createSymlink: un,
|
|
1396
|
+
createSymlinkSync: an,
|
|
1397
|
+
ensureSymlink: un,
|
|
1398
|
+
ensureSymlinkSync: an
|
|
1399
|
+
};
|
|
1400
|
+
function Xr(e, { EOL: n = `
|
|
1401
|
+
`, finalEOL: t = !0, replacer: r = null, spaces: i } = {}) {
|
|
1402
|
+
const o = t ? n : "";
|
|
1403
|
+
return JSON.stringify(e, r, i).replace(/\n/g, n) + o;
|
|
1868
1404
|
}
|
|
1869
|
-
function
|
|
1405
|
+
function zr(e) {
|
|
1870
1406
|
return Buffer.isBuffer(e) && (e = e.toString("utf8")), e.replace(/^\uFEFF/, "");
|
|
1871
1407
|
}
|
|
1872
|
-
var
|
|
1873
|
-
let
|
|
1408
|
+
var Je = { stringify: Xr, stripBom: zr };
|
|
1409
|
+
let Z;
|
|
1874
1410
|
try {
|
|
1875
|
-
|
|
1411
|
+
Z = W;
|
|
1876
1412
|
} catch {
|
|
1877
|
-
|
|
1878
|
-
}
|
|
1879
|
-
const
|
|
1880
|
-
async function
|
|
1881
|
-
typeof
|
|
1882
|
-
const
|
|
1883
|
-
let i = await
|
|
1884
|
-
i =
|
|
1413
|
+
Z = yn;
|
|
1414
|
+
}
|
|
1415
|
+
const Fe = M, { stringify: Qn, stripBom: Xn } = Je;
|
|
1416
|
+
async function Hr(e, n = {}) {
|
|
1417
|
+
typeof n == "string" && (n = { encoding: n });
|
|
1418
|
+
const t = n.fs || Z, r = "throws" in n ? n.throws : !0;
|
|
1419
|
+
let i = await Fe.fromCallback(t.readFile)(e, n);
|
|
1420
|
+
i = Xn(i);
|
|
1885
1421
|
let o;
|
|
1886
1422
|
try {
|
|
1887
|
-
o = JSON.parse(i,
|
|
1423
|
+
o = JSON.parse(i, n ? n.reviver : null);
|
|
1888
1424
|
} catch (c) {
|
|
1889
1425
|
if (r)
|
|
1890
1426
|
throw c.message = `${e}: ${c.message}`, c;
|
|
@@ -1892,202 +1428,202 @@ async function Oi(e, t = {}) {
|
|
|
1892
1428
|
}
|
|
1893
1429
|
return o;
|
|
1894
1430
|
}
|
|
1895
|
-
const
|
|
1896
|
-
function
|
|
1897
|
-
typeof
|
|
1898
|
-
const
|
|
1431
|
+
const br = Fe.fromPromise(Hr);
|
|
1432
|
+
function Zr(e, n = {}) {
|
|
1433
|
+
typeof n == "string" && (n = { encoding: n });
|
|
1434
|
+
const t = n.fs || Z, r = "throws" in n ? n.throws : !0;
|
|
1899
1435
|
try {
|
|
1900
|
-
let i =
|
|
1901
|
-
return i =
|
|
1436
|
+
let i = t.readFileSync(e, n);
|
|
1437
|
+
return i = Xn(i), JSON.parse(i, n.reviver);
|
|
1902
1438
|
} catch (i) {
|
|
1903
1439
|
if (r)
|
|
1904
1440
|
throw i.message = `${e}: ${i.message}`, i;
|
|
1905
1441
|
return null;
|
|
1906
1442
|
}
|
|
1907
1443
|
}
|
|
1908
|
-
async function
|
|
1909
|
-
const r =
|
|
1910
|
-
await
|
|
1444
|
+
async function ei(e, n, t = {}) {
|
|
1445
|
+
const r = t.fs || Z, i = Qn(n, t);
|
|
1446
|
+
await Fe.fromCallback(r.writeFile)(e, i, t);
|
|
1911
1447
|
}
|
|
1912
|
-
const
|
|
1913
|
-
function
|
|
1914
|
-
const r =
|
|
1915
|
-
return r.writeFileSync(e, i,
|
|
1448
|
+
const ni = Fe.fromPromise(ei);
|
|
1449
|
+
function ti(e, n, t = {}) {
|
|
1450
|
+
const r = t.fs || Z, i = Qn(n, t);
|
|
1451
|
+
return r.writeFileSync(e, i, t);
|
|
1916
1452
|
}
|
|
1917
|
-
const
|
|
1918
|
-
readFile:
|
|
1919
|
-
readFileSync:
|
|
1920
|
-
writeFile:
|
|
1921
|
-
writeFileSync:
|
|
1453
|
+
const ri = {
|
|
1454
|
+
readFile: br,
|
|
1455
|
+
readFileSync: Zr,
|
|
1456
|
+
writeFile: ni,
|
|
1457
|
+
writeFileSync: ti
|
|
1922
1458
|
};
|
|
1923
|
-
var
|
|
1924
|
-
const
|
|
1925
|
-
var
|
|
1926
|
-
readJson:
|
|
1927
|
-
readJsonSync:
|
|
1928
|
-
writeJson:
|
|
1929
|
-
writeJsonSync:
|
|
1459
|
+
var ii = ri;
|
|
1460
|
+
const me = ii;
|
|
1461
|
+
var oi = {
|
|
1462
|
+
readJson: me.readFile,
|
|
1463
|
+
readJsonSync: me.readFileSync,
|
|
1464
|
+
writeJson: me.writeFile,
|
|
1465
|
+
writeJsonSync: me.writeFileSync
|
|
1930
1466
|
};
|
|
1931
|
-
const
|
|
1932
|
-
function
|
|
1933
|
-
typeof
|
|
1934
|
-
const i =
|
|
1935
|
-
|
|
1467
|
+
const ci = M.fromCallback, ie = W, zn = L, Hn = q, ui = X.pathExists;
|
|
1468
|
+
function ai(e, n, t, r) {
|
|
1469
|
+
typeof t == "function" && (r = t, t = "utf8");
|
|
1470
|
+
const i = zn.dirname(e);
|
|
1471
|
+
ui(i, (o, c) => {
|
|
1936
1472
|
if (o)
|
|
1937
1473
|
return r(o);
|
|
1938
1474
|
if (c)
|
|
1939
|
-
return
|
|
1940
|
-
|
|
1475
|
+
return ie.writeFile(e, n, t, r);
|
|
1476
|
+
Hn.mkdirs(i, (a) => {
|
|
1941
1477
|
if (a)
|
|
1942
1478
|
return r(a);
|
|
1943
|
-
|
|
1479
|
+
ie.writeFile(e, n, t, r);
|
|
1944
1480
|
});
|
|
1945
1481
|
});
|
|
1946
1482
|
}
|
|
1947
|
-
function
|
|
1948
|
-
const
|
|
1949
|
-
if (
|
|
1950
|
-
return
|
|
1951
|
-
|
|
1483
|
+
function fi(e, ...n) {
|
|
1484
|
+
const t = zn.dirname(e);
|
|
1485
|
+
if (ie.existsSync(t))
|
|
1486
|
+
return ie.writeFileSync(e, ...n);
|
|
1487
|
+
Hn.mkdirsSync(t), ie.writeFileSync(e, ...n);
|
|
1952
1488
|
}
|
|
1953
|
-
var
|
|
1954
|
-
outputFile:
|
|
1955
|
-
outputFileSync:
|
|
1489
|
+
var Be = {
|
|
1490
|
+
outputFile: ci(ai),
|
|
1491
|
+
outputFileSync: fi
|
|
1956
1492
|
};
|
|
1957
|
-
const { stringify:
|
|
1958
|
-
async function
|
|
1959
|
-
const r =
|
|
1960
|
-
await
|
|
1961
|
-
}
|
|
1962
|
-
var
|
|
1963
|
-
const { stringify:
|
|
1964
|
-
function
|
|
1965
|
-
const r =
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
var
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
var
|
|
1979
|
-
const
|
|
1980
|
-
function
|
|
1981
|
-
typeof
|
|
1982
|
-
const i =
|
|
1983
|
-
|
|
1493
|
+
const { stringify: si } = Je, { outputFile: li } = Be;
|
|
1494
|
+
async function yi(e, n, t = {}) {
|
|
1495
|
+
const r = si(n, t);
|
|
1496
|
+
await li(e, r, t);
|
|
1497
|
+
}
|
|
1498
|
+
var mi = yi;
|
|
1499
|
+
const { stringify: di } = Je, { outputFileSync: hi } = Be;
|
|
1500
|
+
function Si(e, n, t) {
|
|
1501
|
+
const r = di(n, t);
|
|
1502
|
+
hi(e, r, t);
|
|
1503
|
+
}
|
|
1504
|
+
var wi = Si;
|
|
1505
|
+
const vi = M.fromPromise, R = oi;
|
|
1506
|
+
R.outputJson = vi(mi);
|
|
1507
|
+
R.outputJsonSync = wi;
|
|
1508
|
+
R.outputJSON = R.outputJson;
|
|
1509
|
+
R.outputJSONSync = R.outputJsonSync;
|
|
1510
|
+
R.writeJSON = R.writeJson;
|
|
1511
|
+
R.writeJSONSync = R.writeJsonSync;
|
|
1512
|
+
R.readJSON = R.readJson;
|
|
1513
|
+
R.readJSONSync = R.readJsonSync;
|
|
1514
|
+
var Ei = R;
|
|
1515
|
+
const pi = W, Ce = L, $i = We.copy, bn = ge.remove, ki = q.mkdirp, gi = X.pathExists, fn = ne;
|
|
1516
|
+
function Fi(e, n, t, r) {
|
|
1517
|
+
typeof t == "function" && (r = t, t = {}), t = t || {};
|
|
1518
|
+
const i = t.overwrite || t.clobber || !1;
|
|
1519
|
+
fn.checkPaths(e, n, "move", t, (o, c) => {
|
|
1984
1520
|
if (o)
|
|
1985
1521
|
return r(o);
|
|
1986
|
-
const { srcStat: a, isChangingCase:
|
|
1987
|
-
|
|
1988
|
-
if (
|
|
1989
|
-
return r(
|
|
1990
|
-
if (
|
|
1991
|
-
return
|
|
1992
|
-
|
|
1522
|
+
const { srcStat: a, isChangingCase: f = !1 } = c;
|
|
1523
|
+
fn.checkParentPaths(e, a, n, "move", (h) => {
|
|
1524
|
+
if (h)
|
|
1525
|
+
return r(h);
|
|
1526
|
+
if (Pi(n))
|
|
1527
|
+
return sn(e, n, i, f, r);
|
|
1528
|
+
ki(Ce.dirname(n), (u) => u ? r(u) : sn(e, n, i, f, r));
|
|
1993
1529
|
});
|
|
1994
1530
|
});
|
|
1995
1531
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const
|
|
1998
|
-
return
|
|
1532
|
+
function Pi(e) {
|
|
1533
|
+
const n = Ce.dirname(e);
|
|
1534
|
+
return Ce.parse(n).root === n;
|
|
1999
1535
|
}
|
|
2000
|
-
function
|
|
1536
|
+
function sn(e, n, t, r, i) {
|
|
2001
1537
|
if (r)
|
|
2002
|
-
return
|
|
2003
|
-
if (
|
|
2004
|
-
return
|
|
2005
|
-
|
|
1538
|
+
return Ne(e, n, t, i);
|
|
1539
|
+
if (t)
|
|
1540
|
+
return bn(n, (o) => o ? i(o) : Ne(e, n, t, i));
|
|
1541
|
+
gi(n, (o, c) => o ? i(o) : c ? i(new Error("dest already exists.")) : Ne(e, n, t, i));
|
|
2006
1542
|
}
|
|
2007
|
-
function
|
|
2008
|
-
|
|
1543
|
+
function Ne(e, n, t, r) {
|
|
1544
|
+
pi.rename(e, n, (i) => i ? i.code !== "EXDEV" ? r(i) : Oi(e, n, t, r) : r());
|
|
2009
1545
|
}
|
|
2010
|
-
function
|
|
2011
|
-
|
|
2012
|
-
overwrite:
|
|
1546
|
+
function Oi(e, n, t, r) {
|
|
1547
|
+
$i(e, n, {
|
|
1548
|
+
overwrite: t,
|
|
2013
1549
|
errorOnExist: !0
|
|
2014
|
-
}, (o) => o ? r(o) :
|
|
1550
|
+
}, (o) => o ? r(o) : bn(e, r));
|
|
2015
1551
|
}
|
|
2016
|
-
var
|
|
2017
|
-
const
|
|
2018
|
-
function
|
|
2019
|
-
|
|
2020
|
-
const r =
|
|
2021
|
-
return
|
|
1552
|
+
var Di = Fi;
|
|
1553
|
+
const Zn = W, xe = L, Ni = We.copySync, et = ge.removeSync, Ti = q.mkdirpSync, ln = ne;
|
|
1554
|
+
function _i(e, n, t) {
|
|
1555
|
+
t = t || {};
|
|
1556
|
+
const r = t.overwrite || t.clobber || !1, { srcStat: i, isChangingCase: o = !1 } = ln.checkPathsSync(e, n, "move", t);
|
|
1557
|
+
return ln.checkParentPathsSync(e, i, n, "move"), Ci(n) || Ti(xe.dirname(n)), xi(e, n, r, o);
|
|
2022
1558
|
}
|
|
2023
|
-
function
|
|
2024
|
-
const
|
|
2025
|
-
return
|
|
1559
|
+
function Ci(e) {
|
|
1560
|
+
const n = xe.dirname(e);
|
|
1561
|
+
return xe.parse(n).root === n;
|
|
2026
1562
|
}
|
|
2027
|
-
function
|
|
1563
|
+
function xi(e, n, t, r) {
|
|
2028
1564
|
if (r)
|
|
2029
|
-
return
|
|
2030
|
-
if (
|
|
2031
|
-
return
|
|
2032
|
-
if (
|
|
1565
|
+
return Te(e, n, t);
|
|
1566
|
+
if (t)
|
|
1567
|
+
return et(n), Te(e, n, t);
|
|
1568
|
+
if (Zn.existsSync(n))
|
|
2033
1569
|
throw new Error("dest already exists.");
|
|
2034
|
-
return
|
|
1570
|
+
return Te(e, n, t);
|
|
2035
1571
|
}
|
|
2036
|
-
function
|
|
1572
|
+
function Te(e, n, t) {
|
|
2037
1573
|
try {
|
|
2038
|
-
|
|
1574
|
+
Zn.renameSync(e, n);
|
|
2039
1575
|
} catch (r) {
|
|
2040
1576
|
if (r.code !== "EXDEV")
|
|
2041
1577
|
throw r;
|
|
2042
|
-
return
|
|
1578
|
+
return ji(e, n, t);
|
|
2043
1579
|
}
|
|
2044
1580
|
}
|
|
2045
|
-
function
|
|
2046
|
-
return
|
|
2047
|
-
overwrite:
|
|
1581
|
+
function ji(e, n, t) {
|
|
1582
|
+
return Ni(e, n, {
|
|
1583
|
+
overwrite: t,
|
|
2048
1584
|
errorOnExist: !0
|
|
2049
|
-
}),
|
|
2050
|
-
}
|
|
2051
|
-
var
|
|
2052
|
-
const
|
|
2053
|
-
var
|
|
2054
|
-
move:
|
|
2055
|
-
moveSync:
|
|
2056
|
-
},
|
|
2057
|
-
...
|
|
2058
|
-
...
|
|
2059
|
-
...
|
|
2060
|
-
...
|
|
2061
|
-
...
|
|
2062
|
-
...
|
|
2063
|
-
...
|
|
2064
|
-
...
|
|
2065
|
-
...
|
|
2066
|
-
...
|
|
1585
|
+
}), et(e);
|
|
1586
|
+
}
|
|
1587
|
+
var Ii = _i;
|
|
1588
|
+
const Li = M.fromCallback;
|
|
1589
|
+
var Ri = {
|
|
1590
|
+
move: Li(Di),
|
|
1591
|
+
moveSync: Ii
|
|
1592
|
+
}, Mi = {
|
|
1593
|
+
...Q,
|
|
1594
|
+
...We,
|
|
1595
|
+
...pr,
|
|
1596
|
+
...Qr,
|
|
1597
|
+
...Ei,
|
|
1598
|
+
...q,
|
|
1599
|
+
...Ri,
|
|
1600
|
+
...Be,
|
|
1601
|
+
...X,
|
|
1602
|
+
...ge
|
|
2067
1603
|
};
|
|
2068
|
-
const
|
|
2069
|
-
function
|
|
1604
|
+
const de = Mi;
|
|
1605
|
+
function qi(e, n) {
|
|
2070
1606
|
return {
|
|
2071
1607
|
name: "vite-plugin-css-import",
|
|
2072
1608
|
apply: "build",
|
|
2073
1609
|
enforce: "post",
|
|
2074
|
-
writeBundle: async (
|
|
2075
|
-
const i = Object.keys(r).filter((
|
|
1610
|
+
writeBundle: async (t, r) => {
|
|
1611
|
+
const i = Object.keys(r).filter((u) => u.endsWith(".css"));
|
|
2076
1612
|
if (!i.length)
|
|
2077
1613
|
return;
|
|
2078
|
-
const o = i.reduce((
|
|
2079
|
-
`, ""), c =
|
|
1614
|
+
const o = i.reduce((u, s) => `${u}import "./${s}";
|
|
1615
|
+
`, ""), c = L.resolve(
|
|
2080
1616
|
process.cwd(),
|
|
2081
1617
|
e,
|
|
2082
|
-
`${
|
|
2083
|
-
), a =
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2086
|
-
await
|
|
1618
|
+
`${n}-temp.js`
|
|
1619
|
+
), a = L.resolve(process.cwd(), e, `${n}.js`), f = de.createWriteStream(c);
|
|
1620
|
+
f.write(o, "utf8");
|
|
1621
|
+
const h = de.createReadStream(a);
|
|
1622
|
+
await tt(h, f), await de.remove(a), await de.rename(c, a), f.end();
|
|
2087
1623
|
}
|
|
2088
1624
|
};
|
|
2089
1625
|
}
|
|
2090
1626
|
export {
|
|
2091
|
-
|
|
1627
|
+
qi as viteCssImportPlugin
|
|
2092
1628
|
};
|
|
2093
1629
|
//# sourceMappingURL=index.js.map
|