Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] how to match ANY version #360

Closed
Diokuz opened this issue Jan 3, 2021 · 2 comments
Closed

[QUESTION] how to match ANY version #360

Diokuz opened this issue Jan 3, 2021 · 2 comments

Comments

@Diokuz
Copy link

Diokuz commented Jan 3, 2021

In the docs it is written that * matches any version. But it doesn't matches pre-release versions.

In this issue there is an example, how to match some particular pre-release versions, but it is still does not works for any versions. For example,

» semver.satisfies('0.3.4-alpha4', '>=0.0.0-1')
« false

How to match any version in semver?

By any I mean any valid version, including 1.0.0 0.0.0-stub 2.1.3-rc45 etc.

I use semver@7.3.4 and node@v12.14.1

@dsbert
Copy link

dsbert commented Jan 16, 2021

Can't you just use valid(version)?

@lukekarrys
Copy link
Member

The docs were clarified in cb1ca1d to better explain this. If you have a specific version, you can match all prereleases of that version with ^1.0.0-a. That will match 1.0.0-beta, 1.0.0-canary, etc. See #329 for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants