(key: string)
| 105 | ); |
| 106 | } |
| 107 | public get(key: string) { |
| 108 | const result = this.db |
| 109 | .query("SELECT value FROM cache WHERE key = ?") |
| 110 | .get(key) as { value: string } | undefined; |
| 111 | if (result) { |
| 112 | return JSON.parse(result.value); |
| 113 | } else { |
| 114 | throw new Error( |
| 115 | `No entry found in json cache when one was expected: ${key}`, |
| 116 | ); |
| 117 | } |
| 118 | } |
| 119 | public set(key: string, value: any) { |
| 120 | this.db |
| 121 | .query( |
no outgoing calls
no test coverage detected