From 126649c09377fdb44fe2b72619afc8c826adac1d Mon Sep 17 00:00:00 2001 From: notaphplover Date: Wed, 4 Dec 2024 14:22:39 +0100 Subject: [PATCH] Fix wrong typescript import (#414) * chore: remove settings * chore: update package lock file * fix: update injectHttpContext types to generate right ts declaration types * docs: update changelog --- .vscode/settings.json | 19 ------------------- CHANGELOG.md | 7 ++++--- package-lock.json | 2 +- src/decorators.ts | 6 +++++- 4 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index cdd24851..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,19 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "src/**/*.js": true, - "test/**/*.js": true, - "**/*.js.map": true, - "**/es": true, - "**/lib": true, - "**/dts": true, - "**/coverage": true, - "**/dist": true, - "**/docs": true, - "type_definitions/**/*.js": true - }, - "typescript.tsdk": "./node_modules/typescript/lib", - "vsicons.presets.angular": false -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 75317274..27b0497a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed +- Fixed wrong emited typescript delclaration files (#1668). ## [6.4.8] ### Fixed -- Fixed can't set headers after they are sent (#255 / #412) +- Fixed can't set headers after they are sent (#255 / #412). ## [6.4.7] @@ -31,8 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Update dependencies (`minimist`, `json5`, `@babel/traverse`, `tough-cookie`, `ansi-regex`, `cookiejar`, `express`, `decode-uri-component`) +- Update dependencies (`minimist`, `json5`, `@babel/traverse`, `tough-cookie`, `ansi-regex`, `cookiejar`, `express`, `decode-uri-component`). ### Fixed -- Change JsonContent to return object rather than string (#379 / #378) +- Change JsonContent to return object rather than string (#379 / #378). diff --git a/package-lock.json b/package-lock.json index 723898e6..6a21d9d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ }, "peerDependencies": { "express": "^4.21.1", - "inversify": "^6.1.0" + "inversify": "^6.0.3" } }, "node_modules/@ampproject/remapping": { diff --git a/src/decorators.ts b/src/decorators.ts index 93a3a173..352356f4 100644 --- a/src/decorators.ts +++ b/src/decorators.ts @@ -3,7 +3,11 @@ import { TYPE, METADATA_KEY, PARAMETER_TYPE, HTTP_VERBS_ENUM, } from './constant import type { DecoratorTarget, Middleware, ControllerMetadata, HandlerDecorator, ControllerMethodMetadata, ControllerParameterMetadata, ParameterMetadata, MiddlewareMetaData } from './interfaces'; import { getMiddlewareMetadata, getOrCreateMetadata } from './utils'; -export const injectHttpContext = inject(TYPE.HttpContext); +export const injectHttpContext: ( + target: DecoratorTarget, + targetKey?: string | symbol, + indexOrPropertyDescriptor?: number | TypedPropertyDescriptor +) => void = inject(TYPE.HttpContext); function defineMiddlewareMetadata( target: DecoratorTarget,