Skip to content

Commit

Permalink
fix: [GH-267] generic args
Browse files Browse the repository at this point in the history
Update generic args when calling policyRequestFrom()
  • Loading branch information
hisham-otofacts authored and trevor-scheer committed Oct 17, 2023
1 parent bb512e9 commit dc77590
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/HTTPCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class HTTPCache<CO extends CacheOptions = CacheOptions> {
(ttlOverride && policy.age() < ttlOverride) ||
(!ttlOverride &&
policy.satisfiesWithoutRevalidation(
policyRequestFrom(urlString, requestOpts),
policyRequestFrom<CO>(urlString, requestOpts),
))
) {
// Either the cache entry was created with an explicit TTL override (ie,
Expand Down Expand Up @@ -146,7 +146,7 @@ export class HTTPCache<CO extends CacheOptions = CacheOptions> {
// still re-write to the cache, because we might need to update the TTL or
// other aspects of the cache policy based on the headers we got back.
const revalidationHeaders = policy.revalidationHeaders(
policyRequestFrom(urlString, requestOpts),
policyRequestFrom<CO>(urlString, requestOpts),
);
const revalidationRequest: RequestOptions<CO> = {
...requestOpts,
Expand All @@ -158,7 +158,7 @@ export class HTTPCache<CO extends CacheOptions = CacheOptions> {
);

const { policy: revalidatedPolicy, modified } = policy.revalidatedPolicy(
policyRequestFrom(urlString, revalidationRequest),
policyRequestFrom<CO>(urlString, revalidationRequest),
policyResponseFrom(revalidationResponse),
) as unknown as { policy: SneakyCachePolicy; modified: boolean };

Expand Down

0 comments on commit dc77590

Please sign in to comment.