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

Function looksLikeUrl

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

Source from the content-addressed store, hash-verified

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

Callers 1

ConnectDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected