Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for sorting an array of objects using myObject.sortKey #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laurenceks
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant