MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / looksLikeUrl

Function looksLikeUrl

packages/react/src/pages/integrations.tsx:157–164  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

155// search query (filter the preset list). Anything with a scheme, slash, or
156// host-with-TLD is treated as a URL; everything else is search.
157const looksLikeUrl = (raw: string): boolean => {
158 const v = raw.trim();
159 if (v.length === 0) return false;
160 if (/^[a-z][a-z0-9+\-.]*:\/\//i.test(v)) return true;
161 if (v.includes("/")) return true;
162 if (/^[a-z0-9][a-z0-9.-]*\.[a-z]{2,}(?::\d+)?$/i.test(v)) return true;
163 return false;
164};
165
166export function ConnectDialog(props: { open: boolean; onOpenChange: (open: boolean) => void }) {
167 const integrationPlugins = useIntegrationPlugins();

Callers 1

ConnectDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected