Skip to content

Custom sort function #269

@Edhilion

Description

@Edhilion

🚀 Feature Proposal

The sort feature only accept true or false values.
As it uses sortObject method, which allows passing a custom comparator, please allow users to pass their custom comparator.

-> other option : implement a comparator that makes no difference between standard, uppercase and special characters (ie 'a' and 'à' is the same letter, 'a' and 'A' is the same letter).

The comparator should follow the spec /** A typical comparator for sorting object keys */ type KeyComparator = (a: string, b: string) => number (see https://github.com/bevry/sortobject/blob/master/source/index.ts)

Motivation

a = A : this seems obvious to me
a = à : I'm French and we use the real words as keys (ie "Cliquez ici": "Click here" instead of "global.button.click": "Click here").

Example

sort: function(a, b) { return a; },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions