MCPcopy
hub / github.com/di-sukharev/opencommit / tD2

Function tD2

out/cli.cjs:198–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196 return e3;
197}
198function tD2() {
199 const t2 = /* @__PURE__ */ new Map();
200 for (const [u3, F5] of Object.entries(r)) {
201 for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]);
202 Object.defineProperty(r, u3, { value: F5, enumerable: false });
203 }
204 return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
205 const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
206 if (!F5) return [0, 0, 0];
207 let [e3] = F5;
208 e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join(""));
209 const s2 = Number.parseInt(e3, 16);
210 return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
211 }, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
212 if (u3 < 8) return 30 + u3;
213 if (u3 < 16) return 90 + (u3 - 8);
214 let F5, e3, s2;
215 if (u3 >= 232) F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5;
216 else {
217 u3 -= 16;
218 const i3 = u3 % 36;
219 F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5;
220 }
221 const C5 = Math.max(F5, e3, s2) * 2;
222 if (C5 === 0) return 30;
223 let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5));
224 return C5 === 2 && (D5 += 60), D5;
225 }, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
226}
227function R4(t2, u3, F5) {
228 return String(t2).normalize().replace(/\r\n/g, `
229`).split(`

Calls 4

entriesMethod · 0.45
setMethod · 0.45
toStringMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected