MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / findGroupForId

Function findGroupForId

src/utils/utils.js:224–241  ·  view source on GitHub ↗
(nowGroupId, templateList)

Source from the content-addressed store, hash-verified

222 }
223}
224export function findGroupForId (nowGroupId, templateList) {
225 // 根据组id获取组
226 let nowGroupTemplate = null
227 const find = (node) => { // 匿名函数防止this指向错误
228 node.some(item => {
229 const { type, elementId } = item.property
230 if (type === 'group' && elementId === nowGroupId) {
231 nowGroupTemplate = item;
232 return true
233 } if (type === 'group') {
234 // 去组里面找看是否为组嵌套
235 find(item.property.children)
236 }
237 })
238 }
239 find(templateList)
240 return nowGroupTemplate
241}
242/**
243* 求partArr数组中不包含allArr的数组
244* @param allArr:全数组

Callers 2

findFunction · 0.90
LayerFunction · 0.90

Calls 1

findFunction · 0.70

Tested by

no test coverage detected