@middy/http-router 4.0.9 → 4.0.10
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 +19 -11
- package/index.js +10 -8
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
8
14
|
});
|
|
9
15
|
const _util = require("@middy/util");
|
|
10
16
|
const httpRouteHandler = (routes)=>{
|
|
@@ -49,14 +55,16 @@ const httpRouteHandler = (routes)=>{
|
|
|
49
55
|
};
|
|
50
56
|
const regexpDynamicWildcards = /\/\{(proxy)\+\}$/;
|
|
51
57
|
const regexpDynamicParameters = /\/\{([^/]+)\}/g;
|
|
52
|
-
const
|
|
53
|
-
'GET',
|
|
54
|
-
'POST',
|
|
55
|
-
'PUT',
|
|
56
|
-
'PATCH',
|
|
57
|
-
'DELETE',
|
|
58
|
-
'OPTIONS'
|
|
59
|
-
|
|
58
|
+
const Method = {
|
|
59
|
+
Get: 'GET',
|
|
60
|
+
Post: 'POST',
|
|
61
|
+
Put: 'PUT',
|
|
62
|
+
Patch: 'PATCH',
|
|
63
|
+
Delete: 'DELETE',
|
|
64
|
+
Options: 'OPTIONS',
|
|
65
|
+
Any: 'ANY'
|
|
66
|
+
};
|
|
67
|
+
const methods = Object.values(Method).filter((method)=>method !== 'ANY');
|
|
60
68
|
const attachStaticRoute = (method, path, handler, routesType)=>{
|
|
61
69
|
if (method === 'ANY') {
|
|
62
70
|
for (const method1 of methods){
|
package/index.js
CHANGED
|
@@ -41,14 +41,16 @@ const httpRouteHandler = (routes)=>{
|
|
|
41
41
|
};
|
|
42
42
|
const regexpDynamicWildcards = /\/\{(proxy)\+\}$/;
|
|
43
43
|
const regexpDynamicParameters = /\/\{([^/]+)\}/g;
|
|
44
|
-
const
|
|
45
|
-
'GET',
|
|
46
|
-
'POST',
|
|
47
|
-
'PUT',
|
|
48
|
-
'PATCH',
|
|
49
|
-
'DELETE',
|
|
50
|
-
'OPTIONS'
|
|
51
|
-
|
|
44
|
+
export const Method = {
|
|
45
|
+
Get: 'GET',
|
|
46
|
+
Post: 'POST',
|
|
47
|
+
Put: 'PUT',
|
|
48
|
+
Patch: 'PATCH',
|
|
49
|
+
Delete: 'DELETE',
|
|
50
|
+
Options: 'OPTIONS',
|
|
51
|
+
Any: 'ANY'
|
|
52
|
+
};
|
|
53
|
+
const methods = Object.values(Method).filter((method)=>method !== 'ANY');
|
|
52
54
|
const attachStaticRoute = (method, path, handler, routesType)=>{
|
|
53
55
|
if (method === 'ANY') {
|
|
54
56
|
for (const method1 of methods){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-router",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
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.
|
|
65
|
+
"@middy/util": "4.0.10"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "4.0.
|
|
68
|
+
"@middy/core": "4.0.10",
|
|
69
69
|
"@types/aws-lambda": "^8.10.97"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e2a97d380fc4150781004092ea054f5d0fc7a8c0"
|
|
72
72
|
}
|