diff --git a/tp-router.js b/tp-router.js index 1f06db8..bb978b9 100644 --- a/tp-router.js +++ b/tp-router.js @@ -183,9 +183,13 @@ export class TpRouter extends LitElement { this.routes[namespace] = {}; } + const keys = []; + const r = pathToRegexp(path, keys); + r.keys = keys; + this.routes[namespace][path] = { path: path, - regex: pathToRegexp(path), + regex: r, data: data, redirect: redirect, params: {}