export function sizeOfJson(object: any): number { // Convert the object to a JSON string const jsonString = JSON.stringify(object); // Get the length of the JSON string in bytes const bytes = new TextEncoder().encode(jsonString).length; return bytes; }