MCPcopy Index your code
hub / github.com/codedogQBY/ReadAny / s3KeyToLogicalPath

Function s3KeyToLogicalPath

packages/core/src/sync/s3-paths.ts:33–41  ·  view source on GitHub ↗
(remoteRoot: string, key: string)

Source from the content-addressed store, hash-verified

31}
32
33export function s3KeyToLogicalPath(remoteRoot: string, key: string): string {
34 const root = sanitizeS3RemoteRoot(remoteRoot) || DEFAULT_S3_REMOTE_ROOT;
35 const normalizedKey = key.replace(/\/+$/, "");
36 if (normalizedKey === root) return "/readany";
37 if (normalizedKey.startsWith(`${root}/`)) {
38 return `/readany/${normalizedKey.slice(root.length + 1)}`;
39 }
40 return `/${normalizedKey}`;
41}

Callers 2

toLogicalPathMethod · 0.90
s3-backend.test.tsFile · 0.90

Calls 3

sanitizeS3RemoteRootFunction · 0.85
replaceMethod · 0.80
sliceMethod · 0.80

Tested by

no test coverage detected