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

Function deduplicateRef

packages/designer/src/component-actions.ts:13–19  ·  view source on GitHub ↗
(node: IPublicModelNode | null | undefined)

Source from the content-addressed store, hash-verified

11import { componentDefaults, legacyIssues } from './transducers';
12
13function deduplicateRef(node: IPublicModelNode | null | undefined) {
14 const currentRef = node?.getPropValue('ref');
15 if (currentRef) {
16 node?.setPropValue('ref', `${node.componentName.toLowerCase()}-${Math.random().toString(36).slice(2, 9)}`);
17 }
18 node?.children?.forEach(deduplicateRef);
19}
20
21export class ComponentActions {
22 private metadataTransducers: IPublicTypeMetadataTransducer[] = [];

Callers 1

actionMethod · 0.85

Calls 4

toStringMethod · 0.80
getPropValueMethod · 0.65
setPropValueMethod · 0.65
forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…