• Extracts JSON from string with lenient parsing rules to improve likelihood of successful extraction.

    Type Parameters

    • T = unknown

    Parameters

    • text: string
    • OptionalthrowOnBadJson: true

    Returns T

  • Extracts JSON from string with lenient parsing rules to improve likelihood of successful extraction.

    Type Parameters

    • T = unknown

    Parameters

    • text: string
    • OptionalthrowOnBadJson: false

    Returns T | null