New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

babel-plugin-transform-private-class-properties

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

babel-plugin-transform-private-class-properties

Mangle JavaScript private class properties

unpublished
latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

babel-plugin-transform-private-class-properties npm

Mangle JavaScript private class properties.

Installation

$ yarn add --dev babel-plugin-transform-private-class-properties

Example

Input file:

class Rectangle {
    constructor(height, width) {
        this._height = height;
        this._width = width;
    }

    area() {
        return this.calcArea();
    }

    calcArea() {
        return this._height * this._width;
    }
}

.babelrc:

{
  "plugins": [
    [
      "babel-plugin-transform-private-class-properties"
    ]
  ]
}

Output:

class Rectangle {
    constructor(height, width) {
        this.$1 = height;
        this.$2 = width;
    }

    area() {
        return this.calcArea();
    }

    calcArea() {
        return this.$1 * this.$2;
    }
}

License

This plugin is licensed under the MIT license. See LICENSE.

Keywords

babel-plugin

FAQs

Package last updated on 15 Oct 2021

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