Files
splitt-the-bill/shared/utils/paymentLink.ts
T
2026-07-01 15:43:18 +02:00

12 lines
237 B
TypeScript

export function isValidPaymentLink(value: string): boolean {
if (!value.trim()) return false
try {
const url = new URL(value)
return url.protocol === 'https:' || url.protocol === 'http:'
}
catch {
return false
}
}