Move const out of loop

This commit is contained in:
Sandro Jäckel 2024-12-07 01:02:04 +01:00
parent c6591510b4
commit 87a43c9b66
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -34,6 +34,7 @@ export async function extractPackageFile(
}
const flakeLock = flakeLockParsed.data;
const rootInputs = flakeLock.nodes['root'].inputs;
for (const [depName, flakeInput] of Object.entries(flakeLock.nodes)) {
// the root input is a magic string for the entrypoint and only references other flake inputs
@ -42,7 +43,6 @@ export async function extractPackageFile(
}
// skip all locked nodes which are not in the flake.nix and cannot be updated
const rootInputs = flakeLock.nodes['root'].inputs;
if (!rootInputs || !(depName in rootInputs)) {
logger.debug(
{ packageLockFile, error: flakeLockParsed.error },