Socket
Socket
Sign inDemoInstall

babel-plugin-strip-test-func

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-strip-test-func

Babel plugin stripping test-only function declarations


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
101 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-babel-strip-test-func

Babel plugin stripping test-only function declarations

Example

In

// input code
let foo;

let __test__bar = () => {};

let __test__foo, foobar;

function __test__baz(){}

Out

// output code
let foo;

let foobar;

Installation

$ npm install babel-plugin-strip-test-func

Options

regexp

A regexp used to check identifier.

Example
{
    "plugins": [
        [
            "strip-test-func",
            {
                "regexp": "^__foo__"
            }
        ]
    ]
}

In

// input code
let foo;

let __foo__bar = () => {};

let __foo__foo, foobar;

function __foo__baz(){}

Out

// output code
let foo;

let foobar;

Usage

.babelrc

{
  "plugins": ["strip-test-func"]
}

Via CLI

$ babel --plugins strip-test-func script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["strip-test-func"]
});

License

Copyright (c) 2018 Benjamin Van Ryseghem

The code is licensed under the MIT license (see LICENSE).

Keywords

FAQs

Last updated on 28 Mar 2018

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