Recursively remove fields with undefined values in object