File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,13 @@ import { MiddlewareFunction } from '../type';
55/**
66 * @description The base abstraction for arguments middleware.
77 * @export
8+ * @abstract
89 * @class MiddlewareBase
10+ * @typedef {MiddlewareBase }
911 * @template [T=any]
12+ * @template [O=T[]]
13+ * @template {Function} [U=MiddlewareFunction<T>]
14+ * @extends {MiddlewareCore<T, O, U> }
1015 */
1116export abstract class MiddlewareBase <
1217 T = any ,
@@ -48,9 +53,9 @@ export abstract class MiddlewareBase<
4853 * @returns {this }
4954 */
5055 public execute ( ...args : T [ ] ) {
51- this . #index = 0 ;
52- this . #next( ...args ) ;
53- return this ;
56+ return this . #index = 0 ,
57+ this . #next( ...args ) ,
58+ this ;
5459 }
5560
5661 /**
@@ -61,11 +66,10 @@ export abstract class MiddlewareBase<
6166 * @returns {unknown }
6267 */
6368 public override async executeAsync ( ...args : T [ ] ) : Promise < O > {
64- this . #index = 0 ;
65- return new Promise < O > ( async resolve => (
69+ return this . #index = 0 ,
6670 await this . #nextAsync( ...args ) ,
67- this . onComplete ( ( ) => resolve ( args as O ) )
68- ) ) ;
71+ this . onComplete ( ( ) => args as O ) ,
72+ args as O ;
6973 }
7074
7175 /**
You can’t perform that action at this time.
0 commit comments