.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / calculateCellHeight.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/dist/calculateCellHeight.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/dist/calculateCellHeight.js
new file mode 100644 (file)
index 0000000..7cfddab
--- /dev/null
@@ -0,0 +1,38 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = void 0;
+
+var _isString = _interopRequireDefault(require("is-string"));
+
+var _wrapCell = _interopRequireDefault(require("./wrapCell"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * @param {string} value
+ * @param {number} columnWidth
+ * @param {boolean} useWrapWord
+ * @returns {number}
+ */
+const calculateCellHeight = (value, columnWidth, useWrapWord = false) => {
+  if (!(0, _isString.default)(value)) {
+    throw new TypeError('Value must be a string.');
+  }
+
+  if (!Number.isInteger(columnWidth)) {
+    throw new TypeError('Column width must be an integer.');
+  }
+
+  if (columnWidth < 1) {
+    throw new Error('Column width must be greater than 0.');
+  }
+
+  return (0, _wrapCell.default)(value, columnWidth, useWrapWord).length;
+};
+
+var _default = calculateCellHeight;
+exports.default = _default;
+//# sourceMappingURL=calculateCellHeight.js.map
\ No newline at end of file