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

Function maybeUrl

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

Source from the content-addressed store, hash-verified

424 typeof value === "object" && value !== null && !Array.isArray(value);
425
426const maybeUrl = (value: string): URL | null => {
427 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL parsing accepts user-pasted spec/base URLs
428 try {
429 return new URL(value);
430 } catch {
431 return null;
432 }
433};
434
435const addProbeCandidate = (candidates: string[], value: string | undefined): void => {
436 const trimmed = value?.trim();

Callers 2

addProbeCandidateFunction · 0.85
plugin.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected