From 644fb754b1fa8077bbb58ae91477c937fdc37707 Mon Sep 17 00:00:00 2001 From: Joel Denning Date: Mon, 14 Oct 2024 20:44:22 -0600 Subject: [PATCH] Self review --- src/modify.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modify.js b/src/modify.js index 4e98ad0..8d80df4 100644 --- a/src/modify.js +++ b/src/modify.js @@ -138,14 +138,13 @@ exports.modifyService = function ( return modifyLock(env, (json) => { const map = getMapFromManifest(json); const oldUrl = map[serviceName]; - const oldIntegrity = json.integrity ? json.integrity[oldUrl] : null; + if (oldUrl && json.integrity) { + delete json.integrity[oldUrl]; + } if (remove) { delete map[serviceName]; delete map[serviceName + "/"]; - if (oldUrl && json.integrity) { - delete json.integrity[oldUrl]; - } } else { map[serviceName] = url; @@ -170,9 +169,6 @@ exports.modifyService = function ( json.integrity = json.integrity ?? {}; json.integrity[url] = integrity; } - if (oldUrl && json.integrity) { - delete json.integrity[oldUrl]; - } } const alphabetical = !!getConfig().alphabetical; if (alphabetical) {