MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / asCodeSearchResult

Function asCodeSearchResult

common/src/testing/mocks/child-process.ts:43–54  ·  view source on GitHub ↗
(result: unknown)

Source from the content-addressed store, hash-verified

41
42/** Typed accessor for code search result value. */
43export function asCodeSearchResult(result: unknown): CodeSearchResult {
44 if (
45 result &&
46 typeof result === 'object' &&
47 'type' in result &&
48 result.type === 'json' &&
49 'value' in result
50 ) {
51 return result.value as CodeSearchResult
52 }
53 return {}
54}
55
56/** Creates a mock spawn function that returns the provided mock process. */
57export function createMockSpawn(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected