MCPcopy Create free account
hub / github.com/activejs/activejs / deDuplicate

Function deDuplicate

packages/core/src/utils/funcs.ts:151–157  ·  view source on GitHub ↗
(arr: T)

Source from the content-addressed store, hash-verified

149 * @internal please do not use.
150 */
151export function deDuplicate<T extends any[]>(arr: T): T {
152 if (typeof Set === 'function') {
153 return [...new Set(arr)] as T;
154 } else {
155 return arr.filter((x, i) => arr.indexOf(x) === i) as T;
156 }
157}
158
159/**
160 * @internal please do not use.

Callers 2

extras.spec.tsFile · 0.90
sanitizeIndicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected