MCPcopy Index your code
hub / github.com/callstack/agent-device / isDeepLinkTarget

Function isDeepLinkTarget

src/core/open-target.ts:1–20  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

1export function isDeepLinkTarget(input: string): boolean {
2 const value = input.trim();
3 if (!value) return false;
4 if (/\s/.test(value)) return false;
5 const match = /^([A-Za-z][A-Za-z0-9+.-]*):(.+)$/.exec(value);
6 if (!match) return false;
7 const scheme = match[1]?.toLowerCase();
8 const rest = match[2] ?? '';
9 if (
10 scheme === 'http' ||
11 scheme === 'https' ||
12 scheme === 'ws' ||
13 scheme === 'wss' ||
14 scheme === 'ftp' ||
15 scheme === 'ftps'
16 ) {
17 return rest.startsWith('//');
18 }
19 return true;
20}
21
22export function isWebUrl(input: string): boolean {
23 const scheme = input.trim().split(':')[0]?.toLowerCase();

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected