Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1270 add sort method #1415

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

ajatkj
Copy link
Contributor

@ajatkj ajatkj commented Jun 12, 2024

Technical implementation details

  • Add new helper methods for sort, sortBy and reverse.

Examples:
{{ sort (array 41 10 99) }} => '10,41,99'
{{ sortBy (array (object key1=10 key2=20) (object key1=30 key2=30) (object key1=15 key2=25)) "key1" }} => [ { "key2": 20, "key1": 10 }, { "key2": 25, "key1": 15 }, { "key2": 30, "key1": 30 } ]

Checklist

  • data migration added (@mockoon/commons)
  • commons lib tests added (@mockoon/commons)
  • commons-server lib tests added (@mockoon/commons-server)
  • CLI tests added (@mockoon/cli)
  • desktop UI automated tests added (@mockoon/desktop)

Closes #1270

@ajatkj ajatkj requested a review from 255kb as a code owner June 12, 2024 14:11
@ajatkj ajatkj force-pushed the feature/1270-add-sort-method branch from 47df54b to 9b42024 Compare June 13, 2024 03:33
Copy link
Member

@255kb 255kb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ajatkj for the PR!

Do you have time to update the docs too? That would be great, thanks :)

@255kb 255kb merged commit fdb5e2d into mockoon:main Jun 25, 2024
7 checks passed
@ajatkj
Copy link
Contributor Author

ajatkj commented Jun 25, 2024

Sure @255kb. I will do it in this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a custom helper for sorting array
2 participants