chore: add checkArgsEmpty

This commit is contained in:
CrescentLeaf
2025-09-08 03:09:56 +08:00
parent f3a9cb8641
commit 7e60e4a4be

View File

@@ -14,6 +14,12 @@ export default abstract class BaseApi {
return true
return false
}
checkArgsEmpty(args: { [key: string]: unknown }, names: string[]) {
for (const k of names)
if (k in args && args[k] == '')
return true
return false
}
registerEvent(name: CallMethod, func: EventCallbackFunction) {
if (!name.startsWith(this.getName() + ".")) throw Error("注冊的事件應該與接口集合命名空間相匹配: " + name)
ApiManager.addEventListener(name, func)