3 lines (2 sloc) 138 Bytes
export const isURL = (value: any): value is URL =>
!!value && typeof value.toString === 'function' && value.href === value.toString()