Browse Source

Force empty object in case of no parameter match

Shaun 2 years ago
parent
commit
52971aac92
2 changed files with 2 additions and 2 deletions
  1. 1 1
      package.json
  2. 1 1
      src/index.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "@shaun/alpinejs-router",
   "name": "@shaun/alpinejs-router",
-  "version": "1.2.9",
+  "version": "1.2.10",
   "description": "Easy to use and flexible router for Alpine.js",
   "description": "Easy to use and flexible router for Alpine.js",
   "type": "module",
   "type": "module",
   "main": "dist/module.cjs.js",
   "main": "dist/module.cjs.js",

+ 1 - 1
src/index.js

@@ -22,7 +22,7 @@ export default function (Alpine) {
       return state.query
       return state.query
     },
     },
     get params () {
     get params () {
-      return state.params
+      return state.params || {}
     },
     },
     get loading () {
     get loading () {
       return state.loading
       return state.loading