@tinkoff/router 0.1.75 → 0.1.76

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.
@@ -366,7 +366,9 @@ class AbstractRouter {
366
366
  pathname = makePath(currentRoute.path, { ...currentRoute.params, ...params });
367
367
  }
368
368
  }
369
- pathname = this.normalizePathname(pathname);
369
+ if (isSameHost(resultUrl)) {
370
+ pathname = this.normalizePathname(pathname);
371
+ }
370
372
  return convertRawUrl(rawAssignUrl(resultUrl, {
371
373
  pathname,
372
374
  search: url ? resultUrl.search : '',
@@ -556,7 +558,7 @@ const wrapHistory = ({ onNavigate }) => {
556
558
  const history = (delta) => {
557
559
  go(delta);
558
560
  };
559
- const browserNavigate = (replace) => {
561
+ const browserNavigate = (replace = false) => {
560
562
  return (navigateState, title, url) => {
561
563
  onNavigate({ url, replace, navigateState });
562
564
  };
package/lib/index.es.js CHANGED
@@ -366,7 +366,9 @@ class AbstractRouter {
366
366
  pathname = makePath(currentRoute.path, { ...currentRoute.params, ...params });
367
367
  }
368
368
  }
369
- pathname = this.normalizePathname(pathname);
369
+ if (isSameHost(resultUrl)) {
370
+ pathname = this.normalizePathname(pathname);
371
+ }
370
372
  return convertRawUrl(rawAssignUrl(resultUrl, {
371
373
  pathname,
372
374
  search: url ? resultUrl.search : '',
@@ -786,7 +788,7 @@ const wrapHistory = ({ onNavigate }) => {
786
788
  const history = (delta) => {
787
789
  go(delta);
788
790
  };
789
- const browserNavigate = (replace) => {
791
+ const browserNavigate = (replace = false) => {
790
792
  return (navigateState, title, url) => {
791
793
  onNavigate({ url, replace, navigateState });
792
794
  };
package/lib/index.js CHANGED
@@ -381,7 +381,9 @@ class AbstractRouter {
381
381
  pathname = makePath(currentRoute.path, { ...currentRoute.params, ...params });
382
382
  }
383
383
  }
384
- pathname = this.normalizePathname(pathname);
384
+ if (isSameHost(resultUrl)) {
385
+ pathname = this.normalizePathname(pathname);
386
+ }
385
387
  return url.convertRawUrl(url.rawAssignUrl(resultUrl, {
386
388
  pathname,
387
389
  search: url$1 ? resultUrl.search : '',
@@ -801,7 +803,7 @@ const wrapHistory = ({ onNavigate }) => {
801
803
  const history = (delta) => {
802
804
  go(delta);
803
805
  };
804
- const browserNavigate = (replace) => {
806
+ const browserNavigate = (replace = false) => {
805
807
  return (navigateState, title, url) => {
806
808
  onNavigate({ url, replace, navigateState });
807
809
  };
package/lib/utils.d.ts CHANGED
@@ -3,6 +3,6 @@ import type { NavigateOptions, NavigationHook, NavigationSyncHook, NavigationGua
3
3
  export declare const isFilePath: (pathname: string) => boolean;
4
4
  export declare const normalizeTrailingSlash: (pathname: string, trailingSlash?: boolean) => string;
5
5
  export declare const normalizeManySlashes: (hrefOrPath: string) => string;
6
- export declare const isSameHost: import("@tinkoff/utils/typings/types").Func<true> | ((url: Url) => boolean);
6
+ export declare const isSameHost: import("@tinkoff/utils/typings/types").Func<true> | ((url: Url | URL) => boolean);
7
7
  export declare const makeNavigateOptions: (options: string | NavigateOptions) => NavigateOptions;
8
8
  export declare const registerHook: <T extends NavigationHook | NavigationSyncHook | NavigationGuard>(hooksSet: Set<T>, hook: T) => () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkoff/router",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "description": "router",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",