Socket
Book a DemoInstallSign in
Socket

babel-plugin-transform-class-prototype-name

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-class-prototype-name

Manaully sets a classes prototype.name after each definition

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

babel-plugin-class-display-name Build Status

After the creation of each class, the plugin manually sets the prototype.name to the class name. This means that after minification class errors still report correctly if you dont have source maps enabled.

Installation

$ npm install babel-plugin-class-prototype-name

Usage

.babelrc

{
  "plugins": ["class-prototype-name"]
}

Via CLI

$ babel --plugins class-prototype-name script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["class-prototype-name"]
});

Compilation

In

class CustomError extends Error {}

Out

class CustomError extends Error {}
CustomError.prototype.name = "CustomError";

After minification

class a extends Error {}
a.prototype.name = "CustomError";

Keywords

babel-plugin

FAQs

Package last updated on 04 Sep 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.