semver icon indicating copy to clipboard operation
semver copied to clipboard

isValid Check Does Not Comply To Semver Spec

Open jonmchan opened this issue 8 years ago • 1 comments

The following strings should fail according to semver spec:

A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. http://semver.org/#spec-item-2

_invalidList = @[@"1", # missing minor and patch  
                           @"1.1", # missing patch
                           @"1.1.0001" # must not contain leading zeroes.
                          ];

isValid check should be made more strict to fall in line with the semver specification. Currently, each of these strings pass isValid validation.

jonmchan avatar Apr 08 '17 04:04 jonmchan

Thanks @jonmchan. I'm happy to accept a PR for this.

thisandagain avatar Apr 11 '17 15:04 thisandagain