array-tree-filter efficiently filters a hierarchical array (tree structure) based on specified conditions. It traverses the array's nested objects, applying a user-defined filter function to each node. Matching nodes, and optionally their ancestors, are retained in the resulting filtered tree. This utility offers precise control over filtering complex, nested data, making it ideal for manipulating configuration structures, organizational charts, or any data represented as a tree. It simplifies extracting specific subtrees that meet given criteria.