MCPcopy Create free account
hub / github.com/dailydotdev/apps / parseFrameTarget

Function parseFrameTarget

packages/extension/src/frame/target.ts:8–20  ·  view source on GitHub ↗
(rawTarget: string)

Source from the content-addressed store, hash-verified

6 ['http:', 'https:'].includes(url.protocol);
7
8export const parseFrameTarget = (rawTarget: string): ParsedFrameTarget => {
9 try {
10 const target = new URL(rawTarget);
11
12 if (!isEmbeddableProtocol(target)) {
13 return { ok: false, reason: 'unsupported-target-protocol' };
14 }
15
16 return { ok: true, target };
17 } catch {
18 return { ok: false, reason: 'invalid-target' };
19 }
20};

Callers 1

index.tsFile · 0.90

Calls 1

isEmbeddableProtocolFunction · 0.85

Tested by

no test coverage detected