Options
All
  • Public
  • Public/Protected
  • All
Menu

A parser that extracts Agent data from a JSON body.

Hierarchy

Index

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>): assertsdata is Agent
  • Checks if all keys in the object are valid Agent keys and if all required keys are there.

    Parameters

    • data: Dict<string>

    Returns assertsdata is Agent