@putout/bundle 3.10.0 → 3.11.0

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.js CHANGED
@@ -1,3 +1,6 @@
1
+ import 'node:process';
2
+ import require$$1$1 from 'node:module';
3
+
1
4
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
5
 
3
6
  function getDefaultExportFromCjs (x) {
@@ -2640,7 +2643,7 @@ function formatValue(ctx, value, recurseTimes) {
2640
2643
  // Check that value is an object with an inspect function on it
2641
2644
  if (ctx.customInspect &&
2642
2645
  value &&
2643
- isFunction$3(value.inspect) &&
2646
+ isFunction$4(value.inspect) &&
2644
2647
  // Filter out the util module, it's inspect function is special
2645
2648
  value.inspect !== inspect &&
2646
2649
  // Also filter out any prototype objects using the circular check.
@@ -2675,7 +2678,7 @@ function formatValue(ctx, value, recurseTimes) {
2675
2678
 
2676
2679
  // Some type of object without properties can be shortcutted.
2677
2680
  if (keys.length === 0) {
2678
- if (isFunction$3(value)) {
2681
+ if (isFunction$4(value)) {
2679
2682
  var name = value.name ? ': ' + value.name : '';
2680
2683
  return ctx.stylize('[Function' + name + ']', 'special');
2681
2684
  }
@@ -2699,7 +2702,7 @@ function formatValue(ctx, value, recurseTimes) {
2699
2702
  }
2700
2703
 
2701
2704
  // Make functions say that they are functions
2702
- if (isFunction$3(value)) {
2705
+ if (isFunction$4(value)) {
2703
2706
  var n = value.name ? ': ' + value.name : '';
2704
2707
  base = ' [Function' + n + ']';
2705
2708
  }
@@ -2921,7 +2924,7 @@ function isError(e) {
2921
2924
  (objectToString$1(e) === '[object Error]' || e instanceof Error);
2922
2925
  }
2923
2926
 
2924
- function isFunction$3(arg) {
2927
+ function isFunction$4(arg) {
2925
2928
  return typeof arg === 'function';
2926
2929
  }
2927
2930
 
@@ -3092,7 +3095,7 @@ var _polyfillNode_util = {
3092
3095
  log: log$6,
3093
3096
  isBuffer: isBuffer,
3094
3097
  isPrimitive: isPrimitive$1,
3095
- isFunction: isFunction$3,
3098
+ isFunction: isFunction$4,
3096
3099
  isError: isError,
3097
3100
  isDate: isDate,
3098
3101
  isObject: isObject$5,
@@ -3128,7 +3131,7 @@ var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({
3128
3131
  isBuffer: isBuffer,
3129
3132
  isDate: isDate,
3130
3133
  isError: isError,
3131
- isFunction: isFunction$3,
3134
+ isFunction: isFunction$4,
3132
3135
  isNull: isNull$1,
3133
3136
  isNullOrUndefined: isNullOrUndefined,
3134
3137
  isNumber: isNumber$3,
@@ -3543,10 +3546,10 @@ var __toESM = function(mod, isNodeMode, target) {
3543
3546
  // file that has been converted to a CommonJS file using a Babel-
3544
3547
  // compatible transform (i.e. "__esModule" has not been set), then set
3545
3548
  // "default" to the CommonJS "module.exports" for node compatibility.
3546
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
3549
+ __defProp(target, "default", {
3547
3550
  value: mod,
3548
3551
  enumerable: true
3549
- }) : target, mod);
3552
+ }) , mod);
3550
3553
  };
3551
3554
  var __toCommonJS = function(mod) {
3552
3555
  return __copyProps(__defProp({}, "__esModule", {
@@ -7685,7 +7688,7 @@ __export(lib_exports, {
7685
7688
  return declaredPredicate;
7686
7689
  },
7687
7690
  Decorator: function() {
7688
- return decorator;
7691
+ return decorator$1;
7689
7692
  },
7690
7693
  Directive: function() {
7691
7694
  return directive;
@@ -9593,7 +9596,7 @@ __export(lib_exports, {
9593
9596
  return declaredPredicate;
9594
9597
  },
9595
9598
  decorator: function() {
9596
- return decorator;
9599
+ return decorator$1;
9597
9600
  },
9598
9601
  directive: function() {
9599
9602
  return directive;
@@ -9791,7 +9794,7 @@ __export(lib_exports, {
9791
9794
  return isAssignmentExpression;
9792
9795
  },
9793
9796
  isAssignmentPattern: function() {
9794
- return isAssignmentPattern$1;
9797
+ return isAssignmentPattern$2;
9795
9798
  },
9796
9799
  isAwaitExpression: function() {
9797
9800
  return isAwaitExpression$1;
@@ -9836,7 +9839,7 @@ __export(lib_exports, {
9836
9839
  return isBreakStatement;
9837
9840
  },
9838
9841
  isCallExpression: function() {
9839
- return isCallExpression$3;
9842
+ return isCallExpression$4;
9840
9843
  },
9841
9844
  isCatchClause: function() {
9842
9845
  return isCatchClause;
@@ -10046,7 +10049,7 @@ __export(lib_exports, {
10046
10049
  return isForXStatement;
10047
10050
  },
10048
10051
  isFunction: function() {
10049
- return isFunction$2;
10052
+ return isFunction$3;
10050
10053
  },
10051
10054
  isFunctionDeclaration: function() {
10052
10055
  return isFunctionDeclaration$1;
@@ -10067,7 +10070,7 @@ __export(lib_exports, {
10067
10070
  return isGenericTypeAnnotation;
10068
10071
  },
10069
10072
  isIdentifier: function() {
10070
- return isIdentifier$a;
10073
+ return isIdentifier$c;
10071
10074
  },
10072
10075
  isIfStatement: function() {
10073
10076
  return isIfStatement$2;
@@ -10187,7 +10190,7 @@ __export(lib_exports, {
10187
10190
  return isLoop;
10188
10191
  },
10189
10192
  isMemberExpression: function() {
10190
- return isMemberExpression$5;
10193
+ return isMemberExpression$6;
10191
10194
  },
10192
10195
  isMetaProperty: function() {
10193
10196
  return isMetaProperty;
@@ -10244,7 +10247,7 @@ __export(lib_exports, {
10244
10247
  return isNumericLiteral;
10245
10248
  },
10246
10249
  isObjectExpression: function() {
10247
- return isObjectExpression$4;
10250
+ return isObjectExpression$5;
10248
10251
  },
10249
10252
  isObjectMember: function() {
10250
10253
  return isObjectMember;
@@ -10364,7 +10367,7 @@ __export(lib_exports, {
10364
10367
  return isSpecifierDefault;
10365
10368
  },
10366
10369
  isSpreadElement: function() {
10367
- return isSpreadElement$3;
10370
+ return isSpreadElement$4;
10368
10371
  },
10369
10372
  isSpreadProperty: function() {
10370
10373
  return isSpreadProperty;
@@ -10379,7 +10382,7 @@ __export(lib_exports, {
10379
10382
  return isStaticBlock;
10380
10383
  },
10381
10384
  isStringLiteral: function() {
10382
- return isStringLiteral$7;
10385
+ return isStringLiteral$9;
10383
10386
  },
10384
10387
  isStringLiteralTypeAnnotation: function() {
10385
10388
  return isStringLiteralTypeAnnotation;
@@ -10613,7 +10616,7 @@ __export(lib_exports, {
10613
10616
  return isTemplateElement$4;
10614
10617
  },
10615
10618
  isTemplateLiteral: function() {
10616
- return isTemplateLiteral$3;
10619
+ return isTemplateLiteral$4;
10617
10620
  },
10618
10621
  isTerminatorless: function() {
10619
10622
  return isTerminatorless;
@@ -11501,7 +11504,7 @@ __export(lib_exports, {
11501
11504
  return yieldExpression;
11502
11505
  }
11503
11506
  });
11504
- var import_to_fast_properties = __toESM(require_to_fast_properties(), 1);
11507
+ var import_to_fast_properties = __toESM(require_to_fast_properties());
11505
11508
  // node_modules/@babel/helper-validator-identifier/lib/index.js
11506
11509
  var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
11507
11510
  var nonASCIIidentifierChars = "‌‍\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
@@ -12485,38 +12488,6 @@ function isKeyword(word) {
12485
12488
  var _isDigit = function isDigit(code2) {
12486
12489
  return code2 >= 48 && code2 <= 57;
12487
12490
  };
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
12491
  function readStringContents(type, input, pos, lineStart, curLine, errors) {
12521
12492
  var initialPos = pos;
12522
12493
  var initialLineStart = lineStart;
@@ -12556,7 +12527,7 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
12556
12527
  ++curLine;
12557
12528
  lineStart = pos;
12558
12529
  } else if (ch === 10 || ch === 13) {
12559
- if (type === "template") {
12530
+ {
12560
12531
  out += input.slice(chunkStart, pos) + "\n";
12561
12532
  ++pos;
12562
12533
  if (ch === 13 && input.charCodeAt(pos) === 10) {
@@ -12564,8 +12535,6 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
12564
12535
  }
12565
12536
  ++curLine;
12566
12537
  chunkStart = lineStart = pos;
12567
- } else {
12568
- errors.unterminated(initialPos, initialLineStart, initialCurLine);
12569
12538
  }
12570
12539
  } else {
12571
12540
  ++pos;
@@ -12580,10 +12549,9 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
12580
12549
  };
12581
12550
  }
12582
12551
  function isStringEnd(type, ch, input, pos) {
12583
- if (type === "template") {
12552
+ {
12584
12553
  return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
12585
12554
  }
12586
- return ch === (type === "double" ? 34 : 39);
12587
12555
  }
12588
12556
  function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
12589
12557
  var throwOnInvalid = !inTemplate;
@@ -12636,10 +12604,8 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
12636
12604
  return res("");
12637
12605
  case 56:
12638
12606
  case 57:
12639
- if (inTemplate) {
12607
+ {
12640
12608
  return res(null);
12641
- } else {
12642
- errors.strictNumericEscape(pos - 1, lineStart, curLine);
12643
12609
  }
12644
12610
  default:
12645
12611
  if (ch >= 48 && ch <= 55) {
@@ -12654,10 +12620,8 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
12654
12620
  pos += octalStr.length - 1;
12655
12621
  var next = input.charCodeAt(pos);
12656
12622
  if (octalStr !== "0" || next === 56 || next === 57) {
12657
- if (inTemplate) {
12623
+ {
12658
12624
  return res(null);
12659
- } else {
12660
- errors.strictNumericEscape(startPos, lineStart, curLine);
12661
12625
  }
12662
12626
  }
12663
12627
  return res(String.fromCharCode(octal));
@@ -12671,9 +12635,7 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
12671
12635
  var ref;
12672
12636
  ref = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid), n2 = ref.n, pos = ref.pos;
12673
12637
  if (n2 === null) {
12674
- if (throwOnInvalid) {
12675
- errors.invalidEscapeSequence(initialPos, lineStart, curLine);
12676
- } else {
12638
+ {
12677
12639
  pos = initialPos - 1;
12678
12640
  }
12679
12641
  }
@@ -12684,31 +12646,20 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
12684
12646
  }
12685
12647
  function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
12686
12648
  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
12649
  var invalid = false;
12690
12650
  var total = 0;
12691
12651
  for(var i = 0, e = len == null ? Infinity : len; i < e; ++i){
12692
12652
  var code2 = input.charCodeAt(pos);
12693
12653
  var val = void 0;
12694
12654
  if (code2 === 95 && allowNumSeparator !== "bail") {
12695
- var prev = input.charCodeAt(pos - 1);
12696
- var next = input.charCodeAt(pos + 1);
12697
- if (!allowNumSeparator) {
12698
- if (bailOnError) return {
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 {
12655
+ input.charCodeAt(pos - 1);
12656
+ input.charCodeAt(pos + 1);
12657
+ {
12658
+ return {
12705
12659
  n: null,
12706
12660
  pos: pos
12707
12661
  };
12708
- errors.unexpectedNumericSeparator(pos, lineStart, curLine);
12709
12662
  }
12710
- ++pos;
12711
- continue;
12712
12663
  }
12713
12664
  if (code2 >= 97) {
12714
12665
  val = code2 - 97 + 10;
@@ -12757,9 +12708,7 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
12757
12708
  ref = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors), code2 = ref.code, pos = ref.pos;
12758
12709
  ++pos;
12759
12710
  if (code2 !== null && code2 > 1114111) {
12760
- if (throwOnInvalid) {
12761
- errors.invalidCodePoint(pos, lineStart, curLine);
12762
- } else {
12711
+ {
12763
12712
  return {
12764
12713
  code: null,
12765
12714
  pos: pos
@@ -12875,7 +12824,7 @@ function isBreakStatement(node, opts) {
12875
12824
  if (node.type !== "BreakStatement") return false;
12876
12825
  return opts == null || shallowEqual(node, opts);
12877
12826
  }
12878
- function isCallExpression$3(node, opts) {
12827
+ function isCallExpression$4(node, opts) {
12879
12828
  if (!node) return false;
12880
12829
  if (node.type !== "CallExpression") return false;
12881
12830
  return opts == null || shallowEqual(node, opts);
@@ -12940,7 +12889,7 @@ function isFunctionExpression$1(node, opts) {
12940
12889
  if (node.type !== "FunctionExpression") return false;
12941
12890
  return opts == null || shallowEqual(node, opts);
12942
12891
  }
12943
- function isIdentifier$a(node, opts) {
12892
+ function isIdentifier$c(node, opts) {
12944
12893
  if (!node) return false;
12945
12894
  if (node.type !== "Identifier") return false;
12946
12895
  return opts == null || shallowEqual(node, opts);
@@ -12955,7 +12904,7 @@ function isLabeledStatement$1(node, opts) {
12955
12904
  if (node.type !== "LabeledStatement") return false;
12956
12905
  return opts == null || shallowEqual(node, opts);
12957
12906
  }
12958
- function isStringLiteral$7(node, opts) {
12907
+ function isStringLiteral$9(node, opts) {
12959
12908
  if (!node) return false;
12960
12909
  if (node.type !== "StringLiteral") return false;
12961
12910
  return opts == null || shallowEqual(node, opts);
@@ -12985,7 +12934,7 @@ function isLogicalExpression(node, opts) {
12985
12934
  if (node.type !== "LogicalExpression") return false;
12986
12935
  return opts == null || shallowEqual(node, opts);
12987
12936
  }
12988
- function isMemberExpression$5(node, opts) {
12937
+ function isMemberExpression$6(node, opts) {
12989
12938
  if (!node) return false;
12990
12939
  if (node.type !== "MemberExpression") return false;
12991
12940
  return opts == null || shallowEqual(node, opts);
@@ -13000,7 +12949,7 @@ function isProgram$4(node, opts) {
13000
12949
  if (node.type !== "Program") return false;
13001
12950
  return opts == null || shallowEqual(node, opts);
13002
12951
  }
13003
- function isObjectExpression$4(node, opts) {
12952
+ function isObjectExpression$5(node, opts) {
13004
12953
  if (!node) return false;
13005
12954
  if (node.type !== "ObjectExpression") return false;
13006
12955
  return opts == null || shallowEqual(node, opts);
@@ -13090,7 +13039,7 @@ function isWithStatement(node, opts) {
13090
13039
  if (node.type !== "WithStatement") return false;
13091
13040
  return opts == null || shallowEqual(node, opts);
13092
13041
  }
13093
- function isAssignmentPattern$1(node, opts) {
13042
+ function isAssignmentPattern$2(node, opts) {
13094
13043
  if (!node) return false;
13095
13044
  if (node.type !== "AssignmentPattern") return false;
13096
13045
  return opts == null || shallowEqual(node, opts);
@@ -13185,7 +13134,7 @@ function isObjectPattern$3(node, opts) {
13185
13134
  if (node.type !== "ObjectPattern") return false;
13186
13135
  return opts == null || shallowEqual(node, opts);
13187
13136
  }
13188
- function isSpreadElement$3(node, opts) {
13137
+ function isSpreadElement$4(node, opts) {
13189
13138
  if (!node) return false;
13190
13139
  if (node.type !== "SpreadElement") return false;
13191
13140
  return opts == null || shallowEqual(node, opts);
@@ -13205,7 +13154,7 @@ function isTemplateElement$4(node, opts) {
13205
13154
  if (node.type !== "TemplateElement") return false;
13206
13155
  return opts == null || shallowEqual(node, opts);
13207
13156
  }
13208
- function isTemplateLiteral$3(node, opts) {
13157
+ function isTemplateLiteral$4(node, opts) {
13209
13158
  if (!node) return false;
13210
13159
  if (node.type !== "TemplateLiteral") return false;
13211
13160
  return opts == null || shallowEqual(node, opts);
@@ -14512,7 +14461,7 @@ function isForXStatement(node, opts) {
14512
14461
  }
14513
14462
  return opts == null || shallowEqual(node, opts);
14514
14463
  }
14515
- function isFunction$2(node, opts) {
14464
+ function isFunction$3(node, opts) {
14516
14465
  if (!node) return false;
14517
14466
  switch(node.type){
14518
14467
  case "FunctionDeclaration":
@@ -15248,11 +15197,11 @@ function isModuleDeclaration(node, opts) {
15248
15197
  return isImportOrExportDeclaration(node, opts);
15249
15198
  }
15250
15199
  function matchesPattern$1(member, match, allowPartial) {
15251
- if (!isMemberExpression$5(member)) return false;
15200
+ if (!isMemberExpression$6(member)) return false;
15252
15201
  var parts = Array.isArray(match) ? match : match.split(".");
15253
15202
  var nodes2 = [];
15254
15203
  var node;
15255
- for(node = member; isMemberExpression$5(node); node = node.object){
15204
+ for(node = member; isMemberExpression$6(node); node = node.object){
15256
15205
  nodes2.push(node.property);
15257
15206
  }
15258
15207
  nodes2.push(node);
@@ -15261,9 +15210,9 @@ function matchesPattern$1(member, match, allowPartial) {
15261
15210
  for(var i = 0, j = nodes2.length - 1; i < parts.length; i++, j--){
15262
15211
  var node2 = nodes2[j];
15263
15212
  var value1 = void 0;
15264
- if (isIdentifier$a(node2)) {
15213
+ if (isIdentifier$c(node2)) {
15265
15214
  value1 = node2.name;
15266
- } else if (isStringLiteral$7(node2)) {
15215
+ } else if (isStringLiteral$9(node2)) {
15267
15216
  value1 = node2.value;
15268
15217
  } else if (isThisExpression(node2)) {
15269
15218
  value1 = "this";
@@ -21671,7 +21620,7 @@ function importAttribute$1(key, value1) {
21671
21620
  value: value1
21672
21621
  });
21673
21622
  }
21674
- function decorator(expression2) {
21623
+ function decorator$1(expression2) {
21675
21624
  return validateNode({
21676
21625
  type: "Decorator",
21677
21626
  expression: expression2
@@ -23205,7 +23154,7 @@ function createTypeAnnotationBasedOnTypeof(type) {
23205
23154
  throw new Error("Invalid typeof value: " + type);
23206
23155
  }
23207
23156
  function getQualifiedName$1(node) {
23208
- return isIdentifier$a(node) ? node.name : "".concat(node.id.name, ".").concat(getQualifiedName$1(node.qualification));
23157
+ return isIdentifier$c(node) ? node.name : "".concat(node.id.name, ".").concat(getQualifiedName$1(node.qualification));
23209
23158
  }
23210
23159
  function removeTypeDuplicates$1(nodesIn) {
23211
23160
  var nodes2 = Array.from(nodesIn);
@@ -23307,7 +23256,7 @@ function createFlowUnionType(types2) {
23307
23256
  }
23308
23257
  }
23309
23258
  function getQualifiedName(node) {
23310
- return isIdentifier$a(node) ? node.name : "".concat(node.right.name, ".").concat(getQualifiedName(node.left));
23259
+ return isIdentifier$c(node) ? node.name : "".concat(node.right.name, ".").concat(getQualifiedName(node.left));
23311
23260
  }
23312
23261
  function removeTypeDuplicates(nodesIn) {
23313
23262
  var nodes2 = Array.from(nodesIn);
@@ -23440,7 +23389,7 @@ function cloneNodeInternal(node) {
23440
23389
  var newNode = {
23441
23390
  type: node.type
23442
23391
  };
23443
- if (isIdentifier$a(node)) {
23392
+ if (isIdentifier$c(node)) {
23444
23393
  newNode.name = node.name;
23445
23394
  if (hasOwn(node, "optional") && typeof node.optional === "boolean") {
23446
23395
  newNode.optional = node.optional;
@@ -23639,7 +23588,7 @@ function toBlock(node, parent) {
23639
23588
  blockNodes = [];
23640
23589
  } else {
23641
23590
  if (!isStatement$5(node)) {
23642
- if (isFunction$2(parent)) {
23591
+ if (isFunction$3(parent)) {
23643
23592
  node = returnStatement$1(node);
23644
23593
  } else {
23645
23594
  node = expressionStatement$1(node);
@@ -23696,7 +23645,7 @@ function toBindingIdentifierName(name) {
23696
23645
  }
23697
23646
  function toComputedKey(node) {
23698
23647
  var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : node.key || node.property;
23699
- if (!node.computed && isIdentifier$a(key)) key = stringLiteral(key.name);
23648
+ if (!node.computed && isIdentifier$c(key)) key = stringLiteral(key.name);
23700
23649
  return key;
23701
23650
  }
23702
23651
  function toExpression$1(node) {
@@ -23708,7 +23657,7 @@ function toExpression$1(node) {
23708
23657
  }
23709
23658
  if (isClass(node)) {
23710
23659
  node.type = "ClassExpression";
23711
- } else if (isFunction$2(node)) {
23660
+ } else if (isFunction$3(node)) {
23712
23661
  node.type = "FunctionExpression";
23713
23662
  }
23714
23663
  if (!isExpression$2(node)) {
@@ -23852,9 +23801,9 @@ function toKeyAlias(node) {
23852
23801
  var alias;
23853
23802
  if (node.kind === "method") {
23854
23803
  return toKeyAlias.increment() + "";
23855
- } else if (isIdentifier$a(key)) {
23804
+ } else if (isIdentifier$c(key)) {
23856
23805
  alias = key.name;
23857
- } else if (isStringLiteral$7(key)) {
23806
+ } else if (isStringLiteral$9(key)) {
23858
23807
  alias = JSON.stringify(key.value);
23859
23808
  } else {
23860
23809
  alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));
@@ -23884,7 +23833,7 @@ function toStatement$1(node, ignore) {
23884
23833
  if (isClass(node)) {
23885
23834
  mustHaveId = true;
23886
23835
  newType = "ClassDeclaration";
23887
- } else if (isFunction$2(node)) {
23836
+ } else if (isFunction$3(node)) {
23888
23837
  mustHaveId = true;
23889
23838
  newType = "FunctionDeclaration";
23890
23839
  } else if (isAssignmentExpression(node)) {
@@ -24078,7 +24027,7 @@ function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) {
24078
24027
  continue;
24079
24028
  }
24080
24029
  var keys = getBindingIdentifiers.keys[id.type];
24081
- if (isIdentifier$a(id)) {
24030
+ if (isIdentifier$c(id)) {
24082
24031
  if (duplicates) {
24083
24032
  var _ids = ids[id.name] = ids[id.name] || [];
24084
24033
  _ids.push(id);
@@ -24320,7 +24269,7 @@ function isBlockScoped(node) {
24320
24269
  }
24321
24270
  function isImmutable(node) {
24322
24271
  if (isType(node.type, "Immutable")) return true;
24323
- if (isIdentifier$a(node)) {
24272
+ if (isIdentifier$c(node)) {
24324
24273
  if (node.name === "undefined") {
24325
24274
  return true;
24326
24275
  } else {
@@ -24500,16 +24449,16 @@ function isReferenced(node, parent, grandparent) {
24500
24449
  return true;
24501
24450
  }
24502
24451
  function isScope(node, parent) {
24503
- if (isBlockStatement$4(node) && (isFunction$2(parent) || isCatchClause(parent))) {
24452
+ if (isBlockStatement$4(node) && (isFunction$3(parent) || isCatchClause(parent))) {
24504
24453
  return false;
24505
24454
  }
24506
- if (isPattern(node) && (isFunction$2(parent) || isCatchClause(parent))) {
24455
+ if (isPattern(node) && (isFunction$3(parent) || isCatchClause(parent))) {
24507
24456
  return true;
24508
24457
  }
24509
24458
  return isScopable(node);
24510
24459
  }
24511
24460
  function isSpecifierDefault(specifier) {
24512
- return isImportDefaultSpecifier$1(specifier) || isIdentifier$a(specifier.imported || specifier.exported, {
24461
+ return isImportDefaultSpecifier$1(specifier) || isIdentifier$c(specifier.imported || specifier.exported, {
24513
24462
  name: "default"
24514
24463
  });
24515
24464
  }
@@ -25483,7 +25432,7 @@ var TokContext = function TokContext(token, preserveSpace) {
25483
25432
  this.token = token;
25484
25433
  this.preserveSpace = !!preserveSpace;
25485
25434
  };
25486
- var types$s = {
25435
+ var types$u = {
25487
25436
  brace: new TokContext("{"),
25488
25437
  j_oTag: new TokContext("<tag"),
25489
25438
  j_cTag: new TokContext("</tag"),
@@ -27639,7 +27588,7 @@ var State$2 = /*#__PURE__*/ function() {
27639
27588
  __publicField(this, "lastTokEndLoc", null);
27640
27589
  __publicField(this, "lastTokStartLoc", null);
27641
27590
  __publicField(this, "context", [
27642
- types$s.brace
27591
+ types$u.brace
27643
27592
  ]);
27644
27593
  __publicField(this, "firstInvalidTemplateEscapePos", null);
27645
27594
  __publicField(this, "strictErrors", /* @__PURE__ */ new Map());
@@ -32250,7 +32199,7 @@ var flow$1 = function(superClass) {
32250
32199
  if (!jsx2.error) return jsx2.node;
32251
32200
  var context = this.state.context;
32252
32201
  var currentContext = context[context.length - 1];
32253
- if (currentContext === types$s.j_oTag || currentContext === types$s.j_expr) {
32202
+ if (currentContext === types$u.j_oTag || currentContext === types$u.j_expr) {
32254
32203
  context.pop();
32255
32204
  }
32256
32205
  }
@@ -33467,9 +33416,9 @@ var jsx$3 = function(superClass) {
33467
33416
  switch(this.state.type){
33468
33417
  case 5:
33469
33418
  node = this.startNode();
33470
- this.setContext(types$s.brace);
33419
+ this.setContext(types$u.brace);
33471
33420
  this.next();
33472
- node = this.jsxParseExpressionContainer(node, types$s.j_oTag);
33421
+ node = this.jsxParseExpressionContainer(node, types$u.j_oTag);
33473
33422
  if (node.expression.type === "JSXEmptyExpression") {
33474
33423
  this.raise(JsxErrors.AttributeIsEmpty, node);
33475
33424
  }
@@ -33494,7 +33443,7 @@ var jsx$3 = function(superClass) {
33494
33443
  value: function jsxParseSpreadChild(node) {
33495
33444
  this.next();
33496
33445
  node.expression = this.parseExpression();
33497
- this.setContext(types$s.j_expr);
33446
+ this.setContext(types$u.j_expr);
33498
33447
  this.state.canStartJSXElement = true;
33499
33448
  this.expect(8);
33500
33449
  return this.finishNode(node, "JSXSpreadChild");
@@ -33526,11 +33475,11 @@ var jsx$3 = function(superClass) {
33526
33475
  value: function jsxParseAttribute() {
33527
33476
  var node = this.startNode();
33528
33477
  if (this.match(5)) {
33529
- this.setContext(types$s.brace);
33478
+ this.setContext(types$u.brace);
33530
33479
  this.next();
33531
33480
  this.expect(21);
33532
33481
  node.argument = this.parseMaybeAssignAllowIn();
33533
- this.setContext(types$s.j_oTag);
33482
+ this.setContext(types$u.j_oTag);
33534
33483
  this.state.canStartJSXElement = true;
33535
33484
  this.expect(8);
33536
33485
  return this.finishNode(node, "JSXSpreadAttribute");
@@ -33601,12 +33550,12 @@ var jsx$3 = function(superClass) {
33601
33550
  case 5:
33602
33551
  {
33603
33552
  var node2 = this.startNode();
33604
- this.setContext(types$s.brace);
33553
+ this.setContext(types$u.brace);
33605
33554
  this.next();
33606
33555
  if (this.match(21)) {
33607
33556
  children.push(this.jsxParseSpreadChild(node2));
33608
33557
  } else {
33609
- children.push(this.jsxParseExpressionContainer(node2, types$s.j_expr));
33558
+ children.push(this.jsxParseExpressionContainer(node2, types$u.j_expr));
33610
33559
  }
33611
33560
  break;
33612
33561
  }
@@ -33683,11 +33632,11 @@ var jsx$3 = function(superClass) {
33683
33632
  key: "getTokenFromCode",
33684
33633
  value: function getTokenFromCode(code2) {
33685
33634
  var context = this.curContext();
33686
- if (context === types$s.j_expr) {
33635
+ if (context === types$u.j_expr) {
33687
33636
  this.jsxReadToken();
33688
33637
  return;
33689
33638
  }
33690
- if (context === types$s.j_oTag || context === types$s.j_cTag) {
33639
+ if (context === types$u.j_oTag || context === types$u.j_cTag) {
33691
33640
  if (isIdentifierStart2(code2)) {
33692
33641
  this.jsxReadWord();
33693
33642
  return;
@@ -33697,7 +33646,7 @@ var jsx$3 = function(superClass) {
33697
33646
  this.finishToken(143);
33698
33647
  return;
33699
33648
  }
33700
- if ((code2 === 34 || code2 === 39) && context === types$s.j_oTag) {
33649
+ if ((code2 === 34 || code2 === 39) && context === types$u.j_oTag) {
33701
33650
  this.jsxReadString(code2);
33702
33651
  return;
33703
33652
  }
@@ -33715,17 +33664,17 @@ var jsx$3 = function(superClass) {
33715
33664
  value: function updateContext(prevType) {
33716
33665
  var _this_state = this.state, context = _this_state.context, type = _this_state.type;
33717
33666
  if (type === 56 && prevType === 142) {
33718
- context.splice(-2, 2, types$s.j_cTag);
33667
+ context.splice(-2, 2, types$u.j_cTag);
33719
33668
  this.state.canStartJSXElement = false;
33720
33669
  } else if (type === 142) {
33721
- context.push(types$s.j_oTag);
33670
+ context.push(types$u.j_oTag);
33722
33671
  } else if (type === 143) {
33723
33672
  var out = context[context.length - 1];
33724
- if (out === types$s.j_oTag && prevType === 56 || out === types$s.j_cTag) {
33673
+ if (out === types$u.j_oTag && prevType === 56 || out === types$u.j_cTag) {
33725
33674
  context.pop();
33726
- this.state.canStartJSXElement = context[context.length - 1] === types$s.j_expr;
33675
+ this.state.canStartJSXElement = context[context.length - 1] === types$u.j_expr;
33727
33676
  } else {
33728
- this.setContext(types$s.j_expr);
33677
+ this.setContext(types$u.j_expr);
33729
33678
  this.state.canStartJSXElement = true;
33730
33679
  }
33731
33680
  } else {
@@ -36218,7 +36167,7 @@ var typescript$3 = function(superClass) {
36218
36167
  });
36219
36168
  if (node.params.length === 0) {
36220
36169
  this.raise(TSErrors.EmptyTypeArguments, node);
36221
- } else if (!this.state.inType && this.curContext() === types$s.brace) {
36170
+ } else if (!this.state.inType && this.curContext() === types$u.brace) {
36222
36171
  this.reScan_lt_gt();
36223
36172
  }
36224
36173
  this.expect(48);
@@ -37026,7 +36975,7 @@ var typescript$3 = function(superClass) {
37026
36975
  if (!jsx2.error) return jsx2.node;
37027
36976
  var context = this.state.context;
37028
36977
  var currentContext = context[context.length - 1];
37029
- if (currentContext === types$s.j_oTag || currentContext === types$s.j_expr) {
36978
+ if (currentContext === types$u.j_oTag || currentContext === types$u.j_expr) {
37030
36979
  context.pop();
37031
36980
  }
37032
36981
  }
@@ -42727,8 +42676,8 @@ function getParserClass(pluginsFromOptions) {
42727
42676
  return cls;
42728
42677
  }
42729
42678
  // node_modules/@babel/highlight/lib/index.js
42730
- var import_js_tokens = __toESM(require_js_tokens(), 1);
42731
- var import_picocolors = __toESM(require_picocolors(), 1);
42679
+ var import_js_tokens = __toESM(require_js_tokens());
42680
+ var import_picocolors = __toESM(require_picocolors());
42732
42681
  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
42682
  var compose = function(f, g) {
42734
42683
  return function(v) {
@@ -43026,7 +42975,7 @@ function highlight(code2) {
43026
42975
  }
43027
42976
  }
43028
42977
  // node_modules/@babel/code-frame/lib/index.js
43029
- var import_picocolors2 = __toESM(require_picocolors(), 1);
42978
+ var import_picocolors2 = __toESM(require_picocolors());
43030
42979
  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
42980
  var compose2 = function(f, g) {
43032
42981
  return function(v) {
@@ -44253,7 +44202,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
44253
44202
  var line = getLine(mappings, genLine);
44254
44203
  var index3 = getColumnIndex(line, genColumn);
44255
44204
  if (!source) {
44256
- if (skipable && skipSourceless(line, index3)) return;
44205
+ if (skipSourceless(line, index3)) return;
44257
44206
  return insert$1(line, index3, [
44258
44207
  genColumn
44259
44208
  ]);
@@ -44261,7 +44210,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
44261
44210
  var sourcesIndex = put(sources, source);
44262
44211
  var namesIndex = name ? put(names, name) : NO_NAME;
44263
44212
  if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
44264
- if (skipable && skipSource(line, index3, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
44213
+ if (skipSource(line, index3, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
44265
44214
  return;
44266
44215
  }
44267
44216
  return insert$1(line, index3, name ? [
@@ -44324,7 +44273,7 @@ function addMappingInternal(skipable, map, mapping) {
44324
44273
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
44325
44274
  }
44326
44275
  // node_modules/@babel/generator/lib/index.js
44327
- var import_jsesc = __toESM(require_jsesc(), 1);
44276
+ var import_jsesc = __toESM(require_jsesc());
44328
44277
  var SourceMap = /*#__PURE__*/ function() {
44329
44278
  function SourceMap(opts, code2) {
44330
44279
  _class_call_check(this, SourceMap);
@@ -45500,7 +45449,7 @@ function _shouldPrintDecoratorsBeforeExport(node) {
45500
45449
  }
45501
45450
  return typeof node.start === "number" && node.start === node.declaration.start;
45502
45451
  }
45503
- function Decorator(node) {
45452
+ function Decorator$1(node) {
45504
45453
  this.tokenChar(64);
45505
45454
  var expression2 = node.expression;
45506
45455
  if (shouldParenthesizeDecoratorExpression(expression2)) {
@@ -46609,7 +46558,7 @@ function NumericLiteral(node) {
46609
46558
  this.number(raw, value1);
46610
46559
  }
46611
46560
  }
46612
- function StringLiteral$4(node) {
46561
+ function StringLiteral$5(node) {
46613
46562
  var raw = this.getPossibleRaw(node);
46614
46563
  if (!this.format.minified && raw !== void 0) {
46615
46564
  this.token(raw);
@@ -48079,7 +48028,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
48079
48028
  DeclareTypeAlias: DeclareTypeAlias,
48080
48029
  DeclareVariable: DeclareVariable,
48081
48030
  DeclaredPredicate: DeclaredPredicate,
48082
- Decorator: Decorator,
48031
+ Decorator: Decorator$1,
48083
48032
  Directive: Directive$1,
48084
48033
  DirectiveLiteral: DirectiveLiteral$1,
48085
48034
  DoExpression: DoExpression,
@@ -48185,8 +48134,8 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
48185
48134
  SequenceExpression: SequenceExpression$2,
48186
48135
  SpreadElement: RestElement$1,
48187
48136
  StaticBlock: StaticBlock$1,
48188
- StringLiteral: StringLiteral$4,
48189
- StringLiteralTypeAnnotation: StringLiteral$4,
48137
+ StringLiteral: StringLiteral$5,
48138
+ StringLiteralTypeAnnotation: StringLiteral$5,
48190
48139
  StringTypeAnnotation: StringTypeAnnotation,
48191
48140
  Super: Super,
48192
48141
  SwitchCase: SwitchCase,
@@ -49189,7 +49138,7 @@ function generate$6(ast) {
49189
49138
  return printer.generate(ast);
49190
49139
  }
49191
49140
  // node_modules/@babel/traverse/lib/index.js
49192
- var import_debug = __toESM(require_src(), 1);
49141
+ var import_debug = __toESM(require_src());
49193
49142
  // node_modules/@babel/helper-split-export-declaration/lib/index.js
49194
49143
  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
49144
  function splitExportDeclaration(exportDeclaration) {
@@ -49287,7 +49236,7 @@ var visitor = {
49287
49236
  }
49288
49237
  };
49289
49238
  // node_modules/@babel/traverse/lib/index.js
49290
- var import_globals = __toESM(require_globals2(), 1);
49239
+ var import_globals = __toESM(require_globals2());
49291
49240
  // node_modules/@babel/helper-hoist-variables/lib/index.js
49292
49241
  var assignmentExpression2 = lib_exports.assignmentExpression, expressionStatement3 = lib_exports.expressionStatement, identifier4 = lib_exports.identifier;
49293
49242
  var visitor2 = {
@@ -51274,7 +51223,7 @@ var _Scope = /*#__PURE__*/ function() {
51274
51223
  } else if (isCallExpression$12(node)) {
51275
51224
  return matchesPattern$1$1(node.callee, "Symbol.for") && !this.hasBinding("Symbol", {
51276
51225
  noGlobals: true
51277
- }) && node.arguments.length === 1 && isStringLiteral$7(node.arguments[0]);
51226
+ }) && node.arguments.length === 1 && isStringLiteral$9(node.arguments[0]);
51278
51227
  } else {
51279
51228
  return isPureish2(node);
51280
51229
  }
@@ -56317,7 +56266,7 @@ var main = {};
56317
56266
 
56318
56267
  var fork = {exports: {}};
56319
56268
 
56320
- var types$r = {exports: {}};
56269
+ var types$t = {exports: {}};
56321
56270
 
56322
56271
  var shared = {};
56323
56272
 
@@ -56417,12 +56366,12 @@ function requireShared () {
56417
56366
  return shared;
56418
56367
  }
56419
56368
 
56420
- types$r.exports;
56369
+ types$t.exports;
56421
56370
 
56422
56371
  var hasRequiredTypes;
56423
56372
 
56424
56373
  function requireTypes () {
56425
- if (hasRequiredTypes) return types$r.exports;
56374
+ if (hasRequiredTypes) return types$t.exports;
56426
56375
  hasRequiredTypes = 1;
56427
56376
  (function (module, exports) {
56428
56377
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -57214,8 +57163,8 @@ function requireTypes () {
57214
57163
  exports.default = typesPlugin;
57215
57164
  (0, shared_1.maybeSetModuleExports)(function () { return module; });
57216
57165
 
57217
- } (types$r, types$r.exports));
57218
- return types$r.exports;
57166
+ } (types$t, types$t.exports));
57167
+ return types$t.exports;
57219
57168
  }
57220
57169
 
57221
57170
  var pathVisitor = {exports: {}};
@@ -76557,9 +76506,9 @@ var fullstore$3 = (value) => {
76557
76506
  };
76558
76507
  };
76559
76508
 
76560
- var types$q = {};
76509
+ var types$s = {};
76561
76510
 
76562
- types$q.TYPES = {
76511
+ types$s.TYPES = {
76563
76512
  TOKEN: 'Token',
76564
76513
  NEWLINE: 'Newline',
76565
76514
  LINEBREAK: 'Linebreak',
@@ -76579,16 +76528,19 @@ var arrowFunctionExpression = {};
76579
76528
 
76580
76529
  var is$3 = {};
76581
76530
 
76531
+ const {types: types$r} = bundle;
76582
76532
  const {
76583
- isStringLiteral: isStringLiteral$6,
76584
- isIdentifier: isIdentifier$9,
76533
+ isStringLiteral: isStringLiteral$8,
76534
+ isSpreadElement: isSpreadElement$3,
76535
+ isIdentifier: isIdentifier$b,
76585
76536
  isIfStatement: isIfStatement$1,
76586
76537
  isStatement: isStatement$4,
76587
76538
  isForOfStatement,
76588
76539
  isVariableDeclaration: isVariableDeclaration$1,
76589
- isMemberExpression: isMemberExpression$4,
76540
+ isMemberExpression: isMemberExpression$5,
76590
76541
  isArrayExpression: isArrayExpression$4,
76591
- } = bundle.types;
76542
+ isObjectExpression: isObjectExpression$4,
76543
+ } = types$r;
76592
76544
 
76593
76545
  const isParentProgram$1 = (path) => path.parentPath?.isProgram();
76594
76546
  const isParentBlock$3 = (path) => path.parentPath.isBlockStatement();
@@ -76610,6 +76562,9 @@ const isPrev$1 = (path) => {
76610
76562
  const isNextParent$5 = (path) => isNext$r(path.parentPath);
76611
76563
  const isLast$d = (path) => isParentProgram$1(path) && !isNext$r(path);
76612
76564
 
76565
+ is$3.isNextObject = (a) => a.getNextSibling().isObjectExpression();
76566
+ is$3.isPrevObject = (a) => a.getPrevSibling().isObjectExpression();
76567
+
76613
76568
  is$3.isFirst = (path) => path.node === path.parentPath.node.body?.[0];
76614
76569
  is$3.isPrevBody = (path) => path.getPrevSibling().isBlockStatement();
76615
76570
  is$3.isNext = isNext$r;
@@ -76624,9 +76579,10 @@ is$3.isIndented = (path = {}) => {
76624
76579
  const {parentPath, node} = path;
76625
76580
  return node.loc?.start.column !== parentPath.node.loc.start.column;
76626
76581
  };
76627
- is$3.isCoupleLines = isCoupleLines$a;
76628
76582
 
76629
- function isCoupleLines$a(path) {
76583
+ is$3.isCoupleLines = isCoupleLines$b;
76584
+
76585
+ function isCoupleLines$b(path) {
76630
76586
  const start = path.node?.loc?.start?.line;
76631
76587
  const end = path.node?.loc?.end?.line;
76632
76588
 
@@ -76636,16 +76592,27 @@ function isCoupleLines$a(path) {
76636
76592
  is$3.exists = (a) => a.node;
76637
76593
  is$3.isStringAndIdentifier = isStringAndIdentifier$2;
76638
76594
  function isStringAndIdentifier$2([a, b]) {
76639
- return isStringLiteral$6(a) && isIdentifier$9(b);
76595
+ return isStringLiteral$8(a) && isIdentifier$b(b);
76640
76596
  }
76641
76597
 
76598
+ is$3.isSimpleAndEmptyObject = ([a, b]) => {
76599
+ if (!isIdentifier$b(a) && !isSpreadElement$3(a) && !isArrayExpression$4(a))
76600
+ return false;
76601
+
76602
+ if (!isObjectExpression$4(b))
76603
+ return false;
76604
+
76605
+ return b.node.properties.length;
76606
+ };
76607
+
76642
76608
  is$3.isIdentifierAndIdentifier = ([a, b]) => {
76643
- return isIdentifier$9(a) && isIdentifier$9(b);
76609
+ return isIdentifier$b(a) && isIdentifier$b(b);
76644
76610
  };
76645
- is$3.isStringAndMember = ([a, b]) => isStringLiteral$6(a) && isMemberExpression$4(b);
76646
- is$3.isIdentifierAndString = ([a, b]) => isIdentifier$9(a) && isStringLiteral$6(b);
76611
+
76612
+ is$3.isStringAndMember = ([a, b]) => isStringLiteral$8(a) && isMemberExpression$5(b);
76613
+ is$3.isIdentifierAndString = ([a, b]) => isIdentifier$b(a) && isStringLiteral$8(b);
76647
76614
  is$3.isStringAndArray = ([a, b]) => {
76648
- if (!isStringLiteral$6(a))
76615
+ if (!isStringLiteral$8(a))
76649
76616
  return false;
76650
76617
 
76651
76618
  if (!isArrayExpression$4(b))
@@ -76689,7 +76656,18 @@ is$3.satisfy = (conditions) => (path) => {
76689
76656
  return false;
76690
76657
  };
76691
76658
 
76692
- is$3.hasTrailingComment = (path) => path.node?.trailingComments?.length;
76659
+ const parseNode$2 = (path) => path.node || path;
76660
+
76661
+ is$3.hasCoupleTrailingComments = (path) => {
76662
+ const node = parseNode$2(path);
76663
+ return node?.trailingComments?.length > 1;
76664
+ };
76665
+
76666
+ is$3.hasTrailingComment = (path) => {
76667
+ const node = parseNode$2(path);
76668
+ return node.trailingComments?.length;
76669
+ };
76670
+
76693
76671
  is$3.hasLeadingComment = (path) => path.node?.leadingComments?.length;
76694
76672
 
76695
76673
  is$3.noTrailingComment = (path) => !path.node.trailingComments?.length;
@@ -76741,7 +76719,7 @@ maybeInsideFn$1.maybeInsideFn = (insideFn, {print, indent}) => {
76741
76719
  indent.dec();
76742
76720
  };
76743
76721
 
76744
- const {types: types$p} = bundle;
76722
+ const {types: types$q} = bundle;
76745
76723
  const {
76746
76724
  hasTrailingComment: hasTrailingComment$3,
76747
76725
  satisfy: satisfy$4,
@@ -76757,7 +76735,7 @@ const {
76757
76735
  isClassProperty,
76758
76736
  isTSPropertySignature,
76759
76737
  isSpreadElement: isSpreadElement$2,
76760
- } = types$p;
76738
+ } = types$q;
76761
76739
 
76762
76740
  const isProperty = satisfy$4([
76763
76741
  isObjectProperty$1,
@@ -76767,6 +76745,8 @@ const isProperty = satisfy$4([
76767
76745
  isSpreadElement$2,
76768
76746
  ]);
76769
76747
 
76748
+ const hasDecorators = ({parentPath}) => parentPath.node.decorators?.length;
76749
+
76770
76750
  function isCommentOfPrevious(path) {
76771
76751
  const [comment] = path.node.leadingComments;
76772
76752
  const {line} = comment.loc.start;
@@ -76803,6 +76783,9 @@ parseLeadingComments$4.parseLeadingComments = (path, {print, maybe, indent}, sem
76803
76783
  if (!leadingComments?.length)
76804
76784
  return;
76805
76785
 
76786
+ if (hasDecorators(path))
76787
+ return;
76788
+
76806
76789
  const looksLikeSwitchCase = path.isSwitchCase();
76807
76790
 
76808
76791
  if (!looksLikeSwitchCase && hasTrailingComment$3(path.getPrevSibling()))
@@ -76862,16 +76845,16 @@ var parseTrailingComments$2 = {};
76862
76845
 
76863
76846
  const {
76864
76847
  isDecorator,
76865
- isMemberExpression: isMemberExpression$3,
76848
+ isMemberExpression: isMemberExpression$4,
76866
76849
  } = bundle.types;
76867
76850
 
76868
76851
  const {
76869
76852
  isLast: isLast$c,
76870
- isCoupleLines: isCoupleLines$9,
76853
+ isCoupleLines: isCoupleLines$a,
76871
76854
  isNext: isNext$q,
76872
76855
  } = is$3;
76873
76856
 
76874
- const hasBody = (path) => path.node.body;
76857
+ const hasBody$1 = (path) => path.node.body;
76875
76858
 
76876
76859
  const isFnParam = (path) => {
76877
76860
  const {parentPath} = path;
@@ -76893,7 +76876,7 @@ const isTrailingIsLeading = (path) => path.node.trailingComments === path.getNex
76893
76876
  const isNewlineAfter = (path) => {
76894
76877
  const {parentPath} = path;
76895
76878
 
76896
- if (isMemberExpression$3(parentPath))
76879
+ if (isMemberExpression$4(parentPath))
76897
76880
  return false;
76898
76881
 
76899
76882
  return !isLast$c(path) && !isDecorator(path);
@@ -76914,7 +76897,7 @@ function isCommentOnNextLine(path) {
76914
76897
  if (isTrailingIsLeading(path))
76915
76898
  return false;
76916
76899
 
76917
- if (trailingComments.length > 1)
76900
+ if (path.isThrowStatement())
76918
76901
  return false;
76919
76902
 
76920
76903
  const [comment] = trailingComments;
@@ -76922,10 +76905,13 @@ function isCommentOnNextLine(path) {
76922
76905
 
76923
76906
  const next = path.getNextSibling();
76924
76907
 
76925
- if (line < next.node?.loc.start.line)
76908
+ if (next.node && line < next.node.loc.start.line)
76926
76909
  return false;
76927
76910
 
76928
- return line === loc.start.line + 1;
76911
+ const isNextLine = line === loc.start.line + 1;
76912
+ const isNextLineAfterNewline = line === loc.start.line + 2;
76913
+
76914
+ return isNextLine || isNextLineAfterNewline;
76929
76915
  }
76930
76916
 
76931
76917
  parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics) => {
@@ -76951,7 +76937,7 @@ parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics
76951
76937
  maybe.write.space(sameLine);
76952
76938
  maybe.indent(!sameLine && !commentOnNextLine);
76953
76939
 
76954
- if (hasBody(path)) {
76940
+ if (hasBody$1(path)) {
76955
76941
  maybe.write.breakline(!isNext$q(path));
76956
76942
  maybe.write.breakline(!n);
76957
76943
  }
@@ -76966,7 +76952,7 @@ parseTrailingComments$2.parseTrailingComments = (path, {write, maybe}, semantics
76966
76952
  maybe.write.space(sameLine);
76967
76953
  maybe.indent(!sameLine);
76968
76954
  write(`/*${value}*/`);
76969
- maybe.write.newline(!sameLine || !isFnParam(path) && isCoupleLines$9(path.parentPath));
76955
+ maybe.write.newline(!sameLine || !isFnParam(path) && isCoupleLines$a(path.parentPath));
76970
76956
  }
76971
76957
  }
76972
76958
  };
@@ -77635,15 +77621,17 @@ maybeDeclare$6.maybeDeclare = (visit) => (path, printer, semantics) => {
77635
77621
  visit(path, printer, semantics);
77636
77622
  };
77637
77623
 
77624
+ const {isFunction: isFunction$2} = bundle.types;
77638
77625
  const {isNext: isNext$l} = is$3;
77639
77626
  const {markAfter: markAfter$8} = mark;
77640
77627
 
77641
- //const {maybeDecorators} = require('../../maybe-get');
77642
77628
  const {maybeDeclare: maybeDeclare$5} = maybeDeclare$6;
77643
77629
  const {parseComments: parseComments$4} = comment;
77644
77630
  const {maybeDecorators: maybeDecorators$2} = maybeDecorators$4;
77645
77631
 
77646
77632
  const isInsideExport = ({parentPath}) => parentPath.isExportDeclaration();
77633
+ const isFunctionLike = (path) => isFunction$2(path.parentPath.parentPath);
77634
+ const hasBody = ({node}) => node.body.body.length;
77647
77635
 
77648
77636
  const classVisitor = maybeDecorators$2((path, printer, semantics) => {
77649
77637
  const {id, abstract} = path.node;
@@ -77705,6 +77693,9 @@ _class.ClassDeclaration = {
77705
77693
  classVisitor(path, printer, semantics);
77706
77694
  }),
77707
77695
  afterIf(path) {
77696
+ if (isFunctionLike(path))
77697
+ return true;
77698
+
77708
77699
  if (!isNext$l(path))
77709
77700
  return false;
77710
77701
 
@@ -77713,7 +77704,7 @@ _class.ClassDeclaration = {
77713
77704
  after(path, {write}) {
77714
77705
  write.newline();
77715
77706
 
77716
- if (path.node.body.body.length) {
77707
+ if (!isFunctionLike(path) && hasBody(path)) {
77717
77708
  write.newline();
77718
77709
  markAfter$8(path);
77719
77710
  }
@@ -77853,7 +77844,7 @@ newExpression.NewExpression = {
77853
77844
  var objectExpression = {};
77854
77845
 
77855
77846
  const {
77856
- isCoupleLines: isCoupleLines$8,
77847
+ isCoupleLines: isCoupleLines$9,
77857
77848
  isForOf: isForOf$3,
77858
77849
  isIf,
77859
77850
  noTrailingComment: noTrailingComment$3,
@@ -77865,6 +77856,7 @@ const {
77865
77856
 
77866
77857
  const {parseComments: parseComments$3} = comment;
77867
77858
  const {likeChain} = memberExpressions$1;
77859
+ const {isStringLiteral: isStringLiteral$7} = bundle.types;
77868
77860
 
77869
77861
  const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
77870
77862
  const isLogical = (path) => path.get('argument').isLogicalExpression();
@@ -77883,6 +77875,25 @@ const isMemberExpressionCallee = ({parentPath}) => {
77883
77875
  return likeChain(callee);
77884
77876
  };
77885
77877
 
77878
+ const isInsideCall = ({parentPath}) => parentPath.isCallExpression();
77879
+
77880
+ function isInsideNestedArrayCall({parentPath}) {
77881
+ if (!parentPath.isArrayExpression())
77882
+ return false;
77883
+
77884
+ if (!parentPath.parentPath.isArrayExpression())
77885
+ return false;
77886
+
77887
+ return isInsideCall(parentPath.parentPath);
77888
+ }
77889
+
77890
+ function isInsideNestedTuple({parentPath}) {
77891
+ const {elements} = parentPath.parentPath.node;
77892
+ const [first] = elements;
77893
+
77894
+ return isStringLiteral$7(first);
77895
+ }
77896
+
77886
77897
  objectExpression.ObjectExpression = (path, printer, semantics) => {
77887
77898
  const {trailingComma} = semantics;
77888
77899
  const {
@@ -77891,7 +77902,9 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
77891
77902
  indent,
77892
77903
  } = printer;
77893
77904
 
77894
- indent.inc();
77905
+ const insideNestedArrayCall = isInsideNestedArrayCall(path);
77906
+
77907
+ maybe.indent.inc(!insideNestedArrayCall);
77895
77908
 
77896
77909
  const properties = path.get('properties');
77897
77910
  const {length} = properties;
@@ -77905,7 +77918,8 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
77905
77918
 
77906
77919
  const n = properties.length - 1;
77907
77920
 
77908
- maybe.indent.inc(isMemberExpressionCallee(path));
77921
+ const memberCallee = isMemberExpressionCallee(path);
77922
+ maybe.indent.inc(memberCallee);
77909
77923
 
77910
77924
  for (const [index, property] of properties.entries()) {
77911
77925
  if (property.isSpreadElement()) {
@@ -77925,13 +77939,10 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
77925
77939
  }
77926
77940
 
77927
77941
  maybe.indent(manyLines && noLeadingComment(property));
77942
+ print(property);
77928
77943
 
77929
- if (property.isObjectMethod()) {
77930
- print(property);
77944
+ if (property.isObjectMethod())
77931
77945
  continue;
77932
- }
77933
-
77934
- print(property);
77935
77946
 
77936
77947
  if (noTrailingComment$3(property) && !hasNextLeadingComment(property)) {
77937
77948
  maybe.print.newline(manyLines);
@@ -77939,12 +77950,19 @@ objectExpression.ObjectExpression = (path, printer, semantics) => {
77939
77950
  }
77940
77951
  }
77941
77952
 
77942
- indent.dec();
77943
- maybe.indent(manyLines);
77953
+ if (!insideNestedArrayCall) {
77954
+ indent.dec();
77955
+ maybe.indent(manyLines);
77956
+ } else if (isInsideNestedTuple(path)) {
77957
+ indent.dec();
77958
+ indent();
77959
+ indent.inc();
77960
+ }
77961
+
77944
77962
  print('}');
77945
77963
  maybe.print(parens, ')');
77946
77964
 
77947
- maybe.indent.dec(isMemberExpressionCallee(path));
77965
+ maybe.indent.dec(memberCallee);
77948
77966
  };
77949
77967
 
77950
77968
  const hasNextLeadingComment = (path) => {
@@ -77962,7 +77980,7 @@ const notLastArgInsideCall = (path) => {
77962
77980
  if (!parentPath.isCallExpression())
77963
77981
  return false;
77964
77982
 
77965
- if (isCoupleLines$8(path))
77983
+ if (isCoupleLines$9(path))
77966
77984
  return false;
77967
77985
 
77968
77986
  return path !== parentPath
@@ -77978,7 +77996,7 @@ function isOneLine$1(path) {
77978
77996
  const {length} = path.get('properties');
77979
77997
 
77980
77998
  if (!length)
77981
- return true;
77999
+ return ONE_LINE$2;
77982
78000
 
77983
78001
  if (notLastArgInsideCall(path))
77984
78002
  return ONE_LINE$2;
@@ -77989,7 +78007,7 @@ function isOneLine$1(path) {
77989
78007
  if (isIf(path))
77990
78008
  return ONE_LINE$2;
77991
78009
 
77992
- if (isCoupleLines$8(path))
78010
+ if (isCoupleLines$9(path))
77993
78011
  return MANY_LINES;
77994
78012
 
77995
78013
  return !isValue(path);
@@ -78007,16 +78025,16 @@ var objectProperty = {};
78007
78025
  var concatanate$1 = {};
78008
78026
 
78009
78027
  const {
78010
- isStringLiteral: isStringLiteral$5,
78011
- isTemplateLiteral: isTemplateLiteral$2,
78028
+ isStringLiteral: isStringLiteral$6,
78029
+ isTemplateLiteral: isTemplateLiteral$3,
78012
78030
  isBinaryExpression,
78013
78031
  } = bundle.types;
78014
78032
 
78015
78033
  const isStringLike = (a) => {
78016
- if (isStringLiteral$5(a))
78034
+ if (isStringLiteral$6(a))
78017
78035
  return true;
78018
78036
 
78019
- return isTemplateLiteral$2(a);
78037
+ return isTemplateLiteral$3(a);
78020
78038
  };
78021
78039
 
78022
78040
  concatanate$1.isConcatenation = (path) => {
@@ -78095,9 +78113,9 @@ wrongShortand.wrongShorthand = ({computed, isAssign, keyPath, valuePath}) => {
78095
78113
  return !computed && !isAssign && keyPath.node.name !== valuePath.node.name;
78096
78114
  };
78097
78115
 
78098
- var maxPropertiesInOneLine = {};
78116
+ var moreThenMaxPropertiesInOneLine$1 = {};
78099
78117
 
78100
- maxPropertiesInOneLine.checkMaxPropertiesInOneLine = (path, {maxPropertiesInOneLine}) => {
78118
+ moreThenMaxPropertiesInOneLine$1.moreThenMaxPropertiesInOneLine = (path, {maxPropertiesInOneLine}) => {
78101
78119
  const {parentPath} = path;
78102
78120
 
78103
78121
  if (parentPath.isObjectProperty())
@@ -78129,8 +78147,43 @@ function maybePrintTypeAnnotation$3(path, printer) {
78129
78147
  }
78130
78148
  }
78131
78149
 
78150
+ var moreThenMaxPropertiesLengthInOneLine$1 = {};
78151
+
78132
78152
  const {
78133
- isIdentifier: isIdentifier$8,
78153
+ isAssignmentPattern: isAssignmentPattern$1,
78154
+ isIdentifier: isIdentifier$a,
78155
+ } = bundle.types;
78156
+
78157
+ moreThenMaxPropertiesLengthInOneLine$1.moreThenMaxPropertiesLengthInOneLine = (path, {maxPropertiesLengthInOneLine}) => {
78158
+ const {properties} = path.node;
78159
+
78160
+ for (const {key, value} of properties) {
78161
+ if (isAssignmentPattern$1(value)) {
78162
+ const {left, right} = value;
78163
+
78164
+ if (!isIdentifier$a(left) || !isIdentifier$a(right))
78165
+ continue;
78166
+
78167
+ const length = left.name.length + right.name.length;
78168
+
78169
+ if (length >= maxPropertiesLengthInOneLine)
78170
+ return true;
78171
+ }
78172
+
78173
+ if (!isIdentifier$a(key))
78174
+ continue;
78175
+
78176
+ const {name} = key;
78177
+
78178
+ if (name.length >= maxPropertiesLengthInOneLine)
78179
+ return true;
78180
+ }
78181
+
78182
+ return false;
78183
+ };
78184
+
78185
+ const {
78186
+ isIdentifier: isIdentifier$9,
78134
78187
  isObjectPattern: isObjectPattern$2,
78135
78188
  isAssignmentPattern,
78136
78189
  } = bundle.types;
@@ -78139,22 +78192,41 @@ const {wrongShorthand} = wrongShortand;
78139
78192
 
78140
78193
  const {
78141
78194
  isForOf: isForOf$2,
78142
- isCoupleLines: isCoupleLines$7,
78195
+ isCoupleLines: isCoupleLines$8,
78143
78196
  exists: exists$9,
78144
78197
  } = is$3;
78145
78198
 
78146
- const {checkMaxPropertiesInOneLine} = maxPropertiesInOneLine;
78199
+ const {moreThenMaxPropertiesInOneLine} = moreThenMaxPropertiesInOneLine$1;
78200
+
78147
78201
  const {maybeTypeAnnotation: maybeTypeAnnotation$3} = maybeTypeAnnotation$4;
78202
+ const {moreThenMaxPropertiesLengthInOneLine} = moreThenMaxPropertiesLengthInOneLine$1;
78148
78203
 
78149
78204
  const isTwoLevelsDeep = ({parentPath}) => parentPath.parentPath.parentPath.isObjectProperty();
78150
-
78151
78205
  const isOneParentProperty = ({parentPath}) => parentPath.parentPath.node.properties?.length === 1;
78152
78206
 
78207
+ function isIndent(path) {
78208
+ return !path.parentPath.isArrayPattern();
78209
+ }
78210
+
78211
+ const isCoupleProperties = ({path, valuePath, property}) => {
78212
+ if (!isCoupleLines$8(valuePath))
78213
+ return false;
78214
+
78215
+ if (exists$9(property.getPrevSibling()))
78216
+ return false;
78217
+
78218
+ return !path.parentPath.isObjectProperty();
78219
+ };
78220
+
78153
78221
  objectPattern.ObjectPattern = {
78154
- print: maybeTypeAnnotation$3((path, {indent, print, maybe}, semantics) => {
78155
- const {maxPropertiesInOneLine} = semantics;
78222
+ print: maybeTypeAnnotation$3((path, {print, maybe, indent}, semantics) => {
78223
+ const shouldIndent = isIndent(path);
78224
+ const {
78225
+ maxPropertiesInOneLine,
78226
+ maxPropertiesLengthInOneLine,
78227
+ } = semantics;
78156
78228
 
78157
- indent.inc();
78229
+ maybe.indent.inc(shouldIndent);
78158
78230
  print('{');
78159
78231
 
78160
78232
  const properties = path.get('properties');
@@ -78162,6 +78234,7 @@ objectPattern.ObjectPattern = {
78162
78234
 
78163
78235
  const is = shouldAddNewline(path, {
78164
78236
  maxPropertiesInOneLine,
78237
+ maxPropertiesLengthInOneLine,
78165
78238
  });
78166
78239
 
78167
78240
  const hasObject = n && hasObjectPattern(properties);
@@ -78183,7 +78256,11 @@ objectPattern.ObjectPattern = {
78183
78256
  const isAssign = valuePath.isAssignmentPattern();
78184
78257
 
78185
78258
  const {shorthand, computed} = property.node;
78186
- const couple = isCoupleLines$7(valuePath) && !exists$9(property.getPrevSibling()) && !path.parentPath.isObjectProperty();
78259
+ const couple = isCoupleProperties({
78260
+ path,
78261
+ property,
78262
+ valuePath,
78263
+ });
78187
78264
 
78188
78265
  maybe.indent(is);
78189
78266
  maybe.print.breakline(couple);
@@ -78203,7 +78280,7 @@ objectPattern.ObjectPattern = {
78203
78280
  maybe.print.newline(couple);
78204
78281
  }
78205
78282
 
78206
- if (is || hasObject) {
78283
+ if (is || hasObject && !isAssign) {
78207
78284
  print(',');
78208
78285
  print.newline();
78209
78286
 
@@ -78218,6 +78295,7 @@ objectPattern.ObjectPattern = {
78218
78295
 
78219
78296
  indent.dec();
78220
78297
  maybe.indent(is);
78298
+ maybe.indent.inc(!shouldIndent);
78221
78299
  print('}');
78222
78300
  }),
78223
78301
  afterIf(path) {
@@ -78238,7 +78316,7 @@ function checkLength(properties) {
78238
78316
  for (const prop of properties) {
78239
78317
  const {value} = prop.node;
78240
78318
 
78241
- if (!isIdentifier$8(value))
78319
+ if (!isIdentifier$9(value))
78242
78320
  continue;
78243
78321
 
78244
78322
  if (value.name.length > 4)
@@ -78271,23 +78349,48 @@ function hasObjectPattern(properties) {
78271
78349
  const ONE_LINE$1 = false;
78272
78350
  const COUPLE_LINES = true;
78273
78351
 
78274
- function shouldAddNewline(path, {maxPropertiesInOneLine}) {
78352
+ function shouldAddNewline(path, semantics) {
78275
78353
  const {parentPath} = path;
78276
78354
  const properties = path.get('properties');
78277
78355
  const n = properties.length - 1;
78278
78356
 
78279
- if (checkMaxPropertiesInOneLine(path, {maxPropertiesInOneLine}))
78357
+ const {
78358
+ maxPropertiesInOneLine,
78359
+ maxPropertiesLengthInOneLine,
78360
+ } = semantics;
78361
+
78362
+ const moreLength = moreThenMaxPropertiesLengthInOneLine(path, {
78363
+ maxPropertiesLengthInOneLine,
78364
+ });
78365
+
78366
+ const moreCount = moreThenMaxPropertiesInOneLine(path, {
78367
+ maxPropertiesInOneLine,
78368
+ });
78369
+
78370
+ const fnParam = isFunctionParam(path);
78371
+
78372
+ if (moreCount && !moreLength)
78280
78373
  return ONE_LINE$1;
78281
78374
 
78282
- if (!isForOf$2(path) && !path.parentPath.isFunction() && n && checkLength(properties))
78375
+ if (!fnParam && n && !isForOf$2(path) && checkLength(properties))
78283
78376
  return COUPLE_LINES;
78284
78377
 
78285
- if (hasAssign(properties))
78378
+ if (!fnParam && hasAssign(properties))
78286
78379
  return COUPLE_LINES;
78287
78380
 
78288
78381
  return parentPath.isObjectProperty();
78289
78382
  }
78290
78383
 
78384
+ function isFunctionParam({parentPath}) {
78385
+ if (parentPath.isFunction())
78386
+ return true;
78387
+
78388
+ if (!parentPath.isAssignmentPattern())
78389
+ return false;
78390
+
78391
+ return parentPath.parentPath.isFunction();
78392
+ }
78393
+
78291
78394
  var classProperty = {};
78292
78395
 
78293
78396
  const {exists: exists$8} = is$3;
@@ -78361,6 +78464,7 @@ parens.maybeParenClose = (path, {maybe}) => {
78361
78464
 
78362
78465
  const {isObjectPattern: isObjectPattern$1} = bundle.types;
78363
78466
  const {isParens: isParens$2} = parens;
78467
+ const {isCoupleLines: isCoupleLines$7} = is$3;
78364
78468
 
78365
78469
  assignmentExpression.AssignmentExpression = {
78366
78470
  condition: (path) => {
@@ -78377,8 +78481,9 @@ assignmentExpression.AssignmentExpression = {
78377
78481
  before(path, {write}) {
78378
78482
  write('(');
78379
78483
  },
78380
- print(path, {print}) {
78484
+ print(path, {print, maybe}) {
78381
78485
  const {operator} = path.node;
78486
+ maybe.print.breakline(isPrevCoupleLines(path));
78382
78487
 
78383
78488
  print('__left');
78384
78489
  print.space();
@@ -78391,6 +78496,22 @@ assignmentExpression.AssignmentExpression = {
78391
78496
  },
78392
78497
  };
78393
78498
 
78499
+ const isPrevCoupleLines = (path) => {
78500
+ const {parentPath} = path;
78501
+ const prev = parentPath.getPrevSibling();
78502
+
78503
+ if (!prev.node)
78504
+ return false;
78505
+
78506
+ const currentStart = path.node?.loc?.start.line;
78507
+ const prevEnd = prev.node?.loc?.end.line;
78508
+
78509
+ if (!isCoupleLines$7(prev))
78510
+ return false;
78511
+
78512
+ return currentStart - prevEnd < 2;
78513
+ };
78514
+
78394
78515
  var arrayExpression = {};
78395
78516
 
78396
78517
  var newline = {};
@@ -78399,11 +78520,11 @@ var operate = {};
78399
78520
 
78400
78521
  var getBinding$2 = {};
78401
78522
 
78402
- const {types: types$o} = bundle;
78523
+ const {types: types$p} = bundle;
78403
78524
  const {
78404
- isIdentifier: isIdentifier$7,
78405
- isMemberExpression: isMemberExpression$2,
78406
- } = types$o;
78525
+ isIdentifier: isIdentifier$8,
78526
+ isMemberExpression: isMemberExpression$3,
78527
+ } = types$p;
78407
78528
 
78408
78529
  const isString$a = (a) => typeof a === 'string';
78409
78530
 
@@ -78419,10 +78540,10 @@ const parseName$1 = (node) => {
78419
78540
  if (isString$a(node))
78420
78541
  return node;
78421
78542
 
78422
- if (isIdentifier$7(node))
78543
+ if (isIdentifier$8(node))
78423
78544
  return node.name;
78424
78545
 
78425
- if (isMemberExpression$2(node))
78546
+ if (isMemberExpression$3(node))
78426
78547
  return parseName$1(node.object);
78427
78548
 
78428
78549
  return '';
@@ -78430,22 +78551,22 @@ const parseName$1 = (node) => {
78430
78551
 
78431
78552
  var isSimple$2 = {};
78432
78553
 
78433
- const {types: types$n} = bundle;
78554
+ const {types: types$o} = bundle;
78434
78555
  const {
78435
78556
  isOptionalMemberExpression,
78436
- isMemberExpression: isMemberExpression$1,
78437
- isIdentifier: isIdentifier$6,
78557
+ isMemberExpression: isMemberExpression$2,
78558
+ isIdentifier: isIdentifier$7,
78438
78559
  isLiteral: isLiteral$4,
78439
- } = types$n;
78560
+ } = types$o;
78440
78561
 
78441
78562
  isSimple$2.isSimple = (a) => {
78442
78563
  if (isLiteral$4(a))
78443
78564
  return true;
78444
78565
 
78445
- if (isIdentifier$6(a))
78566
+ if (isIdentifier$7(a))
78446
78567
  return true;
78447
78568
 
78448
- if (isMemberExpression$1(a))
78569
+ if (isMemberExpression$2(a))
78449
78570
  return true;
78450
78571
 
78451
78572
  return isOptionalMemberExpression(a);
@@ -78453,33 +78574,33 @@ isSimple$2.isSimple = (a) => {
78453
78574
 
78454
78575
  var extract$6 = {};
78455
78576
 
78456
- const {types: types$m} = bundle;
78577
+ const {types: types$n} = bundle;
78457
78578
  const {
78458
78579
  isArrayExpression: isArrayExpression$3,
78459
78580
  isLiteral: isLiteral$3,
78460
- isIdentifier: isIdentifier$5,
78461
- isMemberExpression,
78581
+ isIdentifier: isIdentifier$6,
78582
+ isMemberExpression: isMemberExpression$1,
78462
78583
  isTemplateElement: isTemplateElement$3,
78463
78584
  isRegExpLiteral: isRegExpLiteral$1,
78464
78585
  isClassMethod,
78465
- isTemplateLiteral: isTemplateLiteral$1,
78586
+ isTemplateLiteral: isTemplateLiteral$2,
78466
78587
  isJSXText: isJSXText$2,
78467
78588
  isJSXAttribute: isJSXAttribute$1,
78468
78589
  isTSTypeReference: isTSTypeReference$2,
78469
- } = types$m;
78590
+ } = types$n;
78470
78591
 
78471
78592
  extract$6.extract = extract$5;
78472
78593
 
78473
78594
  function extract$5(node) {
78474
78595
  node = node.node || node;
78475
78596
 
78476
- if (isIdentifier$5(node))
78597
+ if (isIdentifier$6(node))
78477
78598
  return node.name;
78478
78599
 
78479
78600
  if (isRegExpLiteral$1(node))
78480
78601
  return node.pattern;
78481
78602
 
78482
- if (isTemplateLiteral$1(node))
78603
+ if (isTemplateLiteral$2(node))
78483
78604
  return extract$5(node.quasis[0]);
78484
78605
 
78485
78606
  if (isLiteral$3(node))
@@ -78488,7 +78609,7 @@ function extract$5(node) {
78488
78609
  if (isTemplateElement$3(node))
78489
78610
  return node.value.raw;
78490
78611
 
78491
- if (isMemberExpression(node))
78612
+ if (isMemberExpression$1(node))
78492
78613
  return `${extract$5(node.object)}.${extract$5(node.property)}`;
78493
78614
 
78494
78615
  if (isArrayExpression$3(node))
@@ -78804,19 +78925,23 @@ setLiteralValue$2.setLiteralValue = (path, newValue) => {
78804
78925
 
78805
78926
  var properties = {};
78806
78927
 
78807
- var traverseProperties$3 = {};
78808
-
78809
- const {traverse: traverse$b, types: types$l} = bundle;
78928
+ var traverseProperties$4 = {};
78810
78929
 
78930
+ const {traverse: traverse$b, types: types$m} = bundle;
78811
78931
  const {extract: extract$3} = extract$6;
78812
- const {isObjectExpression: isObjectExpression$3} = types$l;
78932
+
78933
+ const {
78934
+ isObjectExpression: isObjectExpression$3,
78935
+ isCallExpression: isCallExpression$3,
78936
+ } = types$m;
78937
+
78813
78938
  const nodeOrPath = (path) => path.node || path;
78814
78939
 
78815
78940
  function getNode(path) {
78816
78941
  if (!isObjectExpression$3(path))
78817
78942
  return nodeOrPath(path);
78818
78943
 
78819
- if (path.parentPath)
78944
+ if (isCallExpression$3(path.parentPath))
78820
78945
  return path.parentPath.node;
78821
78946
 
78822
78947
  return {
@@ -78825,7 +78950,7 @@ function getNode(path) {
78825
78950
  };
78826
78951
  }
78827
78952
 
78828
- traverseProperties$3.traverseProperties = (path, name, {firstLevel = false} = {}) => {
78953
+ traverseProperties$4.traverseProperties = (path, name, {firstLevel = false} = {}) => {
78829
78954
  const collector = [];
78830
78955
  const node = getNode(path);
78831
78956
 
@@ -78861,9 +78986,9 @@ const collect = ({name, collector}) => (path) => {
78861
78986
  };
78862
78987
 
78863
78988
  const {extract: extract$2} = extract$6;
78864
- const {traverseProperties: traverseProperties$2} = traverseProperties$3;
78989
+ const {traverseProperties: traverseProperties$3} = traverseProperties$4;
78865
78990
 
78866
- properties.traverseProperties = traverseProperties$2;
78991
+ properties.traverseProperties = traverseProperties$3;
78867
78992
 
78868
78993
  properties.getProperties = (path, names) => {
78869
78994
  const result = {};
@@ -78900,7 +79025,7 @@ properties.getProperty = (path, name) => {
78900
79025
  return null;
78901
79026
  };
78902
79027
 
78903
- const {types: types$k} = bundle;
79028
+ const {types: types$l} = bundle;
78904
79029
 
78905
79030
  const {getBinding, getBindingPath} = getBinding$2;
78906
79031
  const {isSimple: isSimple$1} = isSimple$2;
@@ -78915,7 +79040,7 @@ const {setLiteralValue: setLiteralValue$1} = setLiteralValue$2;
78915
79040
  const {
78916
79041
  getProperty: getProperty$3,
78917
79042
  getProperties,
78918
- traverseProperties: traverseProperties$1,
79043
+ traverseProperties: traverseProperties$2,
78919
79044
  } = properties;
78920
79045
 
78921
79046
  const {
@@ -78928,7 +79053,7 @@ const {
78928
79053
  isExpression: isExpression$1,
78929
79054
  isStatement: isStatement$3,
78930
79055
  BlockStatement: BlockStatement$1,
78931
- } = types$k;
79056
+ } = types$l;
78932
79057
 
78933
79058
  const {assign: assign$d} = Object;
78934
79059
 
@@ -78946,7 +79071,7 @@ operate.setLiteralValue = setLiteralValue$1;
78946
79071
 
78947
79072
  operate.getProperty = getProperty$3;
78948
79073
  operate.getProperties = getProperties;
78949
- operate.traverseProperties = traverseProperties$1;
79074
+ operate.traverseProperties = traverseProperties$2;
78950
79075
 
78951
79076
  function toExpression(el) {
78952
79077
  const {type} = el;
@@ -79014,7 +79139,11 @@ operate.insertAfter = (path, node) => {
79014
79139
  if (node.trailingComments)
79015
79140
  delete node.trailingComments;
79016
79141
 
79017
- path.insertAfter(node);
79142
+ if (isStatement$3(path) && !isStatement$3(node))
79143
+ path.insertAfter(ExpressionStatement$3(node));
79144
+ else
79145
+ path.insertAfter(node);
79146
+
79018
79147
  path.node.comments = comments;
79019
79148
  };
79020
79149
 
@@ -79087,7 +79216,7 @@ const {
79087
79216
  isAwaitExpression,
79088
79217
  isBooleanLiteral: isBooleanLiteral$1,
79089
79218
  isNullLiteral,
79090
- isStringLiteral: isStringLiteral$4,
79219
+ isStringLiteral: isStringLiteral$5,
79091
79220
  isSpreadElement: isSpreadElement$1,
79092
79221
  } = bundle.types;
79093
79222
 
@@ -79098,6 +79227,7 @@ const {
79098
79227
  isCoupleLines: isCoupleLines$6,
79099
79228
  isStringAndArray: isStringAndArray$1,
79100
79229
  isIdentifierAndIdentifier: isIdentifierAndIdentifier$1,
79230
+ isSimpleAndEmptyObject: isSimpleAndEmptyObject$1,
79101
79231
  } = is$3;
79102
79232
 
79103
79233
  const {round: round$1} = Math;
@@ -79119,6 +79249,7 @@ const isSimpleAndCall = ([a, b]) => {
79119
79249
  };
79120
79250
 
79121
79251
  const isBooleanAndSimple = ([a, b]) => isBooleanLiteral$1(a) && isSimple(b);
79252
+ const isBooleanAndObject = ([a, b]) => isBooleanLiteral$1(a) && isObjectExpression$2(b);
79122
79253
  const isNullAndSimple = ([a, b]) => isNullLiteral(a) && isSimple(b);
79123
79254
  const isSimpleAndObject = ([a, b]) => isSimple(a) && isObjectExpression$2(b);
79124
79255
  const ONE_LINE = false;
@@ -79137,6 +79268,9 @@ newline.isMultiLine = (path, {elements, maxElementsInOneLine}) => {
79137
79268
  if (elements.length > 3 && !isObjectExpression$2(elements[0]))
79138
79269
  return MULTI_LINE;
79139
79270
 
79271
+ if (isSimpleAndEmptyObject$1(elements))
79272
+ return MULTI_LINE;
79273
+
79140
79274
  if (isOneSimple(path))
79141
79275
  return ONE_LINE;
79142
79276
 
@@ -79202,7 +79336,7 @@ newline.isMultiLine = (path, {elements, maxElementsInOneLine}) => {
79202
79336
 
79203
79337
  const isForOf$1 = ({parentPath}) => parentPath.isForOfStatement();
79204
79338
 
79205
- const isStringAndString = ([a, b]) => isStringLiteral$4(a) && isStringLiteral$4(b);
79339
+ const isStringAndString = ([a, b]) => isStringLiteral$5(a) && isStringLiteral$5(b);
79206
79340
 
79207
79341
  const isShortTwoSimplesInsideCall = (path, short) => {
79208
79342
  const {node, parentPath} = path;
@@ -79214,7 +79348,7 @@ const isShortTwoSimplesInsideCall = (path, short) => {
79214
79348
  if (!parentPath.isCallExpression())
79215
79349
  return false;
79216
79350
 
79217
- if (!isStringLiteral$4(a) || !isStringLiteral$4(b))
79351
+ if (!isStringLiteral$5(a) || !isStringLiteral$5(b))
79218
79352
  return false;
79219
79353
 
79220
79354
  return length < short;
@@ -79233,7 +79367,7 @@ const isTwoSimplesInsideObjectProperty = (path) => {
79233
79367
  if (!parentPath.isObjectProperty())
79234
79368
  return false;
79235
79369
 
79236
- if (!isStringLiteral$4(a) || !isStringLiteral$4(b))
79370
+ if (!isStringLiteral$5(a) || !isStringLiteral$5(b))
79237
79371
  return false;
79238
79372
 
79239
79373
  return !isCoupleLines$6(path);
@@ -79331,6 +79465,9 @@ function isIncreaseIndent$1(path) {
79331
79465
  if (!elements.length)
79332
79466
  return false;
79333
79467
 
79468
+ if (isBooleanAndObject(elements))
79469
+ return true;
79470
+
79334
79471
  if (isInsideCallLoop(path))
79335
79472
  return false;
79336
79473
 
@@ -79354,7 +79491,7 @@ const isStringAndObject = (elements) => {
79354
79491
  const first = elements.at(0);
79355
79492
  const last = elements.at(-1);
79356
79493
 
79357
- return isStringLiteral$4(first) && isObjectExpression$2(last);
79494
+ return isStringLiteral$5(first) && isObjectExpression$2(last);
79358
79495
  };
79359
79496
 
79360
79497
  newline.isCurrentNewLine = (path) => {
@@ -79366,13 +79503,13 @@ newline.isCurrentNewLine = (path) => {
79366
79503
 
79367
79504
  var indent = {};
79368
79505
 
79369
- const {types: types$j} = bundle;
79506
+ const {types: types$k} = bundle;
79370
79507
  const {isIndented} = is$3;
79371
79508
 
79372
79509
  const {
79373
- isStringLiteral: isStringLiteral$3,
79510
+ isStringLiteral: isStringLiteral$4,
79374
79511
  isArrayExpression: isArrayExpression$1,
79375
- } = types$j;
79512
+ } = types$k;
79376
79513
 
79377
79514
  const isInsideArray$1 = (path) => path.parentPath.isArrayExpression();
79378
79515
 
@@ -79408,18 +79545,41 @@ function isArrayInsideArray$1(path) {
79408
79545
  const isTwoLongStrings = ([a, b]) => {
79409
79546
  const LONG_STRING = 20;
79410
79547
 
79411
- if (!isStringLiteral$3(a) || !isStringLiteral$3(b))
79548
+ if (!isStringLiteral$4(a) || !isStringLiteral$4(b))
79412
79549
  return false;
79413
79550
 
79414
79551
  return a.node.value.length > LONG_STRING;
79415
79552
  };
79416
79553
 
79417
- const {types: types$i} = bundle;
79554
+ var isObjectAfterSimple$1 = {};
79555
+
79556
+ const {isNextObject: isNextObject$1, isPrevObject} = is$3;
79557
+
79558
+ const SIMPLE_TYPES = [
79559
+ 'ArrayExpression',
79560
+ 'ObjectExpression',
79561
+ 'SpreadElement',
79562
+ 'CallExpression',
79563
+ 'Identifier',
79564
+ ];
79565
+
79566
+ isObjectAfterSimple$1.isObjectAfterSimple = (a) => {
79567
+ const {type} = a;
79568
+
79569
+ if (!isNextObject$1(a) || isPrevObject(a))
79570
+ return false;
79571
+
79572
+ return SIMPLE_TYPES.includes(type);
79573
+ };
79574
+
79575
+ const {types: types$j} = bundle;
79418
79576
  const {
79419
79577
  isCoupleLines: isCoupleLines$5,
79420
79578
  isStringAndIdentifier,
79421
79579
  isIdentifierAndIdentifier,
79422
79580
  isStringAndArray,
79581
+ isSimpleAndEmptyObject,
79582
+ isNextObject,
79423
79583
  } = is$3;
79424
79584
 
79425
79585
  const {
@@ -79434,18 +79594,56 @@ const {
79434
79594
  isArrayIndented,
79435
79595
  } = indent;
79436
79596
 
79597
+ const {isObjectAfterSimple} = isObjectAfterSimple$1;
79598
+
79437
79599
  const {
79438
79600
  isObjectExpression: isObjectExpression$1,
79439
79601
  isSpreadElement,
79440
- isStringLiteral: isStringLiteral$2,
79441
- } = types$i;
79602
+ isStringLiteral: isStringLiteral$3,
79603
+ isIdentifier: isIdentifier$5,
79604
+ } = types$j;
79442
79605
 
79443
- const isNextString = (path) => isStringLiteral$2(path.getNextSibling());
79444
- const isPrevString = (path) => isStringLiteral$2(path.getPrevSibling());
79606
+ const isNextString = (path) => isStringLiteral$3(path.getNextSibling());
79607
+ const isPrevString = (path) => isStringLiteral$3(path.getPrevSibling());
79445
79608
  const isAroundStrings = (path) => isNextString(path) || isPrevString(path);
79446
- const isNextObject = (a) => a.getNextSibling().isObjectExpression();
79447
- const isPrevObject = (a) => a.getPrevSibling().isObjectExpression();
79448
- const isObjectAfterSpread = (a) => isSpreadElement(a) && isNextObject(a) && !isPrevObject(a);
79609
+
79610
+ const isSpreadBeforeObject = (a) => {
79611
+ if (!a.isObjectExpression())
79612
+ return false;
79613
+
79614
+ const prev = a.getPrevSibling();
79615
+
79616
+ if (!prev.isSpreadElement())
79617
+ return false;
79618
+
79619
+ if (prev.getPrevSibling().isObjectExpression())
79620
+ return false;
79621
+
79622
+ return prev
79623
+ .get('argument')
79624
+ .isCallExpression();
79625
+ };
79626
+
79627
+ const isNextSimple = (a) => {
79628
+ const next = a.getNextSibling();
79629
+
79630
+ if (next.isSpreadElement())
79631
+ return true;
79632
+
79633
+ return next.isIdentifier();
79634
+ };
79635
+
79636
+ const isNextSimpleBetweenObjects = (a) => {
79637
+ const next = a.getNextSibling();
79638
+ const is = next.isSpreadElement() || next.isIdentifier();
79639
+
79640
+ if (!is)
79641
+ return true;
79642
+
79643
+ return next
79644
+ .getNextSibling()
79645
+ .isObjectExpression();
79646
+ };
79449
79647
 
79450
79648
  const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1;
79451
79649
 
@@ -79495,18 +79693,24 @@ arrayExpression.ArrayExpression = {
79495
79693
 
79496
79694
  for (const [index, element] of elements.entries()) {
79497
79695
  const is = isNewLine && isCurrentNewLine(element);
79696
+
79697
+ if (isSimpleAfterObject(element))
79698
+ print.newline();
79699
+
79498
79700
  maybe.indent(is);
79499
79701
  print(element);
79500
79702
 
79501
79703
  if (index < n || trailingComma)
79502
79704
  maybe.print(is, ',');
79503
79705
 
79504
- maybe.print.newline(is && !isNextObject(element));
79505
- maybe.print.space(isObjectAfterSpread(element));
79706
+ maybe.print.newline((is || isSpreadBeforeObject(element)) && !isNextObject(element));
79707
+ maybe.print.space(is && isObjectAfterSimple(element));
79506
79708
 
79507
79709
  if (!is && index < n) {
79508
79710
  print(',');
79509
- print.space();
79711
+
79712
+ if (isNextSimpleBetweenObjects(element) || !(element.isObjectExpression() && isNextSimple(element)))
79713
+ print.space();
79510
79714
  }
79511
79715
  }
79512
79716
 
@@ -79526,6 +79730,11 @@ arrayExpression.ArrayExpression = {
79526
79730
  maybe.indent(elements.length && isNewLine);
79527
79731
  }
79528
79732
 
79733
+ if (isSimpleAndEmptyObject(elements) && !isSpreadElement(elements.at(-1))) {
79734
+ print(',');
79735
+ print.breakline();
79736
+ }
79737
+
79529
79738
  print(']');
79530
79739
  },
79531
79740
  afterIf(path) {
@@ -79550,6 +79759,19 @@ arrayExpression.ArrayExpression = {
79550
79759
  },
79551
79760
  };
79552
79761
 
79762
+ function isSimpleAfterObject(path) {
79763
+ if (!isSpreadElement(path) && !isIdentifier$5(path))
79764
+ return;
79765
+
79766
+ const prev = path.getPrevSibling();
79767
+ const next = path.getNextSibling();
79768
+
79769
+ if (next.isObjectExpression())
79770
+ return false;
79771
+
79772
+ return prev.isObjectExpression();
79773
+ }
79774
+
79553
79775
  var arrayPattern = {};
79554
79776
 
79555
79777
  const {maybeTypeAnnotation: maybeTypeAnnotation$2} = maybeTypeAnnotation$4;
@@ -80111,11 +80333,31 @@ expressionStatement.ExpressionStatement = {
80111
80333
  if (hasTrailingComment$1(path) && !isCoupleLines$4(path))
80112
80334
  return;
80113
80335
 
80336
+ if (isTopParentLast(path))
80337
+ return;
80338
+
80114
80339
  print.newline();
80115
80340
  maybe.markAfter(store(), path);
80116
80341
  },
80117
80342
  };
80118
80343
 
80344
+ function isTopParentLast({parentPath}) {
80345
+ if (!parentPath.isIfStatement())
80346
+ return false;
80347
+
80348
+ const nextParent = parentPath.parentPath;
80349
+
80350
+ if (!nextParent.isIfStatement())
80351
+ return false;
80352
+
80353
+ const nextNext = nextParent.parentPath;
80354
+
80355
+ if (!nextNext.isIfStatement())
80356
+ return false;
80357
+
80358
+ return isLast$a(nextNext);
80359
+ }
80360
+
80119
80361
  function isNotLastBody(path) {
80120
80362
  return path.parentPath.get('body') === path;
80121
80363
  }
@@ -80236,7 +80478,6 @@ variableDeclaration.VariableDeclaration = {
80236
80478
  write.newline();
80237
80479
  wasNewline = true;
80238
80480
  } else if (isParentSwitchCase(path)) {
80239
- //write.breakline();
80240
80481
  write.newline();
80241
80482
  }
80242
80483
 
@@ -80391,6 +80632,7 @@ ifStatement.IfStatement = {
80391
80632
  const alternate = path.get('alternate');
80392
80633
  const isConsequentBlock = consequent.isBlockStatement();
80393
80634
  const isVar = consequent.isVariableDeclaration();
80635
+ consequent.isReturnStatement();
80394
80636
 
80395
80637
  if (isConsequentBlock) {
80396
80638
  print.space();
@@ -80414,7 +80656,12 @@ ifStatement.IfStatement = {
80414
80656
  write.space();
80415
80657
  traverse(alternate);
80416
80658
  } else if (alternate.isIfStatement()) {
80417
- write(' else ');
80659
+ if (alternate.get('consequent').isBlockStatement())
80660
+ write.space();
80661
+ else
80662
+ indent();
80663
+
80664
+ write('else ');
80418
80665
  traverse(alternate);
80419
80666
  } else if (exists$6(alternate)) {
80420
80667
  maybe.write.newline(isVar);
@@ -80427,6 +80674,9 @@ ifStatement.IfStatement = {
80427
80674
  indent.dec();
80428
80675
  }
80429
80676
 
80677
+ if (!isNext$i(path) && !consequent.isBlockStatement())
80678
+ return;
80679
+
80430
80680
  if (path === partOfAlternate && isInside(path))
80431
80681
  print.newline();
80432
80682
  },
@@ -80738,6 +80988,8 @@ const {maybeSpaceAfterKeyword} = maybeSpaceAfterKeyword$1;
80738
80988
 
80739
80989
  const isBodyLength = ({parentPath}) => parentPath.node?.body?.length > 2;
80740
80990
 
80991
+ const isInsideIfWithElse = ({parentPath}) => parentPath.isIfStatement() && parentPath.node.alternate;
80992
+
80741
80993
  returnStatement.ReturnStatement = {
80742
80994
  beforeIf(path) {
80743
80995
  return !hasPrevNewline(path) && isBodyLength(path) || isPrevBody(path);
@@ -80765,6 +81017,9 @@ returnStatement.ReturnStatement = {
80765
81017
  print(';');
80766
81018
  },
80767
81019
  afterIf: (path) => {
81020
+ if (isInsideIfWithElse(path))
81021
+ return true;
81022
+
80768
81023
  if (isLast$6(path))
80769
81024
  return false;
80770
81025
 
@@ -80993,11 +81248,18 @@ const {
80993
81248
 
80994
81249
  importDeclaration.ImportAttribute = ImportAttribute;
80995
81250
  importDeclaration.ImportDeclaration = {
80996
- print(path, {print, maybe, write, traverse, indent}, options) {
81251
+ print(path, printer, semantics) {
81252
+ const {
81253
+ print,
81254
+ maybe,
81255
+ write,
81256
+ traverse,
81257
+ indent,
81258
+ } = printer;
81259
+
80997
81260
  const {phase} = path.node;
80998
81261
  const isType = path.node.importKind === 'type';
80999
81262
  const specifiers = path.get('specifiers');
81000
- const {maxSpecifiersInOneLine} = options;
81001
81263
 
81002
81264
  indent();
81003
81265
  write('import');
@@ -81026,6 +81288,7 @@ importDeclaration.ImportDeclaration = {
81026
81288
  traverse(spec.get('local'));
81027
81289
  }
81028
81290
 
81291
+ const maxSpecifiersInOneLine = parseMaxSpecifiers(imports, semantics);
81029
81292
  const importsCount = imports.length - 1;
81030
81293
 
81031
81294
  for (const [index, spec] of imports.entries()) {
@@ -81037,7 +81300,7 @@ importDeclaration.ImportDeclaration = {
81037
81300
  indent.inc();
81038
81301
 
81039
81302
  maybe.write(!wasSpecifier, '{');
81040
- maybe.write.breakline(importsCount > maxSpecifiersInOneLine);
81303
+ maybe.write.breakline(importsCount >= maxSpecifiersInOneLine);
81041
81304
 
81042
81305
  wasSpecifier = true;
81043
81306
  write(imported.name);
@@ -81047,18 +81310,18 @@ importDeclaration.ImportDeclaration = {
81047
81310
  write(spec.node.local.name);
81048
81311
  }
81049
81312
 
81050
- if (importsCount <= maxSpecifiersInOneLine && notLast) {
81313
+ if (importsCount < maxSpecifiersInOneLine && notLast) {
81051
81314
  maybe.write(n, ',');
81052
81315
  maybe.write.space(n);
81053
81316
  }
81054
81317
 
81055
- if (importsCount > maxSpecifiersInOneLine) {
81318
+ if (importsCount >= maxSpecifiersInOneLine) {
81056
81319
  maybe.write(n, ',');
81057
81320
 
81058
81321
  const last = index === n;
81059
- const penult = index === n - 1;
81322
+ const penulty = index === n - 1;
81060
81323
 
81061
- maybe.write.newline(penult && defaults.length);
81324
+ maybe.write.newline(penulty && defaults.length);
81062
81325
  maybe.write.newline(last);
81063
81326
  }
81064
81327
 
@@ -81091,6 +81354,23 @@ importDeclaration.ImportDeclaration = {
81091
81354
  },
81092
81355
  };
81093
81356
 
81357
+ function parseMaxSpecifiers(imports, semantics) {
81358
+ const {
81359
+ maxSpecifiersInOneLine,
81360
+ maxPropertiesLengthInOneLine,
81361
+ } = semantics;
81362
+
81363
+ for (const {node} of imports) {
81364
+ if (node.imported.name !== node.local.name)
81365
+ return 1;
81366
+
81367
+ if (node.imported.name.length >= maxPropertiesLengthInOneLine)
81368
+ return 1;
81369
+ }
81370
+
81371
+ return maxSpecifiersInOneLine;
81372
+ }
81373
+
81094
81374
  var exportDeclaration = {};
81095
81375
 
81096
81376
  const {
@@ -81431,6 +81711,7 @@ var program = {};
81431
81711
 
81432
81712
  const {parseComments: parseComments$1} = comment;
81433
81713
  const {getDirectives} = getDirectives$2;
81714
+ const {hasCoupleTrailingComments} = is$3;
81434
81715
 
81435
81716
  program.Program = (path, printer, semantics) => {
81436
81717
  const {body} = path.node;
@@ -81457,6 +81738,9 @@ program.Program = (path, printer, semantics) => {
81457
81738
  if (directives.length && !body.length)
81458
81739
  return;
81459
81740
 
81741
+ if (body.length && hasCoupleTrailingComments(body.at(-1)))
81742
+ return;
81743
+
81460
81744
  write.endOfFile();
81461
81745
  };
81462
81746
 
@@ -81587,9 +81871,26 @@ identifier.Identifier = maybeParens$2(maybeTypeAnnotation((path, printer) => {
81587
81871
  maybe.write(optional, '?');
81588
81872
  }));
81589
81873
 
81874
+ var decorator = {};
81875
+
81876
+ const {isMemberExpression} = bundle.types;
81877
+
81878
+ decorator.Decorator = (path, {print, maybe}) => {
81879
+ const {expression} = path.node;
81880
+ const isMember = isMemberExpression(expression);
81881
+
81882
+ print('@');
81883
+
81884
+ maybe.print(isMember, '(');
81885
+ print('__expression');
81886
+ maybe.print(isMember, ')');
81887
+ };
81888
+
81590
81889
  const {TemplateLiteral} = templateLiteral;
81591
81890
  const {Identifier: Identifier$2} = identifier;
81592
81891
 
81892
+ const {Decorator} = decorator;
81893
+
81593
81894
  const maybeEncode = (value, {encodeDoubleQuote, encodeSingleQuote}) => {
81594
81895
  if (encodeSingleQuote && !value.includes('\\'))
81595
81896
  return value.replaceAll(`'`, `\\'`);
@@ -81602,14 +81903,11 @@ const maybeEncode = (value, {encodeDoubleQuote, encodeSingleQuote}) => {
81602
81903
 
81603
81904
  var literals$1 = {
81604
81905
  Identifier: Identifier$2,
81906
+ Decorator,
81605
81907
  TemplateLiteral,
81606
81908
  BigIntLiteral(path, {write}) {
81607
81909
  write(path.node.raw);
81608
81910
  },
81609
- Decorator(path, {print}) {
81610
- print('@');
81611
- print('__expression');
81612
- },
81613
81911
  NumericLiteral(path, {write}) {
81614
81912
  const {
81615
81913
  raw,
@@ -81711,8 +82009,13 @@ const {
81711
82009
  const {markAfter} = mark;
81712
82010
  const {maybeDeclare: maybeDeclare$3} = maybeDeclare$6;
81713
82011
  const isNextType = (a) => a.getNextSibling().isTSTypeAliasDeclaration();
82012
+ const isNextExport = (a) => a.getNextSibling().isExportDeclaration();
81714
82013
 
81715
82014
  tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
82015
+ beforeIf: (path) => !path.parentPath.isExportDeclaration(),
82016
+ before: (path, {indent}) => {
82017
+ indent();
82018
+ },
81716
82019
  print: maybeDeclare$3((path, {print, maybe, store}) => {
81717
82020
  const typeAnnotation = path.get('typeAnnotation');
81718
82021
  const isConditional = typeAnnotation.isTSConditionalType();
@@ -81742,7 +82045,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
81742
82045
 
81743
82046
  return !isNextType(path);
81744
82047
  },
81745
- after(path, {print}) {
82048
+ after(path, {print, maybe}) {
82049
+ maybe.indent(isNextExport(path));
81746
82050
  print.newline();
81747
82051
  markAfter(path);
81748
82052
  },
@@ -81750,8 +82054,8 @@ tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
81750
82054
 
81751
82055
  var tsMappedType = {};
81752
82056
 
81753
- const {types: types$h} = bundle;
81754
- const {isTSConditionalType} = types$h;
82057
+ const {types: types$i} = bundle;
82058
+ const {isTSConditionalType} = types$i;
81755
82059
 
81756
82060
  tsMappedType.TSMappedType = (path, {print, indent, maybe}) => {
81757
82061
  const {
@@ -82639,6 +82943,9 @@ var jsxOpeningElement = {};
82639
82943
  const {isCoupleLines: isCoupleLines$1} = is$3;
82640
82944
 
82641
82945
  const isNotJSX = ({parentPath}) => {
82946
+ if (parentPath.parentPath.isCallExpression())
82947
+ return false;
82948
+
82642
82949
  if (parentPath.parentPath.isJSXElement())
82643
82950
  return false;
82644
82951
 
@@ -82841,7 +83148,7 @@ function snakeCase(str) {
82841
83148
  }
82842
83149
 
82843
83150
  const {stringify: stringify$8} = JSON;
82844
- const {TYPES: TYPES$2} = types$q;
83151
+ const {TYPES: TYPES$2} = types$s;
82845
83152
  const toSnakeCase = justSnakeCase;
82846
83153
 
82847
83154
  const {codeFrameColumns: codeFrameColumns$1} = bundle;
@@ -82951,6 +83258,7 @@ function initSemantics(semantics = {}) {
82951
83258
  return {
82952
83259
  comments: true,
82953
83260
  maxPropertiesInOneLine: 2,
83261
+ maxPropertiesLengthInOneLine: 15,
82954
83262
  maxSpecifiersInOneLine: 2,
82955
83263
  maxElementsInOneLine: 5,
82956
83264
  maxVariablesInOneLine: 4,
@@ -82966,7 +83274,7 @@ const {round} = Math;
82966
83274
  const fullstore$2 = fullstore$3;
82967
83275
  const isObject$4 = (a) => a && typeof a === 'object';
82968
83276
  const babelTraverse$2 = bundle.traverse;
82969
- const {TYPES: TYPES$1} = types$q;
83277
+ const {TYPES: TYPES$1} = types$s;
82970
83278
  const baseVisitors = visitors$1;
82971
83279
 
82972
83280
  const {
@@ -83334,6 +83642,7 @@ json.toJS = (source, name = __json) => {
83334
83642
  };
83335
83643
 
83336
83644
  json.fromJS = (source, name = __json) => {
83645
+ source = maybeNewline$1(source);
83337
83646
  const shortName = cut$1(name);
83338
83647
 
83339
83648
  source = source.slice(source.indexOf(shortName));
@@ -83859,7 +84168,7 @@ var getAst = (node) => {
83859
84168
  return ast;
83860
84169
  };
83861
84170
 
83862
- const {traverse: traverse$a, types: types$g} = bundle;
84171
+ const {traverse: traverse$a, types: types$h} = bundle;
83863
84172
 
83864
84173
  const traverseObjectExpression = traverseObjectExpression$1;
83865
84174
  const setClassMethod = setClassMethod$1;
@@ -83886,7 +84195,7 @@ const getAST = getAst;
83886
84195
  const {
83887
84196
  isObjectExpression,
83888
84197
  isExportDeclaration,
83889
- } = types$g;
84198
+ } = types$h;
83890
84199
 
83891
84200
  var estreeToBabel = (node) => {
83892
84201
  const ast = getAST(node);
@@ -91299,14 +91608,16 @@ const clean = (a) => a.filter(Boolean);
91299
91608
  const initBabel = once$6(() => bundle);
91300
91609
  const {assign: assign$8} = Object;
91301
91610
 
91302
- // There is a difference in options naming for babel and recast// recast -> sourceFileName// babel, putout: sourceFilename
91303
- babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true, isFlow = getFlow(source)}) {
91611
+ // There is a difference in options naming for babel and recast
91612
+ // recast -> sourceFileName
91613
+ // babel, putout: sourceFilename
91614
+ babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true, isFlow = getFlow(source), isRecovery}) {
91304
91615
  const {parse} = initBabel();
91305
-
91306
91616
  const parserOptions = {
91307
91617
  sourceType: 'module',
91308
91618
  tokens: true,
91309
91619
  ...options,
91620
+ errorRecovery: isRecovery,
91310
91621
  plugins: clean([
91311
91622
  ...plugins,
91312
91623
  ...getBabelLangExts({
@@ -101282,10 +101593,10 @@ var tenko_prod = /*#__PURE__*/Object.freeze({
101282
101593
  toktypeToString: toktypeToString
101283
101594
  });
101284
101595
 
101285
- var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(tenko_prod);
101596
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(tenko_prod);
101286
101597
 
101287
101598
  const once$3 = onceExports;
101288
- const initTenko = once$3(() => require$$1$1);
101599
+ const initTenko = once$3(() => require$$1);
101289
101600
 
101290
101601
  tenko$1.parse = (source) => {
101291
101602
  const {Tenko} = initTenko();
@@ -104016,7 +104327,7 @@ function isAbsolute(path) {
104016
104327
  }
104017
104328
 
104018
104329
  // posix version
104019
- function join$2() {
104330
+ function join$3() {
104020
104331
  var paths = Array.prototype.slice.call(arguments, 0);
104021
104332
  return normalize(filter$1(paths, function(p, index) {
104022
104333
  if (typeof p !== 'string') {
@@ -104101,17 +104412,17 @@ function basename$3(path, ext) {
104101
104412
  }
104102
104413
 
104103
104414
 
104104
- function extname(path) {
104415
+ function extname$1(path) {
104105
104416
  return splitPath(path)[3];
104106
104417
  }
104107
104418
  var _polyfillNode_path = {
104108
- extname: extname,
104419
+ extname: extname$1,
104109
104420
  basename: basename$3,
104110
104421
  dirname: dirname$1,
104111
104422
  sep: sep,
104112
104423
  delimiter: delimiter,
104113
104424
  relative: relative$1,
104114
- join: join$2,
104425
+ join: join$3,
104115
104426
  isAbsolute: isAbsolute,
104116
104427
  normalize: normalize,
104117
104428
  resolve: resolve
@@ -104140,9 +104451,9 @@ var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
104140
104451
  default: _polyfillNode_path,
104141
104452
  delimiter: delimiter,
104142
104453
  dirname: dirname$1,
104143
- extname: extname,
104454
+ extname: extname$1,
104144
104455
  isAbsolute: isAbsolute,
104145
- join: join$2,
104456
+ join: join$3,
104146
104457
  normalize: normalize,
104147
104458
  relative: relative$1,
104148
104459
  resolve: resolve,
@@ -109132,7 +109443,7 @@ function requireDist () {
109132
109443
 
109133
109444
  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
109445
 
109135
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && 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; }
109446
+ 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
109447
 
109137
109448
  const DEFAULTS = {
109138
109449
  flow: 'detect'
@@ -109216,20 +109527,35 @@ var tryCatch$5 = (fn, ...args) => {
109216
109527
 
109217
109528
  const tryCatch$4 = tryCatch$5;
109218
109529
 
109219
- var secondChance$1 = (fn, source, a, b) => {
109530
+ var secondChance$1 = (fn, source, messages, args) => {
109531
+ const [a, ...others] = args;
109220
109532
  const [errorA, resultA] = tryCatch$4(fn, source, a);
109221
109533
 
109222
109534
  if (!errorA)
109223
109535
  return resultA;
109224
109536
 
109225
- const [errorB, resultB] = tryCatch$4(fn, source, b);
109537
+ if (checkError(errorA, messages))
109538
+ throw errorA;
109226
109539
 
109227
- if (!errorB)
109228
- return resultB;
109540
+ for (const b of others) {
109541
+ const [errorB, resultB] = tryCatch$4(fn, source, b);
109542
+
109543
+ if (!errorB)
109544
+ return resultB;
109545
+ }
109229
109546
 
109230
109547
  throw errorA;
109231
109548
  };
109232
109549
 
109550
+ function checkError(error, messages) {
109551
+ for (const message of messages) {
109552
+ if (error.message.includes(message))
109553
+ return true;
109554
+ }
109555
+
109556
+ return false;
109557
+ }
109558
+
109233
109559
  const acorn = acorn$2;
109234
109560
  const babel = babel$1;
109235
109561
  const espree = espree$2;
@@ -109239,6 +109565,10 @@ const hermes = hermes$1;
109239
109565
  const secondChance = secondChance$1;
109240
109566
  const isObject$3 = (a) => typeof a === 'object';
109241
109567
 
109568
+ const MESSAGES = [
109569
+ 'has already been declared',
109570
+ ];
109571
+
109242
109572
  var customParser$1 = (source, parser, {isTS, isFlow, isJSX}) => {
109243
109573
  const options = {
109244
109574
  parser,
@@ -109247,18 +109577,30 @@ var customParser$1 = (source, parser, {isTS, isFlow, isJSX}) => {
109247
109577
  isJSX,
109248
109578
  };
109249
109579
 
109250
- return secondChance(customParse, source, options, {
109580
+ const optionsB = {
109251
109581
  ...options,
109252
109582
  isJSX: false,
109253
- });
109583
+ };
109584
+
109585
+ const optionsC = {
109586
+ ...options,
109587
+ isRecovery: true,
109588
+ };
109589
+
109590
+ return secondChance(customParse, source, MESSAGES, [
109591
+ options,
109592
+ optionsB,
109593
+ optionsC,
109594
+ ]);
109254
109595
  };
109255
109596
 
109256
- function customParse(source, {parser, isTS, isFlow, isJSX}) {
109597
+ function customParse(source, {parser, isTS, isFlow, isJSX, isRecovery}) {
109257
109598
  if (parser === 'babel')
109258
109599
  return babel.parse(source, {
109259
109600
  isTS,
109260
109601
  isFlow,
109261
109602
  isJSX,
109603
+ isRecovery,
109262
109604
  });
109263
109605
 
109264
109606
  if (isObject$3(parser))
@@ -109285,11 +109627,11 @@ function customParse(source, {parser, isTS, isFlow, isJSX}) {
109285
109627
  return commonjsRequire(parser).parse(source);
109286
109628
  }
109287
109629
 
109288
- const {types: types$f} = bundle;
109630
+ const {types: types$g} = bundle;
109289
109631
  const {
109290
- StringLiteral: StringLiteral$3,
109632
+ StringLiteral: StringLiteral$4,
109291
109633
  ExpressionStatement,
109292
- } = types$f;
109634
+ } = types$g;
109293
109635
 
109294
109636
  const {assign: assign$7} = Object;
109295
109637
 
@@ -109304,7 +109646,7 @@ var moveOutDirectives$1 = (ast) => {
109304
109646
  for (const directive of directives) {
109305
109647
  const {leadingComments} = directive;
109306
109648
  const {value} = directive.value;
109307
- const expression = assign$7(ExpressionStatement(StringLiteral$3(value)), {
109649
+ const expression = assign$7(ExpressionStatement(StringLiteral$4(value)), {
109308
109650
  leadingComments,
109309
109651
  });
109310
109652
 
@@ -109617,16 +109959,7 @@ var lib$1 = {};
109617
109959
 
109618
109960
  var load$1 = {};
109619
109961
 
109620
- var _polyfillNode_module = {};
109621
-
109622
- var _polyfillNode_module$1 = /*#__PURE__*/Object.freeze({
109623
- __proto__: null,
109624
- default: _polyfillNode_module
109625
- });
109626
-
109627
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_module$1);
109628
-
109629
- const {createRequire} = require$$1;
109962
+ const {createRequire} = require$$1$1;
109630
109963
 
109631
109964
  const tryCatch$3 = tryCatch$5;
109632
109965
  const once$1 = onceExports;
@@ -110067,7 +110400,7 @@ isEnabled$4.isEnabled = (name, rules) => {
110067
110400
  }
110068
110401
 
110069
110402
  for (const {rule, state} of rules) {
110070
- if (RegExp(`^${rule}`).test(name))
110403
+ if (RegExp(`^${rule}/`).test(name))
110071
110404
  return state;
110072
110405
  }
110073
110406
 
@@ -111464,7 +111797,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
111464
111797
 
111465
111798
  mergeVisitors$1.default;
111466
111799
 
111467
- const {traverse: babelTraverse$1, types: types$e} = bundle;
111800
+ const {traverse: babelTraverse$1, types: types$f} = bundle;
111468
111801
 
111469
111802
  const {generate: generate$1} = parser$6;
111470
111803
  const {merge: merge$1} = babelTraverse$1.visitors;
@@ -111483,7 +111816,7 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
111483
111816
  template,
111484
111817
  }),
111485
111818
  generate: generate$1,
111486
- types: types$e,
111819
+ types: types$f,
111487
111820
  push,
111488
111821
  options,
111489
111822
  });
@@ -111669,7 +112002,7 @@ function check$5(selector) {
111669
112002
  var is$2 = {};
111670
112003
 
111671
112004
  const {template: template$8} = parser$6;
111672
- const {types: types$d} = bundle;
112005
+ const {types: types$e} = bundle;
111673
112006
  const {
111674
112007
  isBlockStatement: isBlockStatement$1,
111675
112008
  isBooleanLiteral,
@@ -111685,7 +112018,7 @@ const {
111685
112018
  isJSXIdentifier,
111686
112019
  isJSXAttribute,
111687
112020
  isTSTypeReference: isTSTypeReference$1,
111688
- } = types$d;
112021
+ } = types$e;
111689
112022
 
111690
112023
  const isStr$1 = (a) => typeof a === 'string';
111691
112024
 
@@ -111986,7 +112319,7 @@ is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.i
111986
112319
 
111987
112320
  const jessy = jessy$1;
111988
112321
  const nessy = nessy$1;
111989
- const {traverse: traverse$7, types: types$c} = bundle;
112322
+ const {traverse: traverse$7, types: types$d} = bundle;
111990
112323
  const {template: template$7} = parser$6;
111991
112324
 
111992
112325
  const {replaceWith: replaceWith$3, extract} = operate;
@@ -112006,9 +112339,9 @@ const {
112006
112339
  isStatement: isStatement$1,
112007
112340
  isJSXElement,
112008
112341
  isLiteral: isLiteral$1,
112009
- isTemplateLiteral,
112342
+ isTemplateLiteral: isTemplateLiteral$1,
112010
112343
  TemplateElement,
112011
- } = types$c;
112344
+ } = types$d;
112012
112345
 
112013
112346
  const {extractExpression: extractExpression$1} = template$7;
112014
112347
 
@@ -112118,7 +112451,7 @@ function setValues$2({waysTo, values, path}) {
112118
112451
  if (isStatement$1(values[name]))
112119
112452
  way = way.replace(/\.expression$/, '');
112120
112453
 
112121
- if (isLiteral$1(values[name]) && isTemplateLiteral(node)) {
112454
+ if (isLiteral$1(values[name]) && isTemplateLiteral$1(node)) {
112122
112455
  const {value} = values[name];
112123
112456
 
112124
112457
  const element = TemplateElement({
@@ -112187,14 +112520,14 @@ function parseValue(a) {
112187
112520
 
112188
112521
  var logExports = log$4.exports;
112189
112522
 
112190
- const {types: types$b} = bundle;
112523
+ const {types: types$c} = bundle;
112191
112524
  const {
112192
112525
  isIdentifier: isIdentifier$1,
112193
112526
  isLiteral,
112194
- isStringLiteral: isStringLiteral$1,
112527
+ isStringLiteral: isStringLiteral$2,
112195
112528
  isTemplateElement: isTemplateElement$1,
112196
112529
  isTSTypeReference,
112197
- } = types$b;
112530
+ } = types$c;
112198
112531
 
112199
112532
  const parseName = (node) => {
112200
112533
  node = node[0] || node;
@@ -112216,7 +112549,7 @@ const parseName = (node) => {
112216
112549
  var link$1 = ({add, value, nodeValue, templateStore}) => {
112217
112550
  const name = parseName(value);
112218
112551
 
112219
- if (isStringLiteral$1(value) && !isStringLiteral$1(nodeValue))
112552
+ if (isStringLiteral$2(value) && !isStringLiteral$2(nodeValue))
112220
112553
  return false;
112221
112554
 
112222
112555
  if (!templateStore[name]) {
@@ -112259,13 +112592,13 @@ const {
112259
112592
  isLinkedRegExp: isLinkedRegExp$1,
112260
112593
  } = is$2;
112261
112594
 
112262
- const {types: types$a} = bundle;
112595
+ const {types: types$b} = bundle;
112263
112596
  const {
112264
112597
  isClassBody,
112265
112598
  isBlock,
112266
112599
  isJSXText,
112267
112600
  isTemplateElement,
112268
- } = types$a;
112601
+ } = types$b;
112269
112602
 
112270
112603
  const isEmptyBlock = (a) => isBlock(a) && !a.body.length;
112271
112604
  const isPrimitive = (a) => typeof a !== 'object' || a === null;
@@ -112372,7 +112705,7 @@ function compareJSXTexts(node, template) {
112372
112705
 
112373
112706
  var topLevelComparators = {};
112374
112707
 
112375
- const {types: types$9} = bundle;
112708
+ const {types: types$a} = bundle;
112376
112709
  const {
112377
112710
  isEqualBody,
112378
112711
  isEqualAnyObject,
@@ -112385,8 +112718,8 @@ const {
112385
112718
 
112386
112719
  const {
112387
112720
  isIdentifier,
112388
- isStringLiteral,
112389
- } = types$9;
112721
+ isStringLiteral: isStringLiteral$1,
112722
+ } = types$a;
112390
112723
 
112391
112724
  const comparators = [
112392
112725
  isEqualAnyObject,
@@ -112418,7 +112751,7 @@ function isLinkedAndIdentifier(node, templateNode) {
112418
112751
  }
112419
112752
 
112420
112753
  function isLinkedAndStringLiteral(node, templateNode) {
112421
- return isStringLiteral(node) && isLinkedNode(templateNode);
112754
+ return isStringLiteral$1(node) && isLinkedNode(templateNode);
112422
112755
  }
112423
112756
 
112424
112757
  const {template: template$6} = parser$6;
@@ -112536,7 +112869,7 @@ compare$5.compareAll = (path, templateNodes, options) => {
112536
112869
  };
112537
112870
 
112538
112871
  // @babel/template creates empty array directives// extra duplicate value
112539
- const ignore$2 = [
112872
+ const ignore$3 = [
112540
112873
  'loc',
112541
112874
  'start',
112542
112875
  'end',
@@ -112568,7 +112901,7 @@ function superCompareIterate(node, template) {
112568
112901
  return false;
112569
112902
 
112570
112903
  for (const key of keys$2(template)) {
112571
- if (ignore$2.includes(key))
112904
+ if (ignore$3.includes(key))
112572
112905
  continue;
112573
112906
 
112574
112907
  const nodeValue = extractExpression(node[key]);
@@ -112641,8 +112974,8 @@ function findKey(path, parent) {
112641
112974
 
112642
112975
  const wraptile = wraptile$1;
112643
112976
  const findPath = findPath$1;
112644
- const {types: types$8} = bundle;
112645
- const {isProgram: isProgram$2} = types$8;
112977
+ const {types: types$9} = bundle;
112978
+ const {isProgram: isProgram$2} = types$9;
112646
112979
  const name = '__putout_runner_replace';
112647
112980
  const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
112648
112981
 
@@ -112707,7 +113040,7 @@ var watermarkExports = watermark$1.exports;
112707
113040
 
112708
113041
  const {template: template$5, print: print$2} = parser$6;
112709
113042
  const {remove, replaceWith: replaceWith$2} = operate;
112710
- const {types: types$7} = bundle;
113043
+ const {types: types$8} = bundle;
112711
113044
 
112712
113045
  const {
112713
113046
  compare: compare$3,
@@ -112724,7 +113057,7 @@ const {
112724
113057
  isExpression,
112725
113058
  isStatement,
112726
113059
  isExpressionStatement,
112727
- } = types$7;
113060
+ } = types$8;
112728
113061
 
112729
113062
  const PRINT_OPTIONS = {
112730
113063
  printer: ['putout', {
@@ -112965,11 +113298,11 @@ const {
112965
113298
  setModuleType,
112966
113299
  } = record;
112967
113300
 
112968
- const {types: types$6} = bundle;
113301
+ const {types: types$7} = bundle;
112969
113302
  const {
112970
113303
  isImportDeclaration,
112971
113304
  isVariableDeclaration,
112972
- } = types$6;
113305
+ } = types$7;
112973
113306
 
112974
113307
  const {keys} = Object;
112975
113308
  const isString$3 = (a) => typeof a === 'string';
@@ -113224,14 +113557,14 @@ function deinit() {
113224
113557
  assign$2(maybeFS$1, defaultFS);
113225
113558
  }
113226
113559
 
113227
- const {join: join$1, basename: basename$1} = require$$0$2;
113560
+ const {join: join$2, basename: basename$1} = require$$0$2;
113228
113561
  const tryCatch$1 = tryCatch$5;
113229
- const {types: types$5} = bundle;
113562
+ const {types: types$6} = bundle;
113230
113563
 
113231
113564
  const {
113232
113565
  setLiteralValue,
113233
113566
  getProperty: getProperty$2,
113234
- traverseProperties,
113567
+ traverseProperties: traverseProperties$1,
113235
113568
  } = operate;
113236
113569
 
113237
113570
  const maybeFS = maybeFs;
@@ -113260,10 +113593,10 @@ const fromBase64 = (content) => {
113260
113593
  const {
113261
113594
  ObjectExpression: ObjectExpression$1,
113262
113595
  ArrayExpression: ArrayExpression$2,
113263
- StringLiteral: StringLiteral$2,
113596
+ StringLiteral: StringLiteral$3,
113264
113597
  ObjectProperty: ObjectProperty$2,
113265
113598
  isProgram: isProgram$1,
113266
- } = types$5;
113599
+ } = types$6;
113267
113600
 
113268
113601
  const getRegExp = (wildcard) => {
113269
113602
  const escaped = wildcard
@@ -113291,7 +113624,7 @@ function findFile$5(node, name) {
113291
113624
  const filePaths = [];
113292
113625
  const names = maybeArray$1(name);
113293
113626
 
113294
- for (const filenamePath of traverseProperties(node, 'filename')) {
113627
+ for (const filenamePath of traverseProperties$1(node, 'filename')) {
113295
113628
  const {value} = filenamePath.node.value;
113296
113629
  const base = basename$1(value);
113297
113630
 
@@ -113376,7 +113709,7 @@ filesystem.moveFile = (filePath, dirPath) => {
113376
113709
  .split('/')
113377
113710
  .pop();
113378
113711
 
113379
- const newFilename = join$1(dirname, basename);
113712
+ const newFilename = join$2(dirname, basename);
113380
113713
 
113381
113714
  maybeRemoveFile(dirPath, newFilename);
113382
113715
 
@@ -113395,7 +113728,7 @@ filesystem.copyFile = (filePath, dirPath) => {
113395
113728
  .split('/')
113396
113729
  .pop();
113397
113730
 
113398
- const newFilename = join$1(dirname, basename);
113731
+ const newFilename = join$2(dirname, basename);
113399
113732
  const [hasContent, content] = getFileContent(filePath);
113400
113733
 
113401
113734
  const copiedFile = ObjectExpression$1([
@@ -113421,7 +113754,8 @@ function maybeRemoveFile(dirPath, filename) {
113421
113754
  }
113422
113755
 
113423
113756
  const dirPathFiles = getProperty$2(dirPath, 'files');
113424
- const [fileToOverwrite] = findFile$5(dirPathFiles, filename);
113757
+ const name = join$2(getFilename$4(dirPath), basename$1(filename));
113758
+ const [fileToOverwrite] = findFile$5(dirPathFiles, name);
113425
113759
 
113426
113760
  if (!fileToOverwrite)
113427
113761
  return;
@@ -113429,19 +113763,19 @@ function maybeRemoveFile(dirPath, filename) {
113429
113763
  fileToOverwrite.remove();
113430
113764
  }
113431
113765
 
113432
- const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$2('type'), StringLiteral$2(type));
113766
+ const createTypeProperty = (type) => ObjectProperty$2(StringLiteral$3('type'), StringLiteral$3(type));
113433
113767
 
113434
113768
  filesystem.createTypeProperty = createTypeProperty;
113435
113769
 
113436
- const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$2('files'), ArrayExpression$2(files));
113770
+ const createFilesProperty = (files) => ObjectProperty$2(StringLiteral$3('files'), ArrayExpression$2(files));
113437
113771
 
113438
113772
  filesystem.createFilesProperty = createFilesProperty;
113439
113773
 
113440
- const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$2('filename'), StringLiteral$2(filename));
113774
+ const createFilenameProperty = (filename) => ObjectProperty$2(StringLiteral$3('filename'), StringLiteral$3(filename));
113441
113775
 
113442
113776
  filesystem.createFilenameProperty = createFilenameProperty;
113443
113777
 
113444
- const createContentProperty = (content) => ObjectProperty$2(StringLiteral$2('content'), StringLiteral$2(content));
113778
+ const createContentProperty = (content) => ObjectProperty$2(StringLiteral$3('content'), StringLiteral$3(content));
113445
113779
 
113446
113780
  filesystem.createContentProperty = createContentProperty;
113447
113781
 
@@ -113450,7 +113784,7 @@ filesystem.createFile = (dirPath, name, content) => {
113450
113784
 
113451
113785
  const dirPathFiles = getFiles$1(dirPath);
113452
113786
  const parentFilename = getFilename$4(dirPath);
113453
- const filename = join$1(parentFilename, name);
113787
+ const filename = join$2(parentFilename, name);
113454
113788
 
113455
113789
  const typeProperty = createTypeProperty('file');
113456
113790
  const filenameProperty = createFilenameProperty(filename);
@@ -113480,7 +113814,7 @@ function getFiles$1(dirPath) {
113480
113814
  filesystem.createDirectory = (dirPath, name) => {
113481
113815
  const dirPathFiles = getFiles$1(dirPath);
113482
113816
  const parentFilename = getFilename$4(dirPath);
113483
- const filename = join$1(parentFilename, name);
113817
+ const filename = join$2(parentFilename, name);
113484
113818
 
113485
113819
  const typeProperty = createTypeProperty('directory');
113486
113820
  const filesProperty = createFilesProperty([]);
@@ -113551,7 +113885,7 @@ filesystem.start = maybeFS.start;
113551
113885
 
113552
113886
  var convertSimpleFilesystemToFilesystem = {};
113553
113887
 
113554
- const {types: types$4} = bundle;
113888
+ const {types: types$5} = bundle;
113555
113889
  const {basename, dirname} = require$$0$2;
113556
113890
  const {
113557
113891
  createDirectory,
@@ -113565,11 +113899,13 @@ const {replaceWith: replaceWith$1, getProperty: getProperty$1} = operate;
113565
113899
 
113566
113900
  const {
113567
113901
  ObjectExpression,
113568
- isArrayExpression,
113569
113902
  ArrayExpression: ArrayExpression$1,
113570
- StringLiteral: StringLiteral$1,
113903
+ StringLiteral: StringLiteral$2,
113571
113904
  ObjectProperty: ObjectProperty$1,
113572
- } = types$4;
113905
+ isArrayExpression,
113906
+ isStringLiteral,
113907
+ isTemplateLiteral,
113908
+ } = types$5;
113573
113909
 
113574
113910
  convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
113575
113911
 
@@ -113577,24 +113913,34 @@ const isDirectory = (a) => a.endsWith('/');
113577
113913
  const getType = (a) => {
113578
113914
  const type = isDirectory(a) ? 'directory' : 'file';
113579
113915
 
113580
- return ObjectProperty$1(StringLiteral$1('type'), StringLiteral$1(type));
113916
+ return ObjectProperty$1(StringLiteral$2('type'), StringLiteral$2(type));
113581
113917
  };
113582
113918
 
113583
113919
  const createFilename = (filename) => {
113584
- return ObjectProperty$1(StringLiteral$1('filename'), StringLiteral$1(filename));
113920
+ return ObjectProperty$1(StringLiteral$2('filename'), StringLiteral$2(filename));
113585
113921
  };
113586
113922
 
113587
113923
  const getFiles = (a) => {
113588
113924
  if (isDirectory(a))
113589
- return ObjectProperty$1(StringLiteral$1('files'), ArrayExpression$1([]));
113925
+ return ObjectProperty$1(StringLiteral$2('files'), ArrayExpression$1([]));
113590
113926
 
113591
113927
  return null;
113592
113928
  };
113593
113929
 
113594
113930
  const getContent = (a) => {
113595
- return ObjectProperty$1(StringLiteral$1('content'), StringLiteral$1(a));
113931
+ return ObjectProperty$1(StringLiteral$2('content'), StringLiteral$2(a));
113596
113932
  };
113597
113933
 
113934
+ function parseContent(node, path) {
113935
+ if (isStringLiteral(node))
113936
+ return node.value;
113937
+
113938
+ if (isTemplateLiteral(node))
113939
+ return btoa(node.quasis[0].value.raw);
113940
+
113941
+ throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
113942
+ }
113943
+
113598
113944
  convertSimpleFilesystemToFilesystem.fix = (path) => {
113599
113945
  const array = ArrayExpression$1([]);
113600
113946
 
@@ -113602,7 +113948,8 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
113602
113948
  if (isArrayExpression(element)) {
113603
113949
  const [nodeValue, nodeContent] = element.node.elements;
113604
113950
  const {value} = nodeValue;
113605
- const content = nodeContent.value;
113951
+
113952
+ const content = parseContent(nodeContent, element);
113606
113953
 
113607
113954
  array.elements.push(ObjectExpression([
113608
113955
  getType(value),
@@ -113612,13 +113959,18 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
113612
113959
  continue;
113613
113960
  }
113614
113961
 
113615
- const {value} = element.node;
113962
+ if (isStringLiteral(element)) {
113963
+ const {value} = element.node;
113964
+
113965
+ array.elements.push(ObjectExpression([
113966
+ getType(value),
113967
+ createFilename(noTrailingSlash(value)),
113968
+ getFiles(value),
113969
+ ].filter(Boolean)));
113970
+ continue;
113971
+ }
113616
113972
 
113617
- array.elements.push(ObjectExpression([
113618
- getType(value),
113619
- createFilename(noTrailingSlash(value)),
113620
- getFiles(value),
113621
- ].filter(Boolean)));
113973
+ throw Error(`☝️ Looks like file '${element}' has wrong type: '${element.type}' expected: 'string | array'`);
113622
113974
  }
113623
113975
 
113624
113976
  buildTree(path, array);
@@ -113651,7 +114003,7 @@ function buildTree(path, list) {
113651
114003
  const name = basename(filename);
113652
114004
  const [dirPath] = findFile$4(root, dir);
113653
114005
 
113654
- if (!dirPath)
114006
+ if (!dirPath || getFileType$1(dirPath) !== 'directory')
113655
114007
  throw Error(`☝️ Looks like directory '${dir}/' is missing`);
113656
114008
 
113657
114009
  if (type === 'directory') {
@@ -113673,7 +114025,7 @@ function check$2(filename) {
113673
114025
 
113674
114026
  var convertFilesystemToSimpleFilesystem = {};
113675
114027
 
113676
- const {types: types$3} = bundle;
114028
+ const {types: types$4} = bundle;
113677
114029
  const {replaceWith, getProperty} = operate;
113678
114030
  const {__filesystem_name: __filesystem_name$1} = json;
113679
114031
 
@@ -113684,9 +114036,9 @@ const {
113684
114036
  } = filesystem;
113685
114037
 
113686
114038
  const {
113687
- StringLiteral,
114039
+ StringLiteral: StringLiteral$1,
113688
114040
  ArrayExpression,
113689
- } = types$3;
114041
+ } = types$4;
113690
114042
 
113691
114043
  const {isArray: isArray$1} = Array;
113692
114044
  const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
@@ -113720,13 +114072,13 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
113720
114072
  for (const name of names) {
113721
114073
  if (isArray$1(name)) {
113722
114074
  list.push(ArrayExpression([
113723
- StringLiteral(name[0]),
113724
- StringLiteral(name[1]),
114075
+ StringLiteral$1(name[0]),
114076
+ StringLiteral$1(name[1]),
113725
114077
  ]));
113726
114078
  continue;
113727
114079
  }
113728
114080
 
113729
- list.push(StringLiteral(name));
114081
+ list.push(StringLiteral$1(name));
113730
114082
  }
113731
114083
 
113732
114084
  replaceWith(root, ArrayExpression(list));
@@ -114925,7 +115277,7 @@ report$3.default;
114925
115277
 
114926
115278
  var traverse$5 = {};
114927
115279
 
114928
- const {types: types$2, traverse: babelTraverse} = bundle;
115280
+ const {types: types$3, traverse: babelTraverse} = bundle;
114929
115281
 
114930
115282
  const {
114931
115283
  compare,
@@ -114934,7 +115286,7 @@ const {
114934
115286
  getTemplateValues,
114935
115287
  } = compare$5;
114936
115288
 
114937
- const {isFile, isProgram} = types$2;
115289
+ const {isFile, isProgram} = types$3;
114938
115290
  const {merge} = babelTraverse.visitors;
114939
115291
  const {entries: entries$2} = Object;
114940
115292
 
@@ -122122,7 +122474,7 @@ var addArgs = {};
122122
122474
 
122123
122475
  const {compareAny} = compare$5;
122124
122476
  const {template: template$1} = parser$6;
122125
- const {types: types$1} = bundle;
122477
+ const {types: types$2} = bundle;
122126
122478
  const {
122127
122479
  ObjectPattern,
122128
122480
  ObjectProperty,
@@ -122131,7 +122483,7 @@ const {
122131
122483
  isLabeledStatement,
122132
122484
  isObjectPattern,
122133
122485
  isCallExpression,
122134
- } = types$1;
122486
+ } = types$2;
122135
122487
 
122136
122488
  const {entries: entries$1} = Object;
122137
122489
 
@@ -122853,7 +123205,7 @@ factory.isPathValid = isPathValid;
122853
123205
  // Fixes typescript
122854
123206
  factory.default = factory;
122855
123207
 
122856
- var ignore$1 = factory;
123208
+ var ignore$2 = factory;
122857
123209
 
122858
123210
  // Windows
122859
123211
  // --------------------------------------------------------------
@@ -122882,17 +123234,17 @@ if (
122882
123234
  || isNotRelative(path);
122883
123235
  }
122884
123236
 
122885
- ignore$1.default;
123237
+ ignore$2.default;
122886
123238
 
122887
123239
  const {relative} = require$$0$2;
122888
- const ignore = ignore$1;
123240
+ const ignore$1 = ignore$2;
122889
123241
 
122890
123242
  const isNegative = (a) => !a.indexOf('!');
122891
123243
  const positive = (a) => a.replace(/^!/, '');
122892
123244
 
122893
123245
  var ignores$1 = (dirOpt, resolvedName, options = {}) => {
122894
123246
  const relativeName = relative(dirOpt, resolvedName);
122895
- const ignorer = ignore();
123247
+ const ignorer = ignore$1();
122896
123248
  const ignoreList = mergeIgnores(options.ignore || []);
122897
123249
 
122898
123250
  ignorer.add(ignoreList);
@@ -122915,6 +123267,8 @@ function mergeIgnores(ignores) {
122915
123267
 
122916
123268
  ignores$1.default;
122917
123269
 
123270
+ const {join: join$1, extname} = require$$0$2;
123271
+
122918
123272
  const {parse: parse$2, print: print$1} = parser$6;
122919
123273
  const {transform: transform$1} = transform$5;
122920
123274
  const {findPlaces: findPlaces$1} = findPlaces$2;
@@ -122928,6 +123282,7 @@ const {
122928
123282
  writeFileContent,
122929
123283
  getFilename: getFilename$1,
122930
123284
  createFile,
123285
+ removeFile,
122931
123286
  getParentDirectory: getParentDirectory$1,
122932
123287
  } = filesystem;
122933
123288
 
@@ -122946,41 +123301,46 @@ matchFiles.matchFiles = (files) => {
122946
123301
  };
122947
123302
  };
122948
123303
 
122949
- function fix$1(path, {outputFilename, matchedJS, matchedAST, plugins}) {
123304
+ function fix$1(inputFile, {dirPath, mainPath, matchInputFilename, outputFilename, matchedJS, matchedAST, plugins}) {
122950
123305
  transform$1(matchedAST, matchedJS, {
122951
123306
  plugins,
122952
123307
  });
122953
123308
 
122954
123309
  const matchedJSON = magicPrint(outputFilename, matchedAST);
123310
+ const outputFile = getOutputFile(mainPath, {
123311
+ dirPath,
123312
+ matchInputFilename,
123313
+ outputFilename,
123314
+ inputFile,
123315
+ });
122955
123316
 
122956
- writeFileContent(path, matchedJSON);
123317
+ writeFileContent(outputFile, matchedJSON);
123318
+
123319
+ if (inputFile !== outputFile)
123320
+ removeFile(inputFile);
122957
123321
  }
122958
123322
 
122959
- const createScan = (files) => (path, {push, progress, options}) => {
123323
+ const createScan = (files) => (mainPath, {push, progress, options}) => {
122960
123324
  const allFiles = [];
122961
- const cwd = getFilename$1(path);
123325
+ const cwd = getFilename$1(mainPath);
122962
123326
 
122963
123327
  for (const [filename, plugin] of entries(files)) {
122964
123328
  const [matchInputFilename, outputFilename = matchInputFilename] = parseMatcher(filename, options);
122965
- const inputFiles = findFile$1(path, matchInputFilename);
123329
+ const inputFiles = findFile$1(mainPath, matchInputFilename);
122966
123330
 
122967
123331
  for (const inputFile of inputFiles) {
122968
123332
  const dirPath = getParentDirectory$1(inputFile);
122969
123333
  const inputFilename = getFilename$1(inputFile);
122970
- const outputFile = getOutputFile(path, {
122971
- dirPath,
122972
- matchInputFilename,
122973
- outputFilename,
122974
- inputFile,
122975
- });
122976
123334
 
122977
123335
  if (ignores(cwd, inputFilename, options))
122978
123336
  continue;
122979
123337
 
122980
123338
  allFiles.push({
123339
+ mainPath,
123340
+ dirPath,
123341
+ matchInputFilename,
122981
123342
  plugin,
122982
123343
  inputFile,
122983
- outputFile,
122984
123344
  inputFilename,
122985
123345
  outputFilename,
122986
123346
  });
@@ -122989,7 +123349,17 @@ const createScan = (files) => (path, {push, progress, options}) => {
122989
123349
 
122990
123350
  const n = allFiles.length;
122991
123351
 
122992
- for (const [i, {inputFile, outputFile, inputFilename, outputFilename, plugin}] of allFiles.entries()) {
123352
+ for (const [i, current] of allFiles.entries()) {
123353
+ const {
123354
+ dirPath,
123355
+ matchInputFilename,
123356
+ inputFile,
123357
+ inputFilename,
123358
+ outputFilename,
123359
+ plugin,
123360
+ mainPath,
123361
+ } = current;
123362
+
122993
123363
  progress({
122994
123364
  i,
122995
123365
  n,
@@ -123012,7 +123382,11 @@ const createScan = (files) => (path, {push, progress, options}) => {
123012
123382
 
123013
123383
  const {message} = places[0];
123014
123384
 
123015
- push(outputFile, {
123385
+ push(inputFile, {
123386
+ dirPath,
123387
+ mainPath,
123388
+ matchInputFilename,
123389
+
123016
123390
  outputFilename,
123017
123391
  message,
123018
123392
  plugins,
@@ -123063,7 +123437,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
123063
123437
  if (matchInputFilename === outputFilename)
123064
123438
  return inputFile;
123065
123439
 
123066
- const [outputFile] = findFile$1(dirPath, outputFilename);
123440
+ const name = join$1(getFilename$1(dirPath), outputFilename);
123441
+ const [outputFile] = findFile$1(dirPath, name);
123067
123442
 
123068
123443
  if (outputFile)
123069
123444
  return outputFile;
@@ -123072,14 +123447,16 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
123072
123447
  }
123073
123448
 
123074
123449
  function parseMatcher(matcher, options) {
123075
- for (const [name, value] of entries(options)) {
123076
- if (name === 'filename') {
123077
- const [name, ext] = value.split('.');
123078
-
123079
- matcher = matcher.replaceAll(`__name`, name);
123080
- matcher = matcher.replaceAll(`__ext`, ext);
123081
- }
123082
- }
123450
+ const {filename} = options;
123451
+
123452
+ if (!filename)
123453
+ return matcher.split(' -> ');
123454
+
123455
+ const ext = extname(filename);
123456
+ const shortName = filename.replace(ext, '');
123457
+
123458
+ matcher = matcher.replaceAll(`__name`, shortName);
123459
+ matcher = matcher.replaceAll(`__ext`, ext);
123083
123460
 
123084
123461
  return matcher.split(' -> ');
123085
123462
  }
@@ -123161,6 +123538,111 @@ function findUpPackage(file) {
123161
123538
  return packageJSON;
123162
123539
  }
123163
123540
 
123541
+ var ignore = {};
123542
+
123543
+ const {types: types$1} = bundle;
123544
+ const {traverseProperties} = operate;
123545
+ const {StringLiteral} = types$1;
123546
+ const getValue = ({value}) => value;
123547
+
123548
+ ignore.ignore = (type, {name, property, list}) => {
123549
+ const [, collector] = type.split(/\(|\)/);
123550
+
123551
+ return {
123552
+ report: createReport(name),
123553
+ match: createMatch({
123554
+ type,
123555
+ property,
123556
+ collector,
123557
+ list,
123558
+ }),
123559
+ replace: createReplace({
123560
+ type,
123561
+ property,
123562
+ collector,
123563
+ list,
123564
+ }),
123565
+ };
123566
+ };
123567
+
123568
+ const createReport = (name) => () => `Add dotfiles to '${name}'`;
123569
+
123570
+ const createMatch = ({type, property, collector, list}) => ({options}) => {
123571
+ const {dismiss = []} = options;
123572
+ const newNames = filterNames(list, dismiss);
123573
+
123574
+ return {
123575
+ [type]: (vars) => {
123576
+ const elements = parseElements(vars, {
123577
+ property,
123578
+ collector,
123579
+ });
123580
+
123581
+ if (!elements)
123582
+ return false;
123583
+
123584
+ const list = elements.map(getValue);
123585
+
123586
+ for (const name of newNames) {
123587
+ if (!list.includes(name))
123588
+ return true;
123589
+ }
123590
+
123591
+ return false;
123592
+ },
123593
+ };
123594
+ };
123595
+
123596
+ const createReplace = ({type, property, collector, list}) => ({options}) => {
123597
+ const {dismiss = []} = options;
123598
+ const newNames = filterNames(list, dismiss);
123599
+
123600
+ return {
123601
+ [type]: (vars, path) => {
123602
+ const elements = parseElements(vars, {
123603
+ property,
123604
+ collector,
123605
+ });
123606
+
123607
+ const list = elements.map(getValue);
123608
+
123609
+ for (const name of newNames) {
123610
+ if (!list.includes(name))
123611
+ elements.push(StringLiteral(name));
123612
+ }
123613
+
123614
+ return path;
123615
+ },
123616
+ };
123617
+ };
123618
+
123619
+ function filterNames(names, dismiss) {
123620
+ const newNames = [];
123621
+
123622
+ for (const name of names) {
123623
+ if (dismiss.includes(name))
123624
+ continue;
123625
+
123626
+ newNames.push(name);
123627
+ }
123628
+
123629
+ return newNames;
123630
+ }
123631
+
123632
+ function parseElements(vars, {property, collector}) {
123633
+ const node = vars[collector];
123634
+
123635
+ if (!property)
123636
+ return node.elements;
123637
+
123638
+ const [prop] = traverseProperties(node, property);
123639
+
123640
+ if (!prop)
123641
+ return null;
123642
+
123643
+ return prop.node.value.elements;
123644
+ }
123645
+
123164
123646
  const {codeFrameColumns} = bundle;
123165
123647
 
123166
123648
  var codeframe = ({source, error, highlightCode = true}) => {
@@ -123317,6 +123799,7 @@ var operator = putout.exports.operator = {
123317
123799
  ...filesystem,
123318
123800
  ...matchFiles,
123319
123801
  ...renameFiles,
123802
+ ...ignore,
123320
123803
  };
123321
123804
 
123322
123805
  putout.exports.ignores = ignores$1;