@putout/bundle 3.10.0 → 3.11.1
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/bundle/putout-iife.js +1 -1
- package/bundle/putout.js +891 -402
- package/bundle/putout.min.js +1 -1
- package/package.json +2 -2
package/bundle/putout.js
CHANGED
|
@@ -2640,7 +2640,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2640
2640
|
// Check that value is an object with an inspect function on it
|
|
2641
2641
|
if (ctx.customInspect &&
|
|
2642
2642
|
value &&
|
|
2643
|
-
isFunction$
|
|
2643
|
+
isFunction$4(value.inspect) &&
|
|
2644
2644
|
// Filter out the util module, it's inspect function is special
|
|
2645
2645
|
value.inspect !== inspect &&
|
|
2646
2646
|
// Also filter out any prototype objects using the circular check.
|
|
@@ -2675,7 +2675,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2675
2675
|
|
|
2676
2676
|
// Some type of object without properties can be shortcutted.
|
|
2677
2677
|
if (keys.length === 0) {
|
|
2678
|
-
if (isFunction$
|
|
2678
|
+
if (isFunction$4(value)) {
|
|
2679
2679
|
var name = value.name ? ': ' + value.name : '';
|
|
2680
2680
|
return ctx.stylize('[Function' + name + ']', 'special');
|
|
2681
2681
|
}
|
|
@@ -2699,7 +2699,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
|
|
2701
2701
|
// Make functions say that they are functions
|
|
2702
|
-
if (isFunction$
|
|
2702
|
+
if (isFunction$4(value)) {
|
|
2703
2703
|
var n = value.name ? ': ' + value.name : '';
|
|
2704
2704
|
base = ' [Function' + n + ']';
|
|
2705
2705
|
}
|
|
@@ -2921,7 +2921,7 @@ function isError(e) {
|
|
|
2921
2921
|
(objectToString$1(e) === '[object Error]' || e instanceof Error);
|
|
2922
2922
|
}
|
|
2923
2923
|
|
|
2924
|
-
function isFunction$
|
|
2924
|
+
function isFunction$4(arg) {
|
|
2925
2925
|
return typeof arg === 'function';
|
|
2926
2926
|
}
|
|
2927
2927
|
|
|
@@ -3092,7 +3092,7 @@ var _polyfillNode_util = {
|
|
|
3092
3092
|
log: log$6,
|
|
3093
3093
|
isBuffer: isBuffer,
|
|
3094
3094
|
isPrimitive: isPrimitive$1,
|
|
3095
|
-
isFunction: isFunction$
|
|
3095
|
+
isFunction: isFunction$4,
|
|
3096
3096
|
isError: isError,
|
|
3097
3097
|
isDate: isDate,
|
|
3098
3098
|
isObject: isObject$5,
|
|
@@ -3128,7 +3128,7 @@ var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({
|
|
|
3128
3128
|
isBuffer: isBuffer,
|
|
3129
3129
|
isDate: isDate,
|
|
3130
3130
|
isError: isError,
|
|
3131
|
-
isFunction: isFunction$
|
|
3131
|
+
isFunction: isFunction$4,
|
|
3132
3132
|
isNull: isNull$1,
|
|
3133
3133
|
isNullOrUndefined: isNullOrUndefined,
|
|
3134
3134
|
isNumber: isNumber$3,
|
|
@@ -3543,10 +3543,10 @@ var __toESM = function(mod, isNodeMode, target) {
|
|
|
3543
3543
|
// file that has been converted to a CommonJS file using a Babel-
|
|
3544
3544
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
3545
3545
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
3546
|
-
|
|
3546
|
+
__defProp(target, "default", {
|
|
3547
3547
|
value: mod,
|
|
3548
3548
|
enumerable: true
|
|
3549
|
-
})
|
|
3549
|
+
}) , mod);
|
|
3550
3550
|
};
|
|
3551
3551
|
var __toCommonJS = function(mod) {
|
|
3552
3552
|
return __copyProps(__defProp({}, "__esModule", {
|
|
@@ -7685,7 +7685,7 @@ __export(lib_exports, {
|
|
|
7685
7685
|
return declaredPredicate;
|
|
7686
7686
|
},
|
|
7687
7687
|
Decorator: function() {
|
|
7688
|
-
return decorator;
|
|
7688
|
+
return decorator$1;
|
|
7689
7689
|
},
|
|
7690
7690
|
Directive: function() {
|
|
7691
7691
|
return directive;
|
|
@@ -9593,7 +9593,7 @@ __export(lib_exports, {
|
|
|
9593
9593
|
return declaredPredicate;
|
|
9594
9594
|
},
|
|
9595
9595
|
decorator: function() {
|
|
9596
|
-
return decorator;
|
|
9596
|
+
return decorator$1;
|
|
9597
9597
|
},
|
|
9598
9598
|
directive: function() {
|
|
9599
9599
|
return directive;
|
|
@@ -9791,7 +9791,7 @@ __export(lib_exports, {
|
|
|
9791
9791
|
return isAssignmentExpression;
|
|
9792
9792
|
},
|
|
9793
9793
|
isAssignmentPattern: function() {
|
|
9794
|
-
return isAssignmentPattern$
|
|
9794
|
+
return isAssignmentPattern$2;
|
|
9795
9795
|
},
|
|
9796
9796
|
isAwaitExpression: function() {
|
|
9797
9797
|
return isAwaitExpression$1;
|
|
@@ -9836,7 +9836,7 @@ __export(lib_exports, {
|
|
|
9836
9836
|
return isBreakStatement;
|
|
9837
9837
|
},
|
|
9838
9838
|
isCallExpression: function() {
|
|
9839
|
-
return isCallExpression$
|
|
9839
|
+
return isCallExpression$4;
|
|
9840
9840
|
},
|
|
9841
9841
|
isCatchClause: function() {
|
|
9842
9842
|
return isCatchClause;
|
|
@@ -10046,7 +10046,7 @@ __export(lib_exports, {
|
|
|
10046
10046
|
return isForXStatement;
|
|
10047
10047
|
},
|
|
10048
10048
|
isFunction: function() {
|
|
10049
|
-
return isFunction$
|
|
10049
|
+
return isFunction$3;
|
|
10050
10050
|
},
|
|
10051
10051
|
isFunctionDeclaration: function() {
|
|
10052
10052
|
return isFunctionDeclaration$1;
|
|
@@ -10067,7 +10067,7 @@ __export(lib_exports, {
|
|
|
10067
10067
|
return isGenericTypeAnnotation;
|
|
10068
10068
|
},
|
|
10069
10069
|
isIdentifier: function() {
|
|
10070
|
-
return isIdentifier$
|
|
10070
|
+
return isIdentifier$c;
|
|
10071
10071
|
},
|
|
10072
10072
|
isIfStatement: function() {
|
|
10073
10073
|
return isIfStatement$2;
|
|
@@ -10187,7 +10187,7 @@ __export(lib_exports, {
|
|
|
10187
10187
|
return isLoop;
|
|
10188
10188
|
},
|
|
10189
10189
|
isMemberExpression: function() {
|
|
10190
|
-
return isMemberExpression$
|
|
10190
|
+
return isMemberExpression$6;
|
|
10191
10191
|
},
|
|
10192
10192
|
isMetaProperty: function() {
|
|
10193
10193
|
return isMetaProperty;
|
|
@@ -10244,7 +10244,7 @@ __export(lib_exports, {
|
|
|
10244
10244
|
return isNumericLiteral;
|
|
10245
10245
|
},
|
|
10246
10246
|
isObjectExpression: function() {
|
|
10247
|
-
return isObjectExpression$
|
|
10247
|
+
return isObjectExpression$5;
|
|
10248
10248
|
},
|
|
10249
10249
|
isObjectMember: function() {
|
|
10250
10250
|
return isObjectMember;
|
|
@@ -10364,7 +10364,7 @@ __export(lib_exports, {
|
|
|
10364
10364
|
return isSpecifierDefault;
|
|
10365
10365
|
},
|
|
10366
10366
|
isSpreadElement: function() {
|
|
10367
|
-
return isSpreadElement$
|
|
10367
|
+
return isSpreadElement$4;
|
|
10368
10368
|
},
|
|
10369
10369
|
isSpreadProperty: function() {
|
|
10370
10370
|
return isSpreadProperty;
|
|
@@ -10379,7 +10379,7 @@ __export(lib_exports, {
|
|
|
10379
10379
|
return isStaticBlock;
|
|
10380
10380
|
},
|
|
10381
10381
|
isStringLiteral: function() {
|
|
10382
|
-
return isStringLiteral$
|
|
10382
|
+
return isStringLiteral$9;
|
|
10383
10383
|
},
|
|
10384
10384
|
isStringLiteralTypeAnnotation: function() {
|
|
10385
10385
|
return isStringLiteralTypeAnnotation;
|
|
@@ -10613,7 +10613,7 @@ __export(lib_exports, {
|
|
|
10613
10613
|
return isTemplateElement$4;
|
|
10614
10614
|
},
|
|
10615
10615
|
isTemplateLiteral: function() {
|
|
10616
|
-
return isTemplateLiteral$
|
|
10616
|
+
return isTemplateLiteral$4;
|
|
10617
10617
|
},
|
|
10618
10618
|
isTerminatorless: function() {
|
|
10619
10619
|
return isTerminatorless;
|
|
@@ -11501,7 +11501,7 @@ __export(lib_exports, {
|
|
|
11501
11501
|
return yieldExpression;
|
|
11502
11502
|
}
|
|
11503
11503
|
});
|
|
11504
|
-
var import_to_fast_properties = __toESM(require_to_fast_properties()
|
|
11504
|
+
var import_to_fast_properties = __toESM(require_to_fast_properties());
|
|
11505
11505
|
// node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
11506
11506
|
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
11507
11507
|
var nonASCIIidentifierChars = "\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
@@ -12485,38 +12485,6 @@ function isKeyword(word) {
|
|
|
12485
12485
|
var _isDigit = function isDigit(code2) {
|
|
12486
12486
|
return code2 >= 48 && code2 <= 57;
|
|
12487
12487
|
};
|
|
12488
|
-
var forbiddenNumericSeparatorSiblings = {
|
|
12489
|
-
decBinOct: /* @__PURE__ */ new Set([
|
|
12490
|
-
46,
|
|
12491
|
-
66,
|
|
12492
|
-
69,
|
|
12493
|
-
79,
|
|
12494
|
-
95,
|
|
12495
|
-
98,
|
|
12496
|
-
101,
|
|
12497
|
-
111
|
|
12498
|
-
]),
|
|
12499
|
-
hex: /* @__PURE__ */ new Set([
|
|
12500
|
-
46,
|
|
12501
|
-
88,
|
|
12502
|
-
95,
|
|
12503
|
-
120
|
|
12504
|
-
])
|
|
12505
|
-
};
|
|
12506
|
-
var isAllowedNumericSeparatorSibling = {
|
|
12507
|
-
bin: function(ch) {
|
|
12508
|
-
return ch === 48 || ch === 49;
|
|
12509
|
-
},
|
|
12510
|
-
oct: function(ch) {
|
|
12511
|
-
return ch >= 48 && ch <= 55;
|
|
12512
|
-
},
|
|
12513
|
-
dec: function(ch) {
|
|
12514
|
-
return ch >= 48 && ch <= 57;
|
|
12515
|
-
},
|
|
12516
|
-
hex: function(ch) {
|
|
12517
|
-
return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102;
|
|
12518
|
-
}
|
|
12519
|
-
};
|
|
12520
12488
|
function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
12521
12489
|
var initialPos = pos;
|
|
12522
12490
|
var initialLineStart = lineStart;
|
|
@@ -12556,7 +12524,7 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
|
12556
12524
|
++curLine;
|
|
12557
12525
|
lineStart = pos;
|
|
12558
12526
|
} else if (ch === 10 || ch === 13) {
|
|
12559
|
-
|
|
12527
|
+
{
|
|
12560
12528
|
out += input.slice(chunkStart, pos) + "\n";
|
|
12561
12529
|
++pos;
|
|
12562
12530
|
if (ch === 13 && input.charCodeAt(pos) === 10) {
|
|
@@ -12564,8 +12532,6 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
|
12564
12532
|
}
|
|
12565
12533
|
++curLine;
|
|
12566
12534
|
chunkStart = lineStart = pos;
|
|
12567
|
-
} else {
|
|
12568
|
-
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
12569
12535
|
}
|
|
12570
12536
|
} else {
|
|
12571
12537
|
++pos;
|
|
@@ -12580,10 +12546,9 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
|
12580
12546
|
};
|
|
12581
12547
|
}
|
|
12582
12548
|
function isStringEnd(type, ch, input, pos) {
|
|
12583
|
-
|
|
12549
|
+
{
|
|
12584
12550
|
return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
|
|
12585
12551
|
}
|
|
12586
|
-
return ch === (type === "double" ? 34 : 39);
|
|
12587
12552
|
}
|
|
12588
12553
|
function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
12589
12554
|
var throwOnInvalid = !inTemplate;
|
|
@@ -12636,10 +12601,8 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
12636
12601
|
return res("");
|
|
12637
12602
|
case 56:
|
|
12638
12603
|
case 57:
|
|
12639
|
-
|
|
12604
|
+
{
|
|
12640
12605
|
return res(null);
|
|
12641
|
-
} else {
|
|
12642
|
-
errors.strictNumericEscape(pos - 1, lineStart, curLine);
|
|
12643
12606
|
}
|
|
12644
12607
|
default:
|
|
12645
12608
|
if (ch >= 48 && ch <= 55) {
|
|
@@ -12654,10 +12617,8 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
12654
12617
|
pos += octalStr.length - 1;
|
|
12655
12618
|
var next = input.charCodeAt(pos);
|
|
12656
12619
|
if (octalStr !== "0" || next === 56 || next === 57) {
|
|
12657
|
-
|
|
12620
|
+
{
|
|
12658
12621
|
return res(null);
|
|
12659
|
-
} else {
|
|
12660
|
-
errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
12661
12622
|
}
|
|
12662
12623
|
}
|
|
12663
12624
|
return res(String.fromCharCode(octal));
|
|
@@ -12671,9 +12632,7 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
|
|
|
12671
12632
|
var ref;
|
|
12672
12633
|
ref = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid), n2 = ref.n, pos = ref.pos;
|
|
12673
12634
|
if (n2 === null) {
|
|
12674
|
-
|
|
12675
|
-
errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
12676
|
-
} else {
|
|
12635
|
+
{
|
|
12677
12636
|
pos = initialPos - 1;
|
|
12678
12637
|
}
|
|
12679
12638
|
}
|
|
@@ -12684,31 +12643,20 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
|
|
|
12684
12643
|
}
|
|
12685
12644
|
function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
|
|
12686
12645
|
var start = pos;
|
|
12687
|
-
var forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
|
|
12688
|
-
var isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
|
|
12689
12646
|
var invalid = false;
|
|
12690
12647
|
var total = 0;
|
|
12691
12648
|
for(var i = 0, e = len == null ? Infinity : len; i < e; ++i){
|
|
12692
12649
|
var code2 = input.charCodeAt(pos);
|
|
12693
12650
|
var val = void 0;
|
|
12694
12651
|
if (code2 === 95 && allowNumSeparator !== "bail") {
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
n: null,
|
|
12700
|
-
pos: pos
|
|
12701
|
-
};
|
|
12702
|
-
errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
|
|
12703
|
-
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
|
|
12704
|
-
if (bailOnError) return {
|
|
12652
|
+
input.charCodeAt(pos - 1);
|
|
12653
|
+
input.charCodeAt(pos + 1);
|
|
12654
|
+
{
|
|
12655
|
+
return {
|
|
12705
12656
|
n: null,
|
|
12706
12657
|
pos: pos
|
|
12707
12658
|
};
|
|
12708
|
-
errors.unexpectedNumericSeparator(pos, lineStart, curLine);
|
|
12709
12659
|
}
|
|
12710
|
-
++pos;
|
|
12711
|
-
continue;
|
|
12712
12660
|
}
|
|
12713
12661
|
if (code2 >= 97) {
|
|
12714
12662
|
val = code2 - 97 + 10;
|
|
@@ -12757,9 +12705,7 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
12757
12705
|
ref = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors), code2 = ref.code, pos = ref.pos;
|
|
12758
12706
|
++pos;
|
|
12759
12707
|
if (code2 !== null && code2 > 1114111) {
|
|
12760
|
-
|
|
12761
|
-
errors.invalidCodePoint(pos, lineStart, curLine);
|
|
12762
|
-
} else {
|
|
12708
|
+
{
|
|
12763
12709
|
return {
|
|
12764
12710
|
code: null,
|
|
12765
12711
|
pos: pos
|
|
@@ -12875,7 +12821,7 @@ function isBreakStatement(node, opts) {
|
|
|
12875
12821
|
if (node.type !== "BreakStatement") return false;
|
|
12876
12822
|
return opts == null || shallowEqual(node, opts);
|
|
12877
12823
|
}
|
|
12878
|
-
function isCallExpression$
|
|
12824
|
+
function isCallExpression$4(node, opts) {
|
|
12879
12825
|
if (!node) return false;
|
|
12880
12826
|
if (node.type !== "CallExpression") return false;
|
|
12881
12827
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -12940,7 +12886,7 @@ function isFunctionExpression$1(node, opts) {
|
|
|
12940
12886
|
if (node.type !== "FunctionExpression") return false;
|
|
12941
12887
|
return opts == null || shallowEqual(node, opts);
|
|
12942
12888
|
}
|
|
12943
|
-
function isIdentifier$
|
|
12889
|
+
function isIdentifier$c(node, opts) {
|
|
12944
12890
|
if (!node) return false;
|
|
12945
12891
|
if (node.type !== "Identifier") return false;
|
|
12946
12892
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -12955,7 +12901,7 @@ function isLabeledStatement$1(node, opts) {
|
|
|
12955
12901
|
if (node.type !== "LabeledStatement") return false;
|
|
12956
12902
|
return opts == null || shallowEqual(node, opts);
|
|
12957
12903
|
}
|
|
12958
|
-
function isStringLiteral$
|
|
12904
|
+
function isStringLiteral$9(node, opts) {
|
|
12959
12905
|
if (!node) return false;
|
|
12960
12906
|
if (node.type !== "StringLiteral") return false;
|
|
12961
12907
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -12985,7 +12931,7 @@ function isLogicalExpression(node, opts) {
|
|
|
12985
12931
|
if (node.type !== "LogicalExpression") return false;
|
|
12986
12932
|
return opts == null || shallowEqual(node, opts);
|
|
12987
12933
|
}
|
|
12988
|
-
function isMemberExpression$
|
|
12934
|
+
function isMemberExpression$6(node, opts) {
|
|
12989
12935
|
if (!node) return false;
|
|
12990
12936
|
if (node.type !== "MemberExpression") return false;
|
|
12991
12937
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -13000,7 +12946,7 @@ function isProgram$4(node, opts) {
|
|
|
13000
12946
|
if (node.type !== "Program") return false;
|
|
13001
12947
|
return opts == null || shallowEqual(node, opts);
|
|
13002
12948
|
}
|
|
13003
|
-
function isObjectExpression$
|
|
12949
|
+
function isObjectExpression$5(node, opts) {
|
|
13004
12950
|
if (!node) return false;
|
|
13005
12951
|
if (node.type !== "ObjectExpression") return false;
|
|
13006
12952
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -13090,7 +13036,7 @@ function isWithStatement(node, opts) {
|
|
|
13090
13036
|
if (node.type !== "WithStatement") return false;
|
|
13091
13037
|
return opts == null || shallowEqual(node, opts);
|
|
13092
13038
|
}
|
|
13093
|
-
function isAssignmentPattern$
|
|
13039
|
+
function isAssignmentPattern$2(node, opts) {
|
|
13094
13040
|
if (!node) return false;
|
|
13095
13041
|
if (node.type !== "AssignmentPattern") return false;
|
|
13096
13042
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -13185,7 +13131,7 @@ function isObjectPattern$3(node, opts) {
|
|
|
13185
13131
|
if (node.type !== "ObjectPattern") return false;
|
|
13186
13132
|
return opts == null || shallowEqual(node, opts);
|
|
13187
13133
|
}
|
|
13188
|
-
function isSpreadElement$
|
|
13134
|
+
function isSpreadElement$4(node, opts) {
|
|
13189
13135
|
if (!node) return false;
|
|
13190
13136
|
if (node.type !== "SpreadElement") return false;
|
|
13191
13137
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -13205,7 +13151,7 @@ function isTemplateElement$4(node, opts) {
|
|
|
13205
13151
|
if (node.type !== "TemplateElement") return false;
|
|
13206
13152
|
return opts == null || shallowEqual(node, opts);
|
|
13207
13153
|
}
|
|
13208
|
-
function isTemplateLiteral$
|
|
13154
|
+
function isTemplateLiteral$4(node, opts) {
|
|
13209
13155
|
if (!node) return false;
|
|
13210
13156
|
if (node.type !== "TemplateLiteral") return false;
|
|
13211
13157
|
return opts == null || shallowEqual(node, opts);
|
|
@@ -14512,7 +14458,7 @@ function isForXStatement(node, opts) {
|
|
|
14512
14458
|
}
|
|
14513
14459
|
return opts == null || shallowEqual(node, opts);
|
|
14514
14460
|
}
|
|
14515
|
-
function isFunction$
|
|
14461
|
+
function isFunction$3(node, opts) {
|
|
14516
14462
|
if (!node) return false;
|
|
14517
14463
|
switch(node.type){
|
|
14518
14464
|
case "FunctionDeclaration":
|
|
@@ -15248,11 +15194,11 @@ function isModuleDeclaration(node, opts) {
|
|
|
15248
15194
|
return isImportOrExportDeclaration(node, opts);
|
|
15249
15195
|
}
|
|
15250
15196
|
function matchesPattern$1(member, match, allowPartial) {
|
|
15251
|
-
if (!isMemberExpression$
|
|
15197
|
+
if (!isMemberExpression$6(member)) return false;
|
|
15252
15198
|
var parts = Array.isArray(match) ? match : match.split(".");
|
|
15253
15199
|
var nodes2 = [];
|
|
15254
15200
|
var node;
|
|
15255
|
-
for(node = member; isMemberExpression$
|
|
15201
|
+
for(node = member; isMemberExpression$6(node); node = node.object){
|
|
15256
15202
|
nodes2.push(node.property);
|
|
15257
15203
|
}
|
|
15258
15204
|
nodes2.push(node);
|
|
@@ -15261,9 +15207,9 @@ function matchesPattern$1(member, match, allowPartial) {
|
|
|
15261
15207
|
for(var i = 0, j = nodes2.length - 1; i < parts.length; i++, j--){
|
|
15262
15208
|
var node2 = nodes2[j];
|
|
15263
15209
|
var value1 = void 0;
|
|
15264
|
-
if (isIdentifier$
|
|
15210
|
+
if (isIdentifier$c(node2)) {
|
|
15265
15211
|
value1 = node2.name;
|
|
15266
|
-
} else if (isStringLiteral$
|
|
15212
|
+
} else if (isStringLiteral$9(node2)) {
|
|
15267
15213
|
value1 = node2.value;
|
|
15268
15214
|
} else if (isThisExpression(node2)) {
|
|
15269
15215
|
value1 = "this";
|
|
@@ -21671,7 +21617,7 @@ function importAttribute$1(key, value1) {
|
|
|
21671
21617
|
value: value1
|
|
21672
21618
|
});
|
|
21673
21619
|
}
|
|
21674
|
-
function decorator(expression2) {
|
|
21620
|
+
function decorator$1(expression2) {
|
|
21675
21621
|
return validateNode({
|
|
21676
21622
|
type: "Decorator",
|
|
21677
21623
|
expression: expression2
|
|
@@ -23205,7 +23151,7 @@ function createTypeAnnotationBasedOnTypeof(type) {
|
|
|
23205
23151
|
throw new Error("Invalid typeof value: " + type);
|
|
23206
23152
|
}
|
|
23207
23153
|
function getQualifiedName$1(node) {
|
|
23208
|
-
return isIdentifier$
|
|
23154
|
+
return isIdentifier$c(node) ? node.name : "".concat(node.id.name, ".").concat(getQualifiedName$1(node.qualification));
|
|
23209
23155
|
}
|
|
23210
23156
|
function removeTypeDuplicates$1(nodesIn) {
|
|
23211
23157
|
var nodes2 = Array.from(nodesIn);
|
|
@@ -23307,7 +23253,7 @@ function createFlowUnionType(types2) {
|
|
|
23307
23253
|
}
|
|
23308
23254
|
}
|
|
23309
23255
|
function getQualifiedName(node) {
|
|
23310
|
-
return isIdentifier$
|
|
23256
|
+
return isIdentifier$c(node) ? node.name : "".concat(node.right.name, ".").concat(getQualifiedName(node.left));
|
|
23311
23257
|
}
|
|
23312
23258
|
function removeTypeDuplicates(nodesIn) {
|
|
23313
23259
|
var nodes2 = Array.from(nodesIn);
|
|
@@ -23440,7 +23386,7 @@ function cloneNodeInternal(node) {
|
|
|
23440
23386
|
var newNode = {
|
|
23441
23387
|
type: node.type
|
|
23442
23388
|
};
|
|
23443
|
-
if (isIdentifier$
|
|
23389
|
+
if (isIdentifier$c(node)) {
|
|
23444
23390
|
newNode.name = node.name;
|
|
23445
23391
|
if (hasOwn(node, "optional") && typeof node.optional === "boolean") {
|
|
23446
23392
|
newNode.optional = node.optional;
|
|
@@ -23639,7 +23585,7 @@ function toBlock(node, parent) {
|
|
|
23639
23585
|
blockNodes = [];
|
|
23640
23586
|
} else {
|
|
23641
23587
|
if (!isStatement$5(node)) {
|
|
23642
|
-
if (isFunction$
|
|
23588
|
+
if (isFunction$3(parent)) {
|
|
23643
23589
|
node = returnStatement$1(node);
|
|
23644
23590
|
} else {
|
|
23645
23591
|
node = expressionStatement$1(node);
|
|
@@ -23696,7 +23642,7 @@ function toBindingIdentifierName(name) {
|
|
|
23696
23642
|
}
|
|
23697
23643
|
function toComputedKey(node) {
|
|
23698
23644
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : node.key || node.property;
|
|
23699
|
-
if (!node.computed && isIdentifier$
|
|
23645
|
+
if (!node.computed && isIdentifier$c(key)) key = stringLiteral(key.name);
|
|
23700
23646
|
return key;
|
|
23701
23647
|
}
|
|
23702
23648
|
function toExpression$1(node) {
|
|
@@ -23708,7 +23654,7 @@ function toExpression$1(node) {
|
|
|
23708
23654
|
}
|
|
23709
23655
|
if (isClass(node)) {
|
|
23710
23656
|
node.type = "ClassExpression";
|
|
23711
|
-
} else if (isFunction$
|
|
23657
|
+
} else if (isFunction$3(node)) {
|
|
23712
23658
|
node.type = "FunctionExpression";
|
|
23713
23659
|
}
|
|
23714
23660
|
if (!isExpression$2(node)) {
|
|
@@ -23852,9 +23798,9 @@ function toKeyAlias(node) {
|
|
|
23852
23798
|
var alias;
|
|
23853
23799
|
if (node.kind === "method") {
|
|
23854
23800
|
return toKeyAlias.increment() + "";
|
|
23855
|
-
} else if (isIdentifier$
|
|
23801
|
+
} else if (isIdentifier$c(key)) {
|
|
23856
23802
|
alias = key.name;
|
|
23857
|
-
} else if (isStringLiteral$
|
|
23803
|
+
} else if (isStringLiteral$9(key)) {
|
|
23858
23804
|
alias = JSON.stringify(key.value);
|
|
23859
23805
|
} else {
|
|
23860
23806
|
alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));
|
|
@@ -23884,7 +23830,7 @@ function toStatement$1(node, ignore) {
|
|
|
23884
23830
|
if (isClass(node)) {
|
|
23885
23831
|
mustHaveId = true;
|
|
23886
23832
|
newType = "ClassDeclaration";
|
|
23887
|
-
} else if (isFunction$
|
|
23833
|
+
} else if (isFunction$3(node)) {
|
|
23888
23834
|
mustHaveId = true;
|
|
23889
23835
|
newType = "FunctionDeclaration";
|
|
23890
23836
|
} else if (isAssignmentExpression(node)) {
|
|
@@ -24078,7 +24024,7 @@ function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) {
|
|
|
24078
24024
|
continue;
|
|
24079
24025
|
}
|
|
24080
24026
|
var keys = getBindingIdentifiers.keys[id.type];
|
|
24081
|
-
if (isIdentifier$
|
|
24027
|
+
if (isIdentifier$c(id)) {
|
|
24082
24028
|
if (duplicates) {
|
|
24083
24029
|
var _ids = ids[id.name] = ids[id.name] || [];
|
|
24084
24030
|
_ids.push(id);
|
|
@@ -24320,7 +24266,7 @@ function isBlockScoped(node) {
|
|
|
24320
24266
|
}
|
|
24321
24267
|
function isImmutable(node) {
|
|
24322
24268
|
if (isType(node.type, "Immutable")) return true;
|
|
24323
|
-
if (isIdentifier$
|
|
24269
|
+
if (isIdentifier$c(node)) {
|
|
24324
24270
|
if (node.name === "undefined") {
|
|
24325
24271
|
return true;
|
|
24326
24272
|
} else {
|
|
@@ -24500,16 +24446,16 @@ function isReferenced(node, parent, grandparent) {
|
|
|
24500
24446
|
return true;
|
|
24501
24447
|
}
|
|
24502
24448
|
function isScope(node, parent) {
|
|
24503
|
-
if (isBlockStatement$4(node) && (isFunction$
|
|
24449
|
+
if (isBlockStatement$4(node) && (isFunction$3(parent) || isCatchClause(parent))) {
|
|
24504
24450
|
return false;
|
|
24505
24451
|
}
|
|
24506
|
-
if (isPattern(node) && (isFunction$
|
|
24452
|
+
if (isPattern(node) && (isFunction$3(parent) || isCatchClause(parent))) {
|
|
24507
24453
|
return true;
|
|
24508
24454
|
}
|
|
24509
24455
|
return isScopable(node);
|
|
24510
24456
|
}
|
|
24511
24457
|
function isSpecifierDefault(specifier) {
|
|
24512
|
-
return isImportDefaultSpecifier$1(specifier) || isIdentifier$
|
|
24458
|
+
return isImportDefaultSpecifier$1(specifier) || isIdentifier$c(specifier.imported || specifier.exported, {
|
|
24513
24459
|
name: "default"
|
|
24514
24460
|
});
|
|
24515
24461
|
}
|
|
@@ -25483,7 +25429,7 @@ var TokContext = function TokContext(token, preserveSpace) {
|
|
|
25483
25429
|
this.token = token;
|
|
25484
25430
|
this.preserveSpace = !!preserveSpace;
|
|
25485
25431
|
};
|
|
25486
|
-
var types$
|
|
25432
|
+
var types$u = {
|
|
25487
25433
|
brace: new TokContext("{"),
|
|
25488
25434
|
j_oTag: new TokContext("<tag"),
|
|
25489
25435
|
j_cTag: new TokContext("</tag"),
|
|
@@ -27639,7 +27585,7 @@ var State$2 = /*#__PURE__*/ function() {
|
|
|
27639
27585
|
__publicField(this, "lastTokEndLoc", null);
|
|
27640
27586
|
__publicField(this, "lastTokStartLoc", null);
|
|
27641
27587
|
__publicField(this, "context", [
|
|
27642
|
-
types$
|
|
27588
|
+
types$u.brace
|
|
27643
27589
|
]);
|
|
27644
27590
|
__publicField(this, "firstInvalidTemplateEscapePos", null);
|
|
27645
27591
|
__publicField(this, "strictErrors", /* @__PURE__ */ new Map());
|
|
@@ -32250,7 +32196,7 @@ var flow$1 = function(superClass) {
|
|
|
32250
32196
|
if (!jsx2.error) return jsx2.node;
|
|
32251
32197
|
var context = this.state.context;
|
|
32252
32198
|
var currentContext = context[context.length - 1];
|
|
32253
|
-
if (currentContext === types$
|
|
32199
|
+
if (currentContext === types$u.j_oTag || currentContext === types$u.j_expr) {
|
|
32254
32200
|
context.pop();
|
|
32255
32201
|
}
|
|
32256
32202
|
}
|
|
@@ -33467,9 +33413,9 @@ var jsx$3 = function(superClass) {
|
|
|
33467
33413
|
switch(this.state.type){
|
|
33468
33414
|
case 5:
|
|
33469
33415
|
node = this.startNode();
|
|
33470
|
-
this.setContext(types$
|
|
33416
|
+
this.setContext(types$u.brace);
|
|
33471
33417
|
this.next();
|
|
33472
|
-
node = this.jsxParseExpressionContainer(node, types$
|
|
33418
|
+
node = this.jsxParseExpressionContainer(node, types$u.j_oTag);
|
|
33473
33419
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
33474
33420
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
33475
33421
|
}
|
|
@@ -33494,7 +33440,7 @@ var jsx$3 = function(superClass) {
|
|
|
33494
33440
|
value: function jsxParseSpreadChild(node) {
|
|
33495
33441
|
this.next();
|
|
33496
33442
|
node.expression = this.parseExpression();
|
|
33497
|
-
this.setContext(types$
|
|
33443
|
+
this.setContext(types$u.j_expr);
|
|
33498
33444
|
this.state.canStartJSXElement = true;
|
|
33499
33445
|
this.expect(8);
|
|
33500
33446
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -33526,11 +33472,11 @@ var jsx$3 = function(superClass) {
|
|
|
33526
33472
|
value: function jsxParseAttribute() {
|
|
33527
33473
|
var node = this.startNode();
|
|
33528
33474
|
if (this.match(5)) {
|
|
33529
|
-
this.setContext(types$
|
|
33475
|
+
this.setContext(types$u.brace);
|
|
33530
33476
|
this.next();
|
|
33531
33477
|
this.expect(21);
|
|
33532
33478
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
33533
|
-
this.setContext(types$
|
|
33479
|
+
this.setContext(types$u.j_oTag);
|
|
33534
33480
|
this.state.canStartJSXElement = true;
|
|
33535
33481
|
this.expect(8);
|
|
33536
33482
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -33601,12 +33547,12 @@ var jsx$3 = function(superClass) {
|
|
|
33601
33547
|
case 5:
|
|
33602
33548
|
{
|
|
33603
33549
|
var node2 = this.startNode();
|
|
33604
|
-
this.setContext(types$
|
|
33550
|
+
this.setContext(types$u.brace);
|
|
33605
33551
|
this.next();
|
|
33606
33552
|
if (this.match(21)) {
|
|
33607
33553
|
children.push(this.jsxParseSpreadChild(node2));
|
|
33608
33554
|
} else {
|
|
33609
|
-
children.push(this.jsxParseExpressionContainer(node2, types$
|
|
33555
|
+
children.push(this.jsxParseExpressionContainer(node2, types$u.j_expr));
|
|
33610
33556
|
}
|
|
33611
33557
|
break;
|
|
33612
33558
|
}
|
|
@@ -33683,11 +33629,11 @@ var jsx$3 = function(superClass) {
|
|
|
33683
33629
|
key: "getTokenFromCode",
|
|
33684
33630
|
value: function getTokenFromCode(code2) {
|
|
33685
33631
|
var context = this.curContext();
|
|
33686
|
-
if (context === types$
|
|
33632
|
+
if (context === types$u.j_expr) {
|
|
33687
33633
|
this.jsxReadToken();
|
|
33688
33634
|
return;
|
|
33689
33635
|
}
|
|
33690
|
-
if (context === types$
|
|
33636
|
+
if (context === types$u.j_oTag || context === types$u.j_cTag) {
|
|
33691
33637
|
if (isIdentifierStart2(code2)) {
|
|
33692
33638
|
this.jsxReadWord();
|
|
33693
33639
|
return;
|
|
@@ -33697,7 +33643,7 @@ var jsx$3 = function(superClass) {
|
|
|
33697
33643
|
this.finishToken(143);
|
|
33698
33644
|
return;
|
|
33699
33645
|
}
|
|
33700
|
-
if ((code2 === 34 || code2 === 39) && context === types$
|
|
33646
|
+
if ((code2 === 34 || code2 === 39) && context === types$u.j_oTag) {
|
|
33701
33647
|
this.jsxReadString(code2);
|
|
33702
33648
|
return;
|
|
33703
33649
|
}
|
|
@@ -33715,17 +33661,17 @@ var jsx$3 = function(superClass) {
|
|
|
33715
33661
|
value: function updateContext(prevType) {
|
|
33716
33662
|
var _this_state = this.state, context = _this_state.context, type = _this_state.type;
|
|
33717
33663
|
if (type === 56 && prevType === 142) {
|
|
33718
|
-
context.splice(-2, 2, types$
|
|
33664
|
+
context.splice(-2, 2, types$u.j_cTag);
|
|
33719
33665
|
this.state.canStartJSXElement = false;
|
|
33720
33666
|
} else if (type === 142) {
|
|
33721
|
-
context.push(types$
|
|
33667
|
+
context.push(types$u.j_oTag);
|
|
33722
33668
|
} else if (type === 143) {
|
|
33723
33669
|
var out = context[context.length - 1];
|
|
33724
|
-
if (out === types$
|
|
33670
|
+
if (out === types$u.j_oTag && prevType === 56 || out === types$u.j_cTag) {
|
|
33725
33671
|
context.pop();
|
|
33726
|
-
this.state.canStartJSXElement = context[context.length - 1] === types$
|
|
33672
|
+
this.state.canStartJSXElement = context[context.length - 1] === types$u.j_expr;
|
|
33727
33673
|
} else {
|
|
33728
|
-
this.setContext(types$
|
|
33674
|
+
this.setContext(types$u.j_expr);
|
|
33729
33675
|
this.state.canStartJSXElement = true;
|
|
33730
33676
|
}
|
|
33731
33677
|
} else {
|
|
@@ -36218,7 +36164,7 @@ var typescript$3 = function(superClass) {
|
|
|
36218
36164
|
});
|
|
36219
36165
|
if (node.params.length === 0) {
|
|
36220
36166
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
36221
|
-
} else if (!this.state.inType && this.curContext() === types$
|
|
36167
|
+
} else if (!this.state.inType && this.curContext() === types$u.brace) {
|
|
36222
36168
|
this.reScan_lt_gt();
|
|
36223
36169
|
}
|
|
36224
36170
|
this.expect(48);
|
|
@@ -37026,7 +36972,7 @@ var typescript$3 = function(superClass) {
|
|
|
37026
36972
|
if (!jsx2.error) return jsx2.node;
|
|
37027
36973
|
var context = this.state.context;
|
|
37028
36974
|
var currentContext = context[context.length - 1];
|
|
37029
|
-
if (currentContext === types$
|
|
36975
|
+
if (currentContext === types$u.j_oTag || currentContext === types$u.j_expr) {
|
|
37030
36976
|
context.pop();
|
|
37031
36977
|
}
|
|
37032
36978
|
}
|
|
@@ -42727,8 +42673,8 @@ function getParserClass(pluginsFromOptions) {
|
|
|
42727
42673
|
return cls;
|
|
42728
42674
|
}
|
|
42729
42675
|
// node_modules/@babel/highlight/lib/index.js
|
|
42730
|
-
var import_js_tokens = __toESM(require_js_tokens()
|
|
42731
|
-
var import_picocolors = __toESM(require_picocolors()
|
|
42676
|
+
var import_js_tokens = __toESM(require_js_tokens());
|
|
42677
|
+
var import_picocolors = __toESM(require_picocolors());
|
|
42732
42678
|
var colors = typeof browser$1$1 === "object" && (browser$1$1.env.FORCE_COLOR === "0" || browser$1$1.env.FORCE_COLOR === "false") ? (0, import_picocolors.createColors)(false) : import_picocolors.default;
|
|
42733
42679
|
var compose = function(f, g) {
|
|
42734
42680
|
return function(v) {
|
|
@@ -43026,7 +42972,7 @@ function highlight(code2) {
|
|
|
43026
42972
|
}
|
|
43027
42973
|
}
|
|
43028
42974
|
// node_modules/@babel/code-frame/lib/index.js
|
|
43029
|
-
var import_picocolors2 = __toESM(require_picocolors()
|
|
42975
|
+
var import_picocolors2 = __toESM(require_picocolors());
|
|
43030
42976
|
var colors2 = typeof browser$1$1 === "object" && (browser$1$1.env.FORCE_COLOR === "0" || browser$1$1.env.FORCE_COLOR === "false") ? (0, import_picocolors2.createColors)(false) : import_picocolors2.default;
|
|
43031
42977
|
var compose2 = function(f, g) {
|
|
43032
42978
|
return function(v) {
|
|
@@ -44253,7 +44199,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
44253
44199
|
var line = getLine(mappings, genLine);
|
|
44254
44200
|
var index3 = getColumnIndex(line, genColumn);
|
|
44255
44201
|
if (!source) {
|
|
44256
|
-
if (
|
|
44202
|
+
if (skipSourceless(line, index3)) return;
|
|
44257
44203
|
return insert$1(line, index3, [
|
|
44258
44204
|
genColumn
|
|
44259
44205
|
]);
|
|
@@ -44261,7 +44207,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
44261
44207
|
var sourcesIndex = put(sources, source);
|
|
44262
44208
|
var namesIndex = name ? put(names, name) : NO_NAME;
|
|
44263
44209
|
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
|
44264
|
-
if (
|
|
44210
|
+
if (skipSource(line, index3, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
|
44265
44211
|
return;
|
|
44266
44212
|
}
|
|
44267
44213
|
return insert$1(line, index3, name ? [
|
|
@@ -44324,7 +44270,7 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
44324
44270
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
44325
44271
|
}
|
|
44326
44272
|
// node_modules/@babel/generator/lib/index.js
|
|
44327
|
-
var import_jsesc = __toESM(require_jsesc()
|
|
44273
|
+
var import_jsesc = __toESM(require_jsesc());
|
|
44328
44274
|
var SourceMap = /*#__PURE__*/ function() {
|
|
44329
44275
|
function SourceMap(opts, code2) {
|
|
44330
44276
|
_class_call_check(this, SourceMap);
|
|
@@ -45500,7 +45446,7 @@ function _shouldPrintDecoratorsBeforeExport(node) {
|
|
|
45500
45446
|
}
|
|
45501
45447
|
return typeof node.start === "number" && node.start === node.declaration.start;
|
|
45502
45448
|
}
|
|
45503
|
-
function Decorator(node) {
|
|
45449
|
+
function Decorator$1(node) {
|
|
45504
45450
|
this.tokenChar(64);
|
|
45505
45451
|
var expression2 = node.expression;
|
|
45506
45452
|
if (shouldParenthesizeDecoratorExpression(expression2)) {
|
|
@@ -46609,7 +46555,7 @@ function NumericLiteral(node) {
|
|
|
46609
46555
|
this.number(raw, value1);
|
|
46610
46556
|
}
|
|
46611
46557
|
}
|
|
46612
|
-
function StringLiteral$
|
|
46558
|
+
function StringLiteral$5(node) {
|
|
46613
46559
|
var raw = this.getPossibleRaw(node);
|
|
46614
46560
|
if (!this.format.minified && raw !== void 0) {
|
|
46615
46561
|
this.token(raw);
|
|
@@ -48079,7 +48025,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
48079
48025
|
DeclareTypeAlias: DeclareTypeAlias,
|
|
48080
48026
|
DeclareVariable: DeclareVariable,
|
|
48081
48027
|
DeclaredPredicate: DeclaredPredicate,
|
|
48082
|
-
Decorator: Decorator,
|
|
48028
|
+
Decorator: Decorator$1,
|
|
48083
48029
|
Directive: Directive$1,
|
|
48084
48030
|
DirectiveLiteral: DirectiveLiteral$1,
|
|
48085
48031
|
DoExpression: DoExpression,
|
|
@@ -48185,8 +48131,8 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
48185
48131
|
SequenceExpression: SequenceExpression$2,
|
|
48186
48132
|
SpreadElement: RestElement$1,
|
|
48187
48133
|
StaticBlock: StaticBlock$1,
|
|
48188
|
-
StringLiteral: StringLiteral$
|
|
48189
|
-
StringLiteralTypeAnnotation: StringLiteral$
|
|
48134
|
+
StringLiteral: StringLiteral$5,
|
|
48135
|
+
StringLiteralTypeAnnotation: StringLiteral$5,
|
|
48190
48136
|
StringTypeAnnotation: StringTypeAnnotation,
|
|
48191
48137
|
Super: Super,
|
|
48192
48138
|
SwitchCase: SwitchCase,
|
|
@@ -49189,7 +49135,7 @@ function generate$6(ast) {
|
|
|
49189
49135
|
return printer.generate(ast);
|
|
49190
49136
|
}
|
|
49191
49137
|
// node_modules/@babel/traverse/lib/index.js
|
|
49192
|
-
var import_debug = __toESM(require_src()
|
|
49138
|
+
var import_debug = __toESM(require_src());
|
|
49193
49139
|
// node_modules/@babel/helper-split-export-declaration/lib/index.js
|
|
49194
49140
|
var cloneNode3 = lib_exports.cloneNode, exportNamedDeclaration2 = lib_exports.exportNamedDeclaration, exportSpecifier2 = lib_exports.exportSpecifier, identifier3 = lib_exports.identifier, variableDeclaration2 = lib_exports.variableDeclaration, variableDeclarator2 = lib_exports.variableDeclarator;
|
|
49195
49141
|
function splitExportDeclaration(exportDeclaration) {
|
|
@@ -49287,7 +49233,7 @@ var visitor = {
|
|
|
49287
49233
|
}
|
|
49288
49234
|
};
|
|
49289
49235
|
// node_modules/@babel/traverse/lib/index.js
|
|
49290
|
-
var import_globals = __toESM(require_globals2()
|
|
49236
|
+
var import_globals = __toESM(require_globals2());
|
|
49291
49237
|
// node_modules/@babel/helper-hoist-variables/lib/index.js
|
|
49292
49238
|
var assignmentExpression2 = lib_exports.assignmentExpression, expressionStatement3 = lib_exports.expressionStatement, identifier4 = lib_exports.identifier;
|
|
49293
49239
|
var visitor2 = {
|
|
@@ -51274,7 +51220,7 @@ var _Scope = /*#__PURE__*/ function() {
|
|
|
51274
51220
|
} else if (isCallExpression$12(node)) {
|
|
51275
51221
|
return matchesPattern$1$1(node.callee, "Symbol.for") && !this.hasBinding("Symbol", {
|
|
51276
51222
|
noGlobals: true
|
|
51277
|
-
}) && node.arguments.length === 1 && isStringLiteral$
|
|
51223
|
+
}) && node.arguments.length === 1 && isStringLiteral$9(node.arguments[0]);
|
|
51278
51224
|
} else {
|
|
51279
51225
|
return isPureish2(node);
|
|
51280
51226
|
}
|
|
@@ -56317,7 +56263,7 @@ var main = {};
|
|
|
56317
56263
|
|
|
56318
56264
|
var fork = {exports: {}};
|
|
56319
56265
|
|
|
56320
|
-
var types$
|
|
56266
|
+
var types$t = {exports: {}};
|
|
56321
56267
|
|
|
56322
56268
|
var shared = {};
|
|
56323
56269
|
|
|
@@ -56417,12 +56363,12 @@ function requireShared () {
|
|
|
56417
56363
|
return shared;
|
|
56418
56364
|
}
|
|
56419
56365
|
|
|
56420
|
-
types$
|
|
56366
|
+
types$t.exports;
|
|
56421
56367
|
|
|
56422
56368
|
var hasRequiredTypes;
|
|
56423
56369
|
|
|
56424
56370
|
function requireTypes () {
|
|
56425
|
-
if (hasRequiredTypes) return types$
|
|
56371
|
+
if (hasRequiredTypes) return types$t.exports;
|
|
56426
56372
|
hasRequiredTypes = 1;
|
|
56427
56373
|
(function (module, exports) {
|
|
56428
56374
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -57214,8 +57160,8 @@ function requireTypes () {
|
|
|
57214
57160
|
exports.default = typesPlugin;
|
|
57215
57161
|
(0, shared_1.maybeSetModuleExports)(function () { return module; });
|
|
57216
57162
|
|
|
57217
|
-
} (types$
|
|
57218
|
-
return types$
|
|
57163
|
+
} (types$t, types$t.exports));
|
|
57164
|
+
return types$t.exports;
|
|
57219
57165
|
}
|
|
57220
57166
|
|
|
57221
57167
|
var pathVisitor = {exports: {}};
|
|
@@ -76557,9 +76503,9 @@ var fullstore$3 = (value) => {
|
|
|
76557
76503
|
};
|
|
76558
76504
|
};
|
|
76559
76505
|
|
|
76560
|
-
var types$
|
|
76506
|
+
var types$s = {};
|
|
76561
76507
|
|
|
76562
|
-
types$
|
|
76508
|
+
types$s.TYPES = {
|
|
76563
76509
|
TOKEN: 'Token',
|
|
76564
76510
|
NEWLINE: 'Newline',
|
|
76565
76511
|
LINEBREAK: 'Linebreak',
|
|
@@ -76579,16 +76525,19 @@ var arrowFunctionExpression = {};
|
|
|
76579
76525
|
|
|
76580
76526
|
var is$3 = {};
|
|
76581
76527
|
|
|
76528
|
+
const {types: types$r} = bundle;
|
|
76582
76529
|
const {
|
|
76583
|
-
isStringLiteral: isStringLiteral$
|
|
76584
|
-
|
|
76530
|
+
isStringLiteral: isStringLiteral$8,
|
|
76531
|
+
isSpreadElement: isSpreadElement$3,
|
|
76532
|
+
isIdentifier: isIdentifier$b,
|
|
76585
76533
|
isIfStatement: isIfStatement$1,
|
|
76586
76534
|
isStatement: isStatement$4,
|
|
76587
76535
|
isForOfStatement,
|
|
76588
76536
|
isVariableDeclaration: isVariableDeclaration$1,
|
|
76589
|
-
isMemberExpression: isMemberExpression$
|
|
76537
|
+
isMemberExpression: isMemberExpression$5,
|
|
76590
76538
|
isArrayExpression: isArrayExpression$4,
|
|
76591
|
-
|
|
76539
|
+
isObjectExpression: isObjectExpression$4,
|
|
76540
|
+
} = types$r;
|
|
76592
76541
|
|
|
76593
76542
|
const isParentProgram$1 = (path) => path.parentPath?.isProgram();
|
|
76594
76543
|
const isParentBlock$3 = (path) => path.parentPath.isBlockStatement();
|
|
@@ -76610,6 +76559,9 @@ const isPrev$1 = (path) => {
|
|
|
76610
76559
|
const isNextParent$5 = (path) => isNext$r(path.parentPath);
|
|
76611
76560
|
const isLast$d = (path) => isParentProgram$1(path) && !isNext$r(path);
|
|
76612
76561
|
|
|
76562
|
+
is$3.isNextObject = (a) => a.getNextSibling().isObjectExpression();
|
|
76563
|
+
is$3.isPrevObject = (a) => a.getPrevSibling().isObjectExpression();
|
|
76564
|
+
|
|
76613
76565
|
is$3.isFirst = (path) => path.node === path.parentPath.node.body?.[0];
|
|
76614
76566
|
is$3.isPrevBody = (path) => path.getPrevSibling().isBlockStatement();
|
|
76615
76567
|
is$3.isNext = isNext$r;
|
|
@@ -76624,9 +76576,10 @@ is$3.isIndented = (path = {}) => {
|
|
|
76624
76576
|
const {parentPath, node} = path;
|
|
76625
76577
|
return node.loc?.start.column !== parentPath.node.loc.start.column;
|
|
76626
76578
|
};
|
|
76627
|
-
is$3.isCoupleLines = isCoupleLines$a;
|
|
76628
76579
|
|
|
76629
|
-
|
|
76580
|
+
is$3.isCoupleLines = isCoupleLines$b;
|
|
76581
|
+
|
|
76582
|
+
function isCoupleLines$b(path) {
|
|
76630
76583
|
const start = path.node?.loc?.start?.line;
|
|
76631
76584
|
const end = path.node?.loc?.end?.line;
|
|
76632
76585
|
|
|
@@ -76636,16 +76589,27 @@ function isCoupleLines$a(path) {
|
|
|
76636
76589
|
is$3.exists = (a) => a.node;
|
|
76637
76590
|
is$3.isStringAndIdentifier = isStringAndIdentifier$2;
|
|
76638
76591
|
function isStringAndIdentifier$2([a, b]) {
|
|
76639
|
-
return isStringLiteral$
|
|
76592
|
+
return isStringLiteral$8(a) && isIdentifier$b(b);
|
|
76640
76593
|
}
|
|
76641
76594
|
|
|
76595
|
+
is$3.isSimpleAndEmptyObject = ([a, b]) => {
|
|
76596
|
+
if (!isIdentifier$b(a) && !isSpreadElement$3(a) && !isArrayExpression$4(a))
|
|
76597
|
+
return false;
|
|
76598
|
+
|
|
76599
|
+
if (!isObjectExpression$4(b))
|
|
76600
|
+
return false;
|
|
76601
|
+
|
|
76602
|
+
return b.node.properties.length;
|
|
76603
|
+
};
|
|
76604
|
+
|
|
76642
76605
|
is$3.isIdentifierAndIdentifier = ([a, b]) => {
|
|
76643
|
-
return isIdentifier$
|
|
76606
|
+
return isIdentifier$b(a) && isIdentifier$b(b);
|
|
76644
76607
|
};
|
|
76645
|
-
|
|
76646
|
-
is$3.
|
|
76608
|
+
|
|
76609
|
+
is$3.isStringAndMember = ([a, b]) => isStringLiteral$8(a) && isMemberExpression$5(b);
|
|
76610
|
+
is$3.isIdentifierAndString = ([a, b]) => isIdentifier$b(a) && isStringLiteral$8(b);
|
|
76647
76611
|
is$3.isStringAndArray = ([a, b]) => {
|
|
76648
|
-
if (!isStringLiteral$
|
|
76612
|
+
if (!isStringLiteral$8(a))
|
|
76649
76613
|
return false;
|
|
76650
76614
|
|
|
76651
76615
|
if (!isArrayExpression$4(b))
|
|
@@ -76689,7 +76653,18 @@ is$3.satisfy = (conditions) => (path) => {
|
|
|
76689
76653
|
return false;
|
|
76690
76654
|
};
|
|
76691
76655
|
|
|
76692
|
-
|
|
76656
|
+
const parseNode$2 = (path) => path.node || path;
|
|
76657
|
+
|
|
76658
|
+
is$3.hasCoupleTrailingComments = (path) => {
|
|
76659
|
+
const node = parseNode$2(path);
|
|
76660
|
+
return node?.trailingComments?.length > 1;
|
|
76661
|
+
};
|
|
76662
|
+
|
|
76663
|
+
is$3.hasTrailingComment = (path) => {
|
|
76664
|
+
const node = parseNode$2(path);
|
|
76665
|
+
return node.trailingComments?.length;
|
|
76666
|
+
};
|
|
76667
|
+
|
|
76693
76668
|
is$3.hasLeadingComment = (path) => path.node?.leadingComments?.length;
|
|
76694
76669
|
|
|
76695
76670
|
is$3.noTrailingComment = (path) => !path.node.trailingComments?.length;
|
|
@@ -76741,7 +76716,7 @@ maybeInsideFn$1.maybeInsideFn = (insideFn, {print, indent}) => {
|
|
|
76741
76716
|
indent.dec();
|
|
76742
76717
|
};
|
|
76743
76718
|
|
|
76744
|
-
const {types: types$
|
|
76719
|
+
const {types: types$q} = bundle;
|
|
76745
76720
|
const {
|
|
76746
76721
|
hasTrailingComment: hasTrailingComment$3,
|
|
76747
76722
|
satisfy: satisfy$4,
|
|
@@ -76757,7 +76732,7 @@ const {
|
|
|
76757
76732
|
isClassProperty,
|
|
76758
76733
|
isTSPropertySignature,
|
|
76759
76734
|
isSpreadElement: isSpreadElement$2,
|
|
76760
|
-
} = types$
|
|
76735
|
+
} = types$q;
|
|
76761
76736
|
|
|
76762
76737
|
const isProperty = satisfy$4([
|
|
76763
76738
|
isObjectProperty$1,
|
|
@@ -76767,6 +76742,8 @@ const isProperty = satisfy$4([
|
|
|
76767
76742
|
isSpreadElement$2,
|
|
76768
76743
|
]);
|
|
76769
76744
|
|
|
76745
|
+
const hasDecorators = ({parentPath}) => parentPath.node.decorators?.length;
|
|
76746
|
+
|
|
76770
76747
|
function isCommentOfPrevious(path) {
|
|
76771
76748
|
const [comment] = path.node.leadingComments;
|
|
76772
76749
|
const {line} = comment.loc.start;
|
|
@@ -76803,6 +76780,9 @@ parseLeadingComments$4.parseLeadingComments = (path, {print, maybe, indent}, sem
|
|
|
76803
76780
|
if (!leadingComments?.length)
|
|
76804
76781
|
return;
|
|
76805
76782
|
|
|
76783
|
+
if (hasDecorators(path))
|
|
76784
|
+
return;
|
|
76785
|
+
|
|
76806
76786
|
const looksLikeSwitchCase = path.isSwitchCase();
|
|
76807
76787
|
|
|
76808
76788
|
if (!looksLikeSwitchCase && hasTrailingComment$3(path.getPrevSibling()))
|
|
@@ -76862,16 +76842,16 @@ var parseTrailingComments$2 = {};
|
|
|
76862
76842
|
|
|
76863
76843
|
const {
|
|
76864
76844
|
isDecorator,
|
|
76865
|
-
isMemberExpression: isMemberExpression$
|
|
76845
|
+
isMemberExpression: isMemberExpression$4,
|
|
76866
76846
|
} = bundle.types;
|
|
76867
76847
|
|
|
76868
76848
|
const {
|
|
76869
76849
|
isLast: isLast$c,
|
|
76870
|
-
isCoupleLines: isCoupleLines$
|
|
76850
|
+
isCoupleLines: isCoupleLines$a,
|
|
76871
76851
|
isNext: isNext$q,
|
|
76872
76852
|
} = is$3;
|
|
76873
76853
|
|
|
76874
|
-
const hasBody = (path) => path.node.body;
|
|
76854
|
+
const hasBody$1 = (path) => path.node.body;
|
|
76875
76855
|
|
|
76876
76856
|
const isFnParam = (path) => {
|
|
76877
76857
|
const {parentPath} = path;
|
|
@@ -76893,7 +76873,7 @@ const isTrailingIsLeading = (path) => path.node.trailingComments === path.getNex
|
|
|
76893
76873
|
const isNewlineAfter = (path) => {
|
|
76894
76874
|
const {parentPath} = path;
|
|
76895
76875
|
|
|
76896
|
-
if (isMemberExpression$
|
|
76876
|
+
if (isMemberExpression$4(parentPath))
|
|
76897
76877
|
return false;
|
|
76898
76878
|
|
|
76899
76879
|
return !isLast$c(path) && !isDecorator(path);
|
|
@@ -76914,7 +76894,7 @@ function isCommentOnNextLine(path) {
|
|
|
76914
76894
|
if (isTrailingIsLeading(path))
|
|
76915
76895
|
return false;
|
|
76916
76896
|
|
|
76917
|
-
if (
|
|
76897
|
+
if (path.isThrowStatement())
|
|
76918
76898
|
return false;
|
|
76919
76899
|
|
|
76920
76900
|
const [comment] = trailingComments;
|
|
@@ -76922,10 +76902,13 @@ function isCommentOnNextLine(path) {
|
|
|
76922
76902
|
|
|
76923
76903
|
const next = path.getNextSibling();
|
|
76924
76904
|
|
|
76925
|
-
if (line < next.node
|
|
76905
|
+
if (next.node && line < next.node.loc.start.line)
|
|
76926
76906
|
return false;
|
|
76927
76907
|
|
|
76928
|
-
|
|
76908
|
+
const isNextLine = line === loc.start.line + 1;
|
|
76909
|
+
const isNextLineAfterNewline = line === loc.start.line + 2;
|
|
76910
|
+
|
|
76911
|
+
return isNextLine || isNextLineAfterNewline;
|
|
76929
76912
|
}
|
|
76930
76913
|
|
|
76931
76914
|
parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics) => {
|
|
@@ -76951,7 +76934,7 @@ parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics
|
|
|
76951
76934
|
maybe.write.space(sameLine);
|
|
76952
76935
|
maybe.indent(!sameLine && !commentOnNextLine);
|
|
76953
76936
|
|
|
76954
|
-
if (hasBody(path)) {
|
|
76937
|
+
if (hasBody$1(path)) {
|
|
76955
76938
|
maybe.write.breakline(!isNext$q(path));
|
|
76956
76939
|
maybe.write.breakline(!n);
|
|
76957
76940
|
}
|
|
@@ -76966,7 +76949,7 @@ parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics
|
|
|
76966
76949
|
maybe.write.space(sameLine);
|
|
76967
76950
|
maybe.indent(!sameLine);
|
|
76968
76951
|
write(`/*${value}*/`);
|
|
76969
|
-
maybe.write.newline(!sameLine || !isFnParam(path) && isCoupleLines$
|
|
76952
|
+
maybe.write.newline(!sameLine || !isFnParam(path) && isCoupleLines$a(path.parentPath));
|
|
76970
76953
|
}
|
|
76971
76954
|
}
|
|
76972
76955
|
};
|
|
@@ -77635,15 +77618,17 @@ maybeDeclare$6.maybeDeclare = (visit) => (path, printer, semantics) => {
|
|
|
77635
77618
|
visit(path, printer, semantics);
|
|
77636
77619
|
};
|
|
77637
77620
|
|
|
77621
|
+
const {isFunction: isFunction$2} = bundle.types;
|
|
77638
77622
|
const {isNext: isNext$l} = is$3;
|
|
77639
77623
|
const {markAfter: markAfter$8} = mark;
|
|
77640
77624
|
|
|
77641
|
-
//const {maybeDecorators} = require('../../maybe-get');
|
|
77642
77625
|
const {maybeDeclare: maybeDeclare$5} = maybeDeclare$6;
|
|
77643
77626
|
const {parseComments: parseComments$4} = comment;
|
|
77644
77627
|
const {maybeDecorators: maybeDecorators$2} = maybeDecorators$4;
|
|
77645
77628
|
|
|
77646
77629
|
const isInsideExport = ({parentPath}) => parentPath.isExportDeclaration();
|
|
77630
|
+
const isFunctionLike = (path) => isFunction$2(path.parentPath.parentPath);
|
|
77631
|
+
const hasBody = ({node}) => node.body.body.length;
|
|
77647
77632
|
|
|
77648
77633
|
const classVisitor = maybeDecorators$2((path, printer, semantics) => {
|
|
77649
77634
|
const {id, abstract} = path.node;
|
|
@@ -77705,6 +77690,9 @@ _class.ClassDeclaration = {
|
|
|
77705
77690
|
classVisitor(path, printer, semantics);
|
|
77706
77691
|
}),
|
|
77707
77692
|
afterIf(path) {
|
|
77693
|
+
if (isFunctionLike(path))
|
|
77694
|
+
return true;
|
|
77695
|
+
|
|
77708
77696
|
if (!isNext$l(path))
|
|
77709
77697
|
return false;
|
|
77710
77698
|
|
|
@@ -77713,7 +77701,7 @@ _class.ClassDeclaration = {
|
|
|
77713
77701
|
after(path, {write}) {
|
|
77714
77702
|
write.newline();
|
|
77715
77703
|
|
|
77716
|
-
if (path
|
|
77704
|
+
if (!isFunctionLike(path) && hasBody(path)) {
|
|
77717
77705
|
write.newline();
|
|
77718
77706
|
markAfter$8(path);
|
|
77719
77707
|
}
|
|
@@ -77853,7 +77841,7 @@ newExpression.NewExpression = {
|
|
|
77853
77841
|
var objectExpression = {};
|
|
77854
77842
|
|
|
77855
77843
|
const {
|
|
77856
|
-
isCoupleLines: isCoupleLines$
|
|
77844
|
+
isCoupleLines: isCoupleLines$9,
|
|
77857
77845
|
isForOf: isForOf$3,
|
|
77858
77846
|
isIf,
|
|
77859
77847
|
noTrailingComment: noTrailingComment$3,
|
|
@@ -77865,6 +77853,7 @@ const {
|
|
|
77865
77853
|
|
|
77866
77854
|
const {parseComments: parseComments$3} = comment;
|
|
77867
77855
|
const {likeChain} = memberExpressions$1;
|
|
77856
|
+
const {isStringLiteral: isStringLiteral$7} = bundle.types;
|
|
77868
77857
|
|
|
77869
77858
|
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
|
|
77870
77859
|
const isLogical = (path) => path.get('argument').isLogicalExpression();
|
|
@@ -77883,6 +77872,25 @@ const isMemberExpressionCallee = ({parentPath}) => {
|
|
|
77883
77872
|
return likeChain(callee);
|
|
77884
77873
|
};
|
|
77885
77874
|
|
|
77875
|
+
const isInsideCall = ({parentPath}) => parentPath.isCallExpression();
|
|
77876
|
+
|
|
77877
|
+
function isInsideNestedArrayCall({parentPath}) {
|
|
77878
|
+
if (!parentPath.isArrayExpression())
|
|
77879
|
+
return false;
|
|
77880
|
+
|
|
77881
|
+
if (!parentPath.parentPath.isArrayExpression())
|
|
77882
|
+
return false;
|
|
77883
|
+
|
|
77884
|
+
return isInsideCall(parentPath.parentPath);
|
|
77885
|
+
}
|
|
77886
|
+
|
|
77887
|
+
function isInsideNestedTuple({parentPath}) {
|
|
77888
|
+
const {elements} = parentPath.parentPath.node;
|
|
77889
|
+
const [first] = elements;
|
|
77890
|
+
|
|
77891
|
+
return isStringLiteral$7(first);
|
|
77892
|
+
}
|
|
77893
|
+
|
|
77886
77894
|
objectExpression.ObjectExpression = (path, printer, semantics) => {
|
|
77887
77895
|
const {trailingComma} = semantics;
|
|
77888
77896
|
const {
|
|
@@ -77891,7 +77899,9 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
|
|
|
77891
77899
|
indent,
|
|
77892
77900
|
} = printer;
|
|
77893
77901
|
|
|
77894
|
-
|
|
77902
|
+
const insideNestedArrayCall = isInsideNestedArrayCall(path);
|
|
77903
|
+
|
|
77904
|
+
maybe.indent.inc(!insideNestedArrayCall);
|
|
77895
77905
|
|
|
77896
77906
|
const properties = path.get('properties');
|
|
77897
77907
|
const {length} = properties;
|
|
@@ -77905,7 +77915,8 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
|
|
|
77905
77915
|
|
|
77906
77916
|
const n = properties.length - 1;
|
|
77907
77917
|
|
|
77908
|
-
|
|
77918
|
+
const memberCallee = isMemberExpressionCallee(path);
|
|
77919
|
+
maybe.indent.inc(memberCallee);
|
|
77909
77920
|
|
|
77910
77921
|
for (const [index, property] of properties.entries()) {
|
|
77911
77922
|
if (property.isSpreadElement()) {
|
|
@@ -77925,13 +77936,10 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
|
|
|
77925
77936
|
}
|
|
77926
77937
|
|
|
77927
77938
|
maybe.indent(manyLines && noLeadingComment(property));
|
|
77939
|
+
print(property);
|
|
77928
77940
|
|
|
77929
|
-
if (property.isObjectMethod())
|
|
77930
|
-
print(property);
|
|
77941
|
+
if (property.isObjectMethod())
|
|
77931
77942
|
continue;
|
|
77932
|
-
}
|
|
77933
|
-
|
|
77934
|
-
print(property);
|
|
77935
77943
|
|
|
77936
77944
|
if (noTrailingComment$3(property) && !hasNextLeadingComment(property)) {
|
|
77937
77945
|
maybe.print.newline(manyLines);
|
|
@@ -77939,12 +77947,19 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
|
|
|
77939
77947
|
}
|
|
77940
77948
|
}
|
|
77941
77949
|
|
|
77942
|
-
|
|
77943
|
-
|
|
77950
|
+
if (!insideNestedArrayCall) {
|
|
77951
|
+
indent.dec();
|
|
77952
|
+
maybe.indent(manyLines);
|
|
77953
|
+
} else if (isInsideNestedTuple(path)) {
|
|
77954
|
+
indent.dec();
|
|
77955
|
+
indent();
|
|
77956
|
+
indent.inc();
|
|
77957
|
+
}
|
|
77958
|
+
|
|
77944
77959
|
print('}');
|
|
77945
77960
|
maybe.print(parens, ')');
|
|
77946
77961
|
|
|
77947
|
-
maybe.indent.dec(
|
|
77962
|
+
maybe.indent.dec(memberCallee);
|
|
77948
77963
|
};
|
|
77949
77964
|
|
|
77950
77965
|
const hasNextLeadingComment = (path) => {
|
|
@@ -77962,7 +77977,7 @@ const notLastArgInsideCall = (path) => {
|
|
|
77962
77977
|
if (!parentPath.isCallExpression())
|
|
77963
77978
|
return false;
|
|
77964
77979
|
|
|
77965
|
-
if (isCoupleLines$
|
|
77980
|
+
if (isCoupleLines$9(path))
|
|
77966
77981
|
return false;
|
|
77967
77982
|
|
|
77968
77983
|
return path !== parentPath
|
|
@@ -77978,7 +77993,7 @@ function isOneLine$1(path) {
|
|
|
77978
77993
|
const {length} = path.get('properties');
|
|
77979
77994
|
|
|
77980
77995
|
if (!length)
|
|
77981
|
-
return
|
|
77996
|
+
return ONE_LINE$2;
|
|
77982
77997
|
|
|
77983
77998
|
if (notLastArgInsideCall(path))
|
|
77984
77999
|
return ONE_LINE$2;
|
|
@@ -77989,7 +78004,7 @@ function isOneLine$1(path) {
|
|
|
77989
78004
|
if (isIf(path))
|
|
77990
78005
|
return ONE_LINE$2;
|
|
77991
78006
|
|
|
77992
|
-
if (isCoupleLines$
|
|
78007
|
+
if (isCoupleLines$9(path))
|
|
77993
78008
|
return MANY_LINES;
|
|
77994
78009
|
|
|
77995
78010
|
return !isValue(path);
|
|
@@ -78007,16 +78022,16 @@ var objectProperty = {};
|
|
|
78007
78022
|
var concatanate$1 = {};
|
|
78008
78023
|
|
|
78009
78024
|
const {
|
|
78010
|
-
isStringLiteral: isStringLiteral$
|
|
78011
|
-
isTemplateLiteral: isTemplateLiteral$
|
|
78025
|
+
isStringLiteral: isStringLiteral$6,
|
|
78026
|
+
isTemplateLiteral: isTemplateLiteral$3,
|
|
78012
78027
|
isBinaryExpression,
|
|
78013
78028
|
} = bundle.types;
|
|
78014
78029
|
|
|
78015
78030
|
const isStringLike = (a) => {
|
|
78016
|
-
if (isStringLiteral$
|
|
78031
|
+
if (isStringLiteral$6(a))
|
|
78017
78032
|
return true;
|
|
78018
78033
|
|
|
78019
|
-
return isTemplateLiteral$
|
|
78034
|
+
return isTemplateLiteral$3(a);
|
|
78020
78035
|
};
|
|
78021
78036
|
|
|
78022
78037
|
concatanate$1.isConcatenation = (path) => {
|
|
@@ -78095,9 +78110,9 @@ wrongShortand.wrongShorthand = ({computed, isAssign, keyPath, valuePath}) => {
|
|
|
78095
78110
|
return !computed && !isAssign && keyPath.node.name !== valuePath.node.name;
|
|
78096
78111
|
};
|
|
78097
78112
|
|
|
78098
|
-
var
|
|
78113
|
+
var moreThenMaxPropertiesInOneLine$1 = {};
|
|
78099
78114
|
|
|
78100
|
-
|
|
78115
|
+
moreThenMaxPropertiesInOneLine$1.moreThenMaxPropertiesInOneLine = (path, {maxPropertiesInOneLine}) => {
|
|
78101
78116
|
const {parentPath} = path;
|
|
78102
78117
|
|
|
78103
78118
|
if (parentPath.isObjectProperty())
|
|
@@ -78129,8 +78144,43 @@ function maybePrintTypeAnnotation$3(path, printer) {
|
|
|
78129
78144
|
}
|
|
78130
78145
|
}
|
|
78131
78146
|
|
|
78147
|
+
var moreThenMaxPropertiesLengthInOneLine$1 = {};
|
|
78148
|
+
|
|
78132
78149
|
const {
|
|
78133
|
-
|
|
78150
|
+
isAssignmentPattern: isAssignmentPattern$1,
|
|
78151
|
+
isIdentifier: isIdentifier$a,
|
|
78152
|
+
} = bundle.types;
|
|
78153
|
+
|
|
78154
|
+
moreThenMaxPropertiesLengthInOneLine$1.moreThenMaxPropertiesLengthInOneLine = (path, {maxPropertiesLengthInOneLine}) => {
|
|
78155
|
+
const {properties} = path.node;
|
|
78156
|
+
|
|
78157
|
+
for (const {key, value} of properties) {
|
|
78158
|
+
if (isAssignmentPattern$1(value)) {
|
|
78159
|
+
const {left, right} = value;
|
|
78160
|
+
|
|
78161
|
+
if (!isIdentifier$a(left) || !isIdentifier$a(right))
|
|
78162
|
+
continue;
|
|
78163
|
+
|
|
78164
|
+
const length = left.name.length + right.name.length;
|
|
78165
|
+
|
|
78166
|
+
if (length >= maxPropertiesLengthInOneLine)
|
|
78167
|
+
return true;
|
|
78168
|
+
}
|
|
78169
|
+
|
|
78170
|
+
if (!isIdentifier$a(key))
|
|
78171
|
+
continue;
|
|
78172
|
+
|
|
78173
|
+
const {name} = key;
|
|
78174
|
+
|
|
78175
|
+
if (name.length >= maxPropertiesLengthInOneLine)
|
|
78176
|
+
return true;
|
|
78177
|
+
}
|
|
78178
|
+
|
|
78179
|
+
return false;
|
|
78180
|
+
};
|
|
78181
|
+
|
|
78182
|
+
const {
|
|
78183
|
+
isIdentifier: isIdentifier$9,
|
|
78134
78184
|
isObjectPattern: isObjectPattern$2,
|
|
78135
78185
|
isAssignmentPattern,
|
|
78136
78186
|
} = bundle.types;
|
|
@@ -78139,22 +78189,41 @@ const {wrongShorthand} = wrongShortand;
|
|
|
78139
78189
|
|
|
78140
78190
|
const {
|
|
78141
78191
|
isForOf: isForOf$2,
|
|
78142
|
-
isCoupleLines: isCoupleLines$
|
|
78192
|
+
isCoupleLines: isCoupleLines$8,
|
|
78143
78193
|
exists: exists$9,
|
|
78144
78194
|
} = is$3;
|
|
78145
78195
|
|
|
78146
|
-
const {
|
|
78196
|
+
const {moreThenMaxPropertiesInOneLine} = moreThenMaxPropertiesInOneLine$1;
|
|
78197
|
+
|
|
78147
78198
|
const {maybeTypeAnnotation: maybeTypeAnnotation$3} = maybeTypeAnnotation$4;
|
|
78199
|
+
const {moreThenMaxPropertiesLengthInOneLine} = moreThenMaxPropertiesLengthInOneLine$1;
|
|
78148
78200
|
|
|
78149
78201
|
const isTwoLevelsDeep = ({parentPath}) => parentPath.parentPath.parentPath.isObjectProperty();
|
|
78150
|
-
|
|
78151
78202
|
const isOneParentProperty = ({parentPath}) => parentPath.parentPath.node.properties?.length === 1;
|
|
78152
78203
|
|
|
78204
|
+
function isIndent(path) {
|
|
78205
|
+
return !path.parentPath.isArrayPattern();
|
|
78206
|
+
}
|
|
78207
|
+
|
|
78208
|
+
const isCoupleProperties = ({path, valuePath, property}) => {
|
|
78209
|
+
if (!isCoupleLines$8(valuePath))
|
|
78210
|
+
return false;
|
|
78211
|
+
|
|
78212
|
+
if (exists$9(property.getPrevSibling()))
|
|
78213
|
+
return false;
|
|
78214
|
+
|
|
78215
|
+
return !path.parentPath.isObjectProperty();
|
|
78216
|
+
};
|
|
78217
|
+
|
|
78153
78218
|
objectPattern.ObjectPattern = {
|
|
78154
|
-
print: maybeTypeAnnotation$3((path, {
|
|
78155
|
-
const
|
|
78219
|
+
print: maybeTypeAnnotation$3((path, {print, maybe, indent}, semantics) => {
|
|
78220
|
+
const shouldIndent = isIndent(path);
|
|
78221
|
+
const {
|
|
78222
|
+
maxPropertiesInOneLine,
|
|
78223
|
+
maxPropertiesLengthInOneLine,
|
|
78224
|
+
} = semantics;
|
|
78156
78225
|
|
|
78157
|
-
indent.inc();
|
|
78226
|
+
maybe.indent.inc(shouldIndent);
|
|
78158
78227
|
print('{');
|
|
78159
78228
|
|
|
78160
78229
|
const properties = path.get('properties');
|
|
@@ -78162,6 +78231,7 @@ objectPattern.ObjectPattern = {
|
|
|
78162
78231
|
|
|
78163
78232
|
const is = shouldAddNewline(path, {
|
|
78164
78233
|
maxPropertiesInOneLine,
|
|
78234
|
+
maxPropertiesLengthInOneLine,
|
|
78165
78235
|
});
|
|
78166
78236
|
|
|
78167
78237
|
const hasObject = n && hasObjectPattern(properties);
|
|
@@ -78183,7 +78253,11 @@ objectPattern.ObjectPattern = {
|
|
|
78183
78253
|
const isAssign = valuePath.isAssignmentPattern();
|
|
78184
78254
|
|
|
78185
78255
|
const {shorthand, computed} = property.node;
|
|
78186
|
-
const couple =
|
|
78256
|
+
const couple = isCoupleProperties({
|
|
78257
|
+
path,
|
|
78258
|
+
property,
|
|
78259
|
+
valuePath,
|
|
78260
|
+
});
|
|
78187
78261
|
|
|
78188
78262
|
maybe.indent(is);
|
|
78189
78263
|
maybe.print.breakline(couple);
|
|
@@ -78203,7 +78277,7 @@ objectPattern.ObjectPattern = {
|
|
|
78203
78277
|
maybe.print.newline(couple);
|
|
78204
78278
|
}
|
|
78205
78279
|
|
|
78206
|
-
if (is || hasObject) {
|
|
78280
|
+
if (is || hasObject && !isAssign) {
|
|
78207
78281
|
print(',');
|
|
78208
78282
|
print.newline();
|
|
78209
78283
|
|
|
@@ -78218,6 +78292,7 @@ objectPattern.ObjectPattern = {
|
|
|
78218
78292
|
|
|
78219
78293
|
indent.dec();
|
|
78220
78294
|
maybe.indent(is);
|
|
78295
|
+
maybe.indent.inc(!shouldIndent);
|
|
78221
78296
|
print('}');
|
|
78222
78297
|
}),
|
|
78223
78298
|
afterIf(path) {
|
|
@@ -78238,7 +78313,7 @@ function checkLength(properties) {
|
|
|
78238
78313
|
for (const prop of properties) {
|
|
78239
78314
|
const {value} = prop.node;
|
|
78240
78315
|
|
|
78241
|
-
if (!isIdentifier$
|
|
78316
|
+
if (!isIdentifier$9(value))
|
|
78242
78317
|
continue;
|
|
78243
78318
|
|
|
78244
78319
|
if (value.name.length > 4)
|
|
@@ -78271,23 +78346,48 @@ function hasObjectPattern(properties) {
|
|
|
78271
78346
|
const ONE_LINE$1 = false;
|
|
78272
78347
|
const COUPLE_LINES = true;
|
|
78273
78348
|
|
|
78274
|
-
function shouldAddNewline(path,
|
|
78349
|
+
function shouldAddNewline(path, semantics) {
|
|
78275
78350
|
const {parentPath} = path;
|
|
78276
78351
|
const properties = path.get('properties');
|
|
78277
78352
|
const n = properties.length - 1;
|
|
78278
78353
|
|
|
78279
|
-
|
|
78354
|
+
const {
|
|
78355
|
+
maxPropertiesInOneLine,
|
|
78356
|
+
maxPropertiesLengthInOneLine,
|
|
78357
|
+
} = semantics;
|
|
78358
|
+
|
|
78359
|
+
const moreLength = moreThenMaxPropertiesLengthInOneLine(path, {
|
|
78360
|
+
maxPropertiesLengthInOneLine,
|
|
78361
|
+
});
|
|
78362
|
+
|
|
78363
|
+
const moreCount = moreThenMaxPropertiesInOneLine(path, {
|
|
78364
|
+
maxPropertiesInOneLine,
|
|
78365
|
+
});
|
|
78366
|
+
|
|
78367
|
+
const fnParam = isFunctionParam(path);
|
|
78368
|
+
|
|
78369
|
+
if (moreCount && !moreLength)
|
|
78280
78370
|
return ONE_LINE$1;
|
|
78281
78371
|
|
|
78282
|
-
if (!isForOf$2(path) &&
|
|
78372
|
+
if (!fnParam && n && !isForOf$2(path) && checkLength(properties))
|
|
78283
78373
|
return COUPLE_LINES;
|
|
78284
78374
|
|
|
78285
|
-
if (hasAssign(properties))
|
|
78375
|
+
if (!fnParam && hasAssign(properties))
|
|
78286
78376
|
return COUPLE_LINES;
|
|
78287
78377
|
|
|
78288
78378
|
return parentPath.isObjectProperty();
|
|
78289
78379
|
}
|
|
78290
78380
|
|
|
78381
|
+
function isFunctionParam({parentPath}) {
|
|
78382
|
+
if (parentPath.isFunction())
|
|
78383
|
+
return true;
|
|
78384
|
+
|
|
78385
|
+
if (!parentPath.isAssignmentPattern())
|
|
78386
|
+
return false;
|
|
78387
|
+
|
|
78388
|
+
return parentPath.parentPath.isFunction();
|
|
78389
|
+
}
|
|
78390
|
+
|
|
78291
78391
|
var classProperty = {};
|
|
78292
78392
|
|
|
78293
78393
|
const {exists: exists$8} = is$3;
|
|
@@ -78361,6 +78461,7 @@ parens.maybeParenClose = (path, {maybe}) => {
|
|
|
78361
78461
|
|
|
78362
78462
|
const {isObjectPattern: isObjectPattern$1} = bundle.types;
|
|
78363
78463
|
const {isParens: isParens$2} = parens;
|
|
78464
|
+
const {isCoupleLines: isCoupleLines$7} = is$3;
|
|
78364
78465
|
|
|
78365
78466
|
assignmentExpression.AssignmentExpression = {
|
|
78366
78467
|
condition: (path) => {
|
|
@@ -78377,8 +78478,9 @@ assignmentExpression.AssignmentExpression = {
|
|
|
78377
78478
|
before(path, {write}) {
|
|
78378
78479
|
write('(');
|
|
78379
78480
|
},
|
|
78380
|
-
print(path, {print}) {
|
|
78481
|
+
print(path, {print, maybe}) {
|
|
78381
78482
|
const {operator} = path.node;
|
|
78483
|
+
maybe.print.breakline(isPrevCoupleLines(path));
|
|
78382
78484
|
|
|
78383
78485
|
print('__left');
|
|
78384
78486
|
print.space();
|
|
@@ -78391,6 +78493,22 @@ assignmentExpression.AssignmentExpression = {
|
|
|
78391
78493
|
},
|
|
78392
78494
|
};
|
|
78393
78495
|
|
|
78496
|
+
const isPrevCoupleLines = (path) => {
|
|
78497
|
+
const {parentPath} = path;
|
|
78498
|
+
const prev = parentPath.getPrevSibling();
|
|
78499
|
+
|
|
78500
|
+
if (!prev.node)
|
|
78501
|
+
return false;
|
|
78502
|
+
|
|
78503
|
+
const currentStart = path.node?.loc?.start.line;
|
|
78504
|
+
const prevEnd = prev.node?.loc?.end.line;
|
|
78505
|
+
|
|
78506
|
+
if (!isCoupleLines$7(prev))
|
|
78507
|
+
return false;
|
|
78508
|
+
|
|
78509
|
+
return currentStart - prevEnd < 2;
|
|
78510
|
+
};
|
|
78511
|
+
|
|
78394
78512
|
var arrayExpression = {};
|
|
78395
78513
|
|
|
78396
78514
|
var newline = {};
|
|
@@ -78399,11 +78517,11 @@ var operate = {};
|
|
|
78399
78517
|
|
|
78400
78518
|
var getBinding$2 = {};
|
|
78401
78519
|
|
|
78402
|
-
const {types: types$
|
|
78520
|
+
const {types: types$p} = bundle;
|
|
78403
78521
|
const {
|
|
78404
|
-
isIdentifier: isIdentifier$
|
|
78405
|
-
isMemberExpression: isMemberExpression$
|
|
78406
|
-
} = types$
|
|
78522
|
+
isIdentifier: isIdentifier$8,
|
|
78523
|
+
isMemberExpression: isMemberExpression$3,
|
|
78524
|
+
} = types$p;
|
|
78407
78525
|
|
|
78408
78526
|
const isString$a = (a) => typeof a === 'string';
|
|
78409
78527
|
|
|
@@ -78419,10 +78537,10 @@ const parseName$1 = (node) => {
|
|
|
78419
78537
|
if (isString$a(node))
|
|
78420
78538
|
return node;
|
|
78421
78539
|
|
|
78422
|
-
if (isIdentifier$
|
|
78540
|
+
if (isIdentifier$8(node))
|
|
78423
78541
|
return node.name;
|
|
78424
78542
|
|
|
78425
|
-
if (isMemberExpression$
|
|
78543
|
+
if (isMemberExpression$3(node))
|
|
78426
78544
|
return parseName$1(node.object);
|
|
78427
78545
|
|
|
78428
78546
|
return '';
|
|
@@ -78430,22 +78548,22 @@ const parseName$1 = (node) => {
|
|
|
78430
78548
|
|
|
78431
78549
|
var isSimple$2 = {};
|
|
78432
78550
|
|
|
78433
|
-
const {types: types$
|
|
78551
|
+
const {types: types$o} = bundle;
|
|
78434
78552
|
const {
|
|
78435
78553
|
isOptionalMemberExpression,
|
|
78436
|
-
isMemberExpression: isMemberExpression$
|
|
78437
|
-
isIdentifier: isIdentifier$
|
|
78554
|
+
isMemberExpression: isMemberExpression$2,
|
|
78555
|
+
isIdentifier: isIdentifier$7,
|
|
78438
78556
|
isLiteral: isLiteral$4,
|
|
78439
|
-
} = types$
|
|
78557
|
+
} = types$o;
|
|
78440
78558
|
|
|
78441
78559
|
isSimple$2.isSimple = (a) => {
|
|
78442
78560
|
if (isLiteral$4(a))
|
|
78443
78561
|
return true;
|
|
78444
78562
|
|
|
78445
|
-
if (isIdentifier$
|
|
78563
|
+
if (isIdentifier$7(a))
|
|
78446
78564
|
return true;
|
|
78447
78565
|
|
|
78448
|
-
if (isMemberExpression$
|
|
78566
|
+
if (isMemberExpression$2(a))
|
|
78449
78567
|
return true;
|
|
78450
78568
|
|
|
78451
78569
|
return isOptionalMemberExpression(a);
|
|
@@ -78453,33 +78571,33 @@ isSimple$2.isSimple = (a) => {
|
|
|
78453
78571
|
|
|
78454
78572
|
var extract$6 = {};
|
|
78455
78573
|
|
|
78456
|
-
const {types: types$
|
|
78574
|
+
const {types: types$n} = bundle;
|
|
78457
78575
|
const {
|
|
78458
78576
|
isArrayExpression: isArrayExpression$3,
|
|
78459
78577
|
isLiteral: isLiteral$3,
|
|
78460
|
-
isIdentifier: isIdentifier$
|
|
78461
|
-
isMemberExpression,
|
|
78578
|
+
isIdentifier: isIdentifier$6,
|
|
78579
|
+
isMemberExpression: isMemberExpression$1,
|
|
78462
78580
|
isTemplateElement: isTemplateElement$3,
|
|
78463
78581
|
isRegExpLiteral: isRegExpLiteral$1,
|
|
78464
78582
|
isClassMethod,
|
|
78465
|
-
isTemplateLiteral: isTemplateLiteral$
|
|
78583
|
+
isTemplateLiteral: isTemplateLiteral$2,
|
|
78466
78584
|
isJSXText: isJSXText$2,
|
|
78467
78585
|
isJSXAttribute: isJSXAttribute$1,
|
|
78468
78586
|
isTSTypeReference: isTSTypeReference$2,
|
|
78469
|
-
} = types$
|
|
78587
|
+
} = types$n;
|
|
78470
78588
|
|
|
78471
78589
|
extract$6.extract = extract$5;
|
|
78472
78590
|
|
|
78473
78591
|
function extract$5(node) {
|
|
78474
78592
|
node = node.node || node;
|
|
78475
78593
|
|
|
78476
|
-
if (isIdentifier$
|
|
78594
|
+
if (isIdentifier$6(node))
|
|
78477
78595
|
return node.name;
|
|
78478
78596
|
|
|
78479
78597
|
if (isRegExpLiteral$1(node))
|
|
78480
78598
|
return node.pattern;
|
|
78481
78599
|
|
|
78482
|
-
if (isTemplateLiteral$
|
|
78600
|
+
if (isTemplateLiteral$2(node))
|
|
78483
78601
|
return extract$5(node.quasis[0]);
|
|
78484
78602
|
|
|
78485
78603
|
if (isLiteral$3(node))
|
|
@@ -78488,7 +78606,7 @@ function extract$5(node) {
|
|
|
78488
78606
|
if (isTemplateElement$3(node))
|
|
78489
78607
|
return node.value.raw;
|
|
78490
78608
|
|
|
78491
|
-
if (isMemberExpression(node))
|
|
78609
|
+
if (isMemberExpression$1(node))
|
|
78492
78610
|
return `${extract$5(node.object)}.${extract$5(node.property)}`;
|
|
78493
78611
|
|
|
78494
78612
|
if (isArrayExpression$3(node))
|
|
@@ -78804,19 +78922,23 @@ setLiteralValue$2.setLiteralValue = (path, newValue) => {
|
|
|
78804
78922
|
|
|
78805
78923
|
var properties = {};
|
|
78806
78924
|
|
|
78807
|
-
var traverseProperties$
|
|
78808
|
-
|
|
78809
|
-
const {traverse: traverse$b, types: types$l} = bundle;
|
|
78925
|
+
var traverseProperties$4 = {};
|
|
78810
78926
|
|
|
78927
|
+
const {traverse: traverse$b, types: types$m} = bundle;
|
|
78811
78928
|
const {extract: extract$3} = extract$6;
|
|
78812
|
-
|
|
78929
|
+
|
|
78930
|
+
const {
|
|
78931
|
+
isObjectExpression: isObjectExpression$3,
|
|
78932
|
+
isCallExpression: isCallExpression$3,
|
|
78933
|
+
} = types$m;
|
|
78934
|
+
|
|
78813
78935
|
const nodeOrPath = (path) => path.node || path;
|
|
78814
78936
|
|
|
78815
78937
|
function getNode(path) {
|
|
78816
78938
|
if (!isObjectExpression$3(path))
|
|
78817
78939
|
return nodeOrPath(path);
|
|
78818
78940
|
|
|
78819
|
-
if (path.parentPath)
|
|
78941
|
+
if (isCallExpression$3(path.parentPath))
|
|
78820
78942
|
return path.parentPath.node;
|
|
78821
78943
|
|
|
78822
78944
|
return {
|
|
@@ -78825,7 +78947,7 @@ function getNode(path) {
|
|
|
78825
78947
|
};
|
|
78826
78948
|
}
|
|
78827
78949
|
|
|
78828
|
-
traverseProperties$
|
|
78950
|
+
traverseProperties$4.traverseProperties = (path, name, {firstLevel = false} = {}) => {
|
|
78829
78951
|
const collector = [];
|
|
78830
78952
|
const node = getNode(path);
|
|
78831
78953
|
|
|
@@ -78861,9 +78983,9 @@ const collect = ({name, collector}) => (path) => {
|
|
|
78861
78983
|
};
|
|
78862
78984
|
|
|
78863
78985
|
const {extract: extract$2} = extract$6;
|
|
78864
|
-
const {traverseProperties: traverseProperties$
|
|
78986
|
+
const {traverseProperties: traverseProperties$3} = traverseProperties$4;
|
|
78865
78987
|
|
|
78866
|
-
properties.traverseProperties = traverseProperties$
|
|
78988
|
+
properties.traverseProperties = traverseProperties$3;
|
|
78867
78989
|
|
|
78868
78990
|
properties.getProperties = (path, names) => {
|
|
78869
78991
|
const result = {};
|
|
@@ -78900,7 +79022,7 @@ properties.getProperty = (path, name) => {
|
|
|
78900
79022
|
return null;
|
|
78901
79023
|
};
|
|
78902
79024
|
|
|
78903
|
-
const {types: types$
|
|
79025
|
+
const {types: types$l} = bundle;
|
|
78904
79026
|
|
|
78905
79027
|
const {getBinding, getBindingPath} = getBinding$2;
|
|
78906
79028
|
const {isSimple: isSimple$1} = isSimple$2;
|
|
@@ -78915,7 +79037,7 @@ const {setLiteralValue: setLiteralValue$1} = setLiteralValue$2;
|
|
|
78915
79037
|
const {
|
|
78916
79038
|
getProperty: getProperty$3,
|
|
78917
79039
|
getProperties,
|
|
78918
|
-
traverseProperties: traverseProperties$
|
|
79040
|
+
traverseProperties: traverseProperties$2,
|
|
78919
79041
|
} = properties;
|
|
78920
79042
|
|
|
78921
79043
|
const {
|
|
@@ -78928,7 +79050,7 @@ const {
|
|
|
78928
79050
|
isExpression: isExpression$1,
|
|
78929
79051
|
isStatement: isStatement$3,
|
|
78930
79052
|
BlockStatement: BlockStatement$1,
|
|
78931
|
-
} = types$
|
|
79053
|
+
} = types$l;
|
|
78932
79054
|
|
|
78933
79055
|
const {assign: assign$d} = Object;
|
|
78934
79056
|
|
|
@@ -78946,7 +79068,7 @@ operate.setLiteralValue = setLiteralValue$1;
|
|
|
78946
79068
|
|
|
78947
79069
|
operate.getProperty = getProperty$3;
|
|
78948
79070
|
operate.getProperties = getProperties;
|
|
78949
|
-
operate.traverseProperties = traverseProperties$
|
|
79071
|
+
operate.traverseProperties = traverseProperties$2;
|
|
78950
79072
|
|
|
78951
79073
|
function toExpression(el) {
|
|
78952
79074
|
const {type} = el;
|
|
@@ -79014,7 +79136,11 @@ operate.insertAfter = (path, node) => {
|
|
|
79014
79136
|
if (node.trailingComments)
|
|
79015
79137
|
delete node.trailingComments;
|
|
79016
79138
|
|
|
79017
|
-
path
|
|
79139
|
+
if (isStatement$3(path) && !isStatement$3(node))
|
|
79140
|
+
path.insertAfter(ExpressionStatement$3(node));
|
|
79141
|
+
else
|
|
79142
|
+
path.insertAfter(node);
|
|
79143
|
+
|
|
79018
79144
|
path.node.comments = comments;
|
|
79019
79145
|
};
|
|
79020
79146
|
|
|
@@ -79087,7 +79213,7 @@ const {
|
|
|
79087
79213
|
isAwaitExpression,
|
|
79088
79214
|
isBooleanLiteral: isBooleanLiteral$1,
|
|
79089
79215
|
isNullLiteral,
|
|
79090
|
-
isStringLiteral: isStringLiteral$
|
|
79216
|
+
isStringLiteral: isStringLiteral$5,
|
|
79091
79217
|
isSpreadElement: isSpreadElement$1,
|
|
79092
79218
|
} = bundle.types;
|
|
79093
79219
|
|
|
@@ -79098,6 +79224,7 @@ const {
|
|
|
79098
79224
|
isCoupleLines: isCoupleLines$6,
|
|
79099
79225
|
isStringAndArray: isStringAndArray$1,
|
|
79100
79226
|
isIdentifierAndIdentifier: isIdentifierAndIdentifier$1,
|
|
79227
|
+
isSimpleAndEmptyObject: isSimpleAndEmptyObject$1,
|
|
79101
79228
|
} = is$3;
|
|
79102
79229
|
|
|
79103
79230
|
const {round: round$1} = Math;
|
|
@@ -79119,6 +79246,7 @@ const isSimpleAndCall = ([a, b]) => {
|
|
|
79119
79246
|
};
|
|
79120
79247
|
|
|
79121
79248
|
const isBooleanAndSimple = ([a, b]) => isBooleanLiteral$1(a) && isSimple(b);
|
|
79249
|
+
const isBooleanAndObject = ([a, b]) => isBooleanLiteral$1(a) && isObjectExpression$2(b);
|
|
79122
79250
|
const isNullAndSimple = ([a, b]) => isNullLiteral(a) && isSimple(b);
|
|
79123
79251
|
const isSimpleAndObject = ([a, b]) => isSimple(a) && isObjectExpression$2(b);
|
|
79124
79252
|
const ONE_LINE = false;
|
|
@@ -79137,6 +79265,9 @@ newline.isMultiLine = (path, {elements, maxElementsInOneLine}) => {
|
|
|
79137
79265
|
if (elements.length > 3 && !isObjectExpression$2(elements[0]))
|
|
79138
79266
|
return MULTI_LINE;
|
|
79139
79267
|
|
|
79268
|
+
if (isSimpleAndEmptyObject$1(elements))
|
|
79269
|
+
return MULTI_LINE;
|
|
79270
|
+
|
|
79140
79271
|
if (isOneSimple(path))
|
|
79141
79272
|
return ONE_LINE;
|
|
79142
79273
|
|
|
@@ -79202,7 +79333,7 @@ newline.isMultiLine = (path, {elements, maxElementsInOneLine}) => {
|
|
|
79202
79333
|
|
|
79203
79334
|
const isForOf$1 = ({parentPath}) => parentPath.isForOfStatement();
|
|
79204
79335
|
|
|
79205
|
-
const isStringAndString = ([a, b]) => isStringLiteral$
|
|
79336
|
+
const isStringAndString = ([a, b]) => isStringLiteral$5(a) && isStringLiteral$5(b);
|
|
79206
79337
|
|
|
79207
79338
|
const isShortTwoSimplesInsideCall = (path, short) => {
|
|
79208
79339
|
const {node, parentPath} = path;
|
|
@@ -79214,7 +79345,7 @@ const isShortTwoSimplesInsideCall = (path, short) => {
|
|
|
79214
79345
|
if (!parentPath.isCallExpression())
|
|
79215
79346
|
return false;
|
|
79216
79347
|
|
|
79217
|
-
if (!isStringLiteral$
|
|
79348
|
+
if (!isStringLiteral$5(a) || !isStringLiteral$5(b))
|
|
79218
79349
|
return false;
|
|
79219
79350
|
|
|
79220
79351
|
return length < short;
|
|
@@ -79233,7 +79364,7 @@ const isTwoSimplesInsideObjectProperty = (path) => {
|
|
|
79233
79364
|
if (!parentPath.isObjectProperty())
|
|
79234
79365
|
return false;
|
|
79235
79366
|
|
|
79236
|
-
if (!isStringLiteral$
|
|
79367
|
+
if (!isStringLiteral$5(a) || !isStringLiteral$5(b))
|
|
79237
79368
|
return false;
|
|
79238
79369
|
|
|
79239
79370
|
return !isCoupleLines$6(path);
|
|
@@ -79331,6 +79462,9 @@ function isIncreaseIndent$1(path) {
|
|
|
79331
79462
|
if (!elements.length)
|
|
79332
79463
|
return false;
|
|
79333
79464
|
|
|
79465
|
+
if (isBooleanAndObject(elements))
|
|
79466
|
+
return true;
|
|
79467
|
+
|
|
79334
79468
|
if (isInsideCallLoop(path))
|
|
79335
79469
|
return false;
|
|
79336
79470
|
|
|
@@ -79354,7 +79488,7 @@ const isStringAndObject = (elements) => {
|
|
|
79354
79488
|
const first = elements.at(0);
|
|
79355
79489
|
const last = elements.at(-1);
|
|
79356
79490
|
|
|
79357
|
-
return isStringLiteral$
|
|
79491
|
+
return isStringLiteral$5(first) && isObjectExpression$2(last);
|
|
79358
79492
|
};
|
|
79359
79493
|
|
|
79360
79494
|
newline.isCurrentNewLine = (path) => {
|
|
@@ -79366,13 +79500,13 @@ newline.isCurrentNewLine = (path) => {
|
|
|
79366
79500
|
|
|
79367
79501
|
var indent = {};
|
|
79368
79502
|
|
|
79369
|
-
const {types: types$
|
|
79503
|
+
const {types: types$k} = bundle;
|
|
79370
79504
|
const {isIndented} = is$3;
|
|
79371
79505
|
|
|
79372
79506
|
const {
|
|
79373
|
-
isStringLiteral: isStringLiteral$
|
|
79507
|
+
isStringLiteral: isStringLiteral$4,
|
|
79374
79508
|
isArrayExpression: isArrayExpression$1,
|
|
79375
|
-
} = types$
|
|
79509
|
+
} = types$k;
|
|
79376
79510
|
|
|
79377
79511
|
const isInsideArray$1 = (path) => path.parentPath.isArrayExpression();
|
|
79378
79512
|
|
|
@@ -79408,18 +79542,41 @@ function isArrayInsideArray$1(path) {
|
|
|
79408
79542
|
const isTwoLongStrings = ([a, b]) => {
|
|
79409
79543
|
const LONG_STRING = 20;
|
|
79410
79544
|
|
|
79411
|
-
if (!isStringLiteral$
|
|
79545
|
+
if (!isStringLiteral$4(a) || !isStringLiteral$4(b))
|
|
79412
79546
|
return false;
|
|
79413
79547
|
|
|
79414
79548
|
return a.node.value.length > LONG_STRING;
|
|
79415
79549
|
};
|
|
79416
79550
|
|
|
79417
|
-
|
|
79551
|
+
var isObjectAfterSimple$1 = {};
|
|
79552
|
+
|
|
79553
|
+
const {isNextObject: isNextObject$1, isPrevObject} = is$3;
|
|
79554
|
+
|
|
79555
|
+
const SIMPLE_TYPES = [
|
|
79556
|
+
'ArrayExpression',
|
|
79557
|
+
'ObjectExpression',
|
|
79558
|
+
'SpreadElement',
|
|
79559
|
+
'CallExpression',
|
|
79560
|
+
'Identifier',
|
|
79561
|
+
];
|
|
79562
|
+
|
|
79563
|
+
isObjectAfterSimple$1.isObjectAfterSimple = (a) => {
|
|
79564
|
+
const {type} = a;
|
|
79565
|
+
|
|
79566
|
+
if (!isNextObject$1(a) || isPrevObject(a))
|
|
79567
|
+
return false;
|
|
79568
|
+
|
|
79569
|
+
return SIMPLE_TYPES.includes(type);
|
|
79570
|
+
};
|
|
79571
|
+
|
|
79572
|
+
const {types: types$j} = bundle;
|
|
79418
79573
|
const {
|
|
79419
79574
|
isCoupleLines: isCoupleLines$5,
|
|
79420
79575
|
isStringAndIdentifier,
|
|
79421
79576
|
isIdentifierAndIdentifier,
|
|
79422
79577
|
isStringAndArray,
|
|
79578
|
+
isSimpleAndEmptyObject,
|
|
79579
|
+
isNextObject,
|
|
79423
79580
|
} = is$3;
|
|
79424
79581
|
|
|
79425
79582
|
const {
|
|
@@ -79434,18 +79591,56 @@ const {
|
|
|
79434
79591
|
isArrayIndented,
|
|
79435
79592
|
} = indent;
|
|
79436
79593
|
|
|
79594
|
+
const {isObjectAfterSimple} = isObjectAfterSimple$1;
|
|
79595
|
+
|
|
79437
79596
|
const {
|
|
79438
79597
|
isObjectExpression: isObjectExpression$1,
|
|
79439
79598
|
isSpreadElement,
|
|
79440
|
-
isStringLiteral: isStringLiteral$
|
|
79441
|
-
|
|
79599
|
+
isStringLiteral: isStringLiteral$3,
|
|
79600
|
+
isIdentifier: isIdentifier$5,
|
|
79601
|
+
} = types$j;
|
|
79442
79602
|
|
|
79443
|
-
const isNextString = (path) => isStringLiteral$
|
|
79444
|
-
const isPrevString = (path) => isStringLiteral$
|
|
79603
|
+
const isNextString = (path) => isStringLiteral$3(path.getNextSibling());
|
|
79604
|
+
const isPrevString = (path) => isStringLiteral$3(path.getPrevSibling());
|
|
79445
79605
|
const isAroundStrings = (path) => isNextString(path) || isPrevString(path);
|
|
79446
|
-
|
|
79447
|
-
const
|
|
79448
|
-
|
|
79606
|
+
|
|
79607
|
+
const isSpreadBeforeObject = (a) => {
|
|
79608
|
+
if (!a.isObjectExpression())
|
|
79609
|
+
return false;
|
|
79610
|
+
|
|
79611
|
+
const prev = a.getPrevSibling();
|
|
79612
|
+
|
|
79613
|
+
if (!prev.isSpreadElement())
|
|
79614
|
+
return false;
|
|
79615
|
+
|
|
79616
|
+
if (prev.getPrevSibling().isObjectExpression())
|
|
79617
|
+
return false;
|
|
79618
|
+
|
|
79619
|
+
return prev
|
|
79620
|
+
.get('argument')
|
|
79621
|
+
.isCallExpression();
|
|
79622
|
+
};
|
|
79623
|
+
|
|
79624
|
+
const isNextSimple = (a) => {
|
|
79625
|
+
const next = a.getNextSibling();
|
|
79626
|
+
|
|
79627
|
+
if (next.isSpreadElement())
|
|
79628
|
+
return true;
|
|
79629
|
+
|
|
79630
|
+
return next.isIdentifier();
|
|
79631
|
+
};
|
|
79632
|
+
|
|
79633
|
+
const isNextSimpleBetweenObjects = (a) => {
|
|
79634
|
+
const next = a.getNextSibling();
|
|
79635
|
+
const is = next.isSpreadElement() || next.isIdentifier();
|
|
79636
|
+
|
|
79637
|
+
if (!is)
|
|
79638
|
+
return true;
|
|
79639
|
+
|
|
79640
|
+
return next
|
|
79641
|
+
.getNextSibling()
|
|
79642
|
+
.isObjectExpression();
|
|
79643
|
+
};
|
|
79449
79644
|
|
|
79450
79645
|
const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1;
|
|
79451
79646
|
|
|
@@ -79495,18 +79690,24 @@ arrayExpression.ArrayExpression = {
|
|
|
79495
79690
|
|
|
79496
79691
|
for (const [index, element] of elements.entries()) {
|
|
79497
79692
|
const is = isNewLine && isCurrentNewLine(element);
|
|
79693
|
+
|
|
79694
|
+
if (isSimpleAfterObject(element))
|
|
79695
|
+
print.newline();
|
|
79696
|
+
|
|
79498
79697
|
maybe.indent(is);
|
|
79499
79698
|
print(element);
|
|
79500
79699
|
|
|
79501
79700
|
if (index < n || trailingComma)
|
|
79502
79701
|
maybe.print(is, ',');
|
|
79503
79702
|
|
|
79504
|
-
maybe.print.newline(is && !isNextObject(element));
|
|
79505
|
-
maybe.print.space(
|
|
79703
|
+
maybe.print.newline((is || isSpreadBeforeObject(element)) && !isNextObject(element));
|
|
79704
|
+
maybe.print.space(is && isObjectAfterSimple(element));
|
|
79506
79705
|
|
|
79507
79706
|
if (!is && index < n) {
|
|
79508
79707
|
print(',');
|
|
79509
|
-
|
|
79708
|
+
|
|
79709
|
+
if (isNextSimpleBetweenObjects(element) || !(element.isObjectExpression() && isNextSimple(element)))
|
|
79710
|
+
print.space();
|
|
79510
79711
|
}
|
|
79511
79712
|
}
|
|
79512
79713
|
|
|
@@ -79526,6 +79727,11 @@ arrayExpression.ArrayExpression = {
|
|
|
79526
79727
|
maybe.indent(elements.length && isNewLine);
|
|
79527
79728
|
}
|
|
79528
79729
|
|
|
79730
|
+
if (isSimpleAndEmptyObject(elements) && !isSpreadElement(elements.at(-1))) {
|
|
79731
|
+
print(',');
|
|
79732
|
+
print.breakline();
|
|
79733
|
+
}
|
|
79734
|
+
|
|
79529
79735
|
print(']');
|
|
79530
79736
|
},
|
|
79531
79737
|
afterIf(path) {
|
|
@@ -79550,6 +79756,19 @@ arrayExpression.ArrayExpression = {
|
|
|
79550
79756
|
},
|
|
79551
79757
|
};
|
|
79552
79758
|
|
|
79759
|
+
function isSimpleAfterObject(path) {
|
|
79760
|
+
if (!isSpreadElement(path) && !isIdentifier$5(path))
|
|
79761
|
+
return;
|
|
79762
|
+
|
|
79763
|
+
const prev = path.getPrevSibling();
|
|
79764
|
+
const next = path.getNextSibling();
|
|
79765
|
+
|
|
79766
|
+
if (next.isObjectExpression())
|
|
79767
|
+
return false;
|
|
79768
|
+
|
|
79769
|
+
return prev.isObjectExpression();
|
|
79770
|
+
}
|
|
79771
|
+
|
|
79553
79772
|
var arrayPattern = {};
|
|
79554
79773
|
|
|
79555
79774
|
const {maybeTypeAnnotation: maybeTypeAnnotation$2} = maybeTypeAnnotation$4;
|
|
@@ -80111,11 +80330,31 @@ expressionStatement.ExpressionStatement = {
|
|
|
80111
80330
|
if (hasTrailingComment$1(path) && !isCoupleLines$4(path))
|
|
80112
80331
|
return;
|
|
80113
80332
|
|
|
80333
|
+
if (isTopParentLast(path))
|
|
80334
|
+
return;
|
|
80335
|
+
|
|
80114
80336
|
print.newline();
|
|
80115
80337
|
maybe.markAfter(store(), path);
|
|
80116
80338
|
},
|
|
80117
80339
|
};
|
|
80118
80340
|
|
|
80341
|
+
function isTopParentLast({parentPath}) {
|
|
80342
|
+
if (!parentPath.isIfStatement())
|
|
80343
|
+
return false;
|
|
80344
|
+
|
|
80345
|
+
const nextParent = parentPath.parentPath;
|
|
80346
|
+
|
|
80347
|
+
if (!nextParent.isIfStatement())
|
|
80348
|
+
return false;
|
|
80349
|
+
|
|
80350
|
+
const nextNext = nextParent.parentPath;
|
|
80351
|
+
|
|
80352
|
+
if (!nextNext.isIfStatement())
|
|
80353
|
+
return false;
|
|
80354
|
+
|
|
80355
|
+
return isLast$a(nextNext);
|
|
80356
|
+
}
|
|
80357
|
+
|
|
80119
80358
|
function isNotLastBody(path) {
|
|
80120
80359
|
return path.parentPath.get('body') === path;
|
|
80121
80360
|
}
|
|
@@ -80236,7 +80475,6 @@ variableDeclaration.VariableDeclaration = {
|
|
|
80236
80475
|
write.newline();
|
|
80237
80476
|
wasNewline = true;
|
|
80238
80477
|
} else if (isParentSwitchCase(path)) {
|
|
80239
|
-
//write.breakline();
|
|
80240
80478
|
write.newline();
|
|
80241
80479
|
}
|
|
80242
80480
|
|
|
@@ -80391,6 +80629,7 @@ ifStatement.IfStatement = {
|
|
|
80391
80629
|
const alternate = path.get('alternate');
|
|
80392
80630
|
const isConsequentBlock = consequent.isBlockStatement();
|
|
80393
80631
|
const isVar = consequent.isVariableDeclaration();
|
|
80632
|
+
consequent.isReturnStatement();
|
|
80394
80633
|
|
|
80395
80634
|
if (isConsequentBlock) {
|
|
80396
80635
|
print.space();
|
|
@@ -80414,7 +80653,12 @@ ifStatement.IfStatement = {
|
|
|
80414
80653
|
write.space();
|
|
80415
80654
|
traverse(alternate);
|
|
80416
80655
|
} else if (alternate.isIfStatement()) {
|
|
80417
|
-
|
|
80656
|
+
if (alternate.get('consequent').isBlockStatement())
|
|
80657
|
+
write.space();
|
|
80658
|
+
else
|
|
80659
|
+
indent();
|
|
80660
|
+
|
|
80661
|
+
write('else ');
|
|
80418
80662
|
traverse(alternate);
|
|
80419
80663
|
} else if (exists$6(alternate)) {
|
|
80420
80664
|
maybe.write.newline(isVar);
|
|
@@ -80427,6 +80671,9 @@ ifStatement.IfStatement = {
|
|
|
80427
80671
|
indent.dec();
|
|
80428
80672
|
}
|
|
80429
80673
|
|
|
80674
|
+
if (!isNext$i(path) && !consequent.isBlockStatement())
|
|
80675
|
+
return;
|
|
80676
|
+
|
|
80430
80677
|
if (path === partOfAlternate && isInside(path))
|
|
80431
80678
|
print.newline();
|
|
80432
80679
|
},
|
|
@@ -80738,6 +80985,8 @@ const {maybeSpaceAfterKeyword} = maybeSpaceAfterKeyword$1;
|
|
|
80738
80985
|
|
|
80739
80986
|
const isBodyLength = ({parentPath}) => parentPath.node?.body?.length > 2;
|
|
80740
80987
|
|
|
80988
|
+
const isInsideIfWithElse = ({parentPath}) => parentPath.isIfStatement() && parentPath.node.alternate;
|
|
80989
|
+
|
|
80741
80990
|
returnStatement.ReturnStatement = {
|
|
80742
80991
|
beforeIf(path) {
|
|
80743
80992
|
return !hasPrevNewline(path) && isBodyLength(path) || isPrevBody(path);
|
|
@@ -80765,6 +81014,9 @@ returnStatement.ReturnStatement = {
|
|
|
80765
81014
|
print(';');
|
|
80766
81015
|
},
|
|
80767
81016
|
afterIf: (path) => {
|
|
81017
|
+
if (isInsideIfWithElse(path))
|
|
81018
|
+
return true;
|
|
81019
|
+
|
|
80768
81020
|
if (isLast$6(path))
|
|
80769
81021
|
return false;
|
|
80770
81022
|
|
|
@@ -80993,11 +81245,18 @@ const {
|
|
|
80993
81245
|
|
|
80994
81246
|
importDeclaration.ImportAttribute = ImportAttribute;
|
|
80995
81247
|
importDeclaration.ImportDeclaration = {
|
|
80996
|
-
print(path,
|
|
81248
|
+
print(path, printer, semantics) {
|
|
81249
|
+
const {
|
|
81250
|
+
print,
|
|
81251
|
+
maybe,
|
|
81252
|
+
write,
|
|
81253
|
+
traverse,
|
|
81254
|
+
indent,
|
|
81255
|
+
} = printer;
|
|
81256
|
+
|
|
80997
81257
|
const {phase} = path.node;
|
|
80998
81258
|
const isType = path.node.importKind === 'type';
|
|
80999
81259
|
const specifiers = path.get('specifiers');
|
|
81000
|
-
const {maxSpecifiersInOneLine} = options;
|
|
81001
81260
|
|
|
81002
81261
|
indent();
|
|
81003
81262
|
write('import');
|
|
@@ -81026,6 +81285,7 @@ importDeclaration.ImportDeclaration = {
|
|
|
81026
81285
|
traverse(spec.get('local'));
|
|
81027
81286
|
}
|
|
81028
81287
|
|
|
81288
|
+
const maxSpecifiersInOneLine = parseMaxSpecifiers(imports, semantics);
|
|
81029
81289
|
const importsCount = imports.length - 1;
|
|
81030
81290
|
|
|
81031
81291
|
for (const [index, spec] of imports.entries()) {
|
|
@@ -81037,7 +81297,7 @@ importDeclaration.ImportDeclaration = {
|
|
|
81037
81297
|
indent.inc();
|
|
81038
81298
|
|
|
81039
81299
|
maybe.write(!wasSpecifier, '{');
|
|
81040
|
-
maybe.write.breakline(importsCount
|
|
81300
|
+
maybe.write.breakline(importsCount >= maxSpecifiersInOneLine);
|
|
81041
81301
|
|
|
81042
81302
|
wasSpecifier = true;
|
|
81043
81303
|
write(imported.name);
|
|
@@ -81047,18 +81307,18 @@ importDeclaration.ImportDeclaration = {
|
|
|
81047
81307
|
write(spec.node.local.name);
|
|
81048
81308
|
}
|
|
81049
81309
|
|
|
81050
|
-
if (importsCount
|
|
81310
|
+
if (importsCount < maxSpecifiersInOneLine && notLast) {
|
|
81051
81311
|
maybe.write(n, ',');
|
|
81052
81312
|
maybe.write.space(n);
|
|
81053
81313
|
}
|
|
81054
81314
|
|
|
81055
|
-
if (importsCount
|
|
81315
|
+
if (importsCount >= maxSpecifiersInOneLine) {
|
|
81056
81316
|
maybe.write(n, ',');
|
|
81057
81317
|
|
|
81058
81318
|
const last = index === n;
|
|
81059
|
-
const
|
|
81319
|
+
const penulty = index === n - 1;
|
|
81060
81320
|
|
|
81061
|
-
maybe.write.newline(
|
|
81321
|
+
maybe.write.newline(penulty && defaults.length);
|
|
81062
81322
|
maybe.write.newline(last);
|
|
81063
81323
|
}
|
|
81064
81324
|
|
|
@@ -81091,6 +81351,23 @@ importDeclaration.ImportDeclaration = {
|
|
|
81091
81351
|
},
|
|
81092
81352
|
};
|
|
81093
81353
|
|
|
81354
|
+
function parseMaxSpecifiers(imports, semantics) {
|
|
81355
|
+
const {
|
|
81356
|
+
maxSpecifiersInOneLine,
|
|
81357
|
+
maxPropertiesLengthInOneLine,
|
|
81358
|
+
} = semantics;
|
|
81359
|
+
|
|
81360
|
+
for (const {node} of imports) {
|
|
81361
|
+
if (node.imported.name !== node.local.name)
|
|
81362
|
+
return 1;
|
|
81363
|
+
|
|
81364
|
+
if (node.imported.name.length >= maxPropertiesLengthInOneLine)
|
|
81365
|
+
return 1;
|
|
81366
|
+
}
|
|
81367
|
+
|
|
81368
|
+
return maxSpecifiersInOneLine;
|
|
81369
|
+
}
|
|
81370
|
+
|
|
81094
81371
|
var exportDeclaration = {};
|
|
81095
81372
|
|
|
81096
81373
|
const {
|
|
@@ -81431,6 +81708,7 @@ var program = {};
|
|
|
81431
81708
|
|
|
81432
81709
|
const {parseComments: parseComments$1} = comment;
|
|
81433
81710
|
const {getDirectives} = getDirectives$2;
|
|
81711
|
+
const {hasCoupleTrailingComments} = is$3;
|
|
81434
81712
|
|
|
81435
81713
|
program.Program = (path, printer, semantics) => {
|
|
81436
81714
|
const {body} = path.node;
|
|
@@ -81457,6 +81735,9 @@ program.Program = (path, printer, semantics) => {
|
|
|
81457
81735
|
if (directives.length && !body.length)
|
|
81458
81736
|
return;
|
|
81459
81737
|
|
|
81738
|
+
if (body.length && hasCoupleTrailingComments(body.at(-1)))
|
|
81739
|
+
return;
|
|
81740
|
+
|
|
81460
81741
|
write.endOfFile();
|
|
81461
81742
|
};
|
|
81462
81743
|
|
|
@@ -81587,9 +81868,26 @@ identifier.Identifier = maybeParens$2(maybeTypeAnnotation((path, printer) => {
|
|
|
81587
81868
|
maybe.write(optional, '?');
|
|
81588
81869
|
}));
|
|
81589
81870
|
|
|
81871
|
+
var decorator = {};
|
|
81872
|
+
|
|
81873
|
+
const {isMemberExpression} = bundle.types;
|
|
81874
|
+
|
|
81875
|
+
decorator.Decorator = (path, {print, maybe}) => {
|
|
81876
|
+
const {expression} = path.node;
|
|
81877
|
+
const isMember = isMemberExpression(expression);
|
|
81878
|
+
|
|
81879
|
+
print('@');
|
|
81880
|
+
|
|
81881
|
+
maybe.print(isMember, '(');
|
|
81882
|
+
print('__expression');
|
|
81883
|
+
maybe.print(isMember, ')');
|
|
81884
|
+
};
|
|
81885
|
+
|
|
81590
81886
|
const {TemplateLiteral} = templateLiteral;
|
|
81591
81887
|
const {Identifier: Identifier$2} = identifier;
|
|
81592
81888
|
|
|
81889
|
+
const {Decorator} = decorator;
|
|
81890
|
+
|
|
81593
81891
|
const maybeEncode = (value, {encodeDoubleQuote, encodeSingleQuote}) => {
|
|
81594
81892
|
if (encodeSingleQuote && !value.includes('\\'))
|
|
81595
81893
|
return value.replaceAll(`'`, `\\'`);
|
|
@@ -81602,14 +81900,11 @@ const maybeEncode = (value, {encodeDoubleQuote, encodeSingleQuote}) => {
|
|
|
81602
81900
|
|
|
81603
81901
|
var literals$1 = {
|
|
81604
81902
|
Identifier: Identifier$2,
|
|
81903
|
+
Decorator,
|
|
81605
81904
|
TemplateLiteral,
|
|
81606
81905
|
BigIntLiteral(path, {write}) {
|
|
81607
81906
|
write(path.node.raw);
|
|
81608
81907
|
},
|
|
81609
|
-
Decorator(path, {print}) {
|
|
81610
|
-
print('@');
|
|
81611
|
-
print('__expression');
|
|
81612
|
-
},
|
|
81613
81908
|
NumericLiteral(path, {write}) {
|
|
81614
81909
|
const {
|
|
81615
81910
|
raw,
|
|
@@ -81711,8 +82006,13 @@ const {
|
|
|
81711
82006
|
const {markAfter} = mark;
|
|
81712
82007
|
const {maybeDeclare: maybeDeclare$3} = maybeDeclare$6;
|
|
81713
82008
|
const isNextType = (a) => a.getNextSibling().isTSTypeAliasDeclaration();
|
|
82009
|
+
const isNextExport = (a) => a.getNextSibling().isExportDeclaration();
|
|
81714
82010
|
|
|
81715
82011
|
tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
82012
|
+
beforeIf: (path) => !path.parentPath.isExportDeclaration(),
|
|
82013
|
+
before: (path, {indent}) => {
|
|
82014
|
+
indent();
|
|
82015
|
+
},
|
|
81716
82016
|
print: maybeDeclare$3((path, {print, maybe, store}) => {
|
|
81717
82017
|
const typeAnnotation = path.get('typeAnnotation');
|
|
81718
82018
|
const isConditional = typeAnnotation.isTSConditionalType();
|
|
@@ -81742,7 +82042,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
|
81742
82042
|
|
|
81743
82043
|
return !isNextType(path);
|
|
81744
82044
|
},
|
|
81745
|
-
after(path, {print}) {
|
|
82045
|
+
after(path, {print, maybe}) {
|
|
82046
|
+
maybe.indent(isNextExport(path));
|
|
81746
82047
|
print.newline();
|
|
81747
82048
|
markAfter(path);
|
|
81748
82049
|
},
|
|
@@ -81750,8 +82051,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
|
81750
82051
|
|
|
81751
82052
|
var tsMappedType = {};
|
|
81752
82053
|
|
|
81753
|
-
const {types: types$
|
|
81754
|
-
const {isTSConditionalType} = types$
|
|
82054
|
+
const {types: types$i} = bundle;
|
|
82055
|
+
const {isTSConditionalType} = types$i;
|
|
81755
82056
|
|
|
81756
82057
|
tsMappedType.TSMappedType = (path, {print, indent, maybe}) => {
|
|
81757
82058
|
const {
|
|
@@ -82639,6 +82940,9 @@ var jsxOpeningElement = {};
|
|
|
82639
82940
|
const {isCoupleLines: isCoupleLines$1} = is$3;
|
|
82640
82941
|
|
|
82641
82942
|
const isNotJSX = ({parentPath}) => {
|
|
82943
|
+
if (parentPath.parentPath.isCallExpression())
|
|
82944
|
+
return false;
|
|
82945
|
+
|
|
82642
82946
|
if (parentPath.parentPath.isJSXElement())
|
|
82643
82947
|
return false;
|
|
82644
82948
|
|
|
@@ -82841,7 +83145,7 @@ function snakeCase(str) {
|
|
|
82841
83145
|
}
|
|
82842
83146
|
|
|
82843
83147
|
const {stringify: stringify$8} = JSON;
|
|
82844
|
-
const {TYPES: TYPES$2} = types$
|
|
83148
|
+
const {TYPES: TYPES$2} = types$s;
|
|
82845
83149
|
const toSnakeCase = justSnakeCase;
|
|
82846
83150
|
|
|
82847
83151
|
const {codeFrameColumns: codeFrameColumns$1} = bundle;
|
|
@@ -82951,6 +83255,7 @@ function initSemantics(semantics = {}) {
|
|
|
82951
83255
|
return {
|
|
82952
83256
|
comments: true,
|
|
82953
83257
|
maxPropertiesInOneLine: 2,
|
|
83258
|
+
maxPropertiesLengthInOneLine: 15,
|
|
82954
83259
|
maxSpecifiersInOneLine: 2,
|
|
82955
83260
|
maxElementsInOneLine: 5,
|
|
82956
83261
|
maxVariablesInOneLine: 4,
|
|
@@ -82966,7 +83271,7 @@ const {round} = Math;
|
|
|
82966
83271
|
const fullstore$2 = fullstore$3;
|
|
82967
83272
|
const isObject$4 = (a) => a && typeof a === 'object';
|
|
82968
83273
|
const babelTraverse$2 = bundle.traverse;
|
|
82969
|
-
const {TYPES: TYPES$1} = types$
|
|
83274
|
+
const {TYPES: TYPES$1} = types$s;
|
|
82970
83275
|
const baseVisitors = visitors$1;
|
|
82971
83276
|
|
|
82972
83277
|
const {
|
|
@@ -83334,6 +83639,7 @@ json.toJS = (source, name = __json) => {
|
|
|
83334
83639
|
};
|
|
83335
83640
|
|
|
83336
83641
|
json.fromJS = (source, name = __json) => {
|
|
83642
|
+
source = maybeNewline$1(source);
|
|
83337
83643
|
const shortName = cut$1(name);
|
|
83338
83644
|
|
|
83339
83645
|
source = source.slice(source.indexOf(shortName));
|
|
@@ -83859,7 +84165,7 @@ var getAst = (node) => {
|
|
|
83859
84165
|
return ast;
|
|
83860
84166
|
};
|
|
83861
84167
|
|
|
83862
|
-
const {traverse: traverse$a, types: types$
|
|
84168
|
+
const {traverse: traverse$a, types: types$h} = bundle;
|
|
83863
84169
|
|
|
83864
84170
|
const traverseObjectExpression = traverseObjectExpression$1;
|
|
83865
84171
|
const setClassMethod = setClassMethod$1;
|
|
@@ -83886,7 +84192,7 @@ const getAST = getAst;
|
|
|
83886
84192
|
const {
|
|
83887
84193
|
isObjectExpression,
|
|
83888
84194
|
isExportDeclaration,
|
|
83889
|
-
} = types$
|
|
84195
|
+
} = types$h;
|
|
83890
84196
|
|
|
83891
84197
|
var estreeToBabel = (node) => {
|
|
83892
84198
|
const ast = getAST(node);
|
|
@@ -91299,14 +91605,16 @@ const clean = (a) => a.filter(Boolean);
|
|
|
91299
91605
|
const initBabel = once$6(() => bundle);
|
|
91300
91606
|
const {assign: assign$8} = Object;
|
|
91301
91607
|
|
|
91302
|
-
// There is a difference in options naming for babel and recast
|
|
91303
|
-
|
|
91608
|
+
// There is a difference in options naming for babel and recast
|
|
91609
|
+
// recast -> sourceFileName
|
|
91610
|
+
// babel, putout: sourceFilename
|
|
91611
|
+
babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true, isFlow = getFlow(source), isRecovery}) {
|
|
91304
91612
|
const {parse} = initBabel();
|
|
91305
|
-
|
|
91306
91613
|
const parserOptions = {
|
|
91307
91614
|
sourceType: 'module',
|
|
91308
91615
|
tokens: true,
|
|
91309
91616
|
...options,
|
|
91617
|
+
errorRecovery: isRecovery,
|
|
91310
91618
|
plugins: clean([
|
|
91311
91619
|
...plugins,
|
|
91312
91620
|
...getBabelLangExts({
|
|
@@ -104016,7 +104324,7 @@ function isAbsolute(path) {
|
|
|
104016
104324
|
}
|
|
104017
104325
|
|
|
104018
104326
|
// posix version
|
|
104019
|
-
function join$
|
|
104327
|
+
function join$3() {
|
|
104020
104328
|
var paths = Array.prototype.slice.call(arguments, 0);
|
|
104021
104329
|
return normalize(filter$1(paths, function(p, index) {
|
|
104022
104330
|
if (typeof p !== 'string') {
|
|
@@ -104101,17 +104409,17 @@ function basename$3(path, ext) {
|
|
|
104101
104409
|
}
|
|
104102
104410
|
|
|
104103
104411
|
|
|
104104
|
-
function extname(path) {
|
|
104412
|
+
function extname$1(path) {
|
|
104105
104413
|
return splitPath(path)[3];
|
|
104106
104414
|
}
|
|
104107
104415
|
var _polyfillNode_path = {
|
|
104108
|
-
extname: extname,
|
|
104416
|
+
extname: extname$1,
|
|
104109
104417
|
basename: basename$3,
|
|
104110
104418
|
dirname: dirname$1,
|
|
104111
104419
|
sep: sep,
|
|
104112
104420
|
delimiter: delimiter,
|
|
104113
104421
|
relative: relative$1,
|
|
104114
|
-
join: join$
|
|
104422
|
+
join: join$3,
|
|
104115
104423
|
isAbsolute: isAbsolute,
|
|
104116
104424
|
normalize: normalize,
|
|
104117
104425
|
resolve: resolve
|
|
@@ -104140,9 +104448,9 @@ var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
|
|
|
104140
104448
|
default: _polyfillNode_path,
|
|
104141
104449
|
delimiter: delimiter,
|
|
104142
104450
|
dirname: dirname$1,
|
|
104143
|
-
extname: extname,
|
|
104451
|
+
extname: extname$1,
|
|
104144
104452
|
isAbsolute: isAbsolute,
|
|
104145
|
-
join: join$
|
|
104453
|
+
join: join$3,
|
|
104146
104454
|
normalize: normalize,
|
|
104147
104455
|
relative: relative$1,
|
|
104148
104456
|
resolve: resolve,
|
|
@@ -109132,7 +109440,7 @@ function requireDist () {
|
|
|
109132
109440
|
|
|
109133
109441
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
109134
109442
|
|
|
109135
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (
|
|
109443
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
109136
109444
|
|
|
109137
109445
|
const DEFAULTS = {
|
|
109138
109446
|
flow: 'detect'
|
|
@@ -109216,20 +109524,35 @@ var tryCatch$5 = (fn, ...args) => {
|
|
|
109216
109524
|
|
|
109217
109525
|
const tryCatch$4 = tryCatch$5;
|
|
109218
109526
|
|
|
109219
|
-
var secondChance$1 = (fn, source,
|
|
109527
|
+
var secondChance$1 = (fn, source, messages, args) => {
|
|
109528
|
+
const [a, ...others] = args;
|
|
109220
109529
|
const [errorA, resultA] = tryCatch$4(fn, source, a);
|
|
109221
109530
|
|
|
109222
109531
|
if (!errorA)
|
|
109223
109532
|
return resultA;
|
|
109224
109533
|
|
|
109225
|
-
|
|
109534
|
+
if (checkError(errorA, messages))
|
|
109535
|
+
throw errorA;
|
|
109226
109536
|
|
|
109227
|
-
|
|
109228
|
-
|
|
109537
|
+
for (const b of others) {
|
|
109538
|
+
const [errorB, resultB] = tryCatch$4(fn, source, b);
|
|
109539
|
+
|
|
109540
|
+
if (!errorB)
|
|
109541
|
+
return resultB;
|
|
109542
|
+
}
|
|
109229
109543
|
|
|
109230
109544
|
throw errorA;
|
|
109231
109545
|
};
|
|
109232
109546
|
|
|
109547
|
+
function checkError(error, messages) {
|
|
109548
|
+
for (const message of messages) {
|
|
109549
|
+
if (error.message.includes(message))
|
|
109550
|
+
return true;
|
|
109551
|
+
}
|
|
109552
|
+
|
|
109553
|
+
return false;
|
|
109554
|
+
}
|
|
109555
|
+
|
|
109233
109556
|
const acorn = acorn$2;
|
|
109234
109557
|
const babel = babel$1;
|
|
109235
109558
|
const espree = espree$2;
|
|
@@ -109239,6 +109562,10 @@ const hermes = hermes$1;
|
|
|
109239
109562
|
const secondChance = secondChance$1;
|
|
109240
109563
|
const isObject$3 = (a) => typeof a === 'object';
|
|
109241
109564
|
|
|
109565
|
+
const MESSAGES = [
|
|
109566
|
+
'has already been declared',
|
|
109567
|
+
];
|
|
109568
|
+
|
|
109242
109569
|
var customParser$1 = (source, parser, {isTS, isFlow, isJSX}) => {
|
|
109243
109570
|
const options = {
|
|
109244
109571
|
parser,
|
|
@@ -109247,18 +109574,30 @@ var customParser$1 = (source, parser, {isTS, isFlow, isJSX}) => {
|
|
|
109247
109574
|
isJSX,
|
|
109248
109575
|
};
|
|
109249
109576
|
|
|
109250
|
-
|
|
109577
|
+
const optionsB = {
|
|
109251
109578
|
...options,
|
|
109252
109579
|
isJSX: false,
|
|
109253
|
-
}
|
|
109580
|
+
};
|
|
109581
|
+
|
|
109582
|
+
const optionsC = {
|
|
109583
|
+
...options,
|
|
109584
|
+
isRecovery: true,
|
|
109585
|
+
};
|
|
109586
|
+
|
|
109587
|
+
return secondChance(customParse, source, MESSAGES, [
|
|
109588
|
+
options,
|
|
109589
|
+
optionsB,
|
|
109590
|
+
optionsC,
|
|
109591
|
+
]);
|
|
109254
109592
|
};
|
|
109255
109593
|
|
|
109256
|
-
function customParse(source, {parser, isTS, isFlow, isJSX}) {
|
|
109594
|
+
function customParse(source, {parser, isTS, isFlow, isJSX, isRecovery}) {
|
|
109257
109595
|
if (parser === 'babel')
|
|
109258
109596
|
return babel.parse(source, {
|
|
109259
109597
|
isTS,
|
|
109260
109598
|
isFlow,
|
|
109261
109599
|
isJSX,
|
|
109600
|
+
isRecovery,
|
|
109262
109601
|
});
|
|
109263
109602
|
|
|
109264
109603
|
if (isObject$3(parser))
|
|
@@ -109285,11 +109624,11 @@ function customParse(source, {parser, isTS, isFlow, isJSX}) {
|
|
|
109285
109624
|
return commonjsRequire(parser).parse(source);
|
|
109286
109625
|
}
|
|
109287
109626
|
|
|
109288
|
-
const {types: types$
|
|
109627
|
+
const {types: types$g} = bundle;
|
|
109289
109628
|
const {
|
|
109290
|
-
StringLiteral: StringLiteral$
|
|
109629
|
+
StringLiteral: StringLiteral$4,
|
|
109291
109630
|
ExpressionStatement,
|
|
109292
|
-
} = types$
|
|
109631
|
+
} = types$g;
|
|
109293
109632
|
|
|
109294
109633
|
const {assign: assign$7} = Object;
|
|
109295
109634
|
|
|
@@ -109304,7 +109643,7 @@ var moveOutDirectives$1 = (ast) => {
|
|
|
109304
109643
|
for (const directive of directives) {
|
|
109305
109644
|
const {leadingComments} = directive;
|
|
109306
109645
|
const {value} = directive.value;
|
|
109307
|
-
const expression = assign$7(ExpressionStatement(StringLiteral$
|
|
109646
|
+
const expression = assign$7(ExpressionStatement(StringLiteral$4(value)), {
|
|
109308
109647
|
leadingComments,
|
|
109309
109648
|
});
|
|
109310
109649
|
|
|
@@ -110067,7 +110406,7 @@ isEnabled$4.isEnabled = (name, rules) => {
|
|
|
110067
110406
|
}
|
|
110068
110407
|
|
|
110069
110408
|
for (const {rule, state} of rules) {
|
|
110070
|
-
if (RegExp(`^${rule}
|
|
110409
|
+
if (RegExp(`^${rule}/`).test(name))
|
|
110071
110410
|
return state;
|
|
110072
110411
|
}
|
|
110073
110412
|
|
|
@@ -111464,7 +111803,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
|
|
|
111464
111803
|
|
|
111465
111804
|
mergeVisitors$1.default;
|
|
111466
111805
|
|
|
111467
|
-
const {traverse: babelTraverse$1, types: types$
|
|
111806
|
+
const {traverse: babelTraverse$1, types: types$f} = bundle;
|
|
111468
111807
|
|
|
111469
111808
|
const {generate: generate$1} = parser$6;
|
|
111470
111809
|
const {merge: merge$1} = babelTraverse$1.visitors;
|
|
@@ -111483,7 +111822,7 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
|
|
|
111483
111822
|
template,
|
|
111484
111823
|
}),
|
|
111485
111824
|
generate: generate$1,
|
|
111486
|
-
types: types$
|
|
111825
|
+
types: types$f,
|
|
111487
111826
|
push,
|
|
111488
111827
|
options,
|
|
111489
111828
|
});
|
|
@@ -111669,7 +112008,7 @@ function check$5(selector) {
|
|
|
111669
112008
|
var is$2 = {};
|
|
111670
112009
|
|
|
111671
112010
|
const {template: template$8} = parser$6;
|
|
111672
|
-
const {types: types$
|
|
112011
|
+
const {types: types$e} = bundle;
|
|
111673
112012
|
const {
|
|
111674
112013
|
isBlockStatement: isBlockStatement$1,
|
|
111675
112014
|
isBooleanLiteral,
|
|
@@ -111685,7 +112024,7 @@ const {
|
|
|
111685
112024
|
isJSXIdentifier,
|
|
111686
112025
|
isJSXAttribute,
|
|
111687
112026
|
isTSTypeReference: isTSTypeReference$1,
|
|
111688
|
-
} = types$
|
|
112027
|
+
} = types$e;
|
|
111689
112028
|
|
|
111690
112029
|
const isStr$1 = (a) => typeof a === 'string';
|
|
111691
112030
|
|
|
@@ -111986,7 +112325,7 @@ is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.i
|
|
|
111986
112325
|
|
|
111987
112326
|
const jessy = jessy$1;
|
|
111988
112327
|
const nessy = nessy$1;
|
|
111989
|
-
const {traverse: traverse$7, types: types$
|
|
112328
|
+
const {traverse: traverse$7, types: types$d} = bundle;
|
|
111990
112329
|
const {template: template$7} = parser$6;
|
|
111991
112330
|
|
|
111992
112331
|
const {replaceWith: replaceWith$3, extract} = operate;
|
|
@@ -112006,9 +112345,9 @@ const {
|
|
|
112006
112345
|
isStatement: isStatement$1,
|
|
112007
112346
|
isJSXElement,
|
|
112008
112347
|
isLiteral: isLiteral$1,
|
|
112009
|
-
isTemplateLiteral,
|
|
112348
|
+
isTemplateLiteral: isTemplateLiteral$1,
|
|
112010
112349
|
TemplateElement,
|
|
112011
|
-
} = types$
|
|
112350
|
+
} = types$d;
|
|
112012
112351
|
|
|
112013
112352
|
const {extractExpression: extractExpression$1} = template$7;
|
|
112014
112353
|
|
|
@@ -112118,7 +112457,7 @@ function setValues$2({waysTo, values, path}) {
|
|
|
112118
112457
|
if (isStatement$1(values[name]))
|
|
112119
112458
|
way = way.replace(/\.expression$/, '');
|
|
112120
112459
|
|
|
112121
|
-
if (isLiteral$1(values[name]) && isTemplateLiteral(node)) {
|
|
112460
|
+
if (isLiteral$1(values[name]) && isTemplateLiteral$1(node)) {
|
|
112122
112461
|
const {value} = values[name];
|
|
112123
112462
|
|
|
112124
112463
|
const element = TemplateElement({
|
|
@@ -112187,14 +112526,14 @@ function parseValue(a) {
|
|
|
112187
112526
|
|
|
112188
112527
|
var logExports = log$4.exports;
|
|
112189
112528
|
|
|
112190
|
-
const {types: types$
|
|
112529
|
+
const {types: types$c} = bundle;
|
|
112191
112530
|
const {
|
|
112192
112531
|
isIdentifier: isIdentifier$1,
|
|
112193
112532
|
isLiteral,
|
|
112194
|
-
isStringLiteral: isStringLiteral$
|
|
112533
|
+
isStringLiteral: isStringLiteral$2,
|
|
112195
112534
|
isTemplateElement: isTemplateElement$1,
|
|
112196
112535
|
isTSTypeReference,
|
|
112197
|
-
} = types$
|
|
112536
|
+
} = types$c;
|
|
112198
112537
|
|
|
112199
112538
|
const parseName = (node) => {
|
|
112200
112539
|
node = node[0] || node;
|
|
@@ -112216,7 +112555,7 @@ const parseName = (node) => {
|
|
|
112216
112555
|
var link$1 = ({add, value, nodeValue, templateStore}) => {
|
|
112217
112556
|
const name = parseName(value);
|
|
112218
112557
|
|
|
112219
|
-
if (isStringLiteral$
|
|
112558
|
+
if (isStringLiteral$2(value) && !isStringLiteral$2(nodeValue))
|
|
112220
112559
|
return false;
|
|
112221
112560
|
|
|
112222
112561
|
if (!templateStore[name]) {
|
|
@@ -112259,13 +112598,13 @@ const {
|
|
|
112259
112598
|
isLinkedRegExp: isLinkedRegExp$1,
|
|
112260
112599
|
} = is$2;
|
|
112261
112600
|
|
|
112262
|
-
const {types: types$
|
|
112601
|
+
const {types: types$b} = bundle;
|
|
112263
112602
|
const {
|
|
112264
112603
|
isClassBody,
|
|
112265
112604
|
isBlock,
|
|
112266
112605
|
isJSXText,
|
|
112267
112606
|
isTemplateElement,
|
|
112268
|
-
} = types$
|
|
112607
|
+
} = types$b;
|
|
112269
112608
|
|
|
112270
112609
|
const isEmptyBlock = (a) => isBlock(a) && !a.body.length;
|
|
112271
112610
|
const isPrimitive = (a) => typeof a !== 'object' || a === null;
|
|
@@ -112372,7 +112711,7 @@ function compareJSXTexts(node, template) {
|
|
|
112372
112711
|
|
|
112373
112712
|
var topLevelComparators = {};
|
|
112374
112713
|
|
|
112375
|
-
const {types: types$
|
|
112714
|
+
const {types: types$a} = bundle;
|
|
112376
112715
|
const {
|
|
112377
112716
|
isEqualBody,
|
|
112378
112717
|
isEqualAnyObject,
|
|
@@ -112385,8 +112724,8 @@ const {
|
|
|
112385
112724
|
|
|
112386
112725
|
const {
|
|
112387
112726
|
isIdentifier,
|
|
112388
|
-
isStringLiteral,
|
|
112389
|
-
} = types$
|
|
112727
|
+
isStringLiteral: isStringLiteral$1,
|
|
112728
|
+
} = types$a;
|
|
112390
112729
|
|
|
112391
112730
|
const comparators = [
|
|
112392
112731
|
isEqualAnyObject,
|
|
@@ -112418,7 +112757,7 @@ function isLinkedAndIdentifier(node, templateNode) {
|
|
|
112418
112757
|
}
|
|
112419
112758
|
|
|
112420
112759
|
function isLinkedAndStringLiteral(node, templateNode) {
|
|
112421
|
-
return isStringLiteral(node) && isLinkedNode(templateNode);
|
|
112760
|
+
return isStringLiteral$1(node) && isLinkedNode(templateNode);
|
|
112422
112761
|
}
|
|
112423
112762
|
|
|
112424
112763
|
const {template: template$6} = parser$6;
|
|
@@ -112536,7 +112875,7 @@ compare$5.compareAll = (path, templateNodes, options) => {
|
|
|
112536
112875
|
};
|
|
112537
112876
|
|
|
112538
112877
|
// @babel/template creates empty array directives// extra duplicate value
|
|
112539
|
-
const ignore$
|
|
112878
|
+
const ignore$3 = [
|
|
112540
112879
|
'loc',
|
|
112541
112880
|
'start',
|
|
112542
112881
|
'end',
|
|
@@ -112568,7 +112907,7 @@ function superCompareIterate(node, template) {
|
|
|
112568
112907
|
return false;
|
|
112569
112908
|
|
|
112570
112909
|
for (const key of keys$2(template)) {
|
|
112571
|
-
if (ignore$
|
|
112910
|
+
if (ignore$3.includes(key))
|
|
112572
112911
|
continue;
|
|
112573
112912
|
|
|
112574
112913
|
const nodeValue = extractExpression(node[key]);
|
|
@@ -112641,8 +112980,8 @@ function findKey(path, parent) {
|
|
|
112641
112980
|
|
|
112642
112981
|
const wraptile = wraptile$1;
|
|
112643
112982
|
const findPath = findPath$1;
|
|
112644
|
-
const {types: types$
|
|
112645
|
-
const {isProgram: isProgram$2} = types$
|
|
112983
|
+
const {types: types$9} = bundle;
|
|
112984
|
+
const {isProgram: isProgram$2} = types$9;
|
|
112646
112985
|
const name = '__putout_runner_replace';
|
|
112647
112986
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
112648
112987
|
|
|
@@ -112707,7 +113046,7 @@ var watermarkExports = watermark$1.exports;
|
|
|
112707
113046
|
|
|
112708
113047
|
const {template: template$5, print: print$2} = parser$6;
|
|
112709
113048
|
const {remove, replaceWith: replaceWith$2} = operate;
|
|
112710
|
-
const {types: types$
|
|
113049
|
+
const {types: types$8} = bundle;
|
|
112711
113050
|
|
|
112712
113051
|
const {
|
|
112713
113052
|
compare: compare$3,
|
|
@@ -112724,7 +113063,7 @@ const {
|
|
|
112724
113063
|
isExpression,
|
|
112725
113064
|
isStatement,
|
|
112726
113065
|
isExpressionStatement,
|
|
112727
|
-
} = types$
|
|
113066
|
+
} = types$8;
|
|
112728
113067
|
|
|
112729
113068
|
const PRINT_OPTIONS = {
|
|
112730
113069
|
printer: ['putout', {
|
|
@@ -112965,11 +113304,11 @@ const {
|
|
|
112965
113304
|
setModuleType,
|
|
112966
113305
|
} = record;
|
|
112967
113306
|
|
|
112968
|
-
const {types: types$
|
|
113307
|
+
const {types: types$7} = bundle;
|
|
112969
113308
|
const {
|
|
112970
113309
|
isImportDeclaration,
|
|
112971
113310
|
isVariableDeclaration,
|
|
112972
|
-
} = types$
|
|
113311
|
+
} = types$7;
|
|
112973
113312
|
|
|
112974
113313
|
const {keys} = Object;
|
|
112975
113314
|
const isString$3 = (a) => typeof a === 'string';
|
|
@@ -113224,14 +113563,14 @@ function deinit() {
|
|
|
113224
113563
|
assign$2(maybeFS$1, defaultFS);
|
|
113225
113564
|
}
|
|
113226
113565
|
|
|
113227
|
-
const {join: join$
|
|
113566
|
+
const {join: join$2, basename: basename$1} = require$$0$2;
|
|
113228
113567
|
const tryCatch$1 = tryCatch$5;
|
|
113229
|
-
const {types: types$
|
|
113568
|
+
const {types: types$6} = bundle;
|
|
113230
113569
|
|
|
113231
113570
|
const {
|
|
113232
113571
|
setLiteralValue,
|
|
113233
113572
|
getProperty: getProperty$2,
|
|
113234
|
-
traverseProperties,
|
|
113573
|
+
traverseProperties: traverseProperties$1,
|
|
113235
113574
|
} = operate;
|
|
113236
113575
|
|
|
113237
113576
|
const maybeFS = maybeFs;
|
|
@@ -113260,10 +113599,10 @@ const fromBase64 = (content) => {
|
|
|
113260
113599
|
const {
|
|
113261
113600
|
ObjectExpression: ObjectExpression$1,
|
|
113262
113601
|
ArrayExpression: ArrayExpression$2,
|
|
113263
|
-
StringLiteral: StringLiteral$
|
|
113602
|
+
StringLiteral: StringLiteral$3,
|
|
113264
113603
|
ObjectProperty: ObjectProperty$2,
|
|
113265
113604
|
isProgram: isProgram$1,
|
|
113266
|
-
} = types$
|
|
113605
|
+
} = types$6;
|
|
113267
113606
|
|
|
113268
113607
|
const getRegExp = (wildcard) => {
|
|
113269
113608
|
const escaped = wildcard
|
|
@@ -113291,7 +113630,7 @@ function findFile$5(node, name) {
|
|
|
113291
113630
|
const filePaths = [];
|
|
113292
113631
|
const names = maybeArray$1(name);
|
|
113293
113632
|
|
|
113294
|
-
for (const filenamePath of traverseProperties(node, 'filename')) {
|
|
113633
|
+
for (const filenamePath of traverseProperties$1(node, 'filename')) {
|
|
113295
113634
|
const {value} = filenamePath.node.value;
|
|
113296
113635
|
const base = basename$1(value);
|
|
113297
113636
|
|
|
@@ -113376,7 +113715,7 @@ filesystem.moveFile = (filePath, dirPath) => {
|
|
|
113376
113715
|
.split('/')
|
|
113377
113716
|
.pop();
|
|
113378
113717
|
|
|
113379
|
-
const newFilename = join$
|
|
113718
|
+
const newFilename = join$2(dirname, basename);
|
|
113380
113719
|
|
|
113381
113720
|
maybeRemoveFile(dirPath, newFilename);
|
|
113382
113721
|
|
|
@@ -113395,7 +113734,7 @@ filesystem.copyFile = (filePath, dirPath) => {
|
|
|
113395
113734
|
.split('/')
|
|
113396
113735
|
.pop();
|
|
113397
113736
|
|
|
113398
|
-
const newFilename = join$
|
|
113737
|
+
const newFilename = join$2(dirname, basename);
|
|
113399
113738
|
const [hasContent, content] = getFileContent(filePath);
|
|
113400
113739
|
|
|
113401
113740
|
const copiedFile = ObjectExpression$1([
|
|
@@ -113421,7 +113760,8 @@ function maybeRemoveFile(dirPath, filename) {
|
|
|
113421
113760
|
}
|
|
113422
113761
|
|
|
113423
113762
|
const dirPathFiles = getProperty$2(dirPath, 'files');
|
|
113424
|
-
const
|
|
113763
|
+
const name = join$2(getFilename$4(dirPath), basename$1(filename));
|
|
113764
|
+
const [fileToOverwrite] = findFile$5(dirPathFiles, name);
|
|
113425
113765
|
|
|
113426
113766
|
if (!fileToOverwrite)
|
|
113427
113767
|
return;
|
|
@@ -113429,19 +113769,19 @@ function maybeRemoveFile(dirPath, filename) {
|
|
|
113429
113769
|
fileToOverwrite.remove();
|
|
113430
113770
|
}
|
|
113431
113771
|
|
|
113432
|
-
const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$
|
|
113772
|
+
const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$3('type'), StringLiteral$3(type));
|
|
113433
113773
|
|
|
113434
113774
|
filesystem.createTypeProperty = createTypeProperty;
|
|
113435
113775
|
|
|
113436
|
-
const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$
|
|
113776
|
+
const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$3('files'), ArrayExpression$2(files));
|
|
113437
113777
|
|
|
113438
113778
|
filesystem.createFilesProperty = createFilesProperty;
|
|
113439
113779
|
|
|
113440
|
-
const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$
|
|
113780
|
+
const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$3('filename'), StringLiteral$3(filename));
|
|
113441
113781
|
|
|
113442
113782
|
filesystem.createFilenameProperty = createFilenameProperty;
|
|
113443
113783
|
|
|
113444
|
-
const createContentProperty = (content) => ObjectProperty$2(StringLiteral$
|
|
113784
|
+
const createContentProperty = (content) => ObjectProperty$2(StringLiteral$3('content'), StringLiteral$3(content));
|
|
113445
113785
|
|
|
113446
113786
|
filesystem.createContentProperty = createContentProperty;
|
|
113447
113787
|
|
|
@@ -113450,7 +113790,7 @@ filesystem.createFile = (dirPath, name, content) => {
|
|
|
113450
113790
|
|
|
113451
113791
|
const dirPathFiles = getFiles$1(dirPath);
|
|
113452
113792
|
const parentFilename = getFilename$4(dirPath);
|
|
113453
|
-
const filename = join$
|
|
113793
|
+
const filename = join$2(parentFilename, name);
|
|
113454
113794
|
|
|
113455
113795
|
const typeProperty = createTypeProperty('file');
|
|
113456
113796
|
const filenameProperty = createFilenameProperty(filename);
|
|
@@ -113480,7 +113820,7 @@ function getFiles$1(dirPath) {
|
|
|
113480
113820
|
filesystem.createDirectory = (dirPath, name) => {
|
|
113481
113821
|
const dirPathFiles = getFiles$1(dirPath);
|
|
113482
113822
|
const parentFilename = getFilename$4(dirPath);
|
|
113483
|
-
const filename = join$
|
|
113823
|
+
const filename = join$2(parentFilename, name);
|
|
113484
113824
|
|
|
113485
113825
|
const typeProperty = createTypeProperty('directory');
|
|
113486
113826
|
const filesProperty = createFilesProperty([]);
|
|
@@ -113551,7 +113891,7 @@ filesystem.start = maybeFS.start;
|
|
|
113551
113891
|
|
|
113552
113892
|
var convertSimpleFilesystemToFilesystem = {};
|
|
113553
113893
|
|
|
113554
|
-
const {types: types$
|
|
113894
|
+
const {types: types$5} = bundle;
|
|
113555
113895
|
const {basename, dirname} = require$$0$2;
|
|
113556
113896
|
const {
|
|
113557
113897
|
createDirectory,
|
|
@@ -113565,11 +113905,13 @@ const {replaceWith: replaceWith$1, getProperty: getProperty$1} = operate;
|
|
|
113565
113905
|
|
|
113566
113906
|
const {
|
|
113567
113907
|
ObjectExpression,
|
|
113568
|
-
isArrayExpression,
|
|
113569
113908
|
ArrayExpression: ArrayExpression$1,
|
|
113570
|
-
StringLiteral: StringLiteral$
|
|
113909
|
+
StringLiteral: StringLiteral$2,
|
|
113571
113910
|
ObjectProperty: ObjectProperty$1,
|
|
113572
|
-
|
|
113911
|
+
isArrayExpression,
|
|
113912
|
+
isStringLiteral,
|
|
113913
|
+
isTemplateLiteral,
|
|
113914
|
+
} = types$5;
|
|
113573
113915
|
|
|
113574
113916
|
convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
|
|
113575
113917
|
|
|
@@ -113577,24 +113919,34 @@ const isDirectory = (a) => a.endsWith('/');
|
|
|
113577
113919
|
const getType = (a) => {
|
|
113578
113920
|
const type = isDirectory(a) ? 'directory' : 'file';
|
|
113579
113921
|
|
|
113580
|
-
return ObjectProperty$1(StringLiteral$
|
|
113922
|
+
return ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
|
|
113581
113923
|
};
|
|
113582
113924
|
|
|
113583
113925
|
const createFilename = (filename) => {
|
|
113584
|
-
return ObjectProperty$1(StringLiteral$
|
|
113926
|
+
return ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
|
|
113585
113927
|
};
|
|
113586
113928
|
|
|
113587
113929
|
const getFiles = (a) => {
|
|
113588
113930
|
if (isDirectory(a))
|
|
113589
|
-
return ObjectProperty$1(StringLiteral$
|
|
113931
|
+
return ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1([]));
|
|
113590
113932
|
|
|
113591
113933
|
return null;
|
|
113592
113934
|
};
|
|
113593
113935
|
|
|
113594
113936
|
const getContent = (a) => {
|
|
113595
|
-
return ObjectProperty$1(StringLiteral$
|
|
113937
|
+
return ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(a));
|
|
113596
113938
|
};
|
|
113597
113939
|
|
|
113940
|
+
function parseContent(node, path) {
|
|
113941
|
+
if (isStringLiteral(node))
|
|
113942
|
+
return node.value;
|
|
113943
|
+
|
|
113944
|
+
if (isTemplateLiteral(node))
|
|
113945
|
+
return btoa(node.quasis[0].value.raw);
|
|
113946
|
+
|
|
113947
|
+
throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
|
|
113948
|
+
}
|
|
113949
|
+
|
|
113598
113950
|
convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
113599
113951
|
const array = ArrayExpression$1([]);
|
|
113600
113952
|
|
|
@@ -113602,7 +113954,8 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
113602
113954
|
if (isArrayExpression(element)) {
|
|
113603
113955
|
const [nodeValue, nodeContent] = element.node.elements;
|
|
113604
113956
|
const {value} = nodeValue;
|
|
113605
|
-
|
|
113957
|
+
|
|
113958
|
+
const content = parseContent(nodeContent, element);
|
|
113606
113959
|
|
|
113607
113960
|
array.elements.push(ObjectExpression([
|
|
113608
113961
|
getType(value),
|
|
@@ -113612,13 +113965,18 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
|
|
|
113612
113965
|
continue;
|
|
113613
113966
|
}
|
|
113614
113967
|
|
|
113615
|
-
|
|
113968
|
+
if (isStringLiteral(element)) {
|
|
113969
|
+
const {value} = element.node;
|
|
113970
|
+
|
|
113971
|
+
array.elements.push(ObjectExpression([
|
|
113972
|
+
getType(value),
|
|
113973
|
+
createFilename(noTrailingSlash(value)),
|
|
113974
|
+
getFiles(value),
|
|
113975
|
+
].filter(Boolean)));
|
|
113976
|
+
continue;
|
|
113977
|
+
}
|
|
113616
113978
|
|
|
113617
|
-
array
|
|
113618
|
-
getType(value),
|
|
113619
|
-
createFilename(noTrailingSlash(value)),
|
|
113620
|
-
getFiles(value),
|
|
113621
|
-
].filter(Boolean)));
|
|
113979
|
+
throw Error(`☝️ Looks like file '${element}' has wrong type: '${element.type}' expected: 'string | array'`);
|
|
113622
113980
|
}
|
|
113623
113981
|
|
|
113624
113982
|
buildTree(path, array);
|
|
@@ -113651,7 +114009,7 @@ function buildTree(path, list) {
|
|
|
113651
114009
|
const name = basename(filename);
|
|
113652
114010
|
const [dirPath] = findFile$4(root, dir);
|
|
113653
114011
|
|
|
113654
|
-
if (!dirPath)
|
|
114012
|
+
if (!dirPath || getFileType$1(dirPath) !== 'directory')
|
|
113655
114013
|
throw Error(`☝️ Looks like directory '${dir}/' is missing`);
|
|
113656
114014
|
|
|
113657
114015
|
if (type === 'directory') {
|
|
@@ -113673,7 +114031,7 @@ function check$2(filename) {
|
|
|
113673
114031
|
|
|
113674
114032
|
var convertFilesystemToSimpleFilesystem = {};
|
|
113675
114033
|
|
|
113676
|
-
const {types: types$
|
|
114034
|
+
const {types: types$4} = bundle;
|
|
113677
114035
|
const {replaceWith, getProperty} = operate;
|
|
113678
114036
|
const {__filesystem_name: __filesystem_name$1} = json;
|
|
113679
114037
|
|
|
@@ -113684,9 +114042,9 @@ const {
|
|
|
113684
114042
|
} = filesystem;
|
|
113685
114043
|
|
|
113686
114044
|
const {
|
|
113687
|
-
StringLiteral,
|
|
114045
|
+
StringLiteral: StringLiteral$1,
|
|
113688
114046
|
ArrayExpression,
|
|
113689
|
-
} = types$
|
|
114047
|
+
} = types$4;
|
|
113690
114048
|
|
|
113691
114049
|
const {isArray: isArray$1} = Array;
|
|
113692
114050
|
const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
|
|
@@ -113720,13 +114078,13 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
|
|
|
113720
114078
|
for (const name of names) {
|
|
113721
114079
|
if (isArray$1(name)) {
|
|
113722
114080
|
list.push(ArrayExpression([
|
|
113723
|
-
StringLiteral(name[0]),
|
|
113724
|
-
StringLiteral(name[1]),
|
|
114081
|
+
StringLiteral$1(name[0]),
|
|
114082
|
+
StringLiteral$1(name[1]),
|
|
113725
114083
|
]));
|
|
113726
114084
|
continue;
|
|
113727
114085
|
}
|
|
113728
114086
|
|
|
113729
|
-
list.push(StringLiteral(name));
|
|
114087
|
+
list.push(StringLiteral$1(name));
|
|
113730
114088
|
}
|
|
113731
114089
|
|
|
113732
114090
|
replaceWith(root, ArrayExpression(list));
|
|
@@ -114925,7 +115283,7 @@ report$3.default;
|
|
|
114925
115283
|
|
|
114926
115284
|
var traverse$5 = {};
|
|
114927
115285
|
|
|
114928
|
-
const {types: types$
|
|
115286
|
+
const {types: types$3, traverse: babelTraverse} = bundle;
|
|
114929
115287
|
|
|
114930
115288
|
const {
|
|
114931
115289
|
compare,
|
|
@@ -114934,7 +115292,7 @@ const {
|
|
|
114934
115292
|
getTemplateValues,
|
|
114935
115293
|
} = compare$5;
|
|
114936
115294
|
|
|
114937
|
-
const {isFile, isProgram} = types$
|
|
115295
|
+
const {isFile, isProgram} = types$3;
|
|
114938
115296
|
const {merge} = babelTraverse.visitors;
|
|
114939
115297
|
const {entries: entries$2} = Object;
|
|
114940
115298
|
|
|
@@ -122122,7 +122480,7 @@ var addArgs = {};
|
|
|
122122
122480
|
|
|
122123
122481
|
const {compareAny} = compare$5;
|
|
122124
122482
|
const {template: template$1} = parser$6;
|
|
122125
|
-
const {types: types$
|
|
122483
|
+
const {types: types$2} = bundle;
|
|
122126
122484
|
const {
|
|
122127
122485
|
ObjectPattern,
|
|
122128
122486
|
ObjectProperty,
|
|
@@ -122131,7 +122489,7 @@ const {
|
|
|
122131
122489
|
isLabeledStatement,
|
|
122132
122490
|
isObjectPattern,
|
|
122133
122491
|
isCallExpression,
|
|
122134
|
-
} = types$
|
|
122492
|
+
} = types$2;
|
|
122135
122493
|
|
|
122136
122494
|
const {entries: entries$1} = Object;
|
|
122137
122495
|
|
|
@@ -122853,7 +123211,7 @@ factory.isPathValid = isPathValid;
|
|
|
122853
123211
|
// Fixes typescript
|
|
122854
123212
|
factory.default = factory;
|
|
122855
123213
|
|
|
122856
|
-
var ignore$
|
|
123214
|
+
var ignore$2 = factory;
|
|
122857
123215
|
|
|
122858
123216
|
// Windows
|
|
122859
123217
|
// --------------------------------------------------------------
|
|
@@ -122882,17 +123240,17 @@ if (
|
|
|
122882
123240
|
|| isNotRelative(path);
|
|
122883
123241
|
}
|
|
122884
123242
|
|
|
122885
|
-
ignore$
|
|
123243
|
+
ignore$2.default;
|
|
122886
123244
|
|
|
122887
123245
|
const {relative} = require$$0$2;
|
|
122888
|
-
const ignore = ignore$
|
|
123246
|
+
const ignore$1 = ignore$2;
|
|
122889
123247
|
|
|
122890
123248
|
const isNegative = (a) => !a.indexOf('!');
|
|
122891
123249
|
const positive = (a) => a.replace(/^!/, '');
|
|
122892
123250
|
|
|
122893
123251
|
var ignores$1 = (dirOpt, resolvedName, options = {}) => {
|
|
122894
123252
|
const relativeName = relative(dirOpt, resolvedName);
|
|
122895
|
-
const ignorer = ignore();
|
|
123253
|
+
const ignorer = ignore$1();
|
|
122896
123254
|
const ignoreList = mergeIgnores(options.ignore || []);
|
|
122897
123255
|
|
|
122898
123256
|
ignorer.add(ignoreList);
|
|
@@ -122915,6 +123273,8 @@ function mergeIgnores(ignores) {
|
|
|
122915
123273
|
|
|
122916
123274
|
ignores$1.default;
|
|
122917
123275
|
|
|
123276
|
+
const {join: join$1, extname} = require$$0$2;
|
|
123277
|
+
|
|
122918
123278
|
const {parse: parse$2, print: print$1} = parser$6;
|
|
122919
123279
|
const {transform: transform$1} = transform$5;
|
|
122920
123280
|
const {findPlaces: findPlaces$1} = findPlaces$2;
|
|
@@ -122928,6 +123288,7 @@ const {
|
|
|
122928
123288
|
writeFileContent,
|
|
122929
123289
|
getFilename: getFilename$1,
|
|
122930
123290
|
createFile,
|
|
123291
|
+
removeFile,
|
|
122931
123292
|
getParentDirectory: getParentDirectory$1,
|
|
122932
123293
|
} = filesystem;
|
|
122933
123294
|
|
|
@@ -122946,41 +123307,46 @@ matchFiles.matchFiles = (files) => {
|
|
|
122946
123307
|
};
|
|
122947
123308
|
};
|
|
122948
123309
|
|
|
122949
|
-
function fix$1(
|
|
123310
|
+
function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename, matchedJS, matchedAST, plugins}) {
|
|
122950
123311
|
transform$1(matchedAST, matchedJS, {
|
|
122951
123312
|
plugins,
|
|
122952
123313
|
});
|
|
122953
123314
|
|
|
122954
123315
|
const matchedJSON = magicPrint(outputFilename, matchedAST);
|
|
123316
|
+
const outputFile = getOutputFile(mainPath, {
|
|
123317
|
+
dirPath,
|
|
123318
|
+
matchInputFilename,
|
|
123319
|
+
outputFilename,
|
|
123320
|
+
inputFile,
|
|
123321
|
+
});
|
|
123322
|
+
|
|
123323
|
+
writeFileContent(outputFile, matchedJSON);
|
|
122955
123324
|
|
|
122956
|
-
|
|
123325
|
+
if (inputFile !== outputFile)
|
|
123326
|
+
removeFile(inputFile);
|
|
122957
123327
|
}
|
|
122958
123328
|
|
|
122959
|
-
const createScan = (files) => (
|
|
123329
|
+
const createScan = (files) => (mainPath, {push, progress, options}) => {
|
|
122960
123330
|
const allFiles = [];
|
|
122961
|
-
const cwd = getFilename$1(
|
|
123331
|
+
const cwd = getFilename$1(mainPath);
|
|
122962
123332
|
|
|
122963
123333
|
for (const [filename, plugin] of entries(files)) {
|
|
122964
123334
|
const [matchInputFilename, outputFilename = matchInputFilename] = parseMatcher(filename, options);
|
|
122965
|
-
const inputFiles = findFile$1(
|
|
123335
|
+
const inputFiles = findFile$1(mainPath, matchInputFilename);
|
|
122966
123336
|
|
|
122967
123337
|
for (const inputFile of inputFiles) {
|
|
122968
123338
|
const dirPath = getParentDirectory$1(inputFile);
|
|
122969
123339
|
const inputFilename = getFilename$1(inputFile);
|
|
122970
|
-
const outputFile = getOutputFile(path, {
|
|
122971
|
-
dirPath,
|
|
122972
|
-
matchInputFilename,
|
|
122973
|
-
outputFilename,
|
|
122974
|
-
inputFile,
|
|
122975
|
-
});
|
|
122976
123340
|
|
|
122977
123341
|
if (ignores(cwd, inputFilename, options))
|
|
122978
123342
|
continue;
|
|
122979
123343
|
|
|
122980
123344
|
allFiles.push({
|
|
123345
|
+
mainPath,
|
|
123346
|
+
dirPath,
|
|
123347
|
+
matchInputFilename,
|
|
122981
123348
|
plugin,
|
|
122982
123349
|
inputFile,
|
|
122983
|
-
outputFile,
|
|
122984
123350
|
inputFilename,
|
|
122985
123351
|
outputFilename,
|
|
122986
123352
|
});
|
|
@@ -122989,7 +123355,17 @@ const createScan = (files) => (path, {push, progress, options}) => {
|
|
|
122989
123355
|
|
|
122990
123356
|
const n = allFiles.length;
|
|
122991
123357
|
|
|
122992
|
-
for (const [i,
|
|
123358
|
+
for (const [i, current] of allFiles.entries()) {
|
|
123359
|
+
const {
|
|
123360
|
+
dirPath,
|
|
123361
|
+
matchInputFilename,
|
|
123362
|
+
inputFile,
|
|
123363
|
+
inputFilename,
|
|
123364
|
+
outputFilename,
|
|
123365
|
+
plugin,
|
|
123366
|
+
mainPath,
|
|
123367
|
+
} = current;
|
|
123368
|
+
|
|
122993
123369
|
progress({
|
|
122994
123370
|
i,
|
|
122995
123371
|
n,
|
|
@@ -123012,7 +123388,11 @@ const createScan = (files) => (path, {push, progress, options}) => {
|
|
|
123012
123388
|
|
|
123013
123389
|
const {message} = places[0];
|
|
123014
123390
|
|
|
123015
|
-
push(
|
|
123391
|
+
push(inputFile, {
|
|
123392
|
+
dirPath,
|
|
123393
|
+
mainPath,
|
|
123394
|
+
matchInputFilename,
|
|
123395
|
+
|
|
123016
123396
|
outputFilename,
|
|
123017
123397
|
message,
|
|
123018
123398
|
plugins,
|
|
@@ -123063,7 +123443,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
|
|
|
123063
123443
|
if (matchInputFilename === outputFilename)
|
|
123064
123444
|
return inputFile;
|
|
123065
123445
|
|
|
123066
|
-
const
|
|
123446
|
+
const name = join$1(getFilename$1(dirPath), outputFilename);
|
|
123447
|
+
const [outputFile] = findFile$1(dirPath, name);
|
|
123067
123448
|
|
|
123068
123449
|
if (outputFile)
|
|
123069
123450
|
return outputFile;
|
|
@@ -123072,14 +123453,16 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
|
|
|
123072
123453
|
}
|
|
123073
123454
|
|
|
123074
123455
|
function parseMatcher(matcher, options) {
|
|
123075
|
-
|
|
123076
|
-
|
|
123077
|
-
|
|
123078
|
-
|
|
123079
|
-
|
|
123080
|
-
|
|
123081
|
-
|
|
123082
|
-
|
|
123456
|
+
const {filename} = options;
|
|
123457
|
+
|
|
123458
|
+
if (!filename)
|
|
123459
|
+
return matcher.split(' -> ');
|
|
123460
|
+
|
|
123461
|
+
const ext = extname(filename);
|
|
123462
|
+
const shortName = filename.replace(ext, '');
|
|
123463
|
+
|
|
123464
|
+
matcher = matcher.replaceAll(`__name`, shortName);
|
|
123465
|
+
matcher = matcher.replaceAll(`__ext`, ext);
|
|
123083
123466
|
|
|
123084
123467
|
return matcher.split(' -> ');
|
|
123085
123468
|
}
|
|
@@ -123161,6 +123544,111 @@ function findUpPackage(file) {
|
|
|
123161
123544
|
return packageJSON;
|
|
123162
123545
|
}
|
|
123163
123546
|
|
|
123547
|
+
var ignore = {};
|
|
123548
|
+
|
|
123549
|
+
const {types: types$1} = bundle;
|
|
123550
|
+
const {traverseProperties} = operate;
|
|
123551
|
+
const {StringLiteral} = types$1;
|
|
123552
|
+
const getValue = ({value}) => value;
|
|
123553
|
+
|
|
123554
|
+
ignore.ignore = (type, {name, property, list}) => {
|
|
123555
|
+
const [, collector] = type.split(/\(|\)/);
|
|
123556
|
+
|
|
123557
|
+
return {
|
|
123558
|
+
report: createReport(name),
|
|
123559
|
+
match: createMatch({
|
|
123560
|
+
type,
|
|
123561
|
+
property,
|
|
123562
|
+
collector,
|
|
123563
|
+
list,
|
|
123564
|
+
}),
|
|
123565
|
+
replace: createReplace({
|
|
123566
|
+
type,
|
|
123567
|
+
property,
|
|
123568
|
+
collector,
|
|
123569
|
+
list,
|
|
123570
|
+
}),
|
|
123571
|
+
};
|
|
123572
|
+
};
|
|
123573
|
+
|
|
123574
|
+
const createReport = (name) => () => `Add dotfiles to '${name}'`;
|
|
123575
|
+
|
|
123576
|
+
const createMatch = ({type, property, collector, list}) => ({options}) => {
|
|
123577
|
+
const {dismiss = []} = options;
|
|
123578
|
+
const newNames = filterNames(list, dismiss);
|
|
123579
|
+
|
|
123580
|
+
return {
|
|
123581
|
+
[type]: (vars) => {
|
|
123582
|
+
const elements = parseElements(vars, {
|
|
123583
|
+
property,
|
|
123584
|
+
collector,
|
|
123585
|
+
});
|
|
123586
|
+
|
|
123587
|
+
if (!elements)
|
|
123588
|
+
return false;
|
|
123589
|
+
|
|
123590
|
+
const list = elements.map(getValue);
|
|
123591
|
+
|
|
123592
|
+
for (const name of newNames) {
|
|
123593
|
+
if (!list.includes(name))
|
|
123594
|
+
return true;
|
|
123595
|
+
}
|
|
123596
|
+
|
|
123597
|
+
return false;
|
|
123598
|
+
},
|
|
123599
|
+
};
|
|
123600
|
+
};
|
|
123601
|
+
|
|
123602
|
+
const createReplace = ({type, property, collector, list}) => ({options}) => {
|
|
123603
|
+
const {dismiss = []} = options;
|
|
123604
|
+
const newNames = filterNames(list, dismiss);
|
|
123605
|
+
|
|
123606
|
+
return {
|
|
123607
|
+
[type]: (vars, path) => {
|
|
123608
|
+
const elements = parseElements(vars, {
|
|
123609
|
+
property,
|
|
123610
|
+
collector,
|
|
123611
|
+
});
|
|
123612
|
+
|
|
123613
|
+
const list = elements.map(getValue);
|
|
123614
|
+
|
|
123615
|
+
for (const name of newNames) {
|
|
123616
|
+
if (!list.includes(name))
|
|
123617
|
+
elements.push(StringLiteral(name));
|
|
123618
|
+
}
|
|
123619
|
+
|
|
123620
|
+
return path;
|
|
123621
|
+
},
|
|
123622
|
+
};
|
|
123623
|
+
};
|
|
123624
|
+
|
|
123625
|
+
function filterNames(names, dismiss) {
|
|
123626
|
+
const newNames = [];
|
|
123627
|
+
|
|
123628
|
+
for (const name of names) {
|
|
123629
|
+
if (dismiss.includes(name))
|
|
123630
|
+
continue;
|
|
123631
|
+
|
|
123632
|
+
newNames.push(name);
|
|
123633
|
+
}
|
|
123634
|
+
|
|
123635
|
+
return newNames;
|
|
123636
|
+
}
|
|
123637
|
+
|
|
123638
|
+
function parseElements(vars, {property, collector}) {
|
|
123639
|
+
const node = vars[collector];
|
|
123640
|
+
|
|
123641
|
+
if (!property)
|
|
123642
|
+
return node.elements;
|
|
123643
|
+
|
|
123644
|
+
const [prop] = traverseProperties(node, property);
|
|
123645
|
+
|
|
123646
|
+
if (!prop)
|
|
123647
|
+
return null;
|
|
123648
|
+
|
|
123649
|
+
return prop.node.value.elements;
|
|
123650
|
+
}
|
|
123651
|
+
|
|
123164
123652
|
const {codeFrameColumns} = bundle;
|
|
123165
123653
|
|
|
123166
123654
|
var codeframe = ({source, error, highlightCode = true}) => {
|
|
@@ -123317,6 +123805,7 @@ var operator = putout.exports.operator = {
|
|
|
123317
123805
|
...filesystem,
|
|
123318
123806
|
...matchFiles,
|
|
123319
123807
|
...renameFiles,
|
|
123808
|
+
...ignore,
|
|
123320
123809
|
};
|
|
123321
123810
|
|
|
123322
123811
|
putout.exports.ignores = ignores$1;
|