@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.
- package/lib/apply-async-formatter/index.js +1 -2
- package/lib/apply-namaspace-specifier/index.js +1 -2
- package/lib/check-match/index.js +1 -2
- package/lib/check-replace-code/generate-code.js +2 -4
- package/lib/convert-destructuring-to-identifier/index.js +1 -2
- package/lib/convert-traverse-to-include/index.js +1 -2
- package/lib/declare/operator/filesystem.js +2 -0
- package/lib/declare/operator/index.js +2 -0
- package/lib/declare/operator/json.js +8 -0
- package/package.json +2 -2
|
@@ -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') {
|
package/lib/check-match/index.js
CHANGED
|
@@ -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
|
],
|
|
@@ -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',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "
|
|
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": ">=
|
|
51
|
+
"putout": ">=33"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"engines": {
|