MCPcopy Create free account
hub / github.com/apache/maka / decodeRuntimePrefixSegment

Function decodeRuntimePrefixSegment

packages/core/src/runtime-boundary.ts:166–180  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

164}
165
166export function decodeRuntimePrefixSegment(value: unknown): RuntimePrefixSegmentV1 {
167 if (
168 !isRecord(value) ||
169 !hasExactKeys(value, ['protocol', 'identity', 'position', 'prefixDigest']) ||
170 value.protocol !== 'runtime_prefix_segment_v1'
171 ) {
172 throw new Error('Invalid RuntimeEvent prefix segment');
173 }
174 return {
175 protocol: 'runtime_prefix_segment_v1',
176 identity: decodePrefixIdentity(value.identity),
177 position: decodePrefixPosition(value.position),
178 prefixDigest: decodeBoundaryDigest(value.prefixDigest),
179 };
180}
181
182export function decodeRuntimeBoundaryCursor(value: unknown): RuntimeBoundaryCursorV1 {
183 if (

Callers 1

runtimePrefixSegmentFunction · 0.85

Calls 5

isRecordFunction · 0.90
decodePrefixIdentityFunction · 0.85
decodePrefixPositionFunction · 0.85
decodeBoundaryDigestFunction · 0.85
hasExactKeysFunction · 0.70

Tested by

no test coverage detected