Skip to content

Commit bff1bf5

Browse files
author
Jake Champion
committed
fix: Deprecate SimpleCache.set and recommend SimpleCache.getOrSet as the alternative
1 parent 671bcea commit bff1bf5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

types/fastly:cache.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ declare module "fastly:cache" {
1010

1111
export class SimpleCache {
1212
static get(key: string): SimpleCacheEntry | null;
13+
/**
14+
* @deprecated Use `SimpleCache.getOrSet` instead.
15+
*/
1316
static set(key: string, value: BodyInit, ttl: number): undefined;
17+
/**
18+
* @deprecated Use `SimpleCache.getOrSet` instead.
19+
*/
1420
static set(key: string, value: ReadableStream, ttl: number, length: number): undefined;
1521
static getOrSet(key: string, set: () => Promise<{value: BodyInit, ttl: number}>): Promise<SimpleCacheEntry>;
1622
static getOrSet(key: string, set: () => Promise<{value: ReadableStream, ttl: number, length: number}>): Promise<SimpleCacheEntry>;

0 commit comments

Comments
 (0)