From df87c6c75ede8b3c60a25a3cf5369196b0b476ad Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 26 Jul 2020 13:48:57 +0000 Subject: [PATCH] fix(core): update --- package-lock.json | 6 +++--- package.json | 2 +- test/test.ts | 7 +++---- ts/typedrequest.classes.typedrouter.ts | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cb8071..6d8f164 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2359,9 +2359,9 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/node": { - "version": "14.0.23", - "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.0.23.tgz", - "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==" + "version": "14.0.26", + "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" }, "@types/parcel-bundler": { "version": "1.12.1", diff --git a/package.json b/package.json index 8e3762f..54211f7 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@gitzone/tstest": "^1.0.43", "@pushrocks/smartexpress": "^3.0.73", "@pushrocks/tapbundle": "^3.2.9", - "@types/node": "^14.0.23", + "@types/node": "^14.0.26", "tslint": "^6.1.2", "tslint-config-prettier": "^1.18.0" }, diff --git a/test/test.ts b/test/test.ts index a948811..31b86c0 100644 --- a/test/test.ts +++ b/test/test.ts @@ -33,12 +33,11 @@ tap.test('should spawn a server to test with', async () => { }); tap.test('should define a testHandler', async () => { + const testTypedRouter = new typedrequest.TypedRouter(); + testTypedRouter.addTypedHandler(testTypedHandler); testServer.addRoute( '/testroute', - new smartexpress.Handler('POST', async (req, res) => { - console.log(req.body); - res.json(await testTypedHandler.addResponse(req.body)); - }) + new smartexpress.HandlerTypedRouter(testTypedRouter as any) ); }); diff --git a/ts/typedrequest.classes.typedrouter.ts b/ts/typedrequest.classes.typedrouter.ts index 525a74e..ff7680d 100644 --- a/ts/typedrequest.classes.typedrouter.ts +++ b/ts/typedrequest.classes.typedrouter.ts @@ -106,7 +106,9 @@ export class TypedRouter { typedRequestArg = await typedHandler.addResponse(typedRequestArg); } else if (typedRequestArg.correlation.phase === 'response') { - this.fireEventInterestMap.findInterest(typedRequestArg.correlation.id)?.fullfillInterest(typedRequestArg); + this.fireEventInterestMap + .findInterest(typedRequestArg.correlation.id) + ?.fullfillInterest(typedRequestArg); } return typedRequestArg; }