Skip to content

Commit 7f3818b

Browse files
committed
feature: @putout/plugin-putout: declare: hasAttributeValue: add
1 parent 5fb4415 commit 7f3818b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/plugin-putout/lib/declare/jsx.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,14 @@ test('plugin-putout: declare: transform: jsx: hasDataName', (t) => {
139139
`);
140140
t.end();
141141
});
142+
143+
test('plugin-putout: declare: transform: jsx: hasAttribute', (t) => {
144+
t.transformCode(`hasAttributeValue(path, 'data-menu-index', '1')`, montag`
145+
import {operator} from 'putout';
146+
147+
const {hasAttributeValue} = operator;
148+
hasAttributeValue(path, 'data-menu-index', '1');
149+
150+
`);
151+
t.end();
152+
});

packages/plugin-putout/lib/declare/operator/jsx.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
getAttributeNode: 'const {getAttributeNode} = operator',
55
getAttributeValue: 'const {getAttributeValue} = operator',
66
addAttributeValue: 'const {addAttributeValue} = operator',
7+
hasAttributeValue: 'const {hasAttributeValue} = operator',
78
removeAttributeValue: 'const {removeAttributeValue} = operator',
89
setAttributeValue: 'const {setAttributeValue} = operator',
910
addClassName: 'const {addClassName} = operator',

0 commit comments

Comments
 (0)