MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / createChunk

Function createChunk

tests/eval-harness.test.ts:15–39  ·  view source on GitHub ↗
(
  id: string,
  filePath: string,
  content: string,
  overrides?: Partial<CodeChunk>
)

Source from the content-addressed store, hash-verified

13import controlledFixture from './fixtures/eval-controlled.json';
14
15function 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
41function makeSearchResult(filePath: string, score: number): SearchResult {
42 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected