Skip to content

Commit

Permalink
don't use same object reference in shallow dep info (#66)
Browse files Browse the repository at this point in the history
this causes us to create an invalid parent node that does not parse as a
valid request in the API, due to the shared grandparent node being
modified: https://github.com/scarf-sh/scarf-js/blob/8bade0e1b1ed705305e016f480beac36abef4cc0/report.js#L118-L128
  • Loading branch information
justinwoo authored Aug 16, 2023
1 parent 8bade0e commit ba916b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions report.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ async function getDependencyInfo (packageJSONOverride) {
}
const shallowDepInfo = {
scarf: { name: '@scarf/scarf', version: scarfPackageJSON.version },
parent: rootInfoToReport,
rootPackage: rootInfoToReport,
parent: { ...rootInfoToReport },
rootPackage: { ...rootInfoToReport },
anyInChainDisabled: false,
skippedTraversal: true
}
Expand Down

0 comments on commit ba916b8

Please sign in to comment.