New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@putout/operator-add-args

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/operator-add-args

🐊Putout operator adds ability to add args to referenced variables that was not defined

  • 10.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.8K
decreased by-6.51%
Maintainers
0
Weekly downloads
 
Created
Source

@putout/operator-add-args NPM version

🐊Putout operator adds ability to add argument that was not defined before.

Install

npm i putout @putout/operator-add-args

API

If you want to create 🐊Putout plugin that will add args according to your needs just:

const {operator} = require('putout');
const {addArgs} = operator;

module.exports = addArgs({
    comparePlaces: ['{comparePlaces}', 'test("__a", (__args) => __body)'],
    t: ['{comparePlaces}', [
        'test("__a", (__args) => __body)',
        'test.only("__a", (__args) => __body)',
    ]],
    maybe: ['{maybe}', [
        'module.exports.__a = (__args) => __body',
    ]],
});

If you have a file index.spec.js:

-test('', () => {
+test('', ({comparePlaces}) => {
    comparePlaces();
});

Plugin supports options, so you can pass it in .putout.json:

{
    "rules": {
        "tape/add-args": ["on", {
            "args": {
                "comparePlaces": ["{comparePlaces}", "test('__a', (__args) => __body)"]
            }
        }]
    }
}

License

MIT

Keywords

FAQs

Package last updated on 06 Feb 2025

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc