Simple wrapper method to JSON.parse that catches any errors and optionally logs them to the console.
This method is useful when you want to parse JSON but don't want to crash the application if the JSON is invalid.
Type Parameters
T = any
Parameters
jsonString: string
The JSON string to parse
logErrors: boolean = false
If true, parsing errors will be logged to console (default: false)
Simple wrapper method to JSON.parse that catches any errors and optionally logs them to the console. This method is useful when you want to parse JSON but don't want to crash the application if the JSON is invalid.