I have noticed that the following csv is parsed incorrectly:
"c1"|"c2"|"c3"
"1"|"{2\"|3}"|"4"
The following code:
csv({delimiter:'|', escape: '\\', quote: '"'})
.fromString(`"c1"|"c2"|"c3"\n"1"|"{2\\"|3}"|"4"`)
.then((d) => console.log(d))
results in printing:
[ { c1: '1', c2: '"{2\\"', c3: '3}"', field4: '4' } ]
while the expected result is:
[ { c1: '1', c2: '{2"|3}', c3: '4' } ]
I noticed that it only happens when both escaped quote and delimiter are contained inside quoted column, i.e. the following csvs are parsed correctly:
"c1"|"c2"|"c3"
"1"|"{2|3}"|"4"
=>
[ { c1: '1', c2: '{2|3}', c3: '4' } ]
"c1"|"c2"|"c3"
"1"|"{2\"3}"|"4"
=>
[ { c1: '1', c2: '{2"3}', c3: '4' } ]