(promise: Promise<void>)
| 9 | timeoutCallbacks.push(callback) |
| 10 | }, |
| 11 | wrap(promise: Promise<void>) { |
| 12 | return new Promise<void>((resolve, reject) => { |
| 13 | timeoutController.timedOut = false |
| 14 | timeoutController.onTimeout(resolve) |
| 15 | |
| 16 | if (timeout) { |
| 17 | timeoutId = setTimeout(() => { |
| 18 | timeoutController.timedOut = true |
| 19 | timeoutCallbacks.forEach((callback) => callback()) |
| 20 | resolve() |
| 21 | }, timeout) |
| 22 | } |
| 23 | |
| 24 | promise |
| 25 | .then(resolve) |
| 26 | .catch(reject) |
| 27 | .finally(() => timeoutController.cancel()) |
| 28 | }) |
| 29 | }, |
| 30 | cancel() { |
| 31 | clearTimeout(timeoutId) |
| 32 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…