From 529d717588d977a04634c7f101257f5640e73838 Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 21 May 2018 01:11:13 +0900 Subject: [PATCH] ing --- package.json | 3 ++- src/DecoratorHelper.ts | 4 ++-- tsconfig.json | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2d8c56b..eef0e70 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "build": "npm run bundle && npm run generate:package && npm run generate:doc" }, "dependencies": { - "@loafer/core": "^0.0.1" + "@loafer/core": "^0.0.1", + "reflect-metadata": "^0.1.12" }, "devDependencies": { "@types/jasmine": "~2.8.5", diff --git a/src/DecoratorHelper.ts b/src/DecoratorHelper.ts index c11adc0..7795cde 100644 --- a/src/DecoratorHelper.ts +++ b/src/DecoratorHelper.ts @@ -24,7 +24,7 @@ import { NotSupportedDecoratorError } from './error'; export class DecoratorHelper { public static register(annotation: AnnotationType, ...decoratorArgs: any[]) { - const annotationClass = TypeUtil.getType(annotation); + const annotationClass = Metadata.getType(annotation); const name: string = annotationClass.name; DecoratorHelper.registerAnnotation(name, annotation, decoratorArgs); @@ -46,7 +46,7 @@ export class DecoratorHelper { const [target, propertyKey, descriptorOrParameterIndex] = decoratorArgs; - const clazz: Class = Class._defineClass(TypeUtil.getType(target)); + const clazz: Class = Class._defineClass(Metadata.getType(target)); let field: Field = null; let method: Method = null; let parameter: Parameter = null; diff --git a/tsconfig.json b/tsconfig.json index 6063fae..b1da8da 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,6 +37,7 @@ "node_modules/@types" ], "types": [ + "reflect-metadata" ], "lib": [ "es2015", "es2016", "es2017", "dom"