{"name":"@putout/plugin-apply-maybe","version":"1.1.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin applies Maybe monad","homepage":"https://github.com/coderaiser/apply-maybe/tree/master/packages/plugin-apply-maybe#readme","main":"lib/index.js","commitType":"colon","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/apply-maybe.git"},"scripts":{"wisdom":"madrun wisdom","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","apply-maybe-plugin","plugin","apply-maybe"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","lerna":"^6.0.1","madrun":"^9.0.0","montag":"^1.2.1","nodemon":"^2.0.1"},"peerDependencies":{"putout":">=28"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"383dac0d2fa0a244c7d877481b908765275b36a4","bugs":{"url":"https://github.com/coderaiser/apply-maybe/issues"},"_id":"@putout/plugin-apply-maybe@1.1.0","_nodeVersion":"18.13.0","_npmVersion":"9.1.3","dist":{"integrity":"sha512-95PJrk/50tq7KmMIUyKwoKHIU5uiLTHZQfzJOlTkqT5PcePmh/mouelQl6X7cBjMtR1NNSPUdOobYeUaGkUg1w==","shasum":"86a82f43d226c1392c398f85e11cee6b5ae07d29","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-maybe/download/@putout/plugin-apply-maybe-1.1.0.tgz","fileCount":8,"unpackedSize":5354,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFV/ZY6HXWTLk8advqUSSS0/QJkuJbQnPShRQitmT0G5AiEA3o1WdM22RsFq/BzsStfVxfoSkq1bm6d0FTJOHvKWNQ0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3sMIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxsxAAiB8OlFc5absS6SP/+4fC/V6kgqeY3HPWL2fAUB+oSuDUgwut\r\nYr1eZY1TjRMFc+7Zv6won3iwcUubWER1mf7MEx3Zv82oipiENJ1mDcP4AxQZ\r\nMadzNUs54h8bdwlcDXXj+XP1HMgr4AmXRTNv3EUy8GrTEzcU/o3BqOC7iSRu\r\nCSUmXE5Aa+/Qq194QWunIP1lTCv2Ps3Cj6qyFgdHCgGII56e27PuK5T92Gra\r\nTf3p93LgJAgAfkipIDjYZLRymPHxpBAxmJwmvSZBYyZC8YJDjuKgOcG3ecbO\r\nxCQhf6emJeH0cp2PqUCtfkH1JfwG6UQiKnJuELDYBhYwFWuW5UbTlFzvBiTQ\r\nOTpm7GDnwgXvxj1dik2Sx4LkfD3ruIxmynoG4SxTiPC7NmcqdMa857xvLRLa\r\noEe2IeGquMu61Zr20q6G9ssQY+gp2qDZKrXUaKSvn02JXddjSiObQXBdmFDi\r\n8IJ22ZMF/PV/x/kTCN8hJNfi4kOJ6VoNKuJRENzHUx7Be3dej0kBeoFsDlOB\r\nS/YAP6V22vzR80fqNbad+Sdhvg8qJGTt86A1KbdxwCnwkfKmCa4Xw6OMf422\r\n4r1Y65MllsSxeM8jag6WxvBxbdckoZjXh0fKwYe/In4gJHLB/C7e+O9p3jGn\r\nAtrn8f3k07TekGz1umgqpQvxWo89KPL2vy0=\r\n=dOTV\r\n-----END PGP SIGNATURE-----\r\n","size":2296,"noattachment":false,"key":"/@putout/plugin-apply-maybe/-/@putout/plugin-apply-maybe-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","tmp":"tmp/plugin-apply-maybe_1.1.0_1675543303908_0.14186578658222548"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-maybe [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-maybe.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-maybe\"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with `maybe` monad. Depends on [`@putout/declare`](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare#readme). Renamed to [`@putout/plugin-maybe`](https://www.npmjs.com/package/@putout/maybe).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-maybe -D\n```\n\n## Rules\n\n```json\n{\n    \"rules\": {\n        \"apply-maybe/array\": \"on\",\n        \"apply-maybe/empty-array\": \"on\",\n        \"apply-maybe/fn\": \"on\"\n    }\n}\n```\n\n## array\n\n### ❌ Example of incorrect code\n\n```js\nconst array = isArray(a) ? a : [a];\n```\n\n### ✅ Example of correct code\n\n```js\nconst maybeArray = (a) => isArray(a) ? a : [a];\nconst array = maybeArray(a);\n```\n\n## empty-array\n\n### ❌ Example of incorrect code\n\n```js\nconst array = !a ? [] : a;\n```\n\n### ✅ Example of correct code\n\n```js\nconst maybeArray = (a) => !a ? [] : a;\nconst array = maybeEmptyArray(a);\n```\n\n## fn\n\n### ❌ Example of incorrect code\n\n```js\nconst fn = isFn(a) ? a : () => {};\n```\n\n### ✅ Example of correct code\n\n```js\nconst noop = () => {};\nconst maybeFn = isFn(a) ? a : noop;\nconst fn = maybeFn(a);\n```\n\n## noop\n\n### ❌ Example of incorrect code\n\n```js\nconst fn = f || (() => {});\n```\n\n### ✅ Example of correct code\n\n```js\nconst noop = () => {};\nconst fn = fn || noop;\n```\n\n## License\n\nMIT\n","publish_time":1675543304053,"_cnpm_publish_time":1675543304053,"dist-tags":{"latest":"1.2.1"}}