bug fixes

This commit is contained in:
undefined committed 2025-04-16 10:10:04 +08:00
1 parent b979185fd8
commit 71eceaa304
6 files changed
+20 -19

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import LoggerService from '@cordisjs/logger';
import LoggerService from '@cordisjs/plugin-logger';
import { TimerService } from '@cordisjs/plugin-timer';
import * as cordis from 'cordis';
import Schema from 'schemastery';
@@ -18,7 +18,7 @@ function addScript<K>(name: string, description: string, validate: Schema<K>, ru
}
function provideModule<T extends keyof ModuleInterfaces>(type: T, id: string, module: ModuleInterfaces[T]) {
if (global.Hydro.module[type][id]) throw new Error(`duplicate script ${type}/${id} registered.`);
if (global.Hydro.module[type][id]) throw new Error(`duplicate module ${type}/${id} registered.`);
global.Hydro.module[type as any][id] = module;
return () => delete global.Hydro.module[type][id];
}