Skip to main content
Glama
RhombusSystems

Rhombus MCP Server

Official
remove-nulls.ts893 B
/** * Remove all null values from an object. * @param obj - The object to remove null values from. * @returns A new object with all null values removed. */ export function removeNulls<T extends object>(obj: T): Partial<T> { // Create a shallow copy to avoid modifying the original object const copy = { ...obj }; for (const key in copy) { if (Object.prototype.hasOwnProperty.call(copy, key)) { const value = (copy as any)[key]; if (value === null) { delete (copy as any)[key]; } else if (typeof value === "object" && value !== null && !Array.isArray(value)) { // Recursively clean nested objects const cleaned = removeNulls(value); if (Object.keys(cleaned).length === 0) { delete (copy as any)[key]; } else { (copy as any)[key] = cleaned; } } } } return copy as Partial<T>; }

Latest Blog Posts

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/RhombusSystems/rhombus-node-mcp'

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