MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / hasIntersection

Function hasIntersection

frontend/packages/common/src/utils/permission.ts:28–38  ·  view source on GitHub ↗
(arr1: string[], set1: Set<string>)

Source from the content-addressed store, hash-verified

26}
27
28const hasIntersection = (arr1: string[], set1: Set<string>) => {
29 const arr2 = Array.from(set1)
30 const set = new Set(arr1.length > arr2.length ? arr2 : arr1)
31 const arr = arr1.length > arr2.length ? arr1 : arr2
32 for (const item of arr) {
33 if (set.has(item)) {
34 return true // 发现交集
35 }
36 }
37 return false // 没有交集
38}

Callers 1

checkAccessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected