MCPcopy
hub / github.com/alibaba/lowcode-engine / isUseLoop

Function isUseLoop

packages/renderer-core/src/utils/is-use-loop.ts:6–20  ·  view source on GitHub ↗
(loop: null | any[] | IPublicTypeJSExpression, isDesignMode: boolean)

Source from the content-addressed store, hash-verified

4// 1.渲染模式下,loop 是数组,则按照数组长度渲染组件
5// 2.设计模式下,loop 需要长度大于 0,按照循环模式渲染,防止无法设计的情况
6export default function isUseLoop(loop: null | any[] | IPublicTypeJSExpression, isDesignMode: boolean): boolean {
7 if (isJSExpression(loop)) {
8 return true;
9 }
10
11 if (!isDesignMode) {
12 return true;
13 }
14
15 if (!Array.isArray(loop)) {
16 return false;
17 }
18
19 return loop.length > 0;
20}

Callers 2

BaseRendererClass · 0.85

Calls 1

isJSExpressionFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…