Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-transformer-classname

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-transformer-classname

A TypeScript transformer for use with ttypescript that will give you a symbol that returns the name of the class.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
432
increased by37.58%
Maintainers
2
Weekly downloads
 
Created
Source

ts-transformer-class-name

A typescript transformer that attaches the class name to each class type. It enables to recover the class name after a JS minimizer has been executed to the code base.

So for example if you have the class:

class MyClass {
  // class implementation...
}

After the transformer has been executed, you should have:

MyClass[CONSTRUCTOR_NAME_SYMBOL] === 'MyClass'

Usage

ttypescript can be used to integrate this transformer. After ttypescript is installed, you can reference the transformer in your tsconfig.json file:

{
    "compilerOptions": {
        "plugins": [
          { "transform": "ts-transformer-classname", "import": "classNameTransformer" }
        ]
    }
}

DI Compiler adapter

The adapter for DI Compiler is now provided. To use it:

{
    "compilerOptions": {
        "plugins": [
          { "transform": "ts-transformer-classname", "import": "diTransformerAdapter" }
        ]
    }
}

Release process

Run yarn release

Keywords

FAQs

Package last updated on 24 Jan 2023

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