csv-parse
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
var Parser, StringDecoder, stream, util; | ||
@@ -44,3 +44,3 @@ | ||
parser = new Parser(options); | ||
if (data) { | ||
if (data != null) { | ||
process.nextTick(function() { | ||
@@ -80,3 +80,3 @@ parser.write(data); | ||
Parser = function(options) { | ||
var base, base1, base10, base11, base2, base3, base4, base5, base6, base7, base8, base9, k, v; | ||
var base, base1, base10, base11, base12, base2, base3, base4, base5, base6, base7, base8, base9, k, v; | ||
if (options == null) { | ||
@@ -125,5 +125,8 @@ options = {}; | ||
} | ||
if ((base11 = this.options).skip_empty_lines == null) { | ||
base11.skip_empty_lines = false; | ||
if ((base11 = this.options).auto_parse_date == null) { | ||
base11.auto_parse_date = false; | ||
} | ||
if ((base12 = this.options).skip_empty_lines == null) { | ||
base12.skip_empty_lines = false; | ||
} | ||
this.lines = 0; | ||
@@ -208,3 +211,3 @@ this.count = 0; | ||
Parser.prototype.__write = function(chars, end, callback) { | ||
var acceptedLength, areNextCharsDelimiter, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isQuote, isRowDelimiter, l, ltrim, nextCharPos, ref, results, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting; | ||
var acceptedLength, areNextCharsDelimiter, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isQuote, isRowDelimiter, l, ltrim, m, nextCharPos, ref, results, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting; | ||
ltrim = this.options.trim || this.options.ltrim; | ||
@@ -316,2 +319,9 @@ rtrim = this.options.trim || this.options.rtrim; | ||
this.line.push(parseFloat(this.field)); | ||
} else if (this.options.auto_parse && this.options.auto_parse_date) { | ||
m = Date.parse(this.field); | ||
if (isNaN(m)) { | ||
this.line.push(this.field); | ||
} else { | ||
this.line.push(new Date(m)); | ||
} | ||
} else { | ||
@@ -318,0 +328,0 @@ this.line.push(this.field); |
{ | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"name": "csv-parse", | ||
"description": "CSV parsing implementing the Node.js `stream.Transform` API", | ||
"keywords": [ "csv", "parse", "parser" ], | ||
"keywords": [ | ||
"csv", | ||
"parse", | ||
"parser" | ||
], | ||
"contributors": [ | ||
@@ -30,3 +34,4 @@ "David Worms <david@adaltas.com> (http://www.adaltas.com)", | ||
"homepage": "http://csv.adaltas.com/parse/", | ||
"dependencies": {}, | ||
"dependencies": { | ||
}, | ||
"devDependencies": { | ||
@@ -47,2 +52,2 @@ "each": "0.5.0", | ||
} | ||
} | ||
} |
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
19493
463