lib/definitions/aggregate.js
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var handler =  _.find(this.commandHandlers, function (cmdHnd) {
      return cmdHnd.name === name && cmdHnd.version === version;
    });

    if (handler) {
      return handler;
    }

    if (!this.getCommand(name, version)) {
      return null;
    }

    return this.defaultCommandHandler;
  }
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var handler =  _.find(this.commandHandlers, function (cmdHnd) {
      return cmdHnd.name === name && cmdHnd.version === version;
    });

    if (handler) {
      return handler;
    }

    if (!this.getCommand(name, version)) {
      return null;
    }

    return this.defaultCommandHandler;
  }
function ( name , version ) { if ( ! name || ! _ . isString ( name ) ) { var err = new Error ( 'Please pass a valid string as name!' ) ; debug ( err ) ; throw err ; } version = version || 0 ; if ( ! _ . isNumber ( version ) ) { var err = new Error ( 'Please pass a valid number as version!' ) ; debug ( err ) ; throw err ; } var handler = _ . find ( this . commandHandlers , function ( cmdHnd ) { return cmdHnd . name === name && cmdHnd . version === version ; } ) ; if ( handler ) { return handler ; } if ( ! this . getCommand ( name , version ) ) { return null ; } return this . defaultCommandHandler ; }
Returns the commandHandler module by command name and command version.
@param {String} name    The command name.
@param {Number} version The command version. [optional; default 0]
@returns {CommandHandler}
Returns the commandHandler module by command name and command version .