diff --git a/jquery.parse.js b/jquery.parse.js index f47aae4..085c6f5 100644 --- a/jquery.parse.js +++ b/jquery.parse.js @@ -1,6 +1,6 @@ /* jQuery Parse Plugin - v0.5.7 + v0.5.8 https://github.com/mholt/jquery.parse */ diff --git a/jquery.parse.min.js b/jquery.parse.min.js index 63d71bc..edd3634 100644 --- a/jquery.parse.min.js +++ b/jquery.parse.min.js @@ -1,6 +1,6 @@ /* jQuery Parse Plugin - v0.5.7 + v0.5.8 https://github.com/mholt/jquery.parse */ ;(function(e){"use strict";function n(e){e.delimiter=e.delimiter||t.delimiter;e.header=typeof e.header==="undefined"?t.header:e.header;e.dynamicTyping=typeof e.dynamicTyping==="undefined"?t.dynamicTyping:e.dynamicTyping;if(e.delimiter=='"'||e.delimiter=="\n")e.delimiter=t.delimiter;if(e.delimiter.length>1)e.delimiter=e.delimiter[0];return e}function r(e,t){function a(e){return e?{fields:[],rows:[]}:[[]]}function f(){return{i:0,lineNum:1,field:0,fieldVal:"",line:"",ch:"",inQuotes:false,parsed:a(t.header)}}function l(){var e=u.i>0&&d(r[u.i-1])||u.i==0;var t=u.i0)u.parsed.rows.push({});else u.parsed.push([]);u.lineNum++;u.line="";u.field=0}function y(e){var t=o.floats.test(e);return t?parseFloat(e):e}function b(){if(o.empty.test(u.line)){if(i.header){if(u.lineNum==1){u.parsed.fields=[];u.lineNum--}else u.parsed.rows.splice(u.parsed.rows.length-1,1)}else u.parsed.splice(u.parsed.length-1,1);return true}return false}function w(){if(!i.header)return true;if(u.parsed.rows.length==0)return true;var e=u.parsed.fields.length;var t=0;var n=u.parsed.rows[u.parsed.rows.length-1];for(var r in n)if(n.hasOwnProperty(r))t++;if(e!=t)return E("Too few fields; expected "+e+" fields, parsed "+t);return true}function E(e){s.push({message:e,line:u.lineNum,row:i.header?u.parsed.rows.length-1:u.parsed.length-1,index:u.i});return false}var n=this;var r=e;var i=t;var s=[];var o={floats:/^-?\d+(\.\d+)?$/,empty:/^\s*$/};var u=f();this.parse=function(e){if(typeof e==="object")n.setConfig(e);else if(typeof e==="string")n.setInput(e);s=[];u=f();for(u.i=0;u.i