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) {