{"_id":"@putout/plugin-apply-overrides","_rev":"7-ffe596e303c087f94dc15dc5d2b345cd","name":"@putout/plugin-apply-overrides","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"@putout/plugin-apply-overrides","version":"1.0.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@1.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"6d2c0bc72dc89eac7d9469d01852b6a1d6bcf64f","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-1.0.0.tgz","fileCount":4,"integrity":"sha512-hKx0aUHtLuxNAGQvnx7r2zAHVC6pIRJb2zVp2kL+sbrozhRdg+soLHgSbYN+3GFNxUR3mGVD5aAKVPaOaC6p3A==","signatures":[{"sig":"MEUCIFjSMjSzM8+A+Fe87zVw4XL53nqn9R2jrpBz8cJv4MoIAiEA0ngxfTPWd46IFSG0fLC+DC2yC9YekxLmELfKUJ7FXsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6353},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"36c206606d3e40c01cf50350f549e7651733bc33","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.5.0","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"20.12.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=35"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_1.0.0_1714746044183_0.5539967805389896","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@putout/plugin-apply-overrides","version":"1.1.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@1.1.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"66512655d1547900efd388f3c2051a3cdc7666a5","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-1.1.0.tgz","fileCount":4,"integrity":"sha512-cKmfUbGBMwy2+upytcHha138WN/VilRqFVv8dmZAG1vShp2rqyNlyrbhJYhv4FmxARys3zv6EluIyzhADZ+j7Q==","signatures":[{"sig":"MEQCIDBNKLhaKomg0E48jMFAss28WQ3kNC8CWA45/0u4lr/ZAiBc8zeOw/XY8wAFHx7j9syhiKn0Mk/R6I2MN4uMfR1c7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5819},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"9cb59ed7b4edcece80768afd2a20891f8ddc72a7","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.5.0","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"20.12.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=35"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_1.1.0_1714816026086_0.48083594935370777","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@putout/plugin-apply-overrides","version":"1.2.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@1.2.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"b298b833ffe8d27325766263a74bbae66549a6d3","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-1.2.0.tgz","fileCount":4,"integrity":"sha512-ykOfEUmpr/SNw9WYF8x1VZXO9Q4BvbSwwIE8B1LCNal63AljKQhG6yUm9EqfVf5OFBEJsDoDLE9hQYnaRrRrGw==","signatures":[{"sig":"MEYCIQCiA++D+vmJfKeCjqHtf0nabHqzy0t4iVQ/SvGGI2lafQIhAIyNEEFwAbvoWTRCyvxWSPfw3ClG2X8BtnU6j0aLpCqS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5810},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"74d926d77dfeba93f1462289eb4a1ba5fb792854","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.5.0","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"20.12.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=35"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_1.2.0_1714994123664_0.5160372160516165","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"@putout/plugin-apply-overrides","version":"1.3.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@1.3.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"d17b6137be13cc3c6c6efcef781f7ed9bee9698d","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-1.3.0.tgz","fileCount":4,"integrity":"sha512-sCtey6spNDep18E1afmTy8zam/3m8tXv+BmeTn2SoVSJ1NX9oQVlEh62swB+gdrb8HUd7dIdu1LDuex8Snei0A==","signatures":[{"sig":"MEYCIQCXGsBv5Jc6mL5hezKCQ5LzkiYgjj+GeQaSKqRkgCOw3wIhAPzhXuvpd2DuJgYwJECpO35sb3uUJlV4tsmKPP8ngnHR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5895},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"55dd40f7cb469863d4c86d897921e9e5533f8757","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.5.0","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"20.12.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=35"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_1.3.0_1715288620040_0.6123448452883886","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@putout/plugin-apply-overrides","version":"2.0.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@2.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"3863ffb326f7aba0ef61fc9edec6c04c79bbd8e2","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-2.0.0.tgz","fileCount":4,"integrity":"sha512-VFXJbic2Z5V+njpVvRaFbZQ6v78wvU+gblglKfYWLB41z8/ETf5suvikJzuH1QeBMx/KlqppOa7NDnSSl/kqqQ==","signatures":[{"sig":"MEQCIAVT5yuKrqQVj52/Gzzm6qsK8EQakv/DsOwGs/2kKh79AiAqNMdVGG0Rz6Uzi4Qr4XrwEfJV8m3VJl3DXdbJGc0j3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6136},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"1e1f39d3b03a53f1dff4af267c7a0e8604772b50","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.8.2","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"18.20.4","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=36"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_2.0.0_1724321515544_0.10533672229210511","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@putout/plugin-apply-overrides","version":"2.1.0","keywords":["putout","putout-plugin","plugin","overrides"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-overrides@2.1.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"c0e4ad36b21a76a404ee67a82aa6e20399f0cb86","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-2.1.0.tgz","fileCount":4,"integrity":"sha512-uu/G5rJufqWj+qhaDBL0+NFejVrwb/JVdB//8jW74I3sLcYDKiTDU5z2+hNWMCE8ORae+gr6PCWJfiEC9v2ROw==","signatures":[{"sig":"MEUCIEz4dPIITQVwe2Dpmt9EhLg5HuTbLVA7Y+/KjKtFSSfkAiEAuun7IsDxcJeCBsw+0dukGoaEbaNWIEItHmUZ6WFNGvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6128},"main":"lib/apply-overrides.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"1dc711b6dc11ec0103fab2451eeea10f82031d35","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://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.8.2","description":"🐊Putout plugin adds ability apply 'overrides'","directories":{},"_nodeVersion":"20.15.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0"},"peerDependencies":{"putout":">=36"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-overrides_2.1.0_1724338985538_0.6579617021193593","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@putout/plugin-apply-overrides","version":"3.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability apply 'overrides'","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","main":"lib/apply-overrides.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"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","overrides"],"devDependencies":{"@putout/test":"^13.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^26.0.0","madrun":"^11.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=40"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-overrides@3.0.0","gitHead":"ade7dca8bf8aa5bf31195c6931e7feee11720365","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"20.19.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-0fr0SVuZNpUWWGvttHVRxtsmX6/sttF3I0MfbW6TboH/dbBXv4IKfkGB7wLAs7x/lEHWcoxYbsYtm/emsioLvw==","shasum":"b8b1b4f63a8b6b5c253f011002cbacdca9b7f68e","tarball":"https://registry.npmjs.org/@putout/plugin-apply-overrides/-/plugin-apply-overrides-3.0.0.tgz","fileCount":4,"unpackedSize":6084,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDb8lEoS45VBvp+s9rx+JyK9DWOdf8qQxIaMTx0CgjtTAiEAxFvBI84XHC7ZJm7LgakZlwPjZZiVZagPHwLCZOe5fFs="}]},"_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/plugin-apply-overrides_3.0.0_1744647038211_0.05029275932220445"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-03T14:20:44.040Z","modified":"2025-04-14T16:10:38.544Z","1.0.0":"2024-05-03T14:20:44.345Z","1.1.0":"2024-05-04T09:47:06.276Z","1.2.0":"2024-05-06T11:15:23.810Z","1.3.0":"2024-05-09T21:03:40.193Z","2.0.0":"2024-08-22T10:11:55.669Z","2.1.0":"2024-08-22T15:03:05.821Z","3.0.0":"2025-04-14T16:10:38.370Z"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"license":"MIT","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme","keywords":["putout","putout-plugin","plugin","overrides"],"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"description":"🐊Putout plugin adds ability apply 'overrides'","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"readme":"# @putout/plugin-apply-overrides [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-overrides.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-overrides \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `overrides`.\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/2f03cfd6d8dab1431ef388fb9168a017/098a08fd5ba26e5b7dc12e3adcd9766dce6aca0c).\n\nWhen you write testable code and want to avoid mocking `require`d or `import`ed modules, one of a solutions to use simple form\nof dependency injection:\n\n```js\nimport {readDirSync as _readdirSync} from 'node:fs/promises';\n\nexport const readRules = (dirOpt, rulesDir, overrides = {}) => {\n    const {\n        cwd,\n        readdirSync = _readdirSync,\n    } = overrides;\n};\n```\n\nPass `overrides` as last parameter, in this case use can test easily your function `readFules`:\n\n```js\nimport {test, stub} from 'supertape';\n\ntest('readRules', (t) => {\n    const readdirSync = stub().returns([]);\n    const rules = readRules('', '', {\n        readdirSync,\n    });\n    \n    t.equal(rules, []);\n    t.end();\n});\n```\n\nThen only issue is, when you have lots of parameters, your function declaration will be to long, or to hard to read, so recommended way is to use `overrides` variable.\n\n## Install\n\n```\nnpm i @putout/plugin-apply-overrides\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-overrides\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nasync function matchToFlatDir(path, config, {readESLintConfig = _readESLintConfig} = {}) {}\n```\n\n## ✅ Example of correct code\n\n```js\nasync function matchToFlatDir(path, config, overrides = {}) {\n    const {\n        readESLintConfig = _readESLintConfig,\n    } = overrides;\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}