Comparing version 0.2.0 to 0.2.1
@@ -64,3 +64,3 @@ var extended = require("./extended"), | ||
var ignoreEmpty = this._ignoreEmpty; | ||
if (extended.isBoolean(ignoreEmpty) && ignoreEmpty && EMPTY.test(line.join(""))) { | ||
if (extended.isBoolean(ignoreEmpty) && ignoreEmpty && (!line || EMPTY.test(line.join("")))) { | ||
return null; | ||
@@ -67,0 +67,0 @@ } |
@@ -5,4 +5,3 @@ var extended = require("./extended"), | ||
trimLeft = extended.trimLeft, | ||
trimRight = extended.trimRight, | ||
LINE_BREAK = extended.LINE_BREAK; | ||
trimRight = extended.trimRight; | ||
@@ -17,5 +16,6 @@ function createParser(options) { | ||
VALUE_REGEXP = new RegExp("([^" + delimiter + "'\"\\s\\\\]*(?:\\s+[^" + delimiter + "'\"\\s\\\\]+)*)"), | ||
SEARCH_REGEXP = new RegExp("(?:\\n|" + delimiter + ")"), | ||
SEARCH_REGEXP = new RegExp("(?:\\n|\\r|" + delimiter + ")"), | ||
ESCAPE_CHAR = options.escape || '"', | ||
NEXT_TOKEN_REGEXP = new RegExp("([^\\s]|\\\n|" + delimiter + ")"); | ||
NEXT_TOKEN_REGEXP = new RegExp("([^\\s]|\\n|\\r|" + delimiter + ")"), | ||
LINE_BREAK = /[\r\n]/; | ||
@@ -72,7 +72,7 @@ function formatItem(item) { | ||
} else { | ||
throw new Error("Parse Error: expected: '" + ESCAPE + "' got: '" + nextToken + "'. at '" + str.substr(cursor).replace(/\n/g, "\\n" + "'")); | ||
throw new Error("Parse Error: expected: '" + ESCAPE + "' got: '" + nextToken + "'. at '" + str.substr(cursor).replace(/[r\n]/g, "\\n" + "'")); | ||
} | ||
} else if ((!depth && nextToken && nextToken.search(SEARCH_REGEXP) === -1)) { | ||
throw new Error("Parse Error: expected: '" + ESCAPE + "' got: '" + nextToken + "'. at '" + str.substr(cursor, 10).replace(/\n/g, "\\n" + "'")); | ||
} else if (hasMoreData && (!nextToken || nextToken.search(LINE_BREAK) === -1)) { | ||
throw new Error("Parse Error: expected: '" + ESCAPE + "' got: '" + nextToken + "'. at '" + str.substr(cursor, 10).replace(/[\r\n]/g, "\\n" + "'")); | ||
} else if (hasMoreData && (!nextToken || !LINE_BREAK.test(nextToken))) { | ||
cursor = null; | ||
@@ -104,3 +104,3 @@ } | ||
} | ||
} else if (nextChar.search(LINE_BREAK) !== -1) { | ||
} else if (LINE_BREAK.test(nextChar)) { | ||
items.push(formatItem(searchStr.substr(0, nextIndex))); | ||
@@ -134,3 +134,3 @@ cursor += nextIndex; | ||
break; | ||
} else if (token === LINE_BREAK) { | ||
} else if (LINE_BREAK.test(token)) { | ||
i = nextToken.cursor + 1; | ||
@@ -137,0 +137,0 @@ if (i < l) { |
{ | ||
"name": "fast-csv", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "CSV parser and writer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59478172
37