Documentation
    Preparing search index...
    • Parses an array of "field:order" sort strings into a SortOptions object.

      Each entry must follow the format "fieldName" (defaults to asc) or "fieldName:asc" / "fieldName:desc". The fieldName is looked up in sortFieldsMap and mapped to the corresponding entity key.

      Type Parameters

      • T extends object

      Parameters

      • sortArray: string[] | undefined

        Array of sort strings, or undefined to return an empty result.

      • sortFieldsMap: Map<string, keyof T>

        Map from external field names (e.g., query-string names) to entity object keys.

      Returns SortOptions<T>

      A SortOptions object keyed by entity property.

      SortQueryRepeatError When the same field appears more than once.

      SortQueryInvalidFieldError When a field is not found in sortFieldsMap.

      SortQueryInvalidOrderError When the order value is not "asc" or "desc".