UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

18 lines 547 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.safelyStringifyJSON = safelyStringifyJSON; /** * Safely stringify a JSON object * * @param args - The arguments to pass to JSON.stringify * @returns An object containing both the stringified JSON and the error if there was one */ function safelyStringifyJSON(...args) { try { return { json: JSON.stringify(...args) }; } catch (e) { return { json: null, stringifyError: e }; } } //# sourceMappingURL=safelyStringifyJSON.js.map