(sessionDir: string)
| 295 | } |
| 296 | |
| 297 | async function readState(sessionDir: string): Promise<StateJson | null> { |
| 298 | try { |
| 299 | return JSON.parse(await readFile(join(sessionDir, 'state.json'), 'utf8')) as StateJson; |
| 300 | } catch { return null; } |
| 301 | } |
| 302 | |
| 303 | async function findSessionDir(home: string, sessionId: string): Promise<string | null> { |
| 304 | if (!SESSION_ID_RE.test(sessionId)) return null; |
no test coverage detected