router-dom
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -8,2 +8,3 @@ import { listen } from "quicklink"; | ||
const reactivityRegex = /\{\{([^]*?)\}\}/; | ||
const flagsRegex = /:\w+/g; | ||
const base = $("base")?.getAttribute("href") || ""; | ||
@@ -16,4 +17,5 @@ addEventListener("popstate", async () => { | ||
const [_, ...values] = to.match(route.path); | ||
const params = Array.from(route.originalPath.matchAll(/(?<=:)\w+/g)) | ||
const params = Array.from(route.originalPath.matchAll(flagsRegex)) | ||
.flat() | ||
.map((i) => i.replace(":", "")) | ||
.reduce((state, key, idx) => { | ||
@@ -20,0 +22,0 @@ state[key] = values[idx]; |
{ | ||
"name": "router-dom", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "A lightweight router for everyone", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -10,2 +10,3 @@ import { listen } from "quicklink"; | ||
const reactivityRegex = /\{\{([^]*?)\}\}/; | ||
const flagsRegex = /:\w+/g; | ||
const base = $("base")?.getAttribute("href") || ""; | ||
@@ -21,4 +22,5 @@ | ||
const [_, ...values] = to.match(route.path); | ||
const params = Array.from(route.originalPath.matchAll(/(?<=:)\w+/g)) | ||
const params = Array.from(route.originalPath.matchAll(flagsRegex)) | ||
.flat() | ||
.map((i) => i.replace(":", "")) | ||
.reduce((state: LooseObject, key, idx) => { | ||
@@ -25,0 +27,0 @@ state[key] = values[idx]; |
18813
415