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

unused property (tag) #20

Closed
bnb opened this issue Jan 26, 2022 · 2 comments
Closed

unused property (tag) #20

bnb opened this issue Jan 26, 2022 · 2 comments

Comments

@bnb
Copy link

bnb commented Jan 26, 2022

presently, upon outputting all data, it seems that the "tag" property is completely empty. is there any reason to keep it?

@dominykas
Copy link
Member

Looks like it comes from here:

nv/index.js

Lines 166 to 169 in 31c43b9

function splitVersion (ver) {
const [, major, minor, patch, tag] = /^v([0-9]*)\.([0-9]*)\.([0-9]*)(?:-([0-9A-Za-z-_]+))?/.exec(ver).map((n, i) => i < 4 ? parseInt(n, 10) : n || '')
return { major, minor, patch, tag }
}

I guess Node.js never used that, so it may not be necessary, but maybe that code needs to be replaced with semver.parse() anyways, given that semver is already a dep, and return the prerelease prop, however I'm not sure what was the original use case for tag here.

@wesleytodd
Copy link
Member

The tag (now prerelease) is used in canary builds. There is a test which covers this. See #33 for a fix and moving to use semver

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