Skip to main content
Recursively filters out empty values from nested objects and arrays. This function removes the following empty values:
  • null and undefined values
  • Empty strings (after trimming whitespace)
  • Empty arrays
  • Empty objects
  • Arrays and objects that become empty after filtering their contents

Examples

Arguments

input
Object
required
The input object containing the data to filter

Returns: T

Filtered data structure with empty values removed