Member Junction
    Preparing search index...

    Function SerializeValidationErrors

    • Flattens a result's Errors array for transport.

      The input is unknown[] deliberately: BaseEntityResult.Errors is any[] and mixes ValidationErrorInfo instances with plain Errors. Entries carrying a string Message (the MJ shape) are kept — a missing or non-string Source is normalised to '', meaning "not tied to a field", and an unknown Type defaults to Failure. Entries without a Message (an Error has only lowercase message) are skipped: they have no field to paint and their text already reaches the client through CompleteMessage.

      Parameters

      • errors: readonly unknown[] | null | undefined

        The raw Errors array, or nothing.

      Returns SerializedValidationError[]

      Plain, JSON-safe entries; [] when there is nothing to carry.