@middy/http-router 3.3.0 → 3.3.2
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 +3 -3
- package/index.js +3 -3
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -42,8 +42,8 @@ const httpRouteHandler = (routes)=>{
|
|
|
42
42
|
throw (0, _util.createError)(404, 'Route does not exist');
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
const regexpDynamicWildcards = /\/\{proxy\+\}
|
|
46
|
-
const regexpDynamicParameters = /\/\{
|
|
45
|
+
const regexpDynamicWildcards = /\/\{proxy\+\}$/;
|
|
46
|
+
const regexpDynamicParameters = /\/\{[^/]+\}/g;
|
|
47
47
|
const methods = [
|
|
48
48
|
'GET',
|
|
49
49
|
'POST',
|
|
@@ -74,7 +74,7 @@ const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
|
74
74
|
if (!routesType[method]) {
|
|
75
75
|
routesType[method] = [];
|
|
76
76
|
}
|
|
77
|
-
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '
|
|
77
|
+
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '/[^/]+');
|
|
78
78
|
path = new RegExp(`^${path}$`);
|
|
79
79
|
routesType[method].push({
|
|
80
80
|
path,
|
package/index.js
CHANGED
|
@@ -34,8 +34,8 @@ const httpRouteHandler = (routes)=>{
|
|
|
34
34
|
throw createError(404, 'Route does not exist');
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
const regexpDynamicWildcards = /\/\{proxy\+\}
|
|
38
|
-
const regexpDynamicParameters = /\/\{
|
|
37
|
+
const regexpDynamicWildcards = /\/\{proxy\+\}$/;
|
|
38
|
+
const regexpDynamicParameters = /\/\{[^/]+\}/g;
|
|
39
39
|
const methods = [
|
|
40
40
|
'GET',
|
|
41
41
|
'POST',
|
|
@@ -66,7 +66,7 @@ const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
|
66
66
|
if (!routesType[method]) {
|
|
67
67
|
routesType[method] = [];
|
|
68
68
|
}
|
|
69
|
-
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '
|
|
69
|
+
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '/[^/]+');
|
|
70
70
|
path = new RegExp(`^${path}$`);
|
|
71
71
|
routesType[method].push({
|
|
72
72
|
path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-router",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
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": "3.3.
|
|
65
|
+
"@middy/util": "3.3.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "3.3.
|
|
68
|
+
"@middy/core": "3.3.2",
|
|
69
69
|
"@types/aws-lambda": "^8.10.97"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "5fcd6655e7f076615c2dcb877a36f6c4fc3164d3"
|
|
72
72
|
}
|