Hex Core JS
    Preparing search index...

    Function filterAndSortByQuery

    • Filters and sorts the given array using the given query. Filtering is done by matching the query in the style of matchQuery and sorting is done by how well each result matches the query in the style of compareWithQueryDesc.

      Type Parameters

      • T

      Parameters

      • query: string

        The search query to use.

      • array: T[]

        The array to filter and sort.

      • toString: (e: T) => string = ...

        A function to convert each element of the array to a string for matching against the query.

      Returns T[]