MCPcopy Create free account
hub / github.com/PaulleDemon/PyUIBuilder / removeDuplicateObjects

Function removeDuplicateObjects

src/utils/common.js:4–14  ·  view source on GitHub ↗
(array, key)

Source from the content-addressed store, hash-verified

2
3
4export function removeDuplicateObjects(array, key) {
5 const seen = new Set()
6
7 return array.filter(item => {
8 if (!seen.has(item[key])) {
9 seen.add(item[key])
10 return true
11 }
12 return false
13 })
14}
15
16
17/**

Callers 1

canvas.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected