import { DataUtility } from './data.utility' ; let STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg ; let ARGUMENT_NAMES = /([^\s,]+)/g ; export abstract class FunctionUtility { static getParamNames ( func ) { if ( DataUtility . isUndefinedOrNull ( func ) ) return [ ] ; let fnStr = func . toString ( ) . replace ( STRIP_COMMENTS , '' ) ; let result = fnStr . slice ( fnStr . indexOf ( '(' ) + 1 , fnStr . indexOf ( ')' ) ) . match ( ARGUMENT_NAMES ) ; if ( result === null ) { result = [ ] ; } return result ; } }