UNPKG

csv-writer

Version:

Convert objects/arrays into a CSV string or write them into a CSV file

7 lines (5 loc) 209 B
export const resolveDelimiterChar = (char?: string) => { if (char === ',' || char === ';') return char; if (typeof char === 'undefined') return ','; throw new Error('Invalid field delimiter'); };