Skip to content

Commit 27ef0c3

Browse files
committed
fix: polyfill object.values
1 parent ec3f883 commit 27ef0c3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dependencies": {
88
"ajv": "^6.5.3",
99
"lodash": "^4.17.10",
10+
"object.values": "^1.0.4",
1011
"slice-ansi": "1.0.0",
1112
"string-width": "^2.1.1"
1213
},

src/createStream.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';
1212
import alignTableData from './alignTableData';
1313
import padTableData from './padTableData';
1414
import calculateRowHeightIndex from './calculateRowHeightIndex';
15+
import values from 'object.values';
1516

1617
/**
1718
* @param {Array} data
@@ -93,7 +94,8 @@ const append = (row, columnWidthIndex, config) => {
9394
export default (userConfig = {}) => {
9495
const config = makeStreamConfig(userConfig);
9596

96-
const columnWidthIndex = Object.values(_.mapValues(config.columns, (column) => {
97+
// @todo Drop 'object.values' dependency when Node.js v6 support is dropped.
98+
const columnWidthIndex = values(_.mapValues(config.columns, (column) => {
9799
return column.width + column.paddingLeft + column.paddingRight;
98100
}));
99101

0 commit comments

Comments
 (0)