massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / src / calculateCellWidths.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/dist/src/calculateCellWidths.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/dist/src/calculateCellWidths.js
new file mode 100644 (file)
index 0000000..b4b011a
--- /dev/null
@@ -0,0 +1,17 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.calculateCellWidths = void 0;
+const string_width_1 = __importDefault(require("string-width"));
+/**
+ * Calculates width of each cell contents in a row.
+ */
+const calculateCellWidths = (cells) => {
+    return cells.map((cell) => {
+        return Math.max(...cell.split('\n').map(string_width_1.default));
+    });
+};
+exports.calculateCellWidths = calculateCellWidths;
+//# sourceMappingURL=calculateCellWidths.js.map
\ No newline at end of file