supports-color 9.3.0 → 9.3.1
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/index.d.ts +1 -1
- package/index.js +7 -3
- package/package.json +2 -2
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import os from 'node:os';
|
|
|
3
3
|
import tty from 'node:tty';
|
|
4
4
|
|
|
5
5
|
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
|
|
6
|
-
function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
|
|
6
|
+
/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
|
|
7
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
|
7
8
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
8
9
|
const position = argv.indexOf(prefix + flag);
|
|
9
10
|
const terminatorPosition = argv.indexOf('--');
|
|
@@ -138,10 +139,13 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
|
138
139
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
139
140
|
|
|
140
141
|
switch (env.TERM_PROGRAM) {
|
|
141
|
-
case 'iTerm.app':
|
|
142
|
+
case 'iTerm.app': {
|
|
142
143
|
return version >= 3 ? 3 : 2;
|
|
143
|
-
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
case 'Apple_Terminal': {
|
|
144
147
|
return 2;
|
|
148
|
+
}
|
|
145
149
|
// No default
|
|
146
150
|
}
|
|
147
151
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supports-color",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.1",
|
|
4
4
|
"description": "Detect whether a terminal supports color",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/supports-color",
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
"import-fresh": "^3.3.0",
|
|
57
57
|
"tsd": "^0.18.0",
|
|
58
58
|
"typescript": "^4.4.3",
|
|
59
|
-
"xo": "^0.
|
|
59
|
+
"xo": "^0.49.0"
|
|
60
60
|
}
|
|
61
61
|
}
|