4 lines
141 B
TypeScript
Raw Permalink Normal View History

export const isValidUrl = (url: string): boolean => {
return ['http:', 'https:', '//', 'mailto:'].some(prefix => url.startsWith(prefix))
}