Skip to main content
Glama
getIsEditableSection.ts870 B
import { getNodeChildren, getNodeType } from '@intlayer/core'; import { type ContentNode, NodeType, type TypedNode } from '@intlayer/types'; export const getIsEditableSection = (section: ContentNode): boolean => { const children = getNodeChildren(section); const nodeType = getNodeType(section); if ( children && (nodeType === NodeType.ReactNode || nodeType === NodeType.File) ) { return true; } if (children && typeof (children as TypedNode).nodeType === 'string') { return getIsEditableSection( (children as TypedNode)[ (children as TypedNode).nodeType as keyof typeof section ] ); } return ( typeof children === 'string' || // String typeof children === 'number' || // Number typeof children === 'boolean' || // Boolean typeof children === 'undefined' // Undefined like nested field ); };

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/aymericzip/intlayer'

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