Skip to content

Commit 52ab6e5

Browse files
committed
cacheable - fix: adding null for getTtlFromExpires
1 parent 14ae6fd commit 52ab6e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/cacheable/src/ttl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {shorthandToMilliseconds} from '../src/shorthand-time.js';
55
* @param expires - The expires value to convert.
66
* @returns {number | undefined} The TTL value in milliseconds, or undefined if the expires value is not valid.
77
*/
8-
export function getTtlFromExpires(expires: number | undefined): number | undefined {
8+
// eslint-disable-next-line @typescript-eslint/ban-types
9+
export function getTtlFromExpires(expires: number | null | undefined): number | undefined {
910
if (expires === undefined || expires === null) {
1011
return undefined;
1112
}

0 commit comments

Comments
 (0)