Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Function matchRoute

    • the first route whose pattern fits path, with the params it captured

      Type Parameters

      • T extends { pattern: string }

      Parameters

      • routes: readonly T[]
      • path: string

      Returns { params: Params; route: T } | null

      • { params: Params; route: T }
        • params: Params

          the values the pattern captured from the path

        • route: T

          the first route whose pattern matches the path

      • null