@jsenv/humanize 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ const createAnsi = ({
29
29
  if (!color) {
30
30
  return text;
31
31
  }
32
- if (text.trim() === "") {
32
+ if (typeof text === "string" && text.trim() === "") {
33
33
  // cannot set color of blank chars
34
34
  return text;
35
35
  }
@@ -220,7 +220,7 @@ const createAnsi = ({ supported }) => {
220
220
  if (!color) {
221
221
  return text;
222
222
  }
223
- if (text.trim() === "") {
223
+ if (typeof text === "string" && text.trim() === "") {
224
224
  // cannot set color of blank chars
225
225
  return text;
226
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/humanize",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Generate messages meant to read by humans",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,7 +20,7 @@ export const createAnsi = ({ supported }) => {
20
20
  if (!color) {
21
21
  return text;
22
22
  }
23
- if (text.trim() === "") {
23
+ if (typeof text === "string" && text.trim() === "") {
24
24
  // cannot set color of blank chars
25
25
  return text;
26
26
  }