UNPKG

read-excel-file

Version:

Read `.xlsx` files in a web browser or in Node.js

29 lines (28 loc) 760 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = reconstructSheetDimensionsFromSheetCells; function reconstructSheetDimensionsFromSheetCells(cells) { var comparator = function comparator(a, b) { return a - b; }; var allRows = cells.map(function (cell) { return cell.row; }).sort(comparator); var allCols = cells.map(function (cell) { return cell.column; }).sort(comparator); var minRow = allRows[0]; var maxRow = allRows[allRows.length - 1]; var minCol = allCols[0]; var maxCol = allCols[allCols.length - 1]; return [{ row: minRow, column: minCol }, { row: maxRow, column: maxCol }]; } //# sourceMappingURL=reconstructSheetDimensionsFromSheetCells.js.map