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

Function K

out/cli.cjs:64625–64644  ·  view source on GitHub ↗
(t2)

Source from the content-addressed store, hash-verified

64623var R = /[\s.:=]/;
64624var B = (t2) => {
64625 const n2 = `Flag name ${h(t2)}`;
64626 if (t2.length === 0) throw new Error(`${n2} cannot be empty`);
64627 if (t2.length === 1) throw new Error(`${n2} must be longer than a character`);
64628 const r3 = t2.match(R);
64629 if (r3) throw new Error(`${n2} cannot contain ${h(r3?.[0])}`);
64630};
64631var K = (t2) => {
64632 const n2 = {}, r3 = (e3, o3) => {
64633 if (w(n2, e3)) throw new Error(`Duplicate flags named ${h(e3)}`);
64634 n2[e3] = o3;
64635 };
64636 for (const e3 in t2) {
64637 if (!w(t2, e3)) continue;
64638 B(e3);
64639 const o3 = t2[e3], s2 = [[], ...b(o3), o3];
64640 r3(e3, s2);
64641 const i3 = v(e3);
64642 if (e3 !== i3 && r3(i3, s2), "alias" in o3 && typeof o3.alias == "string") {
64643 const { alias: a4 } = o3, l3 = `Flag alias ${h(a4)} for flag ${h(e3)}`;
64644 if (a4.length === 0) throw new Error(`${l3} cannot be empty`);
64645 if (a4.length > 1) throw new Error(`${l3} must be a single character`);
64646 r3(a4, s2);
64647 }

Callers 1

UFunction · 0.85

Calls 5

wFunction · 0.85
BFunction · 0.85
bFunction · 0.85
r3Function · 0.85
vFunction · 0.85

Tested by

no test coverage detected