Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csv-parse

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-parse - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

7

CHANGELOG.md
# 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 @@

17

lib/es5/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc