providerplaneai
    Preparing search index...
    • Robust best-effort JSON parser for LLM-generated text (Gemini/other LLMs). Handles:

      1. Full JSON (object or array)
      2. Newline-delimited JSON
      3. Adjacent JSON objects without newlines: {}{} Fallback: returns a normalized object with description and safety. Silently ignores unparseable fragments, but logs a warning once per parse.

      DO NOT use for:

      • config parsing
      • API responses
      • persistence
      • security-sensitive data

      Type Parameters

      • T = any

      Parameters

      • text: string

        LLM-generated text to parse

      Returns T[]

      Array of parsed objects or fallback