Codacy style changes for test files
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
||||
[
|
||||
columns.join(delimiter),
|
||||
...arr.map(obj =>
|
||||
columns.reduce(
|
||||
(acc, key) => `${acc}${!acc.length ? '' : delimiter}"${!obj[key] ? '' : obj[key]}"`,
|
||||
''
|
||||
)
|
||||
)
|
||||
].join('\n');
|
||||
[
|
||||
columns.join(delimiter),
|
||||
...arr.map(obj =>
|
||||
columns.reduce(
|
||||
(acc, key) => `${acc}${!acc.length ? '' : delimiter}"${!obj[key] ? '' : obj[key]}"`,
|
||||
''
|
||||
)
|
||||
)
|
||||
].join('\n');
|
||||
|
||||
module.exports = JSONtoCSV;
|
||||
Reference in New Issue
Block a user