From 91094260f664883248c00b97b4f3d8cb262c6f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Thu, 19 Nov 2020 22:16:21 +0100 Subject: [PATCH] refactor: use Object.values and String.prototype.trimEnd instead of lodash functions (#127) * Use Object.values instead of lodash's _.values * Use String.prototype.trimEnd instead of lodash's _.trimEnd --- src/createStream.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/createStream.js b/src/createStream.js index 070ff89..fee2d5c 100644 --- a/src/createStream.js +++ b/src/createStream.js @@ -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); }; @@ -84,7 +84,7 @@ const append = (row, columnWidthIndex, config) => { output += body; output += bottom; - output = _.trimEnd(output); + output = output.trimEnd(); process.stdout.write(output); }; @@ -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; }));