@middy/http-router 4.0.6 → 4.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -37,7 +37,9 @@ const httpRouteHandler = (routes)=>{
37
37
  for (const route of routesDynamic[method] ?? []){
38
38
  const match = path.match(route.path);
39
39
  if (match) {
40
- event.pathParameters ??= match.groups;
40
+ event.pathParameters ??= {
41
+ ...match.groups
42
+ };
41
43
  return route.handler(event, context, abort);
42
44
  }
43
45
  }
package/index.d.ts CHANGED
@@ -7,14 +7,15 @@ import {
7
7
  Handler as LambdaHandler
8
8
  } from 'aws-lambda'
9
9
 
10
- export type Method =
11
- | 'GET'
12
- | 'POST'
13
- | 'PUT'
14
- | 'PATCH'
15
- | 'DELETE'
16
- | 'OPTIONS'
17
- | 'ANY'
10
+ export enum Method {
11
+ Get = 'GET',
12
+ Post = 'POST',
13
+ Put = 'PUT',
14
+ Patch = 'PATCH',
15
+ Delete = 'DELETE',
16
+ Options = 'OPTIONS',
17
+ Any = 'ANY'
18
+ }
18
19
 
19
20
  export interface Route<TEvent> {
20
21
  method: Method
package/index.js CHANGED
@@ -29,7 +29,9 @@ const httpRouteHandler = (routes)=>{
29
29
  for (const route of routesDynamic[method] ?? []){
30
30
  const match = path.match(route.path);
31
31
  if (match) {
32
- event.pathParameters ??= match.groups;
32
+ event.pathParameters ??= {
33
+ ...match.groups
34
+ };
33
35
  return route.handler(event, context, abort);
34
36
  }
35
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-router",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "description": "HTTP event router for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -62,11 +62,11 @@
62
62
  },
63
63
  "homepage": "https://middy.js.org",
64
64
  "dependencies": {
65
- "@middy/util": "4.0.6"
65
+ "@middy/util": "4.0.8"
66
66
  },
67
67
  "devDependencies": {
68
- "@middy/core": "4.0.6",
68
+ "@middy/core": "4.0.8",
69
69
  "@types/aws-lambda": "^8.10.97"
70
70
  },
71
- "gitHead": "3bbe8598f33352dc0b1ebb41230680c2de5d15d0"
71
+ "gitHead": "e38d1c27d153f9d9c5bf5627fd1abf425fdf3978"
72
72
  }