Socket
Socket
Sign inDemoInstall

csv-stringify

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-stringify - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

10

lib/index.js

@@ -210,3 +210,3 @@ // Generated by CoffeeScript 1.10.0

Stringifier.prototype.stringify = function(line) {
var _line, column, columns, containsLinebreak, containsQuote, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, value;
var _line, column, columns, containsEscape, containsLinebreak, containsQuote, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, shouldQuote, value;
if (typeof line !== 'object') {

@@ -258,3 +258,9 @@ return line;

containsQuote = field.indexOf(quote) >= 0;
containsEscape = field.indexOf(escape) >= 0 && (escape !== quote);
containsLinebreak = field.indexOf('\r') >= 0 || field.indexOf('\n') >= 0;
shouldQuote = containsQuote || containsdelimiter || containsLinebreak || this.options.quoted || (this.options.quotedString && typeof line[i] === 'string');
if (shouldQuote && containsEscape) {
regexp = escape === '\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g');
field = field.replace(regexp, escape + escape);
}
if (containsQuote) {

@@ -264,3 +270,3 @@ regexp = new RegExp(quote, 'g');

}
if (containsQuote || containsdelimiter || containsLinebreak || this.options.quoted || (this.options.quotedString && typeof line[i] === 'string')) {
if (shouldQuote) {
field = quote + field + quote;

@@ -267,0 +273,0 @@ }

2

package.json
{
"version": "1.0.1",
"version": "1.0.2",
"name": "csv-stringify",

@@ -4,0 +4,0 @@ "description": "CSV stringifier 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