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 numbers as Integer? #398
Comments
That's because some versions are labeled as x.y.z like in semver. |
Can't semver be parsed as integers?
|
Hi @canvasplay, regarding the type of Lines 68 to 70 in a88934f
|
Until now, the responsibility to properly convert string to number before comparing versions still lies on each app that consume this library.. but given how |
Why when retrieving os/browser/... version numbers are typed as string? Why not an Integer?
This question just came to my mind... Shouldn't it be the expected behavior?
Is more than probably that one using this library may need at some time to perform
<
or>
comparisons using those values.This looks very desirable from my point of view, but it also seems too much obvious...
Is this intentional? I don't understand all the regex in here... maybe there is a reason ;)
I just started to investigate it deep in the code and found this line:
ua-parser-js/src/ua-parser.js
Line 779 in a88934f
This is where I though the type conversion could be implemented...
But may I ask why the "deprecated" annotation in all "major" related lines?
Looks like this tool is focusing on being a regex-only tool. Isn't it?
Thanks in advance.
The text was updated successfully, but these errors were encountered: