preserve compatibility of quote_style

This commit is contained in:
alexlamsl 2021-04-07 05:30:02 +08:00
parent 4870747306
commit 94a7bf8521

View File

@ -171,15 +171,15 @@ function OutputStream(options) {
} }
var quote_string = [ var quote_string = [
function(str, quote, dq, sq) { null,
return dq > sq ? quote_single(str) : quote_double(str);
},
quote_single, quote_single,
quote_double, quote_double,
function(str, quote) { function(str, quote) {
return quote == "'" ? quote_single(str) : quote_double(str); return quote == "'" ? quote_single(str) : quote_double(str);
}, },
][options.quote_style]; ][options.quote_style] || function(str, quote, dq, sq) {
return dq > sq ? quote_single(str) : quote_double(str);
};
function make_string(str, quote) { function make_string(str, quote) {
var dq = 0, sq = 0; var dq = 0, sq = 0;