diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-25 21:17:11 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-25 21:17:11 -0500 |
commit | 7b6948e6171b448e271f0564efd1f186ccadb9b8 (patch) | |
tree | e0d1b6e9f9c863cbff53f8832fd55d03cb670a83 /src/lib/strings/url-helpers.ts | |
parent | 15c1b6ee157471807a723161066ba4ce5e12c0b5 (diff) | |
parent | e832352e9844002408b45291396a3c495be23276 (diff) | |
download | voidsky-7b6948e6171b448e271f0564efd1f186ccadb9b8.tar.zst |
Merge branch 'custom-algos' into main
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 { |