@modern-js/utils 3.9.1 → 3.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/applyOptionsChain.js +1 -1
- package/dist/cjs/cli/get/config.js +1 -1
- package/dist/cjs/cli/get/data.js +1 -1
- package/dist/cjs/cli/require.js +2 -2
- package/dist/compiled/browserslist/index.js +37 -35
- package/dist/compiled/commander/index.js +2 -3
- package/dist/compiled/debug/index.js +1 -1
- package/dist/compiled/execa/index.js +8 -6
- package/dist/compiled/fs-extra/index.js +39 -35
- package/dist/compiled/glob/index.js +17 -15
- package/dist/compiled/inquirer/index.js +29 -25
- package/dist/compiled/js-yaml/index.js +17 -15
- package/dist/compiled/js-yaml/index.mjs +17 -15
- package/dist/compiled/minimist/index.js +1 -2
- package/dist/compiled/ora/index.js +17 -15
- package/dist/compiled/semver/index.js +12 -13
- package/dist/compiled/signale/index.js +3 -3
- package/dist/compiled/upath/index.js +15 -11
- package/dist/compiled/webpack-chain/index.js +5 -3
- package/dist/esm/cli/applyOptionsChain.mjs +1 -1
- package/dist/esm/cli/get/config.mjs +1 -1
- package/dist/esm/cli/get/data.mjs +1 -1
- package/dist/esm/cli/require.mjs +1 -1
- package/dist/esm-node/cli/applyOptionsChain.mjs +1 -1
- package/dist/esm-node/cli/get/config.mjs +1 -1
- package/dist/esm-node/cli/get/data.mjs +1 -1
- package/dist/esm-node/cli/require.mjs +1 -1
- package/package.json +4 -4
|
@@ -35,7 +35,7 @@ const external_logger_js_namespaceObject = require("./logger.js");
|
|
|
35
35
|
function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
|
|
36
36
|
if (!options) return defaults;
|
|
37
37
|
if ((0, index_js_namespaceObject.isPlainObject)(options)) return mergeFn(defaults, options);
|
|
38
|
-
if ((0, index_js_namespaceObject.isFunction)(options)) {
|
|
38
|
+
else if ((0, index_js_namespaceObject.isFunction)(options)) {
|
|
39
39
|
const ret = options(defaults, utils);
|
|
40
40
|
if (ret) {
|
|
41
41
|
if (!(0, index_js_namespaceObject.isPlainObject)(ret)) external_logger_js_namespaceObject.logger.warn(`${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`);
|
|
@@ -33,7 +33,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
const index_js_namespaceObject = require("../is/index.js");
|
|
34
34
|
const getEntryOptions = (name, isMainEntry, baseOptions, optionsByEntries, packageName)=>{
|
|
35
35
|
if (!optionsByEntries) return baseOptions;
|
|
36
|
-
{
|
|
36
|
+
else {
|
|
37
37
|
let optionsByEntry = getOptionsByEntryName(name, optionsByEntries);
|
|
38
38
|
if (void 0 === optionsByEntry && isMainEntry && packageName) optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
|
|
39
39
|
return void 0 !== optionsByEntry ? (0, index_js_namespaceObject.isPlainObject)(optionsByEntry) && (0, index_js_namespaceObject.isPlainObject)(baseOptions) ? {
|
package/dist/cjs/cli/get/data.js
CHANGED
package/dist/cjs/cli/require.js
CHANGED
|
@@ -41,7 +41,7 @@ const external_fs_js_namespaceObject = require("./fs.js");
|
|
|
41
41
|
async function importPath(path, options) {
|
|
42
42
|
const modulePath = (0, external_node_path_namespaceObject.isAbsolute)(path) ? (0, external_node_url_namespaceObject.pathToFileURL)(path).href : path;
|
|
43
43
|
if ('development' !== process.env.NODE_ENV) return await import(modulePath, options);
|
|
44
|
-
{
|
|
44
|
+
else {
|
|
45
45
|
const timestamp = Date.now();
|
|
46
46
|
return await import(`${modulePath}?t=${timestamp}`, options);
|
|
47
47
|
}
|
|
@@ -65,7 +65,7 @@ async function compatibleRequireCJS(path, interop = true) {
|
|
|
65
65
|
return interop && requiredModule?.__esModule ? requiredModule.default : requiredModule;
|
|
66
66
|
} catch (err) {
|
|
67
67
|
if ('ERR_REQUIRE_ESM' === err.code) return await compatibleRequireESM(path, interop);
|
|
68
|
-
throw err;
|
|
68
|
+
else throw err;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
async function compatibleRequire(path, interop = true) {
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
if (">" === e) return function(e) {
|
|
75
75
|
return parseFloat(e) > s;
|
|
76
76
|
};
|
|
77
|
-
if (">=" === e) return function(e) {
|
|
77
|
+
else if (">=" === e) return function(e) {
|
|
78
78
|
return parseFloat(e) >= s;
|
|
79
79
|
};
|
|
80
|
-
if ("<" === e) return function(e) {
|
|
80
|
+
else if ("<" === e) return function(e) {
|
|
81
81
|
return parseFloat(e) < s;
|
|
82
82
|
};
|
|
83
|
-
return function(e) {
|
|
83
|
+
else return function(e) {
|
|
84
84
|
return parseFloat(e) <= s;
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -92,15 +92,15 @@
|
|
|
92
92
|
e = e.split(".").map(parseSimpleInt);
|
|
93
93
|
return compareSemver(e, s) > 0;
|
|
94
94
|
};
|
|
95
|
-
if (">=" === e) return function(e) {
|
|
95
|
+
else if (">=" === e) return function(e) {
|
|
96
96
|
e = e.split(".").map(parseSimpleInt);
|
|
97
97
|
return compareSemver(e, s) >= 0;
|
|
98
98
|
};
|
|
99
|
-
if ("<" === e) return function(e) {
|
|
99
|
+
else if ("<" === e) return function(e) {
|
|
100
100
|
e = e.split(".").map(parseSimpleInt);
|
|
101
101
|
return compareSemver(s, e) > 0;
|
|
102
102
|
};
|
|
103
|
-
return function(e) {
|
|
103
|
+
else return function(e) {
|
|
104
104
|
e = e.split(".").map(parseSimpleInt);
|
|
105
105
|
return compareSemver(s, e) >= 0;
|
|
106
106
|
};
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
}
|
|
142
142
|
function resolveVersion(e, s) {
|
|
143
143
|
if (-1 !== e.versions.indexOf(s)) return s;
|
|
144
|
-
if (browserslist.versionAliases[e.name][s]) return browserslist.versionAliases[e.name][s];
|
|
145
|
-
return false;
|
|
144
|
+
else if (browserslist.versionAliases[e.name][s]) return browserslist.versionAliases[e.name][s];
|
|
145
|
+
else return false;
|
|
146
146
|
}
|
|
147
147
|
function normalizeVersion(e, s) {
|
|
148
148
|
var r = resolveVersion(e, s);
|
|
149
149
|
if (r) return r;
|
|
150
|
-
if (1 === e.versions.length) return e.versions[0];
|
|
151
|
-
return false;
|
|
150
|
+
else if (1 === e.versions.length) return e.versions[0];
|
|
151
|
+
else return false;
|
|
152
152
|
}
|
|
153
153
|
function filterByYear(e, s) {
|
|
154
154
|
e /= 1e3;
|
|
@@ -188,12 +188,14 @@
|
|
|
188
188
|
if (s.mobileToDesktop && browserslist.desktopNames[e]) {
|
|
189
189
|
var r = browserslist.data[browserslist.desktopNames[e]];
|
|
190
190
|
if ("android" === e) return normalizeAndroidData(cloneData(browserslist.data[e]), r);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
"
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
else {
|
|
192
|
+
var n = cloneData(r);
|
|
193
|
+
n.name = e;
|
|
194
|
+
if ("op_mob" === e) n = mapVersions(n, {
|
|
195
|
+
"10.0-10.1": "10"
|
|
196
|
+
});
|
|
197
|
+
return n;
|
|
198
|
+
}
|
|
197
199
|
}
|
|
198
200
|
return browserslist.data[e];
|
|
199
201
|
}
|
|
@@ -223,7 +225,7 @@
|
|
|
223
225
|
var t = n[n.length - 1];
|
|
224
226
|
var a = t - d - s;
|
|
225
227
|
if (a > 0) return e.slice(-1);
|
|
226
|
-
return e.slice(a - 1);
|
|
228
|
+
else return e.slice(a - 1);
|
|
227
229
|
}
|
|
228
230
|
function resolve(e, s) {
|
|
229
231
|
e = Array.isArray(e) ? flatten(e.map(parse)) : parse(e);
|
|
@@ -244,14 +246,14 @@
|
|
|
244
246
|
var d = o.select.apply(browserslist, u).map(function(e) {
|
|
245
247
|
var r = e.split(" ");
|
|
246
248
|
if ("0" === r[1]) return r[0] + " " + byName(r[0], s).versions[0];
|
|
247
|
-
return e;
|
|
249
|
+
else return e;
|
|
248
250
|
});
|
|
249
251
|
switch(r.type){
|
|
250
252
|
case v:
|
|
251
253
|
if (a) return e.filter(function(e) {
|
|
252
254
|
return -1 === d.indexOf(e);
|
|
253
255
|
});
|
|
254
|
-
return e.filter(function(e) {
|
|
256
|
+
else return e.filter(function(e) {
|
|
255
257
|
return -1 !== d.indexOf(e);
|
|
256
258
|
});
|
|
257
259
|
case c:
|
|
@@ -303,9 +305,11 @@
|
|
|
303
305
|
e = e.split(" ");
|
|
304
306
|
s = s.split(" ");
|
|
305
307
|
if (e[0] !== s[0]) return compare(e[0], s[0]);
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
308
|
+
else {
|
|
309
|
+
var r = e[1].split("-")[0];
|
|
310
|
+
var n = s[1].split("-")[0];
|
|
311
|
+
return compareSemver(n.split("."), r.split("."));
|
|
312
|
+
}
|
|
309
313
|
});
|
|
310
314
|
if (!process.env.BROWSERSLIST_DISABLE_CACHE) m[o] = u;
|
|
311
315
|
return u;
|
|
@@ -326,15 +330,13 @@
|
|
|
326
330
|
queryString: e.match(n)[1]
|
|
327
331
|
});
|
|
328
332
|
return true;
|
|
329
|
-
}
|
|
330
|
-
if (r.test(e)) {
|
|
333
|
+
} else if (r.test(e)) {
|
|
331
334
|
s.unshift({
|
|
332
335
|
type: c,
|
|
333
336
|
queryString: e.match(r)[1]
|
|
334
337
|
});
|
|
335
338
|
return true;
|
|
336
|
-
}
|
|
337
|
-
if (t === a) {
|
|
339
|
+
} else if (t === a) {
|
|
338
340
|
s.unshift({
|
|
339
341
|
type: c,
|
|
340
342
|
queryString: e.trim()
|
|
@@ -890,7 +892,7 @@
|
|
|
890
892
|
regexp: /^(\w+)$/i,
|
|
891
893
|
select: function(e, s) {
|
|
892
894
|
if (byName(s, e)) throw new l("Specify versions in Browserslist query for browser " + s);
|
|
893
|
-
throw unknownQuery(s);
|
|
895
|
+
else throw unknownQuery(s);
|
|
894
896
|
}
|
|
895
897
|
}
|
|
896
898
|
];
|
|
@@ -1057,12 +1059,12 @@
|
|
|
1057
1059
|
},
|
|
1058
1060
|
loadConfig: function(s) {
|
|
1059
1061
|
if (process.env.BROWSERSLIST) return process.env.BROWSERSLIST;
|
|
1060
|
-
if (s.config || process.env.BROWSERSLIST_CONFIG) {
|
|
1062
|
+
else if (s.config || process.env.BROWSERSLIST_CONFIG) {
|
|
1061
1063
|
var r = s.config || process.env.BROWSERSLIST_CONFIG;
|
|
1062
1064
|
if ("package.json" === a.basename(r)) return pickEnv(parsePackage(r), s);
|
|
1063
|
-
return pickEnv(e.exports.readConfig(r), s);
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1065
|
+
else return pickEnv(e.exports.readConfig(r), s);
|
|
1066
|
+
} else if (s.path) return pickEnv(e.exports.findConfig(s.path), s);
|
|
1067
|
+
else return;
|
|
1066
1068
|
},
|
|
1067
1069
|
loadCountry: function(e, s, r) {
|
|
1068
1070
|
var n = s.replace(/[^\w-]/g, "");
|
|
@@ -1127,10 +1129,10 @@
|
|
|
1127
1129
|
console.warn("[Browserslist] Could not parse " + t + ". Ignoring it.");
|
|
1128
1130
|
}
|
|
1129
1131
|
if (isFile(n) && l) throw new o(s + " contains both browserslist and package.json with browsers");
|
|
1130
|
-
if (isFile(i) && l) throw new o(s + " contains both .browserslistrc and package.json with browsers");
|
|
1131
|
-
if (isFile(n) && isFile(i)) throw new o(s + " contains both .browserslistrc and browserslist");
|
|
1132
|
-
if (isFile(n)) return e.exports.readConfig(n);
|
|
1133
|
-
if (isFile(i)) return e.exports.readConfig(i);
|
|
1132
|
+
else if (isFile(i) && l) throw new o(s + " contains both .browserslistrc and package.json with browsers");
|
|
1133
|
+
else if (isFile(n) && isFile(i)) throw new o(s + " contains both .browserslistrc and browserslist");
|
|
1134
|
+
else if (isFile(n)) return e.exports.readConfig(n);
|
|
1135
|
+
else if (isFile(i)) return e.exports.readConfig(i);
|
|
1134
1136
|
else return l;
|
|
1135
1137
|
});
|
|
1136
1138
|
if (!process.env.BROWSERSLIST_DISABLE_CACHE) r.forEach(function(e) {
|
|
@@ -557,8 +557,7 @@
|
|
|
557
557
|
const e = h ? `searched for local subcommand relative to directory '${h}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
558
558
|
const i = `'${l}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;
|
|
559
559
|
throw new Error(i);
|
|
560
|
-
}
|
|
561
|
-
if ("EACCES" === e.code) throw new Error(`'${l}' not executable`);
|
|
560
|
+
} else if ("EACCES" === e.code) throw new Error(`'${l}' not executable`);
|
|
562
561
|
if (p) {
|
|
563
562
|
const t = new u(1, "commander.executeSubCommandAsync", "(error)");
|
|
564
563
|
t.nestedError = e;
|
|
@@ -576,7 +575,7 @@
|
|
|
576
575
|
s = this._chainOrCallSubCommandHook(s, n, "preSubcommand");
|
|
577
576
|
s = this._chainOrCall(s, ()=>{
|
|
578
577
|
if (!n._executableHandler) return n._parseCommand(e, i);
|
|
579
|
-
this._executeSubCommand(n, e.concat(i));
|
|
578
|
+
else this._executeSubCommand(n, e.concat(i));
|
|
580
579
|
});
|
|
581
580
|
return s;
|
|
582
581
|
}
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
t = t || {};
|
|
448
448
|
var r = typeof e;
|
|
449
449
|
if ("string" === r && e.length > 0) return parse(e);
|
|
450
|
-
if ("number" === r && isFinite(e)) return t.long ? fmtLong(e) : fmtShort(e);
|
|
450
|
+
else if ("number" === r && isFinite(e)) return t.long ? fmtLong(e) : fmtShort(e);
|
|
451
451
|
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e));
|
|
452
452
|
};
|
|
453
453
|
function parse(e) {
|
|
@@ -1259,7 +1259,7 @@
|
|
|
1259
1259
|
return o.sync(e, t || {});
|
|
1260
1260
|
} catch (e) {
|
|
1261
1261
|
if (t && t.ignoreErrors || "EACCES" === e.code) return false;
|
|
1262
|
-
throw e;
|
|
1262
|
+
else throw e;
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
1265
|
},
|
|
@@ -1561,11 +1561,13 @@
|
|
|
1561
1561
|
var x = r.emit;
|
|
1562
1562
|
var h = function(e, t) {
|
|
1563
1563
|
if (!("exit" === e && processOk(global.process))) return x.apply(this, arguments);
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1564
|
+
else {
|
|
1565
|
+
if (void 0 !== t) r.exitCode = t;
|
|
1566
|
+
var n = x.apply(this, arguments);
|
|
1567
|
+
u("exit", r.exitCode, null);
|
|
1568
|
+
u("afterexit", r.exitCode, null);
|
|
1569
|
+
return n;
|
|
1570
|
+
}
|
|
1569
1571
|
};
|
|
1570
1572
|
} else e.exports = function() {
|
|
1571
1573
|
return function() {};
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
const o = i.dereference ? n.statSync : n.lstatSync;
|
|
34
34
|
const c = o(t);
|
|
35
35
|
if (c.isDirectory()) return onDir(c, e, t, r, i);
|
|
36
|
-
if (c.isFile() || c.isCharacterDevice() || c.isBlockDevice()) return onFile(c, e, t, r, i);
|
|
37
|
-
if (c.isSymbolicLink()) return onLink(e, t, r, i);
|
|
38
|
-
if (c.isSocket()) throw new Error(`Cannot copy a socket file: ${t}`);
|
|
39
|
-
if (c.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${t}`);
|
|
36
|
+
else if (c.isFile() || c.isCharacterDevice() || c.isBlockDevice()) return onFile(c, e, t, r, i);
|
|
37
|
+
else if (c.isSymbolicLink()) return onLink(e, t, r, i);
|
|
38
|
+
else if (c.isSocket()) throw new Error(`Cannot copy a socket file: ${t}`);
|
|
39
|
+
else if (c.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${t}`);
|
|
40
40
|
throw new Error(`Unknown file: ${t}`);
|
|
41
41
|
}
|
|
42
42
|
function onFile(e, t, r, n, i) {
|
|
@@ -47,8 +47,7 @@
|
|
|
47
47
|
if (i.overwrite) {
|
|
48
48
|
n.unlinkSync(r);
|
|
49
49
|
return copyFile(e, t, r, i);
|
|
50
|
-
}
|
|
51
|
-
if (i.errorOnExist) throw new Error(`'${r}' already exists`);
|
|
50
|
+
} else if (i.errorOnExist) throw new Error(`'${r}' already exists`);
|
|
52
51
|
}
|
|
53
52
|
function copyFile(e, t, r, i) {
|
|
54
53
|
n.copyFileSync(t, r);
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
let c = n.readlinkSync(t);
|
|
95
94
|
if (o.dereference) c = i.resolve(process.cwd(), c);
|
|
96
95
|
if (!e) return n.symlinkSync(c, r);
|
|
97
|
-
{
|
|
96
|
+
else {
|
|
98
97
|
let e;
|
|
99
98
|
try {
|
|
100
99
|
e = n.readlinkSync(r);
|
|
@@ -172,10 +171,10 @@
|
|
|
172
171
|
c(t, (n, c)=>{
|
|
173
172
|
if (n) return o(n);
|
|
174
173
|
if (c.isDirectory()) return onDir(c, e, t, r, i, o);
|
|
175
|
-
if (c.isFile() || c.isCharacterDevice() || c.isBlockDevice()) return onFile(c, e, t, r, i, o);
|
|
176
|
-
if (c.isSymbolicLink()) return onLink(e, t, r, i, o);
|
|
177
|
-
if (c.isSocket()) return o(new Error(`Cannot copy a socket file: ${t}`));
|
|
178
|
-
if (c.isFIFO()) return o(new Error(`Cannot copy a FIFO pipe: ${t}`));
|
|
174
|
+
else if (c.isFile() || c.isCharacterDevice() || c.isBlockDevice()) return onFile(c, e, t, r, i, o);
|
|
175
|
+
else if (c.isSymbolicLink()) return onLink(e, t, r, i, o);
|
|
176
|
+
else if (c.isSocket()) return o(new Error(`Cannot copy a socket file: ${t}`));
|
|
177
|
+
else if (c.isFIFO()) return o(new Error(`Cannot copy a FIFO pipe: ${t}`));
|
|
179
178
|
return o(new Error(`Unknown file: ${t}`));
|
|
180
179
|
});
|
|
181
180
|
}
|
|
@@ -267,7 +266,7 @@
|
|
|
267
266
|
if (t) return c(t);
|
|
268
267
|
if (o.dereference) s = i.resolve(process.cwd(), s);
|
|
269
268
|
if (!e) return n.symlink(s, r, c);
|
|
270
|
-
n.readlink(r, (t, u)=>{
|
|
269
|
+
else n.readlink(r, (t, u)=>{
|
|
271
270
|
if (t) {
|
|
272
271
|
if ("EINVAL" === t.code || "UNKNOWN" === t.code) return n.symlink(s, r, c);
|
|
273
272
|
return c(t);
|
|
@@ -474,7 +473,7 @@
|
|
|
474
473
|
toDst: e
|
|
475
474
|
});
|
|
476
475
|
});
|
|
477
|
-
{
|
|
476
|
+
else {
|
|
478
477
|
const c = n.dirname(t);
|
|
479
478
|
const s = n.join(c, e);
|
|
480
479
|
return o(s, (t, o)=>{
|
|
@@ -483,7 +482,7 @@
|
|
|
483
482
|
toCwd: s,
|
|
484
483
|
toDst: e
|
|
485
484
|
});
|
|
486
|
-
return i.lstat(e, (t)=>{
|
|
485
|
+
else return i.lstat(e, (t)=>{
|
|
487
486
|
if (t) {
|
|
488
487
|
t.message = t.message.replace("lstat", "ensureSymlink");
|
|
489
488
|
return r(t);
|
|
@@ -505,8 +504,7 @@
|
|
|
505
504
|
toCwd: e,
|
|
506
505
|
toDst: e
|
|
507
506
|
};
|
|
508
|
-
}
|
|
509
|
-
{
|
|
507
|
+
} else {
|
|
510
508
|
const o = n.dirname(t);
|
|
511
509
|
const c = n.join(o, e);
|
|
512
510
|
r = i.existsSync(c);
|
|
@@ -514,12 +512,14 @@
|
|
|
514
512
|
toCwd: c,
|
|
515
513
|
toDst: e
|
|
516
514
|
};
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
515
|
+
else {
|
|
516
|
+
r = i.existsSync(e);
|
|
517
|
+
if (!r) throw new Error("relative srcpath does not exist");
|
|
518
|
+
return {
|
|
519
|
+
toCwd: e,
|
|
520
|
+
toDst: n.relative(o, e)
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
e.exports = {
|
|
@@ -1103,13 +1103,13 @@
|
|
|
1103
1103
|
t.chmodSync(e, 438);
|
|
1104
1104
|
} catch (e) {
|
|
1105
1105
|
if ("ENOENT" === e.code) return;
|
|
1106
|
-
throw r;
|
|
1106
|
+
else throw r;
|
|
1107
1107
|
}
|
|
1108
1108
|
try {
|
|
1109
1109
|
n = t.statSync(e);
|
|
1110
1110
|
} catch (e) {
|
|
1111
1111
|
if ("ENOENT" === e.code) return;
|
|
1112
|
-
throw r;
|
|
1112
|
+
else throw r;
|
|
1113
1113
|
}
|
|
1114
1114
|
if (n.isDirectory()) rmdirSync(e, t, r);
|
|
1115
1115
|
else t.unlinkSync(e);
|
|
@@ -1160,8 +1160,8 @@
|
|
|
1160
1160
|
else t.unlinkSync(e);
|
|
1161
1161
|
} catch (r) {
|
|
1162
1162
|
if ("ENOENT" === r.code) return;
|
|
1163
|
-
if ("EPERM" === r.code) return c ? fixWinEPERMSync(e, t, r) : rmdirSync(e, t, r);
|
|
1164
|
-
if ("EISDIR" !== r.code) throw r;
|
|
1163
|
+
else if ("EPERM" === r.code) return c ? fixWinEPERMSync(e, t, r) : rmdirSync(e, t, r);
|
|
1164
|
+
else if ("EISDIR" !== r.code) throw r;
|
|
1165
1165
|
rmdirSync(e, t, r);
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
@@ -1172,7 +1172,7 @@
|
|
|
1172
1172
|
t.rmdirSync(e);
|
|
1173
1173
|
} catch (n) {
|
|
1174
1174
|
if ("ENOTDIR" === n.code) throw r;
|
|
1175
|
-
if ("ENOTEMPTY" === n.code || "EEXIST" === n.code || "EPERM" === n.code) rmkidsSync(e, t);
|
|
1175
|
+
else if ("ENOTEMPTY" === n.code || "EEXIST" === n.code || "EPERM" === n.code) rmkidsSync(e, t);
|
|
1176
1176
|
else if ("ENOENT" !== n.code) throw n;
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
@@ -1633,7 +1633,7 @@
|
|
|
1633
1633
|
});
|
|
1634
1634
|
function ReadStream(e, t) {
|
|
1635
1635
|
if (this instanceof ReadStream) return f.apply(this, arguments), this;
|
|
1636
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
1636
|
+
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
1637
1637
|
}
|
|
1638
1638
|
function ReadStream$open() {
|
|
1639
1639
|
var e = this;
|
|
@@ -1650,7 +1650,7 @@
|
|
|
1650
1650
|
}
|
|
1651
1651
|
function WriteStream(e, t) {
|
|
1652
1652
|
if (this instanceof WriteStream) return l.apply(this, arguments), this;
|
|
1653
|
-
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
1653
|
+
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
1654
1654
|
}
|
|
1655
1655
|
function WriteStream$open() {
|
|
1656
1656
|
var e = this;
|
|
@@ -2097,8 +2097,10 @@
|
|
|
2097
2097
|
a = JSON.parse(s, t ? t.reviver : null);
|
|
2098
2098
|
} catch (t) {
|
|
2099
2099
|
if (!o) return null;
|
|
2100
|
-
|
|
2101
|
-
|
|
2100
|
+
else {
|
|
2101
|
+
t.message = `${e}: ${t.message}`;
|
|
2102
|
+
throw t;
|
|
2103
|
+
}
|
|
2102
2104
|
}
|
|
2103
2105
|
return a;
|
|
2104
2106
|
}
|
|
@@ -2115,8 +2117,10 @@
|
|
|
2115
2117
|
return JSON.parse(n, t.reviver);
|
|
2116
2118
|
} catch (t) {
|
|
2117
2119
|
if (!i) return null;
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
+
else {
|
|
2121
|
+
t.message = `${e}: ${t.message}`;
|
|
2122
|
+
throw t;
|
|
2123
|
+
}
|
|
2120
2124
|
}
|
|
2121
2125
|
}
|
|
2122
2126
|
async function _writeFile(e, t, r = {}) {
|
|
@@ -2160,7 +2164,7 @@
|
|
|
2160
2164
|
if ("function" != typeof t[t.length - 1]) return new Promise((r, n)=>{
|
|
2161
2165
|
e.call(this, ...t, (e, t)=>null != e ? n(e) : r(t));
|
|
2162
2166
|
});
|
|
2163
|
-
e.apply(this, t);
|
|
2167
|
+
else e.apply(this, t);
|
|
2164
2168
|
}, "name", {
|
|
2165
2169
|
value: e.name
|
|
2166
2170
|
});
|
|
@@ -2169,7 +2173,7 @@
|
|
|
2169
2173
|
return Object.defineProperty(function(...t) {
|
|
2170
2174
|
const r = t[t.length - 1];
|
|
2171
2175
|
if ("function" != typeof r) return e.apply(this, t);
|
|
2172
|
-
e.apply(this, t.slice(0, -1)).then((e)=>r(null, e), r);
|
|
2176
|
+
else e.apply(this, t.slice(0, -1)).then((e)=>r(null, e), r);
|
|
2173
2177
|
}, "name", {
|
|
2174
2178
|
value: e.name
|
|
2175
2179
|
});
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
return n(t, e);
|
|
241
241
|
} catch (r) {
|
|
242
242
|
if (newError(r)) return c.realpathSync(t, e);
|
|
243
|
-
throw r;
|
|
243
|
+
else throw r;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function monkeypatch() {
|
|
@@ -986,7 +986,7 @@
|
|
|
986
986
|
else {
|
|
987
987
|
var o = s.isDirectory() ? "DIR" : "FILE";
|
|
988
988
|
if (i && "FILE" === o) return e();
|
|
989
|
-
return e(null, o, s);
|
|
989
|
+
else return e(null, o, s);
|
|
990
990
|
}
|
|
991
991
|
var c = this;
|
|
992
992
|
var h = m("stat\0" + r, lstatcb_);
|
|
@@ -996,7 +996,7 @@
|
|
|
996
996
|
if (i) c._stat2(t, r, null, a, e);
|
|
997
997
|
else c._stat2(t, r, i, n, e);
|
|
998
998
|
});
|
|
999
|
-
c._stat2(t, r, i, a, e);
|
|
999
|
+
else c._stat2(t, r, i, a, e);
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
1002
|
Glob.prototype._stat2 = function(t, e, r, i, a) {
|
|
@@ -1298,11 +1298,12 @@
|
|
|
1298
1298
|
if (a[t]) {
|
|
1299
1299
|
a[t].push(e);
|
|
1300
1300
|
return null;
|
|
1301
|
+
} else {
|
|
1302
|
+
a[t] = [
|
|
1303
|
+
e
|
|
1304
|
+
];
|
|
1305
|
+
return makeres(t);
|
|
1301
1306
|
}
|
|
1302
|
-
a[t] = [
|
|
1303
|
-
e
|
|
1304
|
-
];
|
|
1305
|
-
return makeres(t);
|
|
1306
1307
|
}
|
|
1307
1308
|
function makeres(t) {
|
|
1308
1309
|
return n(function RES() {
|
|
@@ -1856,13 +1857,14 @@
|
|
|
1856
1857
|
if (this.matchOne(t.slice(u), e.slice(p), r)) {
|
|
1857
1858
|
this.debug("globstar found match!", u, o, v);
|
|
1858
1859
|
return true;
|
|
1860
|
+
} else {
|
|
1861
|
+
if ("." === v || ".." === v || !i.dot && "." === v.charAt(0)) {
|
|
1862
|
+
this.debug("dot detected!", t, u, e, p);
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
this.debug("globstar swallow a segment, and continue");
|
|
1866
|
+
u++;
|
|
1859
1867
|
}
|
|
1860
|
-
if ("." === v || ".." === v || !i.dot && "." === v.charAt(0)) {
|
|
1861
|
-
this.debug("dot detected!", t, u, e, p);
|
|
1862
|
-
break;
|
|
1863
|
-
}
|
|
1864
|
-
this.debug("globstar swallow a segment, and continue");
|
|
1865
|
-
u++;
|
|
1866
1868
|
}
|
|
1867
1869
|
if (r) {
|
|
1868
1870
|
this.debug("\n>>> no match, partial?", t, u, e, p);
|
|
@@ -1881,8 +1883,8 @@
|
|
|
1881
1883
|
if (!d) return false;
|
|
1882
1884
|
}
|
|
1883
1885
|
if (n === o && s === c) return true;
|
|
1884
|
-
if (n === o) return r;
|
|
1885
|
-
if (s === c) return n === o - 1 && "" === t[n];
|
|
1886
|
+
else if (n === o) return r;
|
|
1887
|
+
else if (s === c) return n === o - 1 && "" === t[n];
|
|
1886
1888
|
throw new Error("wtf?");
|
|
1887
1889
|
};
|
|
1888
1890
|
function globUnescape(t) {
|
|
@@ -5434,7 +5434,7 @@
|
|
|
5434
5434
|
return t.confidence - e.confidence;
|
|
5435
5435
|
});
|
|
5436
5436
|
if (t && true === t.returnAllMatches) return u;
|
|
5437
|
-
return u.length > 0 ? u[0].name : null;
|
|
5437
|
+
else return u.length > 0 ? u[0].name : null;
|
|
5438
5438
|
};
|
|
5439
5439
|
e.exports.detectFile = function(e, t, r) {
|
|
5440
5440
|
if ("function" == typeof t) {
|
|
@@ -6196,8 +6196,7 @@
|
|
|
6196
6196
|
if ("object" == typeof p) {
|
|
6197
6197
|
o = p;
|
|
6198
6198
|
continue;
|
|
6199
|
-
}
|
|
6200
|
-
if ("number" == typeof p) d = p;
|
|
6199
|
+
} else if ("number" == typeof p) d = p;
|
|
6201
6200
|
else if (void 0 == p) {
|
|
6202
6201
|
p = o[c];
|
|
6203
6202
|
if (void 0 !== p) {
|
|
@@ -9366,13 +9365,14 @@
|
|
|
9366
9365
|
}
|
|
9367
9366
|
this._hadControl = true;
|
|
9368
9367
|
return this.emit("data", e);
|
|
9368
|
+
} else {
|
|
9369
|
+
if (this._prompt && this._hadControl && 0 === e.indexOf(this._prompt)) {
|
|
9370
|
+
this._hadControl = false;
|
|
9371
|
+
this.emit("data", this._prompt);
|
|
9372
|
+
e = e.substr(this._prompt.length);
|
|
9373
|
+
}
|
|
9374
|
+
e = e.toString().replace(/./g, this.replace);
|
|
9369
9375
|
}
|
|
9370
|
-
if (this._prompt && this._hadControl && 0 === e.indexOf(this._prompt)) {
|
|
9371
|
-
this._hadControl = false;
|
|
9372
|
-
this.emit("data", this._prompt);
|
|
9373
|
-
e = e.substr(this._prompt.length);
|
|
9374
|
-
}
|
|
9375
|
-
e = e.toString().replace(/./g, this.replace);
|
|
9376
9376
|
}
|
|
9377
9377
|
this.emit("data", e);
|
|
9378
9378
|
};
|
|
@@ -14825,7 +14825,7 @@
|
|
|
14825
14825
|
return t(r, e, o, n);
|
|
14826
14826
|
})(i.innerFrom(e(r, o)));
|
|
14827
14827
|
}, r);
|
|
14828
|
-
if ("number" == typeof t) r = t;
|
|
14828
|
+
else if ("number" == typeof t) r = t;
|
|
14829
14829
|
return o.operate(function(t, n) {
|
|
14830
14830
|
return u.mergeInternals(t, n, e, r);
|
|
14831
14831
|
});
|
|
@@ -15084,7 +15084,7 @@
|
|
|
15084
15084
|
for(var i = 0; i < r; i++){
|
|
15085
15085
|
var o = null == n ? void 0 : n[e[i]];
|
|
15086
15086
|
if (void 0 === o) return;
|
|
15087
|
-
n = o;
|
|
15087
|
+
else n = o;
|
|
15088
15088
|
}
|
|
15089
15089
|
return n;
|
|
15090
15090
|
});
|
|
@@ -17367,7 +17367,7 @@
|
|
|
17367
17367
|
this.pending = false;
|
|
17368
17368
|
var r = this._execute(e, t);
|
|
17369
17369
|
if (r) return r;
|
|
17370
|
-
if (false === this.pending && null != this.id) this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
|
17370
|
+
else if (false === this.pending && null != this.id) this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
|
17371
17371
|
};
|
|
17372
17372
|
AsyncAction.prototype._execute = function(e, t) {
|
|
17373
17373
|
var r = false;
|
|
@@ -17619,11 +17619,13 @@
|
|
|
17619
17619
|
VirtualAction.prototype.schedule = function(t, r) {
|
|
17620
17620
|
if (void 0 === r) r = 0;
|
|
17621
17621
|
if (!Number.isFinite(r)) return o.Subscription.EMPTY;
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17622
|
+
else {
|
|
17623
|
+
if (!this.id) return e.prototype.schedule.call(this, t, r);
|
|
17624
|
+
this.active = false;
|
|
17625
|
+
var n = new VirtualAction(this.scheduler, this.work);
|
|
17626
|
+
this.add(n);
|
|
17627
|
+
return n.schedule(t, r);
|
|
17628
|
+
}
|
|
17627
17629
|
};
|
|
17628
17630
|
VirtualAction.prototype.requestAsyncId = function(e, t, r) {
|
|
17629
17631
|
if (void 0 === r) r = 0;
|
|
@@ -17643,8 +17645,8 @@
|
|
|
17643
17645
|
if (e.delay === t.delay) if (e.index === t.index) return 0;
|
|
17644
17646
|
else if (e.index > t.index) return 1;
|
|
17645
17647
|
else return -1;
|
|
17646
|
-
if (e.delay > t.delay) return 1;
|
|
17647
|
-
return -1;
|
|
17648
|
+
else if (e.delay > t.delay) return 1;
|
|
17649
|
+
else return -1;
|
|
17648
17650
|
};
|
|
17649
17651
|
return VirtualAction;
|
|
17650
17652
|
}(i.AsyncAction);
|
|
@@ -19666,11 +19668,13 @@
|
|
|
19666
19668
|
var b = n.emit;
|
|
19667
19669
|
var y = function(e, t) {
|
|
19668
19670
|
if (!("exit" === e && processOk(global.process))) return b.apply(this, arguments);
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19671
|
+
else {
|
|
19672
|
+
if (void 0 !== t) n.exitCode = t;
|
|
19673
|
+
var r = b.apply(this, arguments);
|
|
19674
|
+
l("exit", n.exitCode, null);
|
|
19675
|
+
l("afterexit", n.exitCode, null);
|
|
19676
|
+
return r;
|
|
19677
|
+
}
|
|
19674
19678
|
};
|
|
19675
19679
|
} else e.exports = function() {
|
|
19676
19680
|
return function() {};
|
|
@@ -19736,7 +19740,7 @@
|
|
|
19736
19740
|
while(u.length && !s.paused){
|
|
19737
19741
|
var e = u.shift();
|
|
19738
19742
|
if (null === e) return s.emit("end");
|
|
19739
|
-
s.emit("data", e);
|
|
19743
|
+
else s.emit("data", e);
|
|
19740
19744
|
}
|
|
19741
19745
|
}
|
|
19742
19746
|
s.queue = s.push = function(e) {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
function toArray(e) {
|
|
49
49
|
if (Array.isArray(e)) return e;
|
|
50
|
-
if (isNothing(e)) return [];
|
|
50
|
+
else if (isNothing(e)) return [];
|
|
51
51
|
return [
|
|
52
52
|
e
|
|
53
53
|
];
|
|
@@ -855,12 +855,13 @@
|
|
|
855
855
|
l = true;
|
|
856
856
|
d = e.input.charCodeAt(e.position);
|
|
857
857
|
continue;
|
|
858
|
+
} else {
|
|
859
|
+
e.position = o;
|
|
860
|
+
e.line = s;
|
|
861
|
+
e.lineStart = c;
|
|
862
|
+
e.lineIndent = u;
|
|
863
|
+
break;
|
|
858
864
|
}
|
|
859
|
-
e.position = o;
|
|
860
|
-
e.line = s;
|
|
861
|
-
e.lineStart = c;
|
|
862
|
-
e.lineIndent = u;
|
|
863
|
-
break;
|
|
864
865
|
}
|
|
865
866
|
if (l) {
|
|
866
867
|
captureSegment(e, a, o, false);
|
|
@@ -889,9 +890,11 @@
|
|
|
889
890
|
captureSegment(e, i, e.position, true);
|
|
890
891
|
r = e.input.charCodeAt(++e.position);
|
|
891
892
|
if (39 !== r) return true;
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
893
|
+
else {
|
|
894
|
+
i = e.position;
|
|
895
|
+
e.position++;
|
|
896
|
+
n = e.position;
|
|
897
|
+
}
|
|
895
898
|
} else if (is_EOL(r)) {
|
|
896
899
|
captureSegment(e, i, n, true);
|
|
897
900
|
writeFoldedLines(e, skipSeparationSpace(e, false, t));
|
|
@@ -970,8 +973,7 @@
|
|
|
970
973
|
e.kind = h ? "mapping" : "sequence";
|
|
971
974
|
e.result = l;
|
|
972
975
|
return true;
|
|
973
|
-
}
|
|
974
|
-
if (r) {
|
|
976
|
+
} else if (r) {
|
|
975
977
|
if (44 === y) throwError(e, "expected the node content, but found ','");
|
|
976
978
|
} else throwError(e, "missed comma between flow collection entries");
|
|
977
979
|
v = g = w = null;
|
|
@@ -1403,7 +1405,7 @@
|
|
|
1403
1405
|
return;
|
|
1404
1406
|
}
|
|
1405
1407
|
if (!(e.position < e.length - 1)) return;
|
|
1406
|
-
throwError(e, "end of the stream or a document separator is expected");
|
|
1408
|
+
else throwError(e, "end of the stream or a document separator is expected");
|
|
1407
1409
|
}
|
|
1408
1410
|
function loadDocuments(e, t) {
|
|
1409
1411
|
e = String(e);
|
|
@@ -1438,7 +1440,7 @@
|
|
|
1438
1440
|
function load(e, t) {
|
|
1439
1441
|
var r = loadDocuments(e, t);
|
|
1440
1442
|
if (0 === r.length) return;
|
|
1441
|
-
if (1 === r.length) return r[0];
|
|
1443
|
+
else if (1 === r.length) return r[0];
|
|
1442
1444
|
throw new n("expected a single document in the stream, but found more");
|
|
1443
1445
|
}
|
|
1444
1446
|
e.exports.loadAll = loadAll;
|
|
@@ -1786,7 +1788,7 @@
|
|
|
1786
1788
|
r = "-" === t[0] ? -1 : 1;
|
|
1787
1789
|
if ("+-".indexOf(t[0]) >= 0) t = t.slice(1);
|
|
1788
1790
|
if (".inf" === t) return 1 === r ? 1 / 0 : -1 / 0;
|
|
1789
|
-
if (".nan" === t) return 0 / 0;
|
|
1791
|
+
else if (".nan" === t) return 0 / 0;
|
|
1790
1792
|
return r * parseFloat(t, 10);
|
|
1791
1793
|
}
|
|
1792
1794
|
var o = /^[-+]?[0-9]+e/;
|
|
@@ -2030,7 +2032,7 @@
|
|
|
2030
2032
|
else s = true;
|
|
2031
2033
|
if (!s) return false;
|
|
2032
2034
|
if (-1 !== t.indexOf(l)) return false;
|
|
2033
|
-
t.push(l);
|
|
2035
|
+
else t.push(l);
|
|
2034
2036
|
}
|
|
2035
2037
|
return true;
|
|
2036
2038
|
}
|
|
@@ -38,7 +38,7 @@ function isObject(e) {
|
|
|
38
38
|
}
|
|
39
39
|
function toArray(e) {
|
|
40
40
|
if (Array.isArray(e)) return e;
|
|
41
|
-
if (isNothing(e)) return [];
|
|
41
|
+
else if (isNothing(e)) return [];
|
|
42
42
|
return [
|
|
43
43
|
e
|
|
44
44
|
];
|
|
@@ -493,7 +493,7 @@ function constructYamlFloat(e) {
|
|
|
493
493
|
r = "-" === t[0] ? -1 : 1;
|
|
494
494
|
if ("+-".indexOf(t[0]) >= 0) t = t.slice(1);
|
|
495
495
|
if (".inf" === t) return 1 === r ? 1 / 0 : -1 / 0;
|
|
496
|
-
if (".nan" === t) return 0 / 0;
|
|
496
|
+
else if (".nan" === t) return 0 / 0;
|
|
497
497
|
return r * parseFloat(t, 10);
|
|
498
498
|
}
|
|
499
499
|
var E = /^[-+]?[0-9]+e/;
|
|
@@ -686,7 +686,7 @@ function resolveYamlOmap(e) {
|
|
|
686
686
|
else o = true;
|
|
687
687
|
if (!o) return false;
|
|
688
688
|
if (-1 !== t.indexOf(a)) return false;
|
|
689
|
-
t.push(a);
|
|
689
|
+
else t.push(a);
|
|
690
690
|
}
|
|
691
691
|
return true;
|
|
692
692
|
}
|
|
@@ -1023,12 +1023,13 @@ function readPlainScalar(e, t, r) {
|
|
|
1023
1023
|
l = true;
|
|
1024
1024
|
d = e.input.charCodeAt(e.position);
|
|
1025
1025
|
continue;
|
|
1026
|
+
} else {
|
|
1027
|
+
e.position = o;
|
|
1028
|
+
e.line = s;
|
|
1029
|
+
e.lineStart = c;
|
|
1030
|
+
e.lineIndent = u;
|
|
1031
|
+
break;
|
|
1026
1032
|
}
|
|
1027
|
-
e.position = o;
|
|
1028
|
-
e.line = s;
|
|
1029
|
-
e.lineStart = c;
|
|
1030
|
-
e.lineIndent = u;
|
|
1031
|
-
break;
|
|
1032
1033
|
}
|
|
1033
1034
|
if (l) {
|
|
1034
1035
|
captureSegment(e, a, o, false);
|
|
@@ -1057,9 +1058,11 @@ function readSingleQuotedScalar(e, t) {
|
|
|
1057
1058
|
captureSegment(e, i, e.position, true);
|
|
1058
1059
|
r = e.input.charCodeAt(++e.position);
|
|
1059
1060
|
if (39 !== r) return true;
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1061
|
+
else {
|
|
1062
|
+
i = e.position;
|
|
1063
|
+
e.position++;
|
|
1064
|
+
n = e.position;
|
|
1065
|
+
}
|
|
1063
1066
|
} else if (is_EOL(r)) {
|
|
1064
1067
|
captureSegment(e, i, n, true);
|
|
1065
1068
|
writeFoldedLines(e, skipSeparationSpace(e, false, t));
|
|
@@ -1138,8 +1141,7 @@ function readFlowCollection(e, t) {
|
|
|
1138
1141
|
e.kind = d ? "mapping" : "sequence";
|
|
1139
1142
|
e.result = l;
|
|
1140
1143
|
return true;
|
|
1141
|
-
}
|
|
1142
|
-
if (r) {
|
|
1144
|
+
} else if (r) {
|
|
1143
1145
|
if (44 === w) throwError(e, "expected the node content, but found ','");
|
|
1144
1146
|
} else throwError(e, "missed comma between flow collection entries");
|
|
1145
1147
|
g = m = v = null;
|
|
@@ -1571,7 +1573,7 @@ function readDocument(e) {
|
|
|
1571
1573
|
return;
|
|
1572
1574
|
}
|
|
1573
1575
|
if (!(e.position < e.length - 1)) return;
|
|
1574
|
-
throwError(e, "end of the stream or a document separator is expected");
|
|
1576
|
+
else throwError(e, "end of the stream or a document separator is expected");
|
|
1575
1577
|
}
|
|
1576
1578
|
function loadDocuments(e, t) {
|
|
1577
1579
|
e = String(e);
|
|
@@ -1606,7 +1608,7 @@ function loadAll$1(e, t, r) {
|
|
|
1606
1608
|
function load$1(e, t) {
|
|
1607
1609
|
var r = loadDocuments(e, t);
|
|
1608
1610
|
if (0 === r.length) return;
|
|
1609
|
-
if (1 === r.length) return r[0];
|
|
1611
|
+
else if (1 === r.length) return r[0];
|
|
1610
1612
|
throw new c("expected a single document in the stream, but found more");
|
|
1611
1613
|
}
|
|
1612
1614
|
var ne = loadAll$1;
|
|
@@ -124,8 +124,7 @@
|
|
|
124
124
|
setArg(b[g], f.slice(g + 2), f);
|
|
125
125
|
_ = true;
|
|
126
126
|
break;
|
|
127
|
-
}
|
|
128
|
-
setArg(b[g], r.strings[b[g]] ? "" : true, f);
|
|
127
|
+
} else setArg(b[g], r.strings[b[g]] ? "" : true, f);
|
|
129
128
|
}
|
|
130
129
|
var l = f.slice(-1)[0];
|
|
131
130
|
if (!_ && "-" !== l) if (!e[a + 1] || /^(-|--)[^-]/.test(e[a + 1]) || r.bools[l] || (n[l] ? aliasIsBoolean(l) : false)) if (e[a + 1] && /^(true|false)$/.test(e[a + 1])) {
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
t = void 0;
|
|
146
146
|
}
|
|
147
147
|
if ("function" == typeof e || Array.isArray(e)) throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');
|
|
148
|
-
if ("number" == typeof e) e = i.from([
|
|
148
|
+
else if ("number" == typeof e) e = i.from([
|
|
149
149
|
e
|
|
150
150
|
]);
|
|
151
151
|
else if ("string" == typeof e) e = i.from(e, r);
|
|
@@ -797,7 +797,7 @@
|
|
|
797
797
|
if (!i) i = Error;
|
|
798
798
|
function getMessage(e, t, i) {
|
|
799
799
|
if ("string" == typeof r) return r;
|
|
800
|
-
return r(e, t, i);
|
|
800
|
+
else return r(e, t, i);
|
|
801
801
|
}
|
|
802
802
|
class NodeError extends i {
|
|
803
803
|
constructor(e, t, r){
|
|
@@ -810,12 +810,12 @@
|
|
|
810
810
|
}
|
|
811
811
|
function oneOf(e, t) {
|
|
812
812
|
if (!Array.isArray(e)) return `of ${t} ${String(e)}`;
|
|
813
|
-
{
|
|
813
|
+
else {
|
|
814
814
|
const r = e.length;
|
|
815
815
|
e = e.map((e)=>String(e));
|
|
816
816
|
if (r > 2) return `one of ${t} ${e.slice(0, r - 1).join(", ")}, or ` + e[r - 1];
|
|
817
|
-
if (2 === r) return `one of ${t} ${e[0]} or ${e[1]}`;
|
|
818
|
-
return `of ${t} ${e[0]}`;
|
|
817
|
+
else if (2 === r) return `one of ${t} ${e[0]} or ${e[1]}`;
|
|
818
|
+
else return `of ${t} ${e[0]}`;
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
function startsWith(e, t, r) {
|
|
@@ -828,7 +828,7 @@
|
|
|
828
828
|
function includes(e, t, r) {
|
|
829
829
|
if ("number" != typeof r) r = 0;
|
|
830
830
|
if (r + t.length > e.length) return false;
|
|
831
|
-
return -1 !== e.indexOf(t, r);
|
|
831
|
+
else return -1 !== e.indexOf(t, r);
|
|
832
832
|
}
|
|
833
833
|
createErrorType("ERR_INVALID_OPT_VALUE", function(e, t) {
|
|
834
834
|
return 'The value "' + t + '" is invalid for option "' + e + '"';
|
|
@@ -1514,7 +1514,7 @@
|
|
|
1514
1514
|
u("wrapped data");
|
|
1515
1515
|
if (r.decoder) n = r.decoder.write(n);
|
|
1516
1516
|
if (r.objectMode && null == n) return;
|
|
1517
|
-
if (!r.objectMode && (!n || !n.length)) return;
|
|
1517
|
+
else if (!r.objectMode && (!n || !n.length)) return;
|
|
1518
1518
|
var s = t.push(n);
|
|
1519
1519
|
if (!s) {
|
|
1520
1520
|
i = true;
|
|
@@ -3005,11 +3005,13 @@
|
|
|
3005
3005
|
var g = i.emit;
|
|
3006
3006
|
var y = function(e, t) {
|
|
3007
3007
|
if (!("exit" === e && processOk(global.process))) return g.apply(this, arguments);
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3008
|
+
else {
|
|
3009
|
+
if (void 0 !== t) i.exitCode = t;
|
|
3010
|
+
var r = g.apply(this, arguments);
|
|
3011
|
+
u("exit", i.exitCode, null);
|
|
3012
|
+
u("afterexit", i.exitCode, null);
|
|
3013
|
+
return r;
|
|
3014
|
+
}
|
|
3013
3015
|
};
|
|
3014
3016
|
} else e.exports = function() {
|
|
3015
3017
|
return function() {};
|
|
@@ -3131,9 +3133,9 @@
|
|
|
3131
3133
|
};
|
|
3132
3134
|
function utf8CheckByte(e) {
|
|
3133
3135
|
if (e <= 127) return 0;
|
|
3134
|
-
if (e >> 5 === 6) return 2;
|
|
3135
|
-
if (e >> 4 === 14) return 3;
|
|
3136
|
-
if (e >> 3 === 30) return 4;
|
|
3136
|
+
else if (e >> 5 === 6) return 2;
|
|
3137
|
+
else if (e >> 4 === 14) return 3;
|
|
3138
|
+
else if (e >> 3 === 30) return 4;
|
|
3137
3139
|
return e >> 6 === 2 ? -1 : -2;
|
|
3138
3140
|
}
|
|
3139
3141
|
function utf8CheckIncomplete(e, t, r) {
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
}
|
|
248
248
|
constructor(e, t){
|
|
249
249
|
t = n(t);
|
|
250
|
-
if (e instanceof Comparator) if (
|
|
250
|
+
if (e instanceof Comparator) if (e.loose === !!t.loose) return e;
|
|
251
251
|
else e = e.value;
|
|
252
252
|
e = e.trim().split(/\s+/).join(" ");
|
|
253
253
|
a("comparator", e, t);
|
|
@@ -285,8 +285,7 @@
|
|
|
285
285
|
if ("" === this.operator) {
|
|
286
286
|
if ("" === this.value) return true;
|
|
287
287
|
return new c(e.value, t).test(this.value);
|
|
288
|
-
}
|
|
289
|
-
if ("" === e.operator) {
|
|
288
|
+
} else if ("" === e.operator) {
|
|
290
289
|
if ("" === e.value) return true;
|
|
291
290
|
return new c(this.value, t).test(e.semver);
|
|
292
291
|
}
|
|
@@ -313,7 +312,7 @@
|
|
|
313
312
|
class Range {
|
|
314
313
|
constructor(e, t){
|
|
315
314
|
t = i(t);
|
|
316
|
-
if (e instanceof Range) if (
|
|
315
|
+
if (e instanceof Range) if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease) return e;
|
|
317
316
|
else return new Range(e.raw, t);
|
|
318
317
|
if (e instanceof o) {
|
|
319
318
|
this.raw = e.value;
|
|
@@ -562,7 +561,7 @@
|
|
|
562
561
|
class SemVer {
|
|
563
562
|
constructor(e, t){
|
|
564
563
|
t = a(t);
|
|
565
|
-
if (e instanceof SemVer) if (
|
|
564
|
+
if (e instanceof SemVer) if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease) return e;
|
|
566
565
|
else e = e.version;
|
|
567
566
|
else if ("string" != typeof e) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
568
567
|
if (e.length > n) throw new TypeError(`version is longer than ${n} characters`);
|
|
@@ -614,16 +613,16 @@
|
|
|
614
613
|
comparePre(e) {
|
|
615
614
|
if (!(e instanceof SemVer)) e = new SemVer(e, this.options);
|
|
616
615
|
if (this.prerelease.length && !e.prerelease.length) return -1;
|
|
617
|
-
if (!this.prerelease.length && e.prerelease.length) return 1;
|
|
618
|
-
if (!this.prerelease.length && !e.prerelease.length) return 0;
|
|
616
|
+
else if (!this.prerelease.length && e.prerelease.length) return 1;
|
|
617
|
+
else if (!this.prerelease.length && !e.prerelease.length) return 0;
|
|
619
618
|
let t = 0;
|
|
620
619
|
do {
|
|
621
620
|
const r = this.prerelease[t];
|
|
622
621
|
const n = e.prerelease[t];
|
|
623
622
|
s("prerelease compare", t, r, n);
|
|
624
623
|
if (void 0 === r && void 0 === n) return 0;
|
|
625
|
-
if (void 0 === n) return 1;
|
|
626
|
-
if (void 0 === r) return -1;
|
|
624
|
+
else if (void 0 === n) return 1;
|
|
625
|
+
else if (void 0 === r) return -1;
|
|
627
626
|
else if (r === n) continue;
|
|
628
627
|
else return h(r, n);
|
|
629
628
|
}while (++t);
|
|
@@ -636,8 +635,8 @@
|
|
|
636
635
|
const n = e.build[t];
|
|
637
636
|
s("prerelease compare", t, r, n);
|
|
638
637
|
if (void 0 === r && void 0 === n) return 0;
|
|
639
|
-
if (void 0 === n) return 1;
|
|
640
|
-
if (void 0 === r) return -1;
|
|
638
|
+
else if (void 0 === n) return 1;
|
|
639
|
+
else if (void 0 === r) return -1;
|
|
641
640
|
else if (r === n) continue;
|
|
642
641
|
else return h(r, n);
|
|
643
642
|
}while (++t);
|
|
@@ -1344,7 +1343,7 @@
|
|
|
1344
1343
|
});
|
|
1345
1344
|
if (o.operator === v || o.operator === $) return false;
|
|
1346
1345
|
if ((!l.operator || l.operator === v) && E(e, l.semver)) return false;
|
|
1347
|
-
if (l.operator === $ && m(e, l.semver)) return false;
|
|
1346
|
+
else if (l.operator === $ && m(e, l.semver)) return false;
|
|
1348
1347
|
}
|
|
1349
1348
|
return true;
|
|
1350
1349
|
};
|
|
@@ -1430,7 +1429,7 @@
|
|
|
1430
1429
|
if (n && c) {
|
|
1431
1430
|
u = l(n.semver, c.semver, r);
|
|
1432
1431
|
if (u > 0) return null;
|
|
1433
|
-
if (0 === u && (">=" !== n.operator || "<=" !== c.operator)) return null;
|
|
1432
|
+
else if (0 === u && (">=" !== n.operator || "<=" !== c.operator)) return null;
|
|
1434
1433
|
}
|
|
1435
1434
|
for (const e of s){
|
|
1436
1435
|
if (n && !o(e, String(n), r)) return null;
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
cwd: r
|
|
258
258
|
});
|
|
259
259
|
if (e) return n.join(r, e);
|
|
260
|
-
if (r === s) return null;
|
|
260
|
+
else if (r === s) return null;
|
|
261
261
|
r = n.dirname(r);
|
|
262
262
|
}
|
|
263
263
|
};
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
});
|
|
536
536
|
function ReadStream(e, t) {
|
|
537
537
|
if (this instanceof ReadStream) return f.apply(this, arguments), this;
|
|
538
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
538
|
+
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
539
539
|
}
|
|
540
540
|
function ReadStream$open() {
|
|
541
541
|
var e = this;
|
|
@@ -552,7 +552,7 @@
|
|
|
552
552
|
}
|
|
553
553
|
function WriteStream(e, t) {
|
|
554
554
|
if (this instanceof WriteStream) return u.apply(this, arguments), this;
|
|
555
|
-
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
555
|
+
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
556
556
|
}
|
|
557
557
|
function WriteStream$open() {
|
|
558
558
|
var e = this;
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
t = 1 <= arguments.length ? x.call(arguments, 0) : [];
|
|
29
29
|
t = t.map(function(e) {
|
|
30
30
|
if (f(e)) return p(e);
|
|
31
|
-
return e;
|
|
31
|
+
else return e;
|
|
32
32
|
});
|
|
33
33
|
r = o[e].apply(o, t);
|
|
34
34
|
if (f(r)) return p(r);
|
|
35
|
-
return r;
|
|
35
|
+
else return r;
|
|
36
36
|
};
|
|
37
37
|
}(c);
|
|
38
38
|
else _[c] = h;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
normalizeTrim: function(e) {
|
|
53
53
|
e = _.normalizeSafe(e);
|
|
54
54
|
if (e.endsWith("/")) return e.slice(0, +(e.length - 2) + 1 || 9e9);
|
|
55
|
-
return e;
|
|
55
|
+
else return e;
|
|
56
56
|
},
|
|
57
57
|
joinSafe: function() {
|
|
58
58
|
var e, t, r;
|
|
@@ -68,21 +68,25 @@
|
|
|
68
68
|
},
|
|
69
69
|
addExt: function(e, t) {
|
|
70
70
|
if (!t) return e;
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
else {
|
|
72
|
+
if ("." !== t[0]) t = "." + t;
|
|
73
|
+
return e + (e.endsWith(t) ? "" : t);
|
|
74
|
+
}
|
|
73
75
|
},
|
|
74
76
|
trimExt: function(e, t, r) {
|
|
75
77
|
var n;
|
|
76
78
|
if (null == r) r = 7;
|
|
77
79
|
n = _.extname(e);
|
|
78
80
|
if (l(n, t, r)) return e.slice(0, +(e.length - n.length - 1) + 1 || 9e9);
|
|
79
|
-
return e;
|
|
81
|
+
else return e;
|
|
80
82
|
},
|
|
81
83
|
removeExt: function(e, t) {
|
|
82
84
|
if (!t) return e;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
else {
|
|
86
|
+
t = "." === t[0] ? t : "." + t;
|
|
87
|
+
if (_.extname(e) === t) return _.trimExt(e, [], t.length);
|
|
88
|
+
else return e;
|
|
89
|
+
}
|
|
86
90
|
},
|
|
87
91
|
changeExt: function(e, t, r, n) {
|
|
88
92
|
if (null == n) n = 7;
|
|
@@ -93,7 +97,7 @@
|
|
|
93
97
|
if (null == n) n = 7;
|
|
94
98
|
i = _.extname(e);
|
|
95
99
|
if (l(i, r, n)) return e;
|
|
96
|
-
return _.addExt(e, t);
|
|
100
|
+
else return _.addExt(e, t);
|
|
97
101
|
}
|
|
98
102
|
};
|
|
99
103
|
l = function(e, t, r) {
|
|
@@ -105,7 +109,7 @@
|
|
|
105
109
|
for(s in u)if (m.call(u, s)) {
|
|
106
110
|
i = u[s];
|
|
107
111
|
if (void 0 !== _[s]) throw new Error("path." + s + " already exists.");
|
|
108
|
-
_[s] = i;
|
|
112
|
+
else _[s] = i;
|
|
109
113
|
}
|
|
110
114
|
},
|
|
111
115
|
17: (e)=>{
|
|
@@ -55,9 +55,11 @@
|
|
|
55
55
|
};
|
|
56
56
|
var o = n === i;
|
|
57
57
|
if (!o) return cloneIfNecessary(t, s);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
else {
|
|
59
|
+
if (!n) return mergeObject(e, t, s);
|
|
60
|
+
var u = r.arrayMerge || defaultArrayMerge;
|
|
61
|
+
return u(e, t, s);
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
64
|
deepmerge.all = function(e, t) {
|
|
63
65
|
if (!Array.isArray(e) || e.length < 2) throw new Error("first argument should be an array with at least two elements");
|
|
@@ -3,7 +3,7 @@ import { logger } from "./logger.mjs";
|
|
|
3
3
|
function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
|
|
4
4
|
if (!options) return defaults;
|
|
5
5
|
if (isPlainObject(options)) return mergeFn(defaults, options);
|
|
6
|
-
if (isFunction(options)) {
|
|
6
|
+
else if (isFunction(options)) {
|
|
7
7
|
const ret = options(defaults, utils);
|
|
8
8
|
if (ret) {
|
|
9
9
|
if (!isPlainObject(ret)) logger.warn(`${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isPlainObject } from "../is/index.mjs";
|
|
2
2
|
const getEntryOptions = (name, isMainEntry, baseOptions, optionsByEntries, packageName)=>{
|
|
3
3
|
if (!optionsByEntries) return baseOptions;
|
|
4
|
-
{
|
|
4
|
+
else {
|
|
5
5
|
let optionsByEntry = getOptionsByEntryName(name, optionsByEntries);
|
|
6
6
|
if (void 0 === optionsByEntry && isMainEntry && packageName) optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
|
|
7
7
|
return void 0 !== optionsByEntry ? isPlainObject(optionsByEntry) && isPlainObject(baseOptions) ? {
|
package/dist/esm/cli/require.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { findExists } from "./fs.mjs";
|
|
|
5
5
|
async function importPath(path, options) {
|
|
6
6
|
const modulePath = isAbsolute(path) ? pathToFileURL(path).href : path;
|
|
7
7
|
if ('development' !== process.env.NODE_ENV) return await import(modulePath, options);
|
|
8
|
-
{
|
|
8
|
+
else {
|
|
9
9
|
const timestamp = Date.now();
|
|
10
10
|
return await import(`${modulePath}?t=${timestamp}`, options);
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ import { logger } from "./logger.mjs";
|
|
|
4
4
|
function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
|
|
5
5
|
if (!options) return defaults;
|
|
6
6
|
if (isPlainObject(options)) return mergeFn(defaults, options);
|
|
7
|
-
if (isFunction(options)) {
|
|
7
|
+
else if (isFunction(options)) {
|
|
8
8
|
const ret = options(defaults, utils);
|
|
9
9
|
if (ret) {
|
|
10
10
|
if (!isPlainObject(ret)) logger.warn(`${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`);
|
|
@@ -2,7 +2,7 @@ import "node:module";
|
|
|
2
2
|
import { isPlainObject } from "../is/index.mjs";
|
|
3
3
|
const getEntryOptions = (name, isMainEntry, baseOptions, optionsByEntries, packageName)=>{
|
|
4
4
|
if (!optionsByEntries) return baseOptions;
|
|
5
|
-
{
|
|
5
|
+
else {
|
|
6
6
|
let optionsByEntry = getOptionsByEntryName(name, optionsByEntries);
|
|
7
7
|
if (void 0 === optionsByEntry && isMainEntry && packageName) optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
|
|
8
8
|
return void 0 !== optionsByEntry ? isPlainObject(optionsByEntry) && isPlainObject(baseOptions) ? {
|
|
@@ -6,7 +6,7 @@ import { findExists } from "./fs.mjs";
|
|
|
6
6
|
async function importPath(path, options) {
|
|
7
7
|
const modulePath = isAbsolute(path) ? pathToFileURL(path).href : path;
|
|
8
8
|
if ('development' !== process.env.NODE_ENV) return await import(modulePath, options);
|
|
9
|
-
{
|
|
9
|
+
else {
|
|
10
10
|
const timestamp = Date.now();
|
|
11
11
|
return await import(`${modulePath}?t=${timestamp}`, options);
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.9.
|
|
18
|
+
"version": "3.9.3",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"module": "./dist/esm/index.mjs",
|
|
@@ -142,12 +142,12 @@
|
|
|
142
142
|
"rslog": "^1.3.2"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@rslib/core": "1.0.
|
|
145
|
+
"@rslib/core": "1.0.1",
|
|
146
146
|
"@types/node": "^20",
|
|
147
|
-
"happy-dom": "^20.
|
|
147
|
+
"happy-dom": "^20.14.5",
|
|
148
148
|
"typescript": "^5",
|
|
149
149
|
"@modern-js/rslib": "2.68.10",
|
|
150
|
-
"@modern-js/types": "3.9.
|
|
150
|
+
"@modern-js/types": "3.9.3",
|
|
151
151
|
"@scripts/rstest-config": "2.66.0"
|
|
152
152
|
},
|
|
153
153
|
"peerDependencies": {
|