(filePath: string)
| 924 | } |
| 925 | |
| 926 | function readPendingRestartNotifications(filePath: string): PendingRestartNotification[] { |
| 927 | if (!fs.existsSync(filePath)) { |
| 928 | return []; |
| 929 | } |
| 930 | try { |
| 931 | const parsed = JSON.parse(fs.readFileSync(filePath, 'utf8')); |
| 932 | if (!Array.isArray(parsed)) { |
| 933 | return []; |
| 934 | } |
| 935 | return parsed.filter((item) => item && typeof item.externalScopeId === 'string' && typeof item.content === 'string'); |
| 936 | } catch { |
| 937 | return []; |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | function writePendingRestartNotifications(filePath: string, items: PendingRestartNotification[]) { |
| 942 | fs.mkdirSync(path.dirname(filePath), { recursive: true }); |
no outgoing calls
no test coverage detected