import { IInjector } from "../api/IInjector" ; import { instantiateUnmapped } from "./instantiateUnmapped" ; param guards param injector return export function guardsApprove ( guards , injector ? ) { for ( let guard of guards ) { if ( typeof guard === "function" && guard . prototype . approve === undefined ) { if ( ( < Function > guard ) ( ) ) { continue ; } return false ; } if ( typeof guard === "function" && guard . prototype . approve !== undefined ) { guard = injector ? instantiateUnmapped ( injector , guard ) : new guard ( ) ; } if ( ! guard . approve ( ) ) { return false ; } } return true ; }