mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-28 21:38:52 +03:00
9 lines
318 B
TypeScript
9 lines
318 B
TypeScript
|
// We have TypeError: AbortSignal.timeout is not a function when running tests against masto.js v6
|
||
|
if (!AbortSignal.timeout) {
|
||
|
AbortSignal.timeout = (ms) => {
|
||
|
const controller = new AbortController()
|
||
|
setTimeout(() => controller.abort(new DOMException('TimeoutError')), ms)
|
||
|
return controller.signal
|
||
|
}
|
||
|
}
|