csv-parser
Advanced tools
Comparing version 2.3.2 to 2.3.3
16
index.js
const { Transform } = require('stream') | ||
const bufferFrom = require('buffer-from') | ||
const bufferAlloc = require('buffer-alloc') | ||
const [cr] = bufferFrom('\r') | ||
const [nl] = bufferFrom('\n') | ||
const [cr] = Buffer.from('\r') | ||
const [nl] = Buffer.from('\n') | ||
const defaults = { | ||
@@ -34,3 +32,3 @@ escape: '"', | ||
if (typeof options[key] !== 'undefined') { | ||
([options[key]] = bufferFrom(options[key])) | ||
([options[key]] = Buffer.from(options[key])) | ||
} | ||
@@ -40,6 +38,6 @@ } | ||
// if escape is not defined on the passed options, use the end value of quote | ||
options.escape = (opts || {}).escape ? bufferFrom(options.escape)[0] : options.quote | ||
options.escape = (opts || {}).escape ? Buffer.from(options.escape)[0] : options.quote | ||
this.state = { | ||
empty: options.raw ? bufferAlloc(0) : '', | ||
empty: options.raw ? Buffer.alloc(0) : '', | ||
escaped: false, | ||
@@ -108,3 +106,3 @@ first: true, | ||
const char = typeof skipComments === 'string' ? skipComments : '#' | ||
if (buffer[start] === bufferFrom(char)[0]) { | ||
if (buffer[start] === Buffer.from(char)[0]) { | ||
return | ||
@@ -207,3 +205,3 @@ } | ||
if (typeof data === 'string') { | ||
data = bufferFrom(data) | ||
data = Buffer.from(data) | ||
} | ||
@@ -210,0 +208,0 @@ |
{ | ||
"name": "csv-parser", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "Streaming CSV parser that aims for maximum speed as well as compatibility with the csv-spectrum test suite", | ||
@@ -35,8 +35,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@hapi/joi": "^16.1.4", | ||
"buffer-alloc": "^1.1.0", | ||
"buffer-from": "^1.0.0", | ||
"generate-object-property": "^1.0.0", | ||
"minimist": "^1.2.0", | ||
"ndjson": "^1.4.0" | ||
"through2": "^3.0.1" | ||
}, | ||
@@ -43,0 +39,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
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
2
27327
354
+ Addedthrough2@^3.0.1
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthrough2@3.0.2(transitive)
- Removed@hapi/joi@^16.1.4
- Removedbuffer-alloc@^1.1.0
- Removedbuffer-from@^1.0.0
- Removedgenerate-object-property@^1.0.0
- Removedndjson@^1.4.0
- Removed@hapi/address@2.1.4(transitive)
- Removed@hapi/formula@1.2.0(transitive)
- Removed@hapi/hoek@8.5.1(transitive)
- Removed@hapi/joi@16.1.8(transitive)
- Removed@hapi/pinpoint@1.0.2(transitive)
- Removed@hapi/topo@3.1.6(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedgenerate-object-property@1.2.0(transitive)
- Removedis-property@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedndjson@1.5.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsplit2@2.2.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedxtend@4.0.2(transitive)