Skip to content

Commit 1d66597

Browse files
committed
feature: @putout/plugin-conditions: reverse-condition: !(__a <= __b) -> __a > __b
1 parent bc87467 commit 1d66597

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
path.node.key.name.length > maxPropertiesLengthInOneLine;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!(path.node.key.name.length <= maxPropertiesLengthInOneLine);

β€Žpackages/plugin-conditions/lib/reverse-condition/index.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export const replace = () => ({
55
'!(__a !== __b && __c === __d)': '__a === __b || __c !== __d',
66
'!(__a !== __b || __c !== __d)': '__a === __b && __c === __d',
77
'!(__a || __b)': '!__a && !__b',
8+
'!(__a <= __b)': '__a > __b',
89
});

β€Žpackages/plugin-conditions/lib/reverse-condition/index.spec.jsβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ test('conditions: reverse-condition: transform: not-or', (t) => {
3131
t.transform('not-or');
3232
t.end();
3333
});
34+
35+
test('conditions: reverse-condition: transform: less-equal', (t) => {
36+
t.transform('less-equal');
37+
t.end();
38+
});

0 commit comments

Comments
Β (0)