1.0.0-pre.23 • Published 3 years ago

@esfx/reflect-metadata-compat v1.0.0-pre.23

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
3 years ago

@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-compat

Usage

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.