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

Function isValidHttpUrl

packages/shared/src/lib/links.ts:25–33  ·  view source on GitHub ↗
(link: string)

Source from the content-addressed store, hash-verified

23 `${process.env.NEXT_PUBLIC_WEBAPP_URL}tags/${encodeURIComponent(tag)}`;
24
25export function isValidHttpUrl(link: string): boolean {
26 try {
27 const url = new URL(link);
28
29 return url.protocol === 'http:' || url.protocol === 'https:';
30 } catch (_) {
31 return false;
32 }
33}
34
35const validSchema = ['http:', 'https:'];
36export const withHttps = (url: string): string =>

Callers 11

useMentionAutocompleteFunction · 0.90
SubmitExternalLinkFunction · 0.90
replaceEmbedsFunction · 0.90
GivebackSuggestCauseFormFunction · 0.90
ShortcutEditFormFunction · 0.90
parseUrlLineFunction · 0.90
checkMentionFunction · 0.90
onPasteFunction · 0.90
useDebouncedUrlFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected