brows3r — TypeScript API
    Preparing search index...

    Function fuzzyFilter

    • Filter and sort an array of items by their fuzzy match against query.

      • When query is empty the input is returned unchanged (no sort).
      • When query is non-empty, items whose getText does not fuzzy-match are dropped; the rest are sorted by descending score.

      getText lets callers fuzzy-match against arbitrary fields (a bucket name, an object key, the basename of an object key, etc.) without committing this helper to any one shape.

      Type Parameters

      • T

      Parameters

      • items: readonly T[]
      • query: string
      • getText: (item: T) => string

      Returns T[]