boxen
Advanced tools
Comparing version 5.1.0 to 5.1.1
@@ -156,3 +156,3 @@ import {LiteralUnion} from 'type-fest'; | ||
``` | ||
console.log(boxen('foo bar foo bar', {title: 'example', textAlignmentTitle: 'center'})); | ||
console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'center'})); | ||
// ┌─── example ───┐ | ||
@@ -162,3 +162,3 @@ // │foo bar foo bar│ | ||
console.log(boxen('foo bar foo bar', {title: 'example', textAlignmentTitle: 'right'})); | ||
console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'right'})); | ||
// ┌────── example ┐ | ||
@@ -165,0 +165,0 @@ // │foo bar foo bar│ |
@@ -230,9 +230,8 @@ 'use strict'; | ||
title = ` ${title} `; | ||
// Make the box larger to fit a larger title | ||
if (stringWidth(title) > contentWidth) { | ||
contentWidth = stringWidth(title); | ||
} | ||
} | ||
// Make the box larger to fit a larger title | ||
if (stringWidth(title) > contentWidth) { | ||
contentWidth = stringWidth(title); | ||
} | ||
if ((margin.left && margin.right) && contentWidth + BORDERS_WIDTH + margin.left + margin.right > columns) { | ||
@@ -239,0 +238,0 @@ // Let's assume we have margins: left = 3, right = 5, in total = 8 |
{ | ||
"name": "boxen", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "Create boxes in the terminal", | ||
@@ -40,3 +40,3 @@ "license": "MIT", | ||
"cli-boxes": "^2.2.1", | ||
"string-width": "^4.2.0", | ||
"string-width": "^4.2.2", | ||
"type-fest": "^0.20.2", | ||
@@ -43,0 +43,0 @@ "widest-line": "^3.1.0", |
18401
Updatedstring-width@^4.2.2