lib/eventDispatcher.js
function (evt) {
    if (!evt || !_.isObject(evt)) {
      var err = new Error('Please pass a valid event!');
      debug(err);
      throw err;
    }

    var name = dotty.get(evt, this.definition.name) || '';

    var version = 0;
    if (dotty.exists(evt, this.definition.version)) {
      version = dotty.get(evt, this.definition.version);
    } else {
      debug('no version found, handling as version: 0');
    }

    var aggregate = null;
    if (dotty.exists(evt, this.definition.aggregate)) {
      aggregate = dotty.get(evt, this.definition.aggregate);
    } else {
      debug('no aggregate found');
    }

    var context = null;
    if (dotty.exists(evt, this.definition.context)) {
      context = dotty.get(evt, this.definition.context);
    } else {
      debug('no context found');
    }

    return {
      name: name,
      version: version,
      aggregate: aggregate,
      context: context
    };
  }
function (evt) {
    if (!evt || !_.isObject(evt)) {
      var err = new Error('Please pass a valid event!');
      debug(err);
      throw err;
    }

    var name = dotty.get(evt, this.definition.name) || '';

    var version = 0;
    if (dotty.exists(evt, this.definition.version)) {
      version = dotty.get(evt, this.definition.version);
    } else {
      debug('no version found, handling as version: 0');
    }

    var aggregate = null;
    if (dotty.exists(evt, this.definition.aggregate)) {
      aggregate = dotty.get(evt, this.definition.aggregate);
    } else {
      debug('no aggregate found');
    }

    var context = null;
    if (dotty.exists(evt, this.definition.context)) {
      context = dotty.get(evt, this.definition.context);
    } else {
      debug('no context found');
    }

    return {
      name: name,
      version: version,
      aggregate: aggregate,
      context: context
    };
  }
function ( evt ) { if ( ! evt || ! _ . isObject ( evt ) ) { var err = new Error ( 'Please pass a valid event!' ) ; debug ( err ) ; throw err ; } var name = dotty . get ( evt , this . definition . name ) || '' ; var version = 0 ; if ( dotty . exists ( evt , this . definition . version ) ) { version = dotty . get ( evt , this . definition . version ) ; } else { debug ( 'no version found, handling as version: 0' ) ; } var aggregate = null ; if ( dotty . exists ( evt , this . definition . aggregate ) ) { aggregate = dotty . get ( evt , this . definition . aggregate ) ; } else { debug ( 'no aggregate found' ) ; } var context = null ; if ( dotty . exists ( evt , this . definition . context ) ) { context = dotty . get ( evt , this . definition . context ) ; } else { debug ( 'no context found' ) ; } return { name : name , version : version , aggregate : aggregate , context : context } ; }
Returns the target information of this event.
@param {Object} evt The passed event.
@returns {{name: 'eventName', aggregateId: 'aggregateId', version: 0, aggregate: 'aggregateName', context: 'contextName'}}
Returns the target information of this event .