(rel: string, lines: string[], start: number, end: number, symbol?: string)
| 92 | } |
| 93 | |
| 94 | function 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. */ |
| 101 | export function lineChunk(rel: string, content: string, chunkLines = 40, overlap = 8): Chunk[] { |
no test coverage detected