Skip to content

Commit

Permalink
Changed timer type in clearTimeoutExtensionTimer to be node.js indepe…
Browse files Browse the repository at this point in the history
…ndent (#755)
  • Loading branch information
thehenrytsai authored Jun 12, 2024
1 parent 0311b9e commit 9083e33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/resumable-task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ export class ResumableTaskManager {
/**
* Removes the specified timeout extension loop timer.
* NOTE: created mainly for testing purposes so we can spy on this specific method without needing to filter out other `clearInterval` calls.
* NOTE: using `ReturnType` utility type to avoid using node.js specific type, because `setInterval` returns a `number` in browser environments.
*/
public static clearTimeoutExtensionTimer(timer: NodeJS.Timer): void {
public static clearTimeoutExtensionTimer(timer: ReturnType<typeof setInterval>): void {
clearInterval(timer);
}

Expand Down

0 comments on commit 9083e33

Please sign in to comment.