Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Oct 15, 2024
1 parent d118983 commit 644fb75
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/modify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down

0 comments on commit 644fb75

Please sign in to comment.