Skip to content

Commit

Permalink
Use import type in middlewares
Browse files Browse the repository at this point in the history
  • Loading branch information
juffalow committed Sep 13, 2024
1 parent 0ed799b commit ee0d04f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/middlewares/cors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import config from '../config';

export default function cors(req: Request, res: Response, next: NextFunction): void {
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/errorHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import APIError from '../errors/APIError';
import logger from '../logger';

Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/logRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import logger from '../logger';

export default function logRequest(req: Request, res: Response, next: NextFunction): void {
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/optionalAuth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import services from '../services';

export default async function auth(req: Request, res: Response, next: NextFunction): Promise<unknown> {
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/requireAdmin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import tokenService from '../services/token';

export default async function requireAdmin(req: Request, res: Response, next: NextFunction): Promise<unknown> {
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/requireAuth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import services from '../services';

export default async function requireAuth(req: Request, res: Response, next: NextFunction): Promise<unknown> {
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/trace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import { v4 as uuidv4 } from 'uuid';
import namespace from '../services/cls';

Expand Down

0 comments on commit ee0d04f

Please sign in to comment.