( sessionID: string, cached: T | undefined, resolved: T | undefined, )
| 28 | type SessionParent = { id: string; parentID?: string } |
| 29 | |
| 30 | export function selectSessionLineage<T extends { session: { id: string } }>( |
| 31 | sessionID: string, |
| 32 | cached: T | undefined, |
| 33 | resolved: T | undefined, |
| 34 | ) { |
| 35 | if (cached?.session.id === sessionID) return cached |
| 36 | if (resolved?.session.id === sessionID) return resolved |
| 37 | } |
| 38 | |
| 39 | export async function rootSession<T extends SessionParent>(session: T, get: (sessionID: string) => Promise<T>) { |
| 40 | const seen = new Set([session.id]) |
no outgoing calls
no test coverage detected