Function resolveRedirect

  • Resolves redirect for given URL ! For now, all of the SearchParams are ignored in resolving redirects, but they are passed to the target URL ! Fragments are also ignored

    Returns

    Tuple representing the target URL and the type of redirect or null if no redirect is found

    Parameters

    • redirectsList: Redirect[]

      List of all Redirects that are considered

    • currentUrl: string

      Current relative URL (ex. /products)

    • config: {
          redirectsLimit?: number;
          redirectsQueryParam?: string;
      } = {}
      • Optional redirectsLimit?: number
      • Optional redirectsQueryParam?: string

    Returns null | [redirectUrl: string, redirectCode: number]

Generated using TypeDoc