diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-18 16:22:11 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-18 16:22:11 -0500 |
commit | 1ecf0da81b6e5eaf7959e1416df1e8f004e2566f (patch) | |
tree | eeb039b8671e0a693961613c595202b97c56ea99 /src/lib/strings/url-helpers.ts | |
parent | 84990c509e9feb0cd44921a318aedcbad92b1da7 (diff) | |
download | voidsky-1ecf0da81b6e5eaf7959e1416df1e8f004e2566f.tar.zst |
Add feed sharing
Diffstat (limited to 'src/lib/strings/url-helpers.ts')
-rw-r--r-- | src/lib/strings/url-helpers.ts | 12 |
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 { |