MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / t

Class t

daily/ydyp.js:29–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 }
28})();
29class t {
30 static #e = new Map([]);
31 static #t = [];
32 static #r = new Map([]);
33 static clear = () => {};
34 static count = (e = "default") => {
35 switch (t.#e.has(e)) {
36 case !0:
37 t.#e.set(e, t.#e.get(e) + 1);
38 break;
39 case !1:
40 t.#e.set(e, 0)
41 }
42 t.log(`${e}: ${t.#e.get(e)}`)
43 };
44 static countReset = (e = "default") => {
45 switch (t.#e.has(e)) {
46 case !0:
47 t.#e.set(e, 0), t.log(`${e}: ${t.#e.get(e)}`);
48 break;
49 case !1:
50 t.warn(`Counter "${e}" doesn’t exist`)
51 }
52 };
53 static debug = (...e) => {
54 t.#o < 4 || (e = e.map(e => `🅱️ ${e}`), t.log(...e))
55 };
56 static error(...r) {
57 if (!(t.#o < 1)) {
58 switch (e) {
59 case "Surge":
60 case "Loon":
61 case "Stash":
62 case "Egern":
63 case "Shadowrocket":
64 case "Quantumult X":
65 default:
66 r = r.map(e => `❌ ${e}`);
67 break;
68 case "Node.js":
69 r = r.map(e => `❌ ${e.stack}`)
70 }
71 t.log(...r)
72 }
73 }
74 static exception = (...e) => t.error(...e);
75 static group = e => t.#t.unshift(e);
76 static groupEnd = () => t.#t.shift();
77 static info(...e) {
78 t.#o < 3 || (e = e.map(e => `ℹ️ ${e}`), t.log(...e))
79 }
80 static #o = 3;
81 static get logLevel() {
82 switch (t.#o) {
83 case 0:
84 return "OFF";
85 case 1:
86 return "ERROR";

Callers 1

rMethod · 0.85

Calls 6

warnMethod · 0.80
forEachMethod · 0.80
setMethod · 0.45
getMethod · 0.45
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected