MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getDb

Function getDb

banana/banana.ts:103–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101}
102
103async function getConfigValue<TKey extends keyof BananaConfig>(
104 key: TKey,
105): Promise<BananaConfig[TKey]> {
106 const db = await getDb();
107 const value = db.data![key];
108 if (typeof value === "string") {
109 const trimmed = value.trim();
110 if (!trimmed) {
111 return CONFIG_DEFAULTS[key];
112 }
113 }
114 return value ?? CONFIG_DEFAULTS[key];
115}
116

Callers 2

getConfigValueFunction · 0.70
setConfigValueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected