@middy/http-router 4.2.7 → 5.0.0-alpha.0

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.
Files changed (3) hide show
  1. package/index.cjs +12 -20
  2. package/index.js +9 -11
  3. package/package.json +5 -5
package/index.cjs CHANGED
@@ -2,15 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- Method: ()=>Method,
13
- default: ()=>_default
5
+ Object.defineProperty(module, "exports", {
6
+ enumerable: true,
7
+ get: ()=>_default
14
8
  });
15
9
  const _util = require("@middy/util");
16
10
  const httpRouteHandler = (routes)=>{
@@ -55,17 +49,15 @@ const httpRouteHandler = (routes)=>{
55
49
  };
56
50
  const regexpDynamicWildcards = /\/\{(proxy)\+\}$/;
57
51
  const regexpDynamicParameters = /\/\{([^/]+)\}/g;
58
- const Method = {
59
- Get: 'GET',
60
- Post: 'POST',
61
- Put: 'PUT',
62
- Patch: 'PATCH',
63
- Delete: 'DELETE',
64
- Options: 'OPTIONS',
65
- Head: 'HEAD',
66
- Any: 'ANY'
67
- };
68
- const methods = Object.values(Method).filter((method)=>method !== 'ANY');
52
+ const methods = [
53
+ 'GET',
54
+ 'POST',
55
+ 'PUT',
56
+ 'PATCH',
57
+ 'DELETE',
58
+ 'OPTIONS',
59
+ 'HEAD'
60
+ ];
69
61
  const attachStaticRoute = (method, path, handler, routesType)=>{
70
62
  if (method === 'ANY') {
71
63
  for (const method of methods){
package/index.js CHANGED
@@ -41,17 +41,15 @@ const httpRouteHandler = (routes)=>{
41
41
  };
42
42
  const regexpDynamicWildcards = /\/\{(proxy)\+\}$/;
43
43
  const regexpDynamicParameters = /\/\{([^/]+)\}/g;
44
- export const Method = {
45
- Get: 'GET',
46
- Post: 'POST',
47
- Put: 'PUT',
48
- Patch: 'PATCH',
49
- Delete: 'DELETE',
50
- Options: 'OPTIONS',
51
- Head: 'HEAD',
52
- Any: 'ANY'
53
- };
54
- const methods = Object.values(Method).filter((method)=>method !== 'ANY');
44
+ const methods = [
45
+ 'GET',
46
+ 'POST',
47
+ 'PUT',
48
+ 'PATCH',
49
+ 'DELETE',
50
+ 'OPTIONS',
51
+ 'HEAD'
52
+ ];
55
53
  const attachStaticRoute = (method, path, handler, routesType)=>{
56
54
  if (method === 'ANY') {
57
55
  for (const method of methods){
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@middy/http-router",
3
- "version": "4.2.7",
3
+ "version": "5.0.0-alpha.0",
4
4
  "description": "HTTP event router for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
7
- "node": ">=16"
7
+ "node": ">=18"
8
8
  },
9
9
  "engineStrict": true,
10
10
  "publishConfig": {
@@ -66,11 +66,11 @@
66
66
  "url": "https://github.com/sponsors/willfarrell"
67
67
  },
68
68
  "dependencies": {
69
- "@middy/util": "4.2.7"
69
+ "@middy/util": "5.0.0-alpha.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@middy/core": "4.2.7",
72
+ "@middy/core": "5.0.0-alpha.0",
73
73
  "@types/aws-lambda": "^8.10.97"
74
74
  },
75
- "gitHead": "f17e0e371d1d1c7a67365c895775a847aab5aa0b"
75
+ "gitHead": "08c35e3dba9efdad0b86666ce206ce302cc65d07"
76
76
  }