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

@fast-csv/parse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fast-csv/parse - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

3

build/src/CsvParserStream.d.ts

@@ -16,2 +16,3 @@ /// <reference types="node" />

private endEmitted;
private headersEmitted;
constructor(parserOptions: ParserOptions);

@@ -29,3 +30,5 @@ private get hasHitRowLimit();

private transformRow;
private checkAndEmitHeaders;
private skipRow;
private pushRow;
}

@@ -15,2 +15,3 @@ "use strict";

this.endEmitted = false;
this.headersEmitted = false;
this.parserOptions = parserOptions;

@@ -101,2 +102,3 @@ this.parser = new parser_1.Parser(parserOptions);

};
this.checkAndEmitHeaders();
// if we have emitted all rows or we have hit the maxRows limit option

@@ -144,3 +146,7 @@ // then end

if (!withHeaders.isValid) {
return cb(null, { isValid: false, row: parsedRow });
if (this.shouldEmitRows) {
return cb(null, { isValid: false, row: parsedRow });
}
// skipped because of skipRows option remove from total row count
return this.skipRow(cb);
}

@@ -152,4 +158,3 @@ if (withHeaders.row) {

// skipped because of skipRows option remove from total row count
this.rowCount -= 1;
return cb(null, { row: null, isValid: true });
return this.skipRow(cb);
}

@@ -166,2 +171,13 @@ // this is a header row dont include in the rowCount or parsedRowCount

}
checkAndEmitHeaders() {
if (!this.headersEmitted && this.headerTransformer.headers) {
this.headersEmitted = true;
this.emit('headers', this.headerTransformer.headers);
}
}
skipRow(cb) {
// skipped because of skipRows option remove from total row count
this.rowCount -= 1;
return cb(null, { row: null, isValid: true });
}
pushRow(row, cb) {

@@ -168,0 +184,0 @@ try {

4

build/src/transforms/HeaderTransformer.d.ts
import { ParserOptions } from '../ParserOptions';
import { Row, RowArray, RowValidatorCallback } from '../types';
import { HeaderArray, Row, RowArray, RowValidatorCallback } from '../types';
export declare class HeaderTransformer<O extends Row> {
private readonly parserOptions;
private headers;
headers: HeaderArray | null;
private receivedHeaders;

@@ -7,0 +7,0 @@ private readonly shouldUseFirstRow;

{
"name": "@fast-csv/parse",
"version": "4.1.0",
"version": "4.1.1",
"description": "fast-csv parsing package",

@@ -32,2 +32,3 @@ "keywords": [

"scripts": {
"prepare": "npm run build",
"build": "npm run clean && npm run compile",

@@ -60,3 +61,3 @@ "clean": "rm -rf ./build && rm -rf tsconfig.tsbuildinfo",

},
"gitHead": "682710d90cb3c80c35e067cbe02d18eb822a7873"
"gitHead": "1cf0c07413504f28bec613e3b82efa439c0f8b2f"
}

Sorry, the diff of this file is not supported yet

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