Update supports-color to 9.4.0
Produced via `cp ../supports-color/{index,browser}.{js,d.ts} source/vendor/supports-color`
This commit is contained in:
parent
a370f468a4
commit
bf8a5b290f
3 changed files with 7 additions and 6 deletions
2
source/vendor/supports-color/browser.js
vendored
2
source/vendor/supports-color/browser.js
vendored
|
|
@ -3,7 +3,7 @@
|
||||||
const level = (() => {
|
const level = (() => {
|
||||||
if (navigator.userAgentData) {
|
if (navigator.userAgentData) {
|
||||||
const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');
|
const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');
|
||||||
if (brand && brand.version > 93) {
|
if (brand?.version > 93) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
source/vendor/supports-color/index.d.ts
vendored
8
source/vendor/supports-color/index.d.ts
vendored
|
|
@ -1,13 +1,13 @@
|
||||||
import type {WriteStream} from 'node:tty';
|
import type {WriteStream} from 'node:tty';
|
||||||
|
|
||||||
export type Options = {
|
export interface Options {
|
||||||
/**
|
/**
|
||||||
Whether `process.argv` should be sniffed for `--color` and `--no-color` flags.
|
Whether `process.argv` should be sniffed for `--color` and `--no-color` flags.
|
||||||
|
|
||||||
@default true
|
@default true
|
||||||
*/
|
*/
|
||||||
readonly sniffFlags?: boolean;
|
readonly sniffFlags?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Levels:
|
Levels:
|
||||||
|
|
@ -21,7 +21,7 @@ export type ColorSupportLevel = 0 | 1 | 2 | 3;
|
||||||
/**
|
/**
|
||||||
Detect whether the terminal supports color.
|
Detect whether the terminal supports color.
|
||||||
*/
|
*/
|
||||||
export type ColorSupport = {
|
export interface ColorSupport {
|
||||||
/**
|
/**
|
||||||
The color level.
|
The color level.
|
||||||
*/
|
*/
|
||||||
|
|
@ -41,7 +41,7 @@ export type ColorSupport = {
|
||||||
Whether Truecolor 16 million colors are supported.
|
Whether Truecolor 16 million colors are supported.
|
||||||
*/
|
*/
|
||||||
has16m: boolean;
|
has16m: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
export type ColorInfo = ColorSupport | false;
|
export type ColorInfo = ColorSupport | false;
|
||||||
|
|
||||||
|
|
|
||||||
3
source/vendor/supports-color/index.js
vendored
3
source/vendor/supports-color/index.js
vendored
|
|
@ -3,6 +3,7 @@ import os from 'node:os';
|
||||||
import tty from 'node:tty';
|
import tty from 'node:tty';
|
||||||
|
|
||||||
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
|
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
|
||||||
|
/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
|
||||||
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
||||||
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
||||||
const position = argv.indexOf(prefix + flag);
|
const position = argv.indexOf(prefix + flag);
|
||||||
|
|
@ -111,7 +112,7 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('CI' in env) {
|
if ('CI' in env) {
|
||||||
if ('GITHUB_ACTIONS' in env) {
|
if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue