mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
improved component composition and added tests.
This commit is contained in:
@@ -56,7 +56,12 @@ function matchPattern(pattern: string, path: string): Record<string, string> | n
|
||||
if (prefixed) {
|
||||
const [, prefix, name] = prefixed
|
||||
if (prefix && !actual.startsWith(prefix)) return null
|
||||
const value = decodeURIComponent(actual.slice(prefix.length))
|
||||
let value: string
|
||||
try {
|
||||
value = decodeURIComponent(actual.slice(prefix.length))
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
if (!value) return null
|
||||
params[name.slice(1)] = value
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user