Skip to content

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

Open
laurenceks wants to merge 1 commit intooverset:masterfrom
laurenceks:sortkey
Open

Added support for sorting an array of objects using myObject.sortKey#36
laurenceks wants to merge 1 commit intooverset:masterfrom
laurenceks:sortkey

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