From 15e7ba2ddeb22ef7114e1ddbf5562b97fd068eed Mon Sep 17 00:00:00 2001 From: Daniel Ziegler Date: Thu, 5 Sep 2024 11:15:41 +0200 Subject: [PATCH 1/2] Remove check for empty result --- package-lock.json | 4 ++-- package.json | 2 +- src/middleware.ts | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b950011..ab0e53b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "dependencies": { "@azure/functions": "^4.0.0", diff --git a/package.json b/package.json index 78e8edc..6282fa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "description": "Middleware for azure functions to handle authentication, authorization, error handling and logging", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/middleware.ts b/src/middleware.ts index 6c8dd29..a2c79db 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -21,7 +21,7 @@ const middlewareCore = handler: T, postExecution: (PostExecutionFunction | false)[], ) => - async (request: Parameters, context: InvocationContext): Promise | Error> => { + async (request: Parameters, context: InvocationContext): Promise | undefined | Error> => { let handlerResult: MiddlewareResult> = { $failed: false, $result: undefined }; if (beforeExecution) { @@ -65,10 +65,6 @@ const middlewareCore = return handlerResult.$error; } - if (handlerResult.$result === undefined) { - return new Error('Illegal-State: Result of the handler was empty.'); - } - return handlerResult.$result; }; From 933cb68afd517f291b88d76b26f9fb075572e04b Mon Sep 17 00:00:00 2001 From: maaaNu Date: Thu, 5 Sep 2024 12:05:41 +0200 Subject: [PATCH 2/2] [3.0.0] Modify package.json to release v3.0.0 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5e3daa..24442b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 3.0.3 (05.09.2024) +- Remove check for empty result + ## 3.0.2 (22.08.2024) - Disable Application Insights internal debug logging