Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
729 B · 29 lines
TypeScript
123456789101112131415161718192021222324252627282930export interface ProviderDetails { ownerSubject: string; installationId: string; accountId: string; runtimeOrigin: string;}
export function trustedRuntime(value: string) { try { const url = new URL(value); const localDevelopment = typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1"); return ( !url.username && !url.password && url.pathname === "/" && !url.search && !url.hash && (url.protocol === "https:" || (url.protocol === "http:" && localDevelopment && ["localhost", "127.0.0.1"].includes(url.hostname))) ); } catch { return false; }}