import { IInjector } from "../api/IInjector" ; import { instantiateUnmapped } from "./instantiateUnmapped" ; param hooks param injector export function applyHooks ( hooks , injector ? ) { for ( let hook of hooks ) { if ( typeof hook === "function" && hook . prototype . hook === undefined ) { ( < Function > hook ) ( ) ; continue ; } if ( typeof hook === "function" && hook . prototype . hook !== undefined ) { hook = injector ? instantiateUnmapped ( injector , hook ) : new hook ( ) ; } hook . hook ( ) ; } }