Skip to content

Instantly share code, notes, and snippets.

@nguyentuan1696
Created November 26, 2021 05:18
Check is external url
export function hasProtocol(url) {
return /^(\w*:|\/\/)/.test(url) === true
}
export default function isInternalUrl(url) {
return typeof url !== 'undefined' && !hasProtocol(url)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment