@putout/engine-runner 24.1.4 → 24.2.1
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/includer/index.js +0 -1
- package/lib/replacer/index.js +8 -1
- package/package.json +2 -2
package/lib/includer/index.js
CHANGED
package/lib/replacer/index.js
CHANGED
|
@@ -92,6 +92,13 @@ module.exports.clearWatermark = (ast) => {
|
|
|
92
92
|
|
|
93
93
|
const isFn = (a) => typeof a === 'function';
|
|
94
94
|
|
|
95
|
+
const parseExpression = (nodeFrom, {node}) => {
|
|
96
|
+
if (nodeFrom.type !== node.type && isExpressionStatement(node))
|
|
97
|
+
return node.expression;
|
|
98
|
+
|
|
99
|
+
return node;
|
|
100
|
+
};
|
|
101
|
+
|
|
95
102
|
const fix = (from, to, path) => {
|
|
96
103
|
const nodeFrom = template.ast(from);
|
|
97
104
|
const mark = watermark(from, to, path);
|
|
@@ -102,7 +109,7 @@ const fix = (from, to, path) => {
|
|
|
102
109
|
return;
|
|
103
110
|
|
|
104
111
|
const waysFrom = findVarsWays(nodeFrom);
|
|
105
|
-
const
|
|
112
|
+
const node = parseExpression(nodeFrom, path);
|
|
106
113
|
|
|
107
114
|
const values = getValues({
|
|
108
115
|
waysFrom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-runner",
|
|
3
|
-
"version": "24.1
|
|
3
|
+
"version": "24.2.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Run 🐊Putout plugins",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@putout/compare": "^17.0.0",
|
|
33
33
|
"@putout/engine-parser": "^13.0.0",
|
|
34
34
|
"@putout/operate": "^13.0.0",
|
|
35
|
-
"@putout/operator-declare": "^
|
|
35
|
+
"@putout/operator-declare": "^13.0.0",
|
|
36
36
|
"@putout/operator-filesystem": "^8.0.0",
|
|
37
37
|
"@putout/operator-json": "^2.0.0",
|
|
38
38
|
"@putout/plugin-filesystem": "^10.0.0",
|