keithamus / sort-package-json

Sort an Object or package.json based on the well-known package.json keys
MIT License
791 stars 83 forks source link

refactor: use natural sorting if no sort function is provided #262

Closed faustbrian closed 2 years ago

faustbrian commented 2 years ago

Resolves https://github.com/keithamus/sort-package-json/issues/261

Will add tests when I'm back at my laptop. Let me know if this is the right place to put it or if I should move it somewhere else.

faustbrian commented 2 years ago

@keithamus would you prefer if a separate function is created that only uses natural sorting for dependencies or that it falls back to natural sorting if no comparator is provided like now?