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

    if (!preCond.payload && preCond.payload !== '') {
      preCond.payload = this.aggregate.defaultPreConditionPayload;
    }

    if (this.preConditions.indexOf(preCond) < 0) {
      preCond.defineAggregate(this.aggregate);
      this.preConditions.push(preCond);
      this.preConditions = _.sortBy(this.preConditions, function(pc) {
        return pc.priority;
      });
    }
  }
function (preCond) {
    if (!preCond || !_.isObject(preCond)) {
      var err = new Error('Please inject a valid preCondition object!');
      debug(err);
      throw err;
    }

    if (!preCond.payload && preCond.payload !== '') {
      preCond.payload = this.aggregate.defaultPreConditionPayload;
    }

    if (this.preConditions.indexOf(preCond) < 0) {
      preCond.defineAggregate(this.aggregate);
      this.preConditions.push(preCond);
      this.preConditions = _.sortBy(this.preConditions, function(pc) {
        return pc.priority;
      });
    }
  }
function ( preCond ) { if ( ! preCond || ! _ . isObject ( preCond ) ) { var err = new Error ( 'Please inject a valid preCondition object!' ) ; debug ( err ) ; throw err ; } if ( ! preCond . payload && preCond . payload !== '' ) { preCond . payload = this . aggregate . defaultPreConditionPayload ; } if ( this . preConditions . indexOf ( preCond ) < 0 ) { preCond . defineAggregate ( this . aggregate ) ; this . preConditions . push ( preCond ) ; this . preConditions = _ . sortBy ( this . preConditions , function ( pc ) { return pc . priority ; } ) ; } }
Injects the pre-condition function.
@param {Function} preCond The pre-condition function that should be injected
Injects the pre - condition function .