UNPKG

922 BPlain TextView Raw
1import {
2 ArrayCsvStringifierParams,
3 CsvStringifierFactory,
4 ObjectCsvStringifierParams
5} from './lib/csv-stringifier-factory';
6import {ArrayCsvWriterParams, CsvWriterFactory, ObjectCsvWriterParams} from './lib/csv-writer-factory';
7
8const csvStringifierFactory = new CsvStringifierFactory();
9const csvWriterFactory = new CsvWriterFactory(csvStringifierFactory);
10
11export const createArrayCsvStringifier = (params: ArrayCsvStringifierParams) =>
12 csvStringifierFactory.createArrayCsvStringifier(params);
13
14export const createObjectCsvStringifier = (params: ObjectCsvStringifierParams) =>
15 csvStringifierFactory.createObjectCsvStringifier(params);
16
17export const createArrayCsvWriter = (params: ArrayCsvWriterParams) =>
18 csvWriterFactory.createArrayCsvWriter(params);
19
20export const createObjectCsvWriter = (params: ObjectCsvWriterParams) =>
21 csvWriterFactory.createObjectCsvWriter(params);