swico 0.8.0-beta1 → 0.8.0-beta2
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
|
@@ -7,16 +7,6 @@ exports.useNav = exports.useLocation = void 0;
|
|
|
7
7
|
var react_router_dom_1 = require("react-router-dom");
|
|
8
8
|
var history_1 = require("./$env/history");
|
|
9
9
|
var qs_1 = __importDefault(require("qs"));
|
|
10
|
-
var getFormatNavPath = function (to) {
|
|
11
|
-
var _a;
|
|
12
|
-
var params = to.params, path = to.path, hash = to.hash, name = to.name, query = to.query;
|
|
13
|
-
var search = query ? qs_1.default.stringify(query) : '';
|
|
14
|
-
var formatHash = hash ? (hash.startsWith('#') ? hash : "#".concat(hash)) : '';
|
|
15
|
-
var formatPath = name ? (_a = history_1.pathNameList.find(function (item) { return item.name === name; })) === null || _a === void 0 ? void 0 : _a.path : path;
|
|
16
|
-
var newPath = formatPath ? (0, history_1.interpolatePath)(formatPath, params || {}) : null;
|
|
17
|
-
newPath = newPath + search + formatHash;
|
|
18
|
-
return newPath;
|
|
19
|
-
};
|
|
20
10
|
var useLocation = function () {
|
|
21
11
|
var _a, _b;
|
|
22
12
|
var location = (0, react_router_dom_1.useLocation)();
|
|
@@ -38,6 +28,16 @@ var useLocation = function () {
|
|
|
38
28
|
};
|
|
39
29
|
};
|
|
40
30
|
exports.useLocation = useLocation;
|
|
31
|
+
var getFormatNavPath = function (to) {
|
|
32
|
+
var _a;
|
|
33
|
+
var params = to.params, path = to.path, hash = to.hash, name = to.name, query = to.query;
|
|
34
|
+
var search = query ? "?".concat(qs_1.default.stringify(query)) : '';
|
|
35
|
+
var formatHash = hash ? (hash.startsWith('#') ? hash : "#".concat(hash)) : '';
|
|
36
|
+
var formatPath = name ? (_a = history_1.pathNameList.find(function (item) { return item.name === name; })) === null || _a === void 0 ? void 0 : _a.path : path;
|
|
37
|
+
var newPath = formatPath ? (0, history_1.interpolatePath)(formatPath, params || {}) : null;
|
|
38
|
+
newPath = newPath + search + formatHash;
|
|
39
|
+
return newPath;
|
|
40
|
+
};
|
|
41
41
|
var useNav = function () {
|
|
42
42
|
var navigate = (0, react_router_dom_1.useNavigate)();
|
|
43
43
|
var newNavigate = function (to, options) {
|