(input: {
readonly expiresAt: number | null;
readonly now?: number;
readonly skewMs?: number;
})
| 1724 | * signal. Keep the two paths in sync — narrowing the reactive retry strands |
| 1725 | * every null-expiry connection with no way to recover short of a reconnect. */ |
| 1726 | export const shouldRefreshToken = (input: { |
| 1727 | readonly expiresAt: number | null; |
| 1728 | readonly now?: number; |
| 1729 | readonly skewMs?: number; |
| 1730 | }): boolean => { |
| 1731 | if (input.expiresAt === null) return false; |
| 1732 | const now = input.now ?? Date.now(); |
| 1733 | const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS; |
| 1734 | return input.expiresAt <= now + skew; |
| 1735 | }; |
no outgoing calls
no test coverage detected