Skip to content

Commit

Permalink
chore: Make compile with NodeJS v20.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersen committed Sep 25, 2023
1 parent 8e621d5 commit 004bf5d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dev/src/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ export function setTimeoutHandler(
[Symbol.toPrimitive]: () => {
throw new Error('For tests only. Not Implemented');
},
};
} as unknown as NodeJS.Timeout;
// `NodeJS.Timeout` type signature change:
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66176/files#diff-e838d0ace9cd5f6516bacfbd3ad00d02cd37bd60f9993ce6223f52d889a1fdbaR122-R126
//
// Adding `[Symbol.dispose](): void;` cannot be done on older versions of
// NodeJS. So we simply cast to `NodeJS.Timout`.
return timeout;
};
}
Expand Down Expand Up @@ -267,7 +272,7 @@ export class ExponentialBackoff {
'ExponentialBackoff.backoffAndWait',
null,
`Backing off for ${delayWithJitterMs} ms ` +
`(base delay: ${this.currentBaseMs} ms)`
`(base delay: ${this.currentBaseMs} ms)`
);
}

Expand Down

0 comments on commit 004bf5d

Please sign in to comment.