NOTE: SemVer could have been the perfect library to use here but we can't use it since it's meant for Node only
compare-versions works for browser but seems way overkill, especially when the version format is very
standard, i.e. x.y.z, no prerelease, etc.
As such, we can use the lean comparison algo using localeCompare with numeric settings
Compare SemVer versions.
NOTE: SemVer could have been the perfect library to use here but we can't use it since it's meant for
Node
onlycompare-versions
works for browser but seems way overkill, especially when the version format is very standard, i.e.x.y.z
, no prerelease, etc. As such, we can use the lean comparison algo usinglocaleCompare
with numeric settingsSee https://stackoverflow.com/questions/55466274/simplify-semver-version-compare-logic/55466325#55466325 See omichelsen/compare-versions#45