MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / isSameDomain

Function isSameDomain

packages/common/src/url.ts:51–63  ·  view source on GitHub ↗
(
  url1: string | undefined,
  url2: string | undefined,
)

Source from the content-addressed store, hash-verified

49}
50
51export function isSameDomain(
52 url1: string | undefined,
53 url2: string | undefined,
54) {
55 if (!url1 || !url2) {
56 return false;
57 }
58 try {
59 return new URL(url1).hostname === new URL(url2).hostname;
60 } catch (e) {
61 return false;
62 }
63}

Callers 4

transformEventMethod · 0.90
transformEventMethod · 0.90
transformEventMethod · 0.90
incomingEventFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected