deno_std
deno_std copied to clipboard
semver: satisfies function work incorrect on pre-release part
trafficstars
Describe the bug
Steps to Reproduce
Run with Deno:
~> deno --version
deno 2.1.4 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
~> deno
Deno 2.1.4
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import { parse, parseRange, satisfies } from "jsr:@std/semver@^1.0.3";
undefined
> satisfies(parse("v9.0.0-alpha"), parseRange(">=8.0.0-0"))
false
> satisfies(parse("v9.0.0-0"), parseRange(">=8.0.0-0"))
false
> satisfies(parse("v9.0.0"), parseRange(">=8.0.0"))
true
> satisfies(parse("v9.0.0-alpha"), parseRange(">=8.0.0"))
false
>
Expected behavior
satisfies(parse("v9.0.0-alpha"), parseRange(">=8.0.0-0"))should returntruesatisfies(parse("v9.0.0-0"), parseRange(">=8.0.0-0"))should returntruesatisfies(parse("v9.0.0-alpha"), parseRange(">=8.0.0"))should returntrue
Environment
- OS: Ubuntu 24.04.1 LTS
- deno version: 2.1.4
- std version: 1.0.3?
I saw there was a issue about the pre-release: #4300