lib/auto-parser.js
function parse(value, field, options) {
  options = options || {};
  var parsed = utils.standardizeInput(value);

  // Integer
  if (field.type.key === "BOOLEAN") {
    parsed = utils.toBoolean(parsed);
  }
  else if (field.type.key === "INTEGER") {
    parsed = utils.toInteger(parsed);
  }
  else if (field.type.key === "FLOAT") {
    parsed = utils.toFloat(parsed);
  }
  else if (field.type.key === "DATEONLY") {
    parsed = utils.toDate(parsed, options.dateFormat);
  }
  else if (field.type.key === "DATE") {
    parsed = utils.toDateTime(parsed, options.datetimeFormat);
  }
  else if (field.type.key === "STRING") {
    parsed = utils.toString(parsed);
  }

  return parsed;
}
function parse(value, field, options) {
  options = options || {};
  var parsed = utils.standardizeInput(value);

  // Integer
  if (field.type.key === "BOOLEAN") {
    parsed = utils.toBoolean(parsed);
  }
  else if (field.type.key === "INTEGER") {
    parsed = utils.toInteger(parsed);
  }
  else if (field.type.key === "FLOAT") {
    parsed = utils.toFloat(parsed);
  }
  else if (field.type.key === "DATEONLY") {
    parsed = utils.toDate(parsed, options.dateFormat);
  }
  else if (field.type.key === "DATE") {
    parsed = utils.toDateTime(parsed, options.datetimeFormat);
  }
  else if (field.type.key === "STRING") {
    parsed = utils.toString(parsed);
  }

  return parsed;
}
function parse ( value , field , options ) { options = options || { } ; var parsed = utils . standardizeInput ( value ) ; // Integer if ( field . type . key === "BOOLEAN" ) { parsed = utils . toBoolean ( parsed ) ; } else if ( field . type . key === "INTEGER" ) { parsed = utils . toInteger ( parsed ) ; } else if ( field . type . key === "FLOAT" ) { parsed = utils . toFloat ( parsed ) ; } else if ( field . type . key === "DATEONLY" ) { parsed = utils . toDate ( parsed , options . dateFormat ) ; } else if ( field . type . key === "DATE" ) { parsed = utils . toDateTime ( parsed , options . datetimeFormat ) ; } else if ( field . type . key === "STRING" ) { parsed = utils . toString ( parsed ) ; } return parsed ; }
Parse value based on field definition
Parse value based on field definition