Skip to content

Commit

Permalink
fixing usage in pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Aug 3, 2023
1 parent 4f48cb7 commit 42db28e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions build/utils/yarn.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func buildYarnV1DependencyMap(packageInfo *PackageInfo, responseStr string) (dep
dependenciesMap[curDependency.Name] = dependency
}

rootProject := buildYarn1Root(packageInfo, &packNameToFullName)
rootProject := buildYarn1Root(packageInfo, packNameToFullName)
root = &rootProject
dependenciesMap[root.Value] = root
return
Expand Down Expand Up @@ -272,7 +272,7 @@ func GetYarnDependencyKeyFromLocator(yarnDepLocator string) string {
}

// buildYarn1Root builds the root of the project's dependency tree (from direct dependencies in package.json)
func buildYarn1Root(packageInfo *PackageInfo, packNameToFullName *map[string]string) YarnDependency {
func buildYarn1Root(packageInfo *PackageInfo, packNameToFullName map[string]string) YarnDependency {
rootDependency := YarnDependency{
Value: packageInfo.Name,
Details: YarnDepDetails{Version: packageInfo.Version},
Expand All @@ -284,7 +284,7 @@ func buildYarn1Root(packageInfo *PackageInfo, packNameToFullName *map[string]str
rootDeps = append(rootDeps, maps.Keys(packageInfo.OptionalDependencies)...)

for _, directDepName := range rootDeps {
rootDependency.Details.Dependencies = append(rootDependency.Details.Dependencies, YarnDependencyPointer{Locator: (*packNameToFullName)[directDepName]})
rootDependency.Details.Dependencies = append(rootDependency.Details.Dependencies, YarnDependencyPointer{Locator: packNameToFullName[directDepName]})
}
return rootDependency
}
Expand Down
2 changes: 1 addition & 1 deletion build/utils/yarn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func checkGetYarnDependencies(t *testing.T, versionDir string, expectedLocators
assert.Nil(t, depInfo.Details.Dependencies)
case "loose-envify":
assert.NotNil(t, depInfo.Details.Dependencies)
assert.Equal(t, len(depInfo.Details.Dependencies), 1)
assert.Len(t, depInfo.Details.Dependencies, 1)
case "js-tokens":
assert.Nil(t, depInfo.Details.Dependencies)
case root.Value:
Expand Down

0 comments on commit 42db28e

Please sign in to comment.