lib/auto-parser.js
function autoParse(data, models, options) {
  options = options || {};
  var parsed = {};

  // Go through each data point
  _.each(data, function(value, field) {
    var d = findField(field, models);

    // Find field in
    if (d) {
      parsed[d.modelName] = parsed[d.modelName] || {};
      parsed[d.modelName][d.field.name] = parse(value, d.field, options);
    }
  });

  return parsed;
}
function autoParse(data, models, options) {
  options = options || {};
  var parsed = {};

  // Go through each data point
  _.each(data, function(value, field) {
    var d = findField(field, models);

    // Find field in
    if (d) {
      parsed[d.modelName] = parsed[d.modelName] || {};
      parsed[d.modelName][d.field.name] = parse(value, d.field, options);
    }
  });

  return parsed;
}
function autoParse ( data , models , options ) { options = options || { } ; var parsed = { } ; // Go through each data point _ . each ( data , function ( value , field ) { var d = findField ( field , models ) ; // Find field in if ( d ) { parsed [ d . modelName ] = parsed [ d . modelName ] || { } ; parsed [ d . modelName ] [ d . field . name ] = parse ( value , d . field , options ) ; } } ) ; return parsed ; }
Main function. Takes a row of incoming data and the models definition
Main function . Takes a row of incoming data and the models definition