node/deps/npm/node_modules/github-url-from-username-repo/index.js

9 lines
157 B
JavaScript

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