Skip to content

Commit 1d72fca

Browse files
authored
chore: Make compile with NodeJS v20.5.0 (#1906)
An external change to CI appears to run code on NodeJS v20.5.0. Unfortunately, this breaks our hacky override of Timeout. So as a quick fix, I made it even hackier. Since we only use this for tests, this should be fine.
1 parent 8e621d5 commit 1d72fca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev/src/backoff.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ export function setTimeoutHandler(
9292
[Symbol.toPrimitive]: () => {
9393
throw new Error('For tests only. Not Implemented');
9494
},
95-
};
95+
} as unknown as NodeJS.Timeout;
96+
// `NodeJS.Timeout` type signature change:
97+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66176/files#diff-e838d0ace9cd5f6516bacfbd3ad00d02cd37bd60f9993ce6223f52d889a1fdbaR122-R126
98+
//
99+
// Adding `[Symbol.dispose](): void;` cannot be done on older versions of
100+
// NodeJS. So we simply cast to `NodeJS.Timeout`.
96101
return timeout;
97102
};
98103
}

0 commit comments

Comments
 (0)