(expiresAt: string | undefined, now: (() => number) | undefined)
| 564 | } |
| 565 | |
| 566 | function isExpired(expiresAt: string | undefined, now: (() => number) | undefined): boolean { |
| 567 | if (!expiresAt) return false; |
| 568 | const timestamp = Date.parse(expiresAt); |
| 569 | if (!Number.isFinite(timestamp)) return true; |
| 570 | return timestamp <= (now?.() ?? Date.now()); |
| 571 | } |
| 572 | |
| 573 | function hasToken(value: unknown): value is string { |
| 574 | return typeof value === 'string' && value.trim().length > 0; |
no test coverage detected
searching dependent graphs…