Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixq committed Jan 23, 2025
1 parent 4bca3e2 commit cfdfd4b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func groupYarnPackageDescriptions(ctx context.Context, scanner *bufio.Scanner) (
func extractYarnPackageName(header string) string {
// Header format: @my-scope/my-first-package@my-scope/my-first-package#commit=hash
str := strings.TrimPrefix(header, "\"")
str = strings.TrimSuffix(str, ":")
str, _, _ = strings.Cut(str, ",")

isScoped := strings.HasPrefix(str, "@")
Expand Down Expand Up @@ -160,7 +161,7 @@ func determineYarnPackageResolution(props []string) string {
}

func parseYarnPackageGroup(desc *packageDescription) *extractor.Inventory {
name := extractYarnPackageName(strings.TrimSuffix(desc.header, ":"))
name := extractYarnPackageName(desc.header)
version := determineYarnPackageVersion(desc.props)
resolution := determineYarnPackageResolution(desc.props)

Expand Down

0 comments on commit cfdfd4b

Please sign in to comment.