node/deps/npm/node_modules/github-url-from-username-repo/index.js
2014-07-31 09:05:30 -07:00

10 lines
167 B
JavaScript

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