MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / tryResolveFileReference

Function tryResolveFileReference

packages/web/src/features/chat/utils.ts:434–439  ·  view source on GitHub ↗
(reference: FileReference, sources: FileSource[])

Source from the content-addressed store, hash-verified

432 * Given a file reference and a list of file sources, attempts to resolve the file source that the reference points to.
433 */
434export const tryResolveFileReference = (reference: FileReference, sources: FileSource[]): FileSource | undefined => {
435 return sources.find(
436 (source) => source.repo.endsWith(reference.repo) &&
437 source.path.endsWith(reference.path)
438 );
439};

Calls

no outgoing calls

Tested by

no test coverage detected