MCPcopy Create free account
hub / github.com/ModelEngine-Group/app-platform / updateObject

Function updateObject

agent-flow/src/data/GraphOperator.js:141–166  ·  view source on GitHub ↗
(updates, config)

Source from the content-addressed store, hash-verified

139 };
140
141 const updateObject = (updates, config) => {
142 Object.keys(updates).forEach(k => {
143 if (Object.prototype.hasOwnProperty.call(updates, k)) {
144 const update = updates[k];
145 const correspondingConfig = config.value?.find(v => v.name === k);
146 if (!correspondingConfig) {
147 config.value = config.value || []; // 确保 config.value 是数组
148 config.value.push({
149 id: uuidv4(),
150 name: k,
151 from: FROM_TYPE.INPUT,
152 type: getTypeFromUpdates(update),
153 value: update,
154 });
155 return;
156 }
157
158 // 如果类型是reference,则不进行修改。
159 if (String(correspondingConfig.from ?? "").toLowerCase() === FROM_TYPE.REFERENCE.toLowerCase()) {
160 return;
161 }
162
163 updateConfig(correspondingConfig, update);
164 }
165 });
166 };
167
168 /**
169 * 获取画布数据.

Callers 1

updateConfigFunction · 0.85

Calls 4

getTypeFromUpdatesFunction · 0.85
updateConfigFunction · 0.70
callMethod · 0.65
findMethod · 0.65

Tested by

no test coverage detected