MCPcopy
hub / github.com/anomalyco/opencode / fragment

Function fragment

packages/app/src/utils/server-scope.ts:10–13  ·  view source on GitHub ↗
(label: string, value: string)

Source from the content-addressed store, hash-verified

8const separator = "\u0000"
9
10function fragment(label: string, value: string) {
11 if (value.includes(separator)) throw new Error(`${label} cannot contain null bytes`)
12 return value
13}
14
15function compose(scope: ServerScope, parts: string[]) {
16 return [fragment("Server scope", scope), ...parts.map((part) => fragment("Scoped key part", part))].join(separator)

Callers 5

composeFunction · 0.85
fromServerKeyFunction · 0.85
fromRouteFunction · 0.85
fromLegacyFunction · 0.85
scopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected