Skip to content

Commit

Permalink
feat(platform-router): add PlatformHandlerMetadata.isRawMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Mar 24, 2024
1 parent c18add2 commit 634c728
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/platform/platform-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@tsed/di": "workspace:*",
"@tsed/platform-test-sdk": "workspace:*",
"@types/content-disposition": "^0.5.4",
"barrelsby": "2.8.1",
"cross-env": "7.0.3",
"fastify": "4.23.2",
"fastify-raw-body": ">=4.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ export class PlatformHandlerMetadata {
return this.type === PlatformHandlerType.RESPONSE_FN;
}

public isRawMiddleware() {
return !this.isInjectable() && (this.type === PlatformHandlerType.MIDDLEWARE || this.type === PlatformHandlerType.ERR_MIDDLEWARE);
}

toString() {
return [nameOf(this.target), this.propertyKey].filter(Boolean).join(".");
}
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7323,6 +7323,7 @@ __metadata:
"@tsed/di": "workspace:*"
"@tsed/platform-test-sdk": "workspace:*"
"@types/content-disposition": "npm:^0.5.4"
barrelsby: "npm:2.8.1"
content-disposition: "npm:>=0.5.4"
cross-env: "npm:7.0.3"
fastify: "npm:4.23.2"
Expand Down Expand Up @@ -11274,7 +11275,7 @@ __metadata:
languageName: node
linkType: hard

"barrelsby@npm:^2.8.1":
"barrelsby@npm:2.8.1, barrelsby@npm:^2.8.1":
version: 2.8.1
resolution: "barrelsby@npm:2.8.1"
dependencies:
Expand Down

0 comments on commit 634c728

Please sign in to comment.