Options
All
  • Public
  • Public/Protected
  • All
Menu

JSON utility to wrap and throw ImperativeErrors

export

Hierarchy

  • JSONUtils

Index

Methods

Methods

Static parse

  • parse<T>(data: string, failMessage?: string): T
  • Throw imperative error or return parsed data

    throws

    {ImperativeError} When there was a failure trying to parse a non-zero length data string.

    Type parameters

    • T: object

      type to parse

    Parameters

    • data: string

      string input data to parse as JSON

    • Optional failMessage: string

    Returns T

    • parsed object. If data length is 0 then this method will return a null object

Generated using TypeDoc