We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb54cf5 commit a236819Copy full SHA for a236819
src/csv2json.ts
@@ -310,7 +310,8 @@ export const Csv2Json = function(options: FullCsv2JsonOptions) {
310
lastChar = fieldValue[lastIndex];
311
// If the field starts and ends with a wrap delimiter
312
if (firstChar === options.delimiter.wrap && lastChar === options.delimiter.wrap) {
313
- return fieldValue.substring(1, lastIndex - 1);
+ // Handle the case where the field is just a pair of wrap delimiters
314
+ return fieldValue.length <= 2 ? "" : fieldValue.substring(1, lastIndex);
315
}
316
return fieldValue;
317
0 commit comments