🐊Putout operator adds ability to work with parens
npm install @putout/operator-parens[NPMIMGURL]: https://img.shields.io/npm/v/@putout/operator-parens.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/operator-parens "npm"
🐊Putout operator adds ability to lint parens.
```
npm i putout @putout/operator-parens
Add parens around expression depending on used printer:
- ✅ set node.extra.parenthesized: true when @putout/printer used;ParenthesizedExpression
- ✅ set add or TSParenthesizedType when babel used;
`js
import {operator} from 'putout';
const {addParens} = operator;
addParens(path);
`
Remove parens around expression depending on used printer:
- ✅ set node.extra.parenthesized: false when @putout/printer used;ParenthesizedExpression
- ✅ remove or TSParenthesizedType when babel used;
`js
import {operator} from 'putout';
const {removeParens} = operator;
removeParens(path);
`
Check if path has parens around expression depending on used printer:
- ✅ checks node.extra.parenthesized when @putout/printer used;ParenthesizedExpression
- ✅ check if parent node type is or TSParenthesizedType when babel used;
`js
import {operator} from 'putout';
const {hasParens} = operator;
hasParens(path);
``
MIT