Skip to content

@eightkk/vue-weave / core / toCsv

Function: toCsv() ​

toCsv(table, options?): string

Defined in: src/core/interchangeCsv.ts:41

Build RFC 4180 CSV text: fields separated by commas, records ended by CRLF, and fields that contain a comma, a double quote, CR or LF enclosed in double quotes with inner quotes doubled. undefined is an empty field. Numbers are written as String writes them, except that one below 1e-6 is written in plain decimal notation (0.0000005, not 5e-7). Throws a RangeError for a non-finite number. Spreadsheet formulas are kept unless options.escapeFormulas is true; set it when the file may be opened in a spreadsheet and the text is untrusted.

Parameters ​

table ​

readonly (readonly CsvCell[])[]

options? ​

CsvOptions = {}

Returns ​

string

Released under the MIT License.