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

Function addProbeCandidate

packages/plugins/openapi/src/sdk/plugin.ts:468–477  ·  view source on GitHub ↗
(candidates: string[], value: string | undefined)

Source from the content-addressed store, hash-verified

466};
467
468const addProbeCandidate = (candidates: string[], value: string | undefined): void => {
469 const trimmed = value?.trim();
470 if (!trimmed) return;
471 const parsed = maybeUrl(trimmed);
472 if (!parsed || (parsed.protocol !== "https:" && parsed.protocol !== "http:")) return;
473 const normalized = parsed.toString();
474 const origin = parsed.origin;
475 if (!candidates.includes(normalized)) candidates.push(normalized);
476 if (!candidates.includes(origin)) candidates.push(origin);
477};
478
479const oauthProbeCandidates = (
480 preview: SpecPreview,

Callers 1

oauthProbeCandidatesFunction · 0.85

Calls 3

maybeUrlFunction · 0.85
toStringMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected