Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit 6e767d7

Browse filesBrowse files
committed
audit: Ensure we don't mutate the shrinkwrap
PR-URL: #20389 Credit: @iarna Reviewed-By: @zkat
1 parent e3d8608 commit 6e767d7
Copy full SHA for 6e767d7

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎lib/install/audit.js

Copy file name to clipboardExpand all lines: lib/install/audit.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const url = require('url')
2222
const npa = require('npm-package-arg')
2323
const uuid = require('uuid')
2424
const ssri = require('ssri')
25+
const cloneDeep = require('lodash.clonedeep')
2526

2627
// used when scrubbing module names/specifiers
2728
const runId = uuid.v4()
@@ -100,7 +101,7 @@ function printFullReport (auditResult) {
100101
}
101102

102103
function generate (shrinkwrap, requires, diffs, install, remove) {
103-
const sw = Object.assign({}, shrinkwrap)
104+
const sw = cloneDeep(shrinkwrap)
104105
delete sw.lockfileVersion
105106
sw.requires = scrubRequires(requires)
106107
scrubDeps(sw.dependencies)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.