stain 0.0.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/_macro_.d.cts +9 -0
- package/dist/_macro_.d.mts +9 -0
- package/dist/_macro_.d.ts +9 -0
- package/dist/_macro_.d.ts.map +1 -0
- package/dist/constants.d.cts +55 -0
- package/dist/constants.d.mts +55 -0
- package/dist/constants.d.ts +55 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/index.cjs +344 -0
- package/dist/index.cjs.map +13 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +312 -0
- package/dist/index.js.map +13 -0
- package/dist/index.min.cjs +1 -0
- package/dist/index.min.js +1 -0
- package/dist/testBin/index.d.cts +13 -0
- package/dist/testBin/index.d.mts +13 -0
- package/dist/testBin/index.d.ts +13 -0
- package/dist/testBin/index.d.ts.map +1 -0
- package/dist/testBin/tmp.d.cts +13 -0
- package/dist/testBin/tmp.d.mts +13 -0
- package/dist/testBin/tmp.d.ts +13 -0
- package/dist/testBin/tmp.d.ts.map +1 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 te <legal@fetchTe.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Stain - ANSI Styling
|
|
2
|
+
|
|
3
|
+
Stain the pane without the pain of remembering if it's `bgRed`, `redBg`, or ordering for that matter
|
|
4
|
+
|
|
5
|
+
+ [Dyslectic](https://en.wikipedia.org/wiki/Dyslexia) friendly with any-[fluent](https://en.wikipedia.org/wiki/Fluent_interface)-chain API: `stain.white.bold.cyan.bg('No More Tears')`
|
|
6
|
+
+ Supports: [4-bit](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit) (16 colors), [8-bit](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) (256 colors), **`bold`**, `dim`, <ins>`underline`</ins>, `inverse`, and [`NO_COLOR`](https://no-color.org)
|
|
7
|
+
+ Nest-able: `stain.red.bold('bold' + stain.normal.blue(' normal ') + 'bold')`
|
|
8
|
+
+ Fast-ish: ~180,000,000/sec (`NO_COLOR`), ~6,500,000/sec (`simpleEscape`), ~5,000,000/sec (default)
|
|
9
|
+
+ [TypeScript](https://www.typescriptlang.org)'ed with zero dependencies
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_macro_.d.ts","sourceRoot":"","sources":["../src/_macro_.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO;;;;;;;CAOT,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const ESC = "\u001B";
|
|
2
|
+
export declare const RESET = "\u001B[0m";
|
|
3
|
+
export declare const COLOR_DEF: {
|
|
4
|
+
black: number;
|
|
5
|
+
iblack: number;
|
|
6
|
+
red: number;
|
|
7
|
+
ired: number;
|
|
8
|
+
green: number;
|
|
9
|
+
igreen: number;
|
|
10
|
+
yellow: number;
|
|
11
|
+
iyellow: number;
|
|
12
|
+
blue: number;
|
|
13
|
+
iblue: number;
|
|
14
|
+
purple: number;
|
|
15
|
+
ipurple: number;
|
|
16
|
+
cyan: number;
|
|
17
|
+
icyan: number;
|
|
18
|
+
white: number;
|
|
19
|
+
iwhite: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const XTERM_DEF: {
|
|
22
|
+
[k: string]: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const COLOR_ALL: {
|
|
25
|
+
black: number;
|
|
26
|
+
iblack: number;
|
|
27
|
+
red: number;
|
|
28
|
+
ired: number;
|
|
29
|
+
green: number;
|
|
30
|
+
igreen: number;
|
|
31
|
+
yellow: number;
|
|
32
|
+
iyellow: number;
|
|
33
|
+
blue: number;
|
|
34
|
+
iblue: number;
|
|
35
|
+
purple: number;
|
|
36
|
+
ipurple: number;
|
|
37
|
+
cyan: number;
|
|
38
|
+
icyan: number;
|
|
39
|
+
white: number;
|
|
40
|
+
iwhite: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* color support level
|
|
44
|
+
* @default 3
|
|
45
|
+
* @see {@link https://nodejs.org/api/cli.html#force_color1-2-3|Node.js FORCE_COLOR docs}
|
|
46
|
+
*/
|
|
47
|
+
type ColorSpace = 0 | 1;
|
|
48
|
+
/**
|
|
49
|
+
* COLOR_SPACE - covers all reasonable and most un-reasonable cases
|
|
50
|
+
* @implements nodejs.org/api/cli.html#force_color1-2-3
|
|
51
|
+
* 0=no-color, 1=16, 2=256, 3=true-color
|
|
52
|
+
*/
|
|
53
|
+
export declare const COLOR_SPACE: ColorSpace;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const ESC = "\u001B";
|
|
2
|
+
export declare const RESET = "\u001B[0m";
|
|
3
|
+
export declare const COLOR_DEF: {
|
|
4
|
+
black: number;
|
|
5
|
+
iblack: number;
|
|
6
|
+
red: number;
|
|
7
|
+
ired: number;
|
|
8
|
+
green: number;
|
|
9
|
+
igreen: number;
|
|
10
|
+
yellow: number;
|
|
11
|
+
iyellow: number;
|
|
12
|
+
blue: number;
|
|
13
|
+
iblue: number;
|
|
14
|
+
purple: number;
|
|
15
|
+
ipurple: number;
|
|
16
|
+
cyan: number;
|
|
17
|
+
icyan: number;
|
|
18
|
+
white: number;
|
|
19
|
+
iwhite: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const XTERM_DEF: {
|
|
22
|
+
[k: string]: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const COLOR_ALL: {
|
|
25
|
+
black: number;
|
|
26
|
+
iblack: number;
|
|
27
|
+
red: number;
|
|
28
|
+
ired: number;
|
|
29
|
+
green: number;
|
|
30
|
+
igreen: number;
|
|
31
|
+
yellow: number;
|
|
32
|
+
iyellow: number;
|
|
33
|
+
blue: number;
|
|
34
|
+
iblue: number;
|
|
35
|
+
purple: number;
|
|
36
|
+
ipurple: number;
|
|
37
|
+
cyan: number;
|
|
38
|
+
icyan: number;
|
|
39
|
+
white: number;
|
|
40
|
+
iwhite: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* color support level
|
|
44
|
+
* @default 3
|
|
45
|
+
* @see {@link https://nodejs.org/api/cli.html#force_color1-2-3|Node.js FORCE_COLOR docs}
|
|
46
|
+
*/
|
|
47
|
+
type ColorSpace = 0 | 1;
|
|
48
|
+
/**
|
|
49
|
+
* COLOR_SPACE - covers all reasonable and most un-reasonable cases
|
|
50
|
+
* @implements nodejs.org/api/cli.html#force_color1-2-3
|
|
51
|
+
* 0=no-color, 1=16, 2=256, 3=true-color
|
|
52
|
+
*/
|
|
53
|
+
export declare const COLOR_SPACE: ColorSpace;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const ESC = "\u001B";
|
|
2
|
+
export declare const RESET = "\u001B[0m";
|
|
3
|
+
export declare const COLOR_DEF: {
|
|
4
|
+
black: number;
|
|
5
|
+
iblack: number;
|
|
6
|
+
red: number;
|
|
7
|
+
ired: number;
|
|
8
|
+
green: number;
|
|
9
|
+
igreen: number;
|
|
10
|
+
yellow: number;
|
|
11
|
+
iyellow: number;
|
|
12
|
+
blue: number;
|
|
13
|
+
iblue: number;
|
|
14
|
+
purple: number;
|
|
15
|
+
ipurple: number;
|
|
16
|
+
cyan: number;
|
|
17
|
+
icyan: number;
|
|
18
|
+
white: number;
|
|
19
|
+
iwhite: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const XTERM_DEF: {
|
|
22
|
+
[k: string]: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const COLOR_ALL: {
|
|
25
|
+
black: number;
|
|
26
|
+
iblack: number;
|
|
27
|
+
red: number;
|
|
28
|
+
ired: number;
|
|
29
|
+
green: number;
|
|
30
|
+
igreen: number;
|
|
31
|
+
yellow: number;
|
|
32
|
+
iyellow: number;
|
|
33
|
+
blue: number;
|
|
34
|
+
iblue: number;
|
|
35
|
+
purple: number;
|
|
36
|
+
ipurple: number;
|
|
37
|
+
cyan: number;
|
|
38
|
+
icyan: number;
|
|
39
|
+
white: number;
|
|
40
|
+
iwhite: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* color support level
|
|
44
|
+
* @default 3
|
|
45
|
+
* @see {@link https://nodejs.org/api/cli.html#force_color1-2-3|Node.js FORCE_COLOR docs}
|
|
46
|
+
*/
|
|
47
|
+
type ColorSpace = 0 | 1;
|
|
48
|
+
/**
|
|
49
|
+
* COLOR_SPACE - covers all reasonable and most un-reasonable cases
|
|
50
|
+
* @implements nodejs.org/api/cli.html#force_color1-2-3
|
|
51
|
+
* 0=no-color, 1=16, 2=256, 3=true-color
|
|
52
|
+
*/
|
|
53
|
+
export declare const COLOR_SPACE: ColorSpace;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,GAAG,WAAW,CAAC;AAC5B,eAAO,MAAM,KAAK,cAAY,CAAC;AAE/B,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBrB,CAAC;AACF,eAAO,MAAM,SAAS;;CAErB,CAAC;AACF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAA+B,CAAC;AAGtD;;;;GAIG;AACH,KAAK,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,UAgCtB,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
6
|
+
var __toCommonJS = (from) => {
|
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
|
8
|
+
if (entry)
|
|
9
|
+
return entry;
|
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
}));
|
|
16
|
+
__moduleCache.set(from, entry);
|
|
17
|
+
return entry;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var exports_src = {};
|
|
31
|
+
__export(exports_src, {
|
|
32
|
+
stain: () => stain,
|
|
33
|
+
default: () => src_default2,
|
|
34
|
+
createStain: () => createStain
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(exports_src);
|
|
37
|
+
|
|
38
|
+
// node_modules/cli-reap/dist/index.js
|
|
39
|
+
var GLOBAL_THIS = /* @__PURE__ */ (() => typeof globalThis === "object" ? globalThis : (() => {
|
|
40
|
+
(function(Object2) {
|
|
41
|
+
function get() {
|
|
42
|
+
const e = this || self;
|
|
43
|
+
e.globalThis = e, delete Object2.prototype._T_;
|
|
44
|
+
}
|
|
45
|
+
typeof globalThis != "object" && (this ? get() : (Object2.defineProperty(Object2.prototype, "_T_", { configurable: true, get }), _T_));
|
|
46
|
+
})(Object);
|
|
47
|
+
return typeof globalThis === "object" ? globalThis : {};
|
|
48
|
+
})())();
|
|
49
|
+
var ARGV = /* @__PURE__ */ (() => {
|
|
50
|
+
var _a, _b, _c, _d;
|
|
51
|
+
return typeof process === "undefined" ? typeof scriptArgs !== "undefined" ? scriptArgs : [] : (_d = (GLOBAL_THIS == null ? undefined : GLOBAL_THIS["Deno"]) ? (_c = (_a = GLOBAL_THIS == null ? undefined : GLOBAL_THIS["Deno"]) == null ? undefined : _a.args) != null ? _c : ((_b = process["args"]) == null ? undefined : _b.length) ? process["args"] : process["argv"] : process["argv"]) != null ? _d : [];
|
|
52
|
+
})();
|
|
53
|
+
var ENV = /* @__PURE__ */ (() => {
|
|
54
|
+
var _a, _b, _c, _d;
|
|
55
|
+
return typeof process === "undefined" ? typeof ((_a = GLOBAL_THIS == null ? undefined : GLOBAL_THIS["std"]) == null ? undefined : _a.getenviron) === "function" ? (_d = (_c = (_b = GLOBAL_THIS["std"]).getenviron) == null ? undefined : _c.call(_b)) != null ? _d : {} : {} : !(GLOBAL_THIS == null ? undefined : GLOBAL_THIS["Deno"]) ? process["env"] : (() => {
|
|
56
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
57
|
+
try {
|
|
58
|
+
return (_f = (_c2 = (_b2 = (_a2 = GLOBAL_THIS == null ? undefined : GLOBAL_THIS["Deno"]) == null ? undefined : _a2.env) == null ? undefined : _b2.toObject) == null ? undefined : _c2.call(_b2)) != null ? _f : ((_d2 = process["env"]) == null ? undefined : _d2.toObject) ? (_e = process["env"]) == null ? undefined : _e.toObject() : process["env"];
|
|
59
|
+
} catch (_err) {}
|
|
60
|
+
return {};
|
|
61
|
+
})();
|
|
62
|
+
})();
|
|
63
|
+
var quoteNorm = (val) => /^['"]/.test(val) ? val?.replace(/^(['"])(.*)(['"])$/, (m, q1, body, q2) => q1 === q2 ? quoteNorm(body) : m) : val;
|
|
64
|
+
var isFlag = (val) => /^-+\w/.test(val ?? "") && Number.isNaN(Number(val));
|
|
65
|
+
var isTerm = (val) => val?.trim() === "--";
|
|
66
|
+
var toArgvArray = (key, strict = false, _keys = Array.isArray(key) ? key : [key]) => strict ? _keys : _keys.map((item) => [
|
|
67
|
+
item,
|
|
68
|
+
item.replaceAll(...item.includes("_") ? ["_", "-"] : ["-", "_"])
|
|
69
|
+
]).flat();
|
|
70
|
+
var cliReap = (argv = ARGV, env = ENV, gthis = GLOBAL_THIS, strict = false) => {
|
|
71
|
+
const slice = argv[0] === "node" ? 2 : argv[1] === "run" ? 3 : isFlag(argv[0]) ? 0 : 1;
|
|
72
|
+
const cur = argv.map(String).slice(slice);
|
|
73
|
+
const cmd = argv.map(String).slice(0, slice);
|
|
74
|
+
const end = !!cur.find(isTerm);
|
|
75
|
+
const getArgv = (keys, optValue = false) => {
|
|
76
|
+
const keyList = toArgvArray(keys, strict);
|
|
77
|
+
for (let i = 0;i < cur.length; i++) {
|
|
78
|
+
const token = cur[i];
|
|
79
|
+
if (isTerm(token)) {
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
if (!token || !isFlag(token)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const hasEq = /=/.test(token);
|
|
86
|
+
const part = keyList.map((key) => {
|
|
87
|
+
const [k, ...parts] = token.replace(isFlag(key) ? /(?!)/ : /^\s*?-+/, "").split(hasEq && optValue ? `${key}=` : new RegExp(`^${key}$`, strict ? "" : "i"));
|
|
88
|
+
return !k?.length ? parts.join(key) : k === key ? key : null;
|
|
89
|
+
}).find((v) => v !== null) ?? 0;
|
|
90
|
+
if (part === 0) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!optValue) {
|
|
94
|
+
cur.splice(i, 1);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (hasEq) {
|
|
98
|
+
cur.splice(i, 1);
|
|
99
|
+
return quoteNorm(part);
|
|
100
|
+
}
|
|
101
|
+
const next = cur[i + 1];
|
|
102
|
+
if (next !== undefined && !isTerm(next) && !isFlag(next)) {
|
|
103
|
+
cur.splice(i, 2);
|
|
104
|
+
return quoteNorm(next);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
};
|
|
109
|
+
const getEnv = (keys) => toArgvArray(keys, strict).map((key) => (key in env) ? env[key] : (key in gthis) ? gthis[key] : null).filter(Boolean)[0] ?? null;
|
|
110
|
+
const getFlag = (keys) => getArgv(keys, false) !== null ? true : null;
|
|
111
|
+
const getOpt = (keys) => getArgv(keys, true);
|
|
112
|
+
const getAny = (keys, defaultValue) => getOpt(keys) ?? getFlag(keys) ?? getEnv(keys) ?? (defaultValue !== undefined ? defaultValue : null);
|
|
113
|
+
const getPos = () => {
|
|
114
|
+
const result = [];
|
|
115
|
+
for (let i = 0;i < cur.length; i++) {
|
|
116
|
+
const token = cur[i];
|
|
117
|
+
if (!token) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (isTerm(token)) {
|
|
121
|
+
return [...result, ...cur.slice(i + 1)];
|
|
122
|
+
}
|
|
123
|
+
if (isFlag(token)) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
result.push(token);
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
any: getAny,
|
|
132
|
+
cmd: () => cmd,
|
|
133
|
+
cur: () => cur,
|
|
134
|
+
end: () => end,
|
|
135
|
+
env: getEnv,
|
|
136
|
+
flag: getFlag,
|
|
137
|
+
opt: getOpt,
|
|
138
|
+
pos: getPos
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
var src_default = cliReap;
|
|
142
|
+
|
|
143
|
+
// node_modules/globables/dist/index.js
|
|
144
|
+
var GLOBAL_THIS2 = /* @__PURE__ */ (() => typeof globalThis === "object" ? globalThis : (() => {
|
|
145
|
+
(function(Object2) {
|
|
146
|
+
function get() {
|
|
147
|
+
const e = this || self;
|
|
148
|
+
e.globalThis = e, delete Object2.prototype._T_;
|
|
149
|
+
}
|
|
150
|
+
typeof globalThis != "object" && (this ? get() : (Object2.defineProperty(Object2.prototype, "_T_", { configurable: true, get }), _T_));
|
|
151
|
+
})(Object);
|
|
152
|
+
return typeof globalThis === "object" ? globalThis : {};
|
|
153
|
+
})())();
|
|
154
|
+
var ENV2 = /* @__PURE__ */ (() => {
|
|
155
|
+
var _a, _b, _c, _d;
|
|
156
|
+
return typeof process === "undefined" ? typeof ((_a = GLOBAL_THIS2 == null ? undefined : GLOBAL_THIS2["std"]) == null ? undefined : _a.getenviron) === "function" ? (_d = (_c = (_b = GLOBAL_THIS2["std"]).getenviron) == null ? undefined : _c.call(_b)) != null ? _d : {} : {} : !(GLOBAL_THIS2 == null ? undefined : GLOBAL_THIS2["Deno"]) ? process["env"] : (() => {
|
|
157
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
158
|
+
try {
|
|
159
|
+
return (_f = (_c2 = (_b2 = (_a2 = GLOBAL_THIS2 == null ? undefined : GLOBAL_THIS2["Deno"]) == null ? undefined : _a2.env) == null ? undefined : _b2.toObject) == null ? undefined : _c2.call(_b2)) != null ? _f : ((_d2 = process["env"]) == null ? undefined : _d2.toObject) ? (_e = process["env"]) == null ? undefined : _e.toObject() : process["env"];
|
|
160
|
+
} catch (_err) {}
|
|
161
|
+
return {};
|
|
162
|
+
})();
|
|
163
|
+
})();
|
|
164
|
+
|
|
165
|
+
// src/constants.ts
|
|
166
|
+
var ESC = "\x1B";
|
|
167
|
+
var RESET = "\x1B[0m";
|
|
168
|
+
var COLOR_DEF = {
|
|
169
|
+
black: 30,
|
|
170
|
+
iblack: 90,
|
|
171
|
+
red: 31,
|
|
172
|
+
ired: 91,
|
|
173
|
+
green: 32,
|
|
174
|
+
igreen: 92,
|
|
175
|
+
yellow: 33,
|
|
176
|
+
iyellow: 93,
|
|
177
|
+
blue: 34,
|
|
178
|
+
iblue: 94,
|
|
179
|
+
purple: 35,
|
|
180
|
+
ipurple: 95,
|
|
181
|
+
cyan: 36,
|
|
182
|
+
icyan: 96,
|
|
183
|
+
white: 37,
|
|
184
|
+
iwhite: 97
|
|
185
|
+
};
|
|
186
|
+
var XTERM_DEF = Object.fromEntries(Array(256).fill(0).map((_v, i) => [`x${i}`, i]));
|
|
187
|
+
var COLOR_ALL = { ...COLOR_DEF, ...XTERM_DEF };
|
|
188
|
+
var COLOR_SPACE = /* @__PURE__ */ (() => {
|
|
189
|
+
try {
|
|
190
|
+
const reap = src_default();
|
|
191
|
+
const forceColor = reap.any("FORCE_COLOR");
|
|
192
|
+
if (forceColor === "" || forceColor && !isNaN(Number(forceColor)) && Number(forceColor) > 0) {
|
|
193
|
+
return 1;
|
|
194
|
+
}
|
|
195
|
+
if (typeof process === "undefined") {
|
|
196
|
+
return 0;
|
|
197
|
+
}
|
|
198
|
+
if (reap.any("NO_COLOR") !== null || reap.any("NODE_DISABLE_COLORS") !== null || /-mono|dumb/i.test(ENV2["TERM"] ?? "")) {
|
|
199
|
+
return 0;
|
|
200
|
+
}
|
|
201
|
+
if (!(!!process.stdout?.isTTY || !!ENV2["PM2_HOME"] && !!ENV2["pm_id"] || (GLOBAL_THIS2?.["Deno"] ? GLOBAL_THIS2?.["Deno"]?.isatty(1) : !!process.stdout?.isTTY))) {
|
|
202
|
+
return 0;
|
|
203
|
+
}
|
|
204
|
+
if (/^(false|never|no|0)$/i.test(`${reap.opt("color") ?? ""}`.trim())) {
|
|
205
|
+
return 0;
|
|
206
|
+
}
|
|
207
|
+
return 1;
|
|
208
|
+
} catch (_err) {}
|
|
209
|
+
return 0;
|
|
210
|
+
})();
|
|
211
|
+
|
|
212
|
+
// src/index.ts
|
|
213
|
+
var escStain = (str, open, close, fontReplace) => {
|
|
214
|
+
str = typeof str !== "string" ? String(str) : str;
|
|
215
|
+
const openStr = ESC + `[${open}m`;
|
|
216
|
+
const closeStr = ESC + `[${close}m`;
|
|
217
|
+
const closeLen = closeStr.length;
|
|
218
|
+
const parts = [];
|
|
219
|
+
let cursor = 0;
|
|
220
|
+
let seqCount = 0;
|
|
221
|
+
let resetCount = 0;
|
|
222
|
+
while (true) {
|
|
223
|
+
const idxClose = str.indexOf(closeStr, cursor);
|
|
224
|
+
const idxReset = open === 0 ? -1 : str.indexOf(RESET, cursor);
|
|
225
|
+
let idx = -1;
|
|
226
|
+
let isReset = false;
|
|
227
|
+
if (idxClose >= 0) {
|
|
228
|
+
if (idxReset >= 0 && idxReset < idxClose) {
|
|
229
|
+
idx = idxReset;
|
|
230
|
+
isReset = true;
|
|
231
|
+
} else {
|
|
232
|
+
idx = idxClose;
|
|
233
|
+
}
|
|
234
|
+
} else if (idxReset >= 0) {
|
|
235
|
+
idx = idxReset;
|
|
236
|
+
isReset = true;
|
|
237
|
+
} else {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
parts.push(str.substring(cursor, idx));
|
|
241
|
+
if (isReset) {
|
|
242
|
+
parts.push(RESET);
|
|
243
|
+
resetCount++;
|
|
244
|
+
if (resetCount % 2 === 0) {
|
|
245
|
+
parts.push(openStr);
|
|
246
|
+
}
|
|
247
|
+
cursor = idx + RESET.length;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const segment = str.substring(cursor, idx);
|
|
251
|
+
const openInSeg = segment.split(openStr).length;
|
|
252
|
+
const closeInSeg = segment.split(closeStr).length;
|
|
253
|
+
let rep = openStr;
|
|
254
|
+
if (fontReplace !== undefined && openInSeg <= closeInSeg) {
|
|
255
|
+
seqCount++;
|
|
256
|
+
const on = ESC + `[${fontReplace}m`;
|
|
257
|
+
const off = ESC + `[${close}m`;
|
|
258
|
+
rep = seqCount % 2 === 1 ? on + off : off + on;
|
|
259
|
+
}
|
|
260
|
+
parts.push(rep);
|
|
261
|
+
cursor = idx + closeLen;
|
|
262
|
+
}
|
|
263
|
+
parts.push(str.substring(cursor));
|
|
264
|
+
return openStr + parts.join("") + closeStr;
|
|
265
|
+
};
|
|
266
|
+
var escStainSimple = (str, open, close, _fontReplace) => `${ESC}[${open}m` + (typeof str !== "string" ? String(str) : str) + `${ESC}[${close}m`;
|
|
267
|
+
function createStain(opts = {}) {
|
|
268
|
+
const {
|
|
269
|
+
colors,
|
|
270
|
+
xterm,
|
|
271
|
+
format = (...args) => args.length > 1 ? args.join(" ") : typeof args[0] !== "string" ? JSON.stringify(args[0]) : args[0],
|
|
272
|
+
noColor = COLOR_SPACE === 0,
|
|
273
|
+
simpleEscape = false
|
|
274
|
+
} = opts;
|
|
275
|
+
const colorAll = colors ? { ...xterm ? COLOR_ALL : COLOR_DEF, ...colors } : xterm ? COLOR_ALL : COLOR_DEF;
|
|
276
|
+
if (noColor) {
|
|
277
|
+
const ncFormat = opts?.format ? (...args) => format(...args) : format;
|
|
278
|
+
for (const prop of Object.keys(colorAll).concat(["bg", "bold", "dim", "normal", "reset", "underline"])) {
|
|
279
|
+
ncFormat[prop] = ncFormat;
|
|
280
|
+
}
|
|
281
|
+
return ncFormat;
|
|
282
|
+
}
|
|
283
|
+
const escFn = simpleEscape ? escStainSimple : escStain;
|
|
284
|
+
const color256 = colors ? xterm ? { ...XTERM_DEF, ...colors } : colors : xterm ? XTERM_DEF : {};
|
|
285
|
+
const colorProxy = (cur = {}) => new Proxy((text) => text, {
|
|
286
|
+
get: (_target, prop) => {
|
|
287
|
+
const nxt = { ...cur };
|
|
288
|
+
const fg = nxt.fg;
|
|
289
|
+
if (colorAll[prop] !== undefined) {
|
|
290
|
+
nxt.pr = [
|
|
291
|
+
fg?.[0] ?? colorAll[prop],
|
|
292
|
+
39,
|
|
293
|
+
fg?.[2] ?? (color256[prop] !== undefined ? 1 : 0)
|
|
294
|
+
];
|
|
295
|
+
nxt.fg = [colorAll[prop], 39, color256[prop] !== undefined ? 1 : 0];
|
|
296
|
+
} else if (prop === "bg" && fg) {
|
|
297
|
+
nxt.bg = [fg[0] + (fg[2] || fg[1] === 49 ? 0 : 10), 49, fg[2]];
|
|
298
|
+
if (nxt.pr?.[1] === 39) {
|
|
299
|
+
nxt.fg = fg[0] === nxt.pr[0] ? undefined : [...nxt.pr];
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
const fo = prop === "bold" ? 1 : prop === "dim" ? 2 : prop === "normal" ? 22 : null;
|
|
303
|
+
if (fo) {
|
|
304
|
+
nxt.ft = [fo, 22, 0];
|
|
305
|
+
} else if (prop === "underline") {
|
|
306
|
+
nxt.ue = [4, 24, 0];
|
|
307
|
+
} else if (prop === "inverse") {
|
|
308
|
+
nxt.ie = [7, 27, 0];
|
|
309
|
+
} else if (prop === "reset") {
|
|
310
|
+
nxt.re = [0, 0, 0];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return colorProxy(nxt);
|
|
314
|
+
},
|
|
315
|
+
apply: (_target, _thisArg, args) => {
|
|
316
|
+
let res = format(...args);
|
|
317
|
+
if (cur.re) {
|
|
318
|
+
return escFn(res, 0, 0);
|
|
319
|
+
}
|
|
320
|
+
if (cur.fg) {
|
|
321
|
+
res = escFn(res, (cur.fg[2] ? "38;5;" : "") + cur.fg[0], cur.fg[1]);
|
|
322
|
+
}
|
|
323
|
+
if (cur.bg) {
|
|
324
|
+
res = escFn(res, (cur.bg[2] ? "48;5;" : "") + cur.bg[0], cur.bg[1]);
|
|
325
|
+
}
|
|
326
|
+
if (cur.ft) {
|
|
327
|
+
res = escFn(res, cur.ft[0], cur.ft[1], cur.ft[0]);
|
|
328
|
+
}
|
|
329
|
+
if (cur.ue) {
|
|
330
|
+
res = escFn(res, cur.ue[0], cur.ue[1]);
|
|
331
|
+
}
|
|
332
|
+
if (cur.ie) {
|
|
333
|
+
res = escFn(res, cur.ie[0], cur.ie[1]);
|
|
334
|
+
}
|
|
335
|
+
return res;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
return colorProxy();
|
|
339
|
+
}
|
|
340
|
+
var stain = /* @__PURE__ */ (() => createStain({ xterm: true }))();
|
|
341
|
+
var src_default2 = createStain;
|
|
342
|
+
|
|
343
|
+
//# debugId=1BB7AE79D4CF5C0D64756E2164756E21
|
|
344
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/cli-reap/dist/index.js", "../node_modules/globables/dist/index.js", "../src/constants.ts", "../src/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"// node_modules/globables/dist/index.js\nvar GLOBAL_THIS = /* @__PURE__ */ (() => typeof globalThis === \"object\" ? globalThis : (() => {\n (function(Object2) {\n function get() {\n const e = this || self;\n e.globalThis = e, delete Object2.prototype._T_;\n }\n typeof globalThis != \"object\" && (this ? get() : (Object2.defineProperty(Object2.prototype, \"_T_\", { configurable: true, get }), _T_));\n })(Object);\n return typeof globalThis === \"object\" ? globalThis : {};\n})())();\nvar ARGV = /* @__PURE__ */ (() => {\n var _a, _b, _c, _d;\n return typeof process === \"undefined\" ? typeof scriptArgs !== \"undefined\" ? scriptArgs : [] : (_d = (GLOBAL_THIS == null ? undefined : GLOBAL_THIS[\"Deno\"]) ? (_c = (_a = GLOBAL_THIS == null ? undefined : GLOBAL_THIS[\"Deno\"]) == null ? undefined : _a.args) != null ? _c : ((_b = process[\"args\"]) == null ? undefined : _b.length) ? process[\"args\"] : process[\"argv\"] : process[\"argv\"]) != null ? _d : [];\n})();\nvar ENV = /* @__PURE__ */ (() => {\n var _a, _b, _c, _d;\n return typeof process === \"undefined\" ? typeof ((_a = GLOBAL_THIS == null ? undefined : GLOBAL_THIS[\"std\"]) == null ? undefined : _a.getenviron) === \"function\" ? (_d = (_c = (_b = GLOBAL_THIS[\"std\"]).getenviron) == null ? undefined : _c.call(_b)) != null ? _d : {} : {} : !(GLOBAL_THIS == null ? undefined : GLOBAL_THIS[\"Deno\"]) ? process[\"env\"] : (() => {\n var _a2, _b2, _c2, _d2, _e, _f;\n try {\n return (_f = (_c2 = (_b2 = (_a2 = GLOBAL_THIS == null ? undefined : GLOBAL_THIS[\"Deno\"]) == null ? undefined : _a2.env) == null ? undefined : _b2.toObject) == null ? undefined : _c2.call(_b2)) != null ? _f : ((_d2 = process[\"env\"]) == null ? undefined : _d2.toObject) ? (_e = process[\"env\"]) == null ? undefined : _e.toObject() : process[\"env\"];\n } catch (_err) {}\n return {};\n })();\n})();\n\n// src/index.ts\nvar hasArgv = (keys, argv = ARGV) => !argv?.length ? false : !![keys].flat().filter(Boolean).find((key) => new RegExp(`(^|[^\\\\S])(?:--|-)${key}(=|\\\\s|$)`, \"i\").test(argv.join(\" \")));\nvar quoteNorm = (val) => /^['\"]/.test(val) ? val?.replace(/^(['\"])(.*)(['\"])$/, (m, q1, body, q2) => q1 === q2 ? quoteNorm(body) : m) : val;\nvar isFlag = (val) => /^-+\\w/.test(val ?? \"\") && Number.isNaN(Number(val));\nvar isTerm = (val) => val?.trim() === \"--\";\nvar toArgvArray = (key, strict = false, _keys = Array.isArray(key) ? key : [key]) => strict ? _keys : _keys.map((item) => [\n item,\n item.replaceAll(...item.includes(\"_\") ? [\"_\", \"-\"] : [\"-\", \"_\"])\n]).flat();\nvar cliReap = (argv = ARGV, env = ENV, gthis = GLOBAL_THIS, strict = false) => {\n const slice = argv[0] === \"node\" ? 2 : argv[1] === \"run\" ? 3 : isFlag(argv[0]) ? 0 : 1;\n const cur = argv.map(String).slice(slice);\n const cmd = argv.map(String).slice(0, slice);\n const end = !!cur.find(isTerm);\n const getArgv = (keys, optValue = false) => {\n const keyList = toArgvArray(keys, strict);\n for (let i = 0;i < cur.length; i++) {\n const token = cur[i];\n if (isTerm(token)) {\n break;\n }\n if (!token || !isFlag(token)) {\n continue;\n }\n const hasEq = /=/.test(token);\n const part = keyList.map((key) => {\n const [k, ...parts] = token.replace(isFlag(key) ? /(?!)/ : /^\\s*?-+/, \"\").split(hasEq && optValue ? `${key}=` : new RegExp(`^${key}$`, strict ? \"\" : \"i\"));\n return !k?.length ? parts.join(key) : k === key ? key : null;\n }).find((v) => v !== null) ?? 0;\n if (part === 0) {\n continue;\n }\n if (!optValue) {\n cur.splice(i, 1);\n return true;\n }\n if (hasEq) {\n cur.splice(i, 1);\n return quoteNorm(part);\n }\n const next = cur[i + 1];\n if (next !== undefined && !isTerm(next) && !isFlag(next)) {\n cur.splice(i, 2);\n return quoteNorm(next);\n }\n }\n return null;\n };\n const getEnv = (keys) => toArgvArray(keys, strict).map((key) => (key in env) ? env[key] : (key in gthis) ? gthis[key] : null).filter(Boolean)[0] ?? null;\n const getFlag = (keys) => getArgv(keys, false) !== null ? true : null;\n const getOpt = (keys) => getArgv(keys, true);\n const getAny = (keys, defaultValue) => getOpt(keys) ?? getFlag(keys) ?? getEnv(keys) ?? (defaultValue !== undefined ? defaultValue : null);\n const getPos = () => {\n const result = [];\n for (let i = 0;i < cur.length; i++) {\n const token = cur[i];\n if (!token) {\n continue;\n }\n if (isTerm(token)) {\n return [...result, ...cur.slice(i + 1)];\n }\n if (isFlag(token)) {\n continue;\n }\n result.push(token);\n }\n return result;\n };\n return {\n any: getAny,\n cmd: () => cmd,\n cur: () => cur,\n end: () => end,\n env: getEnv,\n flag: getFlag,\n opt: getOpt,\n pos: getPos\n };\n};\nvar cliReapStrict = (argv = ARGV, procEnv = ENV, gthis = GLOBAL_THIS) => cliReap(argv, procEnv, gthis, true);\nvar src_default = cliReap;\nexport {\n quoteNorm,\n isFlag,\n hasArgv,\n src_default as default,\n cliReapStrict,\n cliReap,\n ENV,\n ARGV\n};\n\n//# debugId=D346F45C437553B064756E2164756E21\n//# sourceMappingURL=index.js.map\n",
|
|
6
|
+
"// src/index.ts\nvar GLOBAL_THIS = /* @__PURE__ */ (() => typeof globalThis === \"object\" ? globalThis : (() => {\n !(function(Object2) {\n function get() {\n const e = this || self;\n e.globalThis = e, delete Object2.prototype._T_;\n }\n \"object\" != typeof globalThis && (this ? get() : (Object2.defineProperty(Object2.prototype, \"_T_\", { configurable: true, get }), _T_));\n })(Object);\n return typeof globalThis === \"object\" ? globalThis : {};\n})())();\nvar ARGV = /* @__PURE__ */ (() => {\n var _a, _b, _c, _d;\n return typeof process === \"undefined\" ? typeof scriptArgs !== \"undefined\" ? scriptArgs : [] : (_d = (GLOBAL_THIS == null ? void 0 : GLOBAL_THIS[\"Deno\"]) ? (_c = (_a = GLOBAL_THIS == null ? void 0 : GLOBAL_THIS[\"Deno\"]) == null ? void 0 : _a.args) != null ? _c : ((_b = process[\"args\"]) == null ? void 0 : _b.length) ? process[\"args\"] : process[\"argv\"] : process[\"argv\"]) != null ? _d : [];\n})();\nvar ARGS = ARGV;\nvar ENV = /* @__PURE__ */ (() => {\n var _a, _b, _c, _d;\n return typeof process === \"undefined\" ? typeof ((_a = GLOBAL_THIS == null ? void 0 : GLOBAL_THIS[\"std\"]) == null ? void 0 : _a.getenviron) === \"function\" ? (_d = (_c = (_b = GLOBAL_THIS[\"std\"]).getenviron) == null ? void 0 : _c.call(_b)) != null ? _d : {} : {} : !(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS[\"Deno\"]) ? process[\"env\"] : (() => {\n var _a2, _b2, _c2, _d2, _e, _f;\n try {\n return (_f = (_c2 = (_b2 = (_a2 = GLOBAL_THIS == null ? void 0 : GLOBAL_THIS[\"Deno\"]) == null ? void 0 : _a2.env) == null ? void 0 : _b2.toObject) == null ? void 0 : _c2.call(_b2)) != null ? _f : ((_d2 = process[\"env\"]) == null ? void 0 : _d2.toObject) ? (_e = process[\"env\"]) == null ? void 0 : _e.toObject() : process[\"env\"];\n } catch (_err) {\n }\n return {};\n })();\n})();\nexport {\n ARGS,\n ARGV,\n ENV,\n GLOBAL_THIS\n};\n//# sourceMappingURL=index.js.map\n",
|
|
7
|
+
"import cliReap from 'cli-reap';\nimport {\n ENV,\n GLOBAL_THIS,\n} from 'globables';\n\nexport const ESC = '\\x1B';\nexport const RESET = '\\x1B[0m';\n\nexport const COLOR_DEF = {\n black: 30,\n iblack: 90,\n red: 31,\n ired: 91,\n green: 32,\n igreen: 92,\n yellow: 33,\n iyellow: 93,\n blue: 34,\n iblue: 94,\n purple: 35,\n ipurple: 95,\n cyan: 36,\n icyan: 96,\n white: 37,\n iwhite: 97,\n};\nexport const XTERM_DEF = Object.fromEntries(\n Array(256).fill(0).map((_v, i) => [`x${i}`, i] as [string, number]),\n);\nexport const COLOR_ALL = {...COLOR_DEF, ...XTERM_DEF};\n\n\n/**\n * color support level\n * @default 3\n * @see {@link https://nodejs.org/api/cli.html#force_color1-2-3|Node.js FORCE_COLOR docs}\n */\ntype ColorSpace = 0 | 1;\n\n\n/**\n * COLOR_SPACE - covers all reasonable and most un-reasonable cases\n * @implements nodejs.org/api/cli.html#force_color1-2-3\n * 0=no-color, 1=16, 2=256, 3=true-color\n */\nexport const COLOR_SPACE: ColorSpace = /* @__PURE__ */ (() => {\n try {\n const reap = cliReap();\n const forceColor = reap.any('FORCE_COLOR');\n // force colors\n if (forceColor === '' || (forceColor && !isNaN(Number(forceColor)) && Number(forceColor) > 0)) {\n return 1;\n }\n // no proc\n if (typeof process === 'undefined') { return 0; }\n\n // no color var\n if (reap.any('NO_COLOR') !== null\n || reap.any('NODE_DISABLE_COLORS') !== null\n || (/-mono|dumb/i).test(ENV['TERM'] ?? '')) { return 0; }\n\n // no tty\n if (!(!!process.stdout?.isTTY\n || (!!ENV['PM2_HOME'] && !!ENV['pm_id'])\n || ((GLOBAL_THIS as never)?.['Deno']\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ? (GLOBAL_THIS as any)?.['Deno']?.isatty(1)\n : !!process.stdout?.isTTY))) { return 0; }\n\n // cli\n if ((/^(false|never|no|0)$/i).test(`${reap.opt('color') ?? ''}`.trim())) {\n return 0;\n }\n return 1;\n } catch (_err) { /* ignore */ }\n // catch/error/fallthrough; plays it safe with no colors\n return 0;\n})();\n\n",
|
|
8
|
+
"import {\n COLOR_SPACE,\n ESC,\n RESET,\n COLOR_DEF,\n XTERM_DEF,\n COLOR_ALL,\n} from './constants.ts';\n\ntype EmptyObject = Record<never, never>;\ntype StrNum = string | number;\n\n// fg=foreground\n// bg=background\n// ft=font\n// ue=underline\n// ie=inverse\n// re=reset\n// pr=previous (internal state)\ntype StyleKeys = 'fg' | 'bg' | 'ft' | 'ue' | 'ie' | 're' | 'pr';\ntype AnsiCodeTuple = [on: number, off: number, isCustom?: number];\ntype StyleState = Partial<Record<StyleKeys, AnsiCodeTuple>>;\ntype StainBase = 'black' | 'blue' | 'cyan' | 'green' | 'purple' | 'red' | 'white' | 'yellow';\nexport type StainAnsi = StainBase | `i${StainBase}`;\n\n// generate xterms: x0 to x255\ntype XtermKeysFactory<N extends number, Acc extends string[] = []> =\n Acc['length'] extends N\n ? Acc[number]\n : XtermKeysFactory<N, [...Acc, `x${Acc['length']}`]>;\nexport type StainXterm = XtermKeysFactory<256>;\n\nexport type Stain<\n C extends Record<string, number> = EmptyObject,\n X extends boolean = false,\n> =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((...args: any[])=> string) &\n {\n bg: Stain<C, X>;\n bold: Stain<C, X>;\n dim: Stain<C, X>;\n normal: Stain<C, X>;\n reset: Stain<C, X>;\n underline: Stain<C, X>;\n inverse: Stain<C, X>;\n } &\n // built-in named colors\n { [K in StainAnsi]: Stain<C, X> } &\n // xterm colors if enabled\n (X extends true ? { [K in StainXterm]: Stain<C, X> } : EmptyObject) &\n // custom colors from opts.colors\n (keyof C extends never ? EmptyObject : { [K in keyof C]: Stain<C, X> });\n\nexport type StainOpts<C extends Record<string, number> = EmptyObject> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n format?: (...args: any[])=> string;\n noColor?: boolean;\n xterm?: boolean;\n colors?: C;\n simpleEscape?: boolean;\n};\n\n\n/**\n * ansi escape-er\n * @note -> without handlin/escapin nesting it simplifies to: `\\x1b[${open}m${str}\\x1b[${close}m`\n * @param {string} str\n * @param {StrNum} open\n * @param {StrNum} close\n * @param {StrNum} fontReplace\n * @return {[type]}\n */\nconst escStain = (str: string, open: StrNum, close: StrNum, fontReplace?: StrNum) => {\n str = typeof str !== 'string' ? String(str) : str; // just in case\n const openStr = ESC + `[${open}m`;\n const closeStr = ESC + `[${close}m`;\n const closeLen = closeStr.length;\n const parts: string[] = [];\n let cursor = 0;\n let seqCount = 0; // count of close sequences for alternating styles\n let resetCount = 0;\n while (true) {\n const idxClose = str.indexOf(closeStr, cursor);\n // next global reset unless it is the reset style\n const idxReset = open === 0 ? -1 : str.indexOf(RESET, cursor);\n let idx = -1;\n let isReset = false;\n // which comes first, cur close sequence or a global reset\n if (idxClose >= 0) {\n if (idxReset >= 0 && idxReset < idxClose) {\n idx = idxReset;\n isReset = true;\n } else {\n idx = idxClose;\n }\n } else if (idxReset >= 0) {\n idx = idxReset;\n isReset = true;\n } else {\n break;\n }\n parts.push(str.substring(cursor, idx));\n\n if (isReset) {\n parts.push(RESET);\n resetCount++;\n // after every second reset restore style\n // e.g: stain.red(`text ${stain.reset('reset')} text`)\n if (resetCount % 2 === 0) { parts.push(openStr); }\n cursor = idx + RESET.length;\n continue;\n }\n\n // a closing sequence; need to determine the correct replacement\n const segment = str.substring(cursor, idx);\n const openInSeg = segment.split(openStr).length;\n const closeInSeg = segment.split(closeStr).length;\n\n let rep = openStr;\n // this roundabout logic is for font styles nesting\n // e.g: stain.bold(`bold ${stain.normal('norm')} bold`)\n if (fontReplace !== undefined && openInSeg <= closeInSeg) {\n // use seqCount to treat the first closeStr as an 'opener' and the second as the 'closer'\n seqCount++;\n const on = ESC + `[${fontReplace}m`; // outer style's open code\n const off = ESC + `[${close}m`; // inner style's open/close code\n rep = (seqCount % 2 === 1) ? on + off : off + on;\n }\n\n parts.push(rep);\n cursor = idx + closeLen;\n }\n parts.push(str.substring(cursor));\n return openStr + parts.join('') + closeStr;\n};\n\n/**\n * simple escape that doesn't handle nested ansi; 1.5-4x+ faster depending on style complexity\n * nested example: stain.red.bold('Bold ' + stain.green.normal('normal') + ' Bold')\n * @param {string} str\n * @param {StrNum} open\n * @param {StrNum} close\n * @param {StrNum} _fontReplace\n * @return {[type]}\n */\nconst escStainSimple = (str: string, open: StrNum, close: StrNum, _fontReplace?: StrNum) =>\n `${ESC}[${open}m` + (typeof str !== 'string' ? String(str) : str) + `${ESC}[${close}m`;\n\n\n/**\n * a nice node typed color api, that isn't \"slow\" at\n * @perf ~6million iter/s - NO_COLOR=~186million iter/s\n */\nfunction createStain<C extends Record<string, number> = EmptyObject>(\n opts?: StainOpts<C> & { xterm?: false }\n): Stain<C, false>;\nfunction createStain<C extends Record<string, number> = EmptyObject>(\n opts: StainOpts<C> & { xterm: true }\n): Stain<C, true>;\nfunction createStain<C extends Record<string, number> = EmptyObject>(\n opts: StainOpts<C> = {},\n): Stain<C, boolean> {\n const {\n colors,\n xterm,\n format = (...args) => args.length > 1\n ? args.join(' ')\n : typeof args[0] !== 'string' ? JSON.stringify(args[0]) : args[0],\n noColor = COLOR_SPACE === 0,\n simpleEscape = false,\n } = opts;\n\n const colorAll: Record<string, number> = colors\n ? {...(xterm ? COLOR_ALL : COLOR_DEF), ...colors}\n : (xterm ? COLOR_ALL : COLOR_DEF);\n\n // provies the same api, but doesn't add color, and much, much, much, faster\n if (noColor) {\n // wrapped to avoid poluting the proto on passed in format\n const ncFormat = opts?.format ? (...args: unknown[]) => format(...args) : format;\n for (const prop of Object.keys(colorAll)\n .concat(['bg', 'bold', 'dim', 'normal', 'reset', 'underline'])) {\n // @ts-expect-error not typable\n ncFormat[prop] = ncFormat;\n }\n return ncFormat as Stain<C, boolean>;\n }\n const escFn = simpleEscape ? escStainSimple : escStain;\n // xterm look-up map to determin if xterm\n // @see {@link https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit}\n const color256: Record<string, number> = colors\n ? (xterm ? {...XTERM_DEF, ...colors} : colors)\n : (xterm ? XTERM_DEF : {});\n\n // our main stain\n const colorProxy = (cur: StyleState = {}) =>\n new Proxy((text: string) => text, {\n get: (_target, prop: string) => {\n const nxt = {...cur};\n const fg = nxt.fg;\n if (colorAll[prop] !== undefined) { // xterm logic\n // keeps track of previous for bg logic\n nxt.pr = [\n fg?.[0] ?? colorAll[prop],\n 39,\n fg?.[2] ?? (color256[prop] !== undefined ? 1 : 0),\n ];\n nxt.fg = [colorAll[prop], 39, color256[prop] !== undefined ? 1 : 0];\n } else if (prop === 'bg' && fg) { // bg/fg logic\n nxt.bg = [fg[0] + (fg[2] || fg[1] === 49 ? 0 : 10), 49, fg[2]] as AnsiCodeTuple;\n // @ts-expect-error to make this type easier we ignore undefined\n if (nxt.pr?.[1] === 39) { nxt.fg = fg[0] === nxt.pr[0] ? undefined : [...nxt.pr]; }\n } else { // font style logic\n const fo = prop === 'bold' ? 1 : prop === 'dim' ? 2 : prop === 'normal' ? 22 : null;\n if (fo) {\n nxt.ft = [fo, 22, 0];\n } else if (prop === 'underline') {\n nxt.ue = [4, 24, 0];\n } else if (prop === 'inverse') {\n nxt.ie = [7, 27, 0];\n } else if (prop === 'reset') {\n nxt.re = [0, 0, 0];\n }\n }\n return colorProxy(nxt);\n },\n apply: (_target, _thisArg, args: string[]) => {\n let res = format(...args);\n // a loop here will dec perf by 6x\n if (cur.re) { return escFn(res, 0, 0); }\n if (cur.fg) { res = escFn(res, (cur.fg[2] ? '38;5;' : '') + cur.fg[0], cur.fg[1]); }\n if (cur.bg) { res = escFn(res, (cur.bg[2] ? '48;5;' : '') + cur.bg[0], cur.bg[1]); }\n if (cur.ft) { res = escFn(res, cur.ft[0], cur.ft[1], cur.ft[0]); }\n if (cur.ue) { res = escFn(res, cur.ue[0], cur.ue[1]); }\n if (cur.ie) { res = escFn(res, cur.ie[0], cur.ie[1]); }\n return res;\n },\n });\n return colorProxy() as Stain<C, boolean>;\n}\n\nconst stain = /* @__PURE__ */ (() => createStain({ xterm: true }))();\n\nexport default createStain;\nexport {\n stain,\n createStain,\n};\n"
|
|
9
|
+
],
|
|
10
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,+BAA+B,MAAM,OAAO,eAAe,WAAW,cAAc,MAAM;AAAA,GAC3F,QAAQ,CAAC,SAAS;AAAA,IACjB,SAAS,GAAG,GAAG;AAAA,MACb,MAAM,IAAI,QAAQ;AAAA,MAClB,EAAE,aAAa,GAAG,OAAO,QAAQ,UAAU;AAAA;AAAA,IAE7C,OAAO,cAAc,aAAa,OAAO,IAAI,KAAK,QAAQ,eAAe,QAAQ,WAAW,OAAO,EAAE,cAAc,MAAM,IAAI,CAAC,GAAG;AAAA,KAChI,MAAM;AAAA,EACT,OAAO,OAAO,eAAe,WAAW,aAAa,CAAC;AAAA,GACrD,GAAG;AACN,IAAI,wBAAwB,MAAM;AAAA,EAChC,IA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