Skip to content

typescript-rtti/reflect

Repository files navigation

@typescript-rtti/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;

About

Unified reflection API for Typescript

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published