supports-color 9.1.0 → 9.2.2
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.
- package/browser.d.ts +1 -0
- package/browser.js +3 -1
- package/index.js +5 -0
- package/package.json +3 -2
package/browser.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './index.js';
|
package/browser.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-env browser */
|
|
2
2
|
|
|
3
|
-
const isBlinkBasedBrowser =
|
|
3
|
+
const isBlinkBasedBrowser = navigator.userAgentData
|
|
4
|
+
? navigator.userAgentData.brands.some(({brand}) => brand === 'Chromium')
|
|
5
|
+
: /\b(Chrome|Chromium)\//.test(navigator.userAgent);
|
|
4
6
|
|
|
5
7
|
const colorSupport = isBlinkBasedBrowser ? {
|
|
6
8
|
level: 1,
|
package/index.js
CHANGED
|
@@ -116,6 +116,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
|
116
116
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// Check for Azure DevOps pipelines
|
|
120
|
+
if ('TF_BUILD' in env && 'AGENT_NAME' in env) {
|
|
121
|
+
return 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
119
124
|
if (env.COLORTERM === 'truecolor') {
|
|
120
125
|
return 3;
|
|
121
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supports-color",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "Detect whether a terminal supports color",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/supports-color",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"index.js",
|
|
27
27
|
"index.d.ts",
|
|
28
|
-
"browser.js"
|
|
28
|
+
"browser.js",
|
|
29
|
+
"browser.d.ts"
|
|
29
30
|
],
|
|
30
31
|
"keywords": [
|
|
31
32
|
"color",
|