0.0.2 • Published 2 years ago

@typescript-rtti/reflect v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

reflect

Version CircleCI

Unified Reflection

This is a project to separate typescript-rtti's reflection library into an independent library and implement other metadata formats. Currently supports emitDecoratorMetadata and typescript-rtti.

Usage

npm install @typescript-rtti/reflect

Traditional metadata (emitDecoratorMetadata):

import { reflect } from '@typescript-rtti/reflect';

@dec() class A { 
    constructor(str : string, num : number) {
    }
}

expect(reflect(A).parameters[0].type.isClass(String)).to.be.true;

typescript-rtti

import { reflect } from '@typescript-rtti/reflect';

class A {
    constructor(str : string, num : number) {
    }
}

expect(reflect(A).parameters[0].type.isClass(String)).to.be.true;