Recursively flattens and processes an object by evaluating its properties and modifying them based on specific conditions. This function handles nested objects, removes function properties, converts moment objects to native Date objects, and leaves other primitive types as-is.

  • Parameters

    • data: any

      The input data to be flattened and processed. Expected to be an object, but non-object data will be returned as-is.

    Returns any

    • The processed data object, with all nested structures flattened and modifications applied. Non-object inputs are returned unchanged.