(task: TaskState)
| 35 | * 2. It has been explicitly backgrounded (not a foreground task) |
| 36 | */ |
| 37 | export function isBackgroundTask(task: TaskState): task is BackgroundTaskState { |
| 38 | if (task.status !== 'running' && task.status !== 'pending') { |
| 39 | return false |
| 40 | } |
| 41 | // Foreground tasks (isBackgrounded === false) are not yet "background tasks" |
| 42 | if ('isBackgrounded' in task && task.isBackgrounded === false) { |
| 43 | return false |
| 44 | } |
| 45 | return true |
| 46 | } |
| 47 |
no outgoing calls
no test coverage detected