chore: better docs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Simon
2026-01-13 14:14:56 +08:00
committed by GitHub
parent 526cb4dbb3
commit d5b8019fb1

View File

@@ -120,9 +120,9 @@ function safeJsonParse(input: any): any {
} }
/** /**
* Retrieve the JSON part from a string. * Extract and parse JSON from a string.
* - treat content between the first `{` and the last `}` as JSON. * - Treat content between the first `{` and the last `}` as JSON.
* - try to parse as JSON, return the parsed result if successful, otherwise return null. * - Try to parse that content as JSON and return the parsed value (object/array/primitive) if successful, otherwise return null.
*/ */
function retrieveJsonFromString(str: string): any { function retrieveJsonFromString(str: string): any {
try { try {