()
| 41 | } |
| 42 | |
| 43 | export async function loadCredentials(): Promise<Credentials | null> { |
| 44 | try { |
| 45 | const data = await fs.readFile(CREDENTIALS_FILE, "utf-8") |
| 46 | return JSON.parse(data) as Credentials |
| 47 | } catch (error) { |
| 48 | if ((error as NodeJS.ErrnoException).code === "ENOENT") { |
| 49 | return null |
| 50 | } |
| 51 | throw error |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | export async function clearToken(): Promise<void> { |
| 56 | try { |
no test coverage detected