mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
fix(outdated): retain strict semver specifier when updating (#27701)
Fixes https://github.com/denoland/deno/issues/27697 If it's a strict bound (e.g. `1.0.0` as opposed to `^1.0.0` or other), retain the strictness when we update
This commit is contained in:
parent
464ee9155e
commit
256950ddb6
10 changed files with 27 additions and 21 deletions
|
@ -280,9 +280,15 @@ fn choose_new_version_req(
|
|||
if preferred.version <= resolved?.version {
|
||||
return None;
|
||||
}
|
||||
let exact = if let Some(range) = dep.req.version_req.range() {
|
||||
range.0[0].start == range.0[0].end
|
||||
} else {
|
||||
false
|
||||
};
|
||||
Some(
|
||||
VersionReq::parse_from_specifier(
|
||||
format!("^{}", preferred.version).as_str(),
|
||||
format!("{}{}", if exact { "" } else { "^" }, preferred.version)
|
||||
.as_str(),
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue