MCPcopy
hub / github.com/adaltas/node-csv / constructor

Method constructor

packages/csv-stringify/lib/index.js:15–33  ·  view source on GitHub ↗
(opts = {})

Source from the content-addressed store, hash-verified

13
14class Stringifier extends Transform {
15 constructor(opts = {}) {
16 super({ ...{ writableObjectMode: true }, ...opts });
17 const [err, options] = normalize_options(opts);
18 if (err !== undefined) throw err;
19 // Expose options
20 this.options = options;
21 // Internal state
22 this.state = {
23 stop: false,
24 };
25 // Information
26 this.info = {
27 records: 0,
28 };
29 this.api = stringifier(this.options, this.state, this.info);
30 this.api.options.on_record = (...args) => {
31 this.emit("record", ...args);
32 };
33 }
34 _transform(chunk, encoding, callback) {
35 if (this.state.stop === true) {
36 return;

Callers

nothing calls this directly

Calls 2

normalize_optionsFunction · 0.90
stringifierFunction · 0.90

Tested by

no test coverage detected