Function
createChunk
(
id: string,
filePath: string,
content: string,
overrides?: Partial<CodeChunk>
)
Source from the content-addressed store, hash-verified
| 13 | import controlledFixture from './fixtures/eval-controlled.json'; |
| 14 | |
| 15 | function createChunk( |
| 16 | id: string, |
| 17 | filePath: string, |
| 18 | content: string, |
| 19 | overrides?: Partial<CodeChunk> |
| 20 | ): CodeChunk { |
| 21 | return { |
| 22 | id, |
| 23 | content, |
| 24 | filePath, |
| 25 | relativePath: filePath.replace(/^.*?[/\\](?:src|libs|apps)[/\\]/, ''), |
| 26 | startLine: 1, |
| 27 | endLine: 40, |
| 28 | language: 'typescript', |
| 29 | framework: 'generic', |
| 30 | componentType: 'service', |
| 31 | layer: 'core', |
| 32 | dependencies: [], |
| 33 | imports: [], |
| 34 | exports: [], |
| 35 | tags: [], |
| 36 | metadata: {}, |
| 37 | ...overrides |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | function makeSearchResult(filePath: string, score: number): SearchResult { |
| 42 | return { |
Tested by
no test coverage detected