()
| 22 | } |
| 23 | |
| 24 | async function loadNotifications(): Promise<Notification[]> { |
| 25 | try { |
| 26 | const data = await fs.readFile(DATA_PATH, 'utf-8'); |
| 27 | return JSON.parse(data); |
| 28 | } catch { |
| 29 | return []; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | async function saveNotifications(notifications: Notification[]): Promise<void> { |
| 34 | const dir = path.dirname(DATA_PATH); |