{"_id":"@putout/operator-parens","_rev":"4160162","name":"@putout/operator-parens","description":"🐊Putout operator adds ability to work with parens","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"time":{"modified":"2026-03-01T20:37:39.000Z","created":"2025-02-10T10:27:17.252Z","4.0.0":"2026-01-04T15:04:09.237Z","3.0.0":"2025-11-28T16:14:10.712Z","2.0.0":"2025-05-31T22:09:28.896Z","1.2.0":"2025-02-14T16:35:40.509Z","1.1.0":"2025-02-14T10:19:57.997Z","1.0.0":"2025-02-10T10:27:17.252Z"},"users":{},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"versions":{"4.0.0":{"name":"@putout/operator-parens","version":"4.0.0","type":"module","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":{"c8":"^10.0.0","eslint":"^10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^29.0.0","madrun":"^12.0.0","montag":"^1.2.1","nodemon":"^3.0.1","putout":"*","supertape":"^11.0.3"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"dependencies":{"@putout/babel":"^5.0.0"},"_id":"@putout/operator-parens@4.0.0","gitHead":"2e378d6c21e09856bcc20232e28390920bc16e65","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.4.2","dist":{"shasum":"1fa0321ae606f62fb212d8a1b7735b97210e8550","size":2173,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-4.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_4.0.0_1767539049105_0.39872296203665236"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-04T15:04:09.237Z","publish_time":1767539049237,"_source_registry_name":"default","_cnpm_publish_time":1767539049237},"3.0.0":{"name":"@putout/operator-parens","version":"3.0.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":{"c8":"^10.0.0","eslint":"v10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^28.0.0","madrun":"^11.0.0","montag":"^1.2.1","nodemon":"^3.0.1","putout":"*","supertape":"^11.0.3","try-catch":"^3.0.0"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"dependencies":{"@putout/babel":"^5.0.0"},"_id":"@putout/operator-parens@3.0.0","gitHead":"b4c6453d08d8fabf7a30ce8657962cf26f079267","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.4.2","dist":{"shasum":"f93b98da58593edd659c25988604061a950b44ec","size":2207,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-3.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_3.0.0_1764346450472_0.7713248951621317"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-28T16:14:10.712Z","publish_time":1764346450712,"_source_registry_name":"default","_cnpm_publish_time":1764346450712},"2.0.0":{"name":"@putout/operator-parens","version":"2.0.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":{"c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^27.0.0","madrun":"^11.0.0","montag":"^1.2.1","nodemon":"^3.0.1","putout":"*","supertape":"^11.0.3","try-catch":"^3.0.0"},"license":"MIT","engines":{"node":">=18"},"publishConfig":{"access":"public"},"dependencies":{"@putout/babel":"^4.0.1"},"_id":"@putout/operator-parens@2.0.0","gitHead":"1d56cf77e987f3c6b11c67cd41073eb7f2560d71","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"20.19.0","_npmVersion":"11.1.0","dist":{"shasum":"62ddc5e7a13dfa3dfcc77c0bed9999a756896e72","size":2200,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-2.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_2.0.0_1748729368721_0.4655517004278267"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-31T22:09:28.896Z","publish_time":1748729368896,"_source_registry_name":"default","_cnpm_publish_time":1748729368896},"1.2.0":{"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":{"shasum":"eb252b60a341e538c54808f8fe74d66e556cf07d","size":2216,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-1.2.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_1.2.0_1739550940302_0.4592911309255694"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-14T16:35:40.509Z","publish_time":1739550940509,"_source_registry_name":"default","_cnpm_publish_time":1739550940509},"1.1.0":{"name":"@putout/operator-parens","version":"1.1.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.1.0","gitHead":"384cc6f2ffded0f190993a403f621fbfea219516","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.0","dist":{"shasum":"0b267c98be2b0e251ecb3d4cdeaff3cd9bdf5768","size":2182,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-1.1.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_1.1.0_1739528397797_0.5774086507445046"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-14T10:19:57.997Z","publish_time":1739528397997,"_source_registry_name":"default","_cnpm_publish_time":1739528397997},"1.0.0":{"name":"@putout/operator-parens","version":"1.0.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":{"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","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.0.0","gitHead":"9331e96fe7e990859d3290d00e1507f6202b6dc6","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.13.1","_npmVersion":"10.9.0","dist":{"shasum":"d71c595568603304a3277eb962011be5951834ca","size":2139,"noattachment":false,"key":"/@putout/operator-parens/-/@putout/operator-parens-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/operator-parens/download/@putout/operator-parens-1.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-parens_1.0.0_1739183237089_0.4605532273357025"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-10T10:27:17.252Z","publish_time":1739183237252,"_source_registry_name":"default","_cnpm_publish_time":1739183237252}},"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","_attachments":{},"homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-parens#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT"}