UNPKG

arvo-event-handler

Version:

A complete set of orthogonal event handler and orchestration primitives for Arvo based applications, featuring declarative state machines (XState), imperative resumables for agentic workflows, contract-based routing, OpenTelemetry observability, and in-me

19 lines (18 loc) 596 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getJsonSize = getJsonSize; var arvo_core_1 = require("arvo-core"); function getJsonSize(obj) { try { var jsonString = JSON.stringify(obj); // Use TextEncoder to get actual UTF-8 byte length return new TextEncoder().encode(jsonString).length; } catch (e) { (0, arvo_core_1.logToSpan)({ level: 'WARNING', message: "Error while calculating the size of the machine memory record. Error: ".concat(e.message), }); return -1; } }