@jsenv/test 3.5.32 → 3.5.33

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_test.js +22 -10
  2. package/package.json +4 -4
@@ -578,17 +578,29 @@ if (
578
578
  }
579
579
 
580
580
  function envForceColor() {
581
- if ('FORCE_COLOR' in env) {
582
- if (env.FORCE_COLOR === 'true') {
583
- return 1;
584
- }
581
+ if (!('FORCE_COLOR' in env)) {
582
+ return;
583
+ }
585
584
 
586
- if (env.FORCE_COLOR === 'false') {
587
- return 0;
588
- }
585
+ if (env.FORCE_COLOR === 'true') {
586
+ return 1;
587
+ }
588
+
589
+ if (env.FORCE_COLOR === 'false') {
590
+ return 0;
591
+ }
589
592
 
590
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
593
+ if (env.FORCE_COLOR.length === 0) {
594
+ return 1;
591
595
  }
596
+
597
+ const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
598
+
599
+ if (![0, 1, 2, 3].includes(level)) {
600
+ return;
601
+ }
602
+
603
+ return level;
592
604
  }
593
605
 
594
606
  function translateLevel(level) {
@@ -659,11 +671,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
659
671
  }
660
672
 
661
673
  if ('CI' in env) {
662
- if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
674
+ if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
663
675
  return 3;
664
676
  }
665
677
 
666
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
678
+ if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
667
679
  return 1;
668
680
  }
669
681
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.5.32",
3
+ "version": "3.5.33",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,8 +43,8 @@
43
43
  "@jsenv/github-check-run": "0.2.5",
44
44
  "@jsenv/node-esm-resolution": "1.0.6",
45
45
  "@jsenv/humanize": "1.2.8",
46
- "@jsenv/plugin-supervisor": "1.6.0",
47
- "@jsenv/sourcemap": "1.2.28",
46
+ "@jsenv/plugin-supervisor": "1.6.1",
47
+ "@jsenv/sourcemap": "1.2.29",
48
48
  "@jsenv/url-meta": "8.5.2",
49
49
  "@jsenv/urls": "2.5.4",
50
50
  "@jsenv/utils": "2.1.2",
@@ -55,7 +55,7 @@
55
55
  "istanbul-reports": "3.1.7",
56
56
  "pidtree": "0.6.0",
57
57
  "strip-ansi": "7.1.0",
58
- "supports-color": "9.4.0",
58
+ "supports-color": "10.0.0",
59
59
  "v8-to-istanbul": "9.3.0"
60
60
  }
61
61
  }