Skip to content

Commit

Permalink
add explicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad committed Nov 27, 2023
1 parent f7e7484 commit 738d221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fastify-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class FastifyMetrics implements IFastifyMetrics {
return;
}

this.deps.fastify.addHook('onRoute', function onRouteMetrics(routeOptions) {
this.deps.fastify.addHook('onRoute', function onRouteMetrics(this: FastifyMetrics routeOptions) {

Check notice

Code scanning / CodeQL

Syntax error Note

Error: ',' expected.
// routeOptions.method;
// routeOptions.schema;
// routeOptions.url; // the complete URL of the route, it will include the prefix if any
Expand Down Expand Up @@ -292,7 +292,7 @@ export class FastifyMetrics implements IFastifyMetrics {
/** Collect per-route metrics */
private collectRouteMetrics(): void {
this.deps.fastify
.addHook('onRequest', function onRequestMetrics(request, _, done) {
.addHook('onRequest', function onRequestMetrics(this: FastifyMetrics, request, _, done) {
if (
request.routeOptions.config.disableMetrics === true ||
!request.raw.url
Expand Down

0 comments on commit 738d221

Please sign in to comment.