(row: MemoryKeyRow)
| 1620 | } |
| 1621 | |
| 1622 | function 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 | |
| 1638 | function decodeSource(row: MemorySourceRow): MemoryItemSource { |
| 1639 | return { |
nothing calls this directly
no test coverage detected