diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow')
-rw-r--r-- | tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow index 89f1869b5d..6562bdfd1b 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow @@ -1,6 +1,5 @@ import _ from 'lodash'; -import wrapString from './wrapString'; -import wrapWord from './wrapWord'; +import wrapCell from './wrapCell'; /** * @param {Array} unmappedRows @@ -21,16 +20,10 @@ export default (unmappedRows, rowHeightIndex, config) => { // [{cell index within a virtual row; index1}] cells.forEach((value, index1) => { - let chunkedValue; + const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord); - if (config.columns[index1].wrapWord) { - chunkedValue = wrapWord(value, config.columns[index1].width); - } else { - chunkedValue = wrapString(value, config.columns[index1].width); - } - - chunkedValue.forEach((part, index2) => { - rowHeight[index2][index1] = part; + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; }); }); |