You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

12 lines
245 B

module.exports = getUrl
function getUrl (r, forBrowser) {
if (!r) return null
if (/^[\w-]+\/[\w\.-]+(#[a-z0-9]*)?$/.test(r)) {
if (forBrowser)
r = r.replace("#", "/tree/")
return "https://github.com/" + r
}
return null
}