(spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise)
| 66540 | if (killResult) { |
| 66541 | context.isCanceled = true; |
| 66542 | } |
| 66543 | }; |
| 66544 | var timeoutKill = (spawned, signal, reject) => { |
| 66545 | spawned.kill(signal); |
| 66546 | reject(Object.assign(new Error("Timed out"), { timedOut: true, signal })); |
| 66547 | }; |
| 66548 | var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => { |
| 66549 | if (timeout === 0 || timeout === void 0) { |
| 66550 | return spawnedPromise; |
| 66551 | } |
| 66552 | let timeoutId; |
| 66553 | const timeoutPromise = new Promise((resolve, reject) => { |
| 66554 | timeoutId = setTimeout(() => { |
| 66555 | timeoutKill(spawned, killSignal, reject); |
| 66556 | }, timeout); |
| 66557 | }); |
| 66558 | const safeSpawnedPromise = spawnedPromise.finally(() => { |
| 66559 | clearTimeout(timeoutId); |
no test coverage detected
searching dependent graphs…