import { ISchemaNode } from '../../../../models/base'; import { guid, LinkedTreeNode } from 'ts-toolset'; import { HtmlSchemaNode } from './types'; export function getSchemaRootNode(node?: ISchemaNode) { return new LinkedTreeNode(node || { isSchemaRootNode: true, id: guid() } as ISchemaNode); } export function getSchemaRootData(id?: string) { return { isSchemaRootNode: true, id: id || guid() } as ISchemaNode; } export function isShallowChild(node: HtmlSchemaNode) { return node.getNodeHeight() === 1; }