buildNodePackage: fix issue with impure version handling (#30577)

This commit is contained in:
b123400 2017-10-22 23:45:16 +09:00 committed by Robin Gloster
parent 97c5dfc55e
commit 2cc79e95f8

View file

@ -145,7 +145,7 @@ let
function replaceImpureVersionSpec(versionSpec) {
var parsedUrl = url.parse(versionSpec);
if(versionSpec == "latest" || versionSpec == "unstable" ||
if(versionSpec == "" || versionSpec == "latest" || versionSpec == "unstable" ||
versionSpec.substr(0, 2) == ".." || dependency.substr(0, 2) == "./" || dependency.substr(0, 2) == "~/" || dependency.substr(0, 1) == '/' || /^[^/]+\/[^/]+$/.test(versionSpec))
return '*';
else if(parsedUrl.protocol == "git:" || parsedUrl.protocol == "git+ssh:" || parsedUrl.protocol == "git+http:" || parsedUrl.protocol == "git+https:" ||