@putout/bundle 5.2.5 → 5.3.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.
@@ -23,7 +23,7 @@ var lookup = [];
23
23
  var revLookup = [];
24
24
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
25
25
  var inited = false;
26
- function init$3 () {
26
+ function init$1 () {
27
27
  inited = true;
28
28
  var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
29
29
  for (var i = 0, len = code.length; i < len; ++i) {
@@ -37,7 +37,7 @@ function init$3 () {
37
37
 
38
38
  function toByteArray (b64) {
39
39
  if (!inited) {
40
- init$3();
40
+ init$1();
41
41
  }
42
42
  var i, j, l, tmp, placeHolders, arr;
43
43
  var len = b64.length;
@@ -96,7 +96,7 @@ function encodeChunk (uint8, start, end) {
96
96
 
97
97
  function fromByteArray (uint8) {
98
98
  if (!inited) {
99
- init$3();
99
+ init$1();
100
100
  }
101
101
  var tmp;
102
102
  var len = uint8.length;
@@ -2701,7 +2701,7 @@ __export(lib_exports, {
2701
2701
  TSUnionType: () => TSUnionType$1,
2702
2702
  TSUnknownKeyword: () => TSUnknownKeyword$1,
2703
2703
  TSVoidKeyword: () => TSVoidKeyword$1,
2704
- TYPES: () => TYPES$3,
2704
+ TYPES: () => TYPES$4,
2705
2705
  TYPESCRIPT_TYPES: () => TYPESCRIPT_TYPES,
2706
2706
  TaggedTemplateExpression: () => TaggedTemplateExpression$1,
2707
2707
  TemplateElement: () => TemplateElement,
@@ -3231,7 +3231,7 @@ __export(lib_exports, {
3231
3231
  isExportAllDeclaration: () => isExportAllDeclaration,
3232
3232
  isExportDeclaration: () => isExportDeclaration$5,
3233
3233
  isExportDefaultDeclaration: () => isExportDefaultDeclaration$1,
3234
- isExportDefaultSpecifier: () => isExportDefaultSpecifier$1,
3234
+ isExportDefaultSpecifier: () => isExportDefaultSpecifier$2,
3235
3235
  isExportNamedDeclaration: () => isExportNamedDeclaration$3,
3236
3236
  isExportNamespaceSpecifier: () => isExportNamespaceSpecifier$1,
3237
3237
  isExportSpecifier: () => isExportSpecifier$1,
@@ -3315,7 +3315,7 @@ __export(lib_exports, {
3315
3315
  isNumberLiteralTypeAnnotation: () => isNumberLiteralTypeAnnotation,
3316
3316
  isNumberTypeAnnotation: () => isNumberTypeAnnotation,
3317
3317
  isNumericLiteral: () => isNumericLiteral$1,
3318
- isObjectExpression: () => isObjectExpression$c,
3318
+ isObjectExpression: () => isObjectExpression$d,
3319
3319
  isObjectMember: () => isObjectMember,
3320
3320
  isObjectMethod: () => isObjectMethod$1,
3321
3321
  isObjectPattern: () => isObjectPattern$3,
@@ -3349,7 +3349,7 @@ __export(lib_exports, {
3349
3349
  isReturnStatement: () => isReturnStatement$4,
3350
3350
  isScopable: () => isScopable,
3351
3351
  isScope: () => isScope,
3352
- isSequenceExpression: () => isSequenceExpression$2,
3352
+ isSequenceExpression: () => isSequenceExpression$3,
3353
3353
  isSpecifierDefault: () => isSpecifierDefault,
3354
3354
  isSpreadElement: () => isSpreadElement$4,
3355
3355
  isSpreadProperty: () => isSpreadProperty,
@@ -3437,7 +3437,7 @@ __export(lib_exports, {
3437
3437
  isTSVoidKeyword: () => isTSVoidKeyword,
3438
3438
  isTaggedTemplateExpression: () => isTaggedTemplateExpression,
3439
3439
  isTemplateElement: () => isTemplateElement$4,
3440
- isTemplateLiteral: () => isTemplateLiteral$4,
3440
+ isTemplateLiteral: () => isTemplateLiteral$5,
3441
3441
  isTerminatorless: () => isTerminatorless,
3442
3442
  isThisExpression: () => isThisExpression,
3443
3443
  isThisTypeAnnotation: () => isThisTypeAnnotation,
@@ -5464,7 +5464,7 @@ function isProgram$5(node, opts) {
5464
5464
  return opts == null || shallowEqual(node, opts);
5465
5465
  }
5466
5466
 
5467
- function isObjectExpression$c(node, opts) {
5467
+ function isObjectExpression$d(node, opts) {
5468
5468
  if (!node)
5469
5469
  return false;
5470
5470
 
@@ -5514,7 +5514,7 @@ function isReturnStatement$4(node, opts) {
5514
5514
  return opts == null || shallowEqual(node, opts);
5515
5515
  }
5516
5516
 
5517
- function isSequenceExpression$2(node, opts) {
5517
+ function isSequenceExpression$3(node, opts) {
5518
5518
  if (!node)
5519
5519
  return false;
5520
5520
 
@@ -5874,7 +5874,7 @@ function isTemplateElement$4(node, opts) {
5874
5874
  return opts == null || shallowEqual(node, opts);
5875
5875
  }
5876
5876
 
5877
- function isTemplateLiteral$4(node, opts) {
5877
+ function isTemplateLiteral$5(node, opts) {
5878
5878
  if (!node)
5879
5879
  return false;
5880
5880
 
@@ -6884,7 +6884,7 @@ function isDoExpression(node, opts) {
6884
6884
  return opts == null || shallowEqual(node, opts);
6885
6885
  }
6886
6886
 
6887
- function isExportDefaultSpecifier$1(node, opts) {
6887
+ function isExportDefaultSpecifier$2(node, opts) {
6888
6888
  if (!node)
6889
6889
  return false;
6890
6890
 
@@ -13415,7 +13415,7 @@ for (const {types: types2, set} of allExpandedTypes) {
13415
13415
  }
13416
13416
  }
13417
13417
 
13418
- var TYPES$3 = [].concat(Object.keys(VISITOR_KEYS), Object.keys(FLIPPED_ALIAS_KEYS), Object.keys(DEPRECATED_KEYS));
13418
+ var TYPES$4 = [].concat(Object.keys(VISITOR_KEYS), Object.keys(FLIPPED_ALIAS_KEYS), Object.keys(DEPRECATED_KEYS));
13419
13419
 
13420
13420
  function validate$1$1(node, key, val) {
13421
13421
  if (!node)
@@ -19351,7 +19351,7 @@ function getNameFromLiteralId(id) {
19351
19351
  return `/${id.pattern}/${id.flags}`;
19352
19352
  }
19353
19353
 
19354
- if (isTemplateLiteral$4(id)) {
19354
+ if (isTemplateLiteral$5(id)) {
19355
19355
  return id.quasis
19356
19356
  .map((quasi) => quasi.value.raw)
19357
19357
  .join('');
@@ -38014,7 +38014,7 @@ var Buffer2 = class {
38014
38014
  this._last = char;
38015
38015
 
38016
38016
  if (char === -1) {
38017
- const indent = repeat > 64 ? this._indentChar.repeat(repeat) : spaceIndents[repeat / 2];
38017
+ const indent = repeat >= 64 ? this._indentChar.repeat(repeat) : spaceIndents[repeat / 2];
38018
38018
  this._str += indent;
38019
38019
  } else {
38020
38020
  this._str += repeat > 1 ? String
@@ -49974,7 +49974,7 @@ var methods = {
49974
49974
  };
49975
49975
 
49976
49976
  Object.assign(NodePath_Final.prototype, methods);
49977
- for (const type of TYPES$3) {
49977
+ for (const type of TYPES$4) {
49978
49978
  const typeKey = `is${type}`;
49979
49979
  const fn = lib_exports[typeKey];
49980
49980
 
@@ -49993,8 +49993,8 @@ for (const type of Object.keys(virtualTypes)) {
49993
49993
  if (type.startsWith('_'))
49994
49994
  continue;
49995
49995
 
49996
- if (!TYPES$3.includes(type))
49997
- TYPES$3.push(type);
49996
+ if (!TYPES$4.includes(type))
49997
+ TYPES$4.push(type);
49998
49998
  }
49999
49999
 
50000
50000
  function _call(fns) {
@@ -50311,7 +50311,7 @@ traverse3.hasType = function(tree, type, denylistTypes) {
50311
50311
  };
50312
50312
  traverse3.cache = cache;
50313
50313
 
50314
- const TYPES$2 = {
50314
+ const TYPES$3 = {
50315
50315
  TOKEN: 'Token',
50316
50316
  NEWLINE: 'Newline',
50317
50317
  SPLITTER: 'Splitter',
@@ -50331,7 +50331,7 @@ const {
50331
50331
  isVariableDeclaration: isVariableDeclaration$4,
50332
50332
  isMemberExpression: isMemberExpression$8,
50333
50333
  isArrayExpression: isArrayExpression$9,
50334
- isObjectExpression: isObjectExpression$b,
50334
+ isObjectExpression: isObjectExpression$c,
50335
50335
  isLabeledStatement: isLabeledStatement$1,
50336
50336
  } = lib_exports;
50337
50337
 
@@ -50395,10 +50395,10 @@ function isStringAndIdentifier([a, b]) {
50395
50395
  const checkObject = (elements) => {
50396
50396
  let a = elements.at(-1);
50397
50397
 
50398
- if (!isObjectExpression$b(a))
50398
+ if (!isObjectExpression$c(a))
50399
50399
  a = elements.at(-2);
50400
50400
 
50401
- if (!isObjectExpression$b(a))
50401
+ if (!isObjectExpression$c(a))
50402
50402
  return false;
50403
50403
 
50404
50404
  return a.node.properties.length;
@@ -51685,7 +51685,7 @@ function printUnary(name, {print}) {
51685
51685
  }
51686
51686
 
51687
51687
  const {
51688
- isObjectExpression: isObjectExpression$a,
51688
+ isObjectExpression: isObjectExpression$b,
51689
51689
  isArrowFunctionExpression: isArrowFunctionExpression$1,
51690
51690
  } = lib_exports;
51691
51691
 
@@ -51740,7 +51740,7 @@ const OptionalMemberExpression = maybeParens((path, {print, maybe}) => {
51740
51740
  });
51741
51741
 
51742
51742
  const isObjectInsideArrow = ({node, parentPath}) => {
51743
- if (!isObjectExpression$a(node.object))
51743
+ if (!isObjectExpression$b(node.object))
51744
51744
  return false;
51745
51745
 
51746
51746
  return isArrowFunctionExpression$1(parentPath);
@@ -52011,7 +52011,7 @@ function maybePrintBrace(brace, path, printer, semantics) {
52011
52011
 
52012
52012
  const {isArrayExpression: isArrayExpression$8} = lib_exports;
52013
52013
 
52014
- const TYPES$1 = [
52014
+ const TYPES$2 = [
52015
52015
  'NullLiteral',
52016
52016
  'NumericLiteral',
52017
52017
  'BigIntLiteral',
@@ -52028,7 +52028,7 @@ const isInsideTuple = (path) => {
52028
52028
  if (second !== path.node)
52029
52029
  return false;
52030
52030
 
52031
- return TYPES$1.includes(first.type);
52031
+ return TYPES$2.includes(first.type);
52032
52032
  };
52033
52033
 
52034
52034
  const {
@@ -52225,7 +52225,7 @@ function isParens$1(path) {
52225
52225
 
52226
52226
  const {
52227
52227
  isStringLiteral: isStringLiteral$8,
52228
- isTemplateLiteral: isTemplateLiteral$3,
52228
+ isTemplateLiteral: isTemplateLiteral$4,
52229
52229
  isBinaryExpression,
52230
52230
  } = lib_exports;
52231
52231
 
@@ -52233,7 +52233,7 @@ const isStringLike = (a) => {
52233
52233
  if (isStringLiteral$8(a))
52234
52234
  return true;
52235
52235
 
52236
- return isTemplateLiteral$3(a);
52236
+ return isTemplateLiteral$4(a);
52237
52237
  };
52238
52238
 
52239
52239
  const isConcatenation = (path) => {
@@ -52308,7 +52308,7 @@ const wrongShorthand = ({computed, isAssign, keyPath, valuePath}) => {
52308
52308
 
52309
52309
  const {
52310
52310
  isMemberExpression: isMemberExpression$5,
52311
- isSequenceExpression: isSequenceExpression$1,
52311
+ isSequenceExpression: isSequenceExpression$2,
52312
52312
  } = lib_exports;
52313
52313
 
52314
52314
  const maybeTypeAnnotation = (visit) => (path, printer, semantics) => {
@@ -52323,7 +52323,7 @@ function maybePrintTypeAnnotation(path, printer) {
52323
52323
  const {typeAnnotation} = node;
52324
52324
  const {write, traverse} = printer;
52325
52325
 
52326
- if (isSequenceExpression$1(parentPath))
52326
+ if (isSequenceExpression$2(parentPath))
52327
52327
  return;
52328
52328
 
52329
52329
  if (isMemberExpression$5(parentPath))
@@ -52339,7 +52339,7 @@ function maybePrintTypeAnnotation(path, printer) {
52339
52339
  const {
52340
52340
  isAssignmentPattern: isAssignmentPattern$4,
52341
52341
  isArrayExpression: isArrayExpression$5,
52342
- isObjectExpression: isObjectExpression$9,
52342
+ isObjectExpression: isObjectExpression$a,
52343
52343
  isIdentifier: isIdentifier$d,
52344
52344
  } = lib_exports;
52345
52345
 
@@ -52370,7 +52370,7 @@ function isLongAssignPattern(path, semantics) {
52370
52370
  }
52371
52371
 
52372
52372
  function isComplexObject(node) {
52373
- if (!isObjectExpression$9(node))
52373
+ if (!isObjectExpression$a(node))
52374
52374
  return false;
52375
52375
 
52376
52376
  return node.properties.length;
@@ -52452,7 +52452,7 @@ const {
52452
52452
  isAssignmentPattern: isAssignmentPattern$2,
52453
52453
  isObjectPattern: isObjectPattern$2,
52454
52454
  isVariableDeclaration: isVariableDeclaration$3,
52455
- isObjectExpression: isObjectExpression$8,
52455
+ isObjectExpression: isObjectExpression$9,
52456
52456
  } = lib_exports;
52457
52457
 
52458
52458
  function hasObjectPattern(properties) {
@@ -52491,7 +52491,7 @@ function hasAssignObject(path, maxPropertiesLengthInOneLine) {
52491
52491
  for (const prop of properties) {
52492
52492
  const {value} = prop.node;
52493
52493
 
52494
- if (isAssignmentPattern$2(value) && isObjectExpression$8(value.right))
52494
+ if (isAssignmentPattern$2(value) && isObjectExpression$9(value.right))
52495
52495
  return n > 1 || maxPropertiesLengthInOneLine <= value.left;
52496
52496
  }
52497
52497
 
@@ -52614,7 +52614,7 @@ function hasComputed(properties) {
52614
52614
  }
52615
52615
 
52616
52616
  const {
52617
- isObjectExpression: isObjectExpression$7,
52617
+ isObjectExpression: isObjectExpression$8,
52618
52618
  isAssignmentPattern,
52619
52619
  isForOfStatement,
52620
52620
  isFunction: isFunction$6,
@@ -52667,7 +52667,7 @@ function isPrevAssignObject(path) {
52667
52667
 
52668
52668
  const {right} = prev.node.value;
52669
52669
 
52670
- return isObjectExpression$7(right);
52670
+ return isObjectExpression$8(right);
52671
52671
  }
52672
52672
 
52673
52673
  function isNextAssignObject(path) {
@@ -52681,10 +52681,10 @@ function isNextAssignObject(path) {
52681
52681
 
52682
52682
  const {right} = next.node.value;
52683
52683
 
52684
- return isObjectExpression$7(right);
52684
+ return isObjectExpression$8(right);
52685
52685
  }
52686
52686
 
52687
- const {isObjectExpression: isObjectExpression$6} = lib_exports;
52687
+ const {isObjectExpression: isObjectExpression$7} = lib_exports;
52688
52688
 
52689
52689
  const ObjectPattern = {
52690
52690
  print: maybeTypeAnnotation((path, printer, semantics) => {
@@ -52764,7 +52764,7 @@ const ObjectPattern = {
52764
52764
 
52765
52765
  const {right} = valuePath.node;
52766
52766
 
52767
- if (i && !isPrevAssign(property) && !isInsideForOf(path) && isObjectExpression$6(right)) {
52767
+ if (i && !isPrevAssign(property) && !isInsideForOf(path) && isObjectExpression$7(right)) {
52768
52768
  print(',');
52769
52769
  print.newline();
52770
52770
  continue;
@@ -52987,7 +52987,7 @@ const {
52987
52987
  isTemplateElement: isTemplateElement$3,
52988
52988
  isRegExpLiteral: isRegExpLiteral$1,
52989
52989
  isClassMethod,
52990
- isTemplateLiteral: isTemplateLiteral$2,
52990
+ isTemplateLiteral: isTemplateLiteral$3,
52991
52991
  isJSXText: isJSXText$3,
52992
52992
  isJSXAttribute: isJSXAttribute$2,
52993
52993
  isJSXIdentifier: isJSXIdentifier$2,
@@ -53008,7 +53008,7 @@ function extract(node) {
53008
53008
  if (isRegExpLiteral$1(node))
53009
53009
  return node.pattern;
53010
53010
 
53011
- if (isTemplateLiteral$2(node))
53011
+ if (isTemplateLiteral$3(node))
53012
53012
  return extract(node.quasis[0]);
53013
53013
 
53014
53014
  if (isLiteral$2(node))
@@ -53345,9 +53345,7 @@ const setLiteralValue = (path, newValue) => {
53345
53345
  const node = path.node || path;
53346
53346
 
53347
53347
  if (isNumericLiteral(node)) {
53348
- node.value = newValue;
53349
- node.raw = newValue;
53350
-
53348
+ setNumericLiteral(node, newValue);
53351
53349
  return;
53352
53350
  }
53353
53351
 
@@ -53355,6 +53353,17 @@ const setLiteralValue = (path, newValue) => {
53355
53353
  setStringLiteral(node, newValue);
53356
53354
  };
53357
53355
 
53356
+ function setNumericLiteral(node, newValue) {
53357
+ const raw = String(newValue);
53358
+
53359
+ node.value = newValue;
53360
+ node.raw = raw;
53361
+ node.extra.rawValue = newValue;
53362
+ node.extra.raw = raw;
53363
+
53364
+ return;
53365
+ }
53366
+
53358
53367
  function setStringLiteral(node, newValue) {
53359
53368
  const {
53360
53369
  raw,
@@ -53409,13 +53418,13 @@ function isRequire$1(path) {
53409
53418
 
53410
53419
  const {
53411
53420
  isCallExpression: isCallExpression$6,
53412
- isObjectExpression: isObjectExpression$5,
53421
+ isObjectExpression: isObjectExpression$6,
53413
53422
  } = lib_exports;
53414
53423
 
53415
53424
  const nodeOrPath = (path) => path.node || path;
53416
53425
 
53417
53426
  function getNode$1(path) {
53418
- if (!isObjectExpression$5(path))
53427
+ if (!isObjectExpression$6(path))
53419
53428
  return nodeOrPath(path);
53420
53429
 
53421
53430
  if (isCallExpression$6(path.parentPath))
@@ -53470,7 +53479,7 @@ const collect = ({name, collector}) => (path) => {
53470
53479
  };
53471
53480
 
53472
53481
  const {
53473
- isObjectExpression: isObjectExpression$4,
53482
+ isObjectExpression: isObjectExpression$5,
53474
53483
  isObjectPattern: isObjectPattern$1,
53475
53484
  } = lib_exports;
53476
53485
 
@@ -53496,7 +53505,7 @@ const getProperties = (path, names) => {
53496
53505
  };
53497
53506
 
53498
53507
  const getProperty = (path, name) => {
53499
- if (!isObjectExpression$4(path) && !isObjectPattern$1(path))
53508
+ if (!isObjectExpression$5(path) && !isObjectPattern$1(path))
53500
53509
  throw Error(`☝️Looks like path is not 'ObjectExpression | ObjectPattern', but: '${path.type}' for path: ${path}`);
53501
53510
 
53502
53511
  const propertyPaths = path.get(`properties`);
@@ -53583,7 +53592,7 @@ const toExpression = (el) => {
53583
53592
  return toStatement(el);
53584
53593
  };
53585
53594
 
53586
- const {isSequenceExpression} = lib_exports;
53595
+ const {isSequenceExpression: isSequenceExpression$1} = lib_exports;
53587
53596
 
53588
53597
  const replaceWithMultiple = (path, nodes) => {
53589
53598
  const {node} = path;
@@ -53609,7 +53618,7 @@ const replaceWithMultiple = (path, nodes) => {
53609
53618
  if (!newPath.length)
53610
53619
  return newPath;
53611
53620
 
53612
- if (!leadingComments && !isSequenceExpression(path))
53621
+ if (!leadingComments && !isSequenceExpression$1(path))
53613
53622
  delete newPath[0].node.leadingComments;
53614
53623
 
53615
53624
  newPath[0].node.comments = comments || parentComments;
@@ -53743,7 +53752,7 @@ const isESM = (path) => {
53743
53752
  };
53744
53753
 
53745
53754
  const {
53746
- isObjectExpression: isObjectExpression$3,
53755
+ isObjectExpression: isObjectExpression$4,
53747
53756
  isArrayExpression: isArrayExpression$3,
53748
53757
  isObjectProperty: isObjectProperty$1,
53749
53758
  isCallExpression: isCallExpression$5,
@@ -53774,9 +53783,9 @@ const isSimpleAndCall = ([a, b]) => {
53774
53783
  };
53775
53784
 
53776
53785
  const isBooleanAndSimple = ([a, b]) => isBooleanLiteral$1(a) && isSimple(b);
53777
- const isBooleanAndObject = ([a, b]) => isBooleanLiteral$1(a) && isObjectExpression$3(b);
53786
+ const isBooleanAndObject = ([a, b]) => isBooleanLiteral$1(a) && isObjectExpression$4(b);
53778
53787
  const isNullAndSimple = ([a, b]) => isNullLiteral(a) && isSimple(b);
53779
- const isSimpleAndObject = ([a, b]) => isSimple(a) && isObjectExpression$3(b);
53788
+ const isSimpleAndObject = ([a, b]) => isSimple(a) && isObjectExpression$4(b);
53780
53789
  const ONE_LINE = false;
53781
53790
  const MULTI_LINE = true;
53782
53791
 
@@ -53810,7 +53819,7 @@ const isMultiLine = (path, {elements, maxElementsInOneLine, maxElementLengthInOn
53810
53819
  if (elements.length > maxElementsInOneLine && isStringLiteral$6(first))
53811
53820
  return MULTI_LINE;
53812
53821
 
53813
- if (elements.length > 3 && !isObjectExpression$3(first))
53822
+ if (elements.length > 3 && !isObjectExpression$4(first))
53814
53823
  return MULTI_LINE;
53815
53824
 
53816
53825
  if (isSimpleAndNotEmptyObject(elements))
@@ -54031,7 +54040,7 @@ const isStringAndObject = (elements) => {
54031
54040
  const first = elements.at(0);
54032
54041
  const last = elements.at(-1);
54033
54042
 
54034
- return isStringLiteral$6(first) && isObjectExpression$3(last);
54043
+ return isStringLiteral$6(first) && isObjectExpression$4(last);
54035
54044
  };
54036
54045
 
54037
54046
  const isCurrentNewLine = (path) => {
@@ -54044,10 +54053,25 @@ const isCurrentNewLine = (path) => {
54044
54053
  const {
54045
54054
  isStringLiteral: isStringLiteral$5,
54046
54055
  isArrayExpression: isArrayExpression$2,
54056
+ isObjectExpression: isObjectExpression$3,
54057
+ isTemplateLiteral: isTemplateLiteral$2,
54047
54058
  } = lib_exports;
54048
54059
 
54049
54060
  const isInsideArray = (path) => path.parentPath.isArrayExpression();
54050
54061
 
54062
+ const isObjectAfterString = ([first, second]) => {
54063
+ if (!first || !second)
54064
+ return false;
54065
+
54066
+ if (!isObjectExpression$3(second))
54067
+ return false;
54068
+
54069
+ if (isStringLiteral$5(first))
54070
+ return true;
54071
+
54072
+ return isTemplateLiteral$2(first);
54073
+ };
54074
+
54051
54075
  const isArrayIndented = (path) => {
54052
54076
  const elements = path.get('elements');
54053
54077
 
@@ -54056,6 +54080,9 @@ const isArrayIndented = (path) => {
54056
54080
 
54057
54081
  const [first] = elements;
54058
54082
 
54083
+ if (isObjectAfterString(elements))
54084
+ return false;
54085
+
54059
54086
  return !isTwoLongStrings(elements) || !isInsideArray(path) && isIndented(first);
54060
54087
  };
54061
54088
 
@@ -54999,8 +55026,42 @@ const WhileStatement = {
54999
55026
  },
55000
55027
  };
55001
55028
 
55002
- const ExportAllDeclaration = (path, {print}) => {
55029
+ const ImportAttribute = (path, {print}) => {
55030
+ print('__key');
55031
+ print(':');
55032
+ print.space();
55033
+ print('__value');
55034
+ print(',');
55035
+ };
55036
+
55037
+ const printAttributes = (path, {write, traverse, indent}) => {
55038
+ const attributes = path.get('attributes');
55039
+
55040
+ if (!attributes.length)
55041
+ return;
55042
+
55043
+ write.space();
55044
+ write('with');
55045
+ write.space();
55046
+
55047
+ write('{');
55048
+ write.breakline();
55049
+ indent.inc();
55050
+
55051
+ for (const attr of attributes) {
55052
+ indent();
55053
+ traverse(attr);
55054
+ write.newline();
55055
+ }
55056
+
55057
+ indent.dec();
55058
+ write('}');
55059
+ };
55060
+
55061
+ const ExportAllDeclaration = (path, printer) => {
55062
+ const {print} = printer;
55003
55063
  const {exportKind} = path.node;
55064
+
55004
55065
  print('export ');
55005
55066
 
55006
55067
  if (exportKind === 'type')
@@ -55008,6 +55069,7 @@ const ExportAllDeclaration = (path, {print}) => {
55008
55069
 
55009
55070
  print('* from ');
55010
55071
  print('__source');
55072
+ printAttributes(path, printer);
55011
55073
  print(';');
55012
55074
  print.newline();
55013
55075
  };
@@ -55016,7 +55078,7 @@ const {
55016
55078
  isExportNamespaceSpecifier,
55017
55079
  isVariableDeclaration: isVariableDeclaration$1,
55018
55080
  isExportNamedDeclaration: isExportNamedDeclaration$1,
55019
- isExportDefaultSpecifier,
55081
+ isExportDefaultSpecifier: isExportDefaultSpecifier$1,
55020
55082
  } = lib_exports;
55021
55083
 
55022
55084
  const isDeclarationNewline = (path) => isMarkedAfter(path.get('declaration'));
@@ -55060,7 +55122,14 @@ const ExportNamedDeclaration = {
55060
55122
  before(path, {print}) {
55061
55123
  print.linebreak();
55062
55124
  },
55063
- print(path, {print, traverse, indent, maybe}, semantics) {
55125
+ print(path, printer, semantics) {
55126
+ const {
55127
+ print,
55128
+ traverse,
55129
+ indent,
55130
+ maybe,
55131
+ } = printer;
55132
+
55064
55133
  const {trailingComma} = semantics;
55065
55134
  const {exportKind} = path.node;
55066
55135
  const specifiers = path.get('specifiers');
@@ -55078,6 +55147,7 @@ const ExportNamedDeclaration = {
55078
55147
  print(specifiers[0]);
55079
55148
  print(' from ');
55080
55149
  print('__source');
55150
+ printAttributes(path, printer);
55081
55151
  print(';');
55082
55152
  maybe.print.newline(!isLast$2(path));
55083
55153
 
@@ -55094,10 +55164,10 @@ const ExportNamedDeclaration = {
55094
55164
 
55095
55165
  if (!specifiers.length) {
55096
55166
  print('{}');
55097
- } else if (isExportDefaultSpecifier(first) && !rest.length) {
55167
+ } else if (isExportDefaultSpecifier$1(first) && !rest.length) {
55098
55168
  traverse(first);
55099
55169
  } else {
55100
- if (isExportDefaultSpecifier(first)) {
55170
+ if (isExportDefaultSpecifier$1(first)) {
55101
55171
  traverse(first);
55102
55172
  print(',');
55103
55173
  print.space();
@@ -55138,6 +55208,7 @@ const ExportNamedDeclaration = {
55138
55208
  if (exists(source)) {
55139
55209
  print(' from ');
55140
55210
  traverse(source);
55211
+ printAttributes(path, printer);
55141
55212
  }
55142
55213
 
55143
55214
  print(';');
@@ -55231,37 +55302,6 @@ var parseImportSpecifiers_1 = (specifiers) => {
55231
55302
  };
55232
55303
  };
55233
55304
 
55234
- const ImportAttribute = (path, {print}) => {
55235
- print('__key');
55236
- print(':');
55237
- print.space();
55238
- print('__value');
55239
- print(',');
55240
- };
55241
-
55242
- const printAttributes = (path, keyword, {write, traverse, indent}) => {
55243
- const attributes = path.get('attributes');
55244
-
55245
- if (!attributes.length)
55246
- return;
55247
-
55248
- write(` ${keyword}`);
55249
- write.space();
55250
-
55251
- write('{');
55252
- write.breakline();
55253
- indent.inc();
55254
-
55255
- for (const attr of attributes) {
55256
- indent();
55257
- traverse(attr);
55258
- write.newline();
55259
- }
55260
-
55261
- indent.dec();
55262
- write('}');
55263
- };
55264
-
55265
55305
  const {isExportDeclaration: isExportDeclaration$3} = lib_exports;
55266
55306
 
55267
55307
  const printTrailingCommentLine = (path, printer, semantics, {printComment}) => {
@@ -55364,7 +55404,7 @@ const ImportDeclaration = {
55364
55404
  print.space();
55365
55405
 
55366
55406
  print('__source');
55367
- printAttributes(path, 'with', printer);
55407
+ printAttributes(path, printer);
55368
55408
 
55369
55409
  print(';');
55370
55410
 
@@ -56550,20 +56590,20 @@ const maybeEscape = (value, {escapeDoubleQuote, escapeSingleQuote}) => {
56550
56590
  };
56551
56591
 
56552
56592
  const escape$1 = (list, {slash, quote}) => {
56553
- const res = [];
56593
+ const result = [];
56554
56594
 
56555
56595
  for (const [index, char] of list.entries()) {
56556
56596
  const prev = list[index - 1];
56557
56597
 
56558
56598
  if (char === quote && prev !== slash) {
56559
- res.push(`${slash}${char}`);
56599
+ result.push(`${slash}${char}`);
56560
56600
  continue;
56561
56601
  }
56562
56602
 
56563
- res.push(char);
56603
+ result.push(char);
56564
56604
  }
56565
56605
 
56566
- return res.join('');
56606
+ return result.join('');
56567
56607
  };
56568
56608
 
56569
56609
  const DirectiveLiteral = (path, {write}) => {
@@ -58211,7 +58251,7 @@ const createDebug$3 = (tokens) => (a) => {
58211
58251
  return;
58212
58252
 
58213
58253
  tokens.push({
58214
- type: TYPES$2.DEBUG,
58254
+ type: TYPES$3.DEBUG,
58215
58255
  value: `/*__${stringSnakeCase(a)}*/`,
58216
58256
  });
58217
58257
  };
@@ -58396,14 +58436,14 @@ const tokenize = (ast, overrides) => {
58396
58436
 
58397
58437
  const write = (value) => {
58398
58438
  addToken({
58399
- type: TYPES$2.TOKEN,
58439
+ type: TYPES$3.TOKEN,
58400
58440
  value,
58401
58441
  });
58402
58442
  };
58403
58443
 
58404
58444
  const indent = () => {
58405
58445
  addToken({
58406
- type: TYPES$2.INDENT,
58446
+ type: TYPES$3.INDENT,
58407
58447
  value: printIndent(i, format.indent),
58408
58448
  });
58409
58449
  };
@@ -58416,7 +58456,7 @@ const tokenize = (ast, overrides) => {
58416
58456
 
58417
58457
  const newline = () => {
58418
58458
  addToken({
58419
- type: TYPES$2.NEWLINE,
58459
+ type: TYPES$3.NEWLINE,
58420
58460
  value: format.newline,
58421
58461
  });
58422
58462
  };
@@ -58440,7 +58480,7 @@ const tokenize = (ast, overrides) => {
58440
58480
 
58441
58481
  const space = () => {
58442
58482
  addToken({
58443
- type: TYPES$2.SPACE,
58483
+ type: TYPES$3.SPACE,
58444
58484
  value: format.space,
58445
58485
  });
58446
58486
  };
@@ -58457,21 +58497,21 @@ const tokenize = (ast, overrides) => {
58457
58497
 
58458
58498
  const splitter = () => {
58459
58499
  addToken({
58460
- type: TYPES$2.SPLITTER,
58500
+ type: TYPES$3.SPLITTER,
58461
58501
  value: format.splitter,
58462
58502
  });
58463
58503
  };
58464
58504
 
58465
58505
  const quote = () => {
58466
58506
  addToken({
58467
- type: TYPES$2.QUOTE,
58507
+ type: TYPES$3.QUOTE,
58468
58508
  value: format.quote,
58469
58509
  });
58470
58510
  };
58471
58511
 
58472
58512
  const endOfFile = () => {
58473
58513
  addToken({
58474
- type: TYPES$2.END_OF_FILE,
58514
+ type: TYPES$3.END_OF_FILE,
58475
58515
  value: format.endOfFile,
58476
58516
  });
58477
58517
  };
@@ -58695,7 +58735,7 @@ const __toml = `${__toml_name}(__object)`;
58695
58735
  const __filesystem = `${__filesystem_name}(__object)`;
58696
58736
  const __ignore = `${__ignore_name}(__array)`;
58697
58737
 
58698
- const TYPES = [
58738
+ const TYPES$1 = [
58699
58739
  __json_name,
58700
58740
  __toml_name,
58701
58741
  __yaml_name,
@@ -58727,7 +58767,7 @@ const fromJS = (source, name = __json) => {
58727
58767
  const isJSON = (source) => !source.indexOf(__json_name);
58728
58768
  const isTOML = (source) => !source.indexOf(__toml_name);
58729
58769
  const isJSONGroup = (source) => {
58730
- for (const type of TYPES) {
58770
+ for (const type of TYPES$1) {
58731
58771
  if (!source.indexOf(type))
58732
58772
  return true;
58733
58773
  }
@@ -58799,7 +58839,7 @@ function check$d(ast) {
58799
58839
 
58800
58840
  const isString$a = (a) => typeof a === 'string';
58801
58841
 
58802
- var alignSpaces = (str) => {
58842
+ const alignSpaces = (str) => {
58803
58843
  check$c(str);
58804
58844
 
58805
58845
  const array = str.split('\n');
@@ -58849,14 +58889,12 @@ function check$c(str) {
58849
58889
  throw Error('str should be a string!');
58850
58890
  }
58851
58891
 
58852
- var align = alignSpaces.default;
58853
-
58854
58892
  const defaultOptions$4 = {
58855
58893
  alignSpaces: true,
58856
58894
  };
58857
58895
 
58858
58896
  const print$1 = (ast, options) => {
58859
- const {source, alignSpaces} = {
58897
+ const {source, alignSpaces: alignSpaces$1} = {
58860
58898
  ...defaultOptions$4,
58861
58899
  ...options,
58862
58900
  };
@@ -58875,10 +58913,10 @@ const print$1 = (ast, options) => {
58875
58913
 
58876
58914
  code += '\n';
58877
58915
 
58878
- if (!alignSpaces)
58916
+ if (!alignSpaces$1)
58879
58917
  return code;
58880
58918
 
58881
- return align(code);
58919
+ return alignSpaces(code);
58882
58920
  };
58883
58921
 
58884
58922
  const {isArray: isArray$b} = Array;
@@ -61101,14 +61139,14 @@ const getPosition = (path, shebang) => {
61101
61139
  if (!loc)
61102
61140
  return {
61103
61141
  line: 0,
61104
- column: 0,
61142
+ column: 1,
61105
61143
  };
61106
61144
 
61107
61145
  const {line, column} = node.loc.start;
61108
61146
 
61109
61147
  return {
61110
61148
  line: shebang ? line + 1 : line,
61111
- column,
61149
+ column: column + 1,
61112
61150
  };
61113
61151
  };
61114
61152
 
@@ -61500,6 +61538,7 @@ const {
61500
61538
  isFunction: isFunction$1,
61501
61539
  isImportDefaultSpecifier,
61502
61540
  isExportSpecifier,
61541
+ isExportDefaultSpecifier,
61503
61542
  isRegExpLiteral,
61504
61543
  isJSXText: isJSXText$2,
61505
61544
  isJSXIdentifier: isJSXIdentifier$1,
@@ -61740,12 +61779,17 @@ const isImports = (a) => {
61740
61779
  const isExports = (a) => {
61741
61780
  const b = !isArray$5(a) ? a : a[0];
61742
61781
 
61743
- if (!isExportSpecifier(b))
61744
- return false;
61782
+ if (isExportSpecifier(b))
61783
+ return isIdentifier$4(b.local, {
61784
+ name: EXPORTS,
61785
+ });
61745
61786
 
61746
- return isIdentifier$4(b.local, {
61747
- name: EXPORTS,
61748
- });
61787
+ if (isExportDefaultSpecifier(b))
61788
+ return isIdentifier$4(b.exported, {
61789
+ name: EXPORTS,
61790
+ });
61791
+
61792
+ return false;
61749
61793
  };
61750
61794
 
61751
61795
  const __OBJECT_TYPE = 'ObjectPattern|ObjectExpression';
@@ -61877,6 +61921,21 @@ const getTemplateValues = (node, str) => {
61877
61921
  });
61878
61922
  };
61879
61923
 
61924
+ const TYPES = [
61925
+ 'Identifier',
61926
+ 'JSXIdentifier',
61927
+ 'BooleanLiteral',
61928
+ 'StringLiteral',
61929
+ 'TemplateElement',
61930
+ 'RegExpLiteral',
61931
+ 'JSXText',
61932
+ 'JSXAttribute',
61933
+ 'TSTypeReference',
61934
+ 'TSTypeParameter',
61935
+ ];
61936
+
61937
+ const JOINED_TYPES = TYPES.join('|');
61938
+
61880
61939
  function findVarsWays(node) {
61881
61940
  if (isIdentifier$3(node) && is(node.name))
61882
61941
  return {
@@ -61887,7 +61946,7 @@ function findVarsWays(node) {
61887
61946
 
61888
61947
  traverse3(node, {
61889
61948
  noScope: true,
61890
- 'Identifier|JSXIdentifier|BooleanLiteral|StringLiteral|TemplateElement|RegExpLiteral|JSXText|JSXAttribute|TSTypeReference|TSTypeParameter'(path) {
61949
+ [JOINED_TYPES](path) {
61891
61950
  if (isInsideTypeReference(path))
61892
61951
  return;
61893
61952
 
@@ -61927,8 +61986,10 @@ function getValues({waysFrom, node}) {
61927
61986
 
61928
61987
  for (const [name, ways] of entries$6(waysFrom)) {
61929
61988
  for (let way of ways) {
61930
- if (isImportsStr(name) || isExportsStr(name))
61989
+ if (isImportsStr(name))
61931
61990
  way = way.replace(/\.0.local$/, '');
61991
+ else if (isExportsStr(name))
61992
+ way = way.replace(/\.0.(local|exported)$/, '');
61932
61993
  else if (isArgsStr(name) || isJSXChildrenStr(name) || isJSXAttributesStr(name) || isTypeParamsStr(name))
61933
61994
  way = way.replace(/\.0$/, '');
61934
61995
 
@@ -61957,8 +62018,10 @@ function setValues({waysTo, values, path}) {
61957
62018
  continue;
61958
62019
  }
61959
62020
 
61960
- if (isImportsStr(name) || isExportsStr(name))
62021
+ if (isImportsStr(name))
61961
62022
  way = way.replace(/\.0.local$/, '');
62023
+ else if (isExportsStr(name))
62024
+ way = way.replace(/\.0.(local|exported)$/, '');
61962
62025
 
61963
62026
  if (isArgsStr(name) || isJSXChildrenStr(name) || isJSXAttributesStr(name))
61964
62027
  way = way.replace(/\.0$/, '');
@@ -63196,7 +63259,7 @@ const watermark = (from, to, path) => {
63196
63259
  };
63197
63260
 
63198
63261
  return {
63199
- init: wraptile$1(init$2, options),
63262
+ init: wraptile$1(init, options),
63200
63263
  has: wraptile$1(has, options),
63201
63264
  add: wraptile$1(add, options),
63202
63265
  };
@@ -63214,7 +63277,7 @@ function create(from, to, path) {
63214
63277
  };
63215
63278
  }
63216
63279
 
63217
- function init$2({path, program}) {
63280
+ function init({path, program}) {
63218
63281
  if (path.node)
63219
63282
  path.node[name] = path.node[name] || new Set();
63220
63283
 
@@ -63222,7 +63285,7 @@ function init$2({path, program}) {
63222
63285
  }
63223
63286
 
63224
63287
  function add({path, program, watermark, highWatermark}) {
63225
- init$2({
63288
+ init({
63226
63289
  path,
63227
63290
  program,
63228
63291
  });
@@ -63730,37 +63793,23 @@ const writeFileContent$1 = (name, content) => {
63730
63793
  maybeFS.writeFileContent(name, content);
63731
63794
  };
63732
63795
 
63733
- function init$1(fsDriver) {
63796
+ const inject = (fsDriver) => {
63734
63797
  assign(maybeFS, fsDriver);
63735
- }
63798
+ };
63736
63799
 
63737
- const pause$1 = () => {
63800
+ const pause = () => {
63738
63801
  driverStore(maybeFS);
63739
- deinit$1();
63802
+ eject();
63740
63803
  };
63741
63804
 
63742
- const start$1 = () => {
63743
- init$1(driverStore());
63805
+ const start = () => {
63806
+ inject(driverStore());
63744
63807
  };
63745
63808
 
63746
- function deinit$1() {
63809
+ function eject() {
63747
63810
  assign(maybeFS, defaultFS);
63748
63811
  }
63749
63812
 
63750
- var maybeFS$1 = /*#__PURE__*/Object.freeze({
63751
- __proto__: null,
63752
- copyFile: copyFile$1,
63753
- createDirectory: createDirectory$1,
63754
- deinit: deinit$1,
63755
- init: init$1,
63756
- pause: pause$1,
63757
- readFileContent: readFileContent$1,
63758
- removeFile: removeFile$1,
63759
- renameFile: renameFile$1,
63760
- start: start$1,
63761
- writeFileContent: writeFileContent$1
63762
- });
63763
-
63764
63813
  const {isFile, isProgram: isProgram$1} = lib_exports;
63765
63814
  const {merge} = traverse3.visitors;
63766
63815
  const {entries: entries$2} = Object;
@@ -63971,7 +64020,10 @@ function parseFindFileOptions(options) {
63971
64020
  }
63972
64021
 
63973
64022
  function findFile(node, name, options) {
63974
- const {exclude = [], crawled = crawlDirectory(node)} = parseFindFileOptions(options);
64023
+ const {
64024
+ exclude = [],
64025
+ crawled = crawlDirectory(node),
64026
+ } = parseFindFileOptions(options);
63975
64027
 
63976
64028
  checkName(name);
63977
64029
 
@@ -64359,13 +64411,6 @@ function getFile(directoryPath, name, {type} = {}) {
64359
64411
  return files.values();
64360
64412
  }
64361
64413
 
64362
- const {
64363
- init,
64364
- deinit,
64365
- pause,
64366
- start,
64367
- } = maybeFS$1;
64368
-
64369
64414
  const {
64370
64415
  objectExpression,
64371
64416
  arrayExpression: arrayExpression$1,
@@ -64683,6 +64728,7 @@ const createTraverse = ({scan, rule, progress}) => ({push, options}) => ({
64683
64728
  fileProgress,
64684
64729
  crawled,
64685
64730
  });
64731
+
64686
64732
  const crawlFile = createCrawlFile(crawled);
64687
64733
 
64688
64734
  scan(rootPath, {
@@ -71174,6 +71220,7 @@ const {
71174
71220
  isLabeledStatement,
71175
71221
  isObjectPattern,
71176
71222
  isCallExpression,
71223
+ isSequenceExpression,
71177
71224
  objectPattern,
71178
71225
  objectProperty,
71179
71226
  } = lib_exports;
@@ -71198,6 +71245,15 @@ const addArgs = (args) => ({
71198
71245
  const fix$3 = ({declaration, path, pattern, params, index}) => {
71199
71246
  const declarationNode = template$1.ast.fresh(declaration);
71200
71247
 
71248
+ if (isSequenceExpression(declarationNode)) {
71249
+ const {expressions} = declarationNode;
71250
+ const {block} = path.scope;
71251
+ const {params} = block;
71252
+
71253
+ block.params.push(...expressions.slice(params.length));
71254
+ return;
71255
+ }
71256
+
71201
71257
  if (isBlockStatement(declarationNode)) {
71202
71258
  const prop = createProperty(declarationNode.body[0]);
71203
71259
  pattern.properties.push(prop);
@@ -71334,6 +71390,7 @@ const expressions = [
71334
71390
  'yield',
71335
71391
  'typeof',
71336
71392
  'function',
71393
+ 'instanceof',
71337
71394
  ];
71338
71395
 
71339
71396
  const statements = [
@@ -71555,7 +71612,7 @@ function magicParse(name, content) {
71555
71612
  return [js, ast];
71556
71613
  }
71557
71614
 
71558
- if (/\.(c|m)?ts(x)?$/.test(name)) {
71615
+ if (/\.[cm]?ts(x)?$/.test(name)) {
71559
71616
  const ast = parse$2(content, {
71560
71617
  isTS: true,
71561
71618
  });
@@ -71994,7 +72051,6 @@ var operator = /*#__PURE__*/Object.freeze({
71994
72051
  createFile: createFile,
71995
72052
  createNestedDirectory: createNestedDirectory,
71996
72053
  declare: declare$1,
71997
- deinit: deinit,
71998
72054
  extract: extract,
71999
72055
  findBinding: findBinding,
72000
72056
  findFile: findFile,
@@ -72026,7 +72082,6 @@ var operator = /*#__PURE__*/Object.freeze({
72026
72082
  hasParens: hasParens,
72027
72083
  hasTagName: hasTagName,
72028
72084
  ignore: ignore,
72029
- init: init,
72030
72085
  insertAfter: insertAfter,
72031
72086
  insertBefore: insertBefore,
72032
72087
  isConditionKeyword: isConditionKeyword,
@@ -72046,7 +72101,6 @@ var operator = /*#__PURE__*/Object.freeze({
72046
72101
  matchFiles: matchFiles,
72047
72102
  moveFile: moveFile,
72048
72103
  parseTemplate: parseTemplate,
72049
- pause: pause,
72050
72104
  readDirectory: readDirectory,
72051
72105
  readFileContent: readFileContent,
72052
72106
  remove: remove,
@@ -72064,7 +72118,6 @@ var operator = /*#__PURE__*/Object.freeze({
72064
72118
  setAttributeValue: setAttributeValue,
72065
72119
  setLiteralValue: setLiteralValue,
72066
72120
  setValues: setValues,
72067
- start: start,
72068
72121
  toExpression: toExpression,
72069
72122
  toJS: toJS,
72070
72123
  transformRegExp: transformRegExp,