Function parseAcceptLanguage

  • Parses an Accept-Language header string.

    Parameters

    • input: string

      The Accept-Language header string.

    • strict: boolean = false

      Determines if invalid values throw errors (true) or log warnings (false). Defaults to false.

    Returns AcceptLanguage[]

    An array of AcceptLanguage objects, sorted by weight. Invalid ranges are ignored and not returned.