chlklib 1.0.0 → 1.0.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/dist/index.cjs +199 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +7 -0
- package/dist/utilities.cjs +52 -0
- package/dist/utilities.cjs.map +7 -0
- package/dist/utilities.js +33 -0
- package/dist/utilities.js.map +7 -0
- package/dist/vendor/ansi-styles/index.cjs +211 -0
- package/dist/vendor/ansi-styles/index.cjs.map +7 -0
- package/dist/vendor/ansi-styles/index.js +192 -0
- package/dist/vendor/ansi-styles/index.js.map +7 -0
- package/dist/vendor/supports-color/browser.cjs +49 -0
- package/dist/vendor/supports-color/browser.cjs.map +7 -0
- package/dist/vendor/supports-color/browser.js +30 -0
- package/dist/vendor/supports-color/browser.js.map +7 -0
- package/dist/vendor/supports-color/index.cjs +164 -0
- package/dist/vendor/supports-color/index.cjs.map +7 -0
- package/dist/vendor/supports-color/index.js +135 -0
- package/dist/vendor/supports-color/index.js.map +7 -0
- package/package.json +11 -11
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var supports_color_exports = {};
|
|
29
|
+
__export(supports_color_exports, {
|
|
30
|
+
createSupportsColor: () => createSupportsColor,
|
|
31
|
+
default: () => supports_color_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(supports_color_exports);
|
|
34
|
+
var import_node_process = __toESM(require("node:process"), 1);
|
|
35
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
36
|
+
var import_node_tty = __toESM(require("node:tty"), 1);
|
|
37
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
38
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
39
|
+
const position = argv.indexOf(prefix + flag);
|
|
40
|
+
const terminatorPosition = argv.indexOf("--");
|
|
41
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
42
|
+
}
|
|
43
|
+
const { env } = import_node_process.default;
|
|
44
|
+
let flagForceColor;
|
|
45
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
46
|
+
flagForceColor = 0;
|
|
47
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
48
|
+
flagForceColor = 1;
|
|
49
|
+
}
|
|
50
|
+
function envForceColor() {
|
|
51
|
+
if ("FORCE_COLOR" in env) {
|
|
52
|
+
if (env.FORCE_COLOR === "true") {
|
|
53
|
+
return 1;
|
|
54
|
+
}
|
|
55
|
+
if (env.FORCE_COLOR === "false") {
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function translateLevel(level) {
|
|
62
|
+
if (level === 0) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
level,
|
|
67
|
+
hasBasic: true,
|
|
68
|
+
has256: level >= 2,
|
|
69
|
+
has16m: level >= 3
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
73
|
+
const noFlagForceColor = envForceColor();
|
|
74
|
+
if (noFlagForceColor !== void 0) {
|
|
75
|
+
flagForceColor = noFlagForceColor;
|
|
76
|
+
}
|
|
77
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
78
|
+
if (forceColor === 0) {
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
if (sniffFlags) {
|
|
82
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
83
|
+
return 3;
|
|
84
|
+
}
|
|
85
|
+
if (hasFlag("color=256")) {
|
|
86
|
+
return 2;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
90
|
+
return 1;
|
|
91
|
+
}
|
|
92
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
const min = forceColor || 0;
|
|
96
|
+
if (env.TERM === "dumb") {
|
|
97
|
+
return min;
|
|
98
|
+
}
|
|
99
|
+
if (import_node_process.default.platform === "win32") {
|
|
100
|
+
const osRelease = import_node_os.default.release().split(".");
|
|
101
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
102
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
103
|
+
}
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
if ("CI" in env) {
|
|
107
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
108
|
+
return 3;
|
|
109
|
+
}
|
|
110
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
111
|
+
return 1;
|
|
112
|
+
}
|
|
113
|
+
return min;
|
|
114
|
+
}
|
|
115
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
116
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
117
|
+
}
|
|
118
|
+
if (env.COLORTERM === "truecolor") {
|
|
119
|
+
return 3;
|
|
120
|
+
}
|
|
121
|
+
if (env.TERM === "xterm-kitty") {
|
|
122
|
+
return 3;
|
|
123
|
+
}
|
|
124
|
+
if (env.TERM === "xterm-ghostty") {
|
|
125
|
+
return 3;
|
|
126
|
+
}
|
|
127
|
+
if (env.TERM === "wezterm") {
|
|
128
|
+
return 3;
|
|
129
|
+
}
|
|
130
|
+
if ("TERM_PROGRAM" in env) {
|
|
131
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
132
|
+
switch (env.TERM_PROGRAM) {
|
|
133
|
+
case "iTerm.app": {
|
|
134
|
+
return version >= 3 ? 3 : 2;
|
|
135
|
+
}
|
|
136
|
+
case "Apple_Terminal": {
|
|
137
|
+
return 2;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
142
|
+
return 2;
|
|
143
|
+
}
|
|
144
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
145
|
+
return 1;
|
|
146
|
+
}
|
|
147
|
+
if ("COLORTERM" in env) {
|
|
148
|
+
return 1;
|
|
149
|
+
}
|
|
150
|
+
return min;
|
|
151
|
+
}
|
|
152
|
+
function createSupportsColor(stream, options = {}) {
|
|
153
|
+
const level = _supportsColor(stream, {
|
|
154
|
+
streamIsTTY: stream && stream.isTTY,
|
|
155
|
+
...options
|
|
156
|
+
});
|
|
157
|
+
return translateLevel(level);
|
|
158
|
+
}
|
|
159
|
+
const supportsColor = {
|
|
160
|
+
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
161
|
+
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
162
|
+
};
|
|
163
|
+
var supports_color_default = supportsColor;
|
|
164
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/vendor/supports-color/index.js"],
|
|
4
|
+
"sourcesContent": ["import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoB;AACpB,qBAAe;AACf,sBAAgB;AAIhB,SAAS,QAAQ,MAAM,OAAO,WAAW,OAAO,WAAW,KAAK,OAAO,oBAAAA,QAAQ,MAAM;AACpF,QAAM,SAAS,KAAK,WAAW,GAAG,IAAI,KAAM,KAAK,WAAW,IAAI,MAAM;AACtE,QAAM,WAAW,KAAK,QAAQ,SAAS,IAAI;AAC3C,QAAM,qBAAqB,KAAK,QAAQ,IAAI;AAC5C,SAAO,aAAa,OAAO,uBAAuB,MAAM,WAAW;AACpE;AAEA,MAAM,EAAC,IAAG,IAAI,oBAAAA;AAEd,IAAI;AACJ,IACC,QAAQ,UAAU,KACf,QAAQ,WAAW,KACnB,QAAQ,aAAa,KACrB,QAAQ,aAAa,GACvB;AACD,mBAAiB;AAClB,WACC,QAAQ,OAAO,KACZ,QAAQ,QAAQ,KAChB,QAAQ,YAAY,KACpB,QAAQ,cAAc,GACxB;AACD,mBAAiB;AAClB;AAEA,SAAS,gBAAgB;AACxB,MAAI,iBAAiB,KAAK;AACzB,QAAI,IAAI,gBAAgB,QAAQ;AAC/B,aAAO;AAAA,IACR;AAEA,QAAI,IAAI,gBAAgB,SAAS;AAChC,aAAO;AAAA,IACR;AAEA,WAAO,IAAI,YAAY,WAAW,IAAI,IAAI,KAAK,IAAI,OAAO,SAAS,IAAI,aAAa,EAAE,GAAG,CAAC;AAAA,EAC3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O,CAAC,EAAC,CAAC;AACnD;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": ["process", "os", "tty"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import tty from "node:tty";
|
|
4
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
|
5
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
6
|
+
const position = argv.indexOf(prefix + flag);
|
|
7
|
+
const terminatorPosition = argv.indexOf("--");
|
|
8
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
9
|
+
}
|
|
10
|
+
const { env } = process;
|
|
11
|
+
let flagForceColor;
|
|
12
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
13
|
+
flagForceColor = 0;
|
|
14
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
15
|
+
flagForceColor = 1;
|
|
16
|
+
}
|
|
17
|
+
function envForceColor() {
|
|
18
|
+
if ("FORCE_COLOR" in env) {
|
|
19
|
+
if (env.FORCE_COLOR === "true") {
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
if (env.FORCE_COLOR === "false") {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function translateLevel(level) {
|
|
29
|
+
if (level === 0) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
level,
|
|
34
|
+
hasBasic: true,
|
|
35
|
+
has256: level >= 2,
|
|
36
|
+
has16m: level >= 3
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
40
|
+
const noFlagForceColor = envForceColor();
|
|
41
|
+
if (noFlagForceColor !== void 0) {
|
|
42
|
+
flagForceColor = noFlagForceColor;
|
|
43
|
+
}
|
|
44
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
45
|
+
if (forceColor === 0) {
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
if (sniffFlags) {
|
|
49
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
50
|
+
return 3;
|
|
51
|
+
}
|
|
52
|
+
if (hasFlag("color=256")) {
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
const min = forceColor || 0;
|
|
63
|
+
if (env.TERM === "dumb") {
|
|
64
|
+
return min;
|
|
65
|
+
}
|
|
66
|
+
if (process.platform === "win32") {
|
|
67
|
+
const osRelease = os.release().split(".");
|
|
68
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
69
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
70
|
+
}
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
if ("CI" in env) {
|
|
74
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
75
|
+
return 3;
|
|
76
|
+
}
|
|
77
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
return min;
|
|
81
|
+
}
|
|
82
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
83
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
84
|
+
}
|
|
85
|
+
if (env.COLORTERM === "truecolor") {
|
|
86
|
+
return 3;
|
|
87
|
+
}
|
|
88
|
+
if (env.TERM === "xterm-kitty") {
|
|
89
|
+
return 3;
|
|
90
|
+
}
|
|
91
|
+
if (env.TERM === "xterm-ghostty") {
|
|
92
|
+
return 3;
|
|
93
|
+
}
|
|
94
|
+
if (env.TERM === "wezterm") {
|
|
95
|
+
return 3;
|
|
96
|
+
}
|
|
97
|
+
if ("TERM_PROGRAM" in env) {
|
|
98
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
99
|
+
switch (env.TERM_PROGRAM) {
|
|
100
|
+
case "iTerm.app": {
|
|
101
|
+
return version >= 3 ? 3 : 2;
|
|
102
|
+
}
|
|
103
|
+
case "Apple_Terminal": {
|
|
104
|
+
return 2;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
109
|
+
return 2;
|
|
110
|
+
}
|
|
111
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
112
|
+
return 1;
|
|
113
|
+
}
|
|
114
|
+
if ("COLORTERM" in env) {
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
return min;
|
|
118
|
+
}
|
|
119
|
+
function createSupportsColor(stream, options = {}) {
|
|
120
|
+
const level = _supportsColor(stream, {
|
|
121
|
+
streamIsTTY: stream && stream.isTTY,
|
|
122
|
+
...options
|
|
123
|
+
});
|
|
124
|
+
return translateLevel(level);
|
|
125
|
+
}
|
|
126
|
+
const supportsColor = {
|
|
127
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
128
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
129
|
+
};
|
|
130
|
+
var supports_color_default = supportsColor;
|
|
131
|
+
export {
|
|
132
|
+
createSupportsColor,
|
|
133
|
+
supports_color_default as default
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/vendor/supports-color/index.js"],
|
|
4
|
+
"sourcesContent": ["import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,aAAa;AACpB,OAAO,QAAQ;AACf,OAAO,SAAS;AAIhB,SAAS,QAAQ,MAAM,OAAO,WAAW,OAAO,WAAW,KAAK,OAAO,QAAQ,MAAM;AACpF,QAAM,SAAS,KAAK,WAAW,GAAG,IAAI,KAAM,KAAK,WAAW,IAAI,MAAM;AACtE,QAAM,WAAW,KAAK,QAAQ,SAAS,IAAI;AAC3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KAAK,kBAAkB;AACtB,eAAO;AAAA,MACR;AAAA,IAED;AAAA,EACD;AAEA,MAAI,iBAAiB,KAAK,IAAI,IAAI,GAAG;AACpC,WAAO;AAAA,EACR;AAEA,MAAI,8DAA8D,KAAK,IAAI,IAAI,GAAG;AACjF,WAAO;AAAA,EACR;AAEA,MAAI,eAAe,KAAK;AACvB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEO,SAAS,oBAAoB,QAAQ,UAAU,CAAC,GAAG;AACzD,QAAM,QAAQ,eAAe,QAAQ;AAAA,IACpC,aAAa,UAAU,OAAO;AAAA,IAC9B,GAAG;AAAA,EACJ,CAAC;AAED,SAAO,eAAe,KAAK;AAC5B;AAEA,MAAM,gBAAgB;AAAA,EACrB,QAAQ,oBAAoB,EAAC,OAAO,IAAI,OAAO,CAAC,EAAC,CAAC;AAAA,EAClD,QAAQ,oBAAoB,EAAC,OAAO,IAAI,OAAO,CAAC,EAAC,CAAC;AACnD;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chlklib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Your module description",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
"module": "./dist/index.js",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"imports": {
|
|
17
17
|
"#ansi-styles": {
|
|
18
|
+
"types": "./dist/vendor/ansi-styles/index.d.ts",
|
|
18
19
|
"import": "./dist/vendor/ansi-styles/index.js",
|
|
19
|
-
"require": "./dist/vendor/ansi-styles/index.cjs"
|
|
20
|
-
"types": "./dist/vendor/ansi-styles/index.d.ts"
|
|
20
|
+
"require": "./dist/vendor/ansi-styles/index.cjs"
|
|
21
21
|
},
|
|
22
22
|
"#supports-color": {
|
|
23
23
|
"node": {
|
|
24
|
+
"types": "./dist/vendor/supports-color/index.d.ts",
|
|
24
25
|
"import": "./dist/vendor/supports-color/index.js",
|
|
25
|
-
"require": "./dist/vendor/supports-color/index.cjs"
|
|
26
|
-
"types": "./dist/vendor/supports-color/index.d.ts"
|
|
26
|
+
"require": "./dist/vendor/supports-color/index.cjs"
|
|
27
27
|
},
|
|
28
28
|
"default": {
|
|
29
|
+
"types": "./dist/vendor/supports-color/browser.d.ts",
|
|
29
30
|
"import": "./dist/vendor/supports-color/browser.js",
|
|
30
|
-
"require": "./dist/vendor/supports-color/browser.cjs"
|
|
31
|
-
"types": "./dist/vendor/supports-color/browser.d.ts"
|
|
31
|
+
"require": "./dist/vendor/supports-color/browser.cjs"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
},
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist",
|
|
47
|
-
"!dist/**/*.test.*"
|
|
47
|
+
"!dist/**/*.test.*"
|
|
48
48
|
],
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^16.11.10",
|
|
51
51
|
"esbuild": "^0.28.0"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|