Swap sortKeys bool for keySort function - #315
Conversation
|
Thanks for the PR! Could you please rebase your commits on top of |
19933d7 to
8c97204
Compare
|
@jpsim this has been rebased. Thanks for taking a look! |
|
@jpsim let me know if anything else is required here. |
|
Hi, is this still mergeable? If so I'd love to merge it! |
|
Hello! I'm sorry that the communication failed in 2021. The project is under more active maintenance now. I'm not a fan of the source-breaking change of turning I do however appreciate the ability to custom-sort the keys. This is what I propose: Introduce a
If With this arrangement we can gain custom sorting without breaking backward compatibility with uses of the existing sort behavior. Thoughts? |
|
I don't write Swift professionally anymore or use this project, so I defer to you! |
(This is a breaking change, but I can make it non-breaking if preferred. It's just a lot more code repetition if non-breaking.)
This changes the
sortKeysoption to be a more flexiblekeySortfunction. The function defaults tonil—do not sort—but can be anything that sortsNodes. I ran into an issue where I wanted a custom sort on a mapping.