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

Function normalizeBrowserOpenUrl

apps/cli/src/device-login.ts:365–372  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

363export type BrowserOpenCommand = readonly [command: string, args: ReadonlyArray<string>];
364
365const normalizeBrowserOpenUrl = (url: string): string | undefined => {
366 try {
367 const parsed = new URL(url);
368 return parsed.protocol === "http:" || parsed.protocol === "https:" ? parsed.href : undefined;
369 } catch {
370 return undefined;
371 }
372};
373
374export const browserOpenCommand = (
375 url: string,

Callers 1

browserOpenCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected