@uxf/router 11.100.0 → 11.105.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 (2) hide show
  1. package/package.json +1 -1
  2. package/router.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/router",
3
- "version": "11.100.0",
3
+ "version": "11.105.0",
4
4
  "description": "UXF Router",
5
5
  "author": "UXFans <dev@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/router#readme",
package/router.js CHANGED
@@ -87,7 +87,7 @@ function createRouter(routes, routerOptions) {
87
87
  const getRouteInfo = (pathname) => {
88
88
  const entry = Object.entries(routesWithRegex).find(([, routeDefinition]) => routeDefinition.regex.some((regex) => regex.test(pathname)));
89
89
  if (!entry) {
90
- throw new Error(`Active route not found (${pathname}).`);
90
+ return null;
91
91
  }
92
92
  return {
93
93
  pathname,
@@ -192,7 +192,7 @@ function createRouter(routes, routerOptions) {
192
192
  const [requiredRouteName, requiredParams] = args;
193
193
  return (pathname, pageParams) => {
194
194
  const routeInfo = getRouteInfo(pathname);
195
- if (routeInfo.routeName !== requiredRouteName) {
195
+ if ((routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.routeName) !== requiredRouteName) {
196
196
  return false;
197
197
  }
198
198
  if (!requiredParams || Object.keys(requiredParams).length === 0) {