MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / parseMessageRef

Function parseMessageRef

lib/message-ids.ts:44–58  ·  view source on GitHub ↗
(ref: string)

Source from the content-addressed store, hash-verified

42}
43
44export function parseMessageRef(ref: string): number | null {
45 const normalized = ref.trim().toLowerCase()
46 const match = normalized.match(MESSAGE_REF_REGEX)
47 if (!match) {
48 return null
49 }
50 const index = Number.parseInt(match[1], 10)
51 if (!Number.isInteger(index)) {
52 return null
53 }
54 if (index < MESSAGE_REF_MIN_INDEX || index > MESSAGE_REF_MAX_INDEX) {
55 return null
56 }
57 return index
58}
59
60export function parseBlockRef(ref: string): number | null {
61 const normalized = ref.trim().toLowerCase()

Callers 1

parseBoundaryIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected