Skip to content

Commit

Permalink
drop express import
Browse files Browse the repository at this point in the history
  • Loading branch information
iamolegga committed Jan 23, 2025
1 parent 9f2335b commit 89de3ed
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/LoggerModule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { IncomingMessage, ServerResponse } from 'node:http';

import {
Global,
Module,
Expand All @@ -9,7 +11,6 @@ import {
Inject,
} from '@nestjs/common';
import { Provider } from '@nestjs/common/interfaces';
import * as express from 'express';
import { pinoHttp } from 'pino-http';

import { createProvidersForDecorated } from './InjectPinoLogger';
Expand Down Expand Up @@ -127,9 +128,9 @@ function bindLoggerMiddlewareFactory(
assignResponse: boolean,
) {
return function bindLoggerMiddleware(
req: express.Request,
res: express.Response,
next: express.NextFunction,
req: IncomingMessage,
res: ServerResponse,
next: () => void,
) {
let log = req.log;
let resLog = assignResponse ? res.log : undefined;
Expand All @@ -141,9 +142,6 @@ function bindLoggerMiddlewareFactory(
resLog = res.allLogs[res.allLogs.length - 1]!;
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: run requires arguments for next but should not because it can
// be called without arguments
storage.run(new Store(log, resLog), next);
};
}

0 comments on commit 89de3ed

Please sign in to comment.