JSON utility to wrap and throw ImperativeErrors

export

### Hierarchy

- JSONUtils

## Index

### Methods

- parse

## Methods

### Static parse

- parse<T>(data: string, failMessage?: string): T

- - Defined in @zowe/imperative/src/utilities/src/JSONUtils.ts:31

  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