MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / set

Method set

src/pkg/config/config.ts:181–190  ·  view source on GitHub ↗
(key: T, value: SystemConfigValueType<T>)

Source from the content-addressed store, hash-verified

179 }
180
181 public set<T extends SystemConfigKey>(key: T, value: SystemConfigValueType<T>): void {
182 const funcName = `set${toCamelCase(key)}`;
183 // @ts-ignore
184 if (typeof this[funcName] === "function") {
185 // @ts-ignore
186 this[funcName](value);
187 } else {
188 throw new Error(`Method ${funcName} does not exist on SystemConfig`);
189 }
190 }
191
192 private _set<T extends SystemConfigKey>(key: T, value: SystemConfigValueType<T> | undefined) {
193 const prev = this.cache.get(key);

Callers

nothing calls this directly

Calls 1

toCamelCaseFunction · 0.90

Tested by

no test coverage detected