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

Function maybeUrl

packages/plugins/openapi/src/sdk/plugin.ts:459–466  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

457 typeof value === "object" && value !== null && !Array.isArray(value);
458
459const maybeUrl = (value: string): URL | null => {
460 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL parsing accepts user-pasted spec/base URLs
461 try {
462 return new URL(value);
463 } catch {
464 return null;
465 }
466};
467
468const addProbeCandidate = (candidates: string[], value: string | undefined): void => {
469 const trimmed = value?.trim();

Callers 2

addProbeCandidateFunction · 0.85
plugin.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected