MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / hasLoop

Method hasLoop

packages/core/src/document/node/node.ts:388–401  ·  view source on GitHub ↗

* has loop when 1. loop is validArray with length > 1 ; OR 2. loop is variable object * @return boolean, has loop config or not

()

Source from the content-addressed store, hash-verified

386 * @return boolean, has loop config or not
387 */
388 hasLoop() {
389 const value = this.getExtraProp('loop', false)?.getValue()
390 if (value === undefined || value === null) {
391 return false
392 }
393
394 if (Array.isArray(value)) {
395 return true
396 }
397 if (isJSExpression(value)) {
398 return true
399 }
400 return false
401 }
402
403 getProp(path: string, createIfNone = true) {
404 return this.props.query(path, createIfNone) || null

Callers 1

getRenderUnitInfoMethod · 0.80

Calls 3

getExtraPropMethod · 0.95
isJSExpressionFunction · 0.90
getValueMethod · 0.45

Tested by

no test coverage detected