Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/output/xlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ class xlsx extends Base {
toStdOut() {
Cli.error(`Can't output xlsx to std out`);
}

/**
* prepare the given object by converting numeric
* columns/properties as numbers instead of strings
* on top of what the parent method already does
*
* suboptimally done here to avoid impacts on other outputs
*
* @param obj
* @param columns
* @returns {Array}
*/
prepare(obj = {}, columns = []) {
let formattedObj = super.prepare(obj, columns);
return formattedObj.map(field => isNaN(field) ? field : Number(field));
}
}

module.exports = xlsx;