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

Function normalizeResourceUri

src/resources/uri.ts:6–13  ·  view source on GitHub ↗
(uri: string)

Source from the content-addressed store, hash-verified

4const FULL_PROJECT_CONTEXT_RESOURCE_PREFIX = `${FULL_CONTEXT_RESOURCE_URI}/project/`;
5
6export function normalizeResourceUri(uri: string): string {
7 if (!uri) return uri;
8 const resourceIndex = uri.indexOf(CONTEXT_RESOURCE_URI);
9 if (resourceIndex >= 0) {
10 return uri.slice(resourceIndex);
11 }
12 return uri;
13}
14
15export function isContextResourceUri(uri: string): boolean {
16 return normalizeResourceUri(uri) === CONTEXT_RESOURCE_URI;

Calls

no outgoing calls

Tested by

no test coverage detected