Explorar o código

Force empty object in case of no parameter match

Shaun %!s(int64=2) %!d(string=hai) anos
pai
achega
52971aac92
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      package.json
  2. 1 1
      src/index.js

+ 1 - 1
package.json

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

+ 1 - 1
src/index.js

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