1
1
import type { BaseStorage } from "../../../storage/index.ts" ;
2
+ import type { LooseType } from "../../entities/common.ts" ;
2
3
3
4
interface Storage {
4
5
Key : string ;
5
- Value : string | number | boolean | null | Record < string | number , any > ;
6
+ Value : string | number | boolean | null | Record < string | number , LooseType > ;
6
7
}
7
8
8
9
type CacheInfo = Record < Storage [ "Key" ] , number > ;
@@ -52,7 +53,7 @@ export class CacheManager {
52
53
*/
53
54
public setCache (
54
55
requestName : string ,
55
- request : Record < string , any > ,
56
+ request : Record < string , LooseType > ,
56
57
response : Storage [ "Value" ] ,
57
58
) : void {
58
59
this . set ( requestName + JSON . stringify ( request ) , response ) ;
@@ -69,7 +70,7 @@ export class CacheManager {
69
70
try {
70
71
this . cacheInfo [ key ] = new Date ( ) . getTime ( ) ;
71
72
return JSON . parse ( this . storage . get ( "cache:" + key ) as string ) ;
72
- } catch ( error ) { }
73
+ } catch ( _e ) { /* Do Nothing */ }
73
74
}
74
75
75
76
/**
@@ -81,7 +82,7 @@ export class CacheManager {
81
82
*/
82
83
public getCache (
83
84
requestName : string ,
84
- request : Record < string , any > ,
85
+ request : Record < string , LooseType > ,
85
86
) : Storage [ "Value" ] | undefined {
86
87
return this . get ( requestName + JSON . stringify ( request ) ) ;
87
88
}
0 commit comments