(store: JsonRecord)
| 13 | * - Array format: { sessions: [...] } |
| 14 | */ |
| 15 | export function extractSessionRecords(store: JsonRecord): JsonRecord[] { |
| 16 | const directEntries = Object.entries(store) |
| 17 | .filter(([key, value]) => key !== 'sessions' && value && typeof value === 'object') |
| 18 | .map(([, value]) => value as JsonRecord); |
| 19 | const arrayEntries = Array.isArray(store.sessions) |
| 20 | ? store.sessions.filter((entry): entry is JsonRecord => Boolean(entry && typeof entry === 'object')) |
| 21 | : []; |
| 22 | return [...directEntries, ...arrayEntries]; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Find accountId from session history by "to" address and channel type. |
no outgoing calls
no test coverage detected