sanex3339 преди 8 години
родител
ревизия
4f02abb517
променени са 1 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 5 3
      src/decorators/Initializable.ts

+ 5 - 3
src/decorators/Initializable.ts

@@ -1,3 +1,5 @@
+/* tslint:disable:no-invalid-this */
+
 import { IInitializable } from '../interfaces/IInitializable';
 
 /**
@@ -22,7 +24,7 @@ export function initializable (
         };
         const originalMethod: Function = methodDescriptor.value;
 
-        methodDescriptor.value = function () {
+        methodDescriptor.value = function (): void {
             originalMethod.apply(this, arguments);
 
             // call property getter to activate initialization check inside it
@@ -45,12 +47,12 @@ export function initializable (
             return this[metadataPropertyKey];
         };
 
-        propertyDescriptor.set = function (newVal: any) {
+        propertyDescriptor.set = function (newVal: any): void {
             this[metadataPropertyKey] = newVal;
         };
 
         Object.defineProperty(target, propertyKey, propertyDescriptor);
 
         return propertyDescriptor;
-    }
+    };
 }