@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/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3040,7 +3040,7 @@ var import_node_fs2 = __toESM(require("fs"), 1);
|
|
|
3040
3040
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
3041
3041
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
3042
3042
|
|
|
3043
|
-
// node_modules/.pnpm/acorn@8.
|
|
3043
|
+
// node_modules/.pnpm/acorn@8.12.1/node_modules/acorn/dist/acorn.mjs
|
|
3044
3044
|
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];
|
|
3045
3045
|
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];
|
|
3046
3046
|
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";
|
|
@@ -3588,7 +3588,7 @@ Parser.tokenizer = function tokenizer(input, options) {
|
|
|
3588
3588
|
};
|
|
3589
3589
|
Object.defineProperties(Parser.prototype, prototypeAccessors);
|
|
3590
3590
|
var pp$9 = Parser.prototype;
|
|
3591
|
-
var literal = /^(?:'((
|
|
3591
|
+
var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
3592
3592
|
pp$9.strictDirective = function(start) {
|
|
3593
3593
|
if (this.options.ecmaVersion < 5) {
|
|
3594
3594
|
return false;
|
|
@@ -3947,16 +3947,21 @@ pp$8.parseForStatement = function(node) {
|
|
|
3947
3947
|
return this.parseFor(node, init$1);
|
|
3948
3948
|
}
|
|
3949
3949
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
3950
|
+
var containsEsc = this.containsEsc;
|
|
3950
3951
|
var refDestructuringErrors = new DestructuringErrors();
|
|
3951
|
-
var
|
|
3952
|
+
var initPos = this.start;
|
|
3953
|
+
var init = awaitAt > -1 ? this.parseExprSubscripts(refDestructuringErrors, "await") : this.parseExpression(true, refDestructuringErrors);
|
|
3952
3954
|
if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
3953
|
-
if (
|
|
3955
|
+
if (awaitAt > -1) {
|
|
3954
3956
|
if (this.type === types$1._in) {
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3957
|
+
this.unexpected(awaitAt);
|
|
3958
|
+
}
|
|
3959
|
+
node.await = true;
|
|
3960
|
+
} else if (isForOf && this.options.ecmaVersion >= 8) {
|
|
3961
|
+
if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") {
|
|
3962
|
+
this.unexpected();
|
|
3963
|
+
} else if (this.options.ecmaVersion >= 9) {
|
|
3964
|
+
node.await = false;
|
|
3960
3965
|
}
|
|
3961
3966
|
}
|
|
3962
3967
|
if (startsWithLet && isForOf) {
|
|
@@ -5307,7 +5312,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
5307
5312
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
5308
5313
|
if (update) {
|
|
5309
5314
|
this.checkLValSimple(node.argument);
|
|
5310
|
-
} else if (this.strict && node.operator === "delete" && node.argument
|
|
5315
|
+
} else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument)) {
|
|
5311
5316
|
this.raiseRecoverable(node.start, "Deleting local variable in strict mode");
|
|
5312
5317
|
} else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) {
|
|
5313
5318
|
this.raiseRecoverable(node.start, "Private fields can not be deleted");
|
|
@@ -5348,8 +5353,11 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
5348
5353
|
return expr;
|
|
5349
5354
|
}
|
|
5350
5355
|
};
|
|
5356
|
+
function isLocalVariableAccess(node) {
|
|
5357
|
+
return node.type === "Identifier" || node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression);
|
|
5358
|
+
}
|
|
5351
5359
|
function isPrivateFieldAccess(node) {
|
|
5352
|
-
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression);
|
|
5360
|
+
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression);
|
|
5353
5361
|
}
|
|
5354
5362
|
pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
|
|
5355
5363
|
var startPos = this.start, startLoc = this.startLoc;
|
|
@@ -5735,7 +5743,7 @@ pp$5.parseTemplateElement = function(ref2) {
|
|
|
5735
5743
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
5736
5744
|
}
|
|
5737
5745
|
elem.value = {
|
|
5738
|
-
raw: this.value,
|
|
5746
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
5739
5747
|
cooked: null
|
|
5740
5748
|
};
|
|
5741
5749
|
} else {
|
|
@@ -6329,6 +6337,23 @@ var ecmaVersion;
|
|
|
6329
6337
|
var i;
|
|
6330
6338
|
var list;
|
|
6331
6339
|
var pp$1 = Parser.prototype;
|
|
6340
|
+
var BranchID = function BranchID2(parent, base) {
|
|
6341
|
+
this.parent = parent;
|
|
6342
|
+
this.base = base || this;
|
|
6343
|
+
};
|
|
6344
|
+
BranchID.prototype.separatedFrom = function separatedFrom(alt) {
|
|
6345
|
+
for (var self = this; self; self = self.parent) {
|
|
6346
|
+
for (var other = alt; other; other = other.parent) {
|
|
6347
|
+
if (self.base === other.base && self !== other) {
|
|
6348
|
+
return true;
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
}
|
|
6352
|
+
return false;
|
|
6353
|
+
};
|
|
6354
|
+
BranchID.prototype.sibling = function sibling() {
|
|
6355
|
+
return new BranchID(this.parent, this.base);
|
|
6356
|
+
};
|
|
6332
6357
|
var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
6333
6358
|
this.parser = parser;
|
|
6334
6359
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
@@ -6345,8 +6370,9 @@ var RegExpValidationState = function RegExpValidationState2(parser) {
|
|
|
6345
6370
|
this.lastAssertionIsQuantifiable = false;
|
|
6346
6371
|
this.numCapturingParens = 0;
|
|
6347
6372
|
this.maxBackReference = 0;
|
|
6348
|
-
this.groupNames =
|
|
6373
|
+
this.groupNames = /* @__PURE__ */ Object.create(null);
|
|
6349
6374
|
this.backReferenceNames = [];
|
|
6375
|
+
this.branchID = null;
|
|
6350
6376
|
};
|
|
6351
6377
|
RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {
|
|
6352
6378
|
var unicodeSets = flags.indexOf("v") !== -1;
|
|
@@ -6452,9 +6478,15 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
6452
6478
|
this.raise(state.start, "Invalid regular expression flag");
|
|
6453
6479
|
}
|
|
6454
6480
|
};
|
|
6481
|
+
function hasProp(obj) {
|
|
6482
|
+
for (var _ in obj) {
|
|
6483
|
+
return true;
|
|
6484
|
+
}
|
|
6485
|
+
return false;
|
|
6486
|
+
}
|
|
6455
6487
|
pp$1.validateRegExpPattern = function(state) {
|
|
6456
6488
|
this.regexp_pattern(state);
|
|
6457
|
-
if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames
|
|
6489
|
+
if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
|
|
6458
6490
|
state.switchN = true;
|
|
6459
6491
|
this.regexp_pattern(state);
|
|
6460
6492
|
}
|
|
@@ -6466,8 +6498,9 @@ pp$1.regexp_pattern = function(state) {
|
|
|
6466
6498
|
state.lastAssertionIsQuantifiable = false;
|
|
6467
6499
|
state.numCapturingParens = 0;
|
|
6468
6500
|
state.maxBackReference = 0;
|
|
6469
|
-
state.groupNames
|
|
6501
|
+
state.groupNames = /* @__PURE__ */ Object.create(null);
|
|
6470
6502
|
state.backReferenceNames.length = 0;
|
|
6503
|
+
state.branchID = null;
|
|
6471
6504
|
this.regexp_disjunction(state);
|
|
6472
6505
|
if (state.pos !== state.source.length) {
|
|
6473
6506
|
if (state.eat(
|
|
@@ -6491,19 +6524,29 @@ pp$1.regexp_pattern = function(state) {
|
|
|
6491
6524
|
}
|
|
6492
6525
|
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
6493
6526
|
var name = list[i];
|
|
6494
|
-
if (state.groupNames
|
|
6527
|
+
if (!state.groupNames[name]) {
|
|
6495
6528
|
state.raise("Invalid named capture referenced");
|
|
6496
6529
|
}
|
|
6497
6530
|
}
|
|
6498
6531
|
};
|
|
6499
6532
|
pp$1.regexp_disjunction = function(state) {
|
|
6533
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
6534
|
+
if (trackDisjunction) {
|
|
6535
|
+
state.branchID = new BranchID(state.branchID, null);
|
|
6536
|
+
}
|
|
6500
6537
|
this.regexp_alternative(state);
|
|
6501
6538
|
while (state.eat(
|
|
6502
6539
|
124
|
|
6503
6540
|
/* | */
|
|
6504
6541
|
)) {
|
|
6542
|
+
if (trackDisjunction) {
|
|
6543
|
+
state.branchID = state.branchID.sibling();
|
|
6544
|
+
}
|
|
6505
6545
|
this.regexp_alternative(state);
|
|
6506
6546
|
}
|
|
6547
|
+
if (trackDisjunction) {
|
|
6548
|
+
state.branchID = state.branchID.parent;
|
|
6549
|
+
}
|
|
6507
6550
|
if (this.regexp_eatQuantifier(state, true)) {
|
|
6508
6551
|
state.raise("Nothing to repeat");
|
|
6509
6552
|
}
|
|
@@ -6762,14 +6805,28 @@ pp$1.regexp_groupSpecifier = function(state) {
|
|
|
6762
6805
|
63
|
|
6763
6806
|
/* ? */
|
|
6764
6807
|
)) {
|
|
6765
|
-
if (this.regexp_eatGroupName(state)) {
|
|
6766
|
-
|
|
6808
|
+
if (!this.regexp_eatGroupName(state)) {
|
|
6809
|
+
state.raise("Invalid group");
|
|
6810
|
+
}
|
|
6811
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
6812
|
+
var known = state.groupNames[state.lastStringValue];
|
|
6813
|
+
if (known) {
|
|
6814
|
+
if (trackDisjunction) {
|
|
6815
|
+
for (var i = 0, list = known; i < list.length; i += 1) {
|
|
6816
|
+
var altID = list[i];
|
|
6817
|
+
if (!altID.separatedFrom(state.branchID)) {
|
|
6818
|
+
state.raise("Duplicate capture group name");
|
|
6819
|
+
}
|
|
6820
|
+
}
|
|
6821
|
+
} else {
|
|
6767
6822
|
state.raise("Duplicate capture group name");
|
|
6768
6823
|
}
|
|
6769
|
-
state.groupNames.push(state.lastStringValue);
|
|
6770
|
-
return;
|
|
6771
6824
|
}
|
|
6772
|
-
|
|
6825
|
+
if (trackDisjunction) {
|
|
6826
|
+
(known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
6827
|
+
} else {
|
|
6828
|
+
state.groupNames[state.lastStringValue] = true;
|
|
6829
|
+
}
|
|
6773
6830
|
}
|
|
6774
6831
|
};
|
|
6775
6832
|
pp$1.regexp_eatGroupName = function(state) {
|
|
@@ -8222,6 +8279,16 @@ pp.readInvalidTemplateToken = function() {
|
|
|
8222
8279
|
}
|
|
8223
8280
|
case "`":
|
|
8224
8281
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
8282
|
+
case "\r":
|
|
8283
|
+
if (this.input[this.pos + 1] === "\n") {
|
|
8284
|
+
++this.pos;
|
|
8285
|
+
}
|
|
8286
|
+
case "\n":
|
|
8287
|
+
case "\u2028":
|
|
8288
|
+
case "\u2029":
|
|
8289
|
+
++this.curLine;
|
|
8290
|
+
this.lineStart = this.pos + 1;
|
|
8291
|
+
break;
|
|
8225
8292
|
}
|
|
8226
8293
|
}
|
|
8227
8294
|
this.raise(this.start, "Unterminated template");
|
|
@@ -8290,6 +8357,10 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
8290
8357
|
return String.fromCharCode(octal);
|
|
8291
8358
|
}
|
|
8292
8359
|
if (isNewLine(ch)) {
|
|
8360
|
+
if (this.options.locations) {
|
|
8361
|
+
this.lineStart = this.pos;
|
|
8362
|
+
++this.curLine;
|
|
8363
|
+
}
|
|
8293
8364
|
return "";
|
|
8294
8365
|
}
|
|
8295
8366
|
return String.fromCharCode(ch);
|
|
@@ -8340,7 +8411,7 @@ pp.readWord = function() {
|
|
|
8340
8411
|
}
|
|
8341
8412
|
return this.finishToken(type, word);
|
|
8342
8413
|
};
|
|
8343
|
-
var version = "8.
|
|
8414
|
+
var version = "8.12.1";
|
|
8344
8415
|
Parser.acorn = {
|
|
8345
8416
|
Parser,
|
|
8346
8417
|
version,
|
|
@@ -8363,7 +8434,7 @@ Parser.acorn = {
|
|
|
8363
8434
|
nonASCIIwhitespace
|
|
8364
8435
|
};
|
|
8365
8436
|
|
|
8366
|
-
// node_modules/.pnpm/mlly@1.
|
|
8437
|
+
// node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
|
|
8367
8438
|
var import_node_module = require("module");
|
|
8368
8439
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
8369
8440
|
|
|
@@ -8420,7 +8491,7 @@ var isAbsolute = function(p) {
|
|
|
8420
8491
|
return _IS_ABSOLUTE_RE.test(p);
|
|
8421
8492
|
};
|
|
8422
8493
|
|
|
8423
|
-
// node_modules/.pnpm/mlly@1.
|
|
8494
|
+
// node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
|
|
8424
8495
|
var import_node_url = require("url");
|
|
8425
8496
|
var import_node_assert = __toESM(require("assert"), 1);
|
|
8426
8497
|
var import_node_process = __toESM(require("process"), 1);
|
|
@@ -8550,21 +8621,21 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
8550
8621
|
codes.ERR_INVALID_PACKAGE_TARGET = createError(
|
|
8551
8622
|
"ERR_INVALID_PACKAGE_TARGET",
|
|
8552
8623
|
/**
|
|
8553
|
-
* @param {string}
|
|
8624
|
+
* @param {string} packagePath
|
|
8554
8625
|
* @param {string} key
|
|
8555
8626
|
* @param {unknown} target
|
|
8556
8627
|
* @param {boolean} [isImport=false]
|
|
8557
8628
|
* @param {string} [base]
|
|
8558
8629
|
*/
|
|
8559
|
-
(
|
|
8560
|
-
const
|
|
8630
|
+
(packagePath, key, target, isImport = false, base = void 0) => {
|
|
8631
|
+
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
8561
8632
|
if (key === ".") {
|
|
8562
8633
|
(0, import_node_assert.default)(isImport === false);
|
|
8563
|
-
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${
|
|
8634
|
+
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 "./"' : ""}`;
|
|
8564
8635
|
}
|
|
8565
8636
|
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
|
|
8566
8637
|
target
|
|
8567
|
-
)} defined for '${key}' in the package config ${
|
|
8638
|
+
)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
8568
8639
|
},
|
|
8569
8640
|
Error
|
|
8570
8641
|
);
|
|
@@ -8600,14 +8671,14 @@ codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
|
|
|
8600
8671
|
codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
8601
8672
|
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
8602
8673
|
/**
|
|
8603
|
-
* @param {string}
|
|
8674
|
+
* @param {string} packagePath
|
|
8604
8675
|
* @param {string} subpath
|
|
8605
8676
|
* @param {string} [base]
|
|
8606
8677
|
*/
|
|
8607
|
-
(
|
|
8678
|
+
(packagePath, subpath, base = void 0) => {
|
|
8608
8679
|
if (subpath === ".")
|
|
8609
|
-
return `No "exports" main defined in ${
|
|
8610
|
-
return `Package subpath '${subpath}' is not defined by "exports" in ${
|
|
8680
|
+
return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
8681
|
+
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
8611
8682
|
},
|
|
8612
8683
|
Error
|
|
8613
8684
|
);
|
|
@@ -8616,14 +8687,19 @@ codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
|
|
|
8616
8687
|
"Directory import '%s' is not supported resolving ES modules imported from %s",
|
|
8617
8688
|
Error
|
|
8618
8689
|
);
|
|
8690
|
+
codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
|
|
8691
|
+
"ERR_UNSUPPORTED_RESOLVE_REQUEST",
|
|
8692
|
+
'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
|
|
8693
|
+
TypeError
|
|
8694
|
+
);
|
|
8619
8695
|
codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
8620
8696
|
"ERR_UNKNOWN_FILE_EXTENSION",
|
|
8621
8697
|
/**
|
|
8622
|
-
* @param {string}
|
|
8698
|
+
* @param {string} extension
|
|
8623
8699
|
* @param {string} path
|
|
8624
8700
|
*/
|
|
8625
|
-
(
|
|
8626
|
-
return `Unknown file extension "${
|
|
8701
|
+
(extension, path4) => {
|
|
8702
|
+
return `Unknown file extension "${extension}" for ${path4}`;
|
|
8627
8703
|
},
|
|
8628
8704
|
TypeError
|
|
8629
8705
|
);
|
|
@@ -8646,18 +8722,18 @@ codes.ERR_INVALID_ARG_VALUE = createError(
|
|
|
8646
8722
|
// Note: extra classes have been shaken out.
|
|
8647
8723
|
// , RangeError
|
|
8648
8724
|
);
|
|
8649
|
-
function createError(sym, value,
|
|
8725
|
+
function createError(sym, value, constructor) {
|
|
8650
8726
|
messages.set(sym, value);
|
|
8651
|
-
return makeNodeErrorWithCode(
|
|
8727
|
+
return makeNodeErrorWithCode(constructor, sym);
|
|
8652
8728
|
}
|
|
8653
8729
|
function makeNodeErrorWithCode(Base, key) {
|
|
8654
8730
|
return NodeError;
|
|
8655
|
-
function NodeError(...
|
|
8731
|
+
function NodeError(...parameters) {
|
|
8656
8732
|
const limit = Error.stackTraceLimit;
|
|
8657
8733
|
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
|
|
8658
8734
|
const error = new Base();
|
|
8659
8735
|
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
|
|
8660
|
-
const message = getMessage(key,
|
|
8736
|
+
const message = getMessage(key, parameters, error);
|
|
8661
8737
|
Object.defineProperties(error, {
|
|
8662
8738
|
// Note: no need to implement `kIsNodeError` symbol, would be hard,
|
|
8663
8739
|
// probably.
|
|
@@ -8695,10 +8771,10 @@ function isErrorStackTraceLimitWritable() {
|
|
|
8695
8771
|
}
|
|
8696
8772
|
return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
8697
8773
|
}
|
|
8698
|
-
function hideStackFrames(
|
|
8699
|
-
const hidden = nodeInternalPrefix +
|
|
8700
|
-
Object.defineProperty(
|
|
8701
|
-
return
|
|
8774
|
+
function hideStackFrames(wrappedFunction) {
|
|
8775
|
+
const hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
8776
|
+
Object.defineProperty(wrappedFunction, "name", { value: hidden });
|
|
8777
|
+
return wrappedFunction;
|
|
8702
8778
|
}
|
|
8703
8779
|
var captureLargerStackTrace = hideStackFrames(
|
|
8704
8780
|
/**
|
|
@@ -8717,27 +8793,27 @@ var captureLargerStackTrace = hideStackFrames(
|
|
|
8717
8793
|
return error;
|
|
8718
8794
|
}
|
|
8719
8795
|
);
|
|
8720
|
-
function getMessage(key,
|
|
8796
|
+
function getMessage(key, parameters, self) {
|
|
8721
8797
|
const message = messages.get(key);
|
|
8722
8798
|
(0, import_node_assert.default)(message !== void 0, "expected `message` to be found");
|
|
8723
8799
|
if (typeof message === "function") {
|
|
8724
8800
|
(0, import_node_assert.default)(
|
|
8725
|
-
message.length <=
|
|
8801
|
+
message.length <= parameters.length,
|
|
8726
8802
|
// Default options do not count.
|
|
8727
|
-
`Code: ${key}; The provided arguments length (${
|
|
8803
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
|
|
8728
8804
|
);
|
|
8729
|
-
return Reflect.apply(message, self,
|
|
8805
|
+
return Reflect.apply(message, self, parameters);
|
|
8730
8806
|
}
|
|
8731
8807
|
const regex = /%[dfijoOs]/g;
|
|
8732
8808
|
let expectedLength = 0;
|
|
8733
8809
|
while (regex.exec(message) !== null) expectedLength++;
|
|
8734
8810
|
(0, import_node_assert.default)(
|
|
8735
|
-
expectedLength ===
|
|
8736
|
-
`Code: ${key}; The provided arguments length (${
|
|
8811
|
+
expectedLength === parameters.length,
|
|
8812
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
|
|
8737
8813
|
);
|
|
8738
|
-
if (
|
|
8739
|
-
|
|
8740
|
-
return Reflect.apply(import_node_util.format, null,
|
|
8814
|
+
if (parameters.length === 0) return message;
|
|
8815
|
+
parameters.unshift(message);
|
|
8816
|
+
return Reflect.apply(import_node_util.format, null, parameters);
|
|
8741
8817
|
}
|
|
8742
8818
|
function determineSpecificType(value) {
|
|
8743
8819
|
if (value === null || value === void 0) {
|
|
@@ -8761,8 +8837,6 @@ function determineSpecificType(value) {
|
|
|
8761
8837
|
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
8762
8838
|
var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
|
|
8763
8839
|
var cache = /* @__PURE__ */ new Map();
|
|
8764
|
-
var reader = { read };
|
|
8765
|
-
var packageJsonReader = reader;
|
|
8766
8840
|
function read(jsonPath, { base, specifier }) {
|
|
8767
8841
|
const existing = cache.get(jsonPath);
|
|
8768
8842
|
if (existing) {
|
|
@@ -8828,21 +8902,20 @@ function read(jsonPath, { base, specifier }) {
|
|
|
8828
8902
|
return result;
|
|
8829
8903
|
}
|
|
8830
8904
|
function getPackageScopeConfig(resolved) {
|
|
8831
|
-
let packageJSONUrl = new
|
|
8905
|
+
let packageJSONUrl = new URL("package.json", resolved);
|
|
8832
8906
|
while (true) {
|
|
8833
8907
|
const packageJSONPath2 = packageJSONUrl.pathname;
|
|
8834
8908
|
if (packageJSONPath2.endsWith("node_modules/package.json")) {
|
|
8835
8909
|
break;
|
|
8836
8910
|
}
|
|
8837
|
-
const packageConfig =
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
);
|
|
8911
|
+
const packageConfig = read((0, import_node_url.fileURLToPath)(packageJSONUrl), {
|
|
8912
|
+
specifier: resolved
|
|
8913
|
+
});
|
|
8841
8914
|
if (packageConfig.exists) {
|
|
8842
8915
|
return packageConfig;
|
|
8843
8916
|
}
|
|
8844
8917
|
const lastPackageJSONUrl = packageJSONUrl;
|
|
8845
|
-
packageJSONUrl = new
|
|
8918
|
+
packageJSONUrl = new URL("../package.json", packageJSONUrl);
|
|
8846
8919
|
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
|
|
8847
8920
|
break;
|
|
8848
8921
|
}
|
|
@@ -8851,16 +8924,11 @@ function getPackageScopeConfig(resolved) {
|
|
|
8851
8924
|
return {
|
|
8852
8925
|
pjsonPath: packageJSONPath,
|
|
8853
8926
|
exists: false,
|
|
8854
|
-
|
|
8855
|
-
name: void 0,
|
|
8856
|
-
type: "none",
|
|
8857
|
-
exports: void 0,
|
|
8858
|
-
imports: void 0
|
|
8927
|
+
type: "none"
|
|
8859
8928
|
};
|
|
8860
8929
|
}
|
|
8861
8930
|
function getPackageType(url) {
|
|
8862
|
-
|
|
8863
|
-
return packageConfig.type;
|
|
8931
|
+
return getPackageScopeConfig(url).type;
|
|
8864
8932
|
}
|
|
8865
8933
|
var { ERR_UNKNOWN_FILE_EXTENSION } = codes;
|
|
8866
8934
|
var hasOwnProperty2 = {}.hasOwnProperty;
|
|
@@ -8910,28 +8978,28 @@ function extname2(url) {
|
|
|
8910
8978
|
return "";
|
|
8911
8979
|
}
|
|
8912
8980
|
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
8913
|
-
const
|
|
8914
|
-
if (
|
|
8981
|
+
const value = extname2(url);
|
|
8982
|
+
if (value === ".js") {
|
|
8915
8983
|
const packageType = getPackageType(url);
|
|
8916
8984
|
if (packageType !== "none") {
|
|
8917
8985
|
return packageType;
|
|
8918
8986
|
}
|
|
8919
8987
|
return "commonjs";
|
|
8920
8988
|
}
|
|
8921
|
-
if (
|
|
8989
|
+
if (value === "") {
|
|
8922
8990
|
const packageType = getPackageType(url);
|
|
8923
8991
|
if (packageType === "none" || packageType === "commonjs") {
|
|
8924
8992
|
return "commonjs";
|
|
8925
8993
|
}
|
|
8926
8994
|
return "module";
|
|
8927
8995
|
}
|
|
8928
|
-
const format3 = extensionFormatMap[
|
|
8996
|
+
const format3 = extensionFormatMap[value];
|
|
8929
8997
|
if (format3) return format3;
|
|
8930
8998
|
if (ignoreErrors) {
|
|
8931
8999
|
return void 0;
|
|
8932
9000
|
}
|
|
8933
9001
|
const filepath = (0, import_node_url.fileURLToPath)(url);
|
|
8934
|
-
throw new ERR_UNKNOWN_FILE_EXTENSION(
|
|
9002
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
|
|
8935
9003
|
}
|
|
8936
9004
|
function getHttpProtocolModuleFormat() {
|
|
8937
9005
|
}
|
|
@@ -8951,14 +9019,15 @@ var {
|
|
|
8951
9019
|
ERR_MODULE_NOT_FOUND,
|
|
8952
9020
|
ERR_PACKAGE_IMPORT_NOT_DEFINED,
|
|
8953
9021
|
ERR_PACKAGE_PATH_NOT_EXPORTED,
|
|
8954
|
-
ERR_UNSUPPORTED_DIR_IMPORT
|
|
9022
|
+
ERR_UNSUPPORTED_DIR_IMPORT,
|
|
9023
|
+
ERR_UNSUPPORTED_RESOLVE_REQUEST
|
|
8955
9024
|
} = codes;
|
|
8956
9025
|
var own = {}.hasOwnProperty;
|
|
8957
9026
|
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;
|
|
8958
9027
|
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;
|
|
8959
9028
|
var invalidPackageNameRegEx = /^\.|%|\\/;
|
|
8960
9029
|
var patternRegEx = /\*/g;
|
|
8961
|
-
var
|
|
9030
|
+
var encodedSeparatorRegEx = /%2f|%5c/i;
|
|
8962
9031
|
var emittedPackageWarnings = /* @__PURE__ */ new Set();
|
|
8963
9032
|
var doubleSlashRegEx = /[/\\]{2}/;
|
|
8964
9033
|
function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
|
|
@@ -8980,21 +9049,21 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
8980
9049
|
const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
|
|
8981
9050
|
if (format3 !== "module") return;
|
|
8982
9051
|
const urlPath = (0, import_node_url.fileURLToPath)(url.href);
|
|
8983
|
-
const
|
|
9052
|
+
const packagePath = (0, import_node_url.fileURLToPath)(new import_node_url.URL(".", packageJsonUrl));
|
|
8984
9053
|
const basePath = (0, import_node_url.fileURLToPath)(base);
|
|
8985
9054
|
if (!main) {
|
|
8986
9055
|
import_node_process.default.emitWarning(
|
|
8987
|
-
`No "main" or "exports" field defined in the package.json for ${
|
|
8988
|
-
|
|
9056
|
+
`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
|
|
9057
|
+
packagePath.length
|
|
8989
9058
|
)}", imported from ${basePath}.
|
|
8990
9059
|
Default "index" lookups for the main are deprecated for ES modules.`,
|
|
8991
9060
|
"DeprecationWarning",
|
|
8992
9061
|
"DEP0151"
|
|
8993
9062
|
);
|
|
8994
|
-
} else if (import_node_path.default.resolve(
|
|
9063
|
+
} else if (import_node_path.default.resolve(packagePath, main) !== urlPath) {
|
|
8995
9064
|
import_node_process.default.emitWarning(
|
|
8996
|
-
`Package ${
|
|
8997
|
-
|
|
9065
|
+
`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
|
|
9066
|
+
packagePath.length
|
|
8998
9067
|
)}", imported from ${basePath}.
|
|
8999
9068
|
Automatic extension resolution of the "main" field is deprecated for ES modules.`,
|
|
9000
9069
|
"DeprecationWarning",
|
|
@@ -9006,7 +9075,6 @@ function tryStatSync(path4) {
|
|
|
9006
9075
|
try {
|
|
9007
9076
|
return (0, import_node_fs.statSync)(path4);
|
|
9008
9077
|
} catch {
|
|
9009
|
-
return new import_node_fs.Stats();
|
|
9010
9078
|
}
|
|
9011
9079
|
}
|
|
9012
9080
|
function fileExists(url) {
|
|
@@ -9060,7 +9128,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
9060
9128
|
);
|
|
9061
9129
|
}
|
|
9062
9130
|
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
9063
|
-
if (
|
|
9131
|
+
if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
|
|
9064
9132
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
9065
9133
|
resolved.pathname,
|
|
9066
9134
|
'must not include encoded "/" or "\\" characters',
|
|
@@ -9082,12 +9150,12 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
9082
9150
|
const stats = tryStatSync(
|
|
9083
9151
|
filePath.endsWith("/") ? filePath.slice(-1) : filePath
|
|
9084
9152
|
);
|
|
9085
|
-
if (stats.isDirectory()) {
|
|
9153
|
+
if (stats && stats.isDirectory()) {
|
|
9086
9154
|
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, import_node_url.fileURLToPath)(base));
|
|
9087
9155
|
error.url = String(resolved);
|
|
9088
9156
|
throw error;
|
|
9089
9157
|
}
|
|
9090
|
-
if (!stats.isFile()) {
|
|
9158
|
+
if (!stats || !stats.isFile()) {
|
|
9091
9159
|
const error = new ERR_MODULE_NOT_FOUND(
|
|
9092
9160
|
filePath || resolved.pathname,
|
|
9093
9161
|
base && (0, import_node_url.fileURLToPath)(base),
|
|
@@ -9337,13 +9405,13 @@ function isConditionalExportsMainSugar(exports2, packageJsonUrl, base) {
|
|
|
9337
9405
|
const keys = Object.getOwnPropertyNames(exports2);
|
|
9338
9406
|
let isConditionalSugar = false;
|
|
9339
9407
|
let i = 0;
|
|
9340
|
-
let
|
|
9341
|
-
while (++
|
|
9342
|
-
const key = keys[
|
|
9343
|
-
const
|
|
9408
|
+
let keyIndex = -1;
|
|
9409
|
+
while (++keyIndex < keys.length) {
|
|
9410
|
+
const key = keys[keyIndex];
|
|
9411
|
+
const currentIsConditionalSugar = key === "" || key[0] !== ".";
|
|
9344
9412
|
if (i++ === 0) {
|
|
9345
|
-
isConditionalSugar =
|
|
9346
|
-
} else if (isConditionalSugar !==
|
|
9413
|
+
isConditionalSugar = currentIsConditionalSugar;
|
|
9414
|
+
} else if (isConditionalSugar !== currentIsConditionalSugar) {
|
|
9347
9415
|
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
9348
9416
|
(0, import_node_url.fileURLToPath)(packageJsonUrl),
|
|
9349
9417
|
base,
|
|
@@ -9572,7 +9640,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
9572
9640
|
let lastPath;
|
|
9573
9641
|
do {
|
|
9574
9642
|
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
9575
|
-
if (!stat.isDirectory()) {
|
|
9643
|
+
if (!stat || !stat.isDirectory()) {
|
|
9576
9644
|
lastPath = packageJsonPath;
|
|
9577
9645
|
packageJsonUrl = new import_node_url.URL(
|
|
9578
9646
|
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
|
|
@@ -9581,10 +9649,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
9581
9649
|
packageJsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl);
|
|
9582
9650
|
continue;
|
|
9583
9651
|
}
|
|
9584
|
-
const packageConfig2 =
|
|
9585
|
-
base,
|
|
9586
|
-
specifier
|
|
9587
|
-
});
|
|
9652
|
+
const packageConfig2 = read(packageJsonPath, { base, specifier });
|
|
9588
9653
|
if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
|
|
9589
9654
|
return packageExportsResolve(
|
|
9590
9655
|
packageJsonUrl,
|
|
@@ -9617,19 +9682,29 @@ function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
|
9617
9682
|
}
|
|
9618
9683
|
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
9619
9684
|
const protocol = base.protocol;
|
|
9620
|
-
const
|
|
9685
|
+
const isData = protocol === "data:";
|
|
9686
|
+
const isRemote = isData || protocol === "http:" || protocol === "https:";
|
|
9621
9687
|
let resolved;
|
|
9622
9688
|
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
9623
|
-
|
|
9624
|
-
|
|
9689
|
+
try {
|
|
9690
|
+
resolved = new import_node_url.URL(specifier, base);
|
|
9691
|
+
} catch (error_) {
|
|
9692
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
9693
|
+
error.cause = error_;
|
|
9694
|
+
throw error;
|
|
9695
|
+
}
|
|
9696
|
+
} else if (protocol === "file:" && specifier[0] === "#") {
|
|
9625
9697
|
resolved = packageImportsResolve(specifier, base, conditions);
|
|
9626
9698
|
} else {
|
|
9627
9699
|
try {
|
|
9628
9700
|
resolved = new import_node_url.URL(specifier);
|
|
9629
|
-
} catch {
|
|
9630
|
-
if (!
|
|
9631
|
-
|
|
9701
|
+
} catch (error_) {
|
|
9702
|
+
if (isRemote && !import_node_module.builtinModules.includes(specifier)) {
|
|
9703
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
9704
|
+
error.cause = error_;
|
|
9705
|
+
throw error;
|
|
9632
9706
|
}
|
|
9707
|
+
resolved = packageResolve(specifier, base, conditions);
|
|
9633
9708
|
}
|
|
9634
9709
|
}
|
|
9635
9710
|
(0, import_node_assert.default)(resolved !== void 0, "expected to be defined");
|