compare-versions
compare-versions copied to clipboard
Fix Some Inconsistencies Between CommonJS and ES Modules Export
Investigation
I found that the validate
test failed using the index.js
file because it was out of sync with index.mjs
. I added a few fixes to bridge the gap between the two files.
Changes
- Added additional validation logic in the
validate
function inindex.js
- Added
isWildcard
check tocompareStrings
function inindex.js
- Added missing
var
within for loop inindex.js
Extra
I was able to spot these because I am working on a version of compare-versions here. In this project, it would be contain a single source of truth which compiles to both CommonJS and ES Modules syntax. If anyone is interested, let me know.
Thank you for your work here. Given the inconsistency in maintaining two versions of this package, we're moving to TypeScript to generate the different output bundles we need. Please let me know if you have any feedback on #54 .
Thanks for the PR. This has now been fixed by v5 which ensures identical behavior between CJS and ESM versions.