1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var csv_writer_1 = require("./csv-writer");
|
4 | var CsvWriterFactory = (function () {
|
5 | function CsvWriterFactory(csvStringifierFactory) {
|
6 | this.csvStringifierFactory = csvStringifierFactory;
|
7 | }
|
8 | CsvWriterFactory.prototype.createArrayCsvWriter = function (params) {
|
9 | var csvStringifier = this.csvStringifierFactory.createArrayCsvStringifier({
|
10 | header: params.header,
|
11 | fieldDelimiter: params.fieldDelimiter,
|
12 | recordDelimiter: params.recordDelimiter,
|
13 | alwaysQuote: params.alwaysQuote
|
14 | });
|
15 | return new csv_writer_1.CsvWriter(csvStringifier, params.path, params.encoding, params.append);
|
16 | };
|
17 | CsvWriterFactory.prototype.createObjectCsvWriter = function (params) {
|
18 | var csvStringifier = this.csvStringifierFactory.createObjectCsvStringifier({
|
19 | header: params.header,
|
20 | fieldDelimiter: params.fieldDelimiter,
|
21 | recordDelimiter: params.recordDelimiter,
|
22 | headerIdDelimiter: params.headerIdDelimiter,
|
23 | alwaysQuote: params.alwaysQuote
|
24 | });
|
25 | return new csv_writer_1.CsvWriter(csvStringifier, params.path, params.encoding, params.append);
|
26 | };
|
27 | return CsvWriterFactory;
|
28 | }());
|
29 | exports.CsvWriterFactory = CsvWriterFactory;
|
30 |
|
\ | No newline at end of file |