Combines CleanJSON and SafeJSONParse to clean, extract, and parse JSON in one operation.
This is a convenience function that first cleans the input string using CleanJSON to handle
various formats (double-escaped, markdown blocks, etc.), then safely parses the result.
Type Parameters
T = any
Parameters
inputString: string|null
The string to clean and parse, which may contain JSON in various formats
logErrors: boolean = false
If true, parsing errors will be logged to console (default: false)
Combines CleanJSON and SafeJSONParse to clean, extract, and parse JSON in one operation. This is a convenience function that first cleans the input string using CleanJSON to handle various formats (double-escaped, markdown blocks, etc.), then safely parses the result.