@tanstack/router-core 1.154.14 → 1.155.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.
@@ -71,12 +71,10 @@ class RouterCore {
71
71
  ...newOptions
72
72
  };
73
73
  this.isServer = this.options.isServer ?? typeof document === "undefined";
74
- this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters ? new Map(
75
- this.options.pathParamsAllowedCharacters.map((char) => [
76
- encodeURIComponent(char),
77
- char
78
- ])
79
- ) : void 0;
74
+ if (this.options.pathParamsAllowedCharacters)
75
+ this.pathParamsDecoder = path.compileDecodeCharMap(
76
+ this.options.pathParamsAllowedCharacters
77
+ );
80
78
  if (!this.history || this.options.history && this.options.history !== this.history) {
81
79
  if (!this.options.history) {
82
80
  if (!this.isServer) {
@@ -346,7 +344,7 @@ class RouterCore {
346
344
  path.interpolatePath({
347
345
  path: nextTo,
348
346
  params: nextParams,
349
- decodeCharMap: this.pathParamsDecodeCharMap
347
+ decoder: this.pathParamsDecoder
350
348
  }).interpolatedPath
351
349
  );
352
350
  let nextSearch = fromSearch;
@@ -1099,7 +1097,7 @@ class RouterCore {
1099
1097
  const { interpolatedPath, usedParams } = path.interpolatePath({
1100
1098
  path: route.fullPath,
1101
1099
  params: routeParams,
1102
- decodeCharMap: this.pathParamsDecodeCharMap
1100
+ decoder: this.pathParamsDecoder
1103
1101
  });
1104
1102
  const matchId = (
1105
1103
  // route.id for disambiguation