Socket
Socket
Sign inDemoInstall

@putout/plugin-merge-duplicate-functions

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @putout/plugin-merge-duplicate-functions

🐊Putout plugin adds ability to merge duplicate functions


Version published
Weekly downloads
3.4K
increased by7.61%
Maintainers
1
Install size
6.29 kB
Created
Weekly downloads
 

Readme

Source

@putout/plugin-merge-duplicate-functions NPM version

Functions are one of the fundamental building blocks in JavaScript. A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output. To use a function, you must define it somewhere in the scope from which you wish to call it.

(c) MDN

🐊Putout plugin adds ability to find and merge duplicate functions. Checkout in 🐊Putout Editor.

Install

npm i @putout/plugin-merge-duplicate-functions

Rule

{
    "rules": {
        "merge-duplicate-functions": "on"
    }
}

❌ Example of incorrect code

const isFn = (a) => typeof a === 'function';
const isFn1 = (a) => typeof a === 'function';
const isFn2 = (a) => typeof a === 'function';

isFn(1);
isFn1(2);

✅ Example of correct code

const isFn = (a) => typeof a === 'function';

isFn(1);
isFn(2);

License

MIT

FAQs

Last updated on 15 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc