@jsse/eslint-config 0.1.20 → 0.1.21
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/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +177 -102
- package/dist/index.js +178 -103
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2973,7 +2973,7 @@ import process5 from "process";
|
|
|
2973
2973
|
import path3, { dirname as dirname3, win32, join as join2 } from "path";
|
|
2974
2974
|
import process2 from "process";
|
|
2975
2975
|
|
|
2976
|
-
// node_modules/.pnpm/acorn@8.
|
|
2976
|
+
// node_modules/.pnpm/acorn@8.12.1/node_modules/acorn/dist/acorn.mjs
|
|
2977
2977
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
2978
2978
|
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
2979
2979
|
var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
@@ -3521,7 +3521,7 @@ Parser.tokenizer = function tokenizer(input, options) {
|
|
|
3521
3521
|
};
|
|
3522
3522
|
Object.defineProperties(Parser.prototype, prototypeAccessors);
|
|
3523
3523
|
var pp$9 = Parser.prototype;
|
|
3524
|
-
var literal = /^(?:'((
|
|
3524
|
+
var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
3525
3525
|
pp$9.strictDirective = function(start) {
|
|
3526
3526
|
if (this.options.ecmaVersion < 5) {
|
|
3527
3527
|
return false;
|
|
@@ -3880,16 +3880,21 @@ pp$8.parseForStatement = function(node) {
|
|
|
3880
3880
|
return this.parseFor(node, init$1);
|
|
3881
3881
|
}
|
|
3882
3882
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
3883
|
+
var containsEsc = this.containsEsc;
|
|
3883
3884
|
var refDestructuringErrors = new DestructuringErrors();
|
|
3884
|
-
var
|
|
3885
|
+
var initPos = this.start;
|
|
3886
|
+
var init = awaitAt > -1 ? this.parseExprSubscripts(refDestructuringErrors, "await") : this.parseExpression(true, refDestructuringErrors);
|
|
3885
3887
|
if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
3886
|
-
if (
|
|
3888
|
+
if (awaitAt > -1) {
|
|
3887
3889
|
if (this.type === types$1._in) {
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3890
|
+
this.unexpected(awaitAt);
|
|
3891
|
+
}
|
|
3892
|
+
node.await = true;
|
|
3893
|
+
} else if (isForOf && this.options.ecmaVersion >= 8) {
|
|
3894
|
+
if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") {
|
|
3895
|
+
this.unexpected();
|
|
3896
|
+
} else if (this.options.ecmaVersion >= 9) {
|
|
3897
|
+
node.await = false;
|
|
3893
3898
|
}
|
|
3894
3899
|
}
|
|
3895
3900
|
if (startsWithLet && isForOf) {
|
|
@@ -5240,7 +5245,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
5240
5245
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
5241
5246
|
if (update) {
|
|
5242
5247
|
this.checkLValSimple(node.argument);
|
|
5243
|
-
} else if (this.strict && node.operator === "delete" && node.argument
|
|
5248
|
+
} else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument)) {
|
|
5244
5249
|
this.raiseRecoverable(node.start, "Deleting local variable in strict mode");
|
|
5245
5250
|
} else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) {
|
|
5246
5251
|
this.raiseRecoverable(node.start, "Private fields can not be deleted");
|
|
@@ -5281,8 +5286,11 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
5281
5286
|
return expr;
|
|
5282
5287
|
}
|
|
5283
5288
|
};
|
|
5289
|
+
function isLocalVariableAccess(node) {
|
|
5290
|
+
return node.type === "Identifier" || node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression);
|
|
5291
|
+
}
|
|
5284
5292
|
function isPrivateFieldAccess(node) {
|
|
5285
|
-
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression);
|
|
5293
|
+
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression);
|
|
5286
5294
|
}
|
|
5287
5295
|
pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
|
|
5288
5296
|
var startPos = this.start, startLoc = this.startLoc;
|
|
@@ -5668,7 +5676,7 @@ pp$5.parseTemplateElement = function(ref2) {
|
|
|
5668
5676
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
5669
5677
|
}
|
|
5670
5678
|
elem.value = {
|
|
5671
|
-
raw: this.value,
|
|
5679
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
5672
5680
|
cooked: null
|
|
5673
5681
|
};
|
|
5674
5682
|
} else {
|
|
@@ -6262,6 +6270,23 @@ var ecmaVersion;
|
|
|
6262
6270
|
var i;
|
|
6263
6271
|
var list;
|
|
6264
6272
|
var pp$1 = Parser.prototype;
|
|
6273
|
+
var BranchID = function BranchID2(parent, base) {
|
|
6274
|
+
this.parent = parent;
|
|
6275
|
+
this.base = base || this;
|
|
6276
|
+
};
|
|
6277
|
+
BranchID.prototype.separatedFrom = function separatedFrom(alt) {
|
|
6278
|
+
for (var self = this; self; self = self.parent) {
|
|
6279
|
+
for (var other = alt; other; other = other.parent) {
|
|
6280
|
+
if (self.base === other.base && self !== other) {
|
|
6281
|
+
return true;
|
|
6282
|
+
}
|
|
6283
|
+
}
|
|
6284
|
+
}
|
|
6285
|
+
return false;
|
|
6286
|
+
};
|
|
6287
|
+
BranchID.prototype.sibling = function sibling() {
|
|
6288
|
+
return new BranchID(this.parent, this.base);
|
|
6289
|
+
};
|
|
6265
6290
|
var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
6266
6291
|
this.parser = parser;
|
|
6267
6292
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
@@ -6278,8 +6303,9 @@ var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
|
6278
6303
|
this.lastAssertionIsQuantifiable = false;
|
|
6279
6304
|
this.numCapturingParens = 0;
|
|
6280
6305
|
this.maxBackReference = 0;
|
|
6281
|
-
this.groupNames =
|
|
6306
|
+
this.groupNames = /* @__PURE__ */ Object.create(null);
|
|
6282
6307
|
this.backReferenceNames = [];
|
|
6308
|
+
this.branchID = null;
|
|
6283
6309
|
};
|
|
6284
6310
|
RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {
|
|
6285
6311
|
var unicodeSets = flags.indexOf("v") !== -1;
|
|
@@ -6385,9 +6411,15 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
6385
6411
|
this.raise(state.start, "Invalid regular expression flag");
|
|
6386
6412
|
}
|
|
6387
6413
|
};
|
|
6414
|
+
function hasProp(obj) {
|
|
6415
|
+
for (var _ in obj) {
|
|
6416
|
+
return true;
|
|
6417
|
+
}
|
|
6418
|
+
return false;
|
|
6419
|
+
}
|
|
6388
6420
|
pp$1.validateRegExpPattern = function(state) {
|
|
6389
6421
|
this.regexp_pattern(state);
|
|
6390
|
-
if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames
|
|
6422
|
+
if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
|
|
6391
6423
|
state.switchN = true;
|
|
6392
6424
|
this.regexp_pattern(state);
|
|
6393
6425
|
}
|
|
@@ -6399,8 +6431,9 @@ pp$1.regexp_pattern = function(state) {
|
|
|
6399
6431
|
state.lastAssertionIsQuantifiable = false;
|
|
6400
6432
|
state.numCapturingParens = 0;
|
|
6401
6433
|
state.maxBackReference = 0;
|
|
6402
|
-
state.groupNames
|
|
6434
|
+
state.groupNames = /* @__PURE__ */ Object.create(null);
|
|
6403
6435
|
state.backReferenceNames.length = 0;
|
|
6436
|
+
state.branchID = null;
|
|
6404
6437
|
this.regexp_disjunction(state);
|
|
6405
6438
|
if (state.pos !== state.source.length) {
|
|
6406
6439
|
if (state.eat(
|
|
@@ -6424,19 +6457,29 @@ pp$1.regexp_pattern = function(state) {
|
|
|
6424
6457
|
}
|
|
6425
6458
|
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
6426
6459
|
var name = list[i];
|
|
6427
|
-
if (state.groupNames
|
|
6460
|
+
if (!state.groupNames[name]) {
|
|
6428
6461
|
state.raise("Invalid named capture referenced");
|
|
6429
6462
|
}
|
|
6430
6463
|
}
|
|
6431
6464
|
};
|
|
6432
6465
|
pp$1.regexp_disjunction = function(state) {
|
|
6466
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
6467
|
+
if (trackDisjunction) {
|
|
6468
|
+
state.branchID = new BranchID(state.branchID, null);
|
|
6469
|
+
}
|
|
6433
6470
|
this.regexp_alternative(state);
|
|
6434
6471
|
while (state.eat(
|
|
6435
6472
|
124
|
|
6436
6473
|
/* | */
|
|
6437
6474
|
)) {
|
|
6475
|
+
if (trackDisjunction) {
|
|
6476
|
+
state.branchID = state.branchID.sibling();
|
|
6477
|
+
}
|
|
6438
6478
|
this.regexp_alternative(state);
|
|
6439
6479
|
}
|
|
6480
|
+
if (trackDisjunction) {
|
|
6481
|
+
state.branchID = state.branchID.parent;
|
|
6482
|
+
}
|
|
6440
6483
|
if (this.regexp_eatQuantifier(state, true)) {
|
|
6441
6484
|
state.raise("Nothing to repeat");
|
|
6442
6485
|
}
|
|
@@ -6695,14 +6738,28 @@ pp$1.regexp_groupSpecifier = function(state) {
|
|
|
6695
6738
|
63
|
|
6696
6739
|
/* ? */
|
|
6697
6740
|
)) {
|
|
6698
|
-
if (this.regexp_eatGroupName(state)) {
|
|
6699
|
-
|
|
6741
|
+
if (!this.regexp_eatGroupName(state)) {
|
|
6742
|
+
state.raise("Invalid group");
|
|
6743
|
+
}
|
|
6744
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
6745
|
+
var known = state.groupNames[state.lastStringValue];
|
|
6746
|
+
if (known) {
|
|
6747
|
+
if (trackDisjunction) {
|
|
6748
|
+
for (var i = 0, list = known; i < list.length; i += 1) {
|
|
6749
|
+
var altID = list[i];
|
|
6750
|
+
if (!altID.separatedFrom(state.branchID)) {
|
|
6751
|
+
state.raise("Duplicate capture group name");
|
|
6752
|
+
}
|
|
6753
|
+
}
|
|
6754
|
+
} else {
|
|
6700
6755
|
state.raise("Duplicate capture group name");
|
|
6701
6756
|
}
|
|
6702
|
-
state.groupNames.push(state.lastStringValue);
|
|
6703
|
-
return;
|
|
6704
6757
|
}
|
|
6705
|
-
|
|
6758
|
+
if (trackDisjunction) {
|
|
6759
|
+
(known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
6760
|
+
} else {
|
|
6761
|
+
state.groupNames[state.lastStringValue] = true;
|
|
6762
|
+
}
|
|
6706
6763
|
}
|
|
6707
6764
|
};
|
|
6708
6765
|
pp$1.regexp_eatGroupName = function(state) {
|
|
@@ -8155,6 +8212,16 @@ pp.readInvalidTemplateToken = function() {
|
|
|
8155
8212
|
}
|
|
8156
8213
|
case "`":
|
|
8157
8214
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
8215
|
+
case "\r":
|
|
8216
|
+
if (this.input[this.pos + 1] === "\n") {
|
|
8217
|
+
++this.pos;
|
|
8218
|
+
}
|
|
8219
|
+
case "\n":
|
|
8220
|
+
case "\u2028":
|
|
8221
|
+
case "\u2029":
|
|
8222
|
+
++this.curLine;
|
|
8223
|
+
this.lineStart = this.pos + 1;
|
|
8224
|
+
break;
|
|
8158
8225
|
}
|
|
8159
8226
|
}
|
|
8160
8227
|
this.raise(this.start, "Unterminated template");
|
|
@@ -8223,6 +8290,10 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
8223
8290
|
return String.fromCharCode(octal);
|
|
8224
8291
|
}
|
|
8225
8292
|
if (isNewLine(ch)) {
|
|
8293
|
+
if (this.options.locations) {
|
|
8294
|
+
this.lineStart = this.pos;
|
|
8295
|
+
++this.curLine;
|
|
8296
|
+
}
|
|
8226
8297
|
return "";
|
|
8227
8298
|
}
|
|
8228
8299
|
return String.fromCharCode(ch);
|
|
@@ -8273,7 +8344,7 @@ pp.readWord = function() {
|
|
|
8273
8344
|
}
|
|
8274
8345
|
return this.finishToken(type, word);
|
|
8275
8346
|
};
|
|
8276
|
-
var version = "8.
|
|
8347
|
+
var version = "8.12.1";
|
|
8277
8348
|
Parser.acorn = {
|
|
8278
8349
|
Parser,
|
|
8279
8350
|
version,
|
|
@@ -8296,9 +8367,9 @@ Parser.acorn = {
|
|
|
8296
8367
|
nonASCIIwhitespace
|
|
8297
8368
|
};
|
|
8298
8369
|
|
|
8299
|
-
// node_modules/.pnpm/mlly@1.
|
|
8370
|
+
// node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
|
|
8300
8371
|
import { builtinModules, createRequire } from "module";
|
|
8301
|
-
import fs, { realpathSync, statSync,
|
|
8372
|
+
import fs, { realpathSync, statSync, promises } from "fs";
|
|
8302
8373
|
|
|
8303
8374
|
// node_modules/.pnpm/ufo@1.5.3/node_modules/ufo/dist/index.mjs
|
|
8304
8375
|
var r = String.fromCharCode;
|
|
@@ -8353,7 +8424,7 @@ var isAbsolute = function(p) {
|
|
|
8353
8424
|
return _IS_ABSOLUTE_RE.test(p);
|
|
8354
8425
|
};
|
|
8355
8426
|
|
|
8356
|
-
// node_modules/.pnpm/mlly@1.
|
|
8427
|
+
// node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
|
|
8357
8428
|
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "url";
|
|
8358
8429
|
import assert from "assert";
|
|
8359
8430
|
import process$1 from "process";
|
|
@@ -8483,21 +8554,21 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
8483
8554
|
codes.ERR_INVALID_PACKAGE_TARGET = createError(
|
|
8484
8555
|
"ERR_INVALID_PACKAGE_TARGET",
|
|
8485
8556
|
/**
|
|
8486
|
-
* @param {string}
|
|
8557
|
+
* @param {string} packagePath
|
|
8487
8558
|
* @param {string} key
|
|
8488
8559
|
* @param {unknown} target
|
|
8489
8560
|
* @param {boolean} [isImport=false]
|
|
8490
8561
|
* @param {string} [base]
|
|
8491
8562
|
*/
|
|
8492
|
-
(
|
|
8493
|
-
const
|
|
8563
|
+
(packagePath, key, target, isImport = false, base = void 0) => {
|
|
8564
|
+
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
8494
8565
|
if (key === ".") {
|
|
8495
8566
|
assert(isImport === false);
|
|
8496
|
-
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${
|
|
8567
|
+
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
8497
8568
|
}
|
|
8498
8569
|
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
|
|
8499
8570
|
target
|
|
8500
|
-
)} defined for '${key}' in the package config ${
|
|
8571
|
+
)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
8501
8572
|
},
|
|
8502
8573
|
Error
|
|
8503
8574
|
);
|
|
@@ -8533,14 +8604,14 @@ codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
|
|
|
8533
8604
|
codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
8534
8605
|
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
8535
8606
|
/**
|
|
8536
|
-
* @param {string}
|
|
8607
|
+
* @param {string} packagePath
|
|
8537
8608
|
* @param {string} subpath
|
|
8538
8609
|
* @param {string} [base]
|
|
8539
8610
|
*/
|
|
8540
|
-
(
|
|
8611
|
+
(packagePath, subpath, base = void 0) => {
|
|
8541
8612
|
if (subpath === ".")
|
|
8542
|
-
return `No "exports" main defined in ${
|
|
8543
|
-
return `Package subpath '${subpath}' is not defined by "exports" in ${
|
|
8613
|
+
return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
8614
|
+
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
8544
8615
|
},
|
|
8545
8616
|
Error
|
|
8546
8617
|
);
|
|
@@ -8549,14 +8620,19 @@ codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
|
|
|
8549
8620
|
"Directory import '%s' is not supported resolving ES modules imported from %s",
|
|
8550
8621
|
Error
|
|
8551
8622
|
);
|
|
8623
|
+
codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
|
|
8624
|
+
"ERR_UNSUPPORTED_RESOLVE_REQUEST",
|
|
8625
|
+
'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
|
|
8626
|
+
TypeError
|
|
8627
|
+
);
|
|
8552
8628
|
codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
8553
8629
|
"ERR_UNKNOWN_FILE_EXTENSION",
|
|
8554
8630
|
/**
|
|
8555
|
-
* @param {string}
|
|
8631
|
+
* @param {string} extension
|
|
8556
8632
|
* @param {string} path
|
|
8557
8633
|
*/
|
|
8558
|
-
(
|
|
8559
|
-
return `Unknown file extension "${
|
|
8634
|
+
(extension, path4) => {
|
|
8635
|
+
return `Unknown file extension "${extension}" for ${path4}`;
|
|
8560
8636
|
},
|
|
8561
8637
|
TypeError
|
|
8562
8638
|
);
|
|
@@ -8579,18 +8655,18 @@ codes.ERR_INVALID_ARG_VALUE = createError(
|
|
|
8579
8655
|
// Note: extra classes have been shaken out.
|
|
8580
8656
|
// , RangeError
|
|
8581
8657
|
);
|
|
8582
|
-
function createError(sym, value,
|
|
8658
|
+
function createError(sym, value, constructor) {
|
|
8583
8659
|
messages.set(sym, value);
|
|
8584
|
-
return makeNodeErrorWithCode(
|
|
8660
|
+
return makeNodeErrorWithCode(constructor, sym);
|
|
8585
8661
|
}
|
|
8586
8662
|
function makeNodeErrorWithCode(Base, key) {
|
|
8587
8663
|
return NodeError;
|
|
8588
|
-
function NodeError(...
|
|
8664
|
+
function NodeError(...parameters) {
|
|
8589
8665
|
const limit = Error.stackTraceLimit;
|
|
8590
8666
|
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
|
|
8591
8667
|
const error = new Base();
|
|
8592
8668
|
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
|
|
8593
|
-
const message = getMessage(key,
|
|
8669
|
+
const message = getMessage(key, parameters, error);
|
|
8594
8670
|
Object.defineProperties(error, {
|
|
8595
8671
|
// Note: no need to implement `kIsNodeError` symbol, would be hard,
|
|
8596
8672
|
// probably.
|
|
@@ -8628,10 +8704,10 @@ function isErrorStackTraceLimitWritable() {
|
|
|
8628
8704
|
}
|
|
8629
8705
|
return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
8630
8706
|
}
|
|
8631
|
-
function hideStackFrames(
|
|
8632
|
-
const hidden = nodeInternalPrefix +
|
|
8633
|
-
Object.defineProperty(
|
|
8634
|
-
return
|
|
8707
|
+
function hideStackFrames(wrappedFunction) {
|
|
8708
|
+
const hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
8709
|
+
Object.defineProperty(wrappedFunction, "name", { value: hidden });
|
|
8710
|
+
return wrappedFunction;
|
|
8635
8711
|
}
|
|
8636
8712
|
var captureLargerStackTrace = hideStackFrames(
|
|
8637
8713
|
/**
|
|
@@ -8650,27 +8726,27 @@ var captureLargerStackTrace = hideStackFrames(
|
|
|
8650
8726
|
return error;
|
|
8651
8727
|
}
|
|
8652
8728
|
);
|
|
8653
|
-
function getMessage(key,
|
|
8729
|
+
function getMessage(key, parameters, self) {
|
|
8654
8730
|
const message = messages.get(key);
|
|
8655
8731
|
assert(message !== void 0, "expected `message` to be found");
|
|
8656
8732
|
if (typeof message === "function") {
|
|
8657
8733
|
assert(
|
|
8658
|
-
message.length <=
|
|
8734
|
+
message.length <= parameters.length,
|
|
8659
8735
|
// Default options do not count.
|
|
8660
|
-
`Code: ${key}; The provided arguments length (${
|
|
8736
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
|
|
8661
8737
|
);
|
|
8662
|
-
return Reflect.apply(message, self,
|
|
8738
|
+
return Reflect.apply(message, self, parameters);
|
|
8663
8739
|
}
|
|
8664
8740
|
const regex = /%[dfijoOs]/g;
|
|
8665
8741
|
let expectedLength = 0;
|
|
8666
8742
|
while (regex.exec(message) !== null) expectedLength++;
|
|
8667
8743
|
assert(
|
|
8668
|
-
expectedLength ===
|
|
8669
|
-
`Code: ${key}; The provided arguments length (${
|
|
8744
|
+
expectedLength === parameters.length,
|
|
8745
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
|
|
8670
8746
|
);
|
|
8671
|
-
if (
|
|
8672
|
-
|
|
8673
|
-
return Reflect.apply(format2, null,
|
|
8747
|
+
if (parameters.length === 0) return message;
|
|
8748
|
+
parameters.unshift(message);
|
|
8749
|
+
return Reflect.apply(format2, null, parameters);
|
|
8674
8750
|
}
|
|
8675
8751
|
function determineSpecificType(value) {
|
|
8676
8752
|
if (value === null || value === void 0) {
|
|
@@ -8694,8 +8770,6 @@ function determineSpecificType(value) {
|
|
|
8694
8770
|
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
8695
8771
|
var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
|
|
8696
8772
|
var cache = /* @__PURE__ */ new Map();
|
|
8697
|
-
var reader = { read };
|
|
8698
|
-
var packageJsonReader = reader;
|
|
8699
8773
|
function read(jsonPath, { base, specifier }) {
|
|
8700
8774
|
const existing = cache.get(jsonPath);
|
|
8701
8775
|
if (existing) {
|
|
@@ -8761,21 +8835,20 @@ function read(jsonPath, { base, specifier }) {
|
|
|
8761
8835
|
return result;
|
|
8762
8836
|
}
|
|
8763
8837
|
function getPackageScopeConfig(resolved) {
|
|
8764
|
-
let packageJSONUrl = new URL
|
|
8838
|
+
let packageJSONUrl = new URL("package.json", resolved);
|
|
8765
8839
|
while (true) {
|
|
8766
8840
|
const packageJSONPath2 = packageJSONUrl.pathname;
|
|
8767
8841
|
if (packageJSONPath2.endsWith("node_modules/package.json")) {
|
|
8768
8842
|
break;
|
|
8769
8843
|
}
|
|
8770
|
-
const packageConfig =
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
);
|
|
8844
|
+
const packageConfig = read(fileURLToPath$1(packageJSONUrl), {
|
|
8845
|
+
specifier: resolved
|
|
8846
|
+
});
|
|
8774
8847
|
if (packageConfig.exists) {
|
|
8775
8848
|
return packageConfig;
|
|
8776
8849
|
}
|
|
8777
8850
|
const lastPackageJSONUrl = packageJSONUrl;
|
|
8778
|
-
packageJSONUrl = new URL
|
|
8851
|
+
packageJSONUrl = new URL("../package.json", packageJSONUrl);
|
|
8779
8852
|
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
|
|
8780
8853
|
break;
|
|
8781
8854
|
}
|
|
@@ -8784,16 +8857,11 @@ function getPackageScopeConfig(resolved) {
|
|
|
8784
8857
|
return {
|
|
8785
8858
|
pjsonPath: packageJSONPath,
|
|
8786
8859
|
exists: false,
|
|
8787
|
-
|
|
8788
|
-
name: void 0,
|
|
8789
|
-
type: "none",
|
|
8790
|
-
exports: void 0,
|
|
8791
|
-
imports: void 0
|
|
8860
|
+
type: "none"
|
|
8792
8861
|
};
|
|
8793
8862
|
}
|
|
8794
8863
|
function getPackageType(url) {
|
|
8795
|
-
|
|
8796
|
-
return packageConfig.type;
|
|
8864
|
+
return getPackageScopeConfig(url).type;
|
|
8797
8865
|
}
|
|
8798
8866
|
var { ERR_UNKNOWN_FILE_EXTENSION } = codes;
|
|
8799
8867
|
var hasOwnProperty2 = {}.hasOwnProperty;
|
|
@@ -8843,28 +8911,28 @@ function extname2(url) {
|
|
|
8843
8911
|
return "";
|
|
8844
8912
|
}
|
|
8845
8913
|
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
8846
|
-
const
|
|
8847
|
-
if (
|
|
8914
|
+
const value = extname2(url);
|
|
8915
|
+
if (value === ".js") {
|
|
8848
8916
|
const packageType = getPackageType(url);
|
|
8849
8917
|
if (packageType !== "none") {
|
|
8850
8918
|
return packageType;
|
|
8851
8919
|
}
|
|
8852
8920
|
return "commonjs";
|
|
8853
8921
|
}
|
|
8854
|
-
if (
|
|
8922
|
+
if (value === "") {
|
|
8855
8923
|
const packageType = getPackageType(url);
|
|
8856
8924
|
if (packageType === "none" || packageType === "commonjs") {
|
|
8857
8925
|
return "commonjs";
|
|
8858
8926
|
}
|
|
8859
8927
|
return "module";
|
|
8860
8928
|
}
|
|
8861
|
-
const format3 = extensionFormatMap[
|
|
8929
|
+
const format3 = extensionFormatMap[value];
|
|
8862
8930
|
if (format3) return format3;
|
|
8863
8931
|
if (ignoreErrors) {
|
|
8864
8932
|
return void 0;
|
|
8865
8933
|
}
|
|
8866
8934
|
const filepath = fileURLToPath$1(url);
|
|
8867
|
-
throw new ERR_UNKNOWN_FILE_EXTENSION(
|
|
8935
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
|
|
8868
8936
|
}
|
|
8869
8937
|
function getHttpProtocolModuleFormat() {
|
|
8870
8938
|
}
|
|
@@ -8884,14 +8952,15 @@ var {
|
|
|
8884
8952
|
ERR_MODULE_NOT_FOUND,
|
|
8885
8953
|
ERR_PACKAGE_IMPORT_NOT_DEFINED,
|
|
8886
8954
|
ERR_PACKAGE_PATH_NOT_EXPORTED,
|
|
8887
|
-
ERR_UNSUPPORTED_DIR_IMPORT
|
|
8955
|
+
ERR_UNSUPPORTED_DIR_IMPORT,
|
|
8956
|
+
ERR_UNSUPPORTED_RESOLVE_REQUEST
|
|
8888
8957
|
} = codes;
|
|
8889
8958
|
var own = {}.hasOwnProperty;
|
|
8890
8959
|
var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
|
|
8891
8960
|
var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
|
|
8892
8961
|
var invalidPackageNameRegEx = /^\.|%|\\/;
|
|
8893
8962
|
var patternRegEx = /\*/g;
|
|
8894
|
-
var
|
|
8963
|
+
var encodedSeparatorRegEx = /%2f|%5c/i;
|
|
8895
8964
|
var emittedPackageWarnings = /* @__PURE__ */ new Set();
|
|
8896
8965
|
var doubleSlashRegEx = /[/\\]{2}/;
|
|
8897
8966
|
function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
|
|
@@ -8913,21 +8982,21 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
8913
8982
|
const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
|
|
8914
8983
|
if (format3 !== "module") return;
|
|
8915
8984
|
const urlPath = fileURLToPath$1(url.href);
|
|
8916
|
-
const
|
|
8985
|
+
const packagePath = fileURLToPath$1(new URL$1(".", packageJsonUrl));
|
|
8917
8986
|
const basePath = fileURLToPath$1(base);
|
|
8918
8987
|
if (!main) {
|
|
8919
8988
|
process$1.emitWarning(
|
|
8920
|
-
`No "main" or "exports" field defined in the package.json for ${
|
|
8921
|
-
|
|
8989
|
+
`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
|
|
8990
|
+
packagePath.length
|
|
8922
8991
|
)}", imported from ${basePath}.
|
|
8923
8992
|
Default "index" lookups for the main are deprecated for ES modules.`,
|
|
8924
8993
|
"DeprecationWarning",
|
|
8925
8994
|
"DEP0151"
|
|
8926
8995
|
);
|
|
8927
|
-
} else if (path2.resolve(
|
|
8996
|
+
} else if (path2.resolve(packagePath, main) !== urlPath) {
|
|
8928
8997
|
process$1.emitWarning(
|
|
8929
|
-
`Package ${
|
|
8930
|
-
|
|
8998
|
+
`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
|
|
8999
|
+
packagePath.length
|
|
8931
9000
|
)}", imported from ${basePath}.
|
|
8932
9001
|
Automatic extension resolution of the "main" field is deprecated for ES modules.`,
|
|
8933
9002
|
"DeprecationWarning",
|
|
@@ -8939,7 +9008,6 @@ function tryStatSync(path4) {
|
|
|
8939
9008
|
try {
|
|
8940
9009
|
return statSync(path4);
|
|
8941
9010
|
} catch {
|
|
8942
|
-
return new Stats();
|
|
8943
9011
|
}
|
|
8944
9012
|
}
|
|
8945
9013
|
function fileExists(url) {
|
|
@@ -8993,7 +9061,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
8993
9061
|
);
|
|
8994
9062
|
}
|
|
8995
9063
|
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
8996
|
-
if (
|
|
9064
|
+
if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
|
|
8997
9065
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
8998
9066
|
resolved.pathname,
|
|
8999
9067
|
'must not include encoded "/" or "\\" characters',
|
|
@@ -9015,12 +9083,12 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
9015
9083
|
const stats = tryStatSync(
|
|
9016
9084
|
filePath.endsWith("/") ? filePath.slice(-1) : filePath
|
|
9017
9085
|
);
|
|
9018
|
-
if (stats.isDirectory()) {
|
|
9086
|
+
if (stats && stats.isDirectory()) {
|
|
9019
9087
|
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath$1(base));
|
|
9020
9088
|
error.url = String(resolved);
|
|
9021
9089
|
throw error;
|
|
9022
9090
|
}
|
|
9023
|
-
if (!stats.isFile()) {
|
|
9091
|
+
if (!stats || !stats.isFile()) {
|
|
9024
9092
|
const error = new ERR_MODULE_NOT_FOUND(
|
|
9025
9093
|
filePath || resolved.pathname,
|
|
9026
9094
|
base && fileURLToPath$1(base),
|
|
@@ -9270,13 +9338,13 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
|
9270
9338
|
const keys = Object.getOwnPropertyNames(exports);
|
|
9271
9339
|
let isConditionalSugar = false;
|
|
9272
9340
|
let i = 0;
|
|
9273
|
-
let
|
|
9274
|
-
while (++
|
|
9275
|
-
const key = keys[
|
|
9276
|
-
const
|
|
9341
|
+
let keyIndex = -1;
|
|
9342
|
+
while (++keyIndex < keys.length) {
|
|
9343
|
+
const key = keys[keyIndex];
|
|
9344
|
+
const currentIsConditionalSugar = key === "" || key[0] !== ".";
|
|
9277
9345
|
if (i++ === 0) {
|
|
9278
|
-
isConditionalSugar =
|
|
9279
|
-
} else if (isConditionalSugar !==
|
|
9346
|
+
isConditionalSugar = currentIsConditionalSugar;
|
|
9347
|
+
} else if (isConditionalSugar !== currentIsConditionalSugar) {
|
|
9280
9348
|
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
9281
9349
|
fileURLToPath$1(packageJsonUrl),
|
|
9282
9350
|
base,
|
|
@@ -9505,7 +9573,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
9505
9573
|
let lastPath;
|
|
9506
9574
|
do {
|
|
9507
9575
|
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
9508
|
-
if (!stat.isDirectory()) {
|
|
9576
|
+
if (!stat || !stat.isDirectory()) {
|
|
9509
9577
|
lastPath = packageJsonPath;
|
|
9510
9578
|
packageJsonUrl = new URL$1(
|
|
9511
9579
|
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
|
|
@@ -9514,10 +9582,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
9514
9582
|
packageJsonPath = fileURLToPath$1(packageJsonUrl);
|
|
9515
9583
|
continue;
|
|
9516
9584
|
}
|
|
9517
|
-
const packageConfig2 =
|
|
9518
|
-
base,
|
|
9519
|
-
specifier
|
|
9520
|
-
});
|
|
9585
|
+
const packageConfig2 = read(packageJsonPath, { base, specifier });
|
|
9521
9586
|
if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
|
|
9522
9587
|
return packageExportsResolve(
|
|
9523
9588
|
packageJsonUrl,
|
|
@@ -9550,19 +9615,29 @@ function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
|
9550
9615
|
}
|
|
9551
9616
|
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
9552
9617
|
const protocol = base.protocol;
|
|
9553
|
-
const
|
|
9618
|
+
const isData = protocol === "data:";
|
|
9619
|
+
const isRemote = isData || protocol === "http:" || protocol === "https:";
|
|
9554
9620
|
let resolved;
|
|
9555
9621
|
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
9556
|
-
|
|
9557
|
-
|
|
9622
|
+
try {
|
|
9623
|
+
resolved = new URL$1(specifier, base);
|
|
9624
|
+
} catch (error_) {
|
|
9625
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
9626
|
+
error.cause = error_;
|
|
9627
|
+
throw error;
|
|
9628
|
+
}
|
|
9629
|
+
} else if (protocol === "file:" && specifier[0] === "#") {
|
|
9558
9630
|
resolved = packageImportsResolve(specifier, base, conditions);
|
|
9559
9631
|
} else {
|
|
9560
9632
|
try {
|
|
9561
9633
|
resolved = new URL$1(specifier);
|
|
9562
|
-
} catch {
|
|
9563
|
-
if (!
|
|
9564
|
-
|
|
9634
|
+
} catch (error_) {
|
|
9635
|
+
if (isRemote && !builtinModules.includes(specifier)) {
|
|
9636
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
9637
|
+
error.cause = error_;
|
|
9638
|
+
throw error;
|
|
9565
9639
|
}
|
|
9640
|
+
resolved = packageResolve(specifier, base, conditions);
|
|
9566
9641
|
}
|
|
9567
9642
|
}
|
|
9568
9643
|
assert(resolved !== void 0, "expected to be defined");
|