{"name":"@putout/plugin-apply-nullish-coalescing","version":"2.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin add ability to apply nullish coalescing operator (??)","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-nullish-coalescing#readme","main":"lib/apply-nullish-coalescing.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://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"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","nullish-coalescing"],"devDependencies":{"@putout/test":"^7.0.0","c8":"^8.0.0","eslint":"^8.0.1","eslint-plugin-n":"^16.0.0","eslint-plugin-putout":"^19.0.0","lerna":"^6.0.1","madrun":"^9.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=31"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"c09954c15adc60803d91daeda5b27cbaba37d949","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-apply-nullish-coalescing@2.0.0","_nodeVersion":"20.5.1","_npmVersion":"9.6.6","dist":{"integrity":"sha512-Wuqq8K4pF9BP5R9hxNCqNbp3Y9Djl+H/rtmKjJP5WCc5r4QAmwVIsr/+s3TG/sjT/vdPcQQgW52KX+DV8capSA==","shasum":"7e30f39b91a24d11e26310b887e8cb70a4829fef","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-nullish-coalescing/download/@putout/plugin-apply-nullish-coalescing-2.0.0.tgz","fileCount":4,"unpackedSize":4222,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSnEh+jSEkYvynmjYtWHDSE1yFKuFStT7pigxvQJ1eiAIhAOhDQUh9XYlYMBDQnvr4289g94aq0keDZQJY06QyVg6u"}],"size":2108,"noattachment":false,"key":"/@putout/plugin-apply-nullish-coalescing/-/@putout/plugin-apply-nullish-coalescing-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","tmp":"tmp/plugin-apply-nullish-coalescing_2.0.0_1692961229866_0.10132672889191352"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-nullish-coalescing [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-nullish-coalescing.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-nullish-coalescing\"npm\"\n\n> The **nullish coalescing** operator (`??`) is a logical operator that returns its right-hand side operand when its left-hand side operand is `null` or `undefined`, and otherwise returns its left-hand side operand.\n> This can be seen as a special case of the logical OR (`||`) operator, which returns the right-hand side operand if the left operand is any falsy value, not only `null` or `undefined`. In other words, if you use `||` to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (e.g., `''` or `0`).\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin apply **nullish coalescing**.\n\n## Install\n\n```\nnpm i @putout/plugin-apply-nullish-coalescing\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-nullish-coalescing\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nresult = result || 'hello';\nresult = typeof result === 'undefined' ? 'hello' : result;\n```\n\n## ✅ Example of correct code\n\n```js\nconst result = result ?? 'hello';\n```\n\n## License\n\nMIT\n","publish_time":1692961230116,"_cnpm_publish_time":1692961230116,"dist-tags":{"latest":"2.0.0"}}