This commit is contained in:
pkoppstein authored and David Tolnay committed 2015-08-11 20:54:03 -07:00
1 parent c426d494f0
commit 16d0e528aa
2 files changed
+38

No files matched your search

+11
View File
@@ -1640,7 +1640,18 @@ static const char* const jq_builtins[] = {
" else .[2]"
" end"
" end;",
// # Apply f to composite entities recursively, and to atoms
"def walk(f):"
" . as $in"
" | if type == \"object\" then"
" reduce keys[] as $key"
" ( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f"
" elif type == \"array\" then map( walk(f) ) | f"
" else f"
" end;",
};
#undef LIBM_DDD_NO
#undef LIBM_DD_NO
#undef LIBM_DDD