minimal adjustments
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / alignString.js
index 5d986444c9d72ac556e400220cfaba2e7e24c9ce..44dd3c33a14df20e1bf39078573b7ac205cb08e0 100644 (file)
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
 });
 exports.default = void 0;
 
-var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
+var _isNumberObject = _interopRequireDefault(require("is-number-object"));
 
-var _isString2 = _interopRequireDefault(require("lodash/isString"));
+var _isString = _interopRequireDefault(require("is-string"));
 
 var _stringWidth = _interopRequireDefault(require("string-width"));
 
@@ -44,7 +44,7 @@ const alignCenter = (subject, width) => {
   let halfWidth;
   halfWidth = width / 2;
 
-  if (halfWidth % 2 === 0) {
+  if (width % 2 === 0) {
     return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);
   } else {
     halfWidth = Math.floor(halfWidth);
@@ -63,11 +63,11 @@ const alignCenter = (subject, width) => {
 
 
 const alignString = (subject, containerWidth, alignment) => {
-  if (!(0, _isString2.default)(subject)) {
+  if (!(0, _isString.default)(subject)) {
     throw new TypeError('Subject parameter value must be a string.');
   }
 
-  if (!(0, _isNumber2.default)(containerWidth)) {
+  if (!(0, _isNumberObject.default)(containerWidth)) {
     throw new TypeError('Container width parameter value must be a number.');
   }
 
@@ -78,7 +78,7 @@ const alignString = (subject, containerWidth, alignment) => {
     throw new Error('Subject parameter value width cannot be greater than the container width.');
   }
 
-  if (!(0, _isString2.default)(alignment)) {
+  if (!(0, _isString.default)(alignment)) {
     throw new TypeError('Alignment parameter value must be a string.');
   }