MiSawa / xq

Pure rust implementation of jq
MIT License
318 stars 18 forks source link

Improve sort_by, min_by, max_by #104

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

This PR improves definitions of sort_by, min_by, and max_by. The sort_by(f) filter keeps the original order when f emits the same value. Also, fixes #40. The {min,max}_by(f) emits the element with {smaller,larger} index when f emits the same value.