denoland / denoland/std

semver: satisfies function work incorrect on pre-release part

Open
#6,303 1 comment 0 reactions 0 assignees View on GitHub
bug needs triage
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

**Steps to Reproduce**

Run with Deno:
```console
~> 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 return `true`
- `satisfies(parse("v9.0.0-0"), parseRange(">=8.0.0-0"))` should return `true`
- `satisfies(parse("v9.0.0-alpha"), parseRange(">=8.0.0"))` should return `true`

**Environment**

- OS: Ubuntu 24.04.1 LTS
- deno version: 2.1.4
- std version: 1.0.3?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.