@putout/plugin-putout 15.5.0 → 16.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,9 +35,8 @@ const create = (name) => (vars, path) => {
35
35
  ]),
36
36
  ];
37
37
 
38
- if (compare(body[n], 't.end()')) {
38
+ if (compare(body[n], 't.end()'))
39
39
  body.pop();
40
- }
41
40
 
42
41
  return `await ${name}(__args)`;
43
42
  };
@@ -62,9 +62,8 @@ const createImportVisitor = ({push, names, pathStore = noop}) => ({
62
62
 
63
63
  const {defaults, imports} = parseImportSpecifiers(specifiers);
64
64
 
65
- if (defaults.length && imports.length) {
65
+ if (defaults.length && imports.length)
66
66
  return;
67
- }
68
67
 
69
68
  for (const name of names) {
70
69
  if (value === name || name === 'any') {
@@ -45,9 +45,8 @@ module.exports.match = () => ({
45
45
  });
46
46
 
47
47
  for (const name of namesMatch) {
48
- if (!namesReplace.includes(name)) {
48
+ if (!namesReplace.includes(name))
49
49
  return true;
50
- }
51
50
  }
52
51
 
53
52
  return false;
@@ -67,13 +67,11 @@ module.exports = (rootPath, key) => {
67
67
  return replaceWith(path, ArrayPattern([]));
68
68
  }
69
69
 
70
- if (name === '__object') {
70
+ if (name === '__object')
71
71
  return objectify(path);
72
- }
73
72
 
74
- if (name === '__body') {
73
+ if (name === '__body')
75
74
  replaceWith(path, BlockStatement([]));
76
- }
77
75
  },
78
76
  }],
79
77
  ],
@@ -16,9 +16,8 @@ module.exports.replace = () => ({
16
16
 
17
17
  function findUp(path, str) {
18
18
  while (!path.isProgram()) {
19
- if (path.isAssignmentExpression()) {
19
+ if (path.isAssignmentExpression())
20
20
  return compare(path, str);
21
- }
22
21
 
23
22
  path = path.parentPath;
24
23
  }
@@ -23,9 +23,8 @@ module.exports.match = () => ({
23
23
  return false;
24
24
 
25
25
  for (const propertyPath of __aPath.get('properties')) {
26
- if (isPush(propertyPath) || isBlock(propertyPath)) {
26
+ if (isPush(propertyPath) || isBlock(propertyPath))
27
27
  return true;
28
- }
29
28
  }
30
29
 
31
30
  return false;
@@ -7,4 +7,6 @@ module.exports = {
7
7
  moveFile: 'const {moveFile} = operator',
8
8
  createDirectory: 'const {createDirectory} = operator',
9
9
  getParentDirectory: 'const {getParentDirectory} = operator',
10
+ readFileContent: 'const {readFileContent} = operator',
11
+ writeFileContent: 'const {writeFileContent} = operator',
10
12
  };
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const filesystem = require('./filesystem');
4
+ const json = require('./json');
4
5
 
5
6
  module.exports = {
6
7
  ...filesystem,
8
+ ...json,
7
9
  operator: `import {operator} from 'putout'`,
8
10
  compare: 'const {compare} = operator',
9
11
  compareAll: 'const {compareAll} = operator',
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ toJS: 'const {toJS} = operator',
5
+ fromJS: 'const {fromJS} = operator',
6
+ __filesystem: 'const {__filesystem} = operator',
7
+ __json: 'const {__json} = operator',
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "15.5.0",
3
+ "version": "16.1.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",
@@ -48,7 +48,7 @@
48
48
  "nodemon": "^3.0.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "putout": ">=32"
51
+ "putout": ">=33"
52
52
  },
53
53
  "license": "MIT",
54
54
  "engines": {