param callback param error param message export function safelyCallBack ( callback , error ? , message ? ) { if ( callback . length === 0 ) { callback ( ) ; } else if ( callback . length === 1 ) { callback ( error ) ; } else if ( callback . length === 2 ) { callback ( error , message ) ; } else { throw new TypeError ( "Callback function accepts more than two parameters." ) ; } }