#!/bin/sh
# This script is in the public domain.
# It removes empty arrays, objects and null values from the JSON data structure it is given.
exec jq 'walk(if type == "object" then with_entries(select(.value != [] and .value != {} and .value != null)) else . end)'
