Function JSONAttemptParse

  • Parse JSON but return the original string if it fails

    Type Parameters

    • T1
    • T2

    Parameters

    • json: T2

      JSON string to parse

    Returns T1 | T2

    Object if successful, original string otherwise