compare-versions icon indicating copy to clipboard operation
compare-versions copied to clipboard

Fix Some Inconsistencies Between CommonJS and ES Modules Export

Open jvanderen1 opened this issue 2 years ago • 1 comments

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 in index.js
  • Added isWildcard check to compareStrings function in index.js
  • Added missing var within for loop in index.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.

jvanderen1 avatar Jan 17 '22 01:01 jvanderen1

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 .

omichelsen avatar Apr 07 '22 16:04 omichelsen

Thanks for the PR. This has now been fixed by v5 which ensures identical behavior between CJS and ESM versions.

omichelsen avatar Aug 26 '22 02:08 omichelsen