MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / dD

Function dD

out/cli.cjs:64953–64994  ·  view source on GitHub ↗
(D5, F5, u3 = {})

Source from the content-addressed store, hash-verified

64951 }
64952 !e3 && D5[D5.length - 1].length > 0 && D5.length > 1 && (D5[D5.length - 2] += D5.pop());
64953};
64954var cD = (D5) => {
64955 let F5 = D5.split(" "), u3 = F5.length;
64956 for (; u3 > 0 && !(g(F5[u3 - 1]) > 0); ) u3--;
64957 return u3 === F5.length ? D5 : F5.slice(0, u3).join(" ") + F5.slice(u3).join("");
64958};
64959var dD = (D5, F5, u3 = {}) => {
64960 if (u3.trim !== false && D5.trim() === "") return "";
64961 let C5 = "", t2, E4, e3 = hD(D5), r3 = [""];
64962 for (let [o3, B3] of D5.split(" ").entries()) {
64963 u3.trim !== false && (r3[r3.length - 1] = r3[r3.length - 1].trimStart());
64964 let a4 = g(r3[r3.length - 1]);
64965 if (o3 !== 0 && (a4 >= F5 && (u3.wordWrap === false || u3.trim === false) && (r3.push(""), a4 = 0), (a4 > 0 || u3.trim === false) && (r3[r3.length - 1] += " ", a4++)), u3.hard && e3[o3] > F5) {
64966 let s2 = F5 - a4, l3 = 1 + Math.floor((e3[o3] - s2 - 1) / F5);
64967 Math.floor((e3[o3] - 1) / F5) < l3 && r3.push(""), S(r3, B3, F5);
64968 continue;
64969 }
64970 if (a4 + e3[o3] > F5 && a4 > 0 && e3[o3] > 0) {
64971 if (u3.wordWrap === false && a4 < F5) {
64972 S(r3, B3, F5);
64973 continue;
64974 }
64975 r3.push("");
64976 }
64977 if (a4 + e3[o3] > F5 && u3.wordWrap === false) {
64978 S(r3, B3, F5);
64979 continue;
64980 }
64981 r3[r3.length - 1] += B3;
64982 }
64983 u3.trim !== false && (r3 = r3.map((o3) => cD(o3)));
64984 let n2 = [...r3.join(`
64985`)];
64986 for (let [o3, B3] of n2.entries()) {
64987 if (C5 += B3, x.has(B3)) {
64988 let { groups: s2 } = new RegExp(`(?:\\${q}(?<code>\\d+)m|\\${M}(?<uri>.*)${R2})`).exec(n2.slice(o3).join("")) || { groups: {} };
64989 if (s2.code !== void 0) {
64990 let l3 = Number.parseFloat(s2.code);
64991 t2 = l3 === gD ? void 0 : l3;
64992 } else s2.uri !== void 0 && (E4 = s2.uri.length === 0 ? void 0 : s2.uri);
64993 }
64994 let a4 = K2.codes.get(Number(t2));
64995 n2[o3 + 1] === `
64996` ? (E4 && (C5 += Q("")), t2 && a4 && (C5 += J(a4))) : B3 === `
64997` && (t2 && a4 && (C5 += J(t2)), E4 && (C5 += Q(E4)));

Callers 1

T2Function · 0.85

Calls 12

hDFunction · 0.85
gFunction · 0.85
SFunction · 0.85
cDFunction · 0.85
QFunction · 0.85
JFunction · 0.85
trimMethod · 0.80
entriesMethod · 0.45
pushMethod · 0.45
hasMethod · 0.45
sliceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected