javascript-natural-sort
javascript-natural-sort copied to clipboard
Added support for sorting an array of objects using myObject.sortKey
Tweaked two lines in naturalSort.js so that it will look for a key called ".sortKey" and use that as a comparison value before falling back to comparing a/b itself. This allows an array of objects to be sorted by setting the object's .sortKey key to whatever value you want to sort without affecting original behaviour.