UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

16 lines (15 loc) 407 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dedupe = dedupe; 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; }