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

10 lines
165 B
JavaScript

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