ng-csv
ng-csv copied to clipboard
Cant add txtDelim when the seprator is not equals to (,) without setting quoteStrings to true
if (options.quoteStrings || data.indexOf(',') > -1 || data.indexOf('\n') > -1 || data.indexOf('\r') > -1) {
data = options.txtDelim + data + options.txtDelim;
}
must be replaced by if (options.quoteStrings || data.indexOf(options.fieldSep ? options.fieldSep : ",") > -1 || data.indexOf('\n') > -1 || data.indexOf('\r') > -1) { data = options.txtDelim + data + options.txtDelim; }