csv-parse
Advanced tools
Comparing version 4.1.0 to 4.2.0
# Changelog | ||
## Version 4.2.0 | ||
Fix: | ||
* record_delimiter: fix multi bytes with skip_empty_lines and from_line | ||
* rtrim: accept tab | ||
## Version 4.1.0 | ||
@@ -5,0 +12,0 @@ |
@@ -72,2 +72,3 @@ "use strict"; | ||
var space = 32; | ||
var tab = 9; | ||
@@ -266,4 +267,5 @@ var Parser = | ||
return _this; | ||
} | ||
} // Implementation of `Transform._transform` | ||
_createClass(Parser, [{ | ||
@@ -283,3 +285,4 @@ key: "_transform", | ||
callback(err); | ||
} | ||
} // Implementation of `Transform._flush` | ||
}, { | ||
@@ -295,3 +298,4 @@ key: "_flush", | ||
callback(err); | ||
} | ||
} // Central parser implementation | ||
}, { | ||
@@ -461,2 +465,3 @@ key: "__parse", | ||
this.info.empty_lines++; | ||
pos += recordDelimiterLength - 1; | ||
continue; | ||
@@ -473,2 +478,3 @@ } // Activate records emition if above from_line | ||
pos += recordDelimiterLength - 1; | ||
continue; | ||
@@ -570,7 +576,8 @@ } else { | ||
} | ||
} | ||
} // Helper to test if a character is a space or a line delimiter | ||
}, { | ||
key: "__isCharTrimable", | ||
value: function __isCharTrimable(chr) { | ||
return chr === space || chr === cr || chr === nl; | ||
return chr === space || chr === tab || chr === cr || chr === nl; | ||
} | ||
@@ -577,0 +584,0 @@ }, { |
@@ -32,2 +32,3 @@ | ||
const space = 32 | ||
const tab = 9 | ||
@@ -192,2 +193,3 @@ class Parser extends Transform { | ||
} | ||
// Implementation of `Transform._transform` | ||
_transform(buf, encoding, callback){ | ||
@@ -203,2 +205,3 @@ if(this.state.stop === true){ | ||
} | ||
// Implementation of `Transform._flush` | ||
_flush(callback){ | ||
@@ -211,2 +214,3 @@ if(this.state.stop === true){ | ||
} | ||
// Central parser implementation | ||
__parse(nextBuf, end){ | ||
@@ -335,2 +339,3 @@ const {comment, escape, from, from_line, info, ltrim, max_record_size, quote, raw, relax, rtrim, skip_empty_lines, to, to_line} = this.options | ||
this.info.empty_lines++ | ||
pos += recordDelimiterLength - 1 | ||
continue | ||
@@ -343,2 +348,3 @@ } | ||
this.__resetRow() | ||
pos += recordDelimiterLength - 1 | ||
continue | ||
@@ -420,4 +426,5 @@ }else{ | ||
} | ||
// Helper to test if a character is a space or a line delimiter | ||
__isCharTrimable(chr){ | ||
return chr === space || chr === cr || chr === nl | ||
return chr === space || chr === tab || chr === cr || chr === nl | ||
} | ||
@@ -424,0 +431,0 @@ __onRow(){ |
{ | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"name": "csv-parse", | ||
@@ -4,0 +4,0 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", |
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
95121
2198