From 62bf149217fb2bc96e787e0aa6790b3b27be3a30 Mon Sep 17 00:00:00 2001 From: Dominik Wilkowski Date: Mon, 23 Apr 2018 11:06:50 +1000 Subject: [PATCH] fixed terminal width detection Signed-off-by: Dominik Wilkowski --- README.md | 1 + package.json | 2 +- src/lib.js | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e39cf55..d93ceede 100644 --- a/README.md +++ b/README.md @@ -379,6 +379,7 @@ npm run test ## Release History +* 2.0.1 - Foxed terminal width detection * 2.0.0 - Added tests, split into more pure functions * 1.2.0 - Added `transparent` and `system` as default background and color option, added `backgroundColor` as alias for `background`, upgraded deps * 1.1.3 - Fixed help text, removing old -t option diff --git a/package.json b/package.json index 3af893c7..88c10529 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cfonts", "description": "Sexy fonts for the console", - "version": "2.0.0", + "version": "2.0.1", "homepage": "https://github.com/dominikwilkowski/cfonts", "author": { "name": "Dominik Wilkowski", diff --git a/src/lib.js b/src/lib.js index 72acc809..92e4fd61 100644 --- a/src/lib.js +++ b/src/lib.js @@ -312,8 +312,12 @@ const AddLetterSpacing = ( output, fontLines, fontLetterspace, fontColors, color * @type {object} */ const Size = { - width: WinSize.width || 80, - height: WinSize.height || 24, + width: WinSize + ? WinSize.width + : 80, + height: WinSize + ? WinSize.height + : 24, };