This is the official Sorting plugin for ZPE.
The plugin provides flexible and stable sorting functions for lists and maps, including numeric sorting, string sorting, natural sorting, and sorting by key.
Place zpe.lib.sort.jar in your ZPE native-plugins folder and restart ZPE.
You can also download with the ZULE Package Manager by using:
zpe --zule install zpe.lib.sort.jar
Full documentation, examples and API reference are available here:
View the complete documentation
import "zpe.lib.sort"
numbers = [5, 2, 10, 1]
print(sort(numbers))
names = ["ZPE", "apple", "Banana"]
print(sort(names, "string_ci"))
rows = [
[=>]{"name":"Jamie","age":34},
[=>]{"name":"Alice","age":12},
[=>]{"name":"Bob","age":12}
]
sorted = sort_by(rows, "age", "number")
print(sorted)
- sort – Sort a list.
- sort_by – Sort a list of maps by key.
- sort_map_keys – Return sorted map keys.
- sort_map_values – Return sorted map values.
"auto"(default)"number""string""string_ci""natural"
- Sorting is stable.
- Original data structures are not modified.
- Cross-platform (Windows, macOS, Linux).