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

Method get

src/pkg/config/config.ts:170–179  ·  view source on GitHub ↗
(key: T)

Source from the content-addressed store, hash-verified

168 }
169
170 public get<T extends SystemConfigKey>(key: T): Promise<SystemConfigValueType<T>> {
171 const funcName = `get${toCamelCase(key)}`;
172 // @ts-ignore
173 if (typeof this[funcName] === "function") {
174 // @ts-ignore
175 return this[funcName]() as Promise<any>;
176 } else {
177 throw new Error(`Method ${funcName} does not exist on SystemConfig`);
178 }
179 }
180
181 public set<T extends SystemConfigKey>(key: T, value: SystemConfigValueType<T>): void {
182 const funcName = `set${toCamelCase(key)}`;

Callers 1

watchMethod · 0.95

Calls 1

toCamelCaseFunction · 0.90

Tested by

no test coverage detected