From 5696017d9f204f5bca2aa93de0e87e692ef11d9a Mon Sep 17 00:00:00 2001 From: Ryan <39529072+ryndh@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:06:36 -0600 Subject: [PATCH] fix: provide support for `packages` when `dependencies` do not exist (package-lock v3) (#104) * Update version * Update CHANGELOG.md * lockfilev1 tree.js fix * work with node 12 * revert changelog.md --- lib/lockfileV1/tree.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lockfileV1/tree.js b/lib/lockfileV1/tree.js index d07cde3..7995499 100644 --- a/lib/lockfileV1/tree.js +++ b/lib/lockfileV1/tree.js @@ -21,7 +21,7 @@ const { module.exports = { buildYarnTree (nodeModulesTree, packageLock) { - const flattenedPackageLock = flattenPackageLock(packageLock.dependencies) + const flattenedPackageLock = flattenPackageLock(packageLock.dependencies || packageLock.packages) const tree = Object.keys(nodeModulesTree).reduce((tree, path) => { const nmEntry = nodeModulesTree[path] const { name } = nmEntry diff --git a/package.json b/package.json index b8956d0..ee3ecdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "synp", - "version": "1.9.10", + "version": "1.9.11", "description": "Convert yarn.lock to package-lock.json and vice versa", "keywords": [ "yarn",