(type: string, id: string)
| 23 | } |
| 24 | |
| 25 | public get<T>(type: string, id: string): T | null { |
| 26 | const found = this.cache.find((cache) => cache.type === type && cache.id === id); |
| 27 | if (found) { |
| 28 | return found.data; |
| 29 | } |
| 30 | return null; |
| 31 | } |
| 32 | |
| 33 | private cleanup() { |
| 34 | this.cache = this.cache.filter((cache) => cache.expires > (new Date())); |