Options
All
  • Public
  • Public/Protected
  • All
Menu

A parser that extracts Agent data from a JSON body.

Hierarchy

Index

Constructors

constructor

Methods

canHandle

handle

handleSafe

  • Helper function that first runs the canHandle function followed by the handle function. Throws the error of the canHandle function if the data can't be handled, or returns the result of the handle function otherwise.

    Parameters

    Returns Promise<Agent>

    The result of the handle function of the handler.

Private isJSON

  • isJSON(mediaType: string): boolean

Private isValidAgent

  • isValidAgent(data: Dict<string>): asserts data is Agent