@jsenv/core 39.0.2 → 39.0.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.
Files changed (2) hide show
  1. package/dist/jsenv_core.js +24 -8
  2. package/package.json +11 -11
@@ -811,19 +811,35 @@ const createAnsi = ({ supported }) => {
811
811
  MAGENTA: "\x1b[35m",
812
812
  CYAN: "\x1b[36m",
813
813
  GREY: "\x1b[90m",
814
- color: (text, ANSI_COLOR) => {
815
- return ANSI.supported && ANSI_COLOR
816
- ? `${ANSI_COLOR}${text}${RESET}`
817
- : text;
814
+ color: (text, color) => {
815
+ if (!ANSI.supported) {
816
+ return text;
817
+ }
818
+ if (!color) {
819
+ return text;
820
+ }
821
+ if (text.trim() === "") {
822
+ // cannot set color of blank chars
823
+ return text;
824
+ }
825
+ return `${color}${text}${RESET}`;
818
826
  },
819
827
 
820
828
  BOLD: "\x1b[1m",
821
829
  UNDERLINE: "\x1b[4m",
822
830
  STRIKE: "\x1b[9m",
823
- effect: (text, ANSI_EFFECT) => {
824
- return ANSI.supported && ANSI_EFFECT
825
- ? `${ANSI_EFFECT}${text}${RESET}`
826
- : text;
831
+ effect: (text, effect) => {
832
+ if (!ANSI.supported) {
833
+ return text;
834
+ }
835
+ if (!effect) {
836
+ return text;
837
+ }
838
+ // cannot add effect to empty string
839
+ if (text === "") {
840
+ return text;
841
+ }
842
+ return `${effect}${text}${RESET}`;
827
843
  },
828
844
  };
829
845
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "39.0.2",
3
+ "version": "39.0.3",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -66,22 +66,22 @@
66
66
  "dependencies": {
67
67
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
68
68
  "@jsenv/abort": "4.3.0",
69
- "@jsenv/ast": "6.1.2",
70
- "@jsenv/filesystem": "4.7.3",
71
- "@jsenv/humanize": "1.2.0",
69
+ "@jsenv/ast": "6.1.3",
70
+ "@jsenv/filesystem": "4.7.4",
71
+ "@jsenv/humanize": "1.2.1",
72
72
  "@jsenv/importmap": "1.2.1",
73
73
  "@jsenv/integrity": "0.0.2",
74
- "@jsenv/js-module-fallback": "1.3.19",
74
+ "@jsenv/js-module-fallback": "1.3.20",
75
75
  "@jsenv/node-esm-resolution": "1.0.2",
76
- "@jsenv/plugin-bundling": "2.6.13",
76
+ "@jsenv/plugin-bundling": "2.6.14",
77
77
  "@jsenv/plugin-minification": "1.5.4",
78
- "@jsenv/plugin-supervisor": "1.4.14",
79
- "@jsenv/plugin-transpilation": "1.4.2",
78
+ "@jsenv/plugin-supervisor": "1.4.15",
79
+ "@jsenv/plugin-transpilation": "1.4.3",
80
80
  "@jsenv/runtime-compat": "1.3.0",
81
- "@jsenv/server": "15.2.10",
82
- "@jsenv/sourcemap": "1.2.11",
81
+ "@jsenv/server": "15.2.11",
82
+ "@jsenv/sourcemap": "1.2.12",
83
83
  "@jsenv/url-meta": "8.4.2",
84
- "@jsenv/urls": "2.2.8",
84
+ "@jsenv/urls": "2.2.9",
85
85
  "@jsenv/utils": "2.1.1"
86
86
  },
87
87
  "devDependencies": {