Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

calculateColumnWidths.js 624B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const calculateCellWidths_1 = require("./calculateCellWidths");
  4. /**
  5. * Produces an array of values that describe the largest value length (width) in every column.
  6. */
  7. exports.default = (rows) => {
  8. const columnWidths = new Array(rows[0].length).fill(0);
  9. rows.forEach((row) => {
  10. const cellWidths = calculateCellWidths_1.calculateCellWidths(row);
  11. cellWidths.forEach((cellWidth, cellIndex) => {
  12. columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], cellWidth);
  13. });
  14. });
  15. return columnWidths;
  16. };