swico 0.5.0-beta10 → 0.5.0-beta11
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
CHANGED
|
@@ -26,13 +26,19 @@ var compareURLPatterns = function (urlPatternWithValues, urlPatternWithParams) {
|
|
|
26
26
|
}
|
|
27
27
|
return true;
|
|
28
28
|
};
|
|
29
|
+
console.log('routes1', routes_1.routes);
|
|
29
30
|
var useLocation = function () {
|
|
30
31
|
var _a, _b;
|
|
31
32
|
var location = (0, react_router_dom_1.useLocation)();
|
|
32
33
|
var params = (0, react_router_dom_1.useParams)();
|
|
33
34
|
var search = location.search, hash = location.hash, pathname = location.pathname;
|
|
35
|
+
console.log('routes2', routes_1.routes);
|
|
34
36
|
var pathNameList = (0, history_1.getPathNameList)(routes_1.routes);
|
|
35
|
-
|
|
37
|
+
console.log('pathNameList', pathNameList);
|
|
38
|
+
var name = (_a = pathNameList.find(function (item) {
|
|
39
|
+
return (Object.keys(params).length > 0 && compareURLPatterns(pathname, item.path)) ||
|
|
40
|
+
item.path === pathname;
|
|
41
|
+
})) === null || _a === void 0 ? void 0 : _a.name;
|
|
36
42
|
var query = search ? qs_1.default.parse(search.startsWith('?') ? search.slice(1) : search) : {};
|
|
37
43
|
return {
|
|
38
44
|
name: name,
|