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

    this.context = context;

    for (var r in this.snapshotConversionRegistrations) {
      var reg = this.snapshotConversionRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.snapshotConversions[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }

    for (var r in this.loadingSnapshotTransformerRegistrations) {
      var reg = this.loadingSnapshotTransformerRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.loadingSnapshotTransformers[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }

    for (var r in this.committingSnapshotTransformerRegistrations) {
      var reg = this.committingSnapshotTransformerRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.committingSnapshotTransformers[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }
  }
function (context) {
    if (!context || !_.isObject(context)) {
      var err = new Error('Please inject a valid context object!');
      debug(err);
      throw err;
    }

    this.context = context;

    for (var r in this.snapshotConversionRegistrations) {
      var reg = this.snapshotConversionRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.snapshotConversions[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }

    for (var r in this.loadingSnapshotTransformerRegistrations) {
      var reg = this.loadingSnapshotTransformerRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.loadingSnapshotTransformers[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }

    for (var r in this.committingSnapshotTransformerRegistrations) {
      var reg = this.committingSnapshotTransformerRegistrations[r];
      var meta = reg.meta;
      var fn = reg.fn;

      meta.context = meta.context || this.context.name;
      meta.aggregate = meta.aggregate || this.name;

      this.committingSnapshotTransformers[meta.context + '.' + meta.aggregate + '.' + meta.version] = fn;
    }
  }
function ( context ) { if ( ! context || ! _ . isObject ( context ) ) { var err = new Error ( 'Please inject a valid context object!' ) ; debug ( err ) ; throw err ; } this . context = context ; for ( var r in this . snapshotConversionRegistrations ) { var reg = this . snapshotConversionRegistrations [ r ] ; var meta = reg . meta ; var fn = reg . fn ; meta . context = meta . context || this . context . name ; meta . aggregate = meta . aggregate || this . name ; this . snapshotConversions [ meta . context + '.' + meta . aggregate + '.' + meta . version ] = fn ; } for ( var r in this . loadingSnapshotTransformerRegistrations ) { var reg = this . loadingSnapshotTransformerRegistrations [ r ] ; var meta = reg . meta ; var fn = reg . fn ; meta . context = meta . context || this . context . name ; meta . aggregate = meta . aggregate || this . name ; this . loadingSnapshotTransformers [ meta . context + '.' + meta . aggregate + '.' + meta . version ] = fn ; } for ( var r in this . committingSnapshotTransformerRegistrations ) { var reg = this . committingSnapshotTransformerRegistrations [ r ] ; var meta = reg . meta ; var fn = reg . fn ; meta . context = meta . context || this . context . name ; meta . aggregate = meta . aggregate || this . name ; this . committingSnapshotTransformers [ meta . context + '.' + meta . aggregate + '.' + meta . version ] = fn ; } }
Inject the context module.
@param {Context} context The context module to be injected.
Inject the context module .