Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Just a minor tweak to semver so that 2010.09.27T21:43:52.491 is valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 28, 2010
1 parent 5dad0b9 commit d539115
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/semver.js
Expand Up @@ -3,7 +3,7 @@
// This implementation is a *hair* less strict in that it allows
// v1.2.3 things, and also tags that don't begin with a char.

var semver = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[0-9]+-?)?([a-zA-Z-][a-zA-Z0-9-]*)?"
var semver = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[0-9]+-?)?([a-zA-Z-][a-zA-Z0-9-\.:]*)?"
, expressions = exports.expressions =
{ parse : new RegExp("^\\s*"+semver+"\\s*$")
, parsePackage : new RegExp("^\\s*([^\/]+)[-@](" +semver+")\\s*$")
Expand Down

3 comments on commit d539115

@Sannis
Copy link
Contributor

@Sannis Sannis commented on d539115 Sep 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This against the semver rules, isn't it?

@isaacs
Copy link
Contributor Author

@isaacs isaacs commented on d539115 Sep 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh. So is the v? and the (-[0-9]+-?)?.

Semantics follow from actual expressions of concepts, not the other way around. Sometimes following the rules is just douchey and obnoxious.

@Sannis
Copy link
Contributor

@Sannis Sannis commented on d539115 Sep 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand :-)

Please sign in to comment.