@viewfly/router 0.3.3 → 0.4.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.
@@ -42,11 +42,8 @@ class Navigator {
42
42
  }
43
43
  function formatUrl(pathname, urlFormatParams) {
44
44
  pathname = pathname.replace(/\/+/g, '/');
45
- if (urlFormatParams) {
46
- const { queryParams, fragment } = urlFormatParams;
47
- return pathname + (queryParams ? '?' + formatQueryParams(queryParams) : '') + (fragment ? '#' + fragment : '');
48
- }
49
- return pathname;
45
+ const { queryParams, fragment } = urlFormatParams;
46
+ return pathname + (queryParams ? '?' + formatQueryParams(queryParams) : '') + (fragment ? '#' + fragment : '');
50
47
  }
51
48
  function formatQueryParams(queryParams) {
52
49
  const params = [];
package/bundles/index.js CHANGED
@@ -44,11 +44,8 @@ class Navigator {
44
44
  }
45
45
  function formatUrl(pathname, urlFormatParams) {
46
46
  pathname = pathname.replace(/\/+/g, '/');
47
- if (urlFormatParams) {
48
- const { queryParams, fragment } = urlFormatParams;
49
- return pathname + (queryParams ? '?' + formatQueryParams(queryParams) : '') + (fragment ? '#' + fragment : '');
50
- }
51
- return pathname;
47
+ const { queryParams, fragment } = urlFormatParams;
48
+ return pathname + (queryParams ? '?' + formatQueryParams(queryParams) : '') + (fragment ? '#' + fragment : '');
52
49
  }
53
50
  function formatQueryParams(queryParams) {
54
51
  const params = [];
@@ -20,7 +20,7 @@ export interface UrlFormatParams {
20
20
  queryParams?: QueryParams;
21
21
  fragment?: string;
22
22
  }
23
- export declare function formatUrl(pathname: string, urlFormatParams?: UrlFormatParams): string;
23
+ export declare function formatUrl(pathname: string, urlFormatParams: UrlFormatParams): string;
24
24
  export declare function formatQueryParams(queryParams: QueryParams): string;
25
25
  export declare class BrowserNavigator extends Navigator {
26
26
  onUrlChanged: Observable<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/router",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -13,7 +13,7 @@
13
13
  "keywords": [],
14
14
  "dependencies": {
15
15
  "@tanbo/stream": "^1.2.3",
16
- "@viewfly/core": "^0.3.1",
16
+ "@viewfly/core": "^0.4.0",
17
17
  "url": "^0.11.1"
18
18
  },
19
19
  "devDependencies": {
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/viewfly/viewfly.git/issues"
36
36
  },
37
- "gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
37
+ "gitHead": "d14b3cd0247a07f72519745933c3070f12adbfa1"
38
38
  }