{"_id":"@putout/plugin-apply-nullish-coalescing","_rev":"2-d68965ff0782468a68d39f37e98aaca3","name":"@putout/plugin-apply-nullish-coalescing","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@putout/plugin-apply-nullish-coalescing","version":"1.0.0","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin add ability to apply nullish coalescing operator (??)","homepage":"http://github.com/coderaiser/putout","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","lint":"madrun lint","fix:lint":"madrun fix:lint","coverage":"madrun coverage"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","nullish-coalescing"],"devDependencies":{"@putout/test":"^1.0.0","coveralls":"^3.0.0","eslint":"^6.2.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^3.0.0","lerna":"^3.8.5","madrun":"^5.0.0","nodemon":"^2.0.1","nyc":"^14.0.0","supertape":"^1.0.3"},"peerDependencies":{"putout":">=7"},"license":"MIT","engines":{"node":">=8.3.0"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-apply-nullish-coalescing@1.0.0","_nodeVersion":"13.8.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-8oNOzREx9cXaeRcVr2hN59PNcZ1Ymgty7eFpJ9x1bVjQcqjAikYGqaF8e1X2WWjcCJciiue//fNntLeC6OM0+Q==","shasum":"98a923f4adcaa5af73ceb1cff4e83353c51915c1","tarball":"https://registry.npmjs.org/@putout/plugin-apply-nullish-coalescing/-/plugin-apply-nullish-coalescing-1.0.0.tgz","fileCount":4,"unpackedSize":3633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeP+fACRA9TVsSAnZWagAA79MP/0ZPy7rcXK47hIbMu7an\nYVMLCcF4cLAnqn+6M+UPdpecuMgE+YG6G6+lHDGhFeXn6duQi+f8aQ4q0Sxd\nIasNztDFSmL13/p93OwOhxpv+A1HpGBIntdVXzZgR1pbI3vkhm6572kAJvPb\ndqG2ZvKnM/SQYjaapRi5N0aHlHKd8I7EtEZSoNrspncFHwpA3kEZihjn2smy\nyU2/WxRGwbqc6opDyrRWI3yzpFevssjwystdO+9dzO/Hwp1kSDYDQFRZpH0P\n/0mTy7E59SmWluDf2KtMvOsTvDgU1DI75NhXbOJJF7V7j2FUUgRuqxc4nZGX\nSZYFYIPa7V3GWrkwHzw50p9jMQNcJ1Zu72Jvt/r9qQIGiCHArm2+enRg1ry1\nYnxTqIjvkjlWzGBLbz8F/GbaI8LEy6+oZ8/kNTVFioYqam/vC1gbEqapsCa9\nPH1SOIVXX0TfFD25PGD1Vxt+LoRAKyCeYPthejZhB6gxtDkSnhap/z4pe+hu\nNocqhaziXUlmd1w0ESVnxj/cQGYaZF+W4in3eXy5e6rarX4++KEnhpUWTbuc\nQuO3uR54q1bGBGdxw6WwMoBV+oQSuDEjWcUF40JYNiRE1Cfr2px04R6pYemD\nDe+U9+HJLuwpnCsz6Rw0lg1y6VFP1yK4/IcvCEYHzypWySz4Bbt/22Q22RZ7\nDjed\r\n=voK5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUQIpsSRrpWAnn4veDUgApJYsegHp0V18cQ6K8+f93qAiBTo8Ni9yqi/NLPc76/eJEuEwa34C6ZZWa2dvFK1Zsgtw=="}]},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-apply-nullish-coalescing_1.0.0_1581246400140_0.4052824571441025"},"_hasShrinkwrap":false},"2.0.0":{"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":"https://registry.npmjs.org/@putout/plugin-apply-nullish-coalescing/-/plugin-apply-nullish-coalescing-2.0.0.tgz","fileCount":4,"unpackedSize":4222,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSnEh+jSEkYvynmjYtWHDSE1yFKuFStT7pigxvQJ1eiAIhAOhDQUh9XYlYMBDQnvr4289g94aq0keDZQJY06QyVg6u"}]},"_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}},"time":{"created":"2020-02-09T11:06:39.953Z","1.0.0":"2020-02-09T11:06:40.273Z","modified":"2023-08-25T11:00:30.300Z","2.0.0":"2023-08-25T11:00:30.116Z"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"description":"🐊Putout plugin add ability to apply nullish coalescing operator (??)","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-nullish-coalescing#readme","keywords":["putout","putout-plugin","plugin","nullish-coalescing"],"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT","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","readmeFilename":"README.md"}