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

Function normalizeBrowserOpenUrl

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

Source from the content-addressed store, hash-verified

314export type BrowserOpenCommand = readonly [command: string, args: ReadonlyArray<string>];
315
316const normalizeBrowserOpenUrl = (url: string): string | undefined => {
317 try {
318 const parsed = new URL(url);
319 return parsed.protocol === "http:" || parsed.protocol === "https:" ? parsed.href : undefined;
320 } catch {
321 return undefined;
322 }
323};
324
325export const browserOpenCommand = (
326 url: string,

Callers 1

browserOpenCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected