Skip to content

Commit 4376a2f

Browse files
remove the unnecessary Partial
1 parent 0078428 commit 4376a2f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/open-next/src/overrides/incrementalCache/multi-tier-ddb-s3.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ const buildDynamoKey = (key: string) => {
5050
*/
5151
const multiTierCache: IncrementalCache = {
5252
name: "multi-tier-ddb-s3",
53-
async get(key, isFetch) {
53+
async get<IsFetch extends boolean = false>(key: string, isFetch?: IsFetch) {
5454
// First we check the local cache
55-
const localCacheEntry = localCache.get(key);
55+
const localCacheEntry = localCache.get(key) as
56+
| {
57+
value: CacheValue<IsFetch>;
58+
lastModified: number;
59+
}
60+
| undefined;
61+
5662
if (localCacheEntry) {
5763
if (Date.now() - localCacheEntry.lastModified < localCacheTTL) {
5864
debug("Using local cache without checking ddb");

packages/open-next/src/types/overrides.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export type WithLastModified<T> = {
7676
};
7777

7878
export type CacheValue<IsFetch extends boolean> = (IsFetch extends true
79-
? Partial<CachedFetchValue>
79+
? CachedFetchValue
8080
: CachedFile) & { revalidate?: number | false };
8181

8282
export type IncrementalCache = {

0 commit comments

Comments
 (0)