Fix RSS URLs treated as internal (#3156)
* Fix RSS URLs treated as internal * Add utils to patch relative RSS external links * modify router to support multiple paths --------- Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
parent
aad8c080ed
commit
594958c6dc
4 changed files with 40 additions and 5 deletions
|
@ -2,9 +2,15 @@ import {RouteParams, Route} from './types'
|
|||
|
||||
export class Router {
|
||||
routes: [string, Route][] = []
|
||||
constructor(description: Record<string, string>) {
|
||||
constructor(description: Record<string, string | string[]>) {
|
||||
for (const [screen, pattern] of Object.entries(description)) {
|
||||
this.routes.push([screen, createRoute(pattern)])
|
||||
if (typeof pattern === 'string') {
|
||||
this.routes.push([screen, createRoute(pattern)])
|
||||
} else {
|
||||
pattern.forEach(subPattern => {
|
||||
this.routes.push([screen, createRoute(subPattern)])
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue