Validator.js: isSemVer returns false for valid versions

Created on 28 Mar 2020  路  4Comments  路  Source: validatorjs/validator.js

here are the few valid ones that are returned false by the current implementation

  • 1.0.0-alpha
  • 1.0.0-alpha.beta
  • 2.0.1-alpha.1227

I can probably raise a pr to fix this with few upvotes:)

All 4 comments

For sure, please send the PR 馃憤

@mum-never-proud Thanks for your using the package and the validator as well!

https://github.com/validatorjs/validator.js/pull/1246/files#diff-dc3a611aadde9b07998954c7eb5ac538R3698-R3700
Check the above lines of the my PR which integrated the isSemVer(str) validator into the project, I already included the first two semantic versions you stated: 1.0.0-alpha & 1.0.0-alpha.beta in the testcases as Valid cases (i.e. cases for which the validator returns true) and the tests are passing meaning the function correctly returns true for them!

  • This line: https://github.com/validatorjs/validator.js/pull/1246/files#diff-dc3a611aadde9b07998954c7eb5ac538R3715 , holds the 3rd test case you've pointed above, 2.0.1-alpha.1227 which I also included as valid case and again the tests passed which means the function correctly returned TRUE for this test-case as Well ..

Are you sure you correctly used the validator OR am I missing something here ?

CC @profnandaa

@hamzahejja -- thanks for checking this out. @mum-never-proud -- please confirm...

my bad looks like my mistake, now it's working maybe there might have been a problem while copying and pasting in the textbox

closing the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaxkodex picture jaxkodex  路  3Comments

Maxreglez picture Maxreglez  路  3Comments

frontendmonster picture frontendmonster  路  4Comments

woverton picture woverton  路  4Comments

RPDeshaies picture RPDeshaies  路  4Comments