mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bug fixes
This commit is contained in:
6 files changed
+20
-19
No files matched your search
@@ -16,7 +16,7 @@
|
||||
"@aws-sdk/lib-storage": "3.726.1",
|
||||
"@aws-sdk/s3-presigned-post": "3.726.1",
|
||||
"@aws-sdk/s3-request-presigner": "3.726.1",
|
||||
"@cordisjs/logger": "1.0.0-alpha.5",
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@cordisjs/plugin-timer": "1.1.1",
|
||||
"@graphql-tools/schema": "^10.0.23",
|
||||
"@hydrooj/common": "workspace:^",
|
||||
@@ -58,7 +58,6 @@
|
||||
"ua-parser-js": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@types/adm-zip": "^0.5.7",
|
||||
"@types/babel__code-frame": "^7.0.6",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user