From 3a9d915fa4340793f2de587da06a105a01fe54e5 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 7 Jul 2026 19:30:00 +0200 Subject: [PATCH 1/5] fix(deps): Upgrading express types dependency. --- pnpm-lock.yaml | 8 ++++---- pnpm-workspace.yaml | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 440a71cfe..04d304042 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -630,8 +630,8 @@ packages: '@types/express-fileupload@1.5.1': resolution: {integrity: sha512-DllImBVI1lCyjl2klky/TEwk60mbNebgXv1669h66g9TfptWSrEFq5a/raHSutaFzjSm1tmn9ypdNfu4jPSixQ==} - '@types/express-serve-static-core@5.1.1': - resolution: {integrity: sha512-v4zIMr/cX7/d2BpAEX3KNKL/JrT1s43s96lLvvdTmza1oEvDudCqK9aF/djc/SWgy8Yh0h30TZx5VpzqFCxk5A==} + '@types/express-serve-static-core@5.1.2': + resolution: {integrity: sha512-d3KvEXBSo/lOAMc2u6fkyDHBvetBHeqD7wm/AcXfLpSOQwlmG9D/aQ0SFswVjv05p7ullQS7Mjohj6/VdbZuTg==} '@types/express@5.0.6': resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==} @@ -2229,7 +2229,7 @@ snapshots: '@types/busboy': 1.5.4 '@types/express': 5.0.6 - '@types/express-serve-static-core@5.1.1': + '@types/express-serve-static-core@5.1.2': dependencies: '@types/node': 26.0.1 '@types/qs': 6.15.0 @@ -2239,7 +2239,7 @@ snapshots: '@types/express@5.0.6': dependencies: '@types/body-parser': 1.19.6 - '@types/express-serve-static-core': 5.1.1 + '@types/express-serve-static-core': 5.1.2 '@types/serve-static': 2.2.0 '@types/http-errors@2.0.5': {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 581501c2c..615baeb36 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -12,6 +12,8 @@ engineStrict: true autoInstallPeers: false dedupePeers: true minimumReleaseAge: 10080 +minimumReleaseAgeExclude: + - "@types/express-serve-static-core@5.1.2" publicHoistPattern: - "@typescript-eslint/*" # used as an assumed transitive in migration - "@vitest/*" # used by vitest.setup.ts and vitest.config.ts From b756846d277c474674d16f1cbaf6f351f7eaa304 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 7 Jul 2026 19:31:37 +0200 Subject: [PATCH 2/5] fix(todo): rm workaround in FamiliarMethod. --- express-zod-api/src/method.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/express-zod-api/src/method.ts b/express-zod-api/src/method.ts index c41382a82..5ccb66dd2 100644 --- a/express-zod-api/src/method.ts +++ b/express-zod-api/src/method.ts @@ -2,10 +2,10 @@ import type { IRouter } from "express"; export type SomeMethod = Lowercase; -type FamiliarMethod = - | Exclude - /** @todo remove when merged: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/75187 */ - | "query"; +type FamiliarMethod = Exclude< + keyof IRouter, + "param" | "use" | "route" | "stack" | "all" +>; export const methods = [ "get", From fe86e6ed880c492509e04d55104c32e69e4580f8 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 7 Jul 2026 19:35:24 +0200 Subject: [PATCH 3/5] fix(todo): rm workaround from initRouting(). --- express-zod-api/src/routing.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/express-zod-api/src/routing.ts b/express-zod-api/src/routing.ts index 60d9b5f9c..10bd6f634 100644 --- a/express-zod-api/src/routing.ts +++ b/express-zod-api/src/routing.ts @@ -1,4 +1,4 @@ -import type { IRouter, RequestHandler, IRouterMatcher } from "express"; +import type { IRouter, RequestHandler } from "express"; import createHttpError from "http-errors"; import { isProduction } from "./common-helpers"; import type { CommonConfig } from "./config-type"; @@ -81,10 +81,10 @@ export const initRouting = ({ app, config, getLogger, ...rest }: InitProps) => { const logger = getLogger(request); return endpoint.execute({ request, response, logger, config }); }); - /** @todo remove type assertion when merged: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/75187 */ - const register: (path: string, ...handlers: RequestHandler[]) => IRouter = - (app as IRouter & { query: IRouterMatcher })[method]; - register.call(app, path, ...handlers); + const register: + ((path: string, ...handlers: RequestHandler[]) => IRouter) | undefined = + app[method]; + register?.call(app, path, ...handlers); } if (config.hintAllowedMethods === false) continue; deprioritized.set(path, createWrongMethodHandler(accessMethods)); From 2a04b8b777150a7e60adf1a9968af977a34a9976 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 7 Jul 2026 19:37:33 +0200 Subject: [PATCH 4/5] fix: rm intermediate fn. --- express-zod-api/src/routing.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/express-zod-api/src/routing.ts b/express-zod-api/src/routing.ts index 10bd6f634..80039b7cc 100644 --- a/express-zod-api/src/routing.ts +++ b/express-zod-api/src/routing.ts @@ -81,10 +81,7 @@ export const initRouting = ({ app, config, getLogger, ...rest }: InitProps) => { const logger = getLogger(request); return endpoint.execute({ request, response, logger, config }); }); - const register: - ((path: string, ...handlers: RequestHandler[]) => IRouter) | undefined = - app[method]; - register?.call(app, path, ...handlers); + app[method]?.(path, ...handlers); } if (config.hintAllowedMethods === false) continue; deprioritized.set(path, createWrongMethodHandler(accessMethods)); From 62a0120a008d25b803a343e422ccc665cf702a40 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 7 Jul 2026 19:41:17 +0200 Subject: [PATCH 5/5] fix(deps): Add todo on removing the exception. --- pnpm-workspace.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 615baeb36..64bd299f5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -13,7 +13,7 @@ autoInstallPeers: false dedupePeers: true minimumReleaseAge: 10080 minimumReleaseAgeExclude: - - "@types/express-serve-static-core@5.1.2" + - "@types/express-serve-static-core@5.1.2" # todo remove 15.07.2026 publicHoistPattern: - "@typescript-eslint/*" # used as an assumed transitive in migration - "@vitest/*" # used by vitest.setup.ts and vitest.config.ts