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

fast-csv

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-csv - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

.vscode/settings.json

4

History.md

@@ -0,1 +1,5 @@

# v2.4.0
* Allow renaming headers. [#175](https://github.com/C2FO/fast-csv/pull/175)
# v2.3.1

@@ -2,0 +6,0 @@

19

lib/parser/parser_stream.js

@@ -36,2 +36,3 @@ var extended = require("../extended"),

this._headers = options.headers;
this._renameHeaders = options.renameHeaders;
this._ignoreEmpty = options.ignoreEmpty;

@@ -118,2 +119,3 @@ this._discardUnmappedColumns = options.discardUnmappedColumns;

var headers = this._headers,
renameHeaders = this._renameHeaders,
discardUnmappedColumns = this._discardUnmappedColumns,

@@ -147,3 +149,3 @@ strictColumnHandling = this._strictColumnHandling,

if (isUndefined(headers[i])) {
continue;
continue;
}

@@ -161,3 +163,10 @@ val = data[i];

if (extended.isBoolean(headers) && headers) {
if (renameHeaders) {
if (Array.isArray(headers)) {
rows.shift();
headerHandler(null, headers);
} else {
self.emit("error", new Error("Error renaming headers: new headers must be provided in an array"));
}
} else if (extended.isBoolean(headers) && headers) {
this.__handleLine(rows.shift(), 0, true, headerHandler);

@@ -205,5 +214,5 @@ } else {

if (data && typeof data == 'string' && data.charCodeAt(0) == '0xFEFF') {
return data.slice(1);
}
return data;
return data.slice(1);
}
return data;
},

@@ -210,0 +219,0 @@

{
"name": "fast-csv",
"version": "2.3.1",
"version": "2.4.0",
"description": "CSV parser and writer",

@@ -5,0 +5,0 @@ "main": "index.js",

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