{"name":"@putout/operator-parens","version":"2.0.0","keywords":["putout","putout-operator","operator","parens"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/operator-parens@2.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-parens#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"62ddc5e7a13dfa3dfcc77c0bed9999a756896e72","tarball":"http://registry-npm.ywwl.com/@putout/operator-parens/download/@putout/operator-parens-2.0.0.tgz","fileCount":4,"integrity":"sha512-ufCGMa7pt/SajYi0fKXm8eanD9s/0w9ztawwEUAlLtn0qvdyuSUVt7v3xZiKPxaad1oCsIRoMDP8Yh6TQlx4mQ==","signatures":[{"sig":"MEUCIQCBLFEOpLDnSEiAi+GD9S5AJqMTU9+lksVcFaCNxWxVTQIgJDIBuil3XoX8HjOCeCM3sWNAnwnY3tLf5wEKk6ryG0E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5388,"size":2200,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-2.0.0.tgz"},"main":"lib/parens.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"1d56cf77e987f3c6b11c67cd41073eb7f2560d71","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.1.0","description":"🐊Putout operator adds ability to work with parens","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@putout/babel":"^4.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","montag":"^1.2.1","putout":"*","nodemon":"^3.0.1","supertape":"^11.0.3","try-catch":"^3.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^27.0.0"},"_npmOperationalInternal":{"tmp":"tmp/operator-parens_2.0.0_1748729368721_0.4655517004278267","host":"s3://npm-registry-packages-npm-production"},"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":1748729368896,"_cnpm_publish_time":1748729368896,"dist-tags":{"latest":"4.1.0"}}