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

Function builtinModel

packages/hydrooj/src/entry/common.ts:49–59  ·  view source on GitHub ↗
(ctx: Context)

Source from the content-addressed store, hash-verified

47export const service = getLoader('service', 'service');
48
49export async function builtinModel(ctx: Context) {
50 const modelDir = path.resolve(__dirname, '..', 'model');
51 const models = await fs.readdir(modelDir);
52 for (const t of models.filter((i) => i.endsWith('.ts'))) {
53 const q = path.resolve(modelDir, t);
54 const module = require(q);
55 if ('apply' in module) ctx.loader.reloadPlugin(q, '');
56 const exports = unwrapExports(module);
57 if (isClass(exports) && !(Symbol.for('hydro.initialize') in exports)) ctx.loader.reloadPlugin(q, '');
58 }
59}
60
61export async function locale(pending: Record<string, string>, fail: string[]) {
62 for (const i of Object.values(pending)) {

Callers 2

applyFunction · 0.90
loadFunction · 0.90

Calls 3

unwrapExportsFunction · 0.90
isClassFunction · 0.90
reloadPluginMethod · 0.80

Tested by

no test coverage detected