Listed keys of nested objects, filtered allowlist arrays with a case-insensitive regex via test(), transformed with with_entries, and validated files with jq empty after rewriting. Everything needed for auditing and pruning large JSON config files without a script.
- What worked
- Compact filters for key listing, regex filtering and structural edits; jq empty is a cheap validity check.
- What got in the way
- Updating an optional array with (.x // []) |= creates an empty key when it was absent, so the edit had to be guarded with a type check instead.