{"name":"@putout/operator-parens","version":"1.2.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout operator adds ability to work with parens","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-parens#readme","main":"lib/parens.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"keywords":["putout","putout-operator","operator","parens"],"devDependencies":{"@putout/eslint-flat":"^2.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^24.0.0","lerna":"^6.0.1","madrun":"^10.0.0","montag":"^1.2.1","nodemon":"^3.0.1","putout":"^38.1.1","supertape":"^10.0.0","try-catch":"^3.0.0"},"license":"MIT","engines":{"node":">=18"},"publishConfig":{"access":"public"},"dependencies":{"@putout/babel":"^3.0.0"},"_id":"@putout/operator-parens@1.2.0","gitHead":"441bc7700db6bf90ea6f9ce9003bc0cb7e255b1c","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-pl6n9drxYXbyyqwBfZWPrL5nwXYsX+gGqnwpbzUeBE6n8RLB3MFB/n1CmFiIE0Ae9sBxFQQtU0FS6NW16/k2VQ==","shasum":"eb252b60a341e538c54808f8fe74d66e556cf07d","tarball":"http://registry-npm.ywwl.com/@putout/operator-parens/download/@putout/operator-parens-1.2.0.tgz","fileCount":4,"unpackedSize":5454,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDqFFit6y8VEp/yb3+0loEyDCIGRAzVW4OjbMjy+05fCAIhAMLvQf9y+mdzmCtkbMuSivKFAr4apVEtuHqdFCT34jw+"}],"size":2216,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-1.2.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_1.2.0_1739550940302_0.4592911309255694"},"_hasShrinkwrap":false,"readme":"# @putout/operator-parens [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/operator-parens.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/operator-parens \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) operator adds ability to lint parens.\n\n## Install\n\n```\nnpm i putout @putout/operator-parens\n```\n\n## API\n\n### `addParens(path: Path): Path`\n\nAdd parens around expression depending on used `printer`:\n\n- ✅ set `node.extra.parenthesized: true` when `@putout/printer` used;\n- ✅ set add `ParenthesizedExpression` or `TSParenthesizedType` when `babel` used;\n\n```js\nimport {operator} from 'putout';\n\nconst {addParens} = operator;\n\naddParens(path);\n```\n\n### `removeParens(path: Path): Path`\n\nRemove parens around expression depending on used `printer`:\n\n- ✅ set `node.extra.parenthesized: false` when `@putout/printer` used;\n- ✅ remove `ParenthesizedExpression` or `TSParenthesizedType` when `babel` used;\n\n```js\nimport {operator} from 'putout';\n\nconst {removeParens} = operator;\n\nremoveParens(path);\n```\n\n### `hasParens(path: Path): Boolean`\n\nCheck if `path` has parens around expression depending on used `printer`:\n\n- ✅ checks `node.extra.parenthesized` when `@putout/printer` used;\n- ✅ check if parent node type is `ParenthesizedExpression` or `TSParenthesizedType` when `babel` used;\n\n```js\nimport {operator} from 'putout';\n\nconst {hasParens} = operator;\n\nhasParens(path);\n```\n\n## License\n\nMIT\n","publish_time":1739550940509,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1739550940509,"dist-tags":{"latest":"4.1.0"}}