File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
routeGeneration/templates/hapi Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- type Middleware < T extends Function | object > = T ;
1
+ type Middleware < T extends CallableFunction | object > = T ;
4
2
5
3
const TSOA_MIDDLEWARES = Symbol ( '@tsoa:middlewares' ) ;
6
4
@@ -34,7 +32,7 @@ function decorator(fn: (value: any) => void) {
34
32
* @param middlewares
35
33
* @returns
36
34
*/
37
- export function Middlewares < T extends Function | object > ( ...mws : Array < Middleware < T > > ) : ClassDecorator & MethodDecorator {
35
+ export function Middlewares < T extends CallableFunction | object > ( ...mws : Array < Middleware < T > > ) : ClassDecorator & MethodDecorator {
38
36
return decorator ( target => {
39
37
if ( mws ) {
40
38
const current = fetchMiddlewares < T > ( target ) ;
@@ -49,6 +47,6 @@ export function Middlewares<T extends Function | object>(...mws: Array<Middlewar
49
47
* @param target
50
48
* @returns list of middlewares
51
49
*/
52
- export function fetchMiddlewares < T extends Function | object > ( target : any ) : Array < Middleware < T > > {
50
+ export function fetchMiddlewares < T extends CallableFunction | object > ( target : any ) : Array < Middleware < T > > {
53
51
return Reflect . getMetadata ( TSOA_MIDDLEWARES , target ) || [ ] ;
54
52
}
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ export class HapiTemplateService extends TemplateService<HapiApiHandlerParameter
36
36
protected readonly models : TsoaRoute . Models ,
37
37
protected readonly config : AdditionalProps ,
38
38
private readonly hapi : {
39
- boomify : Function ;
40
- isBoom : Function ;
39
+ boomify : CallableFunction ;
40
+ isBoom : CallableFunction ;
41
41
} ,
42
42
) {
43
43
super ( models , config ) ;
You can’t perform that action at this time.
0 commit comments