(scripts: any[], callback?: () => void)
| 101 | update(scripts: any[]): Promise<void>; |
| 102 | update(scripts: any[], callback: () => void): void; |
| 103 | update(scripts: any[], callback?: () => void): Promise<void> | void { |
| 104 | // console.log("update called with:", scripts); |
| 105 | for (const updated of scripts) { |
| 106 | const idx = this.scripts.findIndex((s) => s.id === updated.id); |
| 107 | if (idx !== -1) { |
| 108 | this.scripts[idx] = { ...this.scripts[idx], ...updated }; |
| 109 | } |
| 110 | } |
| 111 | if (callback) callback(); |
| 112 | else return Promise.resolve(); |
| 113 | } |
| 114 | |
| 115 | // ---- helper for tests ---- |
| 116 | resetMock(): void { |
nothing calls this directly
no test coverage detected