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