1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Added unique_by function

This commit is contained in:
Santiago Lapresta
2014-05-12 01:37:27 +02:00
parent 022a418894
commit 41a093c1f2
2 changed files with 16 additions and 0 deletions

View File

@@ -664,6 +664,7 @@ static const char* const jq_builtins[] = {
"def sort_by(f): _sort_by_impl(map([f]));",
"def group_by(f): _group_by_impl(map([f]));",
"def unique: group_by(.) | map(.[0]);",
"def unique_by(f): group_by(f) | map(.[0]);",
"def max_by(f): _max_by_impl(map([f]));",
"def min_by(f): _min_by_impl(map([f]));",
#include "libm.h"