(stateDir: string)
| 207 | } |
| 208 | |
| 209 | function readActiveConnectionSession(stateDir: string): string | undefined { |
| 210 | const activePath = activeConnectionStatePath(stateDir); |
| 211 | if (!fs.existsSync(activePath)) return undefined; |
| 212 | try { |
| 213 | const parsed = JSON.parse(fs.readFileSync(activePath, 'utf8')) as Record<string, unknown>; |
| 214 | return typeof parsed.session === 'string' ? parsed.session : undefined; |
| 215 | } catch { |
| 216 | return undefined; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | export function fingerprint(value: string | undefined): string | undefined { |
| 221 | if (!value) return undefined; |
no test coverage detected