• Safely stringify a JSON object

    Parameters

    • ...args: [value: any, replacer?: null | (string | number)[], space?: string | number]

      The arguments to pass to JSON.stringify

    Returns
        | { json: string; stringifyError?: undefined }
        | { json: null; stringifyError: unknown }

    An object containing both the stringified JSON and the error if there was one