about summary refs log tree commit diff
path: root/src/lib/routes/router.ts
diff options
context:
space:
mode:
authorJan-Olof Eriksson <jan-olof.eriksson@iki.fi>2024-03-11 14:52:33 +0200
committerGitHub <noreply@github.com>2024-03-11 14:52:33 +0200
commit4a2251f48bd51d8bd427d21f0dd697c8d43d7856 (patch)
tree17b7d68f0a19f54313607257de79accc7b6daf4c /src/lib/routes/router.ts
parentcbc65247ae57502356165a5d51270bd8d19fd9a5 (diff)
parent596e744d4177d3be6defeef68f202a70baaf6e37 (diff)
downloadvoidsky-4a2251f48bd51d8bd427d21f0dd697c8d43d7856.tar.zst
Merge branch 'bluesky-social:main' into main
Diffstat (limited to 'src/lib/routes/router.ts')
-rw-r--r--src/lib/routes/router.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/routes/router.ts b/src/lib/routes/router.ts
index 00defaeda..8c8be3739 100644
--- a/src/lib/routes/router.ts
+++ b/src/lib/routes/router.ts
@@ -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)])
+        })
+      }
     }
   }