Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
audit: Ensure we don't mutate the shrinkwrap
PR-URL: #20389
Credit: @iarna
Reviewed-By: @zkat
  • Loading branch information
iarna authored and zkat committed Apr 20, 2018
1 parent f2386e1 commit 552ff6d64a5e3bcecb33b2a861c49a3396adad6d
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/install/audit.js
@@ -22,6 +22,7 @@ const url = require('url')
const npa = require('npm-package-arg')
const uuid = require('uuid')
const ssri = require('ssri')
const cloneDeep = require('lodash.clonedeep')

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

function generate (shrinkwrap, requires, diffs, install, remove) {
const sw = Object.assign({}, shrinkwrap)
const sw = cloneDeep(shrinkwrap)
delete sw.lockfileVersion
sw.requires = scrubRequires(requires)
scrubDeps(sw.dependencies)

0 comments on commit 552ff6d

Please sign in to comment.