Returns a struct sorted by the top level keys in a structure.
Sorts using alphabetic or numeric sorting.
Lucee object methods reference
Object Method Struct.toSorted
Struct.toSorted([any sortTypeOrSortFunc,[string sortOrder,[boolean localeSensitive]]]):struct
Category
struct,sort
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
| Name | Type | Required | Default Value | Description |
|---|---|---|---|---|
| sortTypeOrSortFunc | any | No | text |
The following sort types are available: or a function to be used as a comparator function(key1, key2) |
| sortOrder | string | No | asc |
Sort direction: |
| localeSensitive | boolean | No | false | Use locale aware sort |