Skip to content

Commit 881acc6

Browse files
committed
fix(agents): narrow future timestamp guard
1 parent 8da3b79 commit 881acc6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/shared/number-coercion.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ export function asDateTimestampMs(value: unknown): number | undefined {
105105
});
106106
}
107107

108-
export function isFutureDateTimestampMs(value: unknown, opts: { nowMs?: number } = {}): boolean {
108+
export function isFutureDateTimestampMs(
109+
value: unknown,
110+
opts: { nowMs?: number } = {},
111+
): value is number {
109112
const timestampMs = asDateTimestampMs(value);
110113
const nowMs = asDateTimestampMs(opts.nowMs ?? Date.now());
111114
return timestampMs !== undefined && nowMs !== undefined && timestampMs > nowMs;

0 commit comments

Comments
 (0)