summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/github-url-from-username-repo/index.js
blob: 60ed7aa4e4ec522ea491e06555af07e8c6ddb548 (plain)
1
2
3
4
5
6
7
8
9
module.exports = getUrl

function getUrl (r) {
  if (!r) return null
  if (/^[\w-]+\/[\w\.-]+$/.test(r))
    return "https://github.com/" + r
  else
    return null
}