Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: delete package.js resolutions #261

Merged
merged 1 commit into from
Jan 10, 2024
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion opensca/sca/javascript/npm.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,8 @@ type PackageJson struct {
Name string `json:"name"`
Version string `json:"version"`
// License string `json:"license"`
Develop bool `json:"dev"` // lock v3
Develop bool `json:"dev"` // lock v3
// TODO 只有依赖冲突时才会使用
Resolutions map[string]string `json:"resolutions"`
Dependencies map[string]string `json:"dependencies"`
DevDependencies map[string]string `json:"devDependencies"`
5 changes: 0 additions & 5 deletions opensca/sca/javascript/sca.go
Original file line number Diff line number Diff line change
@@ -58,11 +58,6 @@ func (sca Sca) Sca(ctx context.Context, parent *model.File, files []*model.File,
for k, v := range js.PeerDependencies {
js.Dependencies[k] = v
}
// 记录 resolutions
for k, v := range js.Resolutions {
k = k[strings.LastIndex(k, "/")+1:]
js.Dependencies[k] = v
}
js.File = f
if strings.Contains(f.Relpath(), "node_modules") {
nodeMap[dir] = js