Describe the bug
There is no way to quote empty strings without also quoting null and undefined values. I expect that empty string will be quoted and null / undefined values will not be quoted when options quoted_match: /^&/ and quoted_empty: false are provided. quoted_empty: true will quote empty strings, but it will also quote null and undefined values.
Node version: 16.13.2
csv-stringify version: 6.1.2
To Reproduce
import { stringify } from "csv-stringify";
stringify([
["a", null, undefined, "", "b"],
], {
quoted_empty: false,
quoted_match: /^$/,
}, (_, csv) => {
console.log(csv);
});
Output: a,,,,b
Expected output: a,,,"",b
Describe the bug
There is no way to quote empty strings without also quoting null and undefined values. I expect that empty string will be quoted and
null/undefinedvalues will not be quoted when optionsquoted_match: /^&/andquoted_empty: falseare provided.quoted_empty: truewill quote empty strings, but it will also quotenullandundefinedvalues.Node version: 16.13.2
csv-stringify version: 6.1.2
To Reproduce
Output:
a,,,,bExpected output:
a,,,"",b