lib/definitions/aggregate.js
function (command) {
    if (!command || !_.isObject(command)) {
      var err = new Error('Please inject a valid command object!');
      debug(err);
      throw err;
    }

    if (!command.payload && command.payload !== '') {
      command.payload = this.defaultCommandPayload;
    }

    command.defineAggregate(this);

    if (this.commands.indexOf(command) < 0) {
      this.commands.push(command);
    }
  }
function (command) {
    if (!command || !_.isObject(command)) {
      var err = new Error('Please inject a valid command object!');
      debug(err);
      throw err;
    }

    if (!command.payload && command.payload !== '') {
      command.payload = this.defaultCommandPayload;
    }

    command.defineAggregate(this);

    if (this.commands.indexOf(command) < 0) {
      this.commands.push(command);
    }
  }
function ( command ) { if ( ! command || ! _ . isObject ( command ) ) { var err = new Error ( 'Please inject a valid command object!' ) ; debug ( err ) ; throw err ; } if ( ! command . payload && command . payload !== '' ) { command . payload = this . defaultCommandPayload ; } command . defineAggregate ( this ) ; if ( this . commands . indexOf ( command ) < 0 ) { this . commands . push ( command ) ; } }
Add command module.
@param {Command} command The command module to be injected.
Add command module .