Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
npm: remove further version ranges from reporting (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoops authored Oct 3, 2021
1 parent 11a51fb commit 80cefbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 46 deletions.
46 changes: 0 additions & 46 deletions deplist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,108 +50,62 @@ func BuildWant() []Dependency {
"loose-envify",
"iconv-lite",
"d3-brush",
"d3-polygon",
"d3-zoom",
"d3-path",
"d3-chord",
"rw",
"d3-ease",
"object-assign",
"rw",
"d3-scale-chromatic",
"d3-brush",
"d3-hierarchy",
"commander",
"d3-time",
"d3-time-format",
"d3-dsv",
"d3-scale",
"is-plain-object",
"d3-quadtree",
"tiny-warning",
"d3-hierarchy",
"d3-dsv",
"d3-timer",
"d3-scale-chromatic",
"d3-time-format",
"d3-axis",
"d3-timer",
"d3-ease",
"d3-color",
"prismjs",
"d3-force",
"iconv-lite",
"angular",
"d3-delaunay",
"rxjs",
"d3-zoom",
"d3-scale",
"d3-interpolate",
"d3-path",
"d3-array",
"d3-time",
"js-tokens",
"d3-format",
"d3-contour",
"d3-geo",
"safer-buffer",
"react-is",
"d3-format",
"d3-interpolate",
"d3-dispatch",
"d3-force",
"d3-color",
"d3-transition",
"prop-types",
"tiny-emitter",
"d3-polygon",
"d3-chord",
"d3-fetch",
"d3-dispatch",
"d3-contour",
"tslib",
"good-listener",
"d3",
"d3-axis",
"d3-ease",
"delegate",
"d3-drag",
"delaunator",
"commander",
"d3-color",
"delaunator",
"d3-timer",
"d3-drag",
"d3-geo",
"slate",
"d3-interpolate",
"d3-random",
"select",
"esrever",
"d3-transition",
"clipboard",
"d3-dispatch",
"d3-format",
"d3-path",
"d3-array",
"d3-random",
"d3-fetch",
"d3-quadtree",
"d3-shape",
"d3-delaunay",
"d3-time",
"d3-shape",
"immer",
"@types/esrever",
"d3-time-format",
"d3-selection",
"d3-quadtree",
"d3-selection",
"react",
"tether",
"d3-interpolate",
"d3-dsv",
"d3-array",
}

rubySet := []string{
Expand Down
12 changes: 12 additions & 0 deletions internal/scan/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 80cefbf

Please sign in to comment.