MCPcopy Create free account
hub / github.com/cloudflare/computer / buildKey

Function buildKey

packages/computer/src/assets/upload.ts:47–51  ·  view source on GitHub ↗
(path: string, prefix: string | undefined, id: string)

Source from the content-addressed store, hash-verified

45}
46
47export function buildKey(path: string, prefix: string | undefined, id: string): string {
48 const name = basename(path);
49 const normalised = normalisePrefix(prefix);
50 return normalised.length > 0 ? `${normalised}/${id}/${name}` : `${id}/${name}`;
51}
52
53// RFC 6266 Content-Disposition. The filename is quoted; embedded
54// quotes and backslashes are escaped. Non-ASCII filenames also get

Callers 2

shareFunction · 0.85
upload.test.tsFile · 0.85

Calls 2

basenameFunction · 0.70
normalisePrefixFunction · 0.70

Tested by

no test coverage detected