Skip to content

Commit 616f665

Browse files
committed
Initial work
1 parent 559e6eb commit 616f665

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/converter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ var defaultOptions = {
1414
WRAP : ''
1515
},
1616
EOL : '\n',
17-
PARSE_CSV_NUMBERS : false
17+
PARSE_CSV_NUMBERS : false,
18+
KEYS : null
1819
};
1920

2021
/**

lib/json-2-csv.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var options = {}; // Initialize the options - this will be populated when the js
88
// Retrieve the headings for all documents and return it. This checks that all documents have the same schema.
99
var generateHeading = function(data) {
1010
return new Promise(function (resolve, reject) {
11+
if (options.KEYS) { resolve(options.KEYS); }
1112
var keys = _.map(_.keys(data), function (key, indx) { // for each key
1213
if (_.isObject(data[key])) {
1314
// if the data at the key is a document, then we retrieve the subHeading starting with an empty string heading and the doc

0 commit comments

Comments
 (0)