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

Function looksLikeUrl

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

Source from the content-addressed store, hash-verified

144// search query (filter the preset list). Anything with a scheme, slash, or
145// host-with-TLD is treated as a URL; everything else is search.
146const looksLikeUrl = (raw: string): boolean => {
147 const v = raw.trim();
148 if (v.length === 0) return false;
149 if (/^[a-z][a-z0-9+\-.]*:\/\//i.test(v)) return true;
150 if (v.includes("/")) return true;
151 if (/^[a-z0-9][a-z0-9.-]*\.[a-z]{2,}(?::\d+)?$/i.test(v)) return true;
152 return false;
153};
154
155function ConnectDialog(props: { open: boolean; onOpenChange: (open: boolean) => void }) {
156 const integrationPlugins = useIntegrationPlugins();

Callers 1

ConnectDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected