Ver código fonte

in case tpl has no file

Shaun 1 ano atrás
pai
commit
ff611de56b
2 arquivos alterados com 3 adições e 1 exclusões
  1. 1 1
      package.json
  2. 2 0
      src/url.js

+ 1 - 1
package.json

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

+ 2 - 0
src/url.js

@@ -39,6 +39,8 @@ export class RouterURL {
   }
 
   static resolveTemplatePath (pathname, tpl) {
+    if (!tpl) return tpl
+
     if (tpl.startsWith('/')) {
       return tpl
     }