MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / constructor

Method constructor

static/js/bulk.js:15–27  ·  view source on GitHub ↗

* Creates a new instance of the object array to csv converter. * @param {object[]} objectArray

(objectArray)

Source from the content-addressed store, hash-verified

13 * @param {object[]} objectArray
14 */
15 constructor(objectArray) {
16 if (!Array.isArray(objectArray)) {
17 throw new Error('The input to objects-to-csv must be an array of objects.');
18 }
19
20 if (objectArray.length > 0) {
21 if (objectArray.some(row => typeof row !== 'object')) {
22 throw new Error('The array must contain objects, not other data types.');
23 }
24 }
25
26 this.data = objectArray;
27 }
28
29 /**
30 * Saves the CSV file to the specified file.

Callers 5

jquery.jsFile · 0.45
jquery.min.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected