Skip to content

Commit

Permalink
refactor: use Object.values and String.prototype.trimEnd instead of l…
Browse files Browse the repository at this point in the history
…odash functions (#127)

* Use Object.values instead of lodash's _.values

* Use String.prototype.trimEnd instead of lodash's _.trimEnd
  • Loading branch information
realityking committed Nov 19, 2020
1 parent 62599d5 commit 9109426
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/createStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const create = (row, columnWidthIndex, config) => {
output += body;
output += drawBorderBottom(columnWidthIndex, config.border);

output = _.trimEnd(output);
output = output.trimEnd();

process.stdout.write(output);
};
Expand Down Expand Up @@ -84,7 +84,7 @@ const append = (row, columnWidthIndex, config) => {
output += body;
output += bottom;

output = _.trimEnd(output);
output = output.trimEnd();

process.stdout.write(output);
};
Expand All @@ -96,8 +96,7 @@ const append = (row, columnWidthIndex, config) => {
export default (userConfig = {}) => {
const config = makeStreamConfig(userConfig);

// @todo Use 'Object.values' when Node.js v6 support is dropped.
const columnWidthIndex = _.values(_.mapValues(config.columns, (column) => {
const columnWidthIndex = Object.values(_.mapValues(config.columns, (column) => {
return column.width + column.paddingLeft + column.paddingRight;
}));

Expand Down

0 comments on commit 9109426

Please sign in to comment.