game-data-gen 1.0.1 → 1.0.2
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/README.md +3 -3
- package/dist/main.js +4 -2219
- package/package.json +6 -7
package/dist/main.js
CHANGED
|
@@ -3,26 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
24
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
25
|
-
};
|
|
26
8
|
var __copyProps = (to, from, except, desc) => {
|
|
27
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -39,2209 +21,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
22
|
mod
|
|
41
23
|
));
|
|
42
|
-
var __async = (__this, __arguments, generator) => {
|
|
43
|
-
return new Promise((resolve, reject) => {
|
|
44
|
-
var fulfilled = (value) => {
|
|
45
|
-
try {
|
|
46
|
-
step(generator.next(value));
|
|
47
|
-
} catch (e) {
|
|
48
|
-
reject(e);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var rejected = (value) => {
|
|
52
|
-
try {
|
|
53
|
-
step(generator.throw(value));
|
|
54
|
-
} catch (e) {
|
|
55
|
-
reject(e);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
59
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
63
|
-
|
|
64
|
-
// node_modules/universalify/index.js
|
|
65
|
-
var require_universalify = __commonJS({
|
|
66
|
-
"node_modules/universalify/index.js"(exports2) {
|
|
67
|
-
"use strict";
|
|
68
|
-
exports2.fromCallback = function(fn) {
|
|
69
|
-
return Object.defineProperty(function(...args) {
|
|
70
|
-
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
|
71
|
-
else {
|
|
72
|
-
return new Promise((resolve, reject) => {
|
|
73
|
-
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
|
74
|
-
fn.apply(this, args);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}, "name", { value: fn.name });
|
|
78
|
-
};
|
|
79
|
-
exports2.fromPromise = function(fn) {
|
|
80
|
-
return Object.defineProperty(function(...args) {
|
|
81
|
-
const cb = args[args.length - 1];
|
|
82
|
-
if (typeof cb !== "function") return fn.apply(this, args);
|
|
83
|
-
else {
|
|
84
|
-
args.pop();
|
|
85
|
-
fn.apply(this, args).then((r) => cb(null, r), cb);
|
|
86
|
-
}
|
|
87
|
-
}, "name", { value: fn.name });
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// node_modules/graceful-fs/polyfills.js
|
|
93
|
-
var require_polyfills = __commonJS({
|
|
94
|
-
"node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
95
|
-
var constants = require("constants");
|
|
96
|
-
var origCwd = process.cwd;
|
|
97
|
-
var cwd = null;
|
|
98
|
-
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
99
|
-
process.cwd = function() {
|
|
100
|
-
if (!cwd)
|
|
101
|
-
cwd = origCwd.call(process);
|
|
102
|
-
return cwd;
|
|
103
|
-
};
|
|
104
|
-
try {
|
|
105
|
-
process.cwd();
|
|
106
|
-
} catch (er) {
|
|
107
|
-
}
|
|
108
|
-
if (typeof process.chdir === "function") {
|
|
109
|
-
chdir = process.chdir;
|
|
110
|
-
process.chdir = function(d) {
|
|
111
|
-
cwd = null;
|
|
112
|
-
chdir.call(process, d);
|
|
113
|
-
};
|
|
114
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
115
|
-
}
|
|
116
|
-
var chdir;
|
|
117
|
-
module2.exports = patch;
|
|
118
|
-
function patch(fs2) {
|
|
119
|
-
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
120
|
-
patchLchmod(fs2);
|
|
121
|
-
}
|
|
122
|
-
if (!fs2.lutimes) {
|
|
123
|
-
patchLutimes(fs2);
|
|
124
|
-
}
|
|
125
|
-
fs2.chown = chownFix(fs2.chown);
|
|
126
|
-
fs2.fchown = chownFix(fs2.fchown);
|
|
127
|
-
fs2.lchown = chownFix(fs2.lchown);
|
|
128
|
-
fs2.chmod = chmodFix(fs2.chmod);
|
|
129
|
-
fs2.fchmod = chmodFix(fs2.fchmod);
|
|
130
|
-
fs2.lchmod = chmodFix(fs2.lchmod);
|
|
131
|
-
fs2.chownSync = chownFixSync(fs2.chownSync);
|
|
132
|
-
fs2.fchownSync = chownFixSync(fs2.fchownSync);
|
|
133
|
-
fs2.lchownSync = chownFixSync(fs2.lchownSync);
|
|
134
|
-
fs2.chmodSync = chmodFixSync(fs2.chmodSync);
|
|
135
|
-
fs2.fchmodSync = chmodFixSync(fs2.fchmodSync);
|
|
136
|
-
fs2.lchmodSync = chmodFixSync(fs2.lchmodSync);
|
|
137
|
-
fs2.stat = statFix(fs2.stat);
|
|
138
|
-
fs2.fstat = statFix(fs2.fstat);
|
|
139
|
-
fs2.lstat = statFix(fs2.lstat);
|
|
140
|
-
fs2.statSync = statFixSync(fs2.statSync);
|
|
141
|
-
fs2.fstatSync = statFixSync(fs2.fstatSync);
|
|
142
|
-
fs2.lstatSync = statFixSync(fs2.lstatSync);
|
|
143
|
-
if (fs2.chmod && !fs2.lchmod) {
|
|
144
|
-
fs2.lchmod = function(path, mode, cb) {
|
|
145
|
-
if (cb) process.nextTick(cb);
|
|
146
|
-
};
|
|
147
|
-
fs2.lchmodSync = function() {
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
if (fs2.chown && !fs2.lchown) {
|
|
151
|
-
fs2.lchown = function(path, uid, gid, cb) {
|
|
152
|
-
if (cb) process.nextTick(cb);
|
|
153
|
-
};
|
|
154
|
-
fs2.lchownSync = function() {
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
if (platform === "win32") {
|
|
158
|
-
fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : function(fs$rename) {
|
|
159
|
-
function rename(from, to, cb) {
|
|
160
|
-
var start = Date.now();
|
|
161
|
-
var backoff = 0;
|
|
162
|
-
fs$rename(from, to, function CB(er) {
|
|
163
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
164
|
-
setTimeout(function() {
|
|
165
|
-
fs2.stat(to, function(stater, st) {
|
|
166
|
-
if (stater && stater.code === "ENOENT")
|
|
167
|
-
fs$rename(from, to, CB);
|
|
168
|
-
else
|
|
169
|
-
cb(er);
|
|
170
|
-
});
|
|
171
|
-
}, backoff);
|
|
172
|
-
if (backoff < 100)
|
|
173
|
-
backoff += 10;
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
if (cb) cb(er);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
180
|
-
return rename;
|
|
181
|
-
}(fs2.rename);
|
|
182
|
-
}
|
|
183
|
-
fs2.read = typeof fs2.read !== "function" ? fs2.read : function(fs$read) {
|
|
184
|
-
function read(fd, buffer, offset, length, position, callback_) {
|
|
185
|
-
var callback;
|
|
186
|
-
if (callback_ && typeof callback_ === "function") {
|
|
187
|
-
var eagCounter = 0;
|
|
188
|
-
callback = function(er, _, __) {
|
|
189
|
-
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
190
|
-
eagCounter++;
|
|
191
|
-
return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
|
|
192
|
-
}
|
|
193
|
-
callback_.apply(this, arguments);
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
|
|
197
|
-
}
|
|
198
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
199
|
-
return read;
|
|
200
|
-
}(fs2.read);
|
|
201
|
-
fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
202
|
-
return function(fd, buffer, offset, length, position) {
|
|
203
|
-
var eagCounter = 0;
|
|
204
|
-
while (true) {
|
|
205
|
-
try {
|
|
206
|
-
return fs$readSync.call(fs2, fd, buffer, offset, length, position);
|
|
207
|
-
} catch (er) {
|
|
208
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
209
|
-
eagCounter++;
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
throw er;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
}(fs2.readSync);
|
|
217
|
-
function patchLchmod(fs3) {
|
|
218
|
-
fs3.lchmod = function(path, mode, callback) {
|
|
219
|
-
fs3.open(
|
|
220
|
-
path,
|
|
221
|
-
constants.O_WRONLY | constants.O_SYMLINK,
|
|
222
|
-
mode,
|
|
223
|
-
function(err, fd) {
|
|
224
|
-
if (err) {
|
|
225
|
-
if (callback) callback(err);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
fs3.fchmod(fd, mode, function(err2) {
|
|
229
|
-
fs3.close(fd, function(err22) {
|
|
230
|
-
if (callback) callback(err2 || err22);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
};
|
|
236
|
-
fs3.lchmodSync = function(path, mode) {
|
|
237
|
-
var fd = fs3.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
238
|
-
var threw = true;
|
|
239
|
-
var ret;
|
|
240
|
-
try {
|
|
241
|
-
ret = fs3.fchmodSync(fd, mode);
|
|
242
|
-
threw = false;
|
|
243
|
-
} finally {
|
|
244
|
-
if (threw) {
|
|
245
|
-
try {
|
|
246
|
-
fs3.closeSync(fd);
|
|
247
|
-
} catch (er) {
|
|
248
|
-
}
|
|
249
|
-
} else {
|
|
250
|
-
fs3.closeSync(fd);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return ret;
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function patchLutimes(fs3) {
|
|
257
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) {
|
|
258
|
-
fs3.lutimes = function(path, at, mt, cb) {
|
|
259
|
-
fs3.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
260
|
-
if (er) {
|
|
261
|
-
if (cb) cb(er);
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
fs3.futimes(fd, at, mt, function(er2) {
|
|
265
|
-
fs3.close(fd, function(er22) {
|
|
266
|
-
if (cb) cb(er2 || er22);
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
fs3.lutimesSync = function(path, at, mt) {
|
|
272
|
-
var fd = fs3.openSync(path, constants.O_SYMLINK);
|
|
273
|
-
var ret;
|
|
274
|
-
var threw = true;
|
|
275
|
-
try {
|
|
276
|
-
ret = fs3.futimesSync(fd, at, mt);
|
|
277
|
-
threw = false;
|
|
278
|
-
} finally {
|
|
279
|
-
if (threw) {
|
|
280
|
-
try {
|
|
281
|
-
fs3.closeSync(fd);
|
|
282
|
-
} catch (er) {
|
|
283
|
-
}
|
|
284
|
-
} else {
|
|
285
|
-
fs3.closeSync(fd);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return ret;
|
|
289
|
-
};
|
|
290
|
-
} else if (fs3.futimes) {
|
|
291
|
-
fs3.lutimes = function(_a, _b, _c, cb) {
|
|
292
|
-
if (cb) process.nextTick(cb);
|
|
293
|
-
};
|
|
294
|
-
fs3.lutimesSync = function() {
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function chmodFix(orig) {
|
|
299
|
-
if (!orig) return orig;
|
|
300
|
-
return function(target, mode, cb) {
|
|
301
|
-
return orig.call(fs2, target, mode, function(er) {
|
|
302
|
-
if (chownErOk(er)) er = null;
|
|
303
|
-
if (cb) cb.apply(this, arguments);
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function chmodFixSync(orig) {
|
|
308
|
-
if (!orig) return orig;
|
|
309
|
-
return function(target, mode) {
|
|
310
|
-
try {
|
|
311
|
-
return orig.call(fs2, target, mode);
|
|
312
|
-
} catch (er) {
|
|
313
|
-
if (!chownErOk(er)) throw er;
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function chownFix(orig) {
|
|
318
|
-
if (!orig) return orig;
|
|
319
|
-
return function(target, uid, gid, cb) {
|
|
320
|
-
return orig.call(fs2, target, uid, gid, function(er) {
|
|
321
|
-
if (chownErOk(er)) er = null;
|
|
322
|
-
if (cb) cb.apply(this, arguments);
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
function chownFixSync(orig) {
|
|
327
|
-
if (!orig) return orig;
|
|
328
|
-
return function(target, uid, gid) {
|
|
329
|
-
try {
|
|
330
|
-
return orig.call(fs2, target, uid, gid);
|
|
331
|
-
} catch (er) {
|
|
332
|
-
if (!chownErOk(er)) throw er;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function statFix(orig) {
|
|
337
|
-
if (!orig) return orig;
|
|
338
|
-
return function(target, options, cb) {
|
|
339
|
-
if (typeof options === "function") {
|
|
340
|
-
cb = options;
|
|
341
|
-
options = null;
|
|
342
|
-
}
|
|
343
|
-
function callback(er, stats) {
|
|
344
|
-
if (stats) {
|
|
345
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
346
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
347
|
-
}
|
|
348
|
-
if (cb) cb.apply(this, arguments);
|
|
349
|
-
}
|
|
350
|
-
return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback);
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
function statFixSync(orig) {
|
|
354
|
-
if (!orig) return orig;
|
|
355
|
-
return function(target, options) {
|
|
356
|
-
var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target);
|
|
357
|
-
if (stats) {
|
|
358
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
359
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
360
|
-
}
|
|
361
|
-
return stats;
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
function chownErOk(er) {
|
|
365
|
-
if (!er)
|
|
366
|
-
return true;
|
|
367
|
-
if (er.code === "ENOSYS")
|
|
368
|
-
return true;
|
|
369
|
-
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
370
|
-
if (nonroot) {
|
|
371
|
-
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
372
|
-
return true;
|
|
373
|
-
}
|
|
374
|
-
return false;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// node_modules/graceful-fs/legacy-streams.js
|
|
381
|
-
var require_legacy_streams = __commonJS({
|
|
382
|
-
"node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
|
|
383
|
-
var Stream = require("stream").Stream;
|
|
384
|
-
module2.exports = legacy;
|
|
385
|
-
function legacy(fs2) {
|
|
386
|
-
return {
|
|
387
|
-
ReadStream,
|
|
388
|
-
WriteStream
|
|
389
|
-
};
|
|
390
|
-
function ReadStream(path, options) {
|
|
391
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
392
|
-
Stream.call(this);
|
|
393
|
-
var self = this;
|
|
394
|
-
this.path = path;
|
|
395
|
-
this.fd = null;
|
|
396
|
-
this.readable = true;
|
|
397
|
-
this.paused = false;
|
|
398
|
-
this.flags = "r";
|
|
399
|
-
this.mode = 438;
|
|
400
|
-
this.bufferSize = 64 * 1024;
|
|
401
|
-
options = options || {};
|
|
402
|
-
var keys = Object.keys(options);
|
|
403
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
404
|
-
var key = keys[index];
|
|
405
|
-
this[key] = options[key];
|
|
406
|
-
}
|
|
407
|
-
if (this.encoding) this.setEncoding(this.encoding);
|
|
408
|
-
if (this.start !== void 0) {
|
|
409
|
-
if ("number" !== typeof this.start) {
|
|
410
|
-
throw TypeError("start must be a Number");
|
|
411
|
-
}
|
|
412
|
-
if (this.end === void 0) {
|
|
413
|
-
this.end = Infinity;
|
|
414
|
-
} else if ("number" !== typeof this.end) {
|
|
415
|
-
throw TypeError("end must be a Number");
|
|
416
|
-
}
|
|
417
|
-
if (this.start > this.end) {
|
|
418
|
-
throw new Error("start must be <= end");
|
|
419
|
-
}
|
|
420
|
-
this.pos = this.start;
|
|
421
|
-
}
|
|
422
|
-
if (this.fd !== null) {
|
|
423
|
-
process.nextTick(function() {
|
|
424
|
-
self._read();
|
|
425
|
-
});
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
fs2.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
429
|
-
if (err) {
|
|
430
|
-
self.emit("error", err);
|
|
431
|
-
self.readable = false;
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
self.fd = fd;
|
|
435
|
-
self.emit("open", fd);
|
|
436
|
-
self._read();
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
function WriteStream(path, options) {
|
|
440
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
441
|
-
Stream.call(this);
|
|
442
|
-
this.path = path;
|
|
443
|
-
this.fd = null;
|
|
444
|
-
this.writable = true;
|
|
445
|
-
this.flags = "w";
|
|
446
|
-
this.encoding = "binary";
|
|
447
|
-
this.mode = 438;
|
|
448
|
-
this.bytesWritten = 0;
|
|
449
|
-
options = options || {};
|
|
450
|
-
var keys = Object.keys(options);
|
|
451
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
452
|
-
var key = keys[index];
|
|
453
|
-
this[key] = options[key];
|
|
454
|
-
}
|
|
455
|
-
if (this.start !== void 0) {
|
|
456
|
-
if ("number" !== typeof this.start) {
|
|
457
|
-
throw TypeError("start must be a Number");
|
|
458
|
-
}
|
|
459
|
-
if (this.start < 0) {
|
|
460
|
-
throw new Error("start must be >= zero");
|
|
461
|
-
}
|
|
462
|
-
this.pos = this.start;
|
|
463
|
-
}
|
|
464
|
-
this.busy = false;
|
|
465
|
-
this._queue = [];
|
|
466
|
-
if (this.fd === null) {
|
|
467
|
-
this._open = fs2.open;
|
|
468
|
-
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
469
|
-
this.flush();
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
// node_modules/graceful-fs/clone.js
|
|
477
|
-
var require_clone = __commonJS({
|
|
478
|
-
"node_modules/graceful-fs/clone.js"(exports2, module2) {
|
|
479
|
-
"use strict";
|
|
480
|
-
module2.exports = clone;
|
|
481
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
482
|
-
return obj.__proto__;
|
|
483
|
-
};
|
|
484
|
-
function clone(obj) {
|
|
485
|
-
if (obj === null || typeof obj !== "object")
|
|
486
|
-
return obj;
|
|
487
|
-
if (obj instanceof Object)
|
|
488
|
-
var copy = { __proto__: getPrototypeOf(obj) };
|
|
489
|
-
else
|
|
490
|
-
var copy = /* @__PURE__ */ Object.create(null);
|
|
491
|
-
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
492
|
-
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
493
|
-
});
|
|
494
|
-
return copy;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
// node_modules/graceful-fs/graceful-fs.js
|
|
500
|
-
var require_graceful_fs = __commonJS({
|
|
501
|
-
"node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
502
|
-
var fs2 = require("fs");
|
|
503
|
-
var polyfills = require_polyfills();
|
|
504
|
-
var legacy = require_legacy_streams();
|
|
505
|
-
var clone = require_clone();
|
|
506
|
-
var util = require("util");
|
|
507
|
-
var gracefulQueue;
|
|
508
|
-
var previousSymbol;
|
|
509
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
510
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
511
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
512
|
-
} else {
|
|
513
|
-
gracefulQueue = "___graceful-fs.queue";
|
|
514
|
-
previousSymbol = "___graceful-fs.previous";
|
|
515
|
-
}
|
|
516
|
-
function noop() {
|
|
517
|
-
}
|
|
518
|
-
function publishQueue(context, queue2) {
|
|
519
|
-
Object.defineProperty(context, gracefulQueue, {
|
|
520
|
-
get: function() {
|
|
521
|
-
return queue2;
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
var debug = noop;
|
|
526
|
-
if (util.debuglog)
|
|
527
|
-
debug = util.debuglog("gfs4");
|
|
528
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
529
|
-
debug = function() {
|
|
530
|
-
var m = util.format.apply(util, arguments);
|
|
531
|
-
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
532
|
-
console.error(m);
|
|
533
|
-
};
|
|
534
|
-
if (!fs2[gracefulQueue]) {
|
|
535
|
-
queue = global[gracefulQueue] || [];
|
|
536
|
-
publishQueue(fs2, queue);
|
|
537
|
-
fs2.close = function(fs$close) {
|
|
538
|
-
function close(fd, cb) {
|
|
539
|
-
return fs$close.call(fs2, fd, function(err) {
|
|
540
|
-
if (!err) {
|
|
541
|
-
resetQueue();
|
|
542
|
-
}
|
|
543
|
-
if (typeof cb === "function")
|
|
544
|
-
cb.apply(this, arguments);
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
Object.defineProperty(close, previousSymbol, {
|
|
548
|
-
value: fs$close
|
|
549
|
-
});
|
|
550
|
-
return close;
|
|
551
|
-
}(fs2.close);
|
|
552
|
-
fs2.closeSync = function(fs$closeSync) {
|
|
553
|
-
function closeSync(fd) {
|
|
554
|
-
fs$closeSync.apply(fs2, arguments);
|
|
555
|
-
resetQueue();
|
|
556
|
-
}
|
|
557
|
-
Object.defineProperty(closeSync, previousSymbol, {
|
|
558
|
-
value: fs$closeSync
|
|
559
|
-
});
|
|
560
|
-
return closeSync;
|
|
561
|
-
}(fs2.closeSync);
|
|
562
|
-
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
563
|
-
process.on("exit", function() {
|
|
564
|
-
debug(fs2[gracefulQueue]);
|
|
565
|
-
require("assert").equal(fs2[gracefulQueue].length, 0);
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
var queue;
|
|
570
|
-
if (!global[gracefulQueue]) {
|
|
571
|
-
publishQueue(global, fs2[gracefulQueue]);
|
|
572
|
-
}
|
|
573
|
-
module2.exports = patch(clone(fs2));
|
|
574
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) {
|
|
575
|
-
module2.exports = patch(fs2);
|
|
576
|
-
fs2.__patched = true;
|
|
577
|
-
}
|
|
578
|
-
function patch(fs3) {
|
|
579
|
-
polyfills(fs3);
|
|
580
|
-
fs3.gracefulify = patch;
|
|
581
|
-
fs3.createReadStream = createReadStream;
|
|
582
|
-
fs3.createWriteStream = createWriteStream;
|
|
583
|
-
var fs$readFile = fs3.readFile;
|
|
584
|
-
fs3.readFile = readFile;
|
|
585
|
-
function readFile(path, options, cb) {
|
|
586
|
-
if (typeof options === "function")
|
|
587
|
-
cb = options, options = null;
|
|
588
|
-
return go$readFile(path, options, cb);
|
|
589
|
-
function go$readFile(path2, options2, cb2, startTime) {
|
|
590
|
-
return fs$readFile(path2, options2, function(err) {
|
|
591
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
592
|
-
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
593
|
-
else {
|
|
594
|
-
if (typeof cb2 === "function")
|
|
595
|
-
cb2.apply(this, arguments);
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
var fs$writeFile = fs3.writeFile;
|
|
601
|
-
fs3.writeFile = writeFile;
|
|
602
|
-
function writeFile(path, data, options, cb) {
|
|
603
|
-
if (typeof options === "function")
|
|
604
|
-
cb = options, options = null;
|
|
605
|
-
return go$writeFile(path, data, options, cb);
|
|
606
|
-
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
|
607
|
-
return fs$writeFile(path2, data2, options2, function(err) {
|
|
608
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
609
|
-
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
610
|
-
else {
|
|
611
|
-
if (typeof cb2 === "function")
|
|
612
|
-
cb2.apply(this, arguments);
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
var fs$appendFile = fs3.appendFile;
|
|
618
|
-
if (fs$appendFile)
|
|
619
|
-
fs3.appendFile = appendFile;
|
|
620
|
-
function appendFile(path, data, options, cb) {
|
|
621
|
-
if (typeof options === "function")
|
|
622
|
-
cb = options, options = null;
|
|
623
|
-
return go$appendFile(path, data, options, cb);
|
|
624
|
-
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
|
625
|
-
return fs$appendFile(path2, data2, options2, function(err) {
|
|
626
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
627
|
-
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
628
|
-
else {
|
|
629
|
-
if (typeof cb2 === "function")
|
|
630
|
-
cb2.apply(this, arguments);
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
var fs$copyFile = fs3.copyFile;
|
|
636
|
-
if (fs$copyFile)
|
|
637
|
-
fs3.copyFile = copyFile;
|
|
638
|
-
function copyFile(src, dest, flags, cb) {
|
|
639
|
-
if (typeof flags === "function") {
|
|
640
|
-
cb = flags;
|
|
641
|
-
flags = 0;
|
|
642
|
-
}
|
|
643
|
-
return go$copyFile(src, dest, flags, cb);
|
|
644
|
-
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
645
|
-
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
646
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
647
|
-
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
648
|
-
else {
|
|
649
|
-
if (typeof cb2 === "function")
|
|
650
|
-
cb2.apply(this, arguments);
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
var fs$readdir = fs3.readdir;
|
|
656
|
-
fs3.readdir = readdir;
|
|
657
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
658
|
-
function readdir(path, options, cb) {
|
|
659
|
-
if (typeof options === "function")
|
|
660
|
-
cb = options, options = null;
|
|
661
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
|
662
|
-
return fs$readdir(path2, fs$readdirCallback(
|
|
663
|
-
path2,
|
|
664
|
-
options2,
|
|
665
|
-
cb2,
|
|
666
|
-
startTime
|
|
667
|
-
));
|
|
668
|
-
} : function go$readdir2(path2, options2, cb2, startTime) {
|
|
669
|
-
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
670
|
-
path2,
|
|
671
|
-
options2,
|
|
672
|
-
cb2,
|
|
673
|
-
startTime
|
|
674
|
-
));
|
|
675
|
-
};
|
|
676
|
-
return go$readdir(path, options, cb);
|
|
677
|
-
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
678
|
-
return function(err, files) {
|
|
679
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
680
|
-
enqueue([
|
|
681
|
-
go$readdir,
|
|
682
|
-
[path2, options2, cb2],
|
|
683
|
-
err,
|
|
684
|
-
startTime || Date.now(),
|
|
685
|
-
Date.now()
|
|
686
|
-
]);
|
|
687
|
-
else {
|
|
688
|
-
if (files && files.sort)
|
|
689
|
-
files.sort();
|
|
690
|
-
if (typeof cb2 === "function")
|
|
691
|
-
cb2.call(this, err, files);
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
697
|
-
var legStreams = legacy(fs3);
|
|
698
|
-
ReadStream = legStreams.ReadStream;
|
|
699
|
-
WriteStream = legStreams.WriteStream;
|
|
700
|
-
}
|
|
701
|
-
var fs$ReadStream = fs3.ReadStream;
|
|
702
|
-
if (fs$ReadStream) {
|
|
703
|
-
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
704
|
-
ReadStream.prototype.open = ReadStream$open;
|
|
705
|
-
}
|
|
706
|
-
var fs$WriteStream = fs3.WriteStream;
|
|
707
|
-
if (fs$WriteStream) {
|
|
708
|
-
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
709
|
-
WriteStream.prototype.open = WriteStream$open;
|
|
710
|
-
}
|
|
711
|
-
Object.defineProperty(fs3, "ReadStream", {
|
|
712
|
-
get: function() {
|
|
713
|
-
return ReadStream;
|
|
714
|
-
},
|
|
715
|
-
set: function(val) {
|
|
716
|
-
ReadStream = val;
|
|
717
|
-
},
|
|
718
|
-
enumerable: true,
|
|
719
|
-
configurable: true
|
|
720
|
-
});
|
|
721
|
-
Object.defineProperty(fs3, "WriteStream", {
|
|
722
|
-
get: function() {
|
|
723
|
-
return WriteStream;
|
|
724
|
-
},
|
|
725
|
-
set: function(val) {
|
|
726
|
-
WriteStream = val;
|
|
727
|
-
},
|
|
728
|
-
enumerable: true,
|
|
729
|
-
configurable: true
|
|
730
|
-
});
|
|
731
|
-
var FileReadStream = ReadStream;
|
|
732
|
-
Object.defineProperty(fs3, "FileReadStream", {
|
|
733
|
-
get: function() {
|
|
734
|
-
return FileReadStream;
|
|
735
|
-
},
|
|
736
|
-
set: function(val) {
|
|
737
|
-
FileReadStream = val;
|
|
738
|
-
},
|
|
739
|
-
enumerable: true,
|
|
740
|
-
configurable: true
|
|
741
|
-
});
|
|
742
|
-
var FileWriteStream = WriteStream;
|
|
743
|
-
Object.defineProperty(fs3, "FileWriteStream", {
|
|
744
|
-
get: function() {
|
|
745
|
-
return FileWriteStream;
|
|
746
|
-
},
|
|
747
|
-
set: function(val) {
|
|
748
|
-
FileWriteStream = val;
|
|
749
|
-
},
|
|
750
|
-
enumerable: true,
|
|
751
|
-
configurable: true
|
|
752
|
-
});
|
|
753
|
-
function ReadStream(path, options) {
|
|
754
|
-
if (this instanceof ReadStream)
|
|
755
|
-
return fs$ReadStream.apply(this, arguments), this;
|
|
756
|
-
else
|
|
757
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
758
|
-
}
|
|
759
|
-
function ReadStream$open() {
|
|
760
|
-
var that = this;
|
|
761
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
762
|
-
if (err) {
|
|
763
|
-
if (that.autoClose)
|
|
764
|
-
that.destroy();
|
|
765
|
-
that.emit("error", err);
|
|
766
|
-
} else {
|
|
767
|
-
that.fd = fd;
|
|
768
|
-
that.emit("open", fd);
|
|
769
|
-
that.read();
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
}
|
|
773
|
-
function WriteStream(path, options) {
|
|
774
|
-
if (this instanceof WriteStream)
|
|
775
|
-
return fs$WriteStream.apply(this, arguments), this;
|
|
776
|
-
else
|
|
777
|
-
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
778
|
-
}
|
|
779
|
-
function WriteStream$open() {
|
|
780
|
-
var that = this;
|
|
781
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
782
|
-
if (err) {
|
|
783
|
-
that.destroy();
|
|
784
|
-
that.emit("error", err);
|
|
785
|
-
} else {
|
|
786
|
-
that.fd = fd;
|
|
787
|
-
that.emit("open", fd);
|
|
788
|
-
}
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
function createReadStream(path, options) {
|
|
792
|
-
return new fs3.ReadStream(path, options);
|
|
793
|
-
}
|
|
794
|
-
function createWriteStream(path, options) {
|
|
795
|
-
return new fs3.WriteStream(path, options);
|
|
796
|
-
}
|
|
797
|
-
var fs$open = fs3.open;
|
|
798
|
-
fs3.open = open;
|
|
799
|
-
function open(path, flags, mode, cb) {
|
|
800
|
-
if (typeof mode === "function")
|
|
801
|
-
cb = mode, mode = null;
|
|
802
|
-
return go$open(path, flags, mode, cb);
|
|
803
|
-
function go$open(path2, flags2, mode2, cb2, startTime) {
|
|
804
|
-
return fs$open(path2, flags2, mode2, function(err, fd) {
|
|
805
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
806
|
-
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
807
|
-
else {
|
|
808
|
-
if (typeof cb2 === "function")
|
|
809
|
-
cb2.apply(this, arguments);
|
|
810
|
-
}
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
return fs3;
|
|
815
|
-
}
|
|
816
|
-
function enqueue(elem) {
|
|
817
|
-
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
818
|
-
fs2[gracefulQueue].push(elem);
|
|
819
|
-
retry();
|
|
820
|
-
}
|
|
821
|
-
var retryTimer;
|
|
822
|
-
function resetQueue() {
|
|
823
|
-
var now = Date.now();
|
|
824
|
-
for (var i = 0; i < fs2[gracefulQueue].length; ++i) {
|
|
825
|
-
if (fs2[gracefulQueue][i].length > 2) {
|
|
826
|
-
fs2[gracefulQueue][i][3] = now;
|
|
827
|
-
fs2[gracefulQueue][i][4] = now;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
retry();
|
|
831
|
-
}
|
|
832
|
-
function retry() {
|
|
833
|
-
clearTimeout(retryTimer);
|
|
834
|
-
retryTimer = void 0;
|
|
835
|
-
if (fs2[gracefulQueue].length === 0)
|
|
836
|
-
return;
|
|
837
|
-
var elem = fs2[gracefulQueue].shift();
|
|
838
|
-
var fn = elem[0];
|
|
839
|
-
var args = elem[1];
|
|
840
|
-
var err = elem[2];
|
|
841
|
-
var startTime = elem[3];
|
|
842
|
-
var lastTime = elem[4];
|
|
843
|
-
if (startTime === void 0) {
|
|
844
|
-
debug("RETRY", fn.name, args);
|
|
845
|
-
fn.apply(null, args);
|
|
846
|
-
} else if (Date.now() - startTime >= 6e4) {
|
|
847
|
-
debug("TIMEOUT", fn.name, args);
|
|
848
|
-
var cb = args.pop();
|
|
849
|
-
if (typeof cb === "function")
|
|
850
|
-
cb.call(null, err);
|
|
851
|
-
} else {
|
|
852
|
-
var sinceAttempt = Date.now() - lastTime;
|
|
853
|
-
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
854
|
-
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
855
|
-
if (sinceAttempt >= desiredDelay) {
|
|
856
|
-
debug("RETRY", fn.name, args);
|
|
857
|
-
fn.apply(null, args.concat([startTime]));
|
|
858
|
-
} else {
|
|
859
|
-
fs2[gracefulQueue].push(elem);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
if (retryTimer === void 0) {
|
|
863
|
-
retryTimer = setTimeout(retry, 0);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
|
|
869
|
-
// node_modules/fs-extra/lib/fs/index.js
|
|
870
|
-
var require_fs = __commonJS({
|
|
871
|
-
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
872
|
-
"use strict";
|
|
873
|
-
var u = require_universalify().fromCallback;
|
|
874
|
-
var fs2 = require_graceful_fs();
|
|
875
|
-
var api = [
|
|
876
|
-
"access",
|
|
877
|
-
"appendFile",
|
|
878
|
-
"chmod",
|
|
879
|
-
"chown",
|
|
880
|
-
"close",
|
|
881
|
-
"copyFile",
|
|
882
|
-
"cp",
|
|
883
|
-
"fchmod",
|
|
884
|
-
"fchown",
|
|
885
|
-
"fdatasync",
|
|
886
|
-
"fstat",
|
|
887
|
-
"fsync",
|
|
888
|
-
"ftruncate",
|
|
889
|
-
"futimes",
|
|
890
|
-
"glob",
|
|
891
|
-
"lchmod",
|
|
892
|
-
"lchown",
|
|
893
|
-
"lutimes",
|
|
894
|
-
"link",
|
|
895
|
-
"lstat",
|
|
896
|
-
"mkdir",
|
|
897
|
-
"mkdtemp",
|
|
898
|
-
"open",
|
|
899
|
-
"opendir",
|
|
900
|
-
"readdir",
|
|
901
|
-
"readFile",
|
|
902
|
-
"readlink",
|
|
903
|
-
"realpath",
|
|
904
|
-
"rename",
|
|
905
|
-
"rm",
|
|
906
|
-
"rmdir",
|
|
907
|
-
"stat",
|
|
908
|
-
"statfs",
|
|
909
|
-
"symlink",
|
|
910
|
-
"truncate",
|
|
911
|
-
"unlink",
|
|
912
|
-
"utimes",
|
|
913
|
-
"writeFile"
|
|
914
|
-
].filter((key) => {
|
|
915
|
-
return typeof fs2[key] === "function";
|
|
916
|
-
});
|
|
917
|
-
Object.assign(exports2, fs2);
|
|
918
|
-
api.forEach((method) => {
|
|
919
|
-
exports2[method] = u(fs2[method]);
|
|
920
|
-
});
|
|
921
|
-
exports2.exists = function(filename, callback) {
|
|
922
|
-
if (typeof callback === "function") {
|
|
923
|
-
return fs2.exists(filename, callback);
|
|
924
|
-
}
|
|
925
|
-
return new Promise((resolve) => {
|
|
926
|
-
return fs2.exists(filename, resolve);
|
|
927
|
-
});
|
|
928
|
-
};
|
|
929
|
-
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
930
|
-
if (typeof callback === "function") {
|
|
931
|
-
return fs2.read(fd, buffer, offset, length, position, callback);
|
|
932
|
-
}
|
|
933
|
-
return new Promise((resolve, reject) => {
|
|
934
|
-
fs2.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
935
|
-
if (err) return reject(err);
|
|
936
|
-
resolve({ bytesRead, buffer: buffer2 });
|
|
937
|
-
});
|
|
938
|
-
});
|
|
939
|
-
};
|
|
940
|
-
exports2.write = function(fd, buffer, ...args) {
|
|
941
|
-
if (typeof args[args.length - 1] === "function") {
|
|
942
|
-
return fs2.write(fd, buffer, ...args);
|
|
943
|
-
}
|
|
944
|
-
return new Promise((resolve, reject) => {
|
|
945
|
-
fs2.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
946
|
-
if (err) return reject(err);
|
|
947
|
-
resolve({ bytesWritten, buffer: buffer2 });
|
|
948
|
-
});
|
|
949
|
-
});
|
|
950
|
-
};
|
|
951
|
-
exports2.readv = function(fd, buffers, ...args) {
|
|
952
|
-
if (typeof args[args.length - 1] === "function") {
|
|
953
|
-
return fs2.readv(fd, buffers, ...args);
|
|
954
|
-
}
|
|
955
|
-
return new Promise((resolve, reject) => {
|
|
956
|
-
fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
957
|
-
if (err) return reject(err);
|
|
958
|
-
resolve({ bytesRead, buffers: buffers2 });
|
|
959
|
-
});
|
|
960
|
-
});
|
|
961
|
-
};
|
|
962
|
-
exports2.writev = function(fd, buffers, ...args) {
|
|
963
|
-
if (typeof args[args.length - 1] === "function") {
|
|
964
|
-
return fs2.writev(fd, buffers, ...args);
|
|
965
|
-
}
|
|
966
|
-
return new Promise((resolve, reject) => {
|
|
967
|
-
fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
968
|
-
if (err) return reject(err);
|
|
969
|
-
resolve({ bytesWritten, buffers: buffers2 });
|
|
970
|
-
});
|
|
971
|
-
});
|
|
972
|
-
};
|
|
973
|
-
if (typeof fs2.realpath.native === "function") {
|
|
974
|
-
exports2.realpath.native = u(fs2.realpath.native);
|
|
975
|
-
} else {
|
|
976
|
-
process.emitWarning(
|
|
977
|
-
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
978
|
-
"Warning",
|
|
979
|
-
"fs-extra-WARN0003"
|
|
980
|
-
);
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
});
|
|
984
|
-
|
|
985
|
-
// node_modules/fs-extra/lib/mkdirs/utils.js
|
|
986
|
-
var require_utils = __commonJS({
|
|
987
|
-
"node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
988
|
-
"use strict";
|
|
989
|
-
var path = require("path");
|
|
990
|
-
module2.exports.checkPath = function checkPath(pth) {
|
|
991
|
-
if (process.platform === "win32") {
|
|
992
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
|
|
993
|
-
if (pathHasInvalidWinCharacters) {
|
|
994
|
-
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
995
|
-
error.code = "EINVAL";
|
|
996
|
-
throw error;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
}
|
|
1001
|
-
});
|
|
1002
|
-
|
|
1003
|
-
// node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
1004
|
-
var require_make_dir = __commonJS({
|
|
1005
|
-
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
1006
|
-
"use strict";
|
|
1007
|
-
var fs2 = require_fs();
|
|
1008
|
-
var { checkPath } = require_utils();
|
|
1009
|
-
var getMode = (options) => {
|
|
1010
|
-
const defaults = { mode: 511 };
|
|
1011
|
-
if (typeof options === "number") return options;
|
|
1012
|
-
return __spreadValues(__spreadValues({}, defaults), options).mode;
|
|
1013
|
-
};
|
|
1014
|
-
module2.exports.makeDir = (dir, options) => __async(null, null, function* () {
|
|
1015
|
-
checkPath(dir);
|
|
1016
|
-
return fs2.mkdir(dir, {
|
|
1017
|
-
mode: getMode(options),
|
|
1018
|
-
recursive: true
|
|
1019
|
-
});
|
|
1020
|
-
});
|
|
1021
|
-
module2.exports.makeDirSync = (dir, options) => {
|
|
1022
|
-
checkPath(dir);
|
|
1023
|
-
return fs2.mkdirSync(dir, {
|
|
1024
|
-
mode: getMode(options),
|
|
1025
|
-
recursive: true
|
|
1026
|
-
});
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
|
-
});
|
|
1030
|
-
|
|
1031
|
-
// node_modules/fs-extra/lib/mkdirs/index.js
|
|
1032
|
-
var require_mkdirs = __commonJS({
|
|
1033
|
-
"node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
|
|
1034
|
-
"use strict";
|
|
1035
|
-
var u = require_universalify().fromPromise;
|
|
1036
|
-
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
1037
|
-
var makeDir = u(_makeDir);
|
|
1038
|
-
module2.exports = {
|
|
1039
|
-
mkdirs: makeDir,
|
|
1040
|
-
mkdirsSync: makeDirSync,
|
|
1041
|
-
// alias
|
|
1042
|
-
mkdirp: makeDir,
|
|
1043
|
-
mkdirpSync: makeDirSync,
|
|
1044
|
-
ensureDir: makeDir,
|
|
1045
|
-
ensureDirSync: makeDirSync
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
|
|
1050
|
-
// node_modules/fs-extra/lib/path-exists/index.js
|
|
1051
|
-
var require_path_exists = __commonJS({
|
|
1052
|
-
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
1053
|
-
"use strict";
|
|
1054
|
-
var u = require_universalify().fromPromise;
|
|
1055
|
-
var fs2 = require_fs();
|
|
1056
|
-
function pathExists(path) {
|
|
1057
|
-
return fs2.access(path).then(() => true).catch(() => false);
|
|
1058
|
-
}
|
|
1059
|
-
module2.exports = {
|
|
1060
|
-
pathExists: u(pathExists),
|
|
1061
|
-
pathExistsSync: fs2.existsSync
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
|
|
1066
|
-
// node_modules/fs-extra/lib/util/utimes.js
|
|
1067
|
-
var require_utimes = __commonJS({
|
|
1068
|
-
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
1069
|
-
"use strict";
|
|
1070
|
-
var fs2 = require_fs();
|
|
1071
|
-
var u = require_universalify().fromPromise;
|
|
1072
|
-
function utimesMillis(path, atime, mtime) {
|
|
1073
|
-
return __async(this, null, function* () {
|
|
1074
|
-
const fd = yield fs2.open(path, "r+");
|
|
1075
|
-
let closeErr = null;
|
|
1076
|
-
try {
|
|
1077
|
-
yield fs2.futimes(fd, atime, mtime);
|
|
1078
|
-
} finally {
|
|
1079
|
-
try {
|
|
1080
|
-
yield fs2.close(fd);
|
|
1081
|
-
} catch (e) {
|
|
1082
|
-
closeErr = e;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
if (closeErr) {
|
|
1086
|
-
throw closeErr;
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
function utimesMillisSync(path, atime, mtime) {
|
|
1091
|
-
const fd = fs2.openSync(path, "r+");
|
|
1092
|
-
fs2.futimesSync(fd, atime, mtime);
|
|
1093
|
-
return fs2.closeSync(fd);
|
|
1094
|
-
}
|
|
1095
|
-
module2.exports = {
|
|
1096
|
-
utimesMillis: u(utimesMillis),
|
|
1097
|
-
utimesMillisSync
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
// node_modules/fs-extra/lib/util/stat.js
|
|
1103
|
-
var require_stat = __commonJS({
|
|
1104
|
-
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1105
|
-
"use strict";
|
|
1106
|
-
var fs2 = require_fs();
|
|
1107
|
-
var path = require("path");
|
|
1108
|
-
var u = require_universalify().fromPromise;
|
|
1109
|
-
function getStats(src, dest, opts) {
|
|
1110
|
-
const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true });
|
|
1111
|
-
return Promise.all([
|
|
1112
|
-
statFunc(src),
|
|
1113
|
-
statFunc(dest).catch((err) => {
|
|
1114
|
-
if (err.code === "ENOENT") return null;
|
|
1115
|
-
throw err;
|
|
1116
|
-
})
|
|
1117
|
-
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
|
1118
|
-
}
|
|
1119
|
-
function getStatsSync(src, dest, opts) {
|
|
1120
|
-
let destStat;
|
|
1121
|
-
const statFunc = opts.dereference ? (file) => fs2.statSync(file, { bigint: true }) : (file) => fs2.lstatSync(file, { bigint: true });
|
|
1122
|
-
const srcStat = statFunc(src);
|
|
1123
|
-
try {
|
|
1124
|
-
destStat = statFunc(dest);
|
|
1125
|
-
} catch (err) {
|
|
1126
|
-
if (err.code === "ENOENT") return { srcStat, destStat: null };
|
|
1127
|
-
throw err;
|
|
1128
|
-
}
|
|
1129
|
-
return { srcStat, destStat };
|
|
1130
|
-
}
|
|
1131
|
-
function checkPaths(src, dest, funcName, opts) {
|
|
1132
|
-
return __async(this, null, function* () {
|
|
1133
|
-
const { srcStat, destStat } = yield getStats(src, dest, opts);
|
|
1134
|
-
if (destStat) {
|
|
1135
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1136
|
-
const srcBaseName = path.basename(src);
|
|
1137
|
-
const destBaseName = path.basename(dest);
|
|
1138
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1139
|
-
return { srcStat, destStat, isChangingCase: true };
|
|
1140
|
-
}
|
|
1141
|
-
throw new Error("Source and destination must not be the same.");
|
|
1142
|
-
}
|
|
1143
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1144
|
-
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1145
|
-
}
|
|
1146
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1147
|
-
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1151
|
-
throw new Error(errMsg(src, dest, funcName));
|
|
1152
|
-
}
|
|
1153
|
-
return { srcStat, destStat };
|
|
1154
|
-
});
|
|
1155
|
-
}
|
|
1156
|
-
function checkPathsSync(src, dest, funcName, opts) {
|
|
1157
|
-
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1158
|
-
if (destStat) {
|
|
1159
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1160
|
-
const srcBaseName = path.basename(src);
|
|
1161
|
-
const destBaseName = path.basename(dest);
|
|
1162
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1163
|
-
return { srcStat, destStat, isChangingCase: true };
|
|
1164
|
-
}
|
|
1165
|
-
throw new Error("Source and destination must not be the same.");
|
|
1166
|
-
}
|
|
1167
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1168
|
-
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1169
|
-
}
|
|
1170
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1171
|
-
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1175
|
-
throw new Error(errMsg(src, dest, funcName));
|
|
1176
|
-
}
|
|
1177
|
-
return { srcStat, destStat };
|
|
1178
|
-
}
|
|
1179
|
-
function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1180
|
-
return __async(this, null, function* () {
|
|
1181
|
-
const srcParent = path.resolve(path.dirname(src));
|
|
1182
|
-
const destParent = path.resolve(path.dirname(dest));
|
|
1183
|
-
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
|
1184
|
-
let destStat;
|
|
1185
|
-
try {
|
|
1186
|
-
destStat = yield fs2.stat(destParent, { bigint: true });
|
|
1187
|
-
} catch (err) {
|
|
1188
|
-
if (err.code === "ENOENT") return;
|
|
1189
|
-
throw err;
|
|
1190
|
-
}
|
|
1191
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1192
|
-
throw new Error(errMsg(src, dest, funcName));
|
|
1193
|
-
}
|
|
1194
|
-
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1198
|
-
const srcParent = path.resolve(path.dirname(src));
|
|
1199
|
-
const destParent = path.resolve(path.dirname(dest));
|
|
1200
|
-
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
|
1201
|
-
let destStat;
|
|
1202
|
-
try {
|
|
1203
|
-
destStat = fs2.statSync(destParent, { bigint: true });
|
|
1204
|
-
} catch (err) {
|
|
1205
|
-
if (err.code === "ENOENT") return;
|
|
1206
|
-
throw err;
|
|
1207
|
-
}
|
|
1208
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1209
|
-
throw new Error(errMsg(src, dest, funcName));
|
|
1210
|
-
}
|
|
1211
|
-
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
1212
|
-
}
|
|
1213
|
-
function areIdentical(srcStat, destStat) {
|
|
1214
|
-
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1215
|
-
}
|
|
1216
|
-
function isSrcSubdir(src, dest) {
|
|
1217
|
-
const srcArr = path.resolve(src).split(path.sep).filter((i) => i);
|
|
1218
|
-
const destArr = path.resolve(dest).split(path.sep).filter((i) => i);
|
|
1219
|
-
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1220
|
-
}
|
|
1221
|
-
function errMsg(src, dest, funcName) {
|
|
1222
|
-
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
1223
|
-
}
|
|
1224
|
-
module2.exports = {
|
|
1225
|
-
// checkPaths
|
|
1226
|
-
checkPaths: u(checkPaths),
|
|
1227
|
-
checkPathsSync,
|
|
1228
|
-
// checkParent
|
|
1229
|
-
checkParentPaths: u(checkParentPaths),
|
|
1230
|
-
checkParentPathsSync,
|
|
1231
|
-
// Misc
|
|
1232
|
-
isSrcSubdir,
|
|
1233
|
-
areIdentical
|
|
1234
|
-
};
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
|
|
1238
|
-
// node_modules/fs-extra/lib/copy/copy.js
|
|
1239
|
-
var require_copy = __commonJS({
|
|
1240
|
-
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1241
|
-
"use strict";
|
|
1242
|
-
var fs2 = require_fs();
|
|
1243
|
-
var path = require("path");
|
|
1244
|
-
var { mkdirs } = require_mkdirs();
|
|
1245
|
-
var { pathExists } = require_path_exists();
|
|
1246
|
-
var { utimesMillis } = require_utimes();
|
|
1247
|
-
var stat = require_stat();
|
|
1248
|
-
function copy(_0, _1) {
|
|
1249
|
-
return __async(this, arguments, function* (src, dest, opts = {}) {
|
|
1250
|
-
if (typeof opts === "function") {
|
|
1251
|
-
opts = { filter: opts };
|
|
1252
|
-
}
|
|
1253
|
-
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1254
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1255
|
-
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1256
|
-
process.emitWarning(
|
|
1257
|
-
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1258
|
-
"Warning",
|
|
1259
|
-
"fs-extra-WARN0001"
|
|
1260
|
-
);
|
|
1261
|
-
}
|
|
1262
|
-
const { srcStat, destStat } = yield stat.checkPaths(src, dest, "copy", opts);
|
|
1263
|
-
yield stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1264
|
-
const include = yield runFilter(src, dest, opts);
|
|
1265
|
-
if (!include) return;
|
|
1266
|
-
const destParent = path.dirname(dest);
|
|
1267
|
-
const dirExists = yield pathExists(destParent);
|
|
1268
|
-
if (!dirExists) {
|
|
1269
|
-
yield mkdirs(destParent);
|
|
1270
|
-
}
|
|
1271
|
-
yield getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
1272
|
-
});
|
|
1273
|
-
}
|
|
1274
|
-
function runFilter(src, dest, opts) {
|
|
1275
|
-
return __async(this, null, function* () {
|
|
1276
|
-
if (!opts.filter) return true;
|
|
1277
|
-
return opts.filter(src, dest);
|
|
1278
|
-
});
|
|
1279
|
-
}
|
|
1280
|
-
function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1281
|
-
return __async(this, null, function* () {
|
|
1282
|
-
const statFn = opts.dereference ? fs2.stat : fs2.lstat;
|
|
1283
|
-
const srcStat = yield statFn(src);
|
|
1284
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1285
|
-
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
1286
|
-
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
1287
|
-
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1288
|
-
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1289
|
-
throw new Error(`Unknown file: ${src}`);
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
function onFile(srcStat, destStat, src, dest, opts) {
|
|
1293
|
-
return __async(this, null, function* () {
|
|
1294
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1295
|
-
if (opts.overwrite) {
|
|
1296
|
-
yield fs2.unlink(dest);
|
|
1297
|
-
return copyFile(srcStat, src, dest, opts);
|
|
1298
|
-
}
|
|
1299
|
-
if (opts.errorOnExist) {
|
|
1300
|
-
throw new Error(`'${dest}' already exists`);
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
function copyFile(srcStat, src, dest, opts) {
|
|
1305
|
-
return __async(this, null, function* () {
|
|
1306
|
-
yield fs2.copyFile(src, dest);
|
|
1307
|
-
if (opts.preserveTimestamps) {
|
|
1308
|
-
if (fileIsNotWritable(srcStat.mode)) {
|
|
1309
|
-
yield makeFileWritable(dest, srcStat.mode);
|
|
1310
|
-
}
|
|
1311
|
-
const updatedSrcStat = yield fs2.stat(src);
|
|
1312
|
-
yield utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1313
|
-
}
|
|
1314
|
-
return fs2.chmod(dest, srcStat.mode);
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
function fileIsNotWritable(srcMode) {
|
|
1318
|
-
return (srcMode & 128) === 0;
|
|
1319
|
-
}
|
|
1320
|
-
function makeFileWritable(dest, srcMode) {
|
|
1321
|
-
return fs2.chmod(dest, srcMode | 128);
|
|
1322
|
-
}
|
|
1323
|
-
function onDir(srcStat, destStat, src, dest, opts) {
|
|
1324
|
-
return __async(this, null, function* () {
|
|
1325
|
-
if (!destStat) {
|
|
1326
|
-
yield fs2.mkdir(dest);
|
|
1327
|
-
}
|
|
1328
|
-
const promises = [];
|
|
1329
|
-
try {
|
|
1330
|
-
for (var iter = __forAwait(yield fs2.opendir(src)), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
1331
|
-
const item = temp.value;
|
|
1332
|
-
const srcItem = path.join(src, item.name);
|
|
1333
|
-
const destItem = path.join(dest, item.name);
|
|
1334
|
-
promises.push(
|
|
1335
|
-
runFilter(srcItem, destItem, opts).then((include) => {
|
|
1336
|
-
if (include) {
|
|
1337
|
-
return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
|
|
1338
|
-
return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
|
1339
|
-
});
|
|
1340
|
-
}
|
|
1341
|
-
})
|
|
1342
|
-
);
|
|
1343
|
-
}
|
|
1344
|
-
} catch (temp) {
|
|
1345
|
-
error = [temp];
|
|
1346
|
-
} finally {
|
|
1347
|
-
try {
|
|
1348
|
-
more && (temp = iter.return) && (yield temp.call(iter));
|
|
1349
|
-
} finally {
|
|
1350
|
-
if (error)
|
|
1351
|
-
throw error[0];
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
yield Promise.all(promises);
|
|
1355
|
-
if (!destStat) {
|
|
1356
|
-
yield fs2.chmod(dest, srcStat.mode);
|
|
1357
|
-
}
|
|
1358
|
-
});
|
|
1359
|
-
}
|
|
1360
|
-
function onLink(destStat, src, dest, opts) {
|
|
1361
|
-
return __async(this, null, function* () {
|
|
1362
|
-
let resolvedSrc = yield fs2.readlink(src);
|
|
1363
|
-
if (opts.dereference) {
|
|
1364
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
1365
|
-
}
|
|
1366
|
-
if (!destStat) {
|
|
1367
|
-
return fs2.symlink(resolvedSrc, dest);
|
|
1368
|
-
}
|
|
1369
|
-
let resolvedDest = null;
|
|
1370
|
-
try {
|
|
1371
|
-
resolvedDest = yield fs2.readlink(dest);
|
|
1372
|
-
} catch (e) {
|
|
1373
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs2.symlink(resolvedSrc, dest);
|
|
1374
|
-
throw e;
|
|
1375
|
-
}
|
|
1376
|
-
if (opts.dereference) {
|
|
1377
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
1378
|
-
}
|
|
1379
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1380
|
-
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1381
|
-
}
|
|
1382
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1383
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1384
|
-
}
|
|
1385
|
-
yield fs2.unlink(dest);
|
|
1386
|
-
return fs2.symlink(resolvedSrc, dest);
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
module2.exports = copy;
|
|
1390
|
-
}
|
|
1391
|
-
});
|
|
1392
|
-
|
|
1393
|
-
// node_modules/fs-extra/lib/copy/copy-sync.js
|
|
1394
|
-
var require_copy_sync = __commonJS({
|
|
1395
|
-
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1396
|
-
"use strict";
|
|
1397
|
-
var fs2 = require_graceful_fs();
|
|
1398
|
-
var path = require("path");
|
|
1399
|
-
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1400
|
-
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1401
|
-
var stat = require_stat();
|
|
1402
|
-
function copySync(src, dest, opts) {
|
|
1403
|
-
if (typeof opts === "function") {
|
|
1404
|
-
opts = { filter: opts };
|
|
1405
|
-
}
|
|
1406
|
-
opts = opts || {};
|
|
1407
|
-
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1408
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1409
|
-
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1410
|
-
process.emitWarning(
|
|
1411
|
-
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1412
|
-
"Warning",
|
|
1413
|
-
"fs-extra-WARN0002"
|
|
1414
|
-
);
|
|
1415
|
-
}
|
|
1416
|
-
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1417
|
-
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1418
|
-
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1419
|
-
const destParent = path.dirname(dest);
|
|
1420
|
-
if (!fs2.existsSync(destParent)) mkdirsSync(destParent);
|
|
1421
|
-
return getStats(destStat, src, dest, opts);
|
|
1422
|
-
}
|
|
1423
|
-
function getStats(destStat, src, dest, opts) {
|
|
1424
|
-
const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync;
|
|
1425
|
-
const srcStat = statSync(src);
|
|
1426
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1427
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
1428
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
1429
|
-
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1430
|
-
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1431
|
-
throw new Error(`Unknown file: ${src}`);
|
|
1432
|
-
}
|
|
1433
|
-
function onFile(srcStat, destStat, src, dest, opts) {
|
|
1434
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1435
|
-
return mayCopyFile(srcStat, src, dest, opts);
|
|
1436
|
-
}
|
|
1437
|
-
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1438
|
-
if (opts.overwrite) {
|
|
1439
|
-
fs2.unlinkSync(dest);
|
|
1440
|
-
return copyFile(srcStat, src, dest, opts);
|
|
1441
|
-
} else if (opts.errorOnExist) {
|
|
1442
|
-
throw new Error(`'${dest}' already exists`);
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
function copyFile(srcStat, src, dest, opts) {
|
|
1446
|
-
fs2.copyFileSync(src, dest);
|
|
1447
|
-
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1448
|
-
return setDestMode(dest, srcStat.mode);
|
|
1449
|
-
}
|
|
1450
|
-
function handleTimestamps(srcMode, src, dest) {
|
|
1451
|
-
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
|
|
1452
|
-
return setDestTimestamps(src, dest);
|
|
1453
|
-
}
|
|
1454
|
-
function fileIsNotWritable(srcMode) {
|
|
1455
|
-
return (srcMode & 128) === 0;
|
|
1456
|
-
}
|
|
1457
|
-
function makeFileWritable(dest, srcMode) {
|
|
1458
|
-
return setDestMode(dest, srcMode | 128);
|
|
1459
|
-
}
|
|
1460
|
-
function setDestMode(dest, srcMode) {
|
|
1461
|
-
return fs2.chmodSync(dest, srcMode);
|
|
1462
|
-
}
|
|
1463
|
-
function setDestTimestamps(src, dest) {
|
|
1464
|
-
const updatedSrcStat = fs2.statSync(src);
|
|
1465
|
-
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1466
|
-
}
|
|
1467
|
-
function onDir(srcStat, destStat, src, dest, opts) {
|
|
1468
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
1469
|
-
return copyDir(src, dest, opts);
|
|
1470
|
-
}
|
|
1471
|
-
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1472
|
-
fs2.mkdirSync(dest);
|
|
1473
|
-
copyDir(src, dest, opts);
|
|
1474
|
-
return setDestMode(dest, srcMode);
|
|
1475
|
-
}
|
|
1476
|
-
function copyDir(src, dest, opts) {
|
|
1477
|
-
const dir = fs2.opendirSync(src);
|
|
1478
|
-
try {
|
|
1479
|
-
let dirent;
|
|
1480
|
-
while ((dirent = dir.readSync()) !== null) {
|
|
1481
|
-
copyDirItem(dirent.name, src, dest, opts);
|
|
1482
|
-
}
|
|
1483
|
-
} finally {
|
|
1484
|
-
dir.closeSync();
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
function copyDirItem(item, src, dest, opts) {
|
|
1488
|
-
const srcItem = path.join(src, item);
|
|
1489
|
-
const destItem = path.join(dest, item);
|
|
1490
|
-
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1491
|
-
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1492
|
-
return getStats(destStat, srcItem, destItem, opts);
|
|
1493
|
-
}
|
|
1494
|
-
function onLink(destStat, src, dest, opts) {
|
|
1495
|
-
let resolvedSrc = fs2.readlinkSync(src);
|
|
1496
|
-
if (opts.dereference) {
|
|
1497
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
1498
|
-
}
|
|
1499
|
-
if (!destStat) {
|
|
1500
|
-
return fs2.symlinkSync(resolvedSrc, dest);
|
|
1501
|
-
} else {
|
|
1502
|
-
let resolvedDest;
|
|
1503
|
-
try {
|
|
1504
|
-
resolvedDest = fs2.readlinkSync(dest);
|
|
1505
|
-
} catch (err) {
|
|
1506
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs2.symlinkSync(resolvedSrc, dest);
|
|
1507
|
-
throw err;
|
|
1508
|
-
}
|
|
1509
|
-
if (opts.dereference) {
|
|
1510
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
1511
|
-
}
|
|
1512
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1513
|
-
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1514
|
-
}
|
|
1515
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1516
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1517
|
-
}
|
|
1518
|
-
return copyLink(resolvedSrc, dest);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
function copyLink(resolvedSrc, dest) {
|
|
1522
|
-
fs2.unlinkSync(dest);
|
|
1523
|
-
return fs2.symlinkSync(resolvedSrc, dest);
|
|
1524
|
-
}
|
|
1525
|
-
module2.exports = copySync;
|
|
1526
|
-
}
|
|
1527
|
-
});
|
|
1528
|
-
|
|
1529
|
-
// node_modules/fs-extra/lib/copy/index.js
|
|
1530
|
-
var require_copy2 = __commonJS({
|
|
1531
|
-
"node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
|
|
1532
|
-
"use strict";
|
|
1533
|
-
var u = require_universalify().fromPromise;
|
|
1534
|
-
module2.exports = {
|
|
1535
|
-
copy: u(require_copy()),
|
|
1536
|
-
copySync: require_copy_sync()
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
});
|
|
1540
|
-
|
|
1541
|
-
// node_modules/fs-extra/lib/remove/index.js
|
|
1542
|
-
var require_remove = __commonJS({
|
|
1543
|
-
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
1544
|
-
"use strict";
|
|
1545
|
-
var fs2 = require_graceful_fs();
|
|
1546
|
-
var u = require_universalify().fromCallback;
|
|
1547
|
-
function remove(path, callback) {
|
|
1548
|
-
fs2.rm(path, { recursive: true, force: true }, callback);
|
|
1549
|
-
}
|
|
1550
|
-
function removeSync(path) {
|
|
1551
|
-
fs2.rmSync(path, { recursive: true, force: true });
|
|
1552
|
-
}
|
|
1553
|
-
module2.exports = {
|
|
1554
|
-
remove: u(remove),
|
|
1555
|
-
removeSync
|
|
1556
|
-
};
|
|
1557
|
-
}
|
|
1558
|
-
});
|
|
1559
|
-
|
|
1560
|
-
// node_modules/fs-extra/lib/empty/index.js
|
|
1561
|
-
var require_empty = __commonJS({
|
|
1562
|
-
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
1563
|
-
"use strict";
|
|
1564
|
-
var u = require_universalify().fromPromise;
|
|
1565
|
-
var fs2 = require_fs();
|
|
1566
|
-
var path = require("path");
|
|
1567
|
-
var mkdir = require_mkdirs();
|
|
1568
|
-
var remove = require_remove();
|
|
1569
|
-
var emptyDir = u(function emptyDir2(dir) {
|
|
1570
|
-
return __async(this, null, function* () {
|
|
1571
|
-
let items;
|
|
1572
|
-
try {
|
|
1573
|
-
items = yield fs2.readdir(dir);
|
|
1574
|
-
} catch (e) {
|
|
1575
|
-
return mkdir.mkdirs(dir);
|
|
1576
|
-
}
|
|
1577
|
-
return Promise.all(items.map((item) => remove.remove(path.join(dir, item))));
|
|
1578
|
-
});
|
|
1579
|
-
});
|
|
1580
|
-
function emptyDirSync(dir) {
|
|
1581
|
-
let items;
|
|
1582
|
-
try {
|
|
1583
|
-
items = fs2.readdirSync(dir);
|
|
1584
|
-
} catch (e) {
|
|
1585
|
-
return mkdir.mkdirsSync(dir);
|
|
1586
|
-
}
|
|
1587
|
-
items.forEach((item) => {
|
|
1588
|
-
item = path.join(dir, item);
|
|
1589
|
-
remove.removeSync(item);
|
|
1590
|
-
});
|
|
1591
|
-
}
|
|
1592
|
-
module2.exports = {
|
|
1593
|
-
emptyDirSync,
|
|
1594
|
-
emptydirSync: emptyDirSync,
|
|
1595
|
-
emptyDir,
|
|
1596
|
-
emptydir: emptyDir
|
|
1597
|
-
};
|
|
1598
|
-
}
|
|
1599
|
-
});
|
|
1600
|
-
|
|
1601
|
-
// node_modules/fs-extra/lib/ensure/file.js
|
|
1602
|
-
var require_file = __commonJS({
|
|
1603
|
-
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1604
|
-
"use strict";
|
|
1605
|
-
var u = require_universalify().fromPromise;
|
|
1606
|
-
var path = require("path");
|
|
1607
|
-
var fs2 = require_fs();
|
|
1608
|
-
var mkdir = require_mkdirs();
|
|
1609
|
-
function createFile(file) {
|
|
1610
|
-
return __async(this, null, function* () {
|
|
1611
|
-
let stats;
|
|
1612
|
-
try {
|
|
1613
|
-
stats = yield fs2.stat(file);
|
|
1614
|
-
} catch (e) {
|
|
1615
|
-
}
|
|
1616
|
-
if (stats && stats.isFile()) return;
|
|
1617
|
-
const dir = path.dirname(file);
|
|
1618
|
-
let dirStats = null;
|
|
1619
|
-
try {
|
|
1620
|
-
dirStats = yield fs2.stat(dir);
|
|
1621
|
-
} catch (err) {
|
|
1622
|
-
if (err.code === "ENOENT") {
|
|
1623
|
-
yield mkdir.mkdirs(dir);
|
|
1624
|
-
yield fs2.writeFile(file, "");
|
|
1625
|
-
return;
|
|
1626
|
-
} else {
|
|
1627
|
-
throw err;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
if (dirStats.isDirectory()) {
|
|
1631
|
-
yield fs2.writeFile(file, "");
|
|
1632
|
-
} else {
|
|
1633
|
-
yield fs2.readdir(dir);
|
|
1634
|
-
}
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
function createFileSync(file) {
|
|
1638
|
-
let stats;
|
|
1639
|
-
try {
|
|
1640
|
-
stats = fs2.statSync(file);
|
|
1641
|
-
} catch (e) {
|
|
1642
|
-
}
|
|
1643
|
-
if (stats && stats.isFile()) return;
|
|
1644
|
-
const dir = path.dirname(file);
|
|
1645
|
-
try {
|
|
1646
|
-
if (!fs2.statSync(dir).isDirectory()) {
|
|
1647
|
-
fs2.readdirSync(dir);
|
|
1648
|
-
}
|
|
1649
|
-
} catch (err) {
|
|
1650
|
-
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1651
|
-
else throw err;
|
|
1652
|
-
}
|
|
1653
|
-
fs2.writeFileSync(file, "");
|
|
1654
|
-
}
|
|
1655
|
-
module2.exports = {
|
|
1656
|
-
createFile: u(createFile),
|
|
1657
|
-
createFileSync
|
|
1658
|
-
};
|
|
1659
|
-
}
|
|
1660
|
-
});
|
|
1661
|
-
|
|
1662
|
-
// node_modules/fs-extra/lib/ensure/link.js
|
|
1663
|
-
var require_link = __commonJS({
|
|
1664
|
-
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1665
|
-
"use strict";
|
|
1666
|
-
var u = require_universalify().fromPromise;
|
|
1667
|
-
var path = require("path");
|
|
1668
|
-
var fs2 = require_fs();
|
|
1669
|
-
var mkdir = require_mkdirs();
|
|
1670
|
-
var { pathExists } = require_path_exists();
|
|
1671
|
-
var { areIdentical } = require_stat();
|
|
1672
|
-
function createLink(srcpath, dstpath) {
|
|
1673
|
-
return __async(this, null, function* () {
|
|
1674
|
-
let dstStat;
|
|
1675
|
-
try {
|
|
1676
|
-
dstStat = yield fs2.lstat(dstpath);
|
|
1677
|
-
} catch (e) {
|
|
1678
|
-
}
|
|
1679
|
-
let srcStat;
|
|
1680
|
-
try {
|
|
1681
|
-
srcStat = yield fs2.lstat(srcpath);
|
|
1682
|
-
} catch (err) {
|
|
1683
|
-
err.message = err.message.replace("lstat", "ensureLink");
|
|
1684
|
-
throw err;
|
|
1685
|
-
}
|
|
1686
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1687
|
-
const dir = path.dirname(dstpath);
|
|
1688
|
-
const dirExists = yield pathExists(dir);
|
|
1689
|
-
if (!dirExists) {
|
|
1690
|
-
yield mkdir.mkdirs(dir);
|
|
1691
|
-
}
|
|
1692
|
-
yield fs2.link(srcpath, dstpath);
|
|
1693
|
-
});
|
|
1694
|
-
}
|
|
1695
|
-
function createLinkSync(srcpath, dstpath) {
|
|
1696
|
-
let dstStat;
|
|
1697
|
-
try {
|
|
1698
|
-
dstStat = fs2.lstatSync(dstpath);
|
|
1699
|
-
} catch (e) {
|
|
1700
|
-
}
|
|
1701
|
-
try {
|
|
1702
|
-
const srcStat = fs2.lstatSync(srcpath);
|
|
1703
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1704
|
-
} catch (err) {
|
|
1705
|
-
err.message = err.message.replace("lstat", "ensureLink");
|
|
1706
|
-
throw err;
|
|
1707
|
-
}
|
|
1708
|
-
const dir = path.dirname(dstpath);
|
|
1709
|
-
const dirExists = fs2.existsSync(dir);
|
|
1710
|
-
if (dirExists) return fs2.linkSync(srcpath, dstpath);
|
|
1711
|
-
mkdir.mkdirsSync(dir);
|
|
1712
|
-
return fs2.linkSync(srcpath, dstpath);
|
|
1713
|
-
}
|
|
1714
|
-
module2.exports = {
|
|
1715
|
-
createLink: u(createLink),
|
|
1716
|
-
createLinkSync
|
|
1717
|
-
};
|
|
1718
|
-
}
|
|
1719
|
-
});
|
|
1720
|
-
|
|
1721
|
-
// node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
1722
|
-
var require_symlink_paths = __commonJS({
|
|
1723
|
-
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1724
|
-
"use strict";
|
|
1725
|
-
var path = require("path");
|
|
1726
|
-
var fs2 = require_fs();
|
|
1727
|
-
var { pathExists } = require_path_exists();
|
|
1728
|
-
var u = require_universalify().fromPromise;
|
|
1729
|
-
function symlinkPaths(srcpath, dstpath) {
|
|
1730
|
-
return __async(this, null, function* () {
|
|
1731
|
-
if (path.isAbsolute(srcpath)) {
|
|
1732
|
-
try {
|
|
1733
|
-
yield fs2.lstat(srcpath);
|
|
1734
|
-
} catch (err) {
|
|
1735
|
-
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1736
|
-
throw err;
|
|
1737
|
-
}
|
|
1738
|
-
return {
|
|
1739
|
-
toCwd: srcpath,
|
|
1740
|
-
toDst: srcpath
|
|
1741
|
-
};
|
|
1742
|
-
}
|
|
1743
|
-
const dstdir = path.dirname(dstpath);
|
|
1744
|
-
const relativeToDst = path.join(dstdir, srcpath);
|
|
1745
|
-
const exists = yield pathExists(relativeToDst);
|
|
1746
|
-
if (exists) {
|
|
1747
|
-
return {
|
|
1748
|
-
toCwd: relativeToDst,
|
|
1749
|
-
toDst: srcpath
|
|
1750
|
-
};
|
|
1751
|
-
}
|
|
1752
|
-
try {
|
|
1753
|
-
yield fs2.lstat(srcpath);
|
|
1754
|
-
} catch (err) {
|
|
1755
|
-
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1756
|
-
throw err;
|
|
1757
|
-
}
|
|
1758
|
-
return {
|
|
1759
|
-
toCwd: srcpath,
|
|
1760
|
-
toDst: path.relative(dstdir, srcpath)
|
|
1761
|
-
};
|
|
1762
|
-
});
|
|
1763
|
-
}
|
|
1764
|
-
function symlinkPathsSync(srcpath, dstpath) {
|
|
1765
|
-
if (path.isAbsolute(srcpath)) {
|
|
1766
|
-
const exists2 = fs2.existsSync(srcpath);
|
|
1767
|
-
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1768
|
-
return {
|
|
1769
|
-
toCwd: srcpath,
|
|
1770
|
-
toDst: srcpath
|
|
1771
|
-
};
|
|
1772
|
-
}
|
|
1773
|
-
const dstdir = path.dirname(dstpath);
|
|
1774
|
-
const relativeToDst = path.join(dstdir, srcpath);
|
|
1775
|
-
const exists = fs2.existsSync(relativeToDst);
|
|
1776
|
-
if (exists) {
|
|
1777
|
-
return {
|
|
1778
|
-
toCwd: relativeToDst,
|
|
1779
|
-
toDst: srcpath
|
|
1780
|
-
};
|
|
1781
|
-
}
|
|
1782
|
-
const srcExists = fs2.existsSync(srcpath);
|
|
1783
|
-
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1784
|
-
return {
|
|
1785
|
-
toCwd: srcpath,
|
|
1786
|
-
toDst: path.relative(dstdir, srcpath)
|
|
1787
|
-
};
|
|
1788
|
-
}
|
|
1789
|
-
module2.exports = {
|
|
1790
|
-
symlinkPaths: u(symlinkPaths),
|
|
1791
|
-
symlinkPathsSync
|
|
1792
|
-
};
|
|
1793
|
-
}
|
|
1794
|
-
});
|
|
1795
|
-
|
|
1796
|
-
// node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
1797
|
-
var require_symlink_type = __commonJS({
|
|
1798
|
-
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
1799
|
-
"use strict";
|
|
1800
|
-
var fs2 = require_fs();
|
|
1801
|
-
var u = require_universalify().fromPromise;
|
|
1802
|
-
function symlinkType(srcpath, type) {
|
|
1803
|
-
return __async(this, null, function* () {
|
|
1804
|
-
if (type) return type;
|
|
1805
|
-
let stats;
|
|
1806
|
-
try {
|
|
1807
|
-
stats = yield fs2.lstat(srcpath);
|
|
1808
|
-
} catch (e) {
|
|
1809
|
-
return "file";
|
|
1810
|
-
}
|
|
1811
|
-
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1812
|
-
});
|
|
1813
|
-
}
|
|
1814
|
-
function symlinkTypeSync(srcpath, type) {
|
|
1815
|
-
if (type) return type;
|
|
1816
|
-
let stats;
|
|
1817
|
-
try {
|
|
1818
|
-
stats = fs2.lstatSync(srcpath);
|
|
1819
|
-
} catch (e) {
|
|
1820
|
-
return "file";
|
|
1821
|
-
}
|
|
1822
|
-
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1823
|
-
}
|
|
1824
|
-
module2.exports = {
|
|
1825
|
-
symlinkType: u(symlinkType),
|
|
1826
|
-
symlinkTypeSync
|
|
1827
|
-
};
|
|
1828
|
-
}
|
|
1829
|
-
});
|
|
1830
|
-
|
|
1831
|
-
// node_modules/fs-extra/lib/ensure/symlink.js
|
|
1832
|
-
var require_symlink = __commonJS({
|
|
1833
|
-
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1834
|
-
"use strict";
|
|
1835
|
-
var u = require_universalify().fromPromise;
|
|
1836
|
-
var path = require("path");
|
|
1837
|
-
var fs2 = require_fs();
|
|
1838
|
-
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1839
|
-
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1840
|
-
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
1841
|
-
var { pathExists } = require_path_exists();
|
|
1842
|
-
var { areIdentical } = require_stat();
|
|
1843
|
-
function createSymlink(srcpath, dstpath, type) {
|
|
1844
|
-
return __async(this, null, function* () {
|
|
1845
|
-
let stats;
|
|
1846
|
-
try {
|
|
1847
|
-
stats = yield fs2.lstat(dstpath);
|
|
1848
|
-
} catch (e) {
|
|
1849
|
-
}
|
|
1850
|
-
if (stats && stats.isSymbolicLink()) {
|
|
1851
|
-
const [srcStat, dstStat] = yield Promise.all([
|
|
1852
|
-
fs2.stat(srcpath),
|
|
1853
|
-
fs2.stat(dstpath)
|
|
1854
|
-
]);
|
|
1855
|
-
if (areIdentical(srcStat, dstStat)) return;
|
|
1856
|
-
}
|
|
1857
|
-
const relative = yield symlinkPaths(srcpath, dstpath);
|
|
1858
|
-
srcpath = relative.toDst;
|
|
1859
|
-
const toType = yield symlinkType(relative.toCwd, type);
|
|
1860
|
-
const dir = path.dirname(dstpath);
|
|
1861
|
-
if (!(yield pathExists(dir))) {
|
|
1862
|
-
yield mkdirs(dir);
|
|
1863
|
-
}
|
|
1864
|
-
return fs2.symlink(srcpath, dstpath, toType);
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1868
|
-
let stats;
|
|
1869
|
-
try {
|
|
1870
|
-
stats = fs2.lstatSync(dstpath);
|
|
1871
|
-
} catch (e) {
|
|
1872
|
-
}
|
|
1873
|
-
if (stats && stats.isSymbolicLink()) {
|
|
1874
|
-
const srcStat = fs2.statSync(srcpath);
|
|
1875
|
-
const dstStat = fs2.statSync(dstpath);
|
|
1876
|
-
if (areIdentical(srcStat, dstStat)) return;
|
|
1877
|
-
}
|
|
1878
|
-
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1879
|
-
srcpath = relative.toDst;
|
|
1880
|
-
type = symlinkTypeSync(relative.toCwd, type);
|
|
1881
|
-
const dir = path.dirname(dstpath);
|
|
1882
|
-
const exists = fs2.existsSync(dir);
|
|
1883
|
-
if (exists) return fs2.symlinkSync(srcpath, dstpath, type);
|
|
1884
|
-
mkdirsSync(dir);
|
|
1885
|
-
return fs2.symlinkSync(srcpath, dstpath, type);
|
|
1886
|
-
}
|
|
1887
|
-
module2.exports = {
|
|
1888
|
-
createSymlink: u(createSymlink),
|
|
1889
|
-
createSymlinkSync
|
|
1890
|
-
};
|
|
1891
|
-
}
|
|
1892
|
-
});
|
|
1893
|
-
|
|
1894
|
-
// node_modules/fs-extra/lib/ensure/index.js
|
|
1895
|
-
var require_ensure = __commonJS({
|
|
1896
|
-
"node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
|
|
1897
|
-
"use strict";
|
|
1898
|
-
var { createFile, createFileSync } = require_file();
|
|
1899
|
-
var { createLink, createLinkSync } = require_link();
|
|
1900
|
-
var { createSymlink, createSymlinkSync } = require_symlink();
|
|
1901
|
-
module2.exports = {
|
|
1902
|
-
// file
|
|
1903
|
-
createFile,
|
|
1904
|
-
createFileSync,
|
|
1905
|
-
ensureFile: createFile,
|
|
1906
|
-
ensureFileSync: createFileSync,
|
|
1907
|
-
// link
|
|
1908
|
-
createLink,
|
|
1909
|
-
createLinkSync,
|
|
1910
|
-
ensureLink: createLink,
|
|
1911
|
-
ensureLinkSync: createLinkSync,
|
|
1912
|
-
// symlink
|
|
1913
|
-
createSymlink,
|
|
1914
|
-
createSymlinkSync,
|
|
1915
|
-
ensureSymlink: createSymlink,
|
|
1916
|
-
ensureSymlinkSync: createSymlinkSync
|
|
1917
|
-
};
|
|
1918
|
-
}
|
|
1919
|
-
});
|
|
1920
|
-
|
|
1921
|
-
// node_modules/jsonfile/utils.js
|
|
1922
|
-
var require_utils2 = __commonJS({
|
|
1923
|
-
"node_modules/jsonfile/utils.js"(exports2, module2) {
|
|
1924
|
-
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
1925
|
-
const EOF = finalEOL ? EOL : "";
|
|
1926
|
-
const str = JSON.stringify(obj, replacer, spaces);
|
|
1927
|
-
return str.replace(/\n/g, EOL) + EOF;
|
|
1928
|
-
}
|
|
1929
|
-
function stripBom(content) {
|
|
1930
|
-
if (Buffer.isBuffer(content)) content = content.toString("utf8");
|
|
1931
|
-
return content.replace(/^\uFEFF/, "");
|
|
1932
|
-
}
|
|
1933
|
-
module2.exports = { stringify, stripBom };
|
|
1934
|
-
}
|
|
1935
|
-
});
|
|
1936
|
-
|
|
1937
|
-
// node_modules/jsonfile/index.js
|
|
1938
|
-
var require_jsonfile = __commonJS({
|
|
1939
|
-
"node_modules/jsonfile/index.js"(exports2, module2) {
|
|
1940
|
-
var _fs;
|
|
1941
|
-
try {
|
|
1942
|
-
_fs = require_graceful_fs();
|
|
1943
|
-
} catch (_) {
|
|
1944
|
-
_fs = require("fs");
|
|
1945
|
-
}
|
|
1946
|
-
var universalify = require_universalify();
|
|
1947
|
-
var { stringify, stripBom } = require_utils2();
|
|
1948
|
-
function _readFile(_0) {
|
|
1949
|
-
return __async(this, arguments, function* (file, options = {}) {
|
|
1950
|
-
if (typeof options === "string") {
|
|
1951
|
-
options = { encoding: options };
|
|
1952
|
-
}
|
|
1953
|
-
const fs2 = options.fs || _fs;
|
|
1954
|
-
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1955
|
-
let data = yield universalify.fromCallback(fs2.readFile)(file, options);
|
|
1956
|
-
data = stripBom(data);
|
|
1957
|
-
let obj;
|
|
1958
|
-
try {
|
|
1959
|
-
obj = JSON.parse(data, options ? options.reviver : null);
|
|
1960
|
-
} catch (err) {
|
|
1961
|
-
if (shouldThrow) {
|
|
1962
|
-
err.message = `${file}: ${err.message}`;
|
|
1963
|
-
throw err;
|
|
1964
|
-
} else {
|
|
1965
|
-
return null;
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
return obj;
|
|
1969
|
-
});
|
|
1970
|
-
}
|
|
1971
|
-
var readFile = universalify.fromPromise(_readFile);
|
|
1972
|
-
function readFileSync(file, options = {}) {
|
|
1973
|
-
if (typeof options === "string") {
|
|
1974
|
-
options = { encoding: options };
|
|
1975
|
-
}
|
|
1976
|
-
const fs2 = options.fs || _fs;
|
|
1977
|
-
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1978
|
-
try {
|
|
1979
|
-
let content = fs2.readFileSync(file, options);
|
|
1980
|
-
content = stripBom(content);
|
|
1981
|
-
return JSON.parse(content, options.reviver);
|
|
1982
|
-
} catch (err) {
|
|
1983
|
-
if (shouldThrow) {
|
|
1984
|
-
err.message = `${file}: ${err.message}`;
|
|
1985
|
-
throw err;
|
|
1986
|
-
} else {
|
|
1987
|
-
return null;
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
function _writeFile(_0, _1) {
|
|
1992
|
-
return __async(this, arguments, function* (file, obj, options = {}) {
|
|
1993
|
-
const fs2 = options.fs || _fs;
|
|
1994
|
-
const str = stringify(obj, options);
|
|
1995
|
-
yield universalify.fromCallback(fs2.writeFile)(file, str, options);
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
1998
|
-
var writeFile = universalify.fromPromise(_writeFile);
|
|
1999
|
-
function writeFileSync(file, obj, options = {}) {
|
|
2000
|
-
const fs2 = options.fs || _fs;
|
|
2001
|
-
const str = stringify(obj, options);
|
|
2002
|
-
return fs2.writeFileSync(file, str, options);
|
|
2003
|
-
}
|
|
2004
|
-
var jsonfile = {
|
|
2005
|
-
readFile,
|
|
2006
|
-
readFileSync,
|
|
2007
|
-
writeFile,
|
|
2008
|
-
writeFileSync
|
|
2009
|
-
};
|
|
2010
|
-
module2.exports = jsonfile;
|
|
2011
|
-
}
|
|
2012
|
-
});
|
|
2013
|
-
|
|
2014
|
-
// node_modules/fs-extra/lib/json/jsonfile.js
|
|
2015
|
-
var require_jsonfile2 = __commonJS({
|
|
2016
|
-
"node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
|
|
2017
|
-
"use strict";
|
|
2018
|
-
var jsonFile = require_jsonfile();
|
|
2019
|
-
module2.exports = {
|
|
2020
|
-
// jsonfile exports
|
|
2021
|
-
readJson: jsonFile.readFile,
|
|
2022
|
-
readJsonSync: jsonFile.readFileSync,
|
|
2023
|
-
writeJson: jsonFile.writeFile,
|
|
2024
|
-
writeJsonSync: jsonFile.writeFileSync
|
|
2025
|
-
};
|
|
2026
|
-
}
|
|
2027
|
-
});
|
|
2028
|
-
|
|
2029
|
-
// node_modules/fs-extra/lib/output-file/index.js
|
|
2030
|
-
var require_output_file = __commonJS({
|
|
2031
|
-
"node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
2032
|
-
"use strict";
|
|
2033
|
-
var u = require_universalify().fromPromise;
|
|
2034
|
-
var fs2 = require_fs();
|
|
2035
|
-
var path = require("path");
|
|
2036
|
-
var mkdir = require_mkdirs();
|
|
2037
|
-
var pathExists = require_path_exists().pathExists;
|
|
2038
|
-
function outputFile2(file, data, encoding = "utf-8") {
|
|
2039
|
-
return __async(this, null, function* () {
|
|
2040
|
-
const dir = path.dirname(file);
|
|
2041
|
-
if (!(yield pathExists(dir))) {
|
|
2042
|
-
yield mkdir.mkdirs(dir);
|
|
2043
|
-
}
|
|
2044
|
-
return fs2.writeFile(file, data, encoding);
|
|
2045
|
-
});
|
|
2046
|
-
}
|
|
2047
|
-
function outputFileSync(file, ...args) {
|
|
2048
|
-
const dir = path.dirname(file);
|
|
2049
|
-
if (!fs2.existsSync(dir)) {
|
|
2050
|
-
mkdir.mkdirsSync(dir);
|
|
2051
|
-
}
|
|
2052
|
-
fs2.writeFileSync(file, ...args);
|
|
2053
|
-
}
|
|
2054
|
-
module2.exports = {
|
|
2055
|
-
outputFile: u(outputFile2),
|
|
2056
|
-
outputFileSync
|
|
2057
|
-
};
|
|
2058
|
-
}
|
|
2059
|
-
});
|
|
2060
|
-
|
|
2061
|
-
// node_modules/fs-extra/lib/json/output-json.js
|
|
2062
|
-
var require_output_json = __commonJS({
|
|
2063
|
-
"node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
|
|
2064
|
-
"use strict";
|
|
2065
|
-
var { stringify } = require_utils2();
|
|
2066
|
-
var { outputFile: outputFile2 } = require_output_file();
|
|
2067
|
-
function outputJson(_0, _1) {
|
|
2068
|
-
return __async(this, arguments, function* (file, data, options = {}) {
|
|
2069
|
-
const str = stringify(data, options);
|
|
2070
|
-
yield outputFile2(file, str, options);
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
module2.exports = outputJson;
|
|
2074
|
-
}
|
|
2075
|
-
});
|
|
2076
|
-
|
|
2077
|
-
// node_modules/fs-extra/lib/json/output-json-sync.js
|
|
2078
|
-
var require_output_json_sync = __commonJS({
|
|
2079
|
-
"node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
|
|
2080
|
-
"use strict";
|
|
2081
|
-
var { stringify } = require_utils2();
|
|
2082
|
-
var { outputFileSync } = require_output_file();
|
|
2083
|
-
function outputJsonSync(file, data, options) {
|
|
2084
|
-
const str = stringify(data, options);
|
|
2085
|
-
outputFileSync(file, str, options);
|
|
2086
|
-
}
|
|
2087
|
-
module2.exports = outputJsonSync;
|
|
2088
|
-
}
|
|
2089
|
-
});
|
|
2090
|
-
|
|
2091
|
-
// node_modules/fs-extra/lib/json/index.js
|
|
2092
|
-
var require_json = __commonJS({
|
|
2093
|
-
"node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
|
|
2094
|
-
"use strict";
|
|
2095
|
-
var u = require_universalify().fromPromise;
|
|
2096
|
-
var jsonFile = require_jsonfile2();
|
|
2097
|
-
jsonFile.outputJson = u(require_output_json());
|
|
2098
|
-
jsonFile.outputJsonSync = require_output_json_sync();
|
|
2099
|
-
jsonFile.outputJSON = jsonFile.outputJson;
|
|
2100
|
-
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
2101
|
-
jsonFile.writeJSON = jsonFile.writeJson;
|
|
2102
|
-
jsonFile.writeJSONSync = jsonFile.writeJsonSync;
|
|
2103
|
-
jsonFile.readJSON = jsonFile.readJson;
|
|
2104
|
-
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
2105
|
-
module2.exports = jsonFile;
|
|
2106
|
-
}
|
|
2107
|
-
});
|
|
2108
|
-
|
|
2109
|
-
// node_modules/fs-extra/lib/move/move.js
|
|
2110
|
-
var require_move = __commonJS({
|
|
2111
|
-
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2112
|
-
"use strict";
|
|
2113
|
-
var fs2 = require_fs();
|
|
2114
|
-
var path = require("path");
|
|
2115
|
-
var { copy } = require_copy2();
|
|
2116
|
-
var { remove } = require_remove();
|
|
2117
|
-
var { mkdirp } = require_mkdirs();
|
|
2118
|
-
var { pathExists } = require_path_exists();
|
|
2119
|
-
var stat = require_stat();
|
|
2120
|
-
function move(_0, _1) {
|
|
2121
|
-
return __async(this, arguments, function* (src, dest, opts = {}) {
|
|
2122
|
-
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2123
|
-
const { srcStat, isChangingCase = false } = yield stat.checkPaths(src, dest, "move", opts);
|
|
2124
|
-
yield stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2125
|
-
const destParent = path.dirname(dest);
|
|
2126
|
-
const parsedParentPath = path.parse(destParent);
|
|
2127
|
-
if (parsedParentPath.root !== destParent) {
|
|
2128
|
-
yield mkdirp(destParent);
|
|
2129
|
-
}
|
|
2130
|
-
return doRename(src, dest, overwrite, isChangingCase);
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
function doRename(src, dest, overwrite, isChangingCase) {
|
|
2134
|
-
return __async(this, null, function* () {
|
|
2135
|
-
if (!isChangingCase) {
|
|
2136
|
-
if (overwrite) {
|
|
2137
|
-
yield remove(dest);
|
|
2138
|
-
} else if (yield pathExists(dest)) {
|
|
2139
|
-
throw new Error("dest already exists.");
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
try {
|
|
2143
|
-
yield fs2.rename(src, dest);
|
|
2144
|
-
} catch (err) {
|
|
2145
|
-
if (err.code !== "EXDEV") {
|
|
2146
|
-
throw err;
|
|
2147
|
-
}
|
|
2148
|
-
yield moveAcrossDevice(src, dest, overwrite);
|
|
2149
|
-
}
|
|
2150
|
-
});
|
|
2151
|
-
}
|
|
2152
|
-
function moveAcrossDevice(src, dest, overwrite) {
|
|
2153
|
-
return __async(this, null, function* () {
|
|
2154
|
-
const opts = {
|
|
2155
|
-
overwrite,
|
|
2156
|
-
errorOnExist: true,
|
|
2157
|
-
preserveTimestamps: true
|
|
2158
|
-
};
|
|
2159
|
-
yield copy(src, dest, opts);
|
|
2160
|
-
return remove(src);
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
module2.exports = move;
|
|
2164
|
-
}
|
|
2165
|
-
});
|
|
2166
|
-
|
|
2167
|
-
// node_modules/fs-extra/lib/move/move-sync.js
|
|
2168
|
-
var require_move_sync = __commonJS({
|
|
2169
|
-
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2170
|
-
"use strict";
|
|
2171
|
-
var fs2 = require_graceful_fs();
|
|
2172
|
-
var path = require("path");
|
|
2173
|
-
var copySync = require_copy2().copySync;
|
|
2174
|
-
var removeSync = require_remove().removeSync;
|
|
2175
|
-
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
2176
|
-
var stat = require_stat();
|
|
2177
|
-
function moveSync(src, dest, opts) {
|
|
2178
|
-
opts = opts || {};
|
|
2179
|
-
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2180
|
-
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2181
|
-
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2182
|
-
if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest));
|
|
2183
|
-
return doRename(src, dest, overwrite, isChangingCase);
|
|
2184
|
-
}
|
|
2185
|
-
function isParentRoot(dest) {
|
|
2186
|
-
const parent = path.dirname(dest);
|
|
2187
|
-
const parsedPath = path.parse(parent);
|
|
2188
|
-
return parsedPath.root === parent;
|
|
2189
|
-
}
|
|
2190
|
-
function doRename(src, dest, overwrite, isChangingCase) {
|
|
2191
|
-
if (isChangingCase) return rename(src, dest, overwrite);
|
|
2192
|
-
if (overwrite) {
|
|
2193
|
-
removeSync(dest);
|
|
2194
|
-
return rename(src, dest, overwrite);
|
|
2195
|
-
}
|
|
2196
|
-
if (fs2.existsSync(dest)) throw new Error("dest already exists.");
|
|
2197
|
-
return rename(src, dest, overwrite);
|
|
2198
|
-
}
|
|
2199
|
-
function rename(src, dest, overwrite) {
|
|
2200
|
-
try {
|
|
2201
|
-
fs2.renameSync(src, dest);
|
|
2202
|
-
} catch (err) {
|
|
2203
|
-
if (err.code !== "EXDEV") throw err;
|
|
2204
|
-
return moveAcrossDevice(src, dest, overwrite);
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
function moveAcrossDevice(src, dest, overwrite) {
|
|
2208
|
-
const opts = {
|
|
2209
|
-
overwrite,
|
|
2210
|
-
errorOnExist: true,
|
|
2211
|
-
preserveTimestamps: true
|
|
2212
|
-
};
|
|
2213
|
-
copySync(src, dest, opts);
|
|
2214
|
-
return removeSync(src);
|
|
2215
|
-
}
|
|
2216
|
-
module2.exports = moveSync;
|
|
2217
|
-
}
|
|
2218
|
-
});
|
|
2219
|
-
|
|
2220
|
-
// node_modules/fs-extra/lib/move/index.js
|
|
2221
|
-
var require_move2 = __commonJS({
|
|
2222
|
-
"node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
|
|
2223
|
-
"use strict";
|
|
2224
|
-
var u = require_universalify().fromPromise;
|
|
2225
|
-
module2.exports = {
|
|
2226
|
-
move: u(require_move()),
|
|
2227
|
-
moveSync: require_move_sync()
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
});
|
|
2231
|
-
|
|
2232
|
-
// node_modules/fs-extra/lib/index.js
|
|
2233
|
-
var require_lib = __commonJS({
|
|
2234
|
-
"node_modules/fs-extra/lib/index.js"(exports2, module2) {
|
|
2235
|
-
"use strict";
|
|
2236
|
-
module2.exports = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, require_fs()), require_copy2()), require_empty()), require_ensure()), require_json()), require_mkdirs()), require_move2()), require_output_file()), require_path_exists()), require_remove());
|
|
2237
|
-
}
|
|
2238
|
-
});
|
|
2239
24
|
|
|
2240
25
|
// src/main.ts
|
|
2241
|
-
var
|
|
26
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
2242
27
|
var inputFile = process.argv[2];
|
|
2243
28
|
var outputFile = process.argv[3] || `${inputFile}.ts`;
|
|
2244
|
-
var input =
|
|
29
|
+
var input = import_fs.default.readFileSync(inputFile, "utf-8");
|
|
2245
30
|
var output = [];
|
|
2246
31
|
output.push("/*");
|
|
2247
32
|
output.push(` * Generated with game-data-gen on ${(/* @__PURE__ */ new Date()).toLocaleString()}. DO NOT MODIFY THIS FILE!`);
|
|
@@ -2255,7 +40,7 @@ for (const block of blocks) {
|
|
|
2255
40
|
output.push("");
|
|
2256
41
|
output.push("/*");
|
|
2257
42
|
output.push(` * ${"-".repeat(50)}`);
|
|
2258
|
-
output.push(` * ${name}`);
|
|
43
|
+
output.push(` * ${name} (${getTypeName(type)})`);
|
|
2259
44
|
output.push(` * ${"-".repeat(50)}`);
|
|
2260
45
|
output.push(" */");
|
|
2261
46
|
output.push("");
|
|
@@ -2382,4 +167,4 @@ function getTypeName(type) {
|
|
|
2382
167
|
function capitalize(str) {
|
|
2383
168
|
return `${str.substring(0, 1).toUpperCase()}${str.substring(1)}`;
|
|
2384
169
|
}
|
|
2385
|
-
|
|
170
|
+
import_fs.default.writeFileSync(outputFile, output.join("\n"));
|