MCPcopy Create free account
hub / github.com/agegr/pi-web / getRelativePath

Function getRelativePath

app/api/plugins/route.ts:108–113  ·  view source on GitHub ↗
(resource: ResolvedResource)

Source from the content-addressed store, hash-verified

106}
107
108function getRelativePath(resource: ResolvedResource): string {
109 const baseDir = resource.metadata.baseDir;
110 if (!baseDir) return resource.path;
111 const rel = relative(baseDir, resource.path);
112 return rel && !rel.startsWith("..") ? rel : resource.path;
113}
114
115function getConfiguredVersion(source: string): string | undefined {
116 const npmSpec = source.startsWith("npm:") ? source.slice(4) : undefined;

Callers 1

collectResourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected