You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@triptease/babel-plugin-transform-class-prototype-name

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@triptease/babel-plugin-transform-class-prototype-name

Manaully sets a classes prototype.name after each definition

1.0.3
latest
npmnpm
Version published
Weekly downloads
4
33.33%
Maintainers
2
Weekly downloads
 
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 have the correct name.

Installation

$ npm install --dev @triptease/babel-plugin-transform-class-prototype-name

Usage

.babelrc

{
  "plugins": ["@triptease/babel-plugin-transform-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