Skip to content

parseJson()

parseJson<R, T>(str: string, __namedParameters: object): R | T

Parses a JSON string into an object. Has support for BigInt and falls back to a default value if parsing fails.

Type parameters

R = Record<string, unknown>

T = unknown

Parameters

str: string

__namedParameters= {}

__namedParameters.defaultValue?: unknown= {}

Returns

R | T