Skip to main content
Module

x/deno_reflect/example.ts

A Deno-compatible copy of the TypeScript Metadata Reflection API my Microsoft
Latest
File
// run with `deno run -c tsconfig.json example.ts`
import { Reflect } from "./mod.ts";
// deno-lint-ignore no-explicit-anytype Constructor<T = unknown> = new (...args: any[]) => T;
function decorator<T>(_: Constructor<T>): void {}
@decoratorclass Example { constructor(a: string, b: number, c: Example) {}}
const metadata = Reflect.getMetadata("design:paramtypes", Example);console.log(metadata);// "[ [Function: String], [Function: Number], [Function: Example] ]"