Skip to content

Commit

Permalink
Chore: (test) fixes eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Aug 6, 2019
1 parent 61b6d74 commit 7962528
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Format.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { format } from 'winston';

export default function CSVFormatter(fields, options={}){
export default function CSVFormatter(fields, options = {}) {
const delim = options.delimiter || ';';


return format.printf(logObject => {
const data = fields.map(key => {
const value = logObject[key];

return value === undefined ? '' : value;
});

return data.join(delim);
});
}
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import CSVFormatter from './Format';

export default CSVFormatter;

0 comments on commit 7962528

Please sign in to comment.