lib/services/model_factory.js
function(data) {
      // use the supplied constructor
      // This allows a user to pass in instance: function Audience() {}
      // and have the Audience() function return an instance of Audience
      var instance = new InstanceConstructor();
      var instanceData = _.extend(
        {},
        _.cloneDeep(config.fields || {}),
        _.cloneDeep(data || {})
      );
      // populate the instanceor
      _.extend(instance, instanceData);
      return instance;
    }
function(data) {
      // use the supplied constructor
      // This allows a user to pass in instance: function Audience() {}
      // and have the Audience() function return an instance of Audience
      var instance = new InstanceConstructor();
      var instanceData = _.extend(
        {},
        _.cloneDeep(config.fields || {}),
        _.cloneDeep(data || {})
      );
      // populate the instanceor
      _.extend(instance, instanceData);
      return instance;
    }
function ( data ) { // use the supplied constructor // This allows a user to pass in instance: function Audience() {} // and have the Audience() function return an instance of Audience var instance = new InstanceConstructor ( ) ; var instanceData = _ . extend ( { } , _ . cloneDeep ( config . fields || { } ) , _ . cloneDeep ( data || { } ) ) ; // populate the instanceor _ . extend ( instance , instanceData ) ; return instance ; }
Creates a new object with the config.fields as the default values

@param {Object=} data
@return {Object}
Creates a new object with the config . fields as the default values