@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/router.jsx +4 -2
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.148",
19
+ "version": "1.0.149",
20
20
  "description": "",
21
21
  "main": "index.js",
22
22
  "repository": {
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) return {params, parsedRouteDefinition}
100
+ if (matched) {
101
+ return {params, parsedRouteDefinition}
102
+ }
101
103
  }
102
104
  }
103
105