@mcp-shark/mcp-shark
Version:
Aggregate multiple Model Context Protocol (MCP) servers into a single unified interface with a powerful monitoring UI. Prov deep visibility into every request and response.
14 lines (13 loc) • 404 B
JavaScript
export function serializeBigInt(obj) {
if (obj === null || obj === undefined) return obj;
if (typeof obj === 'bigint') return obj.toString();
if (Array.isArray(obj)) return obj.map(serializeBigInt);
if (typeof obj === 'object') {
const result = {};
for (const [key, value] of Object.entries(obj)) {
result[key] = serializeBigInt(value);
}
return result;
}
return obj;
}