import { ts } from 'ts-morph' ; export function isModuleWithProviders ( node ) { let result = false ; if ( node . declarationList ) { if ( node . declarationList . declarations && node . declarationList . declarations . length > 0 ) { let i = 0 , declarations = node . declarationList . declarations , len = node . declarationList . declarations . length ; for ( i ; i < len ; i ++ ) { let declaration = node . declarationList . declarations [ i ] ; if ( declaration . type ) { let type = declaration . type as ts . TypeReferenceNode ; if ( type . typeName ) { let text = type . typeName . getText ( ) ; if ( text === 'ModuleWithProviders' ) { result = true ; } } } } } } return result ; }