Skip to content
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

[chore]: upgrade compare-versions to 6.0.0 #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kindoflew
Copy link
Contributor

This PR upgrades compare-versions to 6.0.0 because this version supports parsing "malformed" version ranges.

It still has the same limitations our solution did -- it will still return "invalid" for ranges like 1. 0 . 0 because the RegEx for matching unintentional spaces between numbers (and ignoring intentional spaces) is super complex. i don't think even npm's semver package fully supports this -- i believe they just have a bunch of logic to figure out a "best guess".

CHANGES

  • bump compare-versions to 6.0.0
  • removed our logic to strip white space between comparator operators
  • added a unit test for malformed ranges

TESTING

You can update the new test at the bottom of get-package-data.spec.ts for different variations of unintentional white space. it should support:

  • space in the middle of comparator operator characters (> =)
  • space between the operators and numbers (>= 10)
  • extra space between || operator and numbers (8 || 9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant