mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
fix(lockfile): don't touch lockfile is npm specifiers are identical (#17973)
We were unconditionally inserting npm specifiers into the lockfile, marking it as "dirty" and requiring saving.
This commit is contained in:
parent
f1c756f589
commit
5149d07335
1 changed files with 6 additions and 1 deletions
|
@ -297,12 +297,17 @@ Use \"--lock-write\" flag to regenerate the lockfile at \"{}\".",
|
|||
serialized_package_req: String,
|
||||
serialized_package_id: String,
|
||||
) {
|
||||
let maybe_prev = self.content.npm.specifiers.get(&serialized_package_req);
|
||||
|
||||
if maybe_prev.is_none() || maybe_prev != Some(&serialized_package_id) {
|
||||
self.has_content_changed = true;
|
||||
}
|
||||
|
||||
self
|
||||
.content
|
||||
.npm
|
||||
.specifiers
|
||||
.insert(serialized_package_req, serialized_package_id);
|
||||
self.has_content_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue