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

Function getText

packages/engine/src/modules/live-editing.ts:4–20  ·  view source on GitHub ↗
(node: DocNode, prop: string)

Source from the content-addressed store, hash-verified

2import { isJSExpression } from '@alilc/lowcode-utils';
3
4function getText(node: DocNode, prop: string) {
5 const p = node.getProp(prop, false);
6 if (!p || p.isUnset()) {
7 return null;
8 }
9 let v = p.getValue();
10 if (isJSExpression(v)) {
11 v = v.mock;
12 }
13 if (v == null) {
14 return null;
15 }
16 if (p.type === 'literal') {
17 return v;
18 }
19 return Symbol.for('not-literal');
20}
21
22export function liveEditingRule(target: EditingTarget) {
23 // for vision components specific

Callers 1

liveEditingRuleFunction · 0.85

Calls 4

getPropMethod · 0.65
isUnsetMethod · 0.65
getValueMethod · 0.65
isJSExpressionFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…