UNPKG

javascript-barcode-reader

Version:

Simple & Fast Barcode decoder for Browser and Node.js

8 lines (5 loc) 210 B
export function isUrl(s: string): boolean { const regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/ if (s.startsWith('#')) return false return regexp.test(s) }