csv-stringify
Advanced tools
Comparing version 2.1.0 to 3.0.0
# Changelog | ||
## Version 3.0.0 | ||
* Switch linebreak check for rowDelimiter check | ||
## Version 2.1.0 | ||
@@ -5,0 +9,0 @@ |
@@ -290,3 +290,3 @@ 'use strict'; | ||
Stringifier.prototype.stringify = function (line) { | ||
var _line, column, columns, containsEscape, containsLinebreak, containsQuote, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, shouldQuote, value; | ||
var _line, column, columns, containsEscape, containsQuote, containsRowDelimiter, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, shouldQuote, value; | ||
if ((typeof line === 'undefined' ? 'undefined' : _typeof(line)) !== 'object') { | ||
@@ -347,4 +347,4 @@ return line; | ||
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'; | ||
containsRowDelimiter = field.indexOf(this.options.rowDelimiter) >= 0; | ||
shouldQuote = containsQuote || containsdelimiter || containsRowDelimiter || this.options.quoted || this.options.quotedString && typeof line[i] === 'string'; | ||
if (shouldQuote && containsEscape) { | ||
@@ -351,0 +351,0 @@ regexp = escape === '\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g'); |
@@ -284,3 +284,3 @@ // Generated by CoffeeScript 2.0.3 | ||
Stringifier.prototype.stringify = function(line) { | ||
var _line, column, columns, containsEscape, containsLinebreak, containsQuote, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, shouldQuote, value; | ||
var _line, column, columns, containsEscape, containsQuote, containsRowDelimiter, containsdelimiter, delimiter, escape, field, i, j, l, newLine, quote, ref, ref1, regexp, shouldQuote, value; | ||
if (typeof line !== 'object') { | ||
@@ -340,4 +340,4 @@ return line; | ||
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'); | ||
containsRowDelimiter = field.indexOf(this.options.rowDelimiter) >= 0; | ||
shouldQuote = containsQuote || containsdelimiter || containsRowDelimiter || this.options.quoted || (this.options.quotedString && typeof line[i] === 'string'); | ||
if (shouldQuote && containsEscape) { | ||
@@ -344,0 +344,0 @@ regexp = escape === '\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g'); |
{ | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"name": "csv-stringify", | ||
@@ -4,0 +4,0 @@ "description": "CSV stringifier implementing the Node.js `stream.Transform` API", |
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
90480