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

Function decodeKey

packages/storage/src/sqlite-long-term-memory-store.ts:1622–1636  ·  view source on GitHub ↗
(row: MemoryKeyRow)

Source from the content-addressed store, hash-verified

1620}
1621
1622function decodeKey(row: MemoryKeyRow): MemoryItemKey {
1623 const keyType = requiredString(row.key_type, 'key_type');
1624 const keyOrigin = requiredString(row.key_origin, 'key_origin');
1625 if (!isMemoryKeyType(keyType)) throw invalidColumn('key_type');
1626 if (!isMemoryKeyOrigin(keyOrigin)) throw invalidColumn('key_origin');
1627 const key = requiredNonEmptyString(row.key_text, 'key_text');
1628 const normalizedKey = requiredNonEmptyString(row.normalized_key, 'normalized_key');
1629 if (normalizeSearchTerm(key) !== normalizedKey) throw invalidColumn('normalized_key');
1630 return {
1631 key,
1632 normalizedKey,
1633 keyType,
1634 keyOrigin,
1635 };
1636}
1637
1638function decodeSource(row: MemorySourceRow): MemoryItemSource {
1639 return {

Callers

nothing calls this directly

Calls 6

isMemoryKeyTypeFunction · 0.90
isMemoryKeyOriginFunction · 0.90
invalidColumnFunction · 0.85
requiredNonEmptyStringFunction · 0.85
normalizeSearchTermFunction · 0.85
requiredStringFunction · 0.70

Tested by

no test coverage detected