A TypeScript transformer for use with ttypescript that will give you a symbol that returns the name of the class.
npm install ts-transformer-classnamets-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:
``typescript`
class MyClass {
// class implementation...
}`
After the transformer has been executed, you should have:typescript`
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:`json`
{
"compilerOptions": {
"plugins": [
{ "transform": "ts-transformer-classname", "import": "classNameTransformer" }
]
}
}
DI Compiler adapter
-------------------
The adapter for DI Compiler is now provided. To use it:
`json`
{
"compilerOptions": {
"plugins": [
{ "transform": "ts-transformer-classname", "import": "diTransformerAdapter" }
]
}
}
Release process
---------------
Run yarn release`