MCPcopy Create free account
hub / github.com/dailydotdev/apps / getRedirectPostId

Function getRedirectPostId

packages/shared/src/components/shell/readingStore.ts:104–109  ·  view source on GitHub ↗
(anchor: HTMLAnchorElement)

Source from the content-addressed store, hash-verified

102// The post behind a redirect link (`api.daily.dev/r/<id>`): the redirect only
103// counts the read when it can tell who is reading.
104export const getRedirectPostId = (anchor: HTMLAnchorElement): string | null => {
105 if (!publicApiUrl || anchor.host !== new URL(publicApiUrl).host) {
106 return null;
107 }
108 return anchor.pathname.match(/^\/r\/([^/]+)\/?$/)?.[1] ?? null;
109};
110
111const shareIntents =
112 /^(?:[a-z0-9-]+\.)?(?:twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|wa\.me|whatsapp\.com|t\.me|telegram\.me)$/;

Callers 1

onClickFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected