@domql/router 2.3.109 → 2.3.110

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/index.js CHANGED
@@ -46,13 +46,15 @@ const router = (path, element, state = {}, options = defaultOptions) => {
46
46
  const [pathname, hash] = path.split("#");
47
47
  const route = getActiveRoute(pathname, options.level);
48
48
  const content = element.routes[route] || element.routes["/*"];
49
- if (content)
49
+ if (!content)
50
50
  return;
51
51
  if (options.pushState)
52
52
  import_globals.window.history.pushState(state, null, pathname + (hash ? `#${hash}` : ""));
53
53
  element.set({ tag: options.useFragment && "fragment", extend: content });
54
54
  if (options.updateState)
55
- element.state.update({ route, hash }, { preventContentUpdate: !options.stateContentUpdate });
55
+ element.state.update({ route, hash }, {
56
+ preventContentUpdate: !options.stateContentUpdate
57
+ });
56
58
  const rootNode = element.node;
57
59
  const scrollNode = options.scrollNode;
58
60
  if (options.scrollToTop) {
package/index.js CHANGED
@@ -37,11 +37,13 @@ export const router = (
37
37
  const route = getActiveRoute(pathname, options.level)
38
38
  const content = element.routes[route] || element.routes['/*']
39
39
 
40
- if (content) return
40
+ if (!content) return
41
41
  if (options.pushState) window.history.pushState(state, null, pathname + (hash ? `#${hash}` : ''))
42
42
 
43
43
  element.set({ tag: options.useFragment && 'fragment', extend: content })
44
- if (options.updateState) element.state.update({ route, hash }, { preventContentUpdate: !options.stateContentUpdate })
44
+ if (options.updateState) element.state.update({ route, hash }, {
45
+ preventContentUpdate: !options.stateContentUpdate
46
+ })
45
47
 
46
48
  const rootNode = element.node
47
49
  const scrollNode = options.scrollNode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/router",
3
- "version": "2.3.109",
3
+ "version": "2.3.110",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
@@ -25,7 +25,7 @@
25
25
  "@domql/globals": "latest",
26
26
  "@domql/utils": "latest"
27
27
  },
28
- "gitHead": "abe8666e3d77d8b287034e91756a9939cb2b6d97",
28
+ "gitHead": "7b3ccf7d24188c27067e88610f4d246070ccffd9",
29
29
  "devDependencies": {
30
30
  "@babel/core": "^7.12.0"
31
31
  }