mirror of
https://github.com/zhigang1992/npm.git
synced 2026-04-28 12:05:32 +08:00
If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project. Fixes #3570
14 lines
230 B
JavaScript
14 lines
230 B
JavaScript
module.exports = isGitUrl
|
|
|
|
function isGitUrl (url) {
|
|
switch (url.protocol) {
|
|
case "git:":
|
|
case "git+http:":
|
|
case "git+https:":
|
|
case "git+rsync:":
|
|
case "git+ftp:":
|
|
case "git+ssh:":
|
|
return true
|
|
}
|
|
}
|