Skip to content

Commit

Permalink
fixed some names
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Jul 30, 2023
1 parent 2632c2d commit 76ec948
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build/utils/yarn.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ func buildYarnV1DependencyMap(packageInfo *PackageInfo, responseStr string) (dep
for _, curDependency := range depTree.Data.DepTree {
var dependency YarnDependency
dependency.Value = curDependency.Name
version := curDependency.Name[strings.Index(curDependency.Name[1:], "@")+2:] // TODO make sure the +2 is ok, suppose to cover a package that starts with @
packageVersion := curDependency.Name[strings.Index(curDependency.Name[1:], "@")+2:] // TODO make sure the +2 is ok, suppose to cover a package that starts with @
packageCleanName := curDependency.Name[:strings.Index(curDependency.Name[1:], "@")+1]
locatorsMap[packageCleanName] = curDependency.Name

dependency.Details = YarnDepDetails{version, nil}
dependency.Details = YarnDepDetails{packageVersion, nil}
for _, subDep := range curDependency.Dependencies {
dependency.Details.Dependencies = append(dependency.Details.Dependencies, YarnDependencyPointer{subDep.DependencyName, ""})
subDependency := &(dependency.Details.Dependencies[len(dependency.Details.Dependencies)-1])
Expand Down Expand Up @@ -261,8 +261,7 @@ func GetYarnDependencyKeyFromLocator(yarnDepLocator string) string {
func buildYarn1Root(packageInfo *PackageInfo, locatorsMap *map[string]string) (root *YarnDependency) {
var rootDependency YarnDependency
rootDependency.Value = packageInfo.Name
version := packageInfo.Version
rootDependency.Details = YarnDepDetails{version, nil}
rootDependency.Details = YarnDepDetails{packageInfo.Version, nil}
for directDepName := range packageInfo.Dependencies {
rootDependency.Details.Dependencies = append(rootDependency.Details.Dependencies, YarnDependencyPointer{"", (*locatorsMap)[directDepName]})
}
Expand Down

0 comments on commit 76ec948

Please sign in to comment.