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

Function uniqueArray

public/iframe/lib/js/commonFun.js:69–78  ·  view source on GitHub ↗
(array, key)

Source from the content-addressed store, hash-verified

67
68 },
69 uniqueArray(array, key) {
70 // 数组去重
71 const map = new Map();
72 for (const item of array) {
73 if (!map.has(item[key])) {
74 map.set(item[key], item);
75 }
76 }
77 return [...map.values()];
78 },
79 apiUrlToAuto(url) {
80 // url中存在windowLocationOrigin的替换为自动获取
81 if (!url) return

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected