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

Function mergeDiffs

out/cli.cjs:85398–85411  ·  view source on GitHub ↗
(arr, maxStringLength)

Source from the content-addressed store, hash-verified

85396 INIT_MAIN_PROMPT2(translation3.localLanguage, fullGitMojiSpec, context),
85397 INIT_DIFF_PROMPT,
85398 INIT_CONSISTENCY_PROMPT(translation3)
85399 ];
85400 }
85401};
85402
85403// src/utils/mergeDiffs.ts
85404function mergeDiffs(arr, maxStringLength) {
85405 const mergedArr = [];
85406 let currentItem = arr[0];
85407 for (const item of arr.slice(1)) {
85408 if (tokenCount(currentItem + item) <= maxStringLength) {
85409 currentItem += item;
85410 } else {
85411 mergedArr.push(currentItem);
85412 currentItem = item;
85413 }
85414 }

Calls 3

tokenCountFunction · 0.70
sliceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…