mgol / check-dependencies

Checks if currently installed npm dependencies are installed in the exact same versions that are specified in package.json
MIT License
115 stars 30 forks source link

git urls can't handle a version range #12

Open elijahsmith opened 9 years ago

elijahsmith commented 9 years ago

when specifying a git url for the package (or, probably but not tested, a custom package name) the version check fails if it is a range (eg ~0.0.1). This is because it's being validated with semver.valid() which is intended to validate a specific version string, not a range.

I would suggest that neither case should use semver.valid(), as it's an additional amount of validation that doesn't get applied to a "regular" version string.

elijahsmith commented 9 years ago

(if you like the suggestion that special validation for git url / custom package versions, I'd be happy to submit a PR for that...)

mgol commented 9 years ago

PR welcome. :) Be sure to add a test.