Skip to main content
Glama
sanitization.ts1.08 kB
import type { Component, ComponentSet } from "@figma/rest-api-spec"; export interface SimplifiedComponentDefinition { id: string; key: string; name: string; componentSetId?: string; } export interface SimplifiedComponentSetDefinition { id: string; key: string; name: string; description?: string; } export function sanitizeComponents( aggregatedComponents: Record<string, Component>, ): Record<string, SimplifiedComponentDefinition> { return Object.fromEntries( Object.entries(aggregatedComponents).map(([id, comp]) => [ id, { id, key: comp.key, name: comp.name, componentSetId: comp.componentSetId, }, ]), ); } export function sanitizeComponentSets( aggregatedComponentSets: Record<string, ComponentSet>, ): Record<string, SimplifiedComponentSetDefinition> { return Object.fromEntries( Object.entries(aggregatedComponentSets).map(([id, set]) => [ id, { id, key: set.key, name: set.name, description: set.description, }, ]), ); }

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/Panzer-Jack/feuse-mcp'

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