{"name":"@putout/operator-parens","version":"1.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@1.0.0","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-parens#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"d71c595568603304a3277eb962011be5951834ca","tarball":"http://registry-npm.ywwl.com/@putout/operator-parens/download/@putout/operator-parens-1.0.0.tgz","fileCount":4,"integrity":"sha512-8AFWiKNfmQ9RtK6cNDSprQLqNqHZWGYFPZKwYXm6MTIoYMyLFF0dYZeSPyypNwmAfXsX6bt1vh9Ua20P52RBAg==","signatures":[{"sig":"MEYCIQDKSVfrqDLhK6YVgJcArgZrcFCCuXnC7Yf0UKZwhEQJUwIhAOoC7KXAeO+TYZCEO1V7kmFOu7j/G9AKRpB3zrEDzIG2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5162,"size":2139,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-1.0.0.tgz"},"main":"lib/parens.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"9331e96fe7e990859d3290d00e1507f6202b6dc6","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":"10.9.0","description":"🐊Putout operator adds ability to work with parens","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@putout/babel":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^10.0.0","try-catch":"^3.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/operator-parens_1.0.0_1739183237089_0.4605532273357025","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":1739183237252,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1739183237252,"dist-tags":{"latest":"4.1.0"}}