diff options
author | 2023-10-11 20:41:12 -0700 | |
---|---|---|
committer | 2023-10-11 20:41:12 -0700 | |
commit | 755e16d962667621039a73e9d336b7ae16dcc00f (patch) | |
tree | b371b873a0c827ca13d862afbdc9930167db787a /src | |
parent | b1063edf3e76a2ef68d2ba3eff686932f742c77c (diff) | |
download | bun-755e16d962667621039a73e9d336b7ae16dcc00f.tar.gz bun-755e16d962667621039a73e9d336b7ae16dcc00f.tar.zst bun-755e16d962667621039a73e9d336b7ae16dcc00f.zip |
fix #6416 (#6430)
* make sure latest is checked after prerelease
* test and fix
* test for when latest matches prerelease
Diffstat (limited to 'src')
-rw-r--r-- | src/install/npm.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/install/npm.zig b/src/install/npm.zig index 75945ba74..4cf1c2b71 100644 --- a/src/install/npm.zig +++ b/src/install/npm.zig @@ -810,7 +810,14 @@ pub const PackageManifest = struct { if (this.findByDistTag("latest")) |result| { if (group.satisfies(result.version)) { - return result; + if (group.flags.isSet(Semver.Query.Group.Flags.pre)) { + if (left.version.order(result.version, this.string_buf, this.string_buf) == .eq) { + // if prerelease, use latest if semver+tag match range exactly + return result; + } + } else { + return result; + } } } |