@kaspernj/api-maker 1.0.148 → 1.0.149
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/package.json +1 -1
- package/src/router.jsx +4 -2
package/package.json
CHANGED
package/src/router.jsx
CHANGED
|
@@ -48,7 +48,7 @@ export default class ApiMakerRouter extends React.Component {
|
|
|
48
48
|
if (!(routePathName in routes))
|
|
49
49
|
throw new Error(`${routePathName} not found in routes: ${Object.keys(routes, ", ")}`)
|
|
50
50
|
|
|
51
|
-
const routePath = routes[routePathName](...params)
|
|
51
|
+
const routePath = routes[routePathName](...params).replace(/[\/]+$/, "")
|
|
52
52
|
const groups = []
|
|
53
53
|
|
|
54
54
|
let pathRegexString = '^'
|
|
@@ -97,7 +97,9 @@ export default class ApiMakerRouter extends React.Component {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
if (path == "" && parsedRouteDefinition.routeDefinition.path == "/") matched = true
|
|
100
|
-
if (matched)
|
|
100
|
+
if (matched) {
|
|
101
|
+
return {params, parsedRouteDefinition}
|
|
102
|
+
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
|