lib/helpers.js
function checkParams(params, reqParams) {
    if ( reqParams.length < 1 ) {
      return;
    }

    if ( (_.isEmpty(params) || !params) && (reqParams.length > 0) ) {
      throw new Error('Missing parameters: ' + reqParams.join(', '));
    }

    var paramsKeys = _.keys(params);
  
    _.each(reqParams, function(reqParam) {
      if ( paramsKeys.indexOf(reqParam) === -1 ) {
        throw new Error('Missing parameter: ' + reqParam);
      }
    });
  }
function checkParams(params, reqParams) {
    if ( reqParams.length < 1 ) {
      return;
    }

    if ( (_.isEmpty(params) || !params) && (reqParams.length > 0) ) {
      throw new Error('Missing parameters: ' + reqParams.join(', '));
    }

    var paramsKeys = _.keys(params);
  
    _.each(reqParams, function(reqParam) {
      if ( paramsKeys.indexOf(reqParam) === -1 ) {
        throw new Error('Missing parameter: ' + reqParam);
      }
    });
  }
function checkParams ( params , reqParams ) { if ( reqParams . length < 1 ) { return ; } if ( ( _ . isEmpty ( params ) || ! params ) && ( reqParams . length > 0 ) ) { throw new Error ( 'Missing parameters: ' + reqParams . join ( ', ' ) ) ; } var paramsKeys = _ . keys ( params ) ; _ . each ( reqParams , function ( reqParam ) { if ( paramsKeys . indexOf ( reqParam ) === - 1 ) { throw new Error ( 'Missing parameter: ' + reqParam ) ; } } ) ; }
Helper function that checks for the required params

@param {object} params
@param {array} reqParams -- required parameters
Helper function that checks for the required params