Skip to content

Commit 2fdac5b

Browse files
committed
Fix csv formatter
1 parent ba4eff0 commit 2fdac5b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app_config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class AppConfig {
3737

3838
get formats() {
3939
const formats = [];
40-
if (this.#options.csv) {
41-
formats.push("csv");
42-
}
4340
if (this.#options.json) {
4441
formats.push("json");
4542
}
43+
if (this.#options.csv) {
44+
formats.push("csv");
45+
}
4646
return formats;
4747
}
4848

src/process_results/result_formatter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const _formatCSV = (result) => {
3737
};
3838

3939
function _mapCSVHeaders(dataArray) {
40-
return dataArray.forEach((dataItem, index) => {
40+
dataArray.forEach((dataItem, index) => {
4141
const newDataItem = {};
4242
Object.keys(dataItem).forEach((key) => {
4343
if (_keyMappings[key]) {
@@ -49,6 +49,7 @@ function _mapCSVHeaders(dataArray) {
4949

5050
dataArray[index] = newDataItem;
5151
});
52+
return dataArray;
5253
}
5354

5455
const _keyMappings = {

0 commit comments

Comments
 (0)