mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -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_req: String,
|
||||||
serialized_package_id: 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
|
self
|
||||||
.content
|
.content
|
||||||
.npm
|
.npm
|
||||||
.specifiers
|
.specifiers
|
||||||
.insert(serialized_package_req, serialized_package_id);
|
.insert(serialized_package_req, serialized_package_id);
|
||||||
self.has_content_changed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue