This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
npm: remove further version ranges from reporting (#46)
- Loading branch information
Showing
2 changed files
with
12 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,13 +47,25 @@ func recordPackage(packageName, version string) { | |
// opposite now, we don't care if its specifying version ranges like 5.x.x, | ||
// or 5.* etc. Just get the versions. | ||
if len(version) > 0 { | ||
// skip if it's specifying the major | ||
// i.e. d3-path@2 only care about [email protected] | ||
if len(version) == 1 { | ||
return | ||
} | ||
|
||
// if not digit, then range | ||
if !utils.CharIsDigit(version) { | ||
return | ||
} | ||
|
||
if version[len(version)-1] == 'x' { | ||
return | ||
} | ||
|
||
// still a version range | ||
if strings.Contains(version, " - ") || strings.Contains(version, "||") { | ||
return | ||
} | ||
} | ||
|
||
if _, ok := gatheredNode[packageName+version]; !ok { | ||
|