MCPcopy Create free account
hub / github.com/DTStack/Taier / handleResolveArray

Function handleResolveArray

taier-ui/scripts/getSwagger.js:114–128  ·  view source on GitHub ↗
(arr1, arr2)

Source from the content-addressed store, hash-verified

112 * @param {Array} arr2
113 */
114const handleResolveArray = (arr1, arr2) => {
115 arr2 = arr2.map((item) => {
116 // 合并data数据
117 const index = `${item.name} ${item.description}`;
118 const object = arr1.find((o) => o.name == index) || {};
119 item.data = item.data.concat(object.data || []);
120 return item;
121 });
122 // 去重
123 arr2 = arr2.map((item) => {
124 item.data = unique(item.data);
125 return item;
126 });
127 return arr2;
128};
129/**
130 * @description 反向解析字符串
131 * @param {string} str

Callers 1

handleFileDataFunction · 0.85

Calls 3

uniqueFunction · 0.85
findMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected