@esfx/reflect-metadata-compat
v1.0.0-pre.23
Published
A global shim that provides API compatibility with 'reflect-metadata'.
Readme
@esfx/reflect-metadata-compat
The @esfx/reflect-metadata-compat package is a global shim that provides API compatibility with reflect-metadata.
Overview
Installation
npm i @esfx/reflect-metadata-compatUsage
import "@esfx/reflect-metadata-compat";
// TypeScript compiled with --emitDecoratorMetadata
class MyClass {
@someDecorator
method(x: number): string {
return "";
}
}
const c = new MyClass();
Reflect.getMetadata("design:returntype", c, "method"); // String
Reflect.getMetadata("design:paramtypes", c, "method"); // [Number]API
You can read more about the API here.
