lib/definitions/aggregate.js
function (meta, fn) {
    if (!_.isObject(meta) || meta.version === undefined || meta.version === null || !_.isNumber(meta.version)) {
      throw new Error('Please pass in a version');
    }
    if (!_.isFunction(fn)) {
      throw new Error('Please pass in a function');
    }

    var wrappedFn;
    if (fn.length === 1) {
      wrappedFn = function (s, cb) {
        try {
          cb(null, fn(s));
        } catch (err) {
          cb(err);
        }
      };
    } else {
      wrappedFn = fn;
    }

    this.loadingSnapshotTransformerRegistrations.push({ meta: meta, fn: wrappedFn });
    return this;
  }
function (meta, fn) {
    if (!_.isObject(meta) || meta.version === undefined || meta.version === null || !_.isNumber(meta.version)) {
      throw new Error('Please pass in a version');
    }
    if (!_.isFunction(fn)) {
      throw new Error('Please pass in a function');
    }

    var wrappedFn;
    if (fn.length === 1) {
      wrappedFn = function (s, cb) {
        try {
          cb(null, fn(s));
        } catch (err) {
          cb(err);
        }
      };
    } else {
      wrappedFn = fn;
    }

    this.loadingSnapshotTransformerRegistrations.push({ meta: meta, fn: wrappedFn });
    return this;
  }
function ( meta , fn ) { if ( ! _ . isObject ( meta ) || meta . version === undefined || meta . version === null || ! _ . isNumber ( meta . version ) ) { throw new Error ( 'Please pass in a version' ) ; } if ( ! _ . isFunction ( fn ) ) { throw new Error ( 'Please pass in a function' ) ; } var wrappedFn ; if ( fn . length === 1 ) { wrappedFn = function ( s , cb ) { try { cb ( null , fn ( s ) ) ; } catch ( err ) { cb ( err ) ; } } ; } else { wrappedFn = fn ; } this . loadingSnapshotTransformerRegistrations . push ( { meta : meta , fn : wrappedFn } ) ; return this ; }
Defines a new loading transform function for snapshot.
@param {Object}   meta Meta infos like: { version: 10 }
@param {Function} fn   Function containing the transform function
`function(snapshotData, callback){}`
@returns {Aggregate}
Defines a new loading transform function for snapshot .