/**
 * Deserialize data received from WebSocket or EventStream.
 * Attempts to parse as JSON if the data looks like JSON, otherwise returns as-is.
 */
export const deserializeData = (data) => {
    if (data) {
        try {
            return JSON.parse(data);
        }
        catch {
            /* */
        }
    }
    return data;
};
//# sourceMappingURL=serialization.js.map