asafdav/ng-csv

Cant add txtDelim when the seprator is not equals to (,) without setting quoteStrings to true

agoubar opened this issue · 0 comments

    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;
}