MCPcopy
hub / github.com/codedogQBY/ReadAny / sanitizeS3RemoteRoot

Function sanitizeS3RemoteRoot

packages/core/src/sync/s3-paths.ts:12–18  ·  view source on GitHub ↗
(remoteRoot: string)

Source from the content-addressed store, hash-verified

10}
11
12export function sanitizeS3RemoteRoot(remoteRoot: string): string {
13 return stripControlChars(remoteRoot)
14 .trim()
15 .replace(/^\/+|\/+$/g, "")
16 .replace(/\/{2,}/g, "/")
17 .toLowerCase();
18}
19
20export function normalizeS3Key(remoteRoot: string, path: string): string {
21 const root = sanitizeS3RemoteRoot(remoteRoot) || DEFAULT_S3_REMOTE_ROOT;

Callers 6

normalizeSyncConfigFunction · 0.90
sync-store.tsFile · 0.90
constructorMethod · 0.90
s3-backend.test.tsFile · 0.90
normalizeS3KeyFunction · 0.85
s3KeyToLogicalPathFunction · 0.85

Calls 2

replaceMethod · 0.80
stripControlCharsFunction · 0.70

Tested by

no test coverage detected