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

Version format isn't kept after incrementing #15

Closed
wtfiscrq opened this issue Sep 11, 2021 · 1 comment
Closed

Version format isn't kept after incrementing #15

wtfiscrq opened this issue Sep 11, 2021 · 1 comment

Comments

@wtfiscrq
Copy link

wtfiscrq commented Sep 11, 2021

When incrementing a version that has a custom format (i.e. v0.0.1), the format isn't kept (i.e. when incrementing major the new version is 1.0.0, without the v prefix).

Actual behavior:

const version = new SemVer("v0.0.1");

console.log(version);
// SemVer { raw: "v0.0.1", ... }

version.inc("major");

console.log(version);
// SemVer { raw: "1.0.0", ... }

Expected behavior:

const version = new SemVer("v0.0.1");

console.log(version);
// SemVer { raw: "v0.0.1", ... }

version.inc("major");

console.log(version);
// SemVer { raw: "v1.0.0", ... }

Not sure if the expected behavior for me is intended or not in terms of the scope of this module. Could you confirm, please?

If this is actually a "bug" I can open a PR.

Thanks in advance!

@justjavac
Copy link
Owner

It's not a bug: Is “v1.2.3” a semantic version?

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

2 participants