swico 0.4.0-beta2 → 0.5.0-beta1
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
|
@@ -46,6 +46,14 @@ var getPathNameList = function () {
|
|
|
46
46
|
return list;
|
|
47
47
|
};
|
|
48
48
|
exports.pathNameList = getPathNameList();
|
|
49
|
+
var getLocation = function (originalHistory) {
|
|
50
|
+
var pathname = originalHistory.pathname, hash = originalHistory.hash, search = originalHistory.search;
|
|
51
|
+
return {
|
|
52
|
+
hash: hash,
|
|
53
|
+
search: search,
|
|
54
|
+
pathname: pathname
|
|
55
|
+
};
|
|
56
|
+
};
|
|
49
57
|
var getFormatHistoryOption = function (to, formatRouterBase, pathList, type) {
|
|
50
58
|
var _a;
|
|
51
59
|
var params = to.params, path = to.path, hash = to.hash, name = to.name, query = to.query;
|
|
@@ -76,6 +84,7 @@ var getHistory = function (routerBase, routerType) {
|
|
|
76
84
|
var formatRouterBase = lastIndexBase === '/' ? routerBase.slice(0, routerBase.length - 1) : routerBase;
|
|
77
85
|
history = {
|
|
78
86
|
go: originalHistory.go,
|
|
87
|
+
forward: originalHistory.forward,
|
|
79
88
|
back: originalHistory.back,
|
|
80
89
|
push: function (to) {
|
|
81
90
|
switch (typeof to) {
|
|
@@ -102,7 +111,8 @@ var getHistory = function (routerBase, routerType) {
|
|
|
102
111
|
default:
|
|
103
112
|
throw "An error occurred while executing Navigation.replace operation: unexpected type of 'to':".concat(typeof to);
|
|
104
113
|
}
|
|
105
|
-
}
|
|
114
|
+
},
|
|
115
|
+
location: getLocation(originalHistory)
|
|
106
116
|
};
|
|
107
117
|
return { history: history, originalHistory: originalHistory };
|
|
108
118
|
};
|