- extractJson<T = unknown>(text: string, throwOnBadJson?: true): T
Parameters
- text: string
Optional
throwOnBadJson: true
Returns T
- extractJson<T = unknown>(text: string, throwOnBadJson?: false): T | null
Parameters
- text: string
Optional
throwOnBadJson: false
Returns T | null
Extracts JSON from string with lenient parsing rules to improve likelihood of successful extraction.