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

Function setConfigValue

banana/banana.ts:129–136  ·  view source on GitHub ↗
(
  key: TKey,
  value: BananaConfig[TKey],
)

Source from the content-addressed store, hash-verified

127 const normalized = raw.trim().toLowerCase();
128 if (!normalized) return null;
129
130 const match = normalized.match(/^(\d+(?:\.\d+)?)(b|kb|mb|gb)?$/);
131 if (!match) return null;
132
133 const value = parseFloat(match[1]);
134 if (!Number.isFinite(value) || value <= 0) return null;
135
136 const unit = match[2] || "mb";
137 const multiplier =
138 unit === "gb"
139 ? 1024 * 1024 * 1024

Callers 1

handleConfigFunction · 0.85

Calls 2

writeMethod · 0.80
getDbFunction · 0.70

Tested by

no test coverage detected