about summary refs log tree commit diff
path: root/src/lib/strings/url-helpers.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
commit7aa1d9010e26da14a843efab0389386144cc978a (patch)
tree31ac7916fd7e1045bce0a078d67cc1164cc2e42f /src/lib/strings/url-helpers.ts
parent52c72d65326c2df6ada7547103c18ed41b51ebda (diff)
parent0ca096138a690f036828c49f9e95cf394b1a4339 (diff)
downloadvoidsky-7aa1d9010e26da14a843efab0389386144cc978a.tar.zst
Merge branch 'main' into custom-algos
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 549587f74..a5412920e 100644
--- a/src/lib/strings/url-helpers.ts
+++ b/src/lib/strings/url-helpers.ts
@@ -94,6 +94,15 @@ export function convertBskyAppUrlIfNeeded(url: string): string {
   return url
 }
 
+export function listUriToHref(url: string): string {
+  try {
+    const {hostname, rkey} = new AtUri(url)
+    return `/profile/${hostname}/lists/${rkey}`
+  } catch {
+    return ''
+  }
+}
+
 export function getYoutubeVideoId(link: string): string | undefined {
   let url
   try {