(key: string, value: string)
| 90 | if (fallback !== undefined) return fallback; |
| 91 | return DEFAULT_CONFIG[key] ?? ""; |
| 92 | } |
| 93 | |
| 94 | static set(key: string, value: string): void { |
| 95 | this.ensureInit(); |
| 96 | try { |
| 97 | const stmt = this.db!.prepare( |
| 98 | "INSERT OR REPLACE INTO config (key, value, updated_at) VALUES (?, ?, CURRENT_TIMESTAMP)", |
| 99 | ); |
| 100 | stmt.run(key, value); |
| 101 | } catch (error) { |
| 102 | console.error("aitc plugin failed to write config", error); |
| 103 | throw error; |
| 104 | } |
| 105 | } |
| 106 |
no test coverage detected