-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nodejs): merge
Indirect
, Dev
, ExternalReferences
fields for…
… same deps from `package-lock.json` files v2 or later (#6356) Signed-off-by: knqyf263 <[email protected]> Co-authored-by: knqyf263 <[email protected]>
- Loading branch information
1 parent
ade033a
commit 258d153
Showing
5 changed files
with
202 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1516,4 +1516,89 @@ var ( | |
DependsOn: []string{"[email protected]"}, | ||
}, | ||
} | ||
|
||
npmV3WithSameDevAndNonDevLibs = []types.Library{ | ||
{ | ||
ID: "[email protected]", | ||
Name: "fsevents", | ||
Version: "1.2.9", | ||
Dev: true, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefOther, | ||
URL: "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", | ||
}, | ||
}, | ||
Locations: []types.Location{ | ||
{ | ||
StartLine: 18, | ||
EndLine: 37, | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "minimist", | ||
Version: "0.0.8", | ||
Indirect: false, | ||
Dev: false, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefOther, | ||
URL: "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", | ||
}, | ||
}, | ||
Locations: []types.Location{ | ||
{ | ||
StartLine: 38, | ||
EndLine: 43, | ||
}, | ||
{ | ||
StartLine: 68, | ||
EndLine: 72, | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "mkdirp", | ||
Version: "0.5.1", | ||
Indirect: true, | ||
Dev: true, | ||
Locations: []types.Location{ | ||
{ | ||
StartLine: 44, | ||
EndLine: 55, | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "node-pre-gyp", | ||
Version: "0.12.0", | ||
Indirect: true, | ||
Dev: true, | ||
Locations: []types.Location{ | ||
{ | ||
StartLine: 56, | ||
EndLine: 67, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
npmV3WithSameDevAndNonDevDeps = []types.Dependency{ | ||
{ | ||
ID: "[email protected]", | ||
DependsOn: []string{"[email protected]"}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
DependsOn: []string{"[email protected]"}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
DependsOn: []string{"[email protected]"}, | ||
}, | ||
} | ||
) |
74 changes: 74 additions & 0 deletions
74
pkg/dependency/parser/nodejs/npm/testdata/package-lock_v3_with-same-dev-and-non-dev.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"name": "5139", | ||
"version": "1.0.0", | ||
"lockfileVersion": 3, | ||
"requires": true, | ||
"packages": { | ||
"": { | ||
"name": "5139", | ||
"version": "1.0.0", | ||
"license": "ISC", | ||
"dependencies": { | ||
"minimist": "^0.0.8" | ||
}, | ||
"devDependencies": { | ||
"fsevents": "^1.2.9" | ||
} | ||
}, | ||
"node_modules/fsevents": { | ||
"version": "1.2.9", | ||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", | ||
"integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", | ||
"bundleDependencies": [ | ||
"node-pre-gyp" | ||
], | ||
"deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", | ||
"dev": true, | ||
"hasInstallScript": true, | ||
"os": [ | ||
"darwin" | ||
], | ||
"dependencies": { | ||
"node-pre-gyp": "^0.12.0" | ||
}, | ||
"engines": { | ||
"node": ">=4.0" | ||
} | ||
}, | ||
"node_modules/fsevents/node_modules/minimist": { | ||
"version": "0.0.8", | ||
"dev": true, | ||
"inBundle": true, | ||
"license": "MIT" | ||
}, | ||
"node_modules/fsevents/node_modules/mkdirp": { | ||
"version": "0.5.1", | ||
"dev": true, | ||
"inBundle": true, | ||
"license": "MIT", | ||
"dependencies": { | ||
"minimist": "0.0.8" | ||
}, | ||
"bin": { | ||
"mkdirp": "bin/cmd.js" | ||
} | ||
}, | ||
"node_modules/fsevents/node_modules/node-pre-gyp": { | ||
"version": "0.12.0", | ||
"dev": true, | ||
"inBundle": true, | ||
"license": "BSD-3-Clause", | ||
"dependencies": { | ||
"mkdirp": "^0.5.1" | ||
}, | ||
"bin": { | ||
"node-pre-gyp": "bin/node-pre-gyp" | ||
} | ||
}, | ||
"node_modules/minimist": { | ||
"version": "0.0.8", | ||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", | ||
"integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==" | ||
} | ||
} | ||
} |