Skip to content

Commit

Permalink
fix: polyfill object.values
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 4, 2018
1 parent ec3f883 commit 27ef0c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"ajv": "^6.5.3",
"lodash": "^4.17.10",
"object.values": "^1.0.4",
"slice-ansi": "1.0.0",
"string-width": "^2.1.1"
},
Expand Down
4 changes: 3 additions & 1 deletion src/createStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';
import alignTableData from './alignTableData';
import padTableData from './padTableData';
import calculateRowHeightIndex from './calculateRowHeightIndex';
import values from 'object.values';

/**
* @param {Array} data
Expand Down Expand Up @@ -93,7 +94,8 @@ const append = (row, columnWidthIndex, config) => {
export default (userConfig = {}) => {
const config = makeStreamConfig(userConfig);

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

Expand Down

0 comments on commit 27ef0c3

Please sign in to comment.