Function parseAccept

  • Parses an Accept header string.


    • input: string

      The Accept header string.

    • strict: boolean = false

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

    Returns Accept[]

    An array of Accept objects, sorted by weight. Accept parts with invalid syntax are ignored and removed from the returned array.