@pigly/transformer
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.9 • Public • Published

Pigly/transformer

CircleCI npm npm Codecov

the typescript plugin to help emit type symbols for the pigly kernel.

alt

Usage

you must use a custom typescript compiler that facilitates using a typescript transformer. see https://github.com/cevek/ttypescript

with @pigly/transformer transformer active, in your code:

import { SymbolFor } from 'pigly';

let $IFoo = SymbolFor<IFoo>() 

...which will get compiled such that SymbolFor<IFoo> will be replaced with symbol.for("...<type hash>")

currently the transformer is just looking for a method SymbolFor<T>() and replaces it with the typescript-id for T. Any changes to how this works will result in a major version bump of this package.

License

MIT

Credits

"pig" licensed under CC from Noun Project, Created by habione 404, FR

@pigly/transformer was derived from https://github.com/YePpHa/ts-di-transformer (MIT)

Package Sidebar

Install

npm i @pigly/transformer

Weekly Downloads

11

Version

2.0.0-alpha.9

License

MIT

Unpacked Size

15.7 kB

Total Files

8

Last publish

Collaborators

  • meirionhughes