• Convert an object to a JSON string avoiding any circular references.

    Parameters

    • obj: any

      Object to convert to JSON

    • Optionalspace: number

      Format the JSON with spaces

    Returns string

    JSON string