MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / mkChunk

Function mkChunk

src/context/ast-chunk.ts:94–98  ·  view source on GitHub ↗
(rel: string, lines: string[], start: number, end: number, symbol?: string)

Source from the content-addressed store, hash-verified

92}
93
94function mkChunk(rel: string, lines: string[], start: number, end: number, symbol?: string): Chunk {
95 const text = lines.slice(start, end).join('\n');
96 const hash = createHash('sha1').update(text).digest('hex').slice(0, 12);
97 return { file: rel, startLine: start + 1, endLine: end, text, hash, symbol } as Chunk;
98}
99
100/** Line-based fallback — identical semantics to the original chunkFile. */
101export function lineChunk(rel: string, content: string, chunkLines = 40, overlap = 8): Chunk[] {

Callers 2

lineChunkFunction · 0.85
astChunkFileFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected