about summary refs log tree commit diff
path: root/src/lib/strings/url-helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/strings/url-helpers.ts')
-rw-r--r--src/lib/strings/url-helpers.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts
index b509aad01..671dc9781 100644
--- a/src/lib/strings/url-helpers.ts
+++ b/src/lib/strings/url-helpers.ts
@@ -129,6 +129,15 @@ export function listUriToHref(url: string): string {
   }
 }
 
+export function feedUriToHref(url: string): string {
+  try {
+    const {hostname, rkey} = new AtUri(url)
+    return `/profile/${hostname}/feed/${rkey}`
+  } catch {
+    return ''
+  }
+}
+
 export function getYoutubeVideoId(link: string): string | undefined {
   let url
   try {