lib/definitions/context.js
function (name, version) {
    if (!name || !_.isString(name)) {
      throw new Error('Please pass in a command name!');
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmd = aggr.getCommand(name, version);
      if (cmd) {
        return aggr;
      }
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmdHndl = aggr.getCommandHandler(name, version);
      if (cmdHndl && cmdHndl !== aggr.defaultCommandHandler) {
        return aggr;
      }
    }

    debug('no matching aggregate found for command ' + name);

    return null;
  }
function (name, version) {
    if (!name || !_.isString(name)) {
      throw new Error('Please pass in a command name!');
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmd = aggr.getCommand(name, version);
      if (cmd) {
        return aggr;
      }
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmdHndl = aggr.getCommandHandler(name, version);
      if (cmdHndl && cmdHndl !== aggr.defaultCommandHandler) {
        return aggr;
      }
    }

    debug('no matching aggregate found for command ' + name);

    return null;
  }
function ( name , version ) { if ( ! name || ! _ . isString ( name ) ) { throw new Error ( 'Please pass in a command name!' ) ; } for ( var a in this . aggregates ) { var aggr = this . aggregates [ a ] ; var cmd = aggr . getCommand ( name , version ) ; if ( cmd ) { return aggr ; } } for ( var a in this . aggregates ) { var aggr = this . aggregates [ a ] ; var cmdHndl = aggr . getCommandHandler ( name , version ) ; if ( cmdHndl && cmdHndl !== aggr . defaultCommandHandler ) { return aggr ; } } debug ( 'no matching aggregate found for command ' + name ) ; return null ; }
Return the aggregate that handles the requested command.
@param {String} name    command name
@param {Number} version command version
@returns {Aggregate}
Return the aggregate that handles the requested command .