@putout/plugin-putout 10.0.1 → 10.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.
|
@@ -44,6 +44,9 @@ module.exports.traverse = ({push}) => ({
|
|
|
44
44
|
if (get(path))
|
|
45
45
|
return;
|
|
46
46
|
|
|
47
|
+
if (hasMatch(path))
|
|
48
|
+
return;
|
|
49
|
+
|
|
47
50
|
for (const propertyPath of path.get('right.body.properties')) {
|
|
48
51
|
if (!propertyPath.get('value').isStringLiteral())
|
|
49
52
|
continue;
|
|
@@ -117,3 +120,14 @@ function parseKey(propertyPath) {
|
|
|
117
120
|
return [null, key];
|
|
118
121
|
}
|
|
119
122
|
|
|
123
|
+
function hasMatch(path) {
|
|
124
|
+
const {body} = path.scope.getProgramParent().path.node;
|
|
125
|
+
|
|
126
|
+
for (const current of body) {
|
|
127
|
+
if (compare(current, 'module.exports.match = __a'))
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
package/package.json
CHANGED