()
| 47 | * Call this when work completes. |
| 48 | */ |
| 49 | export function stopPreventSleep(): void { |
| 50 | if (refCount > 0) { |
| 51 | refCount-- |
| 52 | } |
| 53 | |
| 54 | if (refCount === 0) { |
| 55 | stopRestartInterval() |
| 56 | killCaffeinate() |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Force stop preventing sleep, regardless of reference count. |
no test coverage detected