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

csv-parser

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-parser - npm Package Compare versions

Comparing version 2.3.5 to 3.0.0

11

index.js

@@ -179,10 +179,11 @@ const { Transform } = require('stream')

writeRow (cells) {
if (this.headers === false || cells.length > this.headers.length) {
this.headers = cells.map((value, index) => index)
}
const headers = (this.headers === false) ? cells.map((value, index) => index) : this.headers
const row = cells.reduce((o, cell, index) => {
const header = this.headers[index]
if (header !== null) {
const header = headers[index]
if (header === null) return o // skip columns
if (header !== undefined) {
o[header] = cell
} else {
o[`_${index}`] = cell
}

@@ -189,0 +190,0 @@ return o

{
"name": "csv-parser",
"version": "2.3.5",
"version": "3.0.0",
"description": "Streaming CSV parser that aims for maximum speed as well as compatibility with the csv-spectrum test suite",

@@ -23,3 +23,3 @@ "license": "MIT",

"engines": {
"node": ">= 8.16.0"
"node": ">= 10"
},

@@ -36,4 +36,3 @@ "scripts": {

"dependencies": {
"minimist": "^1.2.0",
"through2": "^3.0.1"
"minimist": "^1.2.0"
},

@@ -40,0 +39,0 @@ "devDependencies": {

@@ -254,5 +254,9 @@ [tests]: http://img.shields.io/travis/mafintosh/csv-parser.svg

Type: `Boolean`<br>
Default: `false`
If `true`, instructs the parser that the number of columns in each row must match
the number of `headers` specified.
the number of `headers` specified or throws an exception.
if `false`: the headers are mapped to the column index
less columns: any missing column in the middle will result in a wrong property mapping!
more columns: the aditional columns will create a "_"+index properties - eg. "_10":"value"

@@ -259,0 +263,0 @@ ## Events

Sorry, the diff of this file is not supported yet

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