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-18 16:22:11 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-05-18 16:22:11 -0500
commit1ecf0da81b6e5eaf7959e1416df1e8f004e2566f (patch)
treeeeb039b8671e0a693961613c595202b97c56ea99 /src/lib/strings/url-helpers.ts
parent84990c509e9feb0cd44921a318aedcbad92b1da7 (diff)
downloadvoidsky-1ecf0da81b6e5eaf7959e1416df1e8f004e2566f.tar.zst
Add feed sharing
Diffstat (limited to 'src/lib/strings/url-helpers.ts')
-rw-r--r--src/lib/strings/url-helpers.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts
index a5412920e..d6d43b89d 100644
--- a/src/lib/strings/url-helpers.ts
+++ b/src/lib/strings/url-helpers.ts
@@ -82,6 +82,18 @@ export function isBskyPostUrl(url: string): boolean {
   return false
 }
 
+export function isBskyCustomFeedUrl(url: string): boolean {
+  if (isBskyAppUrl(url)) {
+    try {
+      const urlp = new URL(url)
+      return /profile\/(?<name>[^/]+)\/feed\/(?<rkey>[^/]+)/i.test(
+        urlp.pathname,
+      )
+    } catch {}
+  }
+  return false
+}
+
 export function convertBskyAppUrlIfNeeded(url: string): string {
   if (isBskyAppUrl(url)) {
     try {