Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Fix #83: Support for boolean sortObjectKeys prop #108

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

nhunzaker
Copy link
Contributor

Documentation suggests that passing a boolean to the sortObjectKeys prop should provide a default sorting method. This commit adds a type check to support both boolean and comparator functions.

Otherwise, invoking array.sort(true) yields:

TypeError: invalid Array.prototype.sort argument[


Fixes #83

Documentation suggests that passing a boolean to the sortObjectKeys
prop should provide a default sorting method. This commit adds a type
check to support both boolean and comparator functions.
@zalmoxisus
Copy link
Collaborator

Thanks for the contribution! I changed it to be a bit shorter. I think throwing when the argument is not boolean and not function is ok, helping debugging.

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

Successfully merging this pull request may close these issues.

2 participants