|
|
@ -1451,6 +1451,18 @@ var UNPARSE_TESTS = [ |
|
|
|
config: { quotes: [true, false, true] }, |
|
|
|
config: { quotes: [true, false, true] }, |
|
|
|
expected: '"Col1",Col2,"Col3"\r\n"a",b,"c"\r\n"d",e,"f"' |
|
|
|
expected: '"Col1",Col2,"Col3"\r\n"a",b,"c"\r\n"d",e,"f"' |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
description: "Force quotes around string fields only", |
|
|
|
|
|
|
|
input: [['a', 'b', 'c'], ['d', 10, true]], |
|
|
|
|
|
|
|
config: { onlyQuoteStrings: true }, |
|
|
|
|
|
|
|
expected: '"a","b","c"\r\n"d",10,true' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
description: "Force quotes around string fields only (with header row)", |
|
|
|
|
|
|
|
input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": 10, "Col3": true }], |
|
|
|
|
|
|
|
config: { onlyQuoteStrings: true }, |
|
|
|
|
|
|
|
expected: '"Col1","Col2","Col3"\r\n"a","b","c"\r\n"d",10,true' |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
description: "Empty input", |
|
|
|
description: "Empty input", |
|
|
|
input: [], |
|
|
|
input: [], |
|
|
|