lib/definitions/collection.js
function (query) {
    if (!query || !_.isObject(query)) {
      var err = new Error('Please pass a valid query object!');
      debug(err);
      throw err;
    }
    query.name = query.name || '';
    query.version = query.version || 0;
    query.aggregate = query.aggregate || null;
    query.context = query.context || null;
    var found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate) &&
        (evExt.context === query.context);
    });
    if (found) {
      return found;
    }
    found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context);
    });
    if (found) {
      return found;
    }
    found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context || !query.context || !evExt.context);
    });
    if (found) {
      return found;
    }
    return _.find(this.eventExtenders, function (evExt) {
      return evExt.name === '' &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context || !query.context || !evExt.context);
    });
  }
function (query) {
    if (!query || !_.isObject(query)) {
      var err = new Error('Please pass a valid query object!');
      debug(err);
      throw err;
    }
    query.name = query.name || '';
    query.version = query.version || 0;
    query.aggregate = query.aggregate || null;
    query.context = query.context || null;
    var found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate) &&
        (evExt.context === query.context);
    });
    if (found) {
      return found;
    }
    found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context);
    });
    if (found) {
      return found;
    }
    found = _.find(this.eventExtenders, function (evExt) {
      return evExt.name === query.name &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context || !query.context || !evExt.context);
    });
    if (found) {
      return found;
    }
    return _.find(this.eventExtenders, function (evExt) {
      return evExt.name === '' &&
        (evExt.version === query.version || evExt.version === -1) &&
        (evExt.aggregate === query.aggregate || !query.aggregate || !evExt.aggregate) &&
        (evExt.context === query.context || !query.context || !evExt.context);
    });
  }
function ( query ) { if ( ! query || ! _ . isObject ( query ) ) { var err = new Error ( 'Please pass a valid query object!' ) ; debug ( err ) ; throw err ; } query . name = query . name || '' ; query . version = query . version || 0 ; query . aggregate = query . aggregate || null ; query . context = query . context || null ; var found = _ . find ( this . eventExtenders , function ( evExt ) { return evExt . name === query . name && ( evExt . version === query . version || evExt . version === - 1 ) && ( evExt . aggregate === query . aggregate ) && ( evExt . context === query . context ) ; } ) ; if ( found ) { return found ; } found = _ . find ( this . eventExtenders , function ( evExt ) { return evExt . name === query . name && ( evExt . version === query . version || evExt . version === - 1 ) && ( evExt . aggregate === query . aggregate || ! query . aggregate || ! evExt . aggregate ) && ( evExt . context === query . context ) ; } ) ; if ( found ) { return found ; } found = _ . find ( this . eventExtenders , function ( evExt ) { return evExt . name === query . name && ( evExt . version === query . version || evExt . version === - 1 ) && ( evExt . aggregate === query . aggregate || ! query . aggregate || ! evExt . aggregate ) && ( evExt . context === query . context || ! query . context || ! evExt . context ) ; } ) ; if ( found ) { return found ; } return _ . find ( this . eventExtenders , function ( evExt ) { return evExt . name === '' && ( evExt . version === query . version || evExt . version === - 1 ) && ( evExt . aggregate === query . aggregate || ! query . aggregate || ! evExt . aggregate ) && ( evExt . context === query . context || ! query . context || ! evExt . context ) ; } ) ; }
Returns the eventExtender module by query.
@param {Object} query The query object.
@returns {EventExtender}
Returns the eventExtender module by query .