@putout/bundle 5.2.1 → 5.2.3

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.
@@ -1,33 +1,4 @@
1
- function getAugmentedNamespace(n) {
2
- if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
3
- var f = n.default;
4
- if (typeof f == "function") {
5
- var a = function a () {
6
- var isInstance = false;
7
- try {
8
- isInstance = this instanceof a;
9
- } catch {}
10
- if (isInstance) {
11
- return Reflect.construct(f, arguments, this.constructor);
12
- }
13
- return f.apply(this, arguments);
14
- };
15
- a.prototype = f.prototype;
16
- } else a = {};
17
- Object.defineProperty(a, '__esModule', {value: true});
18
- Object.keys(n).forEach(function (k) {
19
- var d = Object.getOwnPropertyDescriptor(n, k);
20
- Object.defineProperty(a, k, d.get ? d : {
21
- enumerable: true,
22
- get: function () {
23
- return n[k];
24
- }
25
- });
26
- });
27
- return a;
28
- }
29
-
30
- var fullstore$1 = (value) => {
1
+ function fullstore(value) {
31
2
  const data = {
32
3
  value,
33
4
  };
@@ -42,9 +13,7 @@ var fullstore$1 = (value) => {
42
13
 
43
14
  return value;
44
15
  };
45
- };
46
-
47
- var fullstore$2 = fullstore$1;
16
+ }
48
17
 
49
18
  var global$1 = (typeof global !== "undefined" ? global :
50
19
  typeof self !== "undefined" ? self :
@@ -2820,7 +2789,7 @@ __export(lib_exports, {
2820
2789
  TSUnionType: () => TSUnionType$1,
2821
2790
  TSUnknownKeyword: () => TSUnknownKeyword$1,
2822
2791
  TSVoidKeyword: () => TSVoidKeyword$1,
2823
- TYPES: () => TYPES$4,
2792
+ TYPES: () => TYPES$3,
2824
2793
  TYPESCRIPT_TYPES: () => TYPESCRIPT_TYPES,
2825
2794
  TaggedTemplateExpression: () => TaggedTemplateExpression$1,
2826
2795
  TemplateElement: () => TemplateElement,
@@ -3686,7 +3655,7 @@ __export(lib_exports, {
3686
3655
  toKeyAlias: () => toKeyAlias,
3687
3656
  toStatement: () => toStatement$1,
3688
3657
  topicReference: () => topicReference,
3689
- traverse: () => traverse$2,
3658
+ traverse: () => traverse$4,
3690
3659
  traverseFast: () => traverseFast,
3691
3660
  tryStatement: () => tryStatement,
3692
3661
  tsAnyKeyword: () => tsAnyKeyword,
@@ -13568,7 +13537,7 @@ for (const {types: types2, set} of allExpandedTypes) {
13568
13537
  }
13569
13538
  }
13570
13539
 
13571
- var TYPES$4 = [].concat(Object.keys(VISITOR_KEYS), Object.keys(FLIPPED_ALIAS_KEYS), Object.keys(DEPRECATED_KEYS));
13540
+ var TYPES$3 = [].concat(Object.keys(VISITOR_KEYS), Object.keys(FLIPPED_ALIAS_KEYS), Object.keys(DEPRECATED_KEYS));
13572
13541
 
13573
13542
  function validate$1$1(node, key, val) {
13574
13543
  if (!node)
@@ -19591,7 +19560,7 @@ function getFunctionName(node, parent) {
19591
19560
  };
19592
19561
  }
19593
19562
 
19594
- function traverse$2(node, handlers, state) {
19563
+ function traverse$4(node, handlers, state) {
19595
19564
  if (typeof handlers === 'function') {
19596
19565
  handlers = {
19597
19566
  enter: handlers,
@@ -21375,7 +21344,7 @@ var TokContext = class {
21375
21344
  preserveSpace;
21376
21345
  };
21377
21346
 
21378
- var types$2 = {
21347
+ var types = {
21379
21348
  brace: new TokContext('{'),
21380
21349
  j_oTag: new TokContext('<tag'),
21381
21350
  j_cTag: new TokContext('</tag'),
@@ -23289,9 +23258,9 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23289
23258
  switch(this.state.type) {
23290
23259
  case 2:
23291
23260
  node = this.startNode();
23292
- this.setContext(types$2.brace);
23261
+ this.setContext(types.brace);
23293
23262
  this.next();
23294
- node = this.jsxParseExpressionContainer(node, types$2.j_oTag);
23263
+ node = this.jsxParseExpressionContainer(node, types.j_oTag);
23295
23264
 
23296
23265
  if (node.expression.type === 'JSXEmptyExpression') {
23297
23266
  this.raise(JsxErrors.AttributeIsEmpty, node);
@@ -23316,7 +23285,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23316
23285
  jsxParseSpreadChild(node) {
23317
23286
  this.next();
23318
23287
  node.expression = this.parseExpression();
23319
- this.setContext(types$2.j_expr);
23288
+ this.setContext(types.j_expr);
23320
23289
  this.state.canStartJSXElement = true;
23321
23290
  this.expect(4);
23322
23291
  return this.finishNode(node, 'JSXSpreadChild');
@@ -23345,11 +23314,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23345
23314
  const node = this.startNode();
23346
23315
 
23347
23316
  if (this.match(2)) {
23348
- this.setContext(types$2.brace);
23317
+ this.setContext(types.brace);
23349
23318
  this.next();
23350
23319
  this.expect(17);
23351
23320
  node.argument = this.parseMaybeAssignAllowIn();
23352
- this.setContext(types$2.j_oTag);
23321
+ this.setContext(types.j_oTag);
23353
23322
  this.state.canStartJSXElement = true;
23354
23323
  this.expect(4);
23355
23324
  return this.finishNode(node, 'JSXSpreadAttribute');
@@ -23423,13 +23392,13 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23423
23392
 
23424
23393
  case 2: {
23425
23394
  const node2 = this.startNode();
23426
- this.setContext(types$2.brace);
23395
+ this.setContext(types.brace);
23427
23396
  this.next();
23428
23397
 
23429
23398
  if (this.match(17)) {
23430
23399
  children.push(this.jsxParseSpreadChild(node2));
23431
23400
  } else {
23432
- children.push(this.jsxParseExpressionContainer(node2, types$2.j_expr));
23401
+ children.push(this.jsxParseExpressionContainer(node2, types.j_expr));
23433
23402
  }
23434
23403
 
23435
23404
  break;
@@ -23505,12 +23474,12 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23505
23474
  getTokenFromCode(code2) {
23506
23475
  const context = this.curContext();
23507
23476
 
23508
- if (context === types$2.j_expr) {
23477
+ if (context === types.j_expr) {
23509
23478
  this.jsxReadToken();
23510
23479
  return;
23511
23480
  }
23512
23481
 
23513
- if (context === types$2.j_oTag || context === types$2.j_cTag) {
23482
+ if (context === types.j_oTag || context === types.j_cTag) {
23514
23483
  if (isIdentifierStart2(code2)) {
23515
23484
  this.jsxReadWord();
23516
23485
  return;
@@ -23522,7 +23491,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23522
23491
  return;
23523
23492
  }
23524
23493
 
23525
- if ((code2 === 34 || code2 === 39) && context === types$2.j_oTag) {
23494
+ if ((code2 === 34 || code2 === 39) && context === types.j_oTag) {
23526
23495
  this.jsxReadString(code2);
23527
23496
  return;
23528
23497
  }
@@ -23541,18 +23510,18 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
23541
23510
  const {context, type} = this.state;
23542
23511
 
23543
23512
  if (type === 52 && prevType === 138) {
23544
- context.splice(-2, 2, types$2.j_cTag);
23513
+ context.splice(-2, 2, types.j_cTag);
23545
23514
  this.state.canStartJSXElement = false;
23546
23515
  } else if (type === 138) {
23547
- context.push(types$2.j_oTag);
23516
+ context.push(types.j_oTag);
23548
23517
  } else if (type === 139) {
23549
23518
  const out = context[context.length - 1];
23550
23519
 
23551
- if (out === types$2.j_oTag && prevType === 52 || out === types$2.j_cTag) {
23520
+ if (out === types.j_oTag && prevType === 52 || out === types.j_cTag) {
23552
23521
  context.pop();
23553
- this.state.canStartJSXElement = context[context.length - 1] === types$2.j_expr;
23522
+ this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;
23554
23523
  } else {
23555
- this.setContext(types$2.j_expr);
23524
+ this.setContext(types.j_expr);
23556
23525
  this.state.canStartJSXElement = true;
23557
23526
  }
23558
23527
  } else {
@@ -24134,7 +24103,7 @@ var State$2 = class _State {
24134
24103
  end = 0;
24135
24104
  lastTokEndLoc = null;
24136
24105
  lastTokStartLoc = null;
24137
- context = [types$2.brace];
24106
+ context = [types.brace];
24138
24107
  get canStartJSXElement() {
24139
24108
  return (this.flags & 1024) > 0;
24140
24109
  }
@@ -28522,7 +28491,7 @@ var typescript$1 = (superClass) => class TypeScriptParserMixin extends superClas
28522
28491
  }
28523
28492
 
28524
28493
  tsInTopLevelContext(cb) {
28525
- if (this.curContext() !== types$2.brace) {
28494
+ if (this.curContext() !== types.brace) {
28526
28495
  const oldContext = this.state.context;
28527
28496
 
28528
28497
  this.state.context = [oldContext[0]];
@@ -28908,7 +28877,7 @@ var typescript$1 = (superClass) => class TypeScriptParserMixin extends superClas
28908
28877
 
28909
28878
  if (node.params.length === 0) {
28910
28879
  this.raise(TSErrors.EmptyTypeArguments, node);
28911
- } else if (!this.state.inType && this.curContext() === types$2.brace) {
28880
+ } else if (!this.state.inType && this.curContext() === types.brace) {
28912
28881
  this.reScan_lt_gt();
28913
28882
  }
28914
28883
 
@@ -29815,7 +29784,7 @@ var typescript$1 = (superClass) => class TypeScriptParserMixin extends superClas
29815
29784
 
29816
29785
  const currentContext = context[context.length - 1];
29817
29786
 
29818
- if (currentContext === types$2.j_oTag || currentContext === types$2.j_expr) {
29787
+ if (currentContext === types.j_oTag || currentContext === types.j_expr) {
29819
29788
  context.pop();
29820
29789
  }
29821
29790
  }
@@ -35432,16 +35401,6 @@ function parse$9(input, options) {
35432
35401
  }
35433
35402
  }
35434
35403
 
35435
- function parseExpression$1(input, options) {
35436
- const parser = getParser$1(options, input);
35437
-
35438
- if (parser.options.strictMode) {
35439
- parser.state.strict = true;
35440
- }
35441
-
35442
- return parser.getExpression();
35443
- }
35444
-
35445
35404
  function generateExportedTokenTypes(internalTokenTypes) {
35446
35405
  const tokenTypes2 = {};
35447
35406
 
@@ -35452,7 +35411,7 @@ function generateExportedTokenTypes(internalTokenTypes) {
35452
35411
  return tokenTypes2;
35453
35412
  }
35454
35413
 
35455
- var tokTypes = generateExportedTokenTypes(tt);
35414
+ generateExportedTokenTypes(tt);
35456
35415
 
35457
35416
  function getParser$1(options, input) {
35458
35417
  let cls = Parser;
@@ -44659,7 +44618,7 @@ function verify$1(visitor) {
44659
44618
  continue;
44660
44619
 
44661
44620
  if (!TYPES2.includes(nodeType)) {
44662
- throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-beta.3'}`);
44621
+ throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-beta.4'}`);
44663
44622
  }
44664
44623
 
44665
44624
  const visitors2 = visitor[nodeType];
@@ -47585,7 +47544,7 @@ function replaceWithSourceString(replacement) {
47585
47544
  return this.replaceWith(expressionAST);
47586
47545
  }
47587
47546
 
47588
- function replaceWith$3(replacementPath) {
47547
+ function replaceWith$1(replacementPath) {
47589
47548
  resync.call(this);
47590
47549
 
47591
47550
  if (this.removed) {
@@ -50214,7 +50173,7 @@ var methods = {
50214
50173
  isGenericType,
50215
50174
  replaceWithMultiple: replaceWithMultiple$1,
50216
50175
  replaceWithSourceString,
50217
- replaceWith: replaceWith$3,
50176
+ replaceWith: replaceWith$1,
50218
50177
  replaceExpressionWithStatements,
50219
50178
  replaceInline,
50220
50179
  evaluateTruthy,
@@ -50271,7 +50230,7 @@ var methods = {
50271
50230
  };
50272
50231
 
50273
50232
  Object.assign(NodePath_Final.prototype, methods);
50274
- for (const type of TYPES$4) {
50233
+ for (const type of TYPES$3) {
50275
50234
  const typeKey = `is${type}`;
50276
50235
  const fn = lib_exports[typeKey];
50277
50236
 
@@ -50290,8 +50249,8 @@ for (const type of Object.keys(virtualTypes)) {
50290
50249
  if (type.startsWith('_'))
50291
50250
  continue;
50292
50251
 
50293
- if (!TYPES$4.includes(type))
50294
- TYPES$4.push(type);
50252
+ if (!TYPES$3.includes(type))
50253
+ TYPES$3.push(type);
50295
50254
  }
50296
50255
 
50297
50256
  var {VISITOR_KEYS: VISITOR_KEYS$2} = lib_exports;
@@ -50963,19 +50922,7 @@ traverse3.hasType = function(tree, type, denylistTypes) {
50963
50922
  };
50964
50923
  traverse3.cache = cache;
50965
50924
 
50966
- var bundle = /*#__PURE__*/Object.freeze({
50967
- __proto__: null,
50968
- codeFrameColumns: codeFrameColumns,
50969
- generate: generate$1,
50970
- parse: parse$9,
50971
- parseExpression: parseExpression$1,
50972
- template: index,
50973
- tokTypes: tokTypes,
50974
- traverse: traverse3,
50975
- types: lib_exports
50976
- });
50977
-
50978
- const TYPES$3 = {
50925
+ const TYPES$2 = {
50979
50926
  TOKEN: 'Token',
50980
50927
  NEWLINE: 'Newline',
50981
50928
  SPLITTER: 'Splitter',
@@ -52675,7 +52622,7 @@ function maybePrintBrace(brace, path, printer, semantics) {
52675
52622
 
52676
52623
  const {isArrayExpression: isArrayExpression$8} = lib_exports;
52677
52624
 
52678
- const TYPES$2 = [
52625
+ const TYPES$1 = [
52679
52626
  'NullLiteral',
52680
52627
  'NumericLiteral',
52681
52628
  'BigIntLiteral',
@@ -52692,7 +52639,7 @@ const isInsideTuple = (path) => {
52692
52639
  if (second !== path.node)
52693
52640
  return false;
52694
52641
 
52695
- return TYPES$2.includes(first.type);
52642
+ return TYPES$1.includes(first.type);
52696
52643
  };
52697
52644
 
52698
52645
  const {
@@ -53836,7 +53783,7 @@ function usedInAssignment(path) {
53836
53783
  return false;
53837
53784
  }
53838
53785
 
53839
- const {entries: entries$a} = Object;
53786
+ const {entries: entries$b} = Object;
53840
53787
  const isOneDeclaration = ({node}) => node.declarations.length === 1;
53841
53788
 
53842
53789
  const remove = (path) => {
@@ -53862,7 +53809,7 @@ const remove = (path) => {
53862
53809
  const elements = path.parentPath.get('elements');
53863
53810
  const n = elements.length - 1;
53864
53811
 
53865
- for (const [i, el] of entries$a(elements)) {
53812
+ for (const [i, el] of entries$b(elements)) {
53866
53813
  if (el !== path)
53867
53814
  continue;
53868
53815
 
@@ -54092,7 +54039,7 @@ const getProperties = (path, names) => {
54092
54039
  return result;
54093
54040
  };
54094
54041
 
54095
- const getProperty$2 = (path, name) => {
54042
+ const getProperty = (path, name) => {
54096
54043
  if (!isObjectExpression$4(path) && !isObjectPattern$1(path))
54097
54044
  throw Error(`☝️Looks like path is not 'ObjectExpression | ObjectPattern', but: '${path.type}' for path: ${path}`);
54098
54045
 
@@ -54238,7 +54185,7 @@ const parseNode$2 = (a) => {
54238
54185
  return a;
54239
54186
  };
54240
54187
 
54241
- const replaceWith$2 = (path, node) => {
54188
+ const replaceWith = (path, node) => {
54242
54189
  node = parseNode$2(node);
54243
54190
 
54244
54191
  if (path?.parentPath?.isExpressionStatement() && !path.parentPath.isProgram()) {
@@ -54339,34 +54286,6 @@ const isESM = (path) => {
54339
54286
  return false;
54340
54287
  };
54341
54288
 
54342
- var operate = /*#__PURE__*/Object.freeze({
54343
- __proto__: null,
54344
- compute: compute,
54345
- extract: extract,
54346
- findBinding: findBinding,
54347
- getBinding: getBinding,
54348
- getBindingPath: getBindingPath,
54349
- getExportDefault: getExportDefault,
54350
- getLiteralRaw: getLiteralRaw,
54351
- getPathAfterImports: getPathAfterImports,
54352
- getPathAfterRequires: getPathAfterRequires,
54353
- getProperties: getProperties,
54354
- getProperty: getProperty$2,
54355
- insertAfter: insertAfter,
54356
- insertBefore: insertBefore,
54357
- isESM: isESM,
54358
- isModuleExports: isModuleExports,
54359
- isSimple: isSimple,
54360
- remove: remove,
54361
- rename: rename,
54362
- renameProperty: renameProperty,
54363
- replaceWith: replaceWith$2,
54364
- replaceWithMultiple: replaceWithMultiple,
54365
- setLiteralValue: setLiteralValue,
54366
- toExpression: toExpression,
54367
- traverseProperties: traverseProperties
54368
- });
54369
-
54370
54289
  const {
54371
54290
  isObjectExpression: isObjectExpression$3,
54372
54291
  isArrayExpression: isArrayExpression$3,
@@ -55798,6 +55717,35 @@ const ExportNamedDeclaration = {
55798
55717
  },
55799
55718
  };
55800
55719
 
55720
+ function getAugmentedNamespace(n) {
55721
+ if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
55722
+ var f = n.default;
55723
+ if (typeof f == "function") {
55724
+ var a = function a () {
55725
+ var isInstance = false;
55726
+ try {
55727
+ isInstance = this instanceof a;
55728
+ } catch {}
55729
+ if (isInstance) {
55730
+ return Reflect.construct(f, arguments, this.constructor);
55731
+ }
55732
+ return f.apply(this, arguments);
55733
+ };
55734
+ a.prototype = f.prototype;
55735
+ } else a = {};
55736
+ Object.defineProperty(a, '__esModule', {value: true});
55737
+ Object.keys(n).forEach(function (k) {
55738
+ var d = Object.getOwnPropertyDescriptor(n, k);
55739
+ Object.defineProperty(a, k, d.get ? d : {
55740
+ enumerable: true,
55741
+ get: function () {
55742
+ return n[k];
55743
+ }
55744
+ });
55745
+ });
55746
+ return a;
55747
+ }
55748
+
55801
55749
  var parseImportSpecifiers_1 = (specifiers) => {
55802
55750
  const defaults = [];
55803
55751
  const namespaces = [];
@@ -58456,168 +58404,168 @@ const JSXClosingElement = (path, {print}) => {
58456
58404
  };
58457
58405
 
58458
58406
  var baseVisitors = /*#__PURE__*/Object.freeze({
58459
- __proto__: null,
58460
- ArrayExpression: ArrayExpression,
58461
- ArrayPattern: ArrayPattern,
58462
- ArrowFunctionExpression: ArrowFunctionExpression,
58463
- AssignmentExpression: AssignmentExpression,
58464
- AssignmentPattern: AssignmentPattern,
58465
- AwaitExpression: AwaitExpression,
58466
- BigIntLiteral: BigIntLiteral,
58467
- BinaryExpression: BinaryExpression,
58468
- BlockStatement: BlockStatement,
58469
- BooleanLiteral: BooleanLiteral,
58470
- BreakStatement: BreakStatement,
58471
- CallExpression: CallExpression,
58472
- CatchClause: CatchClause,
58473
- ClassAccessorProperty: ClassAccessorProperty,
58474
- ClassDeclaration: ClassDeclaration,
58475
- ClassExpression: ClassExpression,
58476
- ClassMethod: ClassMethod,
58477
- ClassPrivateMethod: ClassPrivateMethod,
58478
- ClassPrivateProperty: ClassPrivateProperty,
58479
- ClassProperty: ClassProperty,
58480
- ConditionalExpression: ConditionalExpression,
58481
- ContinueStatement: ContinueStatement,
58482
- DebuggerStatement: DebuggerStatement,
58483
- Decorator: Decorator,
58484
- Directive: Directive,
58485
- DirectiveLiteral: DirectiveLiteral,
58486
- DoWhileStatement: DoWhileStatement,
58487
- EmptyStatement: EmptyStatement,
58488
- ExportAllDeclaration: ExportAllDeclaration,
58489
- ExportDefaultDeclaration: ExportDefaultDeclaration,
58490
- ExportDefaultSpecifier: ExportDefaultSpecifier,
58491
- ExportNamedDeclaration: ExportNamedDeclaration,
58492
- ExportNamespaceSpecifier: ExportNamespaceSpecifier,
58493
- ExportSpecifier: ExportSpecifier,
58494
- ExpressionStatement: ExpressionStatement,
58495
- ForInStatement: ForInStatement,
58496
- ForOfStatement: ForOfStatement,
58497
- ForStatement: ForStatement,
58498
- FunctionDeclaration: FunctionDeclaration,
58499
- FunctionExpression: FunctionExpression,
58500
- Identifier: Identifier,
58501
- IfStatement: IfStatement,
58502
- ImportAttribute: ImportAttribute,
58503
- ImportDeclaration: ImportDeclaration,
58504
- ImportExpression: ImportExpression,
58505
- InterpreterDirective: InterpreterDirective,
58506
- JSXAttribute: JSXAttribute,
58507
- JSXClosingElement: JSXClosingElement,
58508
- JSXClosingFragment: JSXClosingFragment,
58509
- JSXElement: JSXElement,
58510
- JSXEmptyExpression: JSXEmptyExpression,
58511
- JSXExpressionContainer: JSXExpressionContainer,
58512
- JSXFragment: JSXFragment,
58513
- JSXIdentifier: JSXIdentifier,
58514
- JSXMemberExpression: JSXMemberExpression,
58515
- JSXOpeningElement: JSXOpeningElement,
58516
- JSXOpeningFragment: JSXOpeningFragment,
58517
- JSXSpreadAttribute: JSXSpreadAttribute,
58518
- JSXText: JSXText,
58519
- LabeledStatement: LabeledStatement,
58520
- LogicalExpression: LogicalExpression,
58521
- MemberExpression: MemberExpression,
58522
- MetaProperty: MetaProperty,
58523
- NewExpression: NewExpression,
58524
- NullLiteral: NullLiteral,
58525
- NumericLiteral: NumericLiteral,
58526
- ObjectExpression: ObjectExpression,
58527
- ObjectMethod: ObjectMethod,
58528
- ObjectPattern: ObjectPattern,
58529
- ObjectProperty: ObjectProperty,
58530
- OptionalCallExpression: OptionalCallExpression,
58531
- OptionalMemberExpression: OptionalMemberExpression,
58532
- ParenthesizedExpression: ParenthesizedExpression,
58533
- PrivateName: PrivateName,
58534
- Program: Program,
58535
- RegExpLiteral: RegExpLiteral,
58536
- RestElement: RestElement,
58537
- ReturnStatement: ReturnStatement,
58538
- SequenceExpression: SequenceExpression,
58539
- SpreadElement: SpreadElement,
58540
- StaticBlock: StaticBlock,
58541
- StringLiteral: StringLiteral,
58542
- Super: Super,
58543
- SwitchStatement: SwitchStatement,
58544
- TSAnyKeyword: TSAnyKeyword,
58545
- TSArrayType: TSArrayType,
58546
- TSAsExpression: TSAsExpression,
58547
- TSBigIntKeyword: TSBigIntKeyword,
58548
- TSBooleanKeyword: TSBooleanKeyword,
58549
- TSCallSignatureDeclaration: TSCallSignatureDeclaration,
58550
- TSClassImplements: TSClassImplements,
58551
- TSConditionalType: TSConditionalType,
58552
- TSConstructSignatureDeclaration: TSConstructSignatureDeclaration,
58553
- TSConstructorType: TSConstructorType,
58554
- TSDeclareFunction: TSDeclareFunction,
58555
- TSDeclareMethod: TSDeclareMethod,
58556
- TSEnumDeclaration: TSEnumDeclaration,
58557
- TSEnumMember: TSEnumMember,
58558
- TSExportAssignment: TSExportAssignment,
58559
- TSExternalModuleReference: TSExternalModuleReference,
58560
- TSFunctionType: TSFunctionType,
58561
- TSImportEqualsDeclaration: TSImportEqualsDeclaration,
58562
- TSImportType: TSImportType,
58563
- TSIndexSignature: TSIndexSignature,
58564
- TSIndexedAccessType: TSIndexedAccessType,
58565
- TSInferType: TSInferType,
58566
- TSInstantiationExpression: TSInstantiationExpression,
58567
- TSInterfaceBody: TSInterfaceBody,
58568
- TSInterfaceDeclaration: TSInterfaceDeclaration,
58569
- TSInterfaceHeritage: TSInterfaceHeritage,
58570
- TSIntersectionType: TSIntersectionType,
58571
- TSLiteralType: TSLiteralType,
58572
- TSMappedType: TSMappedType,
58573
- TSMethodSignature: TSMethodSignature,
58574
- TSModuleBlock: TSModuleBlock,
58575
- TSModuleDeclaration: TSModuleDeclaration,
58576
- TSNamedTupleMember: TSNamedTupleMember,
58577
- TSNeverKeyword: TSNeverKeyword,
58578
- TSNonNullExpression: TSNonNullExpression,
58579
- TSNullKeyword: TSNullKeyword,
58580
- TSNumberKeyword: TSNumberKeyword,
58581
- TSObjectKeyword: TSObjectKeyword,
58582
- TSOptionalType: TSOptionalType,
58583
- TSParameterProperty: TSParameterProperty,
58584
- TSParenthesizedType: TSParenthesizedType,
58585
- TSPropertySignature: TSPropertySignature,
58586
- TSQualifiedName: TSQualifiedName,
58587
- TSRestType: TSRestType,
58588
- TSSatisfiesExpression: TSSatisfiesExpression,
58589
- TSStringKeyword: TSStringKeyword,
58590
- TSSymbolKeyword: TSSymbolKeyword,
58591
- TSTemplateLiteralType: TSTemplateLiteralType,
58592
- TSThisType: TSThisType,
58593
- TSTupleType: TSTupleType,
58594
- TSTypeAliasDeclaration: TSTypeAliasDeclaration,
58595
- TSTypeAnnotation: TSTypeAnnotation,
58596
- TSTypeAssertion: TSTypeAssertion,
58597
- TSTypeLiteral: TSTypeLiteral,
58598
- TSTypeOperator: TSTypeOperator,
58599
- TSTypeParameter: TSTypeParameter,
58600
- TSTypeParameterDeclaration: TSTypeParameterDeclaration,
58601
- TSTypeParameterInstantiation: TSTypeParameterInstantiation,
58602
- TSTypePredicate: TSTypePredicate,
58603
- TSTypeQuery: TSTypeQuery,
58604
- TSTypeReference: TSTypeReference,
58605
- TSUndefinedKeyword: TSUndefinedKeyword,
58606
- TSUnionType: TSUnionType,
58607
- TSUnknownKeyword: TSUnknownKeyword,
58608
- TSVoidKeyword: TSVoidKeyword,
58609
- TaggedTemplateExpression: TaggedTemplateExpression,
58610
- TemplateLiteral: TemplateLiteral,
58611
- ThisExpression: ThisExpression,
58612
- ThrowStatement: ThrowStatement,
58613
- TryStatement: TryStatement,
58614
- UnaryExpression: UnaryExpression,
58615
- UpdateExpression: UpdateExpression,
58616
- VariableDeclaration: VariableDeclaration,
58617
- VoidPattern: VoidPattern,
58618
- WhileStatement: WhileStatement,
58619
- WithStatement: WithStatement,
58620
- YieldExpression: YieldExpression
58407
+ __proto__: null,
58408
+ ArrayExpression: ArrayExpression,
58409
+ ArrayPattern: ArrayPattern,
58410
+ ArrowFunctionExpression: ArrowFunctionExpression,
58411
+ AssignmentExpression: AssignmentExpression,
58412
+ AssignmentPattern: AssignmentPattern,
58413
+ AwaitExpression: AwaitExpression,
58414
+ BigIntLiteral: BigIntLiteral,
58415
+ BinaryExpression: BinaryExpression,
58416
+ BlockStatement: BlockStatement,
58417
+ BooleanLiteral: BooleanLiteral,
58418
+ BreakStatement: BreakStatement,
58419
+ CallExpression: CallExpression,
58420
+ CatchClause: CatchClause,
58421
+ ClassAccessorProperty: ClassAccessorProperty,
58422
+ ClassDeclaration: ClassDeclaration,
58423
+ ClassExpression: ClassExpression,
58424
+ ClassMethod: ClassMethod,
58425
+ ClassPrivateMethod: ClassPrivateMethod,
58426
+ ClassPrivateProperty: ClassPrivateProperty,
58427
+ ClassProperty: ClassProperty,
58428
+ ConditionalExpression: ConditionalExpression,
58429
+ ContinueStatement: ContinueStatement,
58430
+ DebuggerStatement: DebuggerStatement,
58431
+ Decorator: Decorator,
58432
+ Directive: Directive,
58433
+ DirectiveLiteral: DirectiveLiteral,
58434
+ DoWhileStatement: DoWhileStatement,
58435
+ EmptyStatement: EmptyStatement,
58436
+ ExportAllDeclaration: ExportAllDeclaration,
58437
+ ExportDefaultDeclaration: ExportDefaultDeclaration,
58438
+ ExportDefaultSpecifier: ExportDefaultSpecifier,
58439
+ ExportNamedDeclaration: ExportNamedDeclaration,
58440
+ ExportNamespaceSpecifier: ExportNamespaceSpecifier,
58441
+ ExportSpecifier: ExportSpecifier,
58442
+ ExpressionStatement: ExpressionStatement,
58443
+ ForInStatement: ForInStatement,
58444
+ ForOfStatement: ForOfStatement,
58445
+ ForStatement: ForStatement,
58446
+ FunctionDeclaration: FunctionDeclaration,
58447
+ FunctionExpression: FunctionExpression,
58448
+ Identifier: Identifier,
58449
+ IfStatement: IfStatement,
58450
+ ImportAttribute: ImportAttribute,
58451
+ ImportDeclaration: ImportDeclaration,
58452
+ ImportExpression: ImportExpression,
58453
+ InterpreterDirective: InterpreterDirective,
58454
+ JSXAttribute: JSXAttribute,
58455
+ JSXClosingElement: JSXClosingElement,
58456
+ JSXClosingFragment: JSXClosingFragment,
58457
+ JSXElement: JSXElement,
58458
+ JSXEmptyExpression: JSXEmptyExpression,
58459
+ JSXExpressionContainer: JSXExpressionContainer,
58460
+ JSXFragment: JSXFragment,
58461
+ JSXIdentifier: JSXIdentifier,
58462
+ JSXMemberExpression: JSXMemberExpression,
58463
+ JSXOpeningElement: JSXOpeningElement,
58464
+ JSXOpeningFragment: JSXOpeningFragment,
58465
+ JSXSpreadAttribute: JSXSpreadAttribute,
58466
+ JSXText: JSXText,
58467
+ LabeledStatement: LabeledStatement,
58468
+ LogicalExpression: LogicalExpression,
58469
+ MemberExpression: MemberExpression,
58470
+ MetaProperty: MetaProperty,
58471
+ NewExpression: NewExpression,
58472
+ NullLiteral: NullLiteral,
58473
+ NumericLiteral: NumericLiteral,
58474
+ ObjectExpression: ObjectExpression,
58475
+ ObjectMethod: ObjectMethod,
58476
+ ObjectPattern: ObjectPattern,
58477
+ ObjectProperty: ObjectProperty,
58478
+ OptionalCallExpression: OptionalCallExpression,
58479
+ OptionalMemberExpression: OptionalMemberExpression,
58480
+ ParenthesizedExpression: ParenthesizedExpression,
58481
+ PrivateName: PrivateName,
58482
+ Program: Program,
58483
+ RegExpLiteral: RegExpLiteral,
58484
+ RestElement: RestElement,
58485
+ ReturnStatement: ReturnStatement,
58486
+ SequenceExpression: SequenceExpression,
58487
+ SpreadElement: SpreadElement,
58488
+ StaticBlock: StaticBlock,
58489
+ StringLiteral: StringLiteral,
58490
+ Super: Super,
58491
+ SwitchStatement: SwitchStatement,
58492
+ TSAnyKeyword: TSAnyKeyword,
58493
+ TSArrayType: TSArrayType,
58494
+ TSAsExpression: TSAsExpression,
58495
+ TSBigIntKeyword: TSBigIntKeyword,
58496
+ TSBooleanKeyword: TSBooleanKeyword,
58497
+ TSCallSignatureDeclaration: TSCallSignatureDeclaration,
58498
+ TSClassImplements: TSClassImplements,
58499
+ TSConditionalType: TSConditionalType,
58500
+ TSConstructSignatureDeclaration: TSConstructSignatureDeclaration,
58501
+ TSConstructorType: TSConstructorType,
58502
+ TSDeclareFunction: TSDeclareFunction,
58503
+ TSDeclareMethod: TSDeclareMethod,
58504
+ TSEnumDeclaration: TSEnumDeclaration,
58505
+ TSEnumMember: TSEnumMember,
58506
+ TSExportAssignment: TSExportAssignment,
58507
+ TSExternalModuleReference: TSExternalModuleReference,
58508
+ TSFunctionType: TSFunctionType,
58509
+ TSImportEqualsDeclaration: TSImportEqualsDeclaration,
58510
+ TSImportType: TSImportType,
58511
+ TSIndexSignature: TSIndexSignature,
58512
+ TSIndexedAccessType: TSIndexedAccessType,
58513
+ TSInferType: TSInferType,
58514
+ TSInstantiationExpression: TSInstantiationExpression,
58515
+ TSInterfaceBody: TSInterfaceBody,
58516
+ TSInterfaceDeclaration: TSInterfaceDeclaration,
58517
+ TSInterfaceHeritage: TSInterfaceHeritage,
58518
+ TSIntersectionType: TSIntersectionType,
58519
+ TSLiteralType: TSLiteralType,
58520
+ TSMappedType: TSMappedType,
58521
+ TSMethodSignature: TSMethodSignature,
58522
+ TSModuleBlock: TSModuleBlock,
58523
+ TSModuleDeclaration: TSModuleDeclaration,
58524
+ TSNamedTupleMember: TSNamedTupleMember,
58525
+ TSNeverKeyword: TSNeverKeyword,
58526
+ TSNonNullExpression: TSNonNullExpression,
58527
+ TSNullKeyword: TSNullKeyword,
58528
+ TSNumberKeyword: TSNumberKeyword,
58529
+ TSObjectKeyword: TSObjectKeyword,
58530
+ TSOptionalType: TSOptionalType,
58531
+ TSParameterProperty: TSParameterProperty,
58532
+ TSParenthesizedType: TSParenthesizedType,
58533
+ TSPropertySignature: TSPropertySignature,
58534
+ TSQualifiedName: TSQualifiedName,
58535
+ TSRestType: TSRestType,
58536
+ TSSatisfiesExpression: TSSatisfiesExpression,
58537
+ TSStringKeyword: TSStringKeyword,
58538
+ TSSymbolKeyword: TSSymbolKeyword,
58539
+ TSTemplateLiteralType: TSTemplateLiteralType,
58540
+ TSThisType: TSThisType,
58541
+ TSTupleType: TSTupleType,
58542
+ TSTypeAliasDeclaration: TSTypeAliasDeclaration,
58543
+ TSTypeAnnotation: TSTypeAnnotation,
58544
+ TSTypeAssertion: TSTypeAssertion,
58545
+ TSTypeLiteral: TSTypeLiteral,
58546
+ TSTypeOperator: TSTypeOperator,
58547
+ TSTypeParameter: TSTypeParameter,
58548
+ TSTypeParameterDeclaration: TSTypeParameterDeclaration,
58549
+ TSTypeParameterInstantiation: TSTypeParameterInstantiation,
58550
+ TSTypePredicate: TSTypePredicate,
58551
+ TSTypeQuery: TSTypeQuery,
58552
+ TSTypeReference: TSTypeReference,
58553
+ TSUndefinedKeyword: TSUndefinedKeyword,
58554
+ TSUnionType: TSUnionType,
58555
+ TSUnknownKeyword: TSUnknownKeyword,
58556
+ TSVoidKeyword: TSVoidKeyword,
58557
+ TaggedTemplateExpression: TaggedTemplateExpression,
58558
+ TemplateLiteral: TemplateLiteral,
58559
+ ThisExpression: ThisExpression,
58560
+ ThrowStatement: ThrowStatement,
58561
+ TryStatement: TryStatement,
58562
+ UnaryExpression: UnaryExpression,
58563
+ UpdateExpression: UpdateExpression,
58564
+ VariableDeclaration: VariableDeclaration,
58565
+ VoidPattern: VoidPattern,
58566
+ WhileStatement: WhileStatement,
58567
+ WithStatement: WithStatement,
58568
+ YieldExpression: YieldExpression
58621
58569
  });
58622
58570
 
58623
58571
  const isString$c = (a) => typeof a === 'string';
@@ -58803,7 +58751,7 @@ const createDebug$3 = (tokens) => (a) => {
58803
58751
  return;
58804
58752
 
58805
58753
  tokens.push({
58806
- type: TYPES$3.DEBUG,
58754
+ type: TYPES$2.DEBUG,
58807
58755
  value: `/*__${stringSnakeCase(a)}*/`,
58808
58756
  });
58809
58757
  };
@@ -58988,14 +58936,14 @@ const tokenize = (ast, overrides) => {
58988
58936
 
58989
58937
  const write = (value) => {
58990
58938
  addToken({
58991
- type: TYPES$3.TOKEN,
58939
+ type: TYPES$2.TOKEN,
58992
58940
  value,
58993
58941
  });
58994
58942
  };
58995
58943
 
58996
58944
  const indent = () => {
58997
58945
  addToken({
58998
- type: TYPES$3.INDENT,
58946
+ type: TYPES$2.INDENT,
58999
58947
  value: printIndent(i, format.indent),
59000
58948
  });
59001
58949
  };
@@ -59008,7 +58956,7 @@ const tokenize = (ast, overrides) => {
59008
58956
 
59009
58957
  const newline = () => {
59010
58958
  addToken({
59011
- type: TYPES$3.NEWLINE,
58959
+ type: TYPES$2.NEWLINE,
59012
58960
  value: format.newline,
59013
58961
  });
59014
58962
  };
@@ -59032,7 +58980,7 @@ const tokenize = (ast, overrides) => {
59032
58980
 
59033
58981
  const space = () => {
59034
58982
  addToken({
59035
- type: TYPES$3.SPACE,
58983
+ type: TYPES$2.SPACE,
59036
58984
  value: format.space,
59037
58985
  });
59038
58986
  };
@@ -59049,21 +58997,21 @@ const tokenize = (ast, overrides) => {
59049
58997
 
59050
58998
  const splitter = () => {
59051
58999
  addToken({
59052
- type: TYPES$3.SPLITTER,
59000
+ type: TYPES$2.SPLITTER,
59053
59001
  value: format.splitter,
59054
59002
  });
59055
59003
  };
59056
59004
 
59057
59005
  const quote = () => {
59058
59006
  addToken({
59059
- type: TYPES$3.QUOTE,
59007
+ type: TYPES$2.QUOTE,
59060
59008
  value: format.quote,
59061
59009
  });
59062
59010
  };
59063
59011
 
59064
59012
  const endOfFile = () => {
59065
59013
  addToken({
59066
- type: TYPES$3.END_OF_FILE,
59014
+ type: TYPES$2.END_OF_FILE,
59067
59015
  value: format.endOfFile,
59068
59016
  });
59069
59017
  };
@@ -59106,7 +59054,7 @@ const tokenize = (ast, overrides) => {
59106
59054
  traverse,
59107
59055
  maybe,
59108
59056
  quote,
59109
- store: fullstore$2(),
59057
+ store: fullstore(),
59110
59058
  });
59111
59059
 
59112
59060
  const currentTraversers = {
@@ -59264,20 +59212,59 @@ var lib = removeBlankLines;
59264
59212
 
59265
59213
  var removeBlankLines$1 = lib.default;
59266
59214
 
59267
- const __json_name$1 = '__putout_processor_json';
59268
- const __yaml_name$1 = '__putout_processor_yaml';
59269
- const __filesystem_name$3 = '__putout_processor_filesystem';
59270
- const __ignore_name$1 = '__putout_processor_ignore';
59215
+ const cut$1 = (a) => a.slice(0, a.indexOf('('));
59216
+ const createPrefix = (name) => {
59217
+ if (name.includes('('))
59218
+ return `${cut$1(name)}(`;
59219
+
59220
+ return `${name}(`;
59221
+ };
59271
59222
 
59272
- const TYPES$1 = [
59273
- __json_name$1,
59274
- __yaml_name$1,
59275
- __filesystem_name$3,
59276
- __ignore_name$1,
59223
+ const createSuffix = () => ');\n';
59224
+ const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
59225
+
59226
+ const __json_name = '__putout_processor_json';
59227
+ const __yaml_name = '__putout_processor_yaml';
59228
+ const __toml_name = '__putout_processor_toml';
59229
+ const __filesystem_name = '__putout_processor_filesystem';
59230
+ const __ignore_name = '__putout_processor_ignore';
59231
+
59232
+ const __json = `${__json_name}(__object)`;
59233
+ const __yaml = `${__yaml_name}(__object)`;
59234
+ const __toml = `${__toml_name}(__object)`;
59235
+ const __filesystem = `${__filesystem_name}(__object)`;
59236
+ const __ignore = `${__ignore_name}(__array)`;
59237
+
59238
+ const TYPES = [
59239
+ __json_name,
59240
+ __yaml_name,
59241
+ __filesystem_name,
59242
+ __ignore_name,
59277
59243
  ];
59278
59244
 
59279
- var isJSON$1 = (source) => {
59280
- for (const type of TYPES$1) {
59245
+ const toJS = (source, name = __json) => {
59246
+ const prefix = createPrefix(name);
59247
+ const suffix = createSuffix();
59248
+
59249
+ return `${prefix}${source}${suffix}`;
59250
+ };
59251
+
59252
+ const fromJS = (source, name = __json) => {
59253
+ source = maybeNewline(source);
59254
+ const shortName = cut$1(name);
59255
+
59256
+ source = source.slice(source.indexOf(shortName));
59257
+
59258
+ const prefix = createPrefix(name);
59259
+ const suffix = createSuffix();
59260
+ const length = source.length - suffix.length;
59261
+ const sliced = source.slice(prefix.length, length);
59262
+
59263
+ return maybeNewline(removeBlankLines$1(sliced));
59264
+ };
59265
+
59266
+ const isJSON = (source) => {
59267
+ for (const type of TYPES) {
59281
59268
  if (!source.indexOf(type))
59282
59269
  return true;
59283
59270
  }
@@ -59330,7 +59317,7 @@ function isASTJSON(ast) {
59330
59317
  if (!isIdentifier$5(callee))
59331
59318
  return false;
59332
59319
 
59333
- return isJSON$1(callee.name);
59320
+ return isJSON(callee.name);
59334
59321
  }
59335
59322
 
59336
59323
  const print$2 = (ast, overrides = {}) => {
@@ -60026,11 +60013,11 @@ var onceExports = once$6.exports;
60026
60013
  const noop$3 = () => {};
60027
60014
 
60028
60015
  var empty = /*#__PURE__*/Object.freeze({
60029
- __proto__: null,
60030
- default: noop$3
60016
+ __proto__: null,
60017
+ default: noop$3
60031
60018
  });
60032
60019
 
60033
- var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(empty);
60020
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(empty);
60034
60021
 
60035
60022
  // eslint-disable-next-line node/no-unsupported-features/es-syntax
60036
60023
 
@@ -60058,11 +60045,11 @@ function privateMethods(Parser) {
60058
60045
  }
60059
60046
 
60060
60047
  var acornPrivateMethods = /*#__PURE__*/Object.freeze({
60061
- __proto__: null,
60062
- default: privateMethods
60048
+ __proto__: null,
60049
+ default: privateMethods
60063
60050
  });
60064
60051
 
60065
- var require$$2$1 = /*@__PURE__*/getAugmentedNamespace(acornPrivateMethods);
60052
+ var require$$2 = /*@__PURE__*/getAugmentedNamespace(acornPrivateMethods);
60066
60053
 
60067
60054
  var acornStage3;
60068
60055
  var hasRequiredAcornStage3;
@@ -60073,9 +60060,9 @@ function requireAcornStage3 () {
60073
60060
 
60074
60061
  acornStage3 = function(Parser) {
60075
60062
  return Parser.extend(
60076
- require$$1$1,
60077
- require$$1$1,
60078
- require$$2$1
60063
+ require$$1,
60064
+ require$$1,
60065
+ require$$2
60079
60066
  )
60080
60067
  };
60081
60068
  return acornStage3;
@@ -60084,10 +60071,10 @@ function requireAcornStage3 () {
60084
60071
  const once$4 = onceExports;
60085
60072
 
60086
60073
  const initAcorn = once$4(() => {
60087
- const {Parser} = require$$1$1;
60074
+ const {Parser} = require$$1;
60088
60075
 
60089
60076
  const stage3 = requireAcornStage3();
60090
- const typescript = require$$1$1.default;
60077
+ const typescript = require$$1.default;
60091
60078
 
60092
60079
  return Parser.extend(typescript(), stage3);
60093
60080
  });
@@ -60140,10 +60127,10 @@ const allowUndeclaredExports = true;
60140
60127
  const allowImportExportEverywhere = true;
60141
60128
 
60142
60129
  var options = /*#__PURE__*/Object.freeze({
60143
- __proto__: null,
60144
- allowImportExportEverywhere: allowImportExportEverywhere,
60145
- allowReturnOutsideFunction: allowReturnOutsideFunction,
60146
- allowUndeclaredExports: allowUndeclaredExports
60130
+ __proto__: null,
60131
+ allowImportExportEverywhere: allowImportExportEverywhere,
60132
+ allowReturnOutsideFunction: allowReturnOutsideFunction,
60133
+ allowUndeclaredExports: allowUndeclaredExports
60147
60134
  });
60148
60135
 
60149
60136
  const {assign: assign$5} = Object;
@@ -60200,7 +60187,7 @@ function getBabelLangExts({isTS, isFlow, isJSX}) {
60200
60187
 
60201
60188
  const once$3 = onceExports;
60202
60189
 
60203
- const initEspree = once$3(() => require$$1$1);
60190
+ const initEspree = once$3(() => require$$1);
60204
60191
 
60205
60192
  var parse$6 = (source) => {
60206
60193
  const {parse} = initEspree();
@@ -60220,7 +60207,7 @@ var parse$6 = (source) => {
60220
60207
 
60221
60208
  const once$2 = onceExports;
60222
60209
 
60223
- const initEsprima = once$2(() => require$$1$1);
60210
+ const initEsprima = once$2(() => require$$1);
60224
60211
 
60225
60212
  var parse$5 = (source) => {
60226
60213
  const {parse} = initEsprima();
@@ -60236,7 +60223,7 @@ var parse$5 = (source) => {
60236
60223
 
60237
60224
  const once$1 = onceExports;
60238
60225
 
60239
- const initTenko = once$1(() => require$$1$1);
60226
+ const initTenko = once$1(() => require$$1);
60240
60227
 
60241
60228
  var parse$4 = (source) => {
60242
60229
  const {Tenko} = initTenko();
@@ -60250,7 +60237,7 @@ var parse$4 = (source) => {
60250
60237
  };
60251
60238
 
60252
60239
  const once = onceExports;
60253
- const initHermes = once(() => require$$1$1);
60240
+ const initHermes = once(() => require$$1);
60254
60241
 
60255
60242
  var parse$3 = (source) => {
60256
60243
  const parser = initHermes();
@@ -60807,7 +60794,7 @@ function relative(from, to) {
60807
60794
  var sep = '/';
60808
60795
  var delimiter = ':';
60809
60796
 
60810
- function dirname$1(path) {
60797
+ function dirname(path) {
60811
60798
  var result = splitPath(path),
60812
60799
  root = result[0],
60813
60800
  dir = result[1];
@@ -60825,7 +60812,7 @@ function dirname$1(path) {
60825
60812
  return root + dir;
60826
60813
  }
60827
60814
 
60828
- function basename$1(path, ext) {
60815
+ function basename(path, ext) {
60829
60816
  var f = splitPath(path)[2];
60830
60817
  // TODO: make this comparison case-insensitive on windows?
60831
60818
  if (ext && f.substr(-1 * ext.length) === ext) {
@@ -60840,8 +60827,8 @@ function extname(path) {
60840
60827
  }
60841
60828
  var path = {
60842
60829
  extname: extname,
60843
- basename: basename$1,
60844
- dirname: dirname$1,
60830
+ basename: basename,
60831
+ dirname: dirname,
60845
60832
  sep: sep,
60846
60833
  delimiter: delimiter,
60847
60834
  relative: relative,
@@ -60868,21 +60855,6 @@ var substr = 'ab'.substr(-1) === 'b' ?
60868
60855
  }
60869
60856
  ;
60870
60857
 
60871
- var _polyfillNode_path = /*#__PURE__*/Object.freeze({
60872
- __proto__: null,
60873
- basename: basename$1,
60874
- default: path,
60875
- delimiter: delimiter,
60876
- dirname: dirname$1,
60877
- extname: extname,
60878
- isAbsolute: isAbsolute,
60879
- join: join$1,
60880
- normalize: normalize,
60881
- relative: relative,
60882
- resolve: resolve,
60883
- sep: sep
60884
- });
60885
-
60886
60858
  const isFn$5 = (a) => typeof a === 'function';
60887
60859
 
60888
60860
  const tryToCatch = async (fn, ...args) => {
@@ -60900,12 +60872,12 @@ function check$a(fn) {
60900
60872
  throw Error('fn should be a function!');
60901
60873
  }
60902
60874
 
60903
- const returns$1 = (a) => () => a;
60875
+ const returns$2 = (a) => () => a;
60904
60876
  const noop$2 = () => {};
60905
60877
 
60906
60878
  const createRequire = (url, overrides = {}) => {
60907
60879
  const {module = _module} = overrides;
60908
- const {createRequire = returns$1(noop$2)} = module;
60880
+ const {createRequire = returns$2(noop$2)} = module;
60909
60881
 
60910
60882
  return createRequire(url);
60911
60883
  };
@@ -61014,7 +60986,7 @@ function buildPluginsDirs(name) {
61014
60986
 
61015
60987
  const isStr$2 = (a) => typeof a === 'string';
61016
60988
  const {isArray: isArray$a} = Array;
61017
- const {entries: entries$9} = Object;
60989
+ const {entries: entries$a} = Object;
61018
60990
 
61019
60991
  const parsePluginNames = (plugins) => {
61020
60992
  const result = [];
@@ -61031,7 +61003,7 @@ const parsePluginNames = (plugins) => {
61031
61003
  continue;
61032
61004
  }
61033
61005
 
61034
- result.push(...entries$9(plugin));
61006
+ result.push(...entries$a(plugin));
61035
61007
  }
61036
61008
 
61037
61009
  return result;
@@ -61041,7 +61013,7 @@ const {isArray: isArray$9} = Array;
61041
61013
  const isBool$1 = (a) => typeof a === 'boolean';
61042
61014
  const isStr$1 = (a) => typeof a === 'string';
61043
61015
  const isObj = (a) => typeof a === 'object';
61044
- const {entries: entries$8} = Object;
61016
+ const {entries: entries$9} = Object;
61045
61017
  const {stringify: stringify$6} = JSON;
61046
61018
 
61047
61019
  const notSupportedError = (a) => Error(`☝️ Rule format not supported ${a}: ${typeof a}`);
@@ -61068,7 +61040,7 @@ const parseRules = (rules) => {
61068
61040
 
61069
61041
  check$9(rules);
61070
61042
 
61071
- for (const [rule, value] of entries$8(rules)) {
61043
+ for (const [rule, value] of entries$9(rules)) {
61072
61044
  if (isStr$1(value)) {
61073
61045
  result.push({
61074
61046
  rule,
@@ -61153,21 +61125,6 @@ function validateState(rule, value) {
61153
61125
  });
61154
61126
  }
61155
61127
 
61156
- const cut$1 = (a) => a.split('/')[0];
61157
-
61158
- const enableNestedRules = (rules) => {
61159
- const newRules = {};
61160
-
61161
- for (const [rule, value] of entries$8(rules)) {
61162
- if (rule.includes('/') && parseState(rule, value))
61163
- newRules[cut$1(rule)] = 'on';
61164
-
61165
- newRules[rule] = value;
61166
- }
61167
-
61168
- return newRules;
61169
- };
61170
-
61171
61128
  function check$9(rules) {
61172
61129
  if (isArray$9(rules))
61173
61130
  throw Error(`☝️Looks like type of 'rules' passed to @putout/engine-loader is 'array', expected: 'object'.`);
@@ -61298,6 +61255,25 @@ const validateRulesRelations = (options) => {
61298
61255
  });
61299
61256
  };
61300
61257
 
61258
+ const {entries: entries$8, fromEntries} = Object;
61259
+ const cut = (a) => a.split('/')[0];
61260
+
61261
+ const enableNestedRules = (rules) => {
61262
+ const newRules = new Map();
61263
+
61264
+ for (const [rule, value] of entries$8(rules)) {
61265
+ if (newRules.has(rule))
61266
+ continue;
61267
+
61268
+ if (rule.includes('/') && parseState(rule, value))
61269
+ newRules.set(cut(rule), 'on');
61270
+
61271
+ newRules.set(rule, value);
61272
+ }
61273
+
61274
+ return fromEntries(newRules);
61275
+ };
61276
+
61301
61277
  const prepareRules = ({rules, pluginNames}) => {
61302
61278
  const enabledRules = enableNestedRules(rules);
61303
61279
  const cookedEnabledRules = parseRules(enabledRules);
@@ -61457,7 +61433,7 @@ function extendRules$1(rule, plugin) {
61457
61433
 
61458
61434
  function parseRuleName(rule) {
61459
61435
  if (rule.startsWith('import:')) {
61460
- const shortName = basename$1(rule.replace('import:', ''));
61436
+ const shortName = basename(rule.replace('import:', ''));
61461
61437
 
61462
61438
  return shortName.replace('plugin-', '');
61463
61439
  }
@@ -61945,7 +61921,7 @@ const isString$6 = (a) => typeof a === 'string';
61945
61921
  const isUndefined = (a) => typeof a === 'undefined';
61946
61922
  const isEmpty = (obj) => !Object.keys(obj).length;
61947
61923
 
61948
- var jessy = (selector, divider, value) => {
61924
+ function jessy(selector, divider, value) {
61949
61925
  if (!value) {
61950
61926
  value = divider;
61951
61927
  divider = '.';
@@ -61982,7 +61958,7 @@ var jessy = (selector, divider, value) => {
61982
61958
  }
61983
61959
 
61984
61960
  return value;
61985
- };
61961
+ }
61986
61962
 
61987
61963
  function check$7(selector, obj) {
61988
61964
  if (!isString$6(selector))
@@ -61992,14 +61968,12 @@ function check$7(selector, obj) {
61992
61968
  throw Error('obj should be object!');
61993
61969
  }
61994
61970
 
61995
- var jessy$1 = jessy.default;
61996
-
61997
61971
  const isNumber$1 = (a) => !Number.isNaN(a) && typeof a === 'number';
61998
61972
  const isNumberLike = (a, b = Number(a)) => isNumber$1(b);
61999
61973
  const isString$5 = (a) => typeof a === 'string';
62000
61974
  const notSecure = (a) => /__proto__|prototype/.test(a);
62001
61975
 
62002
- var nessy = (selector, value, divider, obj) => {
61976
+ function nessy(selector, value, divider, obj) {
62003
61977
  if (!obj) {
62004
61978
  obj = divider || {};
62005
61979
  divider = '.';
@@ -62012,6 +61986,7 @@ var nessy = (selector, value, divider, obj) => {
62012
61986
  const array = selector
62013
61987
  .split(divider)
62014
61988
  .filter(Boolean);
61989
+
62015
61990
  const n = array.length - 1;
62016
61991
 
62017
61992
  for (const [i, name] of array.entries()) {
@@ -62025,21 +62000,17 @@ var nessy = (selector, value, divider, obj) => {
62025
62000
 
62026
62001
  obj[name] = isNumberLike(nextKey) ? [] : {};
62027
62002
  }
62028
-
62029
62003
 
62030
62004
  obj = obj[name];
62031
62005
  }
62032
62006
 
62033
62007
  return result;
62034
- };
62035
-
62008
+ }
62036
62009
  function check$6(selector) {
62037
62010
  if (!isString$5(selector))
62038
62011
  throw Error('selector should be string!');
62039
62012
  }
62040
62013
 
62041
- var nessy$1 = nessy.default;
62042
-
62043
62014
  const TS_MODULE_REG = /\.body\.0\.expression$/;
62044
62015
  const CLASS_BODY_REG = /\.body\.0\.key$/;
62045
62016
  const BODY_REG = /\.body\.0$/;
@@ -62499,7 +62470,7 @@ function getValues({waysFrom, node}) {
62499
62470
  if (isBodyStr(name))
62500
62471
  way = prepareBodyWay(way);
62501
62472
 
62502
- result[name] = result[name] || extractExpression$1(jessy$1(way, node));
62473
+ result[name] = result[name] || extractExpression$1(jessy(way, node));
62503
62474
  }
62504
62475
  }
62505
62476
 
@@ -62514,7 +62485,7 @@ function setValues({waysTo, values, path}) {
62514
62485
  for (const [name, ways] of entries$6(waysTo)) {
62515
62486
  for (let way of ways) {
62516
62487
  if (!way) {
62517
- replaceWith$2(path, values[name]);
62488
+ replaceWith(path, values[name]);
62518
62489
  continue;
62519
62490
  }
62520
62491
 
@@ -62534,14 +62505,14 @@ function setValues({waysTo, values, path}) {
62534
62505
  raw: makeRaw(value),
62535
62506
  });
62536
62507
 
62537
- nessy$1(way, element, node);
62508
+ nessy(way, element, node);
62538
62509
  continue;
62539
62510
  }
62540
62511
 
62541
62512
  if (isBodyStr(name))
62542
62513
  way = prepareBodyWay(way);
62543
62514
 
62544
- const {extra} = jessy$1(way, node);
62515
+ const {extra} = jessy(way, node);
62545
62516
 
62546
62517
  if (extra) {
62547
62518
  const valueExtra = values[name].extra;
@@ -62552,7 +62523,7 @@ function setValues({waysTo, values, path}) {
62552
62523
  };
62553
62524
  }
62554
62525
 
62555
- nessy$1(way, values[name], node);
62526
+ nessy(way, values[name], node);
62556
62527
  }
62557
62528
  }
62558
62529
  }
@@ -63887,7 +63858,7 @@ const parseExpression = (nodeFrom, {node}) => {
63887
63858
  return node;
63888
63859
  };
63889
63860
 
63890
- const fix$4 = (from, to, path) => {
63861
+ const fix$7 = (from, to, path) => {
63891
63862
  const nodeFrom = template$1.ast(from);
63892
63863
  const mark = watermark(from, to, path);
63893
63864
 
@@ -63914,7 +63885,7 @@ const fix$4 = (from, to, path) => {
63914
63885
  checkExpressionStatement(nodeFrom, nodeTo, path);
63915
63886
 
63916
63887
  const waysTo = findVarsWays(nodeTo);
63917
- const newPath = replaceWith$2(path, nodeTo);
63888
+ const newPath = replaceWith(path, nodeTo);
63918
63889
 
63919
63890
  if (!nodeTo.__putout_replace_cooked) {
63920
63891
  validateTemplateValues(waysTo, waysFrom);
@@ -63942,7 +63913,7 @@ const getFix = (items, match) => (path) => {
63942
63913
  const matchFn = match[from];
63943
63914
 
63944
63915
  if (!matchFn || runMatch(path, nodeFrom, matchFn))
63945
- fix$4(from, to, path);
63916
+ fix$7(from, to, path);
63946
63917
  }
63947
63918
  }
63948
63919
  };
@@ -64085,13 +64056,13 @@ const TS_EXCLUDE = [
64085
64056
  ];
64086
64057
 
64087
64058
  const declare$1 = (declarations) => ({
64088
- report: report$3,
64059
+ report: report$6,
64089
64060
  include,
64090
- fix: fix$3(declarations),
64061
+ fix: fix$6(declarations),
64091
64062
  filter: filter(declarations),
64092
64063
  });
64093
64064
 
64094
- const report$3 = (path) => {
64065
+ const report$6 = (path) => {
64095
64066
  const {name} = path.node;
64096
64067
  const peaceOfName = cutName(name);
64097
64068
 
@@ -64131,7 +64102,7 @@ const filter = (declarations) => (path, {options}) => {
64131
64102
  return parseCode(type, allDeclarations[name]);
64132
64103
  };
64133
64104
 
64134
- const fix$3 = (declarations) => (path, {options}) => {
64105
+ const fix$6 = (declarations) => (path, {options}) => {
64135
64106
  const type = getModuleType(path);
64136
64107
 
64137
64108
  const allDeclarations = {
@@ -64250,111 +64221,17 @@ function validateDeclare(declare) {
64250
64221
  throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify(declare)}'.`);
64251
64222
  }
64252
64223
 
64253
- function fullstore(value) {
64254
- const data = {
64255
- value,
64256
- };
64257
-
64258
- return (...args) => {
64259
- const [value] = args;
64260
-
64261
- if (!args.length)
64262
- return data.value;
64263
-
64264
- data.value = value;
64265
-
64266
- return value;
64267
- };
64268
- }
64269
-
64270
- const cut = (a) => a.slice(0, a.indexOf('('));
64271
- const createPrefix = (name) => {
64272
- if (name.includes('('))
64273
- return `${cut(name)}(`;
64274
-
64275
- return `${name}(`;
64276
- };
64277
-
64278
- const createSuffix = () => ');\n';
64279
- const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
64280
-
64281
- const __json_name = '__putout_processor_json';
64282
- const __yaml_name = '__putout_processor_yaml';
64283
- const __toml_name = '__putout_processor_toml';
64284
- const __filesystem_name$2 = '__putout_processor_filesystem';
64285
- const __ignore_name = '__putout_processor_ignore';
64286
-
64287
- const __json = `${__json_name}(__object)`;
64288
- const __yaml = `${__yaml_name}(__object)`;
64289
- const __toml = `${__toml_name}(__object)`;
64290
- const __filesystem = `${__filesystem_name$2}(__object)`;
64291
- const __ignore = `${__ignore_name}(__array)`;
64292
-
64293
- const TYPES = [
64294
- __json_name,
64295
- __yaml_name,
64296
- __filesystem_name$2,
64297
- __ignore_name,
64298
- ];
64299
-
64300
- const toJS = (source, name = __json) => {
64301
- const prefix = createPrefix(name);
64302
- const suffix = createSuffix();
64303
-
64304
- return `${prefix}${source}${suffix}`;
64305
- };
64306
-
64307
- const fromJS = (source, name = __json) => {
64308
- source = maybeNewline(source);
64309
- const shortName = cut(name);
64310
-
64311
- source = source.slice(source.indexOf(shortName));
64312
-
64313
- const prefix = createPrefix(name);
64314
- const suffix = createSuffix();
64315
- const length = source.length - suffix.length;
64316
- const sliced = source.slice(prefix.length, length);
64317
-
64318
- return maybeNewline(removeBlankLines$1(sliced));
64319
- };
64320
-
64321
- const isJSON = (source) => {
64322
- for (const type of TYPES) {
64323
- if (!source.indexOf(type))
64324
- return true;
64325
- }
64326
-
64327
- return false;
64328
- };
64329
-
64330
- var json = /*#__PURE__*/Object.freeze({
64331
- __proto__: null,
64332
- __filesystem: __filesystem,
64333
- __filesystem_name: __filesystem_name$2,
64334
- __ignore: __ignore,
64335
- __ignore_name: __ignore_name,
64336
- __json: __json,
64337
- __json_name: __json_name,
64338
- __toml: __toml,
64339
- __toml_name: __toml_name,
64340
- __yaml: __yaml,
64341
- __yaml_name: __yaml_name,
64342
- fromJS: fromJS,
64343
- isJSON: isJSON,
64344
- toJS: toJS
64345
- });
64346
-
64347
64224
  const driverStore = fullstore();
64348
64225
 
64349
64226
  const {assign} = Object;
64350
64227
  const noop = () => {};
64351
- const returns = (a) => () => a;
64228
+ const returns$1 = (a) => () => a;
64352
64229
 
64353
64230
  const defaultFS = {
64354
64231
  renameFile: noop,
64355
64232
  removeFile: noop,
64356
64233
  createDirectory: noop,
64357
- readFileContent: returns(''),
64234
+ readFileContent: returns$1(''),
64358
64235
  writeFileContent: noop,
64359
64236
  copyFile: noop,
64360
64237
  };
@@ -64373,7 +64250,7 @@ const copyFile$1 = (from, to) => {
64373
64250
  maybeFS.copyFile(from, to);
64374
64251
  };
64375
64252
 
64376
- const createDirectory$2 = (name) => {
64253
+ const createDirectory$1 = (name) => {
64377
64254
  maybeFS.createDirectory(name);
64378
64255
  };
64379
64256
 
@@ -64403,17 +64280,17 @@ function deinit$1() {
64403
64280
  }
64404
64281
 
64405
64282
  var maybeFS$1 = /*#__PURE__*/Object.freeze({
64406
- __proto__: null,
64407
- copyFile: copyFile$1,
64408
- createDirectory: createDirectory$2,
64409
- deinit: deinit$1,
64410
- init: init$1,
64411
- pause: pause$1,
64412
- readFileContent: readFileContent$1,
64413
- removeFile: removeFile$1,
64414
- renameFile: renameFile$1,
64415
- start: start$1,
64416
- writeFileContent: writeFileContent$1
64283
+ __proto__: null,
64284
+ copyFile: copyFile$1,
64285
+ createDirectory: createDirectory$1,
64286
+ deinit: deinit$1,
64287
+ init: init$1,
64288
+ pause: pause$1,
64289
+ readFileContent: readFileContent$1,
64290
+ removeFile: removeFile$1,
64291
+ renameFile: renameFile$1,
64292
+ start: start$1,
64293
+ writeFileContent: writeFileContent$1
64417
64294
  });
64418
64295
 
64419
64296
  const {
@@ -64507,7 +64384,7 @@ function isExcluded({name, base, exclude}) {
64507
64384
  return false;
64508
64385
  }
64509
64386
 
64510
- function findFile$2(node, name, exclude = []) {
64387
+ function findFile(node, name, exclude = []) {
64511
64388
  checkName(name);
64512
64389
 
64513
64390
  const filePaths = [];
@@ -64515,7 +64392,7 @@ function findFile$2(node, name, exclude = []) {
64515
64392
 
64516
64393
  for (const filenamePath of traverseProperties(node, 'filename')) {
64517
64394
  const {value} = filenamePath.node.value;
64518
- const base = basename$1(value);
64395
+ const base = basename(value);
64519
64396
 
64520
64397
  for (const name of names) {
64521
64398
  if (value === name || getRegExp(name).test(base)) {
@@ -64543,22 +64420,22 @@ function checkName(name) {
64543
64420
  }
64544
64421
 
64545
64422
  function getFilenamePath(filePath) {
64546
- const filenamePath = getProperty$2(filePath, 'filename');
64423
+ const filenamePath = getProperty(filePath, 'filename');
64547
64424
  return filenamePath.get('value');
64548
64425
  }
64549
64426
 
64550
- function getFilename$2(filePath) {
64427
+ function getFilename(filePath) {
64551
64428
  const {value} = getFilenamePath(filePath).node;
64552
64429
  return value;
64553
64430
  }
64554
64431
 
64555
- function getFileType$2(filePath) {
64556
- const typePath = getProperty$2(filePath, 'type');
64432
+ function getFileType(filePath) {
64433
+ const typePath = getProperty(filePath, 'type');
64557
64434
  return typePath.node.value.value;
64558
64435
  }
64559
64436
 
64560
64437
  function getFileContent(filePath) {
64561
- const content = getProperty$2(filePath, 'content');
64438
+ const content = getProperty(filePath, 'content');
64562
64439
 
64563
64440
  return [
64564
64441
  Boolean(content),
@@ -64567,7 +64444,7 @@ function getFileContent(filePath) {
64567
64444
  }
64568
64445
 
64569
64446
  const renameFile = (filePath, name) => {
64570
- const oldName = getFilename$2(filePath);
64447
+ const oldName = getFilename(filePath);
64571
64448
  const valuePath = getFilenamePath(filePath);
64572
64449
  const baseName = oldName
64573
64450
  .split('/')
@@ -64584,7 +64461,7 @@ const renameFile = (filePath, name) => {
64584
64461
  };
64585
64462
 
64586
64463
  function removeFile(filePath) {
64587
- const filename = getFilename$2(filePath);
64464
+ const filename = getFilename(filePath);
64588
64465
 
64589
64466
  if (!getParentDirectory(filePath))
64590
64467
  return;
@@ -64594,7 +64471,7 @@ function removeFile(filePath) {
64594
64471
  }
64595
64472
 
64596
64473
  const removeEmptyDirectory = (dirPath) => {
64597
- const type = getFileType$2(dirPath);
64474
+ const type = getFileType(dirPath);
64598
64475
 
64599
64476
  if (type !== 'directory')
64600
64477
  return;
@@ -64602,7 +64479,7 @@ const removeEmptyDirectory = (dirPath) => {
64602
64479
  let nextParentDir = dirPath;
64603
64480
 
64604
64481
  while (!readDirectory(dirPath).length) {
64605
- const name = getFilename$2(dirPath);
64482
+ const name = getFilename(dirPath);
64606
64483
 
64607
64484
  if (name === '/')
64608
64485
  break;
@@ -64621,10 +64498,10 @@ const moveFile = (filePath, dirPath) => {
64621
64498
  if (filePath === dirPath)
64622
64499
  return;
64623
64500
 
64624
- const dirname = getFilename$2(dirPath);
64625
- const filename = getFilename$2(filePath);
64501
+ const dirname = getFilename(dirPath);
64502
+ const filename = getFilename(filePath);
64626
64503
  const dirPathFiles = getFiles$1(dirPath);
64627
- const filenamePath = getProperty$2(filePath, 'filename');
64504
+ const filenamePath = getProperty(filePath, 'filename');
64628
64505
 
64629
64506
  const basename = filename
64630
64507
  .split('/')
@@ -64642,8 +64519,8 @@ const moveFile = (filePath, dirPath) => {
64642
64519
  };
64643
64520
 
64644
64521
  const copyFile = (filePath, dirPath) => {
64645
- const dirname = getFilename$2(dirPath);
64646
- const filename = getFilename$2(filePath);
64522
+ const dirname = getFilename(dirPath);
64523
+ const filename = getFilename(filePath);
64647
64524
 
64648
64525
  const basename = filename
64649
64526
  .split('/')
@@ -64667,16 +64544,16 @@ const copyFile = (filePath, dirPath) => {
64667
64544
  };
64668
64545
 
64669
64546
  function maybeRemoveFile(dirPath, filename) {
64670
- const type = getFileType$2(dirPath);
64547
+ const type = getFileType(dirPath);
64671
64548
 
64672
64549
  if (type !== 'directory') {
64673
- const filename = getFilename$2(dirPath);
64550
+ const filename = getFilename(dirPath);
64674
64551
  throw Error(`☝️ Looks like '${filename}' is not a directory, but: '${type}'. Rename to '${filename}/'`);
64675
64552
  }
64676
64553
 
64677
- const dirPathFiles = getProperty$2(dirPath, 'files');
64678
- const name = join$1(getFilename$2(dirPath), basename$1(filename));
64679
- const [fileToOverwrite] = findFile$2(dirPathFiles, name);
64554
+ const dirPathFiles = getProperty(dirPath, 'files');
64555
+ const name = join$1(getFilename(dirPath), basename(filename));
64556
+ const [fileToOverwrite] = findFile(dirPathFiles, name);
64680
64557
 
64681
64558
  if (!fileToOverwrite)
64682
64559
  return;
@@ -64688,7 +64565,7 @@ const createFile = (dirPath, name, content) => {
64688
64565
  maybeRemoveFile(dirPath, name);
64689
64566
 
64690
64567
  const dirPathFiles = getFiles$1(dirPath);
64691
- const parentFilename = getFilename$2(dirPath);
64568
+ const parentFilename = getFilename(dirPath);
64692
64569
  const filename = join$1(parentFilename, name);
64693
64570
 
64694
64571
  const typeProperty = createTypeProperty('file');
@@ -64710,10 +64587,10 @@ const createFile = (dirPath, name, content) => {
64710
64587
  return filePath;
64711
64588
  };
64712
64589
 
64713
- const getFiles$1 = (dirPath) => getProperty$2(dirPath, 'files');
64590
+ const getFiles$1 = (dirPath) => getProperty(dirPath, 'files');
64714
64591
 
64715
64592
  function readDirectory(dirPath) {
64716
- const fileType = getFileType$2(dirPath);
64593
+ const fileType = getFileType(dirPath);
64717
64594
 
64718
64595
  if (fileType !== 'directory')
64719
64596
  return [];
@@ -64721,9 +64598,9 @@ function readDirectory(dirPath) {
64721
64598
  return getFiles$1(dirPath).get('value.elements');
64722
64599
  }
64723
64600
 
64724
- function createDirectory$1(dirPath, name) {
64601
+ function createDirectory(dirPath, name) {
64725
64602
  const dirPathFiles = getFiles$1(dirPath);
64726
- const parentFilename = getFilename$2(dirPath);
64603
+ const parentFilename = getFilename(dirPath);
64727
64604
  const filename = join$1(parentFilename, name);
64728
64605
 
64729
64606
  const typeProperty = createTypeProperty('directory');
@@ -64736,13 +64613,13 @@ function createDirectory$1(dirPath, name) {
64736
64613
  filesProperty,
64737
64614
  ]));
64738
64615
 
64739
- createDirectory$2(filename);
64616
+ createDirectory$1(filename);
64740
64617
 
64741
64618
  return dirPathFiles.get('value.elements').at(-1);
64742
64619
  }
64743
64620
 
64744
64621
  const readFileContent = (filePath) => {
64745
- const fileType = getFileType$2(filePath);
64622
+ const fileType = getFileType(filePath);
64746
64623
 
64747
64624
  if (fileType === 'directory')
64748
64625
  return '';
@@ -64752,7 +64629,7 @@ const readFileContent = (filePath) => {
64752
64629
  if (hasContent)
64753
64630
  return fromBase64(content);
64754
64631
 
64755
- const filename = getFilename$2(filePath);
64632
+ const filename = getFilename(filePath);
64756
64633
  const fileContent = readFileContent$1(filename);
64757
64634
 
64758
64635
  const property = createContentProperty(toBase64(fileContent));
@@ -64763,16 +64640,16 @@ const readFileContent = (filePath) => {
64763
64640
  };
64764
64641
 
64765
64642
  function writeFileContent(filePath, content) {
64766
- const fileType = getFileType$2(filePath);
64643
+ const fileType = getFileType(filePath);
64767
64644
 
64768
64645
  if (fileType === 'directory')
64769
64646
  return;
64770
64647
 
64771
- const filename = getFilename$2(filePath);
64648
+ const filename = getFilename(filePath);
64772
64649
 
64773
64650
  writeFileContent$1(filename, content);
64774
64651
 
64775
- const contentPath = getProperty$2(filePath, 'content');
64652
+ const contentPath = getProperty(filePath, 'content');
64776
64653
 
64777
64654
  if (contentPath) {
64778
64655
  setLiteralValue(contentPath.node.value, toBase64(content));
@@ -64785,21 +64662,21 @@ function writeFileContent(filePath, content) {
64785
64662
 
64786
64663
  const createNestedDirectory = (path, name) => {
64787
64664
  const rootPath = getRootDirectory(path);
64788
- const dir = dirname$1(name);
64665
+ const dir = dirname(name);
64789
64666
 
64790
- if (dir === getFilename$2(path))
64791
- return createDirectory$1(path, basename$1(name));
64667
+ if (dir === getFilename(path))
64668
+ return createDirectory(path, basename(name));
64792
64669
 
64793
64670
  let currentDir = name;
64794
64671
 
64795
- const rootDir = getFilename$2(rootPath);
64672
+ const rootDir = getFilename(rootPath);
64796
64673
  const directories = [];
64797
64674
  let prevDir = currentDir;
64798
64675
 
64799
64676
  while (currentDir !== rootDir) {
64800
64677
  directories.unshift(currentDir);
64801
64678
  prevDir = currentDir;
64802
- currentDir = dirname$1(currentDir);
64679
+ currentDir = dirname(currentDir);
64803
64680
 
64804
64681
  if (currentDir === prevDir) {
64805
64682
  currentDir = rootDir;
@@ -64813,16 +64690,16 @@ const createNestedDirectory = (path, name) => {
64813
64690
  }
64814
64691
  }
64815
64692
 
64816
- let lastDirectoryPath = findFile$2(rootPath, directories).at(-1) || rootPath;
64817
- const lastDirectoryName = getFilename$2(lastDirectoryPath);
64693
+ let lastDirectoryPath = findFile(rootPath, directories).at(-1) || rootPath;
64694
+ const lastDirectoryName = getFilename(lastDirectoryPath);
64818
64695
 
64819
64696
  const n = directories.length;
64820
64697
 
64821
64698
  let i = directories.indexOf(lastDirectoryName) + 1;
64822
64699
 
64823
64700
  for (; i < n; i++) {
64824
- const name = basename$1(directories[i]);
64825
- lastDirectoryPath = createDirectory$1(lastDirectoryPath, name);
64701
+ const name = basename(directories[i]);
64702
+ lastDirectoryPath = createDirectory(lastDirectoryPath, name);
64826
64703
  }
64827
64704
 
64828
64705
  return lastDirectoryPath;
@@ -64850,55 +64727,6 @@ const {
64850
64727
  start,
64851
64728
  } = maybeFS$1;
64852
64729
 
64853
- var filesystem = /*#__PURE__*/Object.freeze({
64854
- __proto__: null,
64855
- copyFile: copyFile,
64856
- createDirectory: createDirectory$1,
64857
- createFile: createFile,
64858
- createNestedDirectory: createNestedDirectory,
64859
- deinit: deinit,
64860
- findFile: findFile$2,
64861
- getFileContent: getFileContent,
64862
- getFileType: getFileType$2,
64863
- getFilename: getFilename$2,
64864
- getParentDirectory: getParentDirectory,
64865
- getRootDirectory: getRootDirectory,
64866
- init: init,
64867
- moveFile: moveFile,
64868
- pause: pause,
64869
- readDirectory: readDirectory,
64870
- readFileContent: readFileContent,
64871
- removeEmptyDirectory: removeEmptyDirectory,
64872
- removeFile: removeFile,
64873
- renameFile: renameFile,
64874
- start: start,
64875
- writeFileContent: writeFileContent
64876
- });
64877
-
64878
- var convertSimpleFilesystemToFilesystem = {};
64879
-
64880
- var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_path);
64881
-
64882
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(bundle);
64883
-
64884
- var require$$3 = /*@__PURE__*/getAugmentedNamespace(filesystem);
64885
-
64886
- var require$$2 = /*@__PURE__*/getAugmentedNamespace(json);
64887
-
64888
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(operate);
64889
-
64890
- const {basename, dirname} = require$$0$1;
64891
- const {types: types$1} = require$$0;
64892
- const {
64893
- createDirectory,
64894
- getFileType: getFileType$1,
64895
- getFilename: getFilename$1,
64896
- findFile: findFile$1,
64897
- } = require$$3;
64898
-
64899
- const {__filesystem_name: __filesystem_name$1} = require$$2;
64900
- const {replaceWith: replaceWith$1, getProperty: getProperty$1} = require$$1;
64901
-
64902
64730
  const {
64903
64731
  objectExpression,
64904
64732
  arrayExpression: arrayExpression$1,
@@ -64907,9 +64735,9 @@ const {
64907
64735
  isStringLiteral,
64908
64736
  isTemplateLiteral,
64909
64737
  objectProperty: objectProperty$1,
64910
- } = types$1;
64738
+ } = lib_exports;
64911
64739
 
64912
- convertSimpleFilesystemToFilesystem.report = () => `Convert Simple Filesystem to Filesystem`;
64740
+ const report$5 = () => `Convert Simple Filesystem to Filesystem`;
64913
64741
 
64914
64742
  const isDirectory = (a) => a.endsWith('/');
64915
64743
  const getType = (a) => {
@@ -64943,14 +64771,19 @@ function parseContent(node, path) {
64943
64771
  throw Error(`☝️ Looks like wrong content type: '${node.type}' from file: '${path}'`);
64944
64772
  }
64945
64773
 
64946
- convertSimpleFilesystemToFilesystem.fix = (path) => {
64774
+ const fix$5 = (path) => {
64947
64775
  const array = arrayExpression$1([]);
64948
64776
 
64949
64777
  for (const element of path.get('elements')) {
64950
- if (isArrayExpression(element)) {
64778
+ if (isOneElementTuple(element)) {
64779
+ const [node] = element.node.elements;
64780
+ array.elements.push(createFileFromStringLiteral(node));
64781
+ continue;
64782
+ }
64783
+
64784
+ if (isTwoElementsTuple(element)) {
64951
64785
  const [nodeValue, nodeContent] = element.node.elements;
64952
64786
  const {value} = nodeValue;
64953
-
64954
64787
  const content = parseContent(nodeContent, element);
64955
64788
 
64956
64789
  array.elements.push(objectExpression([
@@ -64962,13 +64795,8 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
64962
64795
  }
64963
64796
 
64964
64797
  if (isStringLiteral(element)) {
64965
- const {value} = element.node;
64966
-
64967
- array.elements.push(objectExpression([
64968
- getType(value),
64969
- createFilename(noTrailingSlash(value)),
64970
- getFiles(value),
64971
- ].filter(Boolean)));
64798
+ const file = createFileFromStringLiteral(element);
64799
+ array.elements.push(file);
64972
64800
  continue;
64973
64801
  }
64974
64802
 
@@ -64978,8 +64806,20 @@ convertSimpleFilesystemToFilesystem.fix = (path) => {
64978
64806
  buildTree(path, array);
64979
64807
  };
64980
64808
 
64981
- convertSimpleFilesystemToFilesystem.traverse = ({push}) => ({
64982
- [`${__filesystem_name$1}(__array)`]: (path) => {
64809
+ const maybeNode = (a) => a.node || a;
64810
+
64811
+ function createFileFromStringLiteral(element) {
64812
+ const {value} = maybeNode(element);
64813
+
64814
+ return objectExpression([
64815
+ getType(value),
64816
+ createFilename(noTrailingSlash(value)),
64817
+ getFiles(value),
64818
+ ].filter(Boolean));
64819
+ }
64820
+
64821
+ const traverse$3 = ({push}) => ({
64822
+ [`${__filesystem_name}(__array)`]: (path) => {
64983
64823
  const root = path.get('arguments.0');
64984
64824
  push(root);
64985
64825
  },
@@ -64993,19 +64833,19 @@ const noTrailingSlash = (a) => {
64993
64833
  };
64994
64834
 
64995
64835
  function buildTree(path, list) {
64996
- const [root, ...files] = findFile$1(list, '*');
64836
+ const [root, ...files] = findFile(list, '*');
64997
64837
 
64998
64838
  for (const filePath of files) {
64999
- const filename = getFilename$1(filePath);
64839
+ const filename = getFilename(filePath);
65000
64840
 
65001
64841
  check$3(filename);
65002
64842
 
65003
- const type = getFileType$1(filePath);
64843
+ const type = getFileType(filePath);
65004
64844
  const dir = dirname(filename);
65005
64845
  const name = basename(filename);
65006
- const [dirPath] = findFile$1(root, dir);
64846
+ const [dirPath] = findFile(root, dir);
65007
64847
 
65008
- if (!dirPath || getFileType$1(dirPath) !== 'directory')
64848
+ if (!dirPath || getFileType(dirPath) !== 'directory')
65009
64849
  throw Error(`☝️ Looks like directory '${dir}/' is missing`);
65010
64850
 
65011
64851
  if (type === 'directory') {
@@ -65013,41 +64853,54 @@ function buildTree(path, list) {
65013
64853
  continue;
65014
64854
  }
65015
64855
 
65016
- const filesProperty = getProperty$1(dirPath, 'files');
64856
+ const filesProperty = getProperty(dirPath, 'files');
65017
64857
  filesProperty.node.value.elements.push(filePath.node);
65018
64858
  }
65019
64859
 
65020
- replaceWith$1(path, root);
64860
+ replaceWith(path, root);
65021
64861
  }
65022
64862
 
64863
+ const isTwoElementsTuple = (a) => {
64864
+ if (!isArrayExpression(a))
64865
+ return false;
64866
+
64867
+ const {elements} = a.node;
64868
+
64869
+ return elements.length === 2;
64870
+ };
64871
+
64872
+ const isOneElementTuple = (a) => {
64873
+ if (!isArrayExpression(a))
64874
+ return false;
64875
+
64876
+ const {elements} = a.node;
64877
+
64878
+ return elements.length === 1;
64879
+ };
64880
+
65023
64881
  function check$3(filename) {
65024
64882
  if (!filename.includes('/'))
65025
64883
  throw Error(`☝️ Looks like directory path is missing: '${filename}'`);
65026
64884
  }
65027
64885
 
65028
- var convertFilesystemToSimpleFilesystem = {};
65029
-
65030
- const {types} = require$$0;
65031
- const {replaceWith, getProperty} = require$$1;
65032
- const {__filesystem_name} = require$$2;
65033
-
65034
- const {
65035
- findFile,
65036
- getFilename,
65037
- getFileType,
65038
- } = require$$3;
64886
+ var fromSimple = /*#__PURE__*/Object.freeze({
64887
+ __proto__: null,
64888
+ fix: fix$5,
64889
+ report: report$5,
64890
+ traverse: traverse$3
64891
+ });
65039
64892
 
65040
64893
  const {
65041
64894
  stringLiteral: stringLiteral$2,
65042
64895
  arrayExpression,
65043
- } = types;
64896
+ } = lib_exports;
65044
64897
 
65045
64898
  const {isArray} = Array;
65046
64899
  const maybeAddSlash = (a) => a === '/' ? a : `${a}/`;
65047
64900
 
65048
- convertFilesystemToSimpleFilesystem.report = () => `Convert Filesystem to Simple Filesystem`;
64901
+ const report$4 = () => `Convert Filesystem to Simple Filesystem`;
65049
64902
 
65050
- convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
64903
+ const fix$4 = (root, {files}) => {
65051
64904
  const names = [];
65052
64905
 
65053
64906
  for (const file of files) {
@@ -65086,7 +64939,7 @@ convertFilesystemToSimpleFilesystem.fix = (root, {files}) => {
65086
64939
  replaceWith(root, arrayExpression(list));
65087
64940
  };
65088
64941
 
65089
- convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
64942
+ const traverse$2 = ({push}) => ({
65090
64943
  [`${__filesystem_name}(__object)`]: (path) => {
65091
64944
  const root = path.get('arguments.0');
65092
64945
  const files = findFile(root, '*');
@@ -65097,9 +64950,16 @@ convertFilesystemToSimpleFilesystem.traverse = ({push}) => ({
65097
64950
  },
65098
64951
  });
65099
64952
 
64953
+ var toSimple = /*#__PURE__*/Object.freeze({
64954
+ __proto__: null,
64955
+ fix: fix$4,
64956
+ report: report$4,
64957
+ traverse: traverse$2
64958
+ });
64959
+
65100
64960
  const log = createDebug$1('putout:runner:scanner');
65101
64961
 
65102
- const scan$1 = ({rule, plugin, msg, options}, {progress}) => {
64962
+ const scan = ({rule, plugin, msg, options}, {progress}) => {
65103
64963
  const {
65104
64964
  scan,
65105
64965
  report,
@@ -65144,7 +65004,7 @@ const createFileProgress = ({rule, progress}) => ({i, n}) => {
65144
65004
  };
65145
65005
 
65146
65006
  const createTrackFile = (fileProgress) => function*(...a) {
65147
- const files = findFile$2(...a);
65007
+ const files = findFile(...a);
65148
65008
  const n = files.length;
65149
65009
 
65150
65010
  for (const [i, file] of files.entries()) {
@@ -65157,7 +65017,7 @@ const createTrackFile = (fileProgress) => function*(...a) {
65157
65017
  };
65158
65018
 
65159
65019
  const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
65160
- [`${__filesystem_name$2}(__)`](path) {
65020
+ [`${__filesystem_name}(__)`](path) {
65161
65021
  log(rule);
65162
65022
  progress.start(rule);
65163
65023
 
@@ -65171,7 +65031,7 @@ const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
65171
65031
 
65172
65032
  const trackFile = createTrackFile(fileProgress);
65173
65033
 
65174
- runSimple(convertSimpleFilesystemToFilesystem, {
65034
+ runSimple(fromSimple, {
65175
65035
  shouldConvert: true,
65176
65036
  path,
65177
65037
  isSimple,
@@ -65188,7 +65048,7 @@ const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
65188
65048
  options,
65189
65049
  });
65190
65050
 
65191
- runSimple(convertFilesystemToSimpleFilesystem, {
65051
+ runSimple(toSimple, {
65192
65052
  shouldConvert: isSimple(),
65193
65053
  path,
65194
65054
  isSimple,
@@ -65228,18 +65088,18 @@ function runSimple(plugin, {path, isSimple, shouldConvert = true}) {
65228
65088
  }
65229
65089
 
65230
65090
  function parseVisitor(visitors) {
65231
- const to = visitors[`${__filesystem_name$2}(__object)`];
65232
- const from = visitors[`${__filesystem_name$2}(__array)`];
65091
+ const to = visitors[`${__filesystem_name}(__object)`];
65092
+ const from = visitors[`${__filesystem_name}(__array)`];
65233
65093
 
65234
65094
  if (to)
65235
65095
  return [
65236
65096
  to,
65237
- `${__filesystem_name$2}(__object)`,
65097
+ `${__filesystem_name}(__object)`,
65238
65098
  ];
65239
65099
 
65240
65100
  return [
65241
65101
  from,
65242
- `${__filesystem_name$2}(__array)`,
65102
+ `${__filesystem_name}(__array)`,
65243
65103
  ];
65244
65104
  }
65245
65105
 
@@ -65407,7 +65267,7 @@ function splitPlugins(plugins, {progress}) {
65407
65267
  }
65408
65268
 
65409
65269
  if (plugin.scan) {
65410
- pluginsTraverse.push(scan$1(item, {
65270
+ pluginsTraverse.push(scan(item, {
65411
65271
  progress,
65412
65272
  }));
65413
65273
  continue;
@@ -71761,15 +71621,15 @@ const isCall = (path) => {
71761
71621
  return isCallExpression(path.find(isCallOrStatement));
71762
71622
  };
71763
71623
 
71764
- const report$2 = ({name}) => `Argument '${name}' is missing`;
71624
+ const report$3 = ({name}) => `Argument '${name}' is missing`;
71765
71625
 
71766
71626
  const addArgs = (args) => ({
71767
- report: report$2,
71768
- fix: fix$2,
71627
+ report: report$3,
71628
+ fix: fix$3,
71769
71629
  traverse: traverse(args),
71770
71630
  });
71771
71631
 
71772
- const fix$2 = ({declaration, path, pattern, params, index}) => {
71632
+ const fix$3 = ({declaration, path, pattern, params, index}) => {
71773
71633
  const declarationNode = template$1.ast.fresh(declaration);
71774
71634
 
71775
71635
  if (isBlockStatement(declarationNode)) {
@@ -72007,7 +71867,7 @@ const {join} = path;
72007
71867
 
72008
71868
  const isObject = (a) => a && typeof a === 'object';
72009
71869
  const {entries} = Object;
72010
- const report$1 = (path, {message}) => message;
71870
+ const report$2 = (path, {message}) => message;
72011
71871
 
72012
71872
  const matchFiles = (options) => {
72013
71873
  const {filename} = options;
@@ -72016,20 +71876,20 @@ const matchFiles = (options) => {
72016
71876
 
72017
71877
  check(files);
72018
71878
 
72019
- const scan = createScan({
71879
+ const scan = createScan$2({
72020
71880
  defaultFilename: filename,
72021
71881
  files,
72022
71882
  exclude,
72023
71883
  });
72024
71884
 
72025
71885
  return {
72026
- fix: fix$1,
71886
+ fix: fix$2,
72027
71887
  scan,
72028
- report: report$1,
71888
+ report: report$2,
72029
71889
  };
72030
71890
  };
72031
71891
 
72032
- function fix$1(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJS, matchedAST, options}) {
71892
+ function fix$2(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJS, matchedAST, options}) {
72033
71893
  transform(matchedAST, matchedJS, options);
72034
71894
 
72035
71895
  const matchedJSON = magicPrint(outputFilename, matchedAST);
@@ -72046,19 +71906,19 @@ function fix$1(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJ
72046
71906
  removeFile(inputFile);
72047
71907
  }
72048
71908
 
72049
- const createScan = ({files, exclude, defaultFilename}) => (mainPath, {push, progress, options}) => {
71909
+ const createScan$2 = ({files, exclude, defaultFilename}) => (mainPath, {push, progress, options}) => {
72050
71910
  const allFiles = [];
72051
- const cwd = getFilename$2(mainPath);
71911
+ const cwd = getFilename(mainPath);
72052
71912
 
72053
71913
  options.filename = options.filename ?? defaultFilename;
72054
71914
 
72055
71915
  for (const [filename, rawOptions] of entries(files)) {
72056
71916
  const [matchInputFilenameMask] = parseMatcher(filename, options);
72057
- const inputFiles = findFile$2(mainPath, matchInputFilenameMask, exclude);
71917
+ const inputFiles = findFile(mainPath, matchInputFilenameMask, exclude);
72058
71918
 
72059
71919
  for (const inputFile of inputFiles) {
72060
71920
  const dirPath = getParentDirectory(inputFile);
72061
- const inputFilename = getFilename$2(inputFile);
71921
+ const inputFilename = getFilename(inputFile);
72062
71922
 
72063
71923
  const [matchInputFilename, outputFilename = matchInputFilename] = parseMatcher(filename, {
72064
71924
  filename: inputFilename,
@@ -72160,8 +72020,8 @@ function getOutputFile({dirPath, matchInputFilename, outputFilename, inputFile})
72160
72020
  if (matchInputFilename === outputFilename)
72161
72021
  return inputFile;
72162
72022
 
72163
- const name = join(getFilename$2(dirPath), outputFilename);
72164
- const [outputFile] = findFile$2(dirPath, name);
72023
+ const name = join(getFilename(dirPath), outputFilename);
72024
+ const [outputFile] = findFile(dirPath, name);
72165
72025
 
72166
72026
  if (outputFile)
72167
72027
  return outputFile;
@@ -72200,28 +72060,18 @@ function parseOptions(inputFilename, rawOptions) {
72200
72060
 
72201
72061
  const {parse} = JSON;
72202
72062
 
72203
- const renameFiles = ({type, mask, rename}) => ({
72204
- report,
72205
- fix,
72206
- scan: scan({
72207
- type,
72208
- mask,
72209
- rename,
72210
- }),
72211
- });
72212
-
72213
- const report = (file, {from, to}) => `Rename '${from}' to '${to}'`;
72063
+ const report$1 = (file, {from, to}) => `Rename '${from}' to '${to}'`;
72214
72064
 
72215
- const fix = (file, {to}) => {
72065
+ const fix$1 = (file, {to}) => {
72216
72066
  renameFile(file, to);
72217
72067
  };
72218
72068
 
72219
- const scan = ({type, mask, rename}) => (path, {push, trackFile}) => {
72069
+ const createScan$1 = ({type, mask, rename} = {}) => (path, {push, trackFile}) => {
72220
72070
  for (const file of trackFile(path, mask)) {
72221
72071
  if (type && !checkType(type, file))
72222
72072
  continue;
72223
72073
 
72224
- const from = getFilename$2(file);
72074
+ const from = getFilename(file);
72225
72075
  const to = rename(from);
72226
72076
 
72227
72077
  push(file, {
@@ -72256,13 +72106,118 @@ function findUpPackage(file) {
72256
72106
  let dirPath = getParentDirectory(file);
72257
72107
 
72258
72108
  do {
72259
- const dir = getFilename$2(dirPath);
72260
- [packageJSON] = findFile$2(dirPath, join$1(dir, 'package.json'));
72109
+ const dir = getFilename(dirPath);
72110
+ [packageJSON] = findFile(dirPath, join$1(dir, 'package.json'));
72261
72111
  } while (!packageJSON && (dirPath = getParentDirectory(dirPath)));
72262
72112
 
72263
72113
  return packageJSON;
72264
72114
  }
72265
72115
 
72116
+ var renameFileWithFn = /*#__PURE__*/Object.freeze({
72117
+ __proto__: null,
72118
+ createScan: createScan$1,
72119
+ fix: fix$1,
72120
+ report: report$1
72121
+ });
72122
+
72123
+ const returns = (a) => () => a;
72124
+
72125
+ const report = (path, {mask, from, to}) => {
72126
+ if (!mask)
72127
+ return `Rename '${from}' to '${to}'`;
72128
+
72129
+ return `Rename '${mask}' to '${mask.replace(from, to)}'`;
72130
+ };
72131
+
72132
+ const fix = (path, {from, to}) => {
72133
+ const filename = getFilename(path);
72134
+ const newFilename = filename.replace(from, to);
72135
+
72136
+ renameFile(path, newFilename);
72137
+ };
72138
+
72139
+ const createScan = (baseOptions) => (rootPath, {push, options, trackFile}) => {
72140
+ const from = options.from || baseOptions.from;
72141
+ const to = options.to || baseOptions.to;
72142
+ const mask = options.mask || baseOptions.mask;
72143
+ const near = options.near || baseOptions.near;
72144
+ const checkNear = near ? createCheckNear(near) : returns(true);
72145
+
72146
+ if (!from || !to)
72147
+ return {};
72148
+
72149
+ for (const file of trackFile(rootPath, mask || from).filter(checkNear)) {
72150
+ push(file, {
72151
+ from,
72152
+ to,
72153
+ mask,
72154
+ });
72155
+ }
72156
+ };
72157
+
72158
+ const createCheckNear = (near) => (file) => {
72159
+ const parentDirectory = getParentDirectory(file);
72160
+
72161
+ for (const currentFile of readDirectory(parentDirectory)) {
72162
+ const type = getFileType(currentFile);
72163
+
72164
+ if (type !== 'file')
72165
+ continue;
72166
+
72167
+ const name = getFilename(currentFile);
72168
+ const base = basename(name);
72169
+
72170
+ if (base === near)
72171
+ return true;
72172
+ }
72173
+
72174
+ return false;
72175
+ };
72176
+
72177
+ var renameFileByMask = /*#__PURE__*/Object.freeze({
72178
+ __proto__: null,
72179
+ createScan: createScan,
72180
+ fix: fix,
72181
+ report: report
72182
+ });
72183
+
72184
+ const renameFiles = ({type, mask, rename, from, to, near} = {}) => {
72185
+ if (rename) {
72186
+ const {
72187
+ report,
72188
+ fix,
72189
+ createScan,
72190
+ } = renameFileWithFn;
72191
+
72192
+ return {
72193
+ report,
72194
+ fix,
72195
+ scan: createScan({
72196
+ type,
72197
+ mask,
72198
+ rename,
72199
+ }),
72200
+ };
72201
+ }
72202
+
72203
+ const {
72204
+ report,
72205
+ fix,
72206
+ createScan,
72207
+ } = renameFileByMask;
72208
+
72209
+ return {
72210
+ fix,
72211
+ report,
72212
+ scan: createScan({
72213
+ mask,
72214
+ from,
72215
+ to,
72216
+ near,
72217
+ }),
72218
+ };
72219
+ };
72220
+
72266
72221
  const {stringLiteral} = lib_exports;
72267
72222
  const getValue = ({value}) => value;
72268
72223
 
@@ -72428,106 +72383,106 @@ function hasParens(path, printer = getPrinter(path)) {
72428
72383
  }
72429
72384
 
72430
72385
  var operator = /*#__PURE__*/Object.freeze({
72431
- __proto__: null,
72432
- __filesystem: __filesystem,
72433
- __filesystem_name: __filesystem_name$2,
72434
- __ignore: __ignore,
72435
- __ignore_name: __ignore_name,
72436
- __json: __json,
72437
- __json_name: __json_name,
72438
- __toml: __toml,
72439
- __toml_name: __toml_name,
72440
- __yaml: __yaml,
72441
- __yaml_name: __yaml_name,
72442
- addArgs: addArgs,
72443
- addAttribute: addAttribute,
72444
- addAttributeValue: addAttributeValue,
72445
- addClassName: addClassName,
72446
- addParens: addParens,
72447
- compare: compare,
72448
- compareAll: compareAll,
72449
- compareAny: compareAny,
72450
- compute: compute,
72451
- contains: contains,
72452
- containsClassName: containsClassName,
72453
- copyFile: copyFile,
72454
- createDirectory: createDirectory$1,
72455
- createFile: createFile,
72456
- createNestedDirectory: createNestedDirectory,
72457
- declare: declare$1,
72458
- deinit: deinit,
72459
- extract: extract,
72460
- findBinding: findBinding,
72461
- findFile: findFile$2,
72462
- findVarsWays: findVarsWays,
72463
- fromJS: fromJS,
72464
- getAttributeNode: getAttributeNode,
72465
- getAttributePath: getAttributePath,
72466
- getAttributeValue: getAttributeValue,
72467
- getBinding: getBinding,
72468
- getBindingPath: getBindingPath,
72469
- getClassName: getClassName,
72470
- getExportDefault: getExportDefault,
72471
- getFileContent: getFileContent,
72472
- getFileType: getFileType$2,
72473
- getFilename: getFilename$2,
72474
- getLiteralRaw: getLiteralRaw,
72475
- getParentDirectory: getParentDirectory,
72476
- getPathAfterImports: getPathAfterImports,
72477
- getPathAfterRequires: getPathAfterRequires,
72478
- getProperties: getProperties,
72479
- getProperty: getProperty$2,
72480
- getRootDirectory: getRootDirectory,
72481
- getTemplateValues: getTemplateValues,
72482
- getValues: getValues,
72483
- hasAttributeValue: hasAttributeValue,
72484
- hasDataName: hasDataName,
72485
- hasParens: hasParens,
72486
- hasTagName: hasTagName,
72487
- ignore: ignore,
72488
- init: init,
72489
- insertAfter: insertAfter,
72490
- insertBefore: insertBefore,
72491
- isConditionKeyword: isConditionKeyword,
72492
- isDeclarationKeyword: isDeclarationKeyword,
72493
- isESM: isESM,
72494
- isJSON: isJSON,
72495
- isKeyword: isKeyword,
72496
- isModuleDeclarationKeyword: isModuleDeclarationKeyword,
72497
- isModuleExports: isModuleExports,
72498
- isSimple: isSimple,
72499
- isSimpleRegExp: isSimpleRegExp,
72500
- isStatementKeyword: isStatementKeyword,
72501
- isTSKeyword: isTSKeyword,
72502
- isTemplate: isTemplate,
72503
- matchFiles: matchFiles,
72504
- moveFile: moveFile,
72505
- parseTemplate: parseTemplate,
72506
- pause: pause,
72507
- readDirectory: readDirectory,
72508
- readFileContent: readFileContent,
72509
- remove: remove,
72510
- removeAttributeValue: removeAttributeValue,
72511
- removeClassName: removeClassName,
72512
- removeEmptyDirectory: removeEmptyDirectory,
72513
- removeFile: removeFile,
72514
- removeParens: removeParens,
72515
- rename: rename,
72516
- renameFile: renameFile,
72517
- renameFiles: renameFiles,
72518
- renameProperty: renameProperty,
72519
- replaceWith: replaceWith$2,
72520
- replaceWithMultiple: replaceWithMultiple,
72521
- setAttributeValue: setAttributeValue,
72522
- setLiteralValue: setLiteralValue,
72523
- setValues: setValues,
72524
- start: start,
72525
- toExpression: toExpression,
72526
- toJS: toJS,
72527
- transformRegExp: transformRegExp,
72528
- traverse: traverse$1,
72529
- traverseProperties: traverseProperties,
72530
- writeFileContent: writeFileContent
72386
+ __proto__: null,
72387
+ __filesystem: __filesystem,
72388
+ __filesystem_name: __filesystem_name,
72389
+ __ignore: __ignore,
72390
+ __ignore_name: __ignore_name,
72391
+ __json: __json,
72392
+ __json_name: __json_name,
72393
+ __toml: __toml,
72394
+ __toml_name: __toml_name,
72395
+ __yaml: __yaml,
72396
+ __yaml_name: __yaml_name,
72397
+ addArgs: addArgs,
72398
+ addAttribute: addAttribute,
72399
+ addAttributeValue: addAttributeValue,
72400
+ addClassName: addClassName,
72401
+ addParens: addParens,
72402
+ compare: compare,
72403
+ compareAll: compareAll,
72404
+ compareAny: compareAny,
72405
+ compute: compute,
72406
+ contains: contains,
72407
+ containsClassName: containsClassName,
72408
+ copyFile: copyFile,
72409
+ createDirectory: createDirectory,
72410
+ createFile: createFile,
72411
+ createNestedDirectory: createNestedDirectory,
72412
+ declare: declare$1,
72413
+ deinit: deinit,
72414
+ extract: extract,
72415
+ findBinding: findBinding,
72416
+ findFile: findFile,
72417
+ findVarsWays: findVarsWays,
72418
+ fromJS: fromJS,
72419
+ getAttributeNode: getAttributeNode,
72420
+ getAttributePath: getAttributePath,
72421
+ getAttributeValue: getAttributeValue,
72422
+ getBinding: getBinding,
72423
+ getBindingPath: getBindingPath,
72424
+ getClassName: getClassName,
72425
+ getExportDefault: getExportDefault,
72426
+ getFileContent: getFileContent,
72427
+ getFileType: getFileType,
72428
+ getFilename: getFilename,
72429
+ getLiteralRaw: getLiteralRaw,
72430
+ getParentDirectory: getParentDirectory,
72431
+ getPathAfterImports: getPathAfterImports,
72432
+ getPathAfterRequires: getPathAfterRequires,
72433
+ getProperties: getProperties,
72434
+ getProperty: getProperty,
72435
+ getRootDirectory: getRootDirectory,
72436
+ getTemplateValues: getTemplateValues,
72437
+ getValues: getValues,
72438
+ hasAttributeValue: hasAttributeValue,
72439
+ hasDataName: hasDataName,
72440
+ hasParens: hasParens,
72441
+ hasTagName: hasTagName,
72442
+ ignore: ignore,
72443
+ init: init,
72444
+ insertAfter: insertAfter,
72445
+ insertBefore: insertBefore,
72446
+ isConditionKeyword: isConditionKeyword,
72447
+ isDeclarationKeyword: isDeclarationKeyword,
72448
+ isESM: isESM,
72449
+ isJSON: isJSON,
72450
+ isKeyword: isKeyword,
72451
+ isModuleDeclarationKeyword: isModuleDeclarationKeyword,
72452
+ isModuleExports: isModuleExports,
72453
+ isSimple: isSimple,
72454
+ isSimpleRegExp: isSimpleRegExp,
72455
+ isStatementKeyword: isStatementKeyword,
72456
+ isTSKeyword: isTSKeyword,
72457
+ isTemplate: isTemplate,
72458
+ matchFiles: matchFiles,
72459
+ moveFile: moveFile,
72460
+ parseTemplate: parseTemplate,
72461
+ pause: pause,
72462
+ readDirectory: readDirectory,
72463
+ readFileContent: readFileContent,
72464
+ remove: remove,
72465
+ removeAttributeValue: removeAttributeValue,
72466
+ removeClassName: removeClassName,
72467
+ removeEmptyDirectory: removeEmptyDirectory,
72468
+ removeFile: removeFile,
72469
+ removeParens: removeParens,
72470
+ rename: rename,
72471
+ renameFile: renameFile,
72472
+ renameFiles: renameFiles,
72473
+ renameProperty: renameProperty,
72474
+ replaceWith: replaceWith,
72475
+ replaceWithMultiple: replaceWithMultiple,
72476
+ setAttributeValue: setAttributeValue,
72477
+ setLiteralValue: setLiteralValue,
72478
+ setValues: setValues,
72479
+ start: start,
72480
+ toExpression: toExpression,
72481
+ toJS: toJS,
72482
+ transformRegExp: transformRegExp,
72483
+ traverse: traverse$1,
72484
+ traverseProperties: traverseProperties,
72485
+ writeFileContent: writeFileContent
72531
72486
  });
72532
72487
 
72533
72488
  const codeframe = ({source, error, highlightCode = true}) => {
@@ -72547,20 +72502,20 @@ const codeframe = ({source, error, highlightCode = true}) => {
72547
72502
  };
72548
72503
 
72549
72504
  var exports$1 = /*#__PURE__*/Object.freeze({
72550
- __proto__: null,
72551
- codeframe: codeframe,
72552
- findPlaces: findPlaces,
72553
- findPlacesAsync: findPlacesAsync,
72554
- generate: generate,
72555
- operator: operator,
72556
- parse: parse$2,
72557
- print: print,
72558
- putoutAsync: putoutAsync,
72559
- template: template$1,
72560
- transform: transform,
72561
- transformAsync: transformAsync,
72562
- traverse: traverse3,
72563
- types: lib_exports
72505
+ __proto__: null,
72506
+ codeframe: codeframe,
72507
+ findPlaces: findPlaces,
72508
+ findPlacesAsync: findPlacesAsync,
72509
+ generate: generate,
72510
+ operator: operator,
72511
+ parse: parse$2,
72512
+ print: print,
72513
+ putoutAsync: putoutAsync,
72514
+ template: template$1,
72515
+ transform: transform,
72516
+ transformAsync: transformAsync,
72517
+ traverse: traverse3,
72518
+ types: lib_exports
72564
72519
  });
72565
72520
 
72566
72521
  Object.assign(putout, exports$1);