MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / generateSimpleNode

Function generateSimpleNode

modules/code-generator/src/utils/nodeToJSX.ts:165–183  ·  view source on GitHub ↗
(
  nodeItem: IPublicTypeNodeSchema,
  scope: IScope,
  config?: NodeGeneratorConfig,
)

Source from the content-addressed store, hash-verified

163}
164
165function generateSimpleNode(
166 nodeItem: IPublicTypeNodeSchema,
167 scope: IScope,
168 config?: NodeGeneratorConfig,
169): CodePiece[] {
170 const basicParts = generateBasicNode(nodeItem, scope, config) || [];
171 const attrParts = generateAttrs(nodeItem, scope, config) || [];
172 const childrenParts: CodePiece[] = [];
173 if (nodeItem.children && config?.self) {
174 const childrenStr = config.self(nodeItem.children, scope);
175
176 childrenParts.push({
177 type: PIECE_TYPE.CHILDREN,
178 value: childrenStr,
179 });
180 }
181
182 return [...basicParts, ...attrParts, ...childrenParts];
183}
184
185function linkPieces(pieces: CodePiece[]): string {
186 const tagsPieces = pieces.filter((p) => p.type === PIECE_TYPE.TAG);

Callers 1

generateNodeSchemaFunction · 0.85

Calls 3

generateBasicNodeFunction · 0.85
generateAttrsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…