From 26a8b0726ef3b94a9143135625a970dac92f948e Mon Sep 17 00:00:00 2001 From: justinwoo Date: Wed, 16 Aug 2023 17:32:32 +0300 Subject: [PATCH] don't use same object reference in shallow dep info 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 --- report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/report.js b/report.js index ee9c96f..34314df 100644 --- a/report.js +++ b/report.js @@ -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 }