UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

13 lines (12 loc) 312 B
export function dedupe(list, hasher = JSON.stringify) { const clone = []; const lookup = new Set(); for (const entry of list) { const hashed = hasher(entry); if (!lookup.has(hashed)) { clone.push(entry); lookup.add(hashed); } } return clone; }