MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / resolveConfig

Method resolveConfig

packages/hydrooj/src/loader.ts:107–114  ·  view source on GitHub ↗
(plugin: any, configScope: string, dynamic = true)

Source from the content-addressed store, hash-verified

105 }
106
107 async resolveConfig(plugin: any, configScope: string, dynamic = true) {
108 const schema = plugin['Config'] || plugin['schema'];
109 if (!schema) return Object.freeze({});
110 const schemaRequest = this.buildSchema(schema, configScope);
111 await this.ctx.setting._tryMigrateConfig(schemaRequest);
112 const res = this.ctx.setting.requestConfig(schemaRequest, dynamic);
113 return configScope ? res[configScope] : res;
114 }
115
116 async reloadPlugin(key: string, configScope: string) {
117 const plugin = this.resolvePlugin(key);

Callers 1

reloadPluginMethod · 0.95

Calls 3

buildSchemaMethod · 0.95
_tryMigrateConfigMethod · 0.80
requestConfigMethod · 0.80

Tested by

no test coverage detected