MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / decodeVectorId

Function decodeVectorId

vector/idCodec.js:42–56  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

40}
41
42export function decodeVectorId(id) {
43 if (!id || typeof id !== 'string') return null;
44 const parts = id.split('::');
45 if (parts[0] !== ID_VERSION) return null;
46
47 return {
48 version: parts[0],
49 namespace: decodePart(parts[1]),
50 type: decodePart(parts[2]),
51 entityId: decodePart(parts[3]),
52 chunkId: decodePart(parts[4]),
53 field: decodePart(parts[5]),
54 variant: decodePart(parts[6])
55 };
56}
57
58export const VECTOR_ID_VERSION = ID_VERSION;

Callers 1

Calls 1

decodePartFunction · 0.85

Tested by

no test coverage detected