Skip to content

Commit ab17523

Browse files
committed
1 parent c3810bc commit ab17523

File tree

5 files changed

+48
-27
lines changed

5 files changed

+48
-27
lines changed

node_modules/supports-color/browser.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
/* eslint-env browser */
2+
/* eslint-disable n/no-unsupported-features/node-builtins */
23

34
const level = (() => {
4-
if (navigator.userAgentData) {
5+
if (!('navigator' in globalThis)) {
6+
return 0;
7+
}
8+
9+
if (globalThis.navigator.userAgentData) {
510
const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');
611
if (brand?.version > 93) {
712
return 3;
813
}
914
}
1015

11-
if (/\b(Chrome|Chromium)\//.test(navigator.userAgent)) {
16+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) {
1217
return 1;
1318
}
1419

node_modules/supports-color/index.js

+22-10
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,29 @@ if (
3131
}
3232

3333
function envForceColor() {
34-
if ('FORCE_COLOR' in env) {
35-
if (env.FORCE_COLOR === 'true') {
36-
return 1;
37-
}
34+
if (!('FORCE_COLOR' in env)) {
35+
return;
36+
}
3837

39-
if (env.FORCE_COLOR === 'false') {
40-
return 0;
41-
}
38+
if (env.FORCE_COLOR === 'true') {
39+
return 1;
40+
}
41+
42+
if (env.FORCE_COLOR === 'false') {
43+
return 0;
44+
}
4245

43-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
46+
if (env.FORCE_COLOR.length === 0) {
47+
return 1;
4448
}
49+
50+
const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
51+
52+
if (![0, 1, 2, 3].includes(level)) {
53+
return;
54+
}
55+
56+
return level;
4557
}
4658

4759
function translateLevel(level) {
@@ -112,11 +124,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
112124
}
113125

114126
if ('CI' in env) {
115-
if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
127+
if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
116128
return 3;
117129
}
118130

119-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
131+
if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
120132
return 1;
121133
}
122134

node_modules/supports-color/package.json

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supports-color",
3-
"version": "9.4.0",
3+
"version": "10.0.0",
44
"description": "Detect whether a terminal supports color",
55
"license": "MIT",
66
"repository": "chalk/supports-color",
@@ -12,15 +12,16 @@
1212
},
1313
"type": "module",
1414
"exports": {
15+
"types": "./index.d.ts",
1516
"node": "./index.js",
1617
"default": "./browser.js"
1718
},
19+
"sideEffects": false,
1820
"engines": {
19-
"node": ">=12"
21+
"node": ">=18"
2022
},
2123
"scripts": {
22-
"//test": "xo && ava && tsd",
23-
"test": "tsd"
24+
"test": "xo && ava && tsd"
2425
},
2526
"files": [
2627
"index.js",
@@ -51,10 +52,13 @@
5152
"16m"
5253
],
5354
"devDependencies": {
54-
"@types/node": "^20.3.2",
55-
"ava": "^5.3.1",
56-
"import-fresh": "^3.3.0",
57-
"tsd": "^0.18.0",
58-
"xo": "^0.54.2"
55+
"@types/node": "^22.10.2",
56+
"ava": "^6.2.0",
57+
"tsd": "^0.31.2",
58+
"xo": "^0.60.0"
59+
},
60+
"ava": {
61+
"serial": true,
62+
"workerThreads": false
5963
}
6064
}

package-lock.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"semver": "^7.7.1",
144144
"spdx-expression-parse": "^4.0.0",
145145
"ssri": "^12.0.0",
146-
"supports-color": "^9.4.0",
146+
"supports-color": "^10.0.0",
147147
"tar": "^6.2.1",
148148
"text-table": "~0.2.0",
149149
"tiny-relative-date": "^1.3.0",
@@ -15129,13 +15129,13 @@
1512915129
}
1513015130
},
1513115131
"node_modules/supports-color": {
15132-
"version": "9.4.0",
15133-
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz",
15134-
"integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==",
15132+
"version": "10.0.0",
15133+
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.0.0.tgz",
15134+
"integrity": "sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==",
1513515135
"inBundle": true,
1513615136
"license": "MIT",
1513715137
"engines": {
15138-
"node": ">=12"
15138+
"node": ">=18"
1513915139
},
1514015140
"funding": {
1514115141
"url": "https://github.com/chalk/supports-color?sponsor=1"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"semver": "^7.7.1",
111111
"spdx-expression-parse": "^4.0.0",
112112
"ssri": "^12.0.0",
113-
"supports-color": "^9.4.0",
113+
"supports-color": "^10.0.0",
114114
"tar": "^6.2.1",
115115
"text-table": "~0.2.0",
116116
"tiny-relative-date": "^1.3.0",

0 commit comments

Comments
 (0)