mockoon
mockoon copied to clipboard
Add a custom helper for sorting array
Currently, Mockoon has array helpers like filter
and slice
. It would be ideal if a sort
helper could be added.
Discussion: https://github.com/mockoon/mockoon/discussions/1257
@255kb Please assign this to me.
We discussed a bit with @ajatkj and propose the following implementation with two helpers:
-
{{sort 'asc|desc'}}
for arrays of strings and numbers. -
{{sortBy 'keyname' 'asc|desc'}}
for arrays of objects.
📦 This was released in v8.3.0