mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -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
92ba46c384
commit
c6c747873f
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