@esfx/metadata-shim
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-pre.23 • Public • Published

@esfx/metadata-shim

The @esfx/metadata-shim package is a global shim that adds minimal @esfx/metadata functionality to the Reflect global object. This provides partial compatibility with TypeScript's --emitDecoratorMetadata flag.

Overview

Installation

npm i @esfx/metadata-shim

Usage

import "@esfx/metadata-shim";
import { getMemberMetadata } from "@esfx/metadata";

// TypeScript compiled with --emitDecoratorMetadata
class MyClass {
    @someDecorator
    method(x: number): string {
        return "";
    }
}

const c = new MyClass();
getMemberMetadata(c, "method", "design:returntype"); // String
getMemberMetadata(c, "method", "design:paramtypes"); // [Number]

API

You can read more about the API here.

/@esfx/metadata-shim/

    Package Sidebar

    Install

    npm i @esfx/metadata-shim

    Weekly Downloads

    1

    Version

    1.0.0-pre.23

    License

    Apache-2.0

    Unpacked Size

    17 kB

    Total Files

    7

    Last publish

    Collaborators

    • rbuckton