Skip to content

Commit

Permalink
fix regex for reading org in package spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmistman committed Oct 10, 2023
1 parent 3b910ad commit 22f1a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/backends/nodejs/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ var NodejsYarnBackend = api.LanguageBackend{
util.Die("yarn.lock: %s", err)
}
contents := string(contentsB)
r := regexp.MustCompile(`(?m)^"?([^@ \n]+).+:\n version "(.+)"$`)
r := regexp.MustCompile(`(?m)^"?((?:@[^@ \n]+\/)?[^@ \n]+).+:\n version "(.+)"$`)
pkgs := map[api.PkgName]api.PkgVersion{}
for _, match := range r.FindAllStringSubmatch(contents, -1) {
name := api.PkgName(match[1])
Expand Down

0 comments on commit 22f1a83

Please sign in to comment.