@tanstack/router-core 1.157.14 → 1.157.15
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/dist/cjs/router.cjs +21 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +21 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +26 -1
package/dist/cjs/router.cjs
CHANGED
|
@@ -222,9 +222,29 @@ class RouterCore {
|
|
|
222
222
|
};
|
|
223
223
|
this.parseLocation = (locationToParse, previousLocation) => {
|
|
224
224
|
const parse = ({
|
|
225
|
+
pathname,
|
|
226
|
+
search,
|
|
227
|
+
hash,
|
|
225
228
|
href,
|
|
226
229
|
state
|
|
227
230
|
}) => {
|
|
231
|
+
if (!this.rewrite && !/[ \x00-\x1f\x7f\u0080-\uffff]/.test(pathname)) {
|
|
232
|
+
const parsedSearch2 = this.options.parseSearch(search);
|
|
233
|
+
const searchStr2 = this.options.stringifySearch(parsedSearch2);
|
|
234
|
+
return {
|
|
235
|
+
href: pathname + searchStr2 + hash,
|
|
236
|
+
publicHref: href,
|
|
237
|
+
pathname: utils.decodePath(pathname),
|
|
238
|
+
external: false,
|
|
239
|
+
searchStr: searchStr2,
|
|
240
|
+
search: utils.replaceEqualDeep(
|
|
241
|
+
previousLocation?.search,
|
|
242
|
+
parsedSearch2
|
|
243
|
+
),
|
|
244
|
+
hash: utils.decodePath(hash.slice(1)),
|
|
245
|
+
state: utils.replaceEqualDeep(previousLocation?.state, state)
|
|
246
|
+
};
|
|
247
|
+
}
|
|
228
248
|
const fullUrl = new URL(href, this.origin);
|
|
229
249
|
const url = rewrite.executeRewriteInput(this.rewrite, fullUrl);
|
|
230
250
|
const parsedSearch = this.options.parseSearch(url.search);
|
|
@@ -238,7 +258,7 @@ class RouterCore {
|
|
|
238
258
|
external: !!this.rewrite && url.origin !== this.origin,
|
|
239
259
|
searchStr,
|
|
240
260
|
search: utils.replaceEqualDeep(previousLocation?.search, parsedSearch),
|
|
241
|
-
hash: utils.decodePath(url.hash.
|
|
261
|
+
hash: utils.decodePath(url.hash.slice(1)),
|
|
242
262
|
state: utils.replaceEqualDeep(previousLocation?.state, state)
|
|
243
263
|
};
|
|
244
264
|
};
|