Skip to main content
Glama

Xero MCP Server

parseArrayValues.ts740 B
export const parseArrayValues = (obj: any): any => { if (obj === null || obj === undefined) return obj; if (typeof obj === "string") { // Try to parse string that looks like an array if (obj.startsWith("[") && obj.endsWith("]")) { try { const parsed = JSON.parse(obj); // Recursively parse any array strings within the parsed result return parseArrayValues(parsed); } catch { return obj; } } return obj; } if (Array.isArray(obj)) { return obj.map((item) => parseArrayValues(item)); } if (typeof obj === "object") { return Object.fromEntries( Object.entries(obj).map(([key, value]) => [key, parseArrayValues(value)]) ); } return obj; };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/john-zhang-dev/xero-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server