Skip to main content
Glama
Children.js554 B
import { toChildArray } from 'preact'; const mapFn = (children, fn) => { if (children == null) return null; return toChildArray(toChildArray(children).map(fn)); }; // This API is completely unnecessary for Preact, so it's basically passthrough. export const Children = { map: mapFn, forEach: mapFn, count(children) { return children ? toChildArray(children).length : 0; }, only(children) { const normalized = toChildArray(children); if (normalized.length !== 1) throw 'Children.only'; return normalized[0]; }, toArray: toChildArray };

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/sadiuysal/mem0-mcp-server-ts'

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