(input: string)
| 1 | export 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 | |
| 22 | export function isWebUrl(input: string): boolean { |
| 23 | const scheme = input.trim().split(':')[0]?.toLowerCase(); |
no test coverage detected