@putout/plugin-conditions 8.5.0 → 8.7.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.
@@ -97,7 +97,14 @@ export const filter = (path) => {
97
97
  const couple = [];
98
98
 
99
99
  for (const path of paths) {
100
- const is = isBlockStatement(path) && path.node.body.length > 1;
100
+ if (!isBlockStatement(path)) {
101
+ couple.push(false);
102
+ continue;
103
+ }
104
+
105
+ const {length} = path.node.body;
106
+ const is = length > 1 || !length;
107
+
101
108
  couple.push(is);
102
109
  }
103
110
 
@@ -4,6 +4,8 @@ export const replace = () => ({
4
4
  '!(__a > __b)': '__a <= __b',
5
5
  '!(__a !== __b && __c === __d)': '__a === __b || __c !== __d',
6
6
  '!(__a !== __b || __c !== __d)': '__a === __b && __c === __d',
7
+ '!(__a || __b || __c || __d)': '!__a && !__b && !__c && !__d',
8
+ '!(__a || __b || __c)': '!__a && !__b && !__c',
7
9
  '!(__a || __b)': '!__a && !__b',
8
10
  '!(__a <= __b)': '__a > __b',
9
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-conditions",
3
- "version": "8.5.0",
3
+ "version": "8.7.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds support of conditions transformations",