UNPKG

1.41 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var csv_writer_1 = require("./csv-writer");
4var CsvWriterFactory = /** @class */ (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}());
29exports.CsvWriterFactory = CsvWriterFactory;
30//# sourceMappingURL=csv-writer-factory.js.map
\No newline at end of file