node-karin 0.12.17 → 0.12.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,9 +144,9 @@ export declare class Karin extends Listeners {
|
|
|
144
144
|
* @param event - 监听事件
|
|
145
145
|
* @param fn - 实现函数
|
|
146
146
|
*/
|
|
147
|
-
accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => boolean
|
|
147
|
+
accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => Promise<boolean>, options?: Options): {
|
|
148
148
|
event: T;
|
|
149
|
-
fn: (e: AcceptDict[T]) => boolean
|
|
149
|
+
fn: (e: AcceptDict[T]) => Promise<boolean>;
|
|
150
150
|
log: (id: string, text: string) => void;
|
|
151
151
|
name: string;
|
|
152
152
|
rank: number;
|
|
@@ -316,6 +316,8 @@ class PluginLoader {
|
|
|
316
316
|
/** 函数语法糖数组 */
|
|
317
317
|
if (Array.isArray(Fn)) {
|
|
318
318
|
for (const Val of Fn) {
|
|
319
|
+
if (typeof Val !== 'object' || !Val?.type)
|
|
320
|
+
continue;
|
|
319
321
|
logger.debug(`载入插件 [${plugin}]${_path ? `${common.getRelPath(_path)}` : ''}[${file}][${Val.name}]`);
|
|
320
322
|
list.push(this.cachePlugin(index, plugin, file, Val));
|
|
321
323
|
}
|